コード例 #1
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->Config = D('Common/Config');
     $configList = $this->Config->getField("varname,value");
     $this->assign('Site', $configList);
 }
コード例 #2
0
 protected function _initialize()
 {
     parent::_initialize();
     if (!isModuleInstall('Addons')) {
         $this->error('你还没有安装插件模块,无法使用插件商店!');
     }
 }
コード例 #3
0
 protected function _initialize()
 {
     //除了swfupload不验证,其他都验证
     if (ACTION_NAME != 'swfupload') {
         parent::_initialize();
     }
     //附件目录强制/d/file/ 后台设置的附件目录,只对网络地址有效
     $this->path = C("UPLOADFILEPATH");
 }
コード例 #4
0
 protected function _initialize()
 {
     parent::_initialize();
     //可用模块列表
     $Module = array('content' => array('module' => 'content', 'name' => '内容模块'));
     foreach (cache('Module') as $r) {
         $Module[strtolower($r['module'])] = array('module' => strtolower($r['module']), 'name' => $r['modulename']);
     }
     $this->assign('Module', $Module);
 }
コード例 #5
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->modelfield = D("Content/ModelField");
     //字段类型存放目录
     $this->fields = MODULE_PATH . 'Fields/';
     $modelid = I('get.modelid', 0, 'intval');
     //菜单导航
     $Custom = array(array('name' => '字段管理', 'app' => MODULE_NAME, 'controller' => CONTROLLER_NAME, 'action' => 'index', 'parameter' => "modelid={$modelid}"), array('name' => '添加字段', 'app' => MODULE_NAME, 'controller' => CONTROLLER_NAME, 'action' => 'add', 'parameter' => "modelid={$modelid}"), array('name' => '预览模型', 'app' => MODULE_NAME, 'controller' => CONTROLLER_NAME, 'action' => 'priview', 'parameter' => "modelid={$modelid}"));
     $menuReturn = array('name' => '返回模型管理', 'url' => U('Models/index'));
     $this->assign('Custom', $Custom)->assign('menuReturn', $menuReturn);
 }
コード例 #6
0
 protected function _initialize()
 {
     parent::_initialize();
     $model = cache('Model');
     foreach ($model as $rs) {
         if ($rs['type'] == 0) {
             $this->model[$rs['modelid']] = $rs;
         }
     }
     $this->categorys = cache('Category');
     //合并get到post
     foreach ($_GET as $k => $v) {
         $_POST[$k] = $v;
     }
 }
コード例 #7
0
 protected function _initialize()
 {
     parent::_initialize();
     load('Content/iconvfunc');
     //取得当前内容模型模板存放目录
     $this->filepath = TEMPLATE_PATH . (empty(self::$Cache["Config"]['theme']) ? "Default" : self::$Cache["Config"]['theme']) . "/Content/";
     //取得栏目频道模板列表
     $this->tp_category = str_replace($this->filepath . "Category/", '', glob($this->filepath . 'Category/category*'));
     //取得栏目列表模板列表
     $this->tp_list = str_replace($this->filepath . "List/", '', glob($this->filepath . 'List/list*'));
     //取得内容页模板列表
     $this->tp_show = str_replace($this->filepath . "Show/", '', glob($this->filepath . 'Show/show*'));
     //取得单页模板
     $this->tp_page = str_replace($this->filepath . "Page/", '', glob($this->filepath . 'Page/page*'));
     //取得评论模板列表
     $this->tp_comment = str_replace($this->filepath . "Comment/", '', glob($this->filepath . 'Comment/comment*'));
 }
コード例 #8
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->catid = I('request.catid', $_POST['info']['catid'], 'intval');
     $this->model = cache('Model');
     //权限验证
     if (User::getInstance()->isAdministrator() !== true) {
         //如果是public_开头的方法通过验证
         if (strpos(ACTION_NAME, 'public_') === false && ACTION_NAME != 'index') {
             //操作
             $action = getCategory($this->catid, 'type') == 0 ? ACTION_NAME : 'init';
             if ($action == 'classlist') {
                 $action = 'init';
             }
             $priv_datas = M('CategoryPriv')->where(array('catid' => $this->catid, 'is_admin' => 1, 'roleid' => User::getInstance()->role_id, 'action' => $action))->find();
             if (empty($priv_datas)) {
                 $this->error('您没有操作该项的权限!');
             }
         }
     }
 }
コード例 #9
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->cateid = I('request.cateid', $_POST['cateid'], 'intval');
     $this->tryid = I('request.tryid', $_POST['tryid'], 'intval');
 }
コード例 #10
0
 function _initialize()
 {
     parent::_initialize();
     //附件目录强制/d/file/ 后台设置的附件目录,只对网络地址有效
     $this->path = C("UPLOADFILEPATH");
 }
コード例 #11
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->behavior = D('Common/Behavior');
 }
コード例 #12
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->doAction = I('request.doAction', $_POST['doAction'], 'trim');
 }
コード例 #13
0
 protected function _initialize()
 {
     parent::_initialize();
     $this->db = D('Template/Customlist');
 }