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


PHP ACLAction::setupCategoriesMatrix方法代码示例

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


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

示例1: sizeof

} else {
    $categories = ACLRole::getRoleActions('');
}
$sugar_smarty->assign('ROLE', $role->toArray());
$tdwidth = 10;
if (isset($_REQUEST['return_module'])) {
    $return['module'] = $_REQUEST['return_module'];
    if (isset($_REQUEST['return_action'])) {
        $return['action'] = $_REQUEST['return_action'];
    }
    if (isset($_REQUEST['return_record'])) {
        $return['record'] = $_REQUEST['return_record'];
    }
}
$sugar_smarty->assign('RETURN', $return);
$names = ACLAction::setupCategoriesMatrix($categories);
if (!empty($names)) {
    $tdwidth = 100 / sizeof($names);
}
$sugar_smarty->assign('CATEGORIES', $categories);
$sugar_smarty->assign('CATEGORY_NAME', $_REQUEST['category_name']);
$sugar_smarty->assign('TDWIDTH', $tdwidth);
$sugar_smarty->assign('ACTION_NAMES', $names);
$actions = $categories[$_REQUEST['category_name']]['module'];
$sugar_smarty->assign('ACTIONS', $actions);
ob_clean();
if ($_REQUEST['category_name'] == 'All') {
    echo $sugar_smarty->fetch('modules/ACLRoles/EditAllBody.tpl');
} else {
    //WDong Bug 23195: Strings not localized in Role Management.
    echo getClassicModuleTitle($_REQUEST['category_name'], array($app_list_strings['moduleList'][$_REQUEST['category_name']]), false);
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:31,代码来源:EditRole.php

示例2: testsetupCategoriesMatrix

 public function testsetupCategoriesMatrix()
 {
     //preset required data
     $categories = array();
     $categories['Accounts']['module']['list'][] = 'list';
     $categories['Accounts']['module']['edit'][] = 'edit';
     $names_expected = array('list' => 'List', 'edit' => 'Edit');
     $categories_expected = array('Accounts' => array('module' => array('list' => array('list', 'accessColor' => false, 'accessName' => false, 'accessLabel' => false, 'accessOptions' => array(90 => 'All', 80 => 'Group', 75 => 'Owner', 0 => 'Not Set', -99 => 'None')), 'edit' => array('edit', 'accessColor' => false, 'accessName' => false, 'accessLabel' => false, 'accessOptions' => array(90 => 'All', 80 => 'Group', 75 => 'Owner', 0 => 'Not Set', -99 => 'None')))));
     //execute the method and verify that it retunrs expected results
     $result = ACLAction::setupCategoriesMatrix($categories);
     $this->assertSame($names_expected, $result);
     $this->assertSame($categories, $categories_expected);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:13,代码来源:ACLActionTest.php


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