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


PHP ACLAction::getAccessOptions方法代码示例

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


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

示例1: setupCategoriesMatrix

 /**
  *
  * static pass by ref setupCategoriesMatrix(&$categories)
  * takes in an array of categories and modifes them adding display information
  *
  * @param unknown_type $categories
  */
 public static function setupCategoriesMatrix(&$categories)
 {
     global $ACLActions, $current_user;
     $names = array();
     $disabled = array();
     foreach ($categories as $cat_name => $category) {
         foreach ($category as $type_name => $type) {
             foreach ($type as $act_name => $action) {
                 $names[$act_name] = translate($ACLActions[$type_name]['actions'][$act_name]['label'], 'ACLActions');
                 $categories[$cat_name][$type_name][$act_name]['accessColor'] = ACLAction::AccessColor($action['aclaccess']);
                 if ($type_name == 'module') {
                     if ($act_name != 'aclaccess' && $categories[$cat_name]['module']['access']['aclaccess'] == ACL_ALLOW_DISABLED) {
                         $categories[$cat_name][$type_name][$act_name]['accessColor'] = 'darkgray';
                         $disabled[] = $cat_name;
                     }
                 }
                 $categories[$cat_name][$type_name][$act_name]['accessName'] = ACLAction::AccessName($action['aclaccess']);
                 $categories[$cat_name][$type_name][$act_name]['accessLabel'] = ACLAction::AccessLabel($action['aclaccess']);
                 if ($cat_name == 'Users' && $act_name == 'admin') {
                     $categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEFAULT] = ACLAction::AccessName(ACL_ALLOW_DEFAULT);
                     $categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEV] = ACLAction::AccessName(ACL_ALLOW_DEV);
                 } else {
                     $categories[$cat_name][$type_name][$act_name]['accessOptions'] = ACLAction::getAccessOptions($act_name, $type_name);
                 }
             }
         }
     }
     if (!is_admin($current_user)) {
         foreach ($disabled as $cat_name) {
             unset($categories[$cat_name]);
         }
     }
     return $names;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:41,代码来源:ACLAction.php

示例2: setupCategoriesMatrix

 /**
  * 
  * static pass by ref setupCategoriesMatrix(&$categories)
  * takes in an array of categories and modifes them adding display information
  *
  * @param unknown_type $categories
  */
 function setupCategoriesMatrix(&$categories)
 {
     global $ACLActions, $current_user;
     $names = array();
     $disabled = array();
     foreach ($categories as $cat_name => $category) {
         foreach ($category as $type_name => $type) {
             $setup_names = false;
             if (empty($names)) {
                 $names = array();
                 $setup_names = true;
                 if (!empty($names)) {
                     $tdwidth = 100 / sizeof($names);
                 }
             }
             foreach ($type as $act_name => $action) {
                 if ($setup_names) {
                     $names[] = translate($ACLActions[$type_name]['actions'][$act_name]['label'], 'ACLActions');
                 }
                 $categories[$cat_name][$type_name][$act_name]['accessColor'] = ACLAction::AccessColor($action['aclaccess']);
                 if ($type_name == 'module') {
                     if ($act_name != 'aclaccess' && $categories[$cat_name]['module']['access']['aclaccess'] == ACL_ALLOW_DISABLED) {
                         $categories[$cat_name][$type_name][$act_name]['accessColor'] = 'darkgray';
                         $disabled[] = $cat_name;
                     }
                 }
                 $categories[$cat_name][$type_name][$act_name]['accessName'] = ACLAction::AccessName($action['aclaccess']);
                 $categories[$cat_name][$type_name][$act_name]['accessOptions'] = ACLAction::getAccessOptions($act_name, $type_name);
             }
         }
     }
     if (!is_admin($current_user)) {
         foreach ($disabled as $cat_name) {
             unset($categories[$cat_name]);
         }
     }
     return $names;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:45,代码来源:ACLAction.php


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