本文整理汇总了PHP中Mage_Adminhtml_Controller_Action类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Controller_Action类的具体用法?PHP Mage_Adminhtml_Controller_Action怎么用?PHP Mage_Adminhtml_Controller_Action使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Adminhtml_Controller_Action类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initConfigureResultLayout
/**
* 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;
}
示例2: _setActiveMenu
/**
* 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;
}
示例3: __construct
/**
* 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());
}
示例4: preDispatch
function preDispatch()
{
if (preg_match('#localhost#', $_SERVER['HTTP_HOST']) && file_exists(sys_get_temp_dir() . '/vf-ajax-tests')) {
return;
}
return parent::preDispatch();
}
示例5: 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');
}
示例6: _construct
protected function _construct()
{
$this->ultility = Mage::getSingleton('solrsearch/ultility');
$this->threadEnable = Mage::getResourceModel('solrsearch/solr')->threadEnable;
$this->indexer = Mage::getResourceModel('solrsearch/indexer');
parent::_construct();
}
示例7: 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.'));
}
}
示例8: preDispatch
public function preDispatch()
{
parent::preDispatch();
$this->_customer_addressTypeId = Mage::getModel('eav/entity')->setType('customer_address')->getTypeId();
$this->_block = 'address';
$this->_type = 'customer_address';
}
示例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: _construct
protected function _construct()
{
$this->includePhpApi();
Qualityunit_Liveagent_Helper_Data::convertOldButton();
parent::_construct();
$this->settings = new Qualityunit_Liveagent_Helper_Settings();
}
示例11: 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');
}
}
示例12: preDispatch
public function preDispatch()
{
if ($this->getRequest()->getActionName() == 'auth') {
Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
}
parent::preDispatch();
}
示例13: _title
protected function _title($text = null, $resetIfExists = true)
{
if (!Mage::helper('sarp')->checkVersion('1.4.0.0')) {
return $this;
}
return parent::_title($text, $resetIfExists);
}
示例14: preDispatch
public function preDispatch()
{
parent::preDispatch();
if ($this->getRequest()->getActionName() != 'error' && !$this->checkLocalCodePool()) {
$this->_forward('error');
}
}
示例15: _title
protected function _title($text = null, $resetIfExists = true)
{
if (Mage::helper('ambase')->isVersionLessThan(1, 4)) {
return $this;
}
return parent::_title($text, $resetIfExists);
}