本文整理汇总了PHP中get_module_info函数的典型用法代码示例。如果您正苦于以下问题:PHP get_module_info函数的具体用法?PHP get_module_info怎么用?PHP get_module_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_module_info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: updateRelatedMeetingsGeocodeInfo
function updateRelatedMeetingsGeocodeInfo(&$bean, $event, $arguments)
{
// after_save
$jjwg_Maps = get_module_info('jjwg_Maps');
if ($jjwg_Maps->settings['logic_hooks_enabled']) {
$jjwg_Maps->updateRelatedMeetingsGeocodeInfo($bean);
}
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:8,代码来源:ContactsJjwg_MapsLogicHook.php
示例2: action_marker_detail_map
function action_marker_detail_map()
{
$this->view = 'marker_detail_map';
$jjwg_Markers = get_module_info('jjwg_Markers');
// Get the map object
if (is_guid($_REQUEST['id'])) {
$jjwg_Markers->retrieve($_REQUEST['id']);
}
$GLOBALS['loc'] = $jjwg_Markers->define_loc();
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:10,代码来源:controller.php
示例3: action_area_detail_map
function action_area_detail_map()
{
$this->view = 'area_detail_map';
$jjwg_Areas = get_module_info('jjwg_Areas');
// Get the map object
if (is_guid($_REQUEST['id'])) {
$jjwg_Areas->retrieve($_REQUEST['id']);
}
$GLOBALS['polygon'] = $jjwg_Areas->define_polygon();
$GLOBALS['loc'] = $jjwg_Areas->define_area_loc();
}
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:11,代码来源:controller.php
示例4: deleteRelationship
function deleteRelationship(&$bean, $event, $arguments)
{
// after_relationship_delete
// $arguments['module'], $arguments['related_module'], $arguments['id'] and $arguments['related_id']
if ($this->jjwg_Maps->settings['logic_hooks_enabled']) {
$focus = get_module_info($arguments['module']);
if (!empty($arguments['id'])) {
$focus->retrieve($arguments['id']);
$focus->custom_fields->retrieve();
$this->jjwg_Maps->updateGeocodeInfo($focus, true);
if ($focus->jjwg_maps_address_c != $focus->fetched_row['jjwg_maps_address_c']) {
$focus->save(false);
}
}
}
}
开发者ID:ghermans,项目名称:SuiteCRM,代码行数:16,代码来源:ProjectJjwg_MapsLogicHook.php
示例5: deleteRelationship
function deleteRelationship(&$bean, $event, $arguments)
{
// after_relationship_delete
$GLOBALS['log']->info(__METHOD__ . ' $arguments: ' . print_r($arguments, true));
// $arguments['module'], $arguments['related_module'], $arguments['id'] and $arguments['related_id']
$jjwg_Maps = get_module_info('jjwg_Maps');
if ($jjwg_Maps->settings['logic_hooks_enabled']) {
$focus = get_module_info($arguments['module']);
if (!empty($arguments['id'])) {
$focus->retrieve($arguments['id']);
$focus->custom_fields->retrieve();
$jjwg_Maps->updateGeocodeInfo($focus, true);
if ($focus->jjwg_maps_address_c != $focus->fetched_row['jjwg_maps_address_c']) {
$focus->save(false);
}
}
}
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:18,代码来源:OpportunitiesJjwg_MapsLogicHook.php
示例6: settings_run
function settings_run()
{
global $session;
$op = httpget('op');
$category = stripslashes(rawurldecode(httpget('cat'))) ?: 'Account';
page_header("Settings - {$category}");
switch ($op) {
case 'save':
$accounts = db_prefix('accounts');
$post = httpallpost();
unset($post['showFormTabIndex']);
foreach ($post as $key => $val) {
$post[$key] = stripcslashes($val);
}
$post['oldvalues'] = json_decode($post['oldvalues'], true);
foreach ($post['oldvalues'] as $key => $val) {
$post['oldvalues'][$key] = stripslashes($val);
}
$post = modulehook('prefs-change', $post);
if ($post['return'] != '') {
$return = $post['return'];
unset($post['return']);
}
//Fix template changes.
if (md5(md5($post['oldpass'])) == $session['user']['password'] && $post['newpass'] != '') {
require_once 'lib/systemmail.php';
$newPass = md5(md5($post['newpass']));
db_query("UPDATE {$accounts}\n SET password = '{$newPass}'\n WHERE acctid = '{$session['user']['acctid']}'");
systemmail($session['user']['acctid'], 'Account Settings', "`@Your password was changed successfully!");
}
unset($post['newpass']);
unset($post['oldpass']);
foreach ($post as $key => $val) {
if ($key == 'bio' && $val != $post['oldvalues']['bio']) {
$session['user']['bio'] = $val;
} else {
if (!is_array($val) && $val != $post['oldvalues'][$key]) {
if (strpos($key, '__user') || strpos($key, '__check')) {
$moduleKey = explode('__', $key);
set_module_pref($moduleKey[1], $val, $moduleKey[0]);
unset($moduleKey);
} else {
$session['user']['prefs'][$key] = $val;
}
}
}
}
$prefs = @serialize($session['user']['prefs']);
db_query("UPDATE {$accounts} SET prefs = '{$prefs}'\n WHERE acctid = '{$session['user']['acctid']}'");
redirect("runmodule.php?module=settings&cat={$return}&save=true");
addnav('Go back', 'runmodule.php?module=settings');
break;
default:
$modules = db_prefix('modules');
$userprefs = db_prefix('module_userprefs');
$rewrite = trim(get_module_setting('rewrite'));
$rewrite = json_decode($rewrite, true);
$languages = getsetting('serverlanguages', 'en, English');
$prefs = $session['user']['prefs'];
$prefs['bio'] = $session['user']['bio'];
$prefs['template'] = $_COOKIE['template'] ?: getsetting('defaultskin', 'jade.htm');
$prefs['email'] = $session['user']['emailaddress'];
$prefsFormat = ['Account' => ['bio' => 'Short biography, textarea', 'newpass' => 'New password, password', 'oldpass' => 'If you are changing your password, type your old one, password', 'email' => 'Email, text'], 'Display' => ['template' => 'Skin, theme', 'language' => 'Which language do you prefer?, enum, ' . $languages, 'timestamp' => 'Show timestamps in commentary?, enum, 0, None, 1, Real Time, 2, Relative Time'], 'Game Behavior' => ['emailonmail' => 'Receive emails when you receive a mail?, bool', 'systemmail' => 'Receive emails for system messages?, bool', 'Be sure to check your email\'s spam folder and add our email as a trusted sender!, note', 'dirtyemail' => 'Allow profanity in mail?, bool', 'timeoffset' => sprintf_translate('Hours to offset time (currently %s)?, int', date($prefs['timeformat'], strtotime('now') + $prefs['timeoffset'] * 3600)), 'ihavenocheer' => 'Disable holiday text?, bool', 'nojump' => 'Disable jumping to the commentary when posting or refreshing?, bool']];
if (count(explode(',', $languages)) < 3) {
unset($prefs['Display']['language']);
}
$prefsFormat = modulehook('prefs-format', $prefsFormat);
$prefsTemp = [];
$modulesFound = [];
$sql = db_query("SELECT modulename, formalname FROM {$modules}\n WHERE infokeys LIKE '%|prefs|%'\n AND active = 1\n ORDER BY modulename");
while ($row = db_fetch_assoc($sql)) {
$formal = $row['formalname'];
$modulesFound[$row['modulename']] = true;
if (module_status($row['modulename']) == MODULE_FILE_NOT_PRESENT) {
foreach ($rewrite as $key => $moduleName) {
if ($moduleName == $formal || strpos($key, $row['modulename']) !== false) {
unset($rewrite[$key]);
}
}
set_module_setting('rewrite', json_encode($rewrite));
} else {
$prefsTemp[$formal] = get_module_info($row['modulename'])['prefs'];
}
unset($prefsTemp[$formal][0]);
foreach ($prefsTemp[$formal] as $setting => $description) {
$description = explode('|', $description)[0];
if (strpos($setting, 'user_') === false) {
unset($prefsTemp[$formal][$setting]);
} else {
$structuredKey = "{$row['modulename']}__{$setting}";
if ($rewrite[$structuredKey] != $formal) {
$prefsTemp[$rewrite[$structuredKey]][$structuredKey] = $description;
} else {
$prefsTemp[$formal][$structuredKey] = $description;
}
unset($prefsTemp[$formal][$setting]);
}
}
if (count($prefsTemp[$formal]) == 0) {
unset($prefsTemp[$formal]);
//.........这里部分代码省略.........
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:101,代码来源:settings.php
示例7: saveVardefs
protected function saveVardefs($basepath, $installDefPrefix, $relationshipName, $vardefs)
{
mkdir_recursive("{$basepath}/vardefs/");
$GLOBALS['log']->debug(get_class($this) . "->saveVardefs(): vardefs =" . print_r($vardefs, true));
foreach ($vardefs as $moduleName => $definitions) {
// find this module's Object name - the object name, not the module name, is used as the key in the vardefs...
if (isset($GLOBALS['beanList'][$moduleName])) {
$module = get_module_info($moduleName);
$object = $module->object_name;
} else {
$object = $moduleName;
}
$filename = "{$basepath}/vardefs/{$moduleName}.php";
foreach ($definitions as $definition) {
$GLOBALS['log']->debug(get_class($this) . "->saveVardefs(): saving the following to {$filename}" . print_r($definition, true));
write_array_to_file('dictionary["' . $object . '"]["fields"]["' . $definition['name'] . '"]', $definition, $filename, 'a');
}
$installDefs[$moduleName] = array('from' => "{$installDefPrefix}/relationships/vardefs/{$moduleName}.php", 'to_module' => $moduleName);
}
$GLOBALS['log']->debug(get_class($this) . "->saveVardefs(): installDefs =" . print_r($installDefs, true));
return $installDefs;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:22,代码来源:AbstractRelationships.php
示例8: db_prefix
// Default tabbed config to true
if (!isset($prefs['tabconfig'])) {
$prefs['tabconfig'] = 1;
}
// Okay, allow modules to add prefs one at a time.
// We are going to do it this way to *ensure* that modules don't conflict
// in namespace.
$sql = "SELECT modulename FROM " . db_prefix("modules") . " WHERE infokeys LIKE '%|prefs|%' AND active=1 ORDER BY modulename";
$result = db_query($sql);
$everfound = 0;
$foundmodules = array();
$msettings = array();
$mdata = array();
while ($row = db_fetch_assoc($result)) {
$module = $row['modulename'];
$info = get_module_info($module);
if (count($info['prefs']) <= 0) {
continue;
}
$tempsettings = array();
$tempdata = array();
$found = 0;
while (list($key, $val) = each($info['prefs'])) {
$isuser = preg_match("/^user_/", $key);
$ischeck = preg_match("/^check_/", $key);
if (is_array($val)) {
$v = $val[0];
$x = explode("|", $v);
$val[0] = $x[0];
$x[0] = $val;
} else {
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:prefs.php
示例9: action_map_markers
/**
* action map_markers
* Google Maps - Output the Map Markers
*/
function action_map_markers()
{
header_remove('X-Frame-Options');
$this->view = 'map_markers';
// Define globals for use in the view.
$this->bean->map_center = array();
$this->bean->map_markers = array();
$this->bean->map_markers_groups = array();
$this->bean->custom_markers = array();
$this->bean->custom_areas = array();
// Create New Sugar_Smarty Object
$this->sugarSmarty = new Sugar_Smarty();
$this->sugarSmarty->assign("mod_strings", $GLOBALS['mod_strings']);
$this->sugarSmarty->assign("app_strings", $GLOBALS['app_strings']);
$this->sugarSmarty->assign('app_list_strings', $GLOBALS['app_list_strings']);
$this->sugarSmarty->assign('moduleListSingular', $GLOBALS['app_list_strings']['moduleListSingular']);
$this->sugarSmarty->assign('moduleList', $GLOBALS['app_list_strings']['moduleList']);
//echo '<pre>';
//var_dump($_REQUEST);
// Related Map Record Defines the Map
if (!empty($_REQUEST['record']) || !empty($_REQUEST['relate_id']) && !empty($_REQUEST['relate_module']) || !empty($_REQUEST['quick_address']) && !empty($_REQUEST['display_module'])) {
// If map 'record' then define map details from current module.
if (@is_guid($_REQUEST['record'])) {
// Get the map object
$map = get_module_info($GLOBALS['currentModule']);
$map->retrieve($_REQUEST['record']);
// Define map variables
$map_parent_type = $map->parent_type;
$map_parent_id = $map->parent_id;
$map_module_type = $map->module_type;
$map_unit_type = $map->unit_type;
$map_distance = $map->distance;
} else {
if (@(is_guid($_REQUEST['relate_id']) && !empty($_REQUEST['relate_module']))) {
// Define map variables
$map_parent_type = $_REQUEST['relate_module'];
$map_parent_id = $_REQUEST['relate_id'];
$map_module_type = !empty($_REQUEST['display_module']) ? $_REQUEST['display_module'] : $_REQUEST['relate_module'];
$map_distance = !empty($_REQUEST['distance']) ? $_REQUEST['distance'] : $this->settings['map_default_distance'];
$map_unit_type = !empty($_REQUEST['unit_type']) ? $_REQUEST['unit_type'] : $this->settings['map_default_unit_type'];
} else {
if (!empty($_REQUEST['quick_address']) && !empty($_REQUEST['display_module'])) {
// Define map variables / No Parent
$map_parent_type = null;
$map_parent_id = null;
$map_module_type = !empty($_REQUEST['display_module']) ? $_REQUEST['display_module'] : $_REQUEST['relate_module'];
$map_distance = !empty($_REQUEST['distance']) ? $_REQUEST['distance'] : $this->settings['map_default_distance'];
$map_unit_type = !empty($_REQUEST['unit_type']) ? $_REQUEST['unit_type'] : $this->settings['map_default_unit_type'];
}
}
}
// Define display object, note - 'Accounts_Members' is a special display type
$this->display_object = $map_module_type == 'Accounts_Members' ? get_module_info('Accounts') : get_module_info($map_module_type);
$mod_strings_display = return_module_language($GLOBALS['current_language'], $this->display_object->module_name);
$mod_strings_display = array_merge($mod_strings_display, $GLOBALS['mod_strings']);
// If relate module/id object
if (!empty($map_parent_type) && !empty($map_parent_id)) {
// Define relate objects
$this->relate_object = get_module_info($map_parent_type);
$this->relate_object->retrieve($map_parent_id);
$mod_strings_related = return_module_language($GLOBALS['current_language'], $this->relate_object->module_name);
$mod_strings_related = array_merge($mod_strings_related, $GLOBALS['mod_strings']);
// Get the Relate object Assoc Data
$where_conds = $this->relate_object->table_name . ".id = '" . $map_parent_id . "'";
$query = $this->relate_object->create_new_list_query("" . $this->relate_object->table_name . ".assigned_user_id", $where_conds, array(), array(), 0, '', false, $this->relate_object, false);
//var_dump($query);
$relate_result = $this->bean->db->query($query);
$relate = $this->bean->db->fetchByAssoc($relate_result);
// Add Relate (Center Point) Marker
$this->bean->map_center = $this->getMarkerData($map_parent_type, $relate, true, $mod_strings_related);
// Define Center Point
$center_lat = $this->relate_object->jjwg_maps_lat_c;
$center_lng = $this->relate_object->jjwg_maps_lng_c;
} else {
// Geocode 'quick_address'
$aInfo = $this->bean->getGoogleMapsGeocode($_REQUEST['quick_address'], false, true);
// If not status 'OK', then fail here and exit. Note: Inside of iFrame
if (!empty($aInfo['status']) && $aInfo['status'] != 'OK' && preg_match('/[A-Z\\_]/', $aInfo['status'])) {
echo '<br /><br /><div><b>' . $GLOBALS['mod_strings']['LBL_MAP_LAST_STATUS'] . ': ' . $aInfo['status'] . '</b></div><br /><br />';
exit;
}
//var_dump($aInfo);
// Define Marker Data
$aInfo['name'] = $_REQUEST['quick_address'];
$aInfo['id'] = 0;
$aInfo['module'] = $map_module_type == 'Accounts_Members' ? 'Accounts' : $map_module_type;
$aInfo['address'] = $_REQUEST['quick_address'];
$aInfo['jjwg_maps_address_c'] = $_REQUEST['quick_address'];
$aInfo['jjwg_maps_lat_c'] = $aInfo['lat'];
$aInfo['jjwg_maps_lng_c'] = $aInfo['lng'];
$this->bean->map_center = $this->getMarkerData($map_parent_type, $aInfo, true);
// Define Center Point
$center_lat = $aInfo['lat'];
$center_lng = $aInfo['lng'];
}
//var_dump($aInfo);
//.........这里部分代码省略.........
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:101,代码来源:controller.php
示例10: install_module
function install_module($module, $force = true)
{
global $mostrecentmodule, $session;
$name = $session['user']['name'];
if (!$name) {
$name = '`@System`0';
}
require_once "lib/sanitize.php";
if (modulename_sanitize($module) != $module) {
output("Error, module file names can only contain alpha numeric characters and underscores before the trailing .php`n`nGood module names include 'testmodule.php', 'joesmodule2.php', while bad module names include, 'test.module.php' or 'joes module.php'`n");
return false;
} else {
// If we are forcing an install, then whack the old version.
if ($force) {
$sql = "DELETE FROM " . db_prefix("modules") . " WHERE modulename='{$module}'";
db_query($sql);
}
// We want to do the inject so that it auto-upgrades any installed
// version correctly.
if (injectmodule($module, true)) {
// If we're not forcing and this is already installed, we are done
if (!$force && is_module_installed($module)) {
return true;
}
$info = get_module_info($module);
//check installation requirements
if (!module_check_requirements($info['requires'])) {
output("`\$Module could not installed -- it did not meet its prerequisites.`n");
return false;
} else {
$keys = "|" . join(array_keys($info), "|") . "|";
$sql = "INSERT INTO " . db_prefix("modules") . " (modulename,formalname,moduleauthor,active,filename,installdate,installedby,category,infokeys,version,download,description) VALUES ('{$mostrecentmodule}','" . addslashes($info['name']) . "','" . addslashes($info['author']) . "',0,'{$mostrecentmodule}.php','" . date("Y-m-d H:i:s") . "','" . addslashes($name) . "','" . addslashes($info['category']) . "','{$keys}','" . addslashes($info['version']) . "','" . addslashes($info['download']) . "', '" . addslashes($info['description']) . "')";
db_query($sql);
$fname = $mostrecentmodule . "_install";
if (isset($info['settings']) && count($info['settings']) > 0) {
foreach ($info['settings'] as $key => $val) {
if (is_array($val)) {
$x = explode("|", $val[0]);
} else {
$x = explode("|", $val);
}
if (isset($x[1])) {
$x[1] = trim($x[1]);
set_module_setting($key, $x[1]);
debug("Setting {$key} to default {$x[1]}");
}
}
}
if ($fname() === false) {
return false;
}
output("`^Module installed. It is not yet active.`n");
invalidatedatacache("inject-{$mostrecentmodule}");
massinvalidate("moduleprepare");
return true;
}
} else {
output("`\$Module could not be injected.");
output("Module not installed.");
output("This is probably due to the module file having a parse error or not existing in the filesystem.`n");
return false;
}
}
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:64,代码来源:modules.php
示例11: __construct
function __construct($subpanelName, $moduleName)
{
$GLOBALS['log']->debug(get_class($this) . "->__construct({$subpanelName} , {$moduleName})");
$this->_subpanelName = $subpanelName;
$this->_moduleName = $moduleName;
$module = BeanFactory::getBean($moduleName);
// BEGIN ASSERTIONS
if (empty($module)) {
sugar_die(get_class($this) . ": Modulename {$moduleName} is not a Deployed Module");
}
// END ASSERTIONS
$this->historyPathname = 'custom/history/modules/' . $moduleName . '/subpanels/' . $subpanelName . '/' . self::HISTORYFILENAME;
$this->_history = new History($this->historyPathname);
require_once 'include/SubPanel/SubPanelDefinitions.php';
// retrieve the definitions for all the available subpanels for this module from the subpanel
$spd = new SubPanelDefinitions($module);
// Get the lists of fields already in the subpanel and those that can be added in
// Get the fields lists from an aSubPanel object describing this subpanel from the SubPanelDefinitions object
$this->_viewdefs = array();
$this->_fielddefs = array();
$this->_language = '';
if (!empty($spd->layout_defs)) {
if (array_key_exists(strtolower($subpanelName), $spd->layout_defs['subpanel_setup'])) {
//First load the original defs from the module folder
$originalSubpanel = $spd->load_subpanel($subpanelName, false, true);
$this->_fullFielddefs = $originalSubpanel ? $originalSubpanel->get_list_fields() : array();
$this->_mergeFielddefs($this->_fielddefs, $this->_fullFielddefs);
$this->_aSubPanelObject = $spd->load_subpanel($subpanelName);
// now check if there is a restored subpanel in the history area - if there is, then go ahead and use it
if (file_exists($this->historyPathname)) {
// load in the subpanelDefOverride from the history file
$GLOBALS['log']->debug(get_class($this) . ": loading from history");
require $this->historyPathname;
$this->_viewdefs = $layout_defs;
} else {
$this->_viewdefs = $this->_aSubPanelObject->get_list_fields();
}
// don't attempt to access the template_instance property if our subpanel represents a collection, as it won't be there - the sub-sub-panels get this value instead
if (!$this->_aSubPanelObject->isCollection()) {
$this->_language = $this->_aSubPanelObject->template_instance->module_dir;
}
// Retrieve a copy of the bean for the parent module of this subpanel - so we can find additional fields for the layout
$subPanelParentModuleName = $this->_aSubPanelObject->get_module_name();
$beanListLower = array_change_key_case($GLOBALS['beanList']);
if (!empty($subPanelParentModuleName) && isset($beanListLower[strtolower($subPanelParentModuleName)])) {
$subPanelParentModule = get_module_info($subPanelParentModuleName);
// Run through the preliminary list, keeping only those fields that are valid to include in a layout
foreach ($subPanelParentModule->field_defs as $key => $def) {
$key = strtolower($key);
if (AbstractMetaDataParser::validField($def)) {
if (!isset($def['label'])) {
$def['label'] = $def['name'];
}
$this->_fielddefs[$key] = $def;
}
}
}
$this->_mergeFielddefs($this->_fielddefs, $this->_viewdefs);
}
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:61,代码来源:DeployedSubpanelImplementation.php
示例12: get_module_install_status
}
}
$install_status = get_module_install_status();
$uninstalled = $install_status['uninstalledmodules'];
reset($uninstalled);
$invalidmodule = array("version" => "", "author" => "", "category" => "Invalid Modules", "download" => "", "description" => "", "invalid" => true);
while (list($key, $modulename) = each($uninstalled)) {
$row = array();
//test if the file is a valid module or a lib file/whatever that got in, maybe even malcode that does not have module form
$modulenamelower = strtolower($modulename);
$file = strtolower(file_get_contents("modules/{$modulename}.php"));
if (strpos($file, $modulenamelower . "_getmoduleinfo") === false || strpos($file, $modulenamelower . "_install") === false || strpos($file, $modulenamelower . "_uninstall") === false) {
//here the files has neither do_hook nor getinfo, which means it won't execute as a module here --> block it + notify the admin who is the manage modules section
$moduleinfo = array_merge($invalidmodule, array("name" => $modulename . ".php " . appoencode(translate_inline("(`\$Invalid Module! Contact Author or check file!`0)"))));
} else {
$moduleinfo = get_module_info($modulename);
}
//end of testing
$row['installed'] = false;
$row['active'] = false;
$row['category'] = $moduleinfo['category'];
$row['modulename'] = $modulename;
$row['formalname'] = $moduleinfo['name'];
$row['description'] = $moduleinfo['description'];
$row['moduleauthor'] = $moduleinfo['author'];
$row['invalid'] = isset($moduleinfo['invalid']) ? $moduleinfo['invalid'] : false;
if (!array_key_exists($row['category'], $all_modules)) {
$all_modules[$row['category']] = array();
}
$all_modules[$row['category']][$row['modulename']] = $row;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:31,代码来源:installer_stage_8.php
示例13: define
<?php
// translator ready
// addnews ready
// mail ready
define("ALLOW_ANONYMOUS", true);
define("OVERRIDE_FORCED_NAV", true);
require_once "lib/http.php";
require_once "common.php";
require_once "lib/dump_item.php";
require_once "lib/modules.php";
require_once "lib/villagenav.php";
if (injectmodule(httpget('module'), httpget('admin') ? true : false)) {
$info = get_module_info(httpget('module'));
if (!isset($info['allowanonymous'])) {
$allowanonymous = false;
} else {
$allowanonymous = $info['allowanonymous'];
}
if (!isset($info['override_forced_nav'])) {
$override_forced_nav = false;
} else {
$override_forced_nav = $info['override_forced_nav'];
}
do_forced_nav($allowanonymous, $override_forced_nav);
$starttime = getmicrotime();
$fname = $mostrecentmodule . "_run";
tlschema("module-{$mostrecentmodule}");
$fname();
$endtime = getmicrotime();
if ($endtime - $starttime >= 1.0 && $session['user']['superuser'] & SU_DEBUG_OUTPUT) {
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:runmodule.php
示例14: search_filter_rel_info
function search_filter_rel_info(&$focus, $tar_rel_module, $relationship_name)
{
$rel_list = array();
foreach ($focus->relationship_fields as $rel_key => $rel_value) {
if ($rel_value == $relationship_name) {
$temp_bean = get_module_info($tar_rel_module);
echo $focus->{$rel_key};
$temp_bean->retrieve($focus->{$rel_key});
if ($temp_bean->id != "") {
$rel_list[] = $temp_bean;
return $rel_list;
}
}
}
return $rel_list;
//end function search_filter_rel_info
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:17,代码来源:utils.php
示例15: set_module_visibility
/**
* Set module visibility in all courses
* @param int $moduleId id of the module
* @param bool $visibility true for visible, false for invisible
* @return array( backlog, boolean )
* backlog object
* boolean true if suceeded, false otherwise
* @todo remove the need of the Backlog and use Exceptions instead
*/
function set_module_visibility($moduleId, $visibility)
{
$backlog = new Backlog();
$success = true;
$tbl = claro_sql_get_main_tbl();
$moduleInfo = get_module_info($moduleId);
$tool_id = get_course_tool_id($moduleInfo['label']);
$sql = "SELECT `code` FROM `" . $tbl['course'] . "`";
$course_list = claro_sql_query_fetch_all($sql);
$default_visibility = false;
foreach ($course_list as $course) {
if (false === set_module_visibility_in_course($tool_id, $course['code'], $visibility)) {
$success = false;
$backlog->failure(get_lang('Cannot change module visibility in %course', array('%course' => $course['code'])));
break;
}
}
return array($backlog, $success);
}
开发者ID:rhertzog,项目名称:lcs,代码行数:28,代码来源:manage.lib.php
示例16: defineMapsAddress
/**
* Define Maps Address
*
* Address Relationship Notes:
* Account(address)
* Contact(address)
* Lead(address)
* Taget/Prospect(address)
* Opportunity to Account(address)
* Case 'account_id' to Account(address)
* or Case to Account(address)
* Project to Account(address)
* or Project to Opportunity to Account(address)
* Meeting - based on Flex Relate
*
* @param $object_name signular object name
* @param $display fetched row
*/
function defineMapsAddress($object_name, $display)
{
$address = false;
$fields = false;
$parent = null;
$parent_type = '';
$parent_id = '';
$GLOBALS['log']->debug(__METHOD__ . ' START');
$GLOBALS['log']->debug(__METHOD__ . ' $object_name: ' . $object_name);
$GLOBALS['log']->debug(__METHOD__ . ' $display: ' . print_r($display, true));
// Field naming is different in some modules.
// Some modules do not have an address, so a related account needs to be found first.
if ($object_name == 'Account') {
$address = $this->defineMapsFormattedAddress($display, $this->settings['geocode_modules_to_address_type']['Accounts']);
} elseif ($object_name == 'Contact') {
$address = $this->defineMapsFormattedAddress($display, $this->settings['geocode_modules_to_address_type']['Contacts']);
} elseif ($object_name == 'Lead') {
$address = $this->defineMapsFormattedAddress($display, $this->settings['geocode_modules_to_address_type']['Leads']);
} elseif ($object_name == 'Prospect') {
$address = $this->defineMapsFormattedAddress($display, $this->settings['geocode_modules_to_address_type']['Prospects']);
} elseif ($object_name == 'User') {
$address = $this->defineMapsFormattedAddress($display, $this->settings['geocode_modules_to_address_type']['Users']);
} elseif ($object_name == 'Opportunity') {
// Find Account - Assume only one related Account
$query = "SELECT accounts.*, accounts_cstm.* FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c " . " LEFT JOIN accounts_opportunities ON accounts.id = accounts_opportunities.account_id AND accounts_opportunities.deleted = 0 " . " WHERE accounts.deleted = 0 AND accounts_opportunities.opportunity_id = '" . $display['id'] . "'";
$GLOBALS['log']->debug(__METHOD__ . ' Opportunity to Account');
$result = $this->db->limitQuery($query, 0, 1);
$fields = $this->db->fetchByAssoc($result);
if (!empty($fields)) {
$address = $this->defineMapsFormattedAddress($fields, $this->settings['geocode_modules_to_address_type']['Opportunities']);
}
} elseif (in_array($object_name, array('aCase', 'Case'))) {
// Find Account from Case (account_id field)
$query = "SELECT accounts.*, accounts_cstm.* FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c " . " WHERE accounts.deleted = 0 AND id = '" . $display['account_id'] . "'";
$GLOBALS['log']->debug(__METHOD__ . ' Case to Account');
$result = $this->db->limitQuery($query, 0, 1);
$fields = $this->db->fetchByAssoc($result);
// If Account is not found; Find many to many Account - Assume only one related Account
if (empty($fields)) {
$query = "SELECT accounts.*, accounts_cstm.* FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c " . " LEFT JOIN accounts_cases ON accounts.id = accounts_cases.account_id AND accounts_cases.deleted = 0 " . " WHERE accounts.deleted = 0 AND accounts_cases.case_id = '" . $display['id'] . "'";
$GLOBALS['log']->debug(__METHOD__ . ' Case to Accounts');
$result = $this->db->limitQuery($query, 0, 1);
$fields = $this->db->fetchByAssoc($result);
}
if (!empty($fields)) {
$address = $this->defineMapsFormattedAddress($fields, $this->settings['geocode_modules_to_address_type']['Cases']);
}
} elseif ($object_name == 'Project') {
// Check relationship from Project to Account - Assume only one related Account
$query = "SELECT accounts.*, accounts_cstm.* FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c " . " LEFT JOIN projects_accounts ON accounts.id = projects_accounts.account_id AND projects_accounts.deleted = 0 " . " WHERE accounts.deleted = 0 AND projects_accounts.project_id = '" . $display['id'] . "'";
$GLOBALS['log']->debug(__METHOD__ . ' Project to Account');
$result = $this->db->limitQuery($query, 0, 1);
$fields = $this->db->fetchByAssoc($result);
if (empty($fields)) {
// Find Opportunity - Assuming that the Project was created from an Opportunity (Closed Won) Detial View
$query = "SELECT opportunities.*, opportunities_cstm.* FROM opportunities LEFT JOIN opportunities_cstm ON opportunities.id = opportunities_cstm.id_c " . " LEFT JOIN projects_opportunities ON opportunities.id = projects_opportunities.opportunity_id AND projects_opportunities.deleted = 0 " . " WHERE opportunities.deleted = 0 AND projects_opportunities.project_id = '" . $display['id'] . "'";
$GLOBALS['log']->debug(__METHOD__ . ' Project to Opportunity');
$result = $this->db->limitQuery($query, 0, 1);
$opportunity = $this->db->fetchByAssoc($result);
// Find Account - Assume only one related Account for the Opportunity
$query = "SELECT accounts.*, accounts_cstm.* FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c " . " LEFT JOIN accounts_opportunities ON accounts.id = accounts_opportunities.account_id AND accounts_opportunities.deleted = 0 " . " WHERE accounts.deleted = 0 AND accounts_opportunities.opportunity_id = '" . $opportunity['id'] . "'";
$GLOBALS['log']->debug(__METHOD__ . ' Opportunity to Account');
$result = $this->db->limitQuery($query, 0, 1);
$fields = $this->db->fetchByAssoc($result);
}
if (!empty($fields)) {
$address = $this->defineMapsFormattedAddress($fields, $this->settings['geocode_modules_to_address_type']['Project']);
}
} elseif ($object_name == 'Meeting') {
// Find Meeting - Flex Relate Fields: meetings.parent_type and meetings.parent_id
$query = "SELECT meetings.*, meetings_cstm.* FROM meetings LEFT JOIN meetings_cstm ON meetings.id = meetings_cstm.id_c " . " WHERE meetings.deleted = 0 AND meetings.id = '" . $display['id'] . "'";
$GLOBALS['log']->debug(__METHOD__ . ' Meeting');
$result = $this->db->limitQuery($query, 0, 1);
$meeting = $this->db->fetchByAssoc($result);
$parent_type = $meeting['parent_type'];
$parent_id = $meeting['parent_id'];
$GLOBALS['log']->debug(__METHOD__ . ' Meeting $parent_type: ' . $parent_type);
$GLOBALS['log']->debug(__METHOD__ . ' Meeting $parent_id: ' . $parent_id);
// If the parent_type is valid module to geocode
if (in_array($parent_type, array_keys($this->settings['valid_geocode_modules'])) && !empty($parent_id) && $parent_type != 'Meeting') {
// Define parent object
$parent = get_module_info($parent_type);
//.........这里部分代码省略.........
开发者ID:ghermans,项目名称:SuiteCRM,代码行数:101,代码来源:jjwg_Maps.php
示例17: get_lang
$summary = get_lang('Module installation failed');
$dialogBox->error(Backlog_Reporter::report($summary, $details));
}
} else {
$summary = get_lang('Module installation failed');
$details = get_lang('Module directory not found');
$dialogBox->error(Backlog_Reporter::report($summary, $details));
}
} else {
$summary = get_lang('Module installation failed');
$details = get_lang('Missing module directory');
$dialogBox->error(Backlog_Reporter::report($summary, $details));
}
}
if (empty($typeReq) && $module_id) {
$moduleInfo = get_module_info($module_id);
$typeReq = $moduleInfo['type'];
}
//----------------------------------
// FIND INFORMATION
//----------------------------------
// $moduleTypeList = claro_get_module_types();
// $moduleTypeList = array_merge($moduleTypeList, array_keys($typeLabel));
switch ($typeReq) {
case 'applet':
$sqlSelectType = " D.`id` AS dock_id, " . "\n" . " D.`name` AS dockname," . "\n";
$sqlJoinType = " LEFT JOIN `" . $tbl_dock . "` AS D " . "\n" . " ON D.`module_id`= M.id " . "\n";
$orderType = "";
break;
case 'tool':
$sqlSelectType = " CT.`id` AS courseToolId, " . "\n" . " CT.`icon` AS icon," . "\n" . " CT.`script_url` AS script_url," . "\n" . " CT.`def_rank` AS rank," . "\n" . " CT.`def_access` AS visibility," . "\n";
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:module_list.php
|
请发表评论