本文整理汇总了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;
}
示例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;
}