本文整理汇总了PHP中auth_admin::build_permission_array方法的典型用法代码示例。如果您正苦于以下问题:PHP auth_admin::build_permission_array方法的具体用法?PHP auth_admin::build_permission_array怎么用?PHP auth_admin::build_permission_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth_admin
的用法示例。
在下文中一共展示了auth_admin::build_permission_array方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_auth_options
/**
* Display permission settings able to be set
*/
function display_auth_options($auth_options)
{
global $template, $user;
$content_array = $categories = array();
$key_sort_array = array(0);
$auth_options = array(0 => $auth_options);
// Making use of auth_admin method here (we do not really want to change two similar code fragments)
auth_admin::build_permission_array($auth_options, $content_array, $categories, $key_sort_array);
$content_array = $content_array[0];
$template->assign_var('S_NUM_PERM_COLS', sizeof($categories));
// Assign to template
foreach ($content_array as $cat => $cat_array) {
$template->assign_block_vars('auth', array('CAT_NAME' => $user->lang['permission_cat'][$cat], 'S_YES' => $cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO'] ? true : false, 'S_NEVER' => $cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO'] ? true : false, 'S_NO' => $cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES'] ? true : false));
foreach ($cat_array['permissions'] as $permission => $allowed) {
$template->assign_block_vars('auth.mask', array('S_YES' => $allowed == ACL_YES ? true : false, 'S_NEVER' => $allowed == ACL_NEVER ? true : false, 'S_NO' => $allowed == ACL_NO ? true : false, 'FIELD_NAME' => $permission, 'PERMISSION' => $user->lang['acl_' . $permission]['lang']));
}
}
}