/**
  * Init composite product configuration layout
  *
  * $isOk - true or false, whether action was completed nicely or with some error
  * If $isOk is FALSE (some error during configuration), so $productType must be null
  *
  * @param Mage_Adminhtml_Controller_Action $controller
  * @param bool $isOk
  * @param string $productType
  * @return Mage_Adminhtml_Helper_Catalog_Product_Composite
  */
 protected function _initConfigureResultLayout($controller, $isOk, $productType)
 {
     $update = $controller->getLayout()->getUpdate();
     if ($isOk) {
         $update->addHandle('SPACEMARIACHI_ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE')->addHandle('PRODUCT_TYPE_' . $productType);
     } else {
         $update->addHandle('ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR');
     }
     $controller->loadLayoutUpdates()->generateLayoutXml()->generateLayoutBlocks();
     return $this;
 }
 /**
  * Initializes the PEAR service implementation.
  *
  * @return void
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     // call the parent constructor
     parent::__construct($request, $response, $invokeArgs);
     // initialize the PEAR service implementation
     $this->_service = Faett_Core_Factory::get(Mage::getBaseDir());
 }
 function preDispatch()
 {
     if (preg_match('#localhost#', $_SERVER['HTTP_HOST']) && file_exists(sys_get_temp_dir() . '/vf-ajax-tests')) {
         return;
     }
     return parent::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');
 }
 protected function _construct()
 {
     $this->ultility = Mage::getSingleton('solrsearch/ultility');
     $this->threadEnable = Mage::getResourceModel('solrsearch/solr')->threadEnable;
     $this->indexer = Mage::getResourceModel('solrsearch/indexer');
     parent::_construct();
 }
 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.'));
     }
 }
 public function preDispatch()
 {
     parent::preDispatch();
     $this->_customer_addressTypeId = Mage::getModel('eav/entity')->setType('customer_address')->getTypeId();
     $this->_block = 'address';
     $this->_type = 'customer_address';
 }
示例#8
0
 /**
  * Define active menu item in menu block
  *
  * @param $menuPath
  * @return Mage_Adminhtml_Controller_Action
  */
 protected function _setActiveMenu($menuPath)
 {
     parent::_setActiveMenu($menuPath);
     if (method_exists($this, '_title')) {
         try {
             $labels = array();
             $parts = explode("/", $menuPath);
             /** @var $menu Mage_Adminhtml_Block_Page_Menu */
             $menu = $this->getLayout()->getBlock('menu');
             $children = $menu->getMenuArray();
             foreach ($parts as $part) {
                 if ($label = $this->_getPartNameFromChildren($part, $children)) {
                     $labels[] = $label;
                 } else {
                     break;
                 }
             }
             if (count($labels)) {
                 $this->_title();
                 foreach ($labels as $label) {
                     $this->_title($label);
                 }
             }
         } catch (Exception $e) {
             $this->_commonHelper()->getException()->logException($e);
         }
     }
     return $this;
 }
 public function preDispatch()
 {
     parent::preDispatch();
     $this->_categoryTypeId = Mage::getModel('eav/entity')->setType('catalog_category')->getTypeId();
     $this->_block = 'category';
     $this->_type = 'catalog_category';
 }
 protected function _construct()
 {
     $this->includePhpApi();
     Qualityunit_Liveagent_Helper_Data::convertOldButton();
     parent::_construct();
     $this->settings = new Qualityunit_Liveagent_Helper_Settings();
 }
 /**
  * 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');
     }
 }
 public function preDispatch()
 {
     if ($this->getRequest()->getActionName() == 'auth') {
         Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
     }
     parent::preDispatch();
 }
 protected function _title($text = null, $resetIfExists = true)
 {
     if (!Mage::helper('sarp')->checkVersion('1.4.0.0')) {
         return $this;
     }
     return parent::_title($text, $resetIfExists);
 }
 public function preDispatch()
 {
     parent::preDispatch();
     if ($this->getRequest()->getActionName() != 'error' && !$this->checkLocalCodePool()) {
         $this->_forward('error');
     }
 }
示例#15
0
 protected function _title($text = null, $resetIfExists = true)
 {
     if (Mage::helper('ambase')->isVersionLessThan(1, 4)) {
         return $this;
     }
     return parent::_title($text, $resetIfExists);
 }
示例#16
0
 public function __construct($op1 = NULL, $op2 = NULL, $op3 = array())
 {
     if ($op1 != NULL) {
         return parent::__construct($op1, $op2, $op3);
     } else {
         return $this;
     }
 }
示例#17
0
 /**
  * Dispatches controller_action_postdispatch_adminhtml Event (as not Adminhtml router)
  */
 public function postDispatch()
 {
     parent::postDispatch();
     if ($this->getFlag('', self::FLAG_NO_POST_DISPATCH)) {
         return;
     }
     Mage::dispatchEvent('controller_action_postdispatch_adminhtml', array('controller_action' => $this));
 }
 public function preDispatch()
 {
     parent::preDispatch();
     /* if (!Mage::helper('storecredit')->moduleEnabled() && $this->getRequest()->getActionName() != 'noroute') {
            $this->_forward('noroute');
        }*/
     return $this;
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
 public function preDispatch()
 {
     parent::preDispatch();
     /**
      * trick autoloader because the class Google_Service_ShoppingContent is included in the file
      * Google/Service/ShoppingContent.php which contains all other classes Google_Service_ShoppingContent_*
      */
     new Google_Service_ShoppingContent(Mage::getSingleton('gshoppingv2/googleShopping')->getClient(null));
 }
示例#23
0
 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;
 }
 /**
  * Initializes the PEAR service implementation.
  *
  * @return void
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     // call the parent constructor
     parent::__construct($request, $response, $invokeArgs);
     // initialize the PEAR service implementation
     $this->_service = Faett_Core_Factory::get(Mage::getBaseDir());
     // initialize the console log stream in 'html' mode
     $this->_service->getUI()->setLogStream($this->_logStream = fopen('php://memory', 'w+'));
 }
 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;
 }
 protected function _title($text = null, $resetIfExists = true)
 {
     $helper = Mage::helper('massimporterpro');
     if ($helper->checkVersion('1.3.2.4', '<=')) {
         return $this;
     } else {
         return parent::_title($text, $resetIfExists);
     }
 }
 function _construct()
 {
     parent::_construct();
     Mage::getSingleton('core/session', array('name' => 'adminhtml'));
     if (Mage::app()->getRequest()->getParam('isAjax') && !Mage::getSingleton('admin/session')->isLoggedIn()) {
         echo json_encode(array('ajaxExpired' => 1, 'ajaxRedirect' => $this->getUrl("thememanager/adminhtml_thememanager/index")));
         die;
     }
 }
示例#28
0
 protected function _setActiveMenu($menuPath)
 {
     parent::_setActiveMenu($menuPath);
     /**
      *  Save current report access key for limitaton of Custom Options dialog
      *  @see AW_Advancedreports_Block_Adminhtml_Setup
      */
     Mage::register(AW_Advancedreports_Block_Adminhtml_Setup::DATA_KEY_SECURE_CHECK, $menuPath, true);
     return $this;
 }
示例#29
0
 /**
  * preDispatch - called before every action
  */
 public function preDispatch()
 {
     parent::preDispatch();
     $this->_helper = Mage::helper('ash_slideshow');
     $this->_slideshowModel = Mage::getModel('ash_slideshow/slideshow');
     $this->_assetModel = Mage::getModel('ash_slideshow/asset');
     $this->_imageUrl = 'ash_slideshow_assets' . DS . 'image' . DS;
     $this->_mediaAbsolutePath = Mage::getBaseDir('media');
     $this->_prependRandom = str_shuffle('abcdefghijklmnopqrstuvxwyz');
 }
示例#30
0
 public function hasAction($action)
 {
     /* @var $adminPageHelper Mana_Admin_Helper_Page */
     $adminPageHelper = Mage::helper('mana_admin/page');
     if ($adminPageHelper->getPageLayout($this->getRequest())) {
         return true;
     } else {
         return parent::hasAction($action);
     }
 }