本文整理汇总了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');
}
}
示例2: preDispatch
function preDispatch()
{
if (preg_match('#localhost#', $_SERVER['HTTP_HOST']) && file_exists(sys_get_temp_dir() . '/vf-ajax-tests')) {
return;
}
return parent::preDispatch();
}
示例3: preDispatch
public function preDispatch()
{
parent::preDispatch();
if ($this->getRequest()->getActionName() != 'error' && !$this->checkLocalCodePool()) {
$this->_forward('error');
}
}
示例4: preDispatch
public function preDispatch()
{
if ($this->getRequest()->getActionName() == 'auth') {
Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
}
parent::preDispatch();
}
示例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.'));
}
}
示例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';
}
示例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;
}
示例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');
}
示例9: preDispatch
public function preDispatch()
{
parent::preDispatch();
$this->_categoryTypeId = Mage::getModel('eav/entity')->setType('catalog_category')->getTypeId();
$this->_block = 'category';
$this->_type = 'catalog_category';
}
示例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;
}
示例11: preDispatch
public function preDispatch()
{
parent::preDispatch();
/* if (!Mage::helper('storecredit')->moduleEnabled() && $this->getRequest()->getActionName() != 'noroute') {
$this->_forward('noroute');
}*/
return $this;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}