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


PHP role::get_action_ids方法代码示例

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


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

示例1: index

 /**
  * 列表
  */
 public function index()
 {
     $this->template->content = new View("manage/action_list");
     $actions = Myaction::instance()->actions();
     //用户可管理权限资源的ID
     $user_action_ids = role::get_action_ids();
     foreach ($actions as $key => $value) {
         if (!in_array($value['id'], $user_action_ids)) {
             unset($actions[$key]);
         }
     }
     $this->template->content->actions = $actions;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:16,代码来源:action.php

示例2: index

 function index()
 {
     $nodes = array();
     $empty_menu = array('#', 'javascript:void(0);', 'javascript:void(0)');
     $action_ids = role::get_action_ids();
     $orderby = array('order' => 'DESC');
     $menus = ORM::factory('menu')->where('parent_id', 0)->where('active', 1)->in('action_id', $action_ids)->orderby($orderby)->find_all();
     foreach ($menus as $item) {
         $value = $item->as_array();
         $value['name'] = '<b>' . $value['name'] . '</b>';
         $sub_menus = $this->sub_menus($value['id'], $action_ids);
         if (empty($sub_menus)) {
             continue;
         }
         foreach ($sub_menus as $sub_menu_key => $sub_menu_value) {
             $sub_menus[$sub_menu_key]['children'] = $this->sub_menus($sub_menu_value['id'], $action_ids);
         }
         $value['children'] = $sub_menus;
         $value = self::to_node($value);
         $nodes[] = $value;
     }
     die(json_encode($nodes));
     //echo 'Docs.classData =[];';
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:24,代码来源:menu_tree.php

示例3: get_avalible_menu

 /**
  * get user avalible menu
  */
 public static function get_avalible_menu()
 {
     //all menus
     $menus = Mymenu::instance()->get_level_menus();
     //账号的资源列表
     $action_ids = role::get_action_ids();
     //无权限的菜单删除
     foreach ($menus as $menus_key => $menus_value) {
         $sub_menu = $menus_value['children'];
         foreach ($sub_menu as $key => $value) {
             //if ($value ['action_id'] > 0){
             if (!in_array($value['action_id'], $action_ids)) {
                 unset($menus[$menus_key]['children'][$key]);
             }
             //}
         }
     }
     return $menus;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:22,代码来源:menu.php


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