예제 #1
0
 function _menuList()
 {
     $menuLit = MenuModel::getList();
     $tree = array();
     $this->mkTree($menuLit, $tree);
     $menus = array();
     if ($this->userInfo['group']['permission']['type'] == 'super') {
         $menus = $tree;
     } else {
         $permissionList = is_array($this->userInfo['group']['permission']['list']) ? $this->userInfo['group']['permission']['list'] : array();
         foreach ($tree as $item) {
             if (in_array($item['url'], $permissionList)) {
                 if ($item['pid'] && !isset($menus[$item['pid']])) {
                     $menus[$item['pid']] = $tree[$item['pid']];
                 }
                 if (!isset($menus[$item['id']])) {
                     $menus[$item['id']] = $item;
                 }
             }
         }
     }
     $this->assign('menuList', $menus);
 }