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


PHP Mage_Adminhtml_Controller_Action::preDispatch方法代码示例

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


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

示例1: preDispatch

 /**
  * Method is called by the controller before the requested action is
  * invoked.
  *
  * This method checks if a valid licence for the package is available,
  * if not the user is redirected to the package detail page to enter
  * a valid serialz.
  *
  * @return Mage_Core_Controller_Front_Action The controller instance
  */
 public function preDispatch()
 {
     try {
         // invoke the parent's preDispatch method
         parent::preDispatch();
         // validate the package information
         Mage::getModel('manager/connector')->validate($packageInformation = $this->_getPackageInformation());
         // return the instance
         return $this;
     } catch (Faett_Manager_Exceptions_InvalidLicenceException $ile) {
         // log the exception
         Mage::logException($ile);
         // add an error to the session
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manager')->__('202.error.invalid.serialz', $packageInformation->getIdentifier()));
     } catch (Faett_Manager_Exceptions_ChannelLoginException $cle) {
         // log the exception
         Mage::logException($cle);
         // add an error to the session
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manager')->__('202.error.invalid.credentials', $packageInformation->getPackage()->getChannel()->getUrl()));
         // redirect and request user to enter a valid Serialz
         $this->_forward('index', 'adminhtml_channel', 'manager', array('id' => $packageInformation->getPackage()->getId()));
     } catch (Faett_Manager_Exceptions_ChannelNotFoundException $cnfe) {
         // log the exception
         Mage::logException($cnfe);
         // add an error to the session
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manager')->__('202.error.invalid.channel', $packageInformation->getPackage()->getChannel()->getUrl()));
         // redirect and request user to register channel first
         $this->_forward('new', 'adminhtml_channel', 'manager');
     }
 }
开发者ID:BGCX067,项目名称:faett-manager-svn-to-git,代码行数:40,代码来源:AbstractController.php

示例2: preDispatch

 function preDispatch()
 {
     if (preg_match('#localhost#', $_SERVER['HTTP_HOST']) && file_exists(sys_get_temp_dir() . '/vf-ajax-tests')) {
         return;
     }
     return parent::preDispatch();
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:VehicleslistController.php

示例3: preDispatch

 public function preDispatch()
 {
     parent::preDispatch();
     if ($this->getRequest()->getActionName() != 'error' && !$this->checkLocalCodePool()) {
         $this->_forward('error');
     }
 }
开发者ID:unifiedarts,项目名称:Aoe_Scheduler,代码行数:7,代码来源:AbstractController.php

示例4: preDispatch

 public function preDispatch()
 {
     if ($this->getRequest()->getActionName() == 'auth') {
         Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
     }
     parent::preDispatch();
 }
开发者ID:shakhawat4g,项目名称:MagentoExtensions,代码行数:7,代码来源:OauthController.php

示例5: preDispatch

 public function preDispatch()
 {
     parent::preDispatch();
     if (!extension_loaded('imap')) {
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please, ask your hosting provider to enable IMAP extension in PHP configuration of your server. <br> Otherwise, helpdesk will not be able to fetch emails.'));
     }
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:7,代码来源:GatewayController.php

示例6: preDispatch

 public function preDispatch()
 {
     parent::preDispatch();
     $this->_customer_addressTypeId = Mage::getModel('eav/entity')->setType('customer_address')->getTypeId();
     $this->_block = 'address';
     $this->_type = 'customer_address';
 }
开发者ID:remiebeling,项目名称:Hwg_Attributemanager,代码行数:7,代码来源:AddressController.php

示例7: preDispatch

 public function preDispatch()
 {
     parent::preDispatch();
     /**
      * Custom implementation of APPSEC-1034 (SUPEE-6788) [see additional information below].
      * M2E Pro prevents redirect to Magento Admin Panel login page.
      *
      * This PHP class is the base PHP class of all M2E Pro controllers.
      * Thus, it protects any action of any controller of M2E Pro extension.
      *
      * The code below is the logical extension of the method \Ess_M2ePro_Controller_Router::addModule.
      */
     // -----------------------------------------------------------------
     if (!$this->getRequest()->isDispatched() && !Mage::getSingleton('admin/session')->isLoggedIn() && $this->getRequest()->getActionName() == 'login') {
         return $this->_redirect('M2ePro/index/index/');
     }
     // -----------------------------------------------------------------
     // client was logged out
     if ($this->getRequest()->isXmlHttpRequest() && !Mage::getSingleton('admin/session')->isLoggedIn()) {
         exit(json_encode(array('ajaxExpired' => 1, 'ajaxRedirect' => $this->_getRefererUrl())));
     }
     // flag controller loaded
     if (is_null(Mage::helper('M2ePro/Data_Global')->getValue('is_base_controller_loaded'))) {
         Mage::helper('M2ePro/Data_Global')->setValue('is_base_controller_loaded', true);
     }
     return $this;
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:27,代码来源:BaseController.php

示例8: preDispatch

 /**
  * preDispatch - called before every action
  */
 public function preDispatch()
 {
     parent::preDispatch();
     $this->_helper = Mage::helper('ash_slideshow');
     $this->_slideshowModel = Mage::getModel('ash_slideshow/slideshow');
     $this->_slideshowAssetsModel = Mage::getModel('ash_slideshow/slideshowasset');
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:10,代码来源:SlideshowsController.php

示例9: preDispatch

 public function preDispatch()
 {
     parent::preDispatch();
     $this->_categoryTypeId = Mage::getModel('eav/entity')->setType('catalog_category')->getTypeId();
     $this->_block = 'category';
     $this->_type = 'catalog_category';
 }
开发者ID:remiebeling,项目名称:Hwg_Attributemanager,代码行数:7,代码来源:CategoryController.php

示例10: preDispatch

 /**
  * Check if module functionality enabled
  *
  * @return Enterprise_Reward_Adminhtml_Reward_RateController
  */
 public function preDispatch()
 {
     parent::preDispatch();
     if (!Mage::helper('rewardpoints')->moduleEnabled() && $this->getRequest()->getActionName() != 'noroute') {
         $this->_forward('noroute');
     }
     return $this;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:13,代码来源:CustomerController.php

示例11: preDispatch

 public function preDispatch()
 {
     parent::preDispatch();
     /* if (!Mage::helper('storecredit')->moduleEnabled() && $this->getRequest()->getActionName() != 'noroute') {
            $this->_forward('noroute');
        }*/
     return $this;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:8,代码来源:CustomerController.php

示例12: preDispatch

 /**
  * Controller predispatch method
  * Check if current section is found and is allowed
  *
  * @return Mage_Adminhtml_System_ConfigController
  */
 public function preDispatch()
 {
     parent::preDispatch();
     if ($this->getRequest()->getParam('section')) {
         $this->_isSectionAllowedFlag = $this->_isSectionAllowed($this->getRequest()->getParam('section'));
     }
     return $this;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:14,代码来源:ConfigController.php

示例13: preDispatch

 /**
  * Check if module functionality enabled
  *
  * @return Enterprise_Reward_Adminhtml_Reward_RateController
  */
 public function preDispatch()
 {
     parent::preDispatch();
     if (!Mage::helper('enterprise_reward')->isEnabled() && $this->getRequest()->getActionName() != 'noroute') {
         $this->_forward('noroute');
     }
     return $this;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:13,代码来源:RateController.php

示例14: preDispatch

 public function preDispatch()
 {
     $result = parent::preDispatch();
     if (true === $this->_getSession()->getData('aitsys_rewriter_require_rebuild')) {
         $this->_getSession()->unsetData('aitsys_rewriter_require_rebuild');
         Mage::getModel('aitsys/rewriter')->prepare();
     }
     return $result;
 }
开发者ID:kiutisuperking,项目名称:eatsmartboxdev,代码行数:9,代码来源:RewriterController.php

示例15: preDispatch

 public function preDispatch()
 {
     $result = parent::preDispatch();
     $this->tool()->setInteractiveSession($this->_getSession());
     if ($this->tool()->platform()->isBlocked() && 'error' != $this->getRequest()->getActionName()) {
         $this->_forward('error', 'index');
     }
     return $result;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:9,代码来源:Controller.php


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