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


PHP Roles::findProjectRoles方法代码示例

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


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

示例1: smarty_function_select_user_project_permissions

/**
 * Render select user permissions widget
 * 
 * Params:
 * 
 * - name
 * - id
 * - permissions
 * - role_id
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_select_user_project_permissions($params, &$smarty)
{
    static $counter = 1;
    $id = array_var($params, 'id');
    if (empty($id)) {
        $id = 'select_user_project_permissions_' . $counter;
        $counter++;
    }
    // if
    $role_id = array_var($params, 'role_id', 0);
    $permissions = array_var($params, 'permissions', array());
    $smarty->assign(array('_select_user_project_permissions_name' => array_var($params, 'name'), '_select_user_project_permissions_role_id_field' => array_var($params, 'role_id_field', 'role_id'), '_select_user_project_permissions_permissions_field' => array_var($params, 'permissions_field', 'permissions'), '_select_user_project_permissions_name' => array_var($params, 'name'), '_select_user_project_permissions_id' => $id, '_select_user_project_permissions_role_id' => $role_id, '_select_user_project_permissions_permissions' => $permissions, '_select_user_project_permissions_roles' => Roles::findProjectRoles()));
    return $smarty->fetch(get_template_path('_user_project_permissions', null, SYSTEM_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:28,代码来源:function.select_user_project_permissions.php

示例2: project_roles

 /**
  * Show all available project roles
  *
  * @param void
  * @return null
  */
 function project_roles()
 {
     $roles_data = array();
     $project_permissions = array_keys(Permissions::findProject());
     $roles = Roles::findProjectRoles();
     if (is_foreachable($roles)) {
         foreach ($roles as $role) {
             $role_details = array('id' => $role->getId(), 'name' => $role->getName(), 'permissions' => array());
             foreach ($project_permissions as $permission) {
                 $role_details['permissions'][$permission] = (int) $role->getPermissionValue($permission, 0);
             }
             // foreach
             $roles_data[] = $role_details;
         }
         // foreach
     }
     // if
     $this->serveData($roles_data, 'project_roles');
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:25,代码来源:ApiController.class.php


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