当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminController::init方法代码示例

本文整理汇总了PHP中AdminController::init方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::init方法的具体用法?PHP AdminController::init怎么用?PHP AdminController::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdminController的用法示例。


在下文中一共展示了AdminController::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * 初始化
  */
 public function init()
 {
     parent::init();
     $this->topic = new TopicModel();
     $this->referer = isset($_SERVER["HTTP_REFERER"]) ? str_replace('http://' . $_SERVER['HTTP_HOST'], '', $_SERVER["HTTP_REFERER"]) : '/admin/index/index';
     //设置白名单(在白名单内不需要tid,否则需要提供tid
     //这样可以避免在专题相关的控制器和方法中再次判断 用户对专题权限
     $url_arr = array("/admin/topic/index", "/admin/topic/index/", "/admin/topicdata/index", "/admin/topicdata/index/", "/admin/topic/add/", "/admin/topic/add", "/admin/topicdata/trashindex", "/admin/topicdata/trashindex/");
     if (!in_array($_SERVER['REQUEST_URI'], $url_arr)) {
         $tid = $this->getRequest()->getQuery("tid");
         //如果不存在tid 非法请求
         if (!$tid) {
             Alert::danger("非法请求");
             Yaf_Controller_Abstract::redirect("/admin/topic/index/");
             exit;
         }
         //根据tid查询当前用户是否是管理员或者是该专题的所有者,如果不是则提示权限不足
         if (!$this->checkrole($tid)) {
             Alert::danger("权限不足");
             Yaf_Controller_Abstract::redirect("/admin/topic/index/");
             exit;
         }
     }
     //判断是否是管理员 并赋值给模板
     $this->getView()->assign("is_admin", $this->is_admin());
 }
开发者ID:290329416,项目名称:guahao,代码行数:29,代码来源:Topicbase.php

示例2: init

 /**
  初始化
  @param void
  @return void
 */
 function init()
 {
     parent::init();
     $this->referer = isset($_SERVER["HTTP_REFERER"]) ? str_replace('http://' . $_SERVER['HTTP_HOST'], '', $_SERVER["HTTP_REFERER"]) : '/admin/index/index';
     //db 实例化
     $this->db_config = new ConfigModel();
 }
开发者ID:290329416,项目名称:guahao,代码行数:12,代码来源:Config.php

示例3: init

 public function init()
 {
     parent::init();
     AuthController::requireLogin();
     AuthController::requireShopSession();
     $this->setSmarty();
 }
开发者ID:ecuation,项目名称:Control-de-stock,代码行数:7,代码来源:Product_listController.php

示例4: init

 function init()
 {
     parent::init();
     if (true !== YII_DEBUG) {
         exit('access deny!');
     }
 }
开发者ID:hiproz,项目名称:mincms,代码行数:7,代码来源:DefaultController.php

示例5: init

 /**
  * AdminController::init() override
  * @see AdminController::init()
  */
 public function init()
 {
     if (Tools::isSubmit('submitFilterorders')) {
         $this->list_id = 'orders';
     } elseif (Tools::isSubmit('submitFiltertemplates')) {
         $this->list_id = 'templates';
     }
     parent::init();
     if (Tools::isSubmit('addsupply_order') || Tools::isSubmit('submitAddsupply_order') || Tools::isSubmit('updatesupply_order') && Tools::isSubmit('id_supply_order')) {
         // override table, lang, className and identifier for the current controller
         $this->table = 'supply_order';
         $this->className = 'SupplyOrder';
         $this->identifier = 'id_supply_order';
         $this->lang = false;
         $this->action = 'new';
         $this->display = 'add';
         if (Tools::isSubmit('updatesupply_order')) {
             if ($this->tabAccess['edit'] === '1') {
                 $this->display = 'edit';
             } else {
                 $this->errors[] = Tools::displayError('You do not have permission to edit this.');
             }
         }
     }
     if (Tools::isSubmit('update_receipt') && Tools::isSubmit('id_supply_order')) {
         // change the display type in order to add specific actions to
         $this->display = 'update_receipt';
         // display correct toolBar
         $this->initToolbar();
     }
 }
开发者ID:zangles,项目名称:lennyba,代码行数:35,代码来源:AdminSupplyOrdersController.php

示例6: init

 /**
  初始化
  @param void
  @return void
 */
 function init()
 {
     parent::init();
     //db 实例化
     $this->category = new CategoryModel();
     $this->modeldata = new ModeldataModel();
 }
开发者ID:290329416,项目名称:guahao,代码行数:12,代码来源:Category.php

示例7: init

 public function init()
 {
     parent::init();
     // context->shop is set in the init() function, so we move the _category instanciation after that
     if (($id_category = Tools::getvalue('id_category')) && $this->action != 'select_delete') {
         $this->_category = new Category($id_category);
     } else {
         if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
             $this->_category = new Category($this->context->shop->id_category);
         } else {
             if (count(Category::getCategoriesWithoutParent()) > 1 && Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) != 1) {
                 $this->_category = Category::getTopCategory();
             } else {
                 $this->_category = new Category(Configuration::get('PS_HOME_CATEGORY'));
             }
         }
     }
     // if we are not in a shop context, we remove the position column
     if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) {
         unset($this->fields_list['position']);
     }
     // shop restriction : if category is not available for current shop, we redirect to the list from default category
     if (!$this->_category->isAssociatedToShop() && Shop::getContext() == Shop::CONTEXT_SHOP) {
         $this->redirect_after = self::$currentIndex . '&id_category=' . (int) $this->context->shop->getCategory() . '&token=' . $this->token;
         $this->redirect();
     }
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:27,代码来源:AdminCategoriesController.php

示例8: init

 function init()
 {
     parent::init();
     Requirements::css(Director::protocol() . "code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css");
     Requirements::css('news/code/ui/frontend/css/news.admin.css');
     Requirements::javascript(Director::protocol() . "code.jquery.com/ui/1.10.4/jquery-ui.min.js");
     Requirements::javascript('news/code/ui/frontend/js/news.admin.js');
 }
开发者ID:balajijegan,项目名称:openstack-org,代码行数:8,代码来源:NewsAdminPage_Controller.php

示例9: init

    public function init()
    {
        parent::init();
        $this->fields_list = array('id_currency' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Currency')), 'iso_code' => array('title' => $this->l('ISO code'), 'align' => 'center', 'width' => 80), 'iso_code_num' => array('title' => $this->l('ISO code number'), 'align' => 'center', 'width' => 120), 'sign' => array('title' => $this->l('Symbol'), 'width' => 20, 'align' => 'center', 'orderby' => false, 'search' => false), 'conversion_rate' => array('title' => $this->l('Conversion rate'), 'type' => 'float', 'align' => 'center', 'width' => 130, 'search' => false), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')), 'enableSelection' => array('text' => $this->l('Enable selection')), 'disableSelection' => array('text' => $this->l('Disable selection')));
        $this->fields_options = array('change' => array('title' => $this->l('Currency rates'), 'image' => '../img/admin/exchangesrate.gif', 'description' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, rates are provided as-is.'), 'submit' => array('title' => $this->l('Update currency rates'), 'class' => 'button', 'name' => 'SubmitExchangesRates')), 'cron' => array('title' => $this->l('Automatically update currency rates'), 'image' => '../img/admin/tab-tools.gif', 'info' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, rates are provided as-is. Place this URL in crontab or access it manually daily') . ':<br />
					<b>' . Tools::getShopDomain(true, true) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/cron_currency_rates.php?secure_key=' . md5(_COOKIE_KEY_ . Configuration::get('PS_SHOP_NAME')) . '</b></p>'));
    }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:8,代码来源:AdminCurrenciesController.php

示例10: init

 public function init()
 {
     parent::init();
     $this->navItemIconBaseUrlPath = $this->rootUrl . '/images/admin/icon1';
     $this->componentFastpostIconBaseUrlPath = $this->rootUrl . '/images/admin/icon2';
     $this->componentDiscoverIconBaseUrlPath = $this->rootUrl . '/images/admin/icon3';
     $this->componentTopbarIconBaseUrlPath = $this->rootUrl . '/images/admin/topbar';
 }
开发者ID:caidongyun,项目名称:CS,代码行数:8,代码来源:UIDiyController.php

示例11: init

 function init()
 {
     parent::init();
     $this->db_role = new RoleModel();
     $this->db_user = new UserModel();
     $this->db_privilege = new PrivilegeModel();
     $this->db_document = new DocumentModel();
 }
开发者ID:290329416,项目名称:guahao,代码行数:8,代码来源:Index.php

示例12: init

 function init()
 {
     parent::init();
     if (!$this->_config['mlanguage']) {
         flash('error', __('please open muit language support'));
         $this->redirect(url('admin/default/index'));
     }
 }
开发者ID:hiproz,项目名称:mincms,代码行数:8,代码来源:LanguageController.php

示例13: init

 /**
  * init
  */
 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_formtemplate_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Form Templates Manager'));
     $this->title[] = at('Form Templates Manager');
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:12,代码来源:FormtemplateController.php

示例14: init

 function init()
 {
     parent::init();
     $this->getid = (int) $_GET['fid'];
     $this->active = 'node-' . $this->getid;
     $model = NodeContent::model()->findByPk($this->getid);
     $this->table = "field_" . trim($model->name);
     $this->title = __($model->discription) ?: __($model->name);
 }
开发者ID:hiproz,项目名称:mincms,代码行数:9,代码来源:QueryController.php

示例15: init

 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_logs_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Logs'));
     $this->title[] = at('Logs');
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:9,代码来源:LogController.php


注:本文中的AdminController::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。