當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。