public function __construct()
 {
     parent::__construct();
     $this->left_menus = $this->_generate_menus();
     $this->manager_role = D('User')->managerRole();
     $this->category = D('Category')->getTree(0);
 }
 public function __construct()
 {
     parent::__construct();
     if (!C('SHOW_STATISTIC')) {
         session('error', '统计功能已经关闭');
         redirect('Index/index');
     }
     $this->statistic_contents = unserialize(D('Config')->getConfigValue('contents'));
 }
 public function __construct()
 {
     parent::__construct();
     // $this->getMenu();
     $this->models = D("Model")->getModels();
     $this->statuses = D("Status")->getContentStatus();
     $this->seditors = D("User")->getField('id,username', true);
     $this->id = $id = I('get.id', 0);
     $this->model_id = I('get.model_id', 1);
     $this->category_id = I('get.category_id', 0);
     if (!$this->category_id) {
         $this->category_id = I('get.cid', 0);
     }
     // 有内容,编辑页
     if ($this->id) {
         $this->content = D('Content')->detail($this->id);
         $this->model_id = $this->content['model_id'];
         $this->category_id = $this->content['category_id'];
     }
     $this->model = $this->models[$this->model_id];
     $this->category = D("Category")->getById($this->category_id);
     $this->available_model_ids = array_keys($this->models);
     if ($this->category) {
         $this->available_model_ids = array_keys($this->category['models']);
     }
     $this->default_new_model_id = $this->available_model_ids[0];
     // TODO 扩展还没.过滤一下后台设置不显示的字段
     $this->model_fields = D("Field")->getContentFields($this->model_id, $this->category_id);
     // 做一下权限的处理
     $user = $this->login_user;
     if ($user['role'] != 'manager') {
         $ids = D('Category')->getIdsForTree($user['category_ids']);
         $filter['id'] = array('in', $ids);
     }
     $this->category_tree = D('Category')->getTree(0, false, $filter);
     $this->breadcrumb_info = D("Category")->getParentCategory($this->category_id);
     $this->left_menus = $this->_generate_menus($this->category_tree, array(), 0);
 }
 public function __construct()
 {
     parent::__construct();
     $this->left_menus = $this->_generate_menus();
     $this->msg_fields = D('Field')->getMessageFields();
 }
 public function __construct()
 {
     parent::__construct();
 }
Example #6
0
 public function __construct()
 {
     parent::__construct();
     $this->left_menus = $this->_generate_menus();
 }