示例#1
0
 /**
  * 获取菜单
  */
 public function get_menu($leve)
 {
     $nodemod = new NodeModel();
     if ($_SESSION[C('ADMIN_AUTH_KEY')]) {
         //超级管理员
         $list = $nodemod->get_node($leve);
         foreach ($list as $k => $v) {
             if ($leve == 1) {
                 $list[$k]['url'] = U($v['name'] . "/index");
             } else {
                 $list[$k]['url'] = U($this->getActionName() . "/" . strtolower($v['name']));
             }
             $list[$k]['name'] = strtolower($v['name']);
         }
     } else {
         //非超级管理员
         $list = $nodemod->get_user_node($leve, $_SESSION['my_info']['a_id']);
         foreach ($list as $k => $v) {
             if ($leve == 1) {
                 $list[$k]['url'] = U($v['name'] . "/index");
             } else {
                 $list[$k]['url'] = U($this->getActionName() . "/" . strtolower($v['name']));
             }
             $list[$k]['name'] = strtolower($v['name']);
         }
     }
     if ($list) {
         return $list;
     } else {
         return false;
     }
 }