当前位置: 首页>>代码示例>>PHP>>正文


PHP ACLController::filterModuleList方法代码示例

本文整理汇总了PHP中ACLController::filterModuleList方法的典型用法代码示例。如果您正苦于以下问题:PHP ACLController::filterModuleList方法的具体用法?PHP ACLController::filterModuleList怎么用?PHP ACLController::filterModuleList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ACLController的用法示例。


在下文中一共展示了ACLController::filterModuleList方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_system_tabs

 function get_system_tabs()
 {
     global $moduleList;
     static $system_tabs_result = null;
     // if the value is not already cached, then retrieve it.
     if (empty($system_tabs_result)) {
         $administration = new Administration();
         $administration->retrieveSettings('MySettings');
         if (isset($administration->settings) && isset($administration->settings['MySettings_tab'])) {
             $tabs = $administration->settings['MySettings_tab'];
             $trimmed_tabs = trim($tabs);
             //make sure serialized string is not empty
             if (!empty($trimmed_tabs)) {
                 $tabs = base64_decode($tabs);
                 $tabs = unserialize($tabs);
                 //Ensure modules saved in the prefences exist.
                 foreach ($tabs as $id => $tab) {
                     if (!in_array($tab, $moduleList)) {
                         unset($tabs[$id]);
                     }
                 }
                 ACLController::filterModuleList($tabs);
                 $tabs = $this->get_key_array($tabs);
                 $system_tabs_result = $tabs;
             } else {
                 $system_tabs_result = $this->get_key_array($moduleList);
             }
         } else {
             $system_tabs_result = $this->get_key_array($moduleList);
         }
     }
     return $system_tabs_result;
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:33,代码来源:TabController.php

示例2: SugarFeedDashlet

 function SugarFeedDashlet($id, $def = null)
 {
     global $current_user, $app_strings, $app_list_strings;
     require 'modules/SugarFeed/metadata/dashletviewdefs.php';
     $this->myItemsOnly = false;
     parent::DashletGeneric($id, $def);
     $this->myItemsOnly = false;
     $this->isConfigurable = true;
     $this->hasScript = true;
     $pattern = array();
     $pattern[] = "/-/";
     $pattern[] = "/[0-9]/";
     $replacements = array();
     $replacements[] = '';
     $replacements[] = '';
     $this->idjs = preg_replace($pattern, $replacements, $this->id);
     // Add in some default categories.
     $this->categories['ALL'] = translate('LBL_ALL', 'SugarFeed');
     // Need to get the rest of the active SugarFeed modules
     $module_list = SugarFeed::getActiveFeedModules();
     // Translate the category names
     if (!is_array($module_list)) {
         $module_list = array();
     }
     foreach ($module_list as $module) {
         if ($module == 'UserFeed') {
             // Fake module, need to translate specially
             $this->categories[$module] = translate('LBL_USER_FEED', 'SugarFeed');
         } else {
             $this->categories[$module] = $app_list_strings['moduleList'][$module];
         }
     }
     // Need to add the external api's here
     $this->externalAPIList = ExternalAPIFactory::getModuleDropDown('SugarFeed', true);
     if (!is_array($this->externalAPIList)) {
         $this->externalAPIList = array();
     }
     foreach ($this->externalAPIList as $apiObj => $apiName) {
         $this->categories[$apiObj] = $apiName;
     }
     if (empty($def['title'])) {
         $this->title = translate('LBL_HOMEPAGE_TITLE', 'SugarFeed');
     }
     if (!empty($def['rows'])) {
         $this->displayRows = $def['rows'];
     }
     if (!empty($def['categories'])) {
         $this->selectedCategories = $def['categories'];
     }
     if (!empty($def['userfeed_created'])) {
         $this->userfeed_created = $def['userfeed_created'];
     }
     $this->searchFields = $dashletData['SugarFeedDashlet']['searchFields'];
     $this->columns = $dashletData['SugarFeedDashlet']['columns'];
     $catCount = count($this->categories);
     ACLController::filterModuleList($this->categories, false);
     if (count($this->categories) < $catCount) {
         if (!empty($this->selectedCategories)) {
             ACLController::filterModuleList($this->selectedCategories, true);
         } else {
             $this->selectedCategories = array_keys($this->categories);
             unset($this->selectedCategories[0]);
         }
     }
     $this->seedBean = new SugarFeed();
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:66,代码来源:SugarFeedDashlet.php

示例3: get_user_module_list

 function get_user_module_list($user)
 {
     $GLOBALS['log']->info('Begin: SoapHelperWebServices->get_user_module_list');
     global $app_list_strings, $current_language;
     $app_list_strings = return_app_list_strings_language($current_language);
     $modules = query_module_access_list($user);
     ACLController::filterModuleList($modules, false);
     global $modInvisList, $modInvisListActivities;
     foreach ($modInvisList as $invis) {
         $modules[$invis] = 'read_only';
     }
     if (isset($modules['Calendar']) || $modules['Activities']) {
         foreach ($modInvisListActivities as $invis) {
             $modules[$invis] = $invis;
         }
     }
     $actions = ACLAction::getUserActions($user->id, true);
     foreach ($actions as $key => $value) {
         if (isset($value['module']) && $value['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED) {
             if ($value['module']['access']['aclaccess'] == ACL_ALLOW_DISABLED) {
                 unset($modules[$key]);
             } else {
                 $modules[$key] = 'read_only';
             }
             // else
         } else {
             $modules[$key] = '';
         }
         // else
     }
     // foreach
     $GLOBALS['log']->info('End: SoapHelperWebServices->get_user_module_list');
     return $modules;
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:34,代码来源:SoapHelperWebService.php

示例4: ACLFilter

 function ACLFilter()
 {
     ACLController::filterModuleList($GLOBALS['moduleList']);
 }
开发者ID:switcode,项目名称:SuiteCRM,代码行数:4,代码来源:SugarApplication.php

示例5: get_user_module_list

function get_user_module_list($user)
{
    global $app_list_strings, $current_language, $beanList, $beanFiles;
    $app_list_strings = return_app_list_strings_language($current_language);
    $modules = query_module_access_list($user);
    ACLController::filterModuleList($modules, false);
    global $modInvisList;
    foreach ($modInvisList as $invis) {
        $modules[$invis] = 'read_only';
    }
    $actions = ACLAction::getUserActions($user->id, true);
    foreach ($actions as $key => $value) {
        if (isset($value['module']) && $value['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED) {
            if ($value['module']['access']['aclaccess'] == ACL_ALLOW_DISABLED) {
                unset($modules[$key]);
            } else {
                $modules[$key] = 'read_only';
            }
            // else
        } else {
            $modules[$key] = '';
        }
        // else
    }
    // foreach
    //Remove all modules that don't have a beanFiles entry associated with it
    foreach ($modules as $module_name => $module) {
        if (isset($beanList[$module_name])) {
            $class_name = $beanList[$module_name];
            if (empty($beanFiles[$class_name])) {
                unset($modules[$module_name]);
            }
        } else {
            unset($modules[$module_name]);
        }
    }
    return $modules;
}
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:38,代码来源:SoapHelperFunctions.php

示例6: ACLFilter

 function ACLFilter()
 {
     ACLController::filterModuleList($GLOBALS['moduleList']);
     ACLController::filterModuleList($GLOBALS['modInvisListActivities']);
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:5,代码来源:SugarApplication.php

示例7: clean_string

//if the theme is changed
$_SESSION['theme_changed'] = false;
if (isset($_REQUEST['usertheme'])) {
    $_SESSION['theme_changed'] = true;
    $_SESSION['authenticated_user_theme'] = clean_string($_REQUEST['usertheme']);
    $theme = clean_string($_REQUEST['usertheme']);
}
//if the language is changed
if (isset($_REQUEST['userlanguage'])) {
    $_SESSION['theme_changed'] = true;
    $_SESSION['authenticated_user_language'] = clean_string($_REQUEST['userlanguage']);
    $current_language = clean_string($_REQUEST['userlanguage']);
}
$GLOBALS['log']->debug('Current theme is: ' . $theme);
ACLController::filterModuleList($moduleList);
ACLController::filterModuleList($modInvisListActivities);
//TODO move this code into $theme/header.php so that we can be within the <DOCTYPE xxx> and <HTML> tags.
if (empty($_REQUEST['to_pdf']) && empty($_REQUEST['to_csv'])) {
    echo '<script type="text/javascript" src="include/javascript/cookie.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<link rel="stylesheet" type="text/css" media="all" href="themes/' . $theme . '/calendar-win2k-cold-1.css?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '">';
    echo '<script>jscal_today = ' . 1000 * strtotime($timedate->handle_offset(gmdate('Y-m-d H:i:s', gmmktime()), 'Y-m-d H:i:s')) . '; if(typeof app_strings == "undefined") app_strings = new Array();</script>';
    echo '<script type="text/javascript" src="jscalendar/calendar.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script type="text/javascript" src="jscalendar/lang/calendar-en.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script type="text/javascript" src="jscalendar/calendar-setup_3.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script src="include/javascript/yui/YAHOO.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script src="include/javascript/yui/log.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script src="include/javascript/yui/dom.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script src="include/javascript/yui/event.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script src="include/javascript/yui/animation.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script src="include/javascript/yui/connection.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    echo '<script src="include/javascript/yui/dragdrop.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:index.php

示例8: globalSearchSpot

 /**
  * This function is used to hand off the global search to the built-in SugarSearchEngine (aka SugarSpot)
  * @param $api ServiceBase The API class of the request
  * @param $args array The arguments array passed in from the API
  * @param $searchEngine SugarSearchEngine The SugarSpot search engine created using the Factory in the caller
  * @param $options array An array of options to pass through to the search engine, they get translated to the $searchOptions array so you can see exactly what gets passed through
  * @return array Two elements, 'records' the list of returned records formatted through FormatBean, and 'next_offset' which will indicate to the user if there are additional records to be returned.
  */
 public function globalSearchSpot(ServiceBase $api, array $args, $searchEngine, array $options)
 {
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $searchOptions = array('modules' => $options['moduleList'], 'current_module' => $options['primaryModule'], 'return_beans' => true, 'my_items' => $options['my_items'], 'favorites' => $options['favorites'], 'orderBy' => $options['orderBy'], 'fields' => $options['fieldFilters'], 'selectFields' => $options['selectFields'], 'limitPerModule' => $options['limitPerModule'], 'allowEmptySearch' => true, 'distinct' => 'DISTINCT', 'return_beans' => true);
     if (isset($options['deleted'])) {
         $searchOptions['deleted'] = $options['deleted'];
     }
     $multiModule = false;
     if (empty($options['moduleList']) || count($options['moduleList']) == 0 || count($options['moduleList']) > 1) {
         $multiModule = true;
     }
     if (empty($options['moduleList'])) {
         require_once 'modules/ACL/ACLController.php';
         $usa = new UnifiedSearchAdvanced();
         $moduleList = $usa->getUnifiedSearchModules();
         // get the module names [array keys]
         $moduleList = array_keys($moduleList);
         // filter based on User Access if Blank
         $ACL = new ACLController();
         // moduleList is passed by reference
         $ACL->filterModuleList($moduleList);
         $searchOptions['modules'] = $options['moduleList'] = $moduleList;
     }
     if (!empty($options['searchFields'])) {
         $customWhere = array();
         foreach ($options['moduleList'] as $module) {
             $seed = BeanFactory::getBean($module);
             $fields = array_keys($seed->field_defs);
             $existingfields = array_intersect($fields, $options['searchFields']);
             if (!empty($existingfields)) {
                 $customTable = $seed->get_custom_table_name();
                 $table = $seed->table_name;
                 foreach ($existingfields as $field) {
                     if (!isset($seed->field_defs[$field]['unified_search']) || $seed->field_defs[$field]['unified_search'] !== true) {
                         continue;
                     }
                     $prefix = $table;
                     if (isset($GLOBALS['dictionary'][$seed->object_name]['custom_fields'][$field])) {
                         $prefix = $customTable;
                     }
                     if (!isset($seed->field_defs[$field]['source']) || $seed->field_defs[$field]['source'] != 'non-db') {
                         $customWhere[$module][] = "{$prefix}.{$field} LIKE '{$options['query']}%'";
                     }
                 }
                 if (isset($customWhere[$module])) {
                     $searchOptions['custom_where_module'][$module] = '(' . implode(' OR ', $customWhere[$module]) . ')';
                 }
             }
         }
     }
     $offset = $options['offset'];
     // One for luck.
     // Well, actually it's so that we know that there are additional results
     $limit = $options['limit'] + 1;
     if ($multiModule && $options['offset'] != 0) {
         // With more than one module, there is no way to do offsets for real, so we have to fake it.
         $limit = $limit + $offset;
         $offset = 0;
     }
     if (!$multiModule) {
         // It's not multi-module, the per-module limit should be the same as the master limit
         $searchOptions['limitPerModule'] = $limit;
     }
     if (isset($options['custom_select'])) {
         $searchOptions['custom_select'] = $options['custom_select'];
     }
     if (isset($options['custom_from'])) {
         $searchOptions['custom_from'] = $options['custom_from'];
     }
     if (isset($options['custom_where'])) {
         $searchOptions['custom_where'] = $options['custom_where'];
     }
     $results = $searchEngine->search($options['query'], $offset, $limit, $searchOptions);
     $returnedRecords = array();
     $api->action = 'list';
     foreach ($results as $module => $moduleResults) {
         if (!is_array($moduleResults['data'])) {
             continue;
         }
         $moduleArgs = $args;
         // Need to override the filter arg so that it looks like something formatBean expects
         if (!empty($options['fieldFilters'][$module])) {
             $moduleFields = $options['fieldFilters'][$module];
         } else {
             if (!empty($options['fieldFilters']['_default'])) {
                 $moduleFields = $options['fieldFilters']['_default'];
             } else {
                 $moduleFields = array();
             }
         }
         $moduleArgs['fields'] = implode(',', $moduleFields);
         foreach ($moduleResults['data'] as $record) {
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:UnifiedSearchApi.php

示例9: get_user_module_list

 function get_user_module_list($user)
 {
     $GLOBALS['log']->info('Begin: SoapHelperWebServices->get_user_module_list');
     global $app_list_strings, $current_language;
     $app_list_strings = return_app_list_strings_language($current_language);
     $modules = query_module_access_list($user);
     ACLController::filterModuleList($modules, false);
     global $modInvisList, $modInvisListActivities;
     foreach ($modInvisList as $invis) {
         $modules[$invis] = 'read_only';
     }
     if (isset($modules['Calendar']) || $modules['Activities']) {
         foreach ($modInvisListActivities as $invis) {
             $modules[$invis] = $invis;
         }
     }
     $GLOBALS['log']->info('End: SoapHelperWebServices->get_user_module_list');
     return $modules;
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:19,代码来源:SoapHelperWebService.php

示例10: get_user_module_list

function get_user_module_list($user)
{
    global $app_list_strings;
    $app_list_strings = return_app_list_strings_language($current_language);
    $modules = query_module_access_list($user);
    ACLController::filterModuleList($modules, false);
    global $modInvisList, $modInvisListActivities;
    foreach ($modInvisList as $invis) {
        $modules[$invis] = 'read_only';
    }
    if (isset($modules['Calendar']) || $modules['Activities']) {
        foreach ($modInvisListActivities as $invis) {
            $modules[$invis] = $invis;
        }
    }
    return $modules;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:17,代码来源:SoapHelperFunctions.php


注:本文中的ACLController::filterModuleList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。