public function _construct() { if ($this->hasData('grouped')) { $this->_isGrouped = (bool) $this->getData('grouped'); } parent::_construct(); }
protected function _construct() { parent::_construct(); $this->setErrorText($this->helper('Mage_Backend_Helper_Data')->jsQuoteEscape($this->helper('Mage_Backend_Helper_Data')->__('Please select items.'))); if (null !== $this->getOptions()) { foreach ($this->getOptions() as $optionId => $option) { $this->addItem($optionId, $option); } $this->unsetData('options'); } }
/** * Sets Massaction template */ public function __construct(array $data = array()) { parent::__construct($data); $this->setTemplate('Mage_Backend::widget/grid/massaction.phtml'); $this->_helper = isset($data['helper']) ? $data['helper'] : Mage::helper('Mage_Backend_Helper_Data'); if (!$this->_helper instanceof Mage_Backend_Helper_Data) { throw new InvalidArgumentException('Helper must be instance of Mage_Backend_Helper_Data'); } $this->setErrorText($this->_helper->jsQuoteEscape($this->_helper->__('Please select items.'))); if (null !== $this->getOptions()) { foreach ($this->getOptions() as $optionId => $option) { $this->addItem($optionId, $option); } $this->unsetData('options'); } }
public function __construct() { parent::__construct(); }
public function __construct() { parent::__construct(); $this->setTemplate('Mage_Backend::widget/accordion.phtml'); }
/** * Define block template */ protected function _construct() { $this->setTemplate('Mage_Backend::widget/button/split.phtml'); parent::_construct(); }
/** * @param Mage_Core_Controller_Request_Http $request * @param Mage_Core_Model_Layout $layout * @param Mage_Core_Model_Event_Manager $eventManager * @param Mage_Backend_Model_Url $urlBuilder * @param Mage_Core_Model_Translate $translator * @param Mage_Core_Model_Cache $cache * @param Mage_Core_Model_Design_Package $designPackage * @param Mage_Core_Model_Session $session * @param Mage_Core_Model_Store_Config $storeConfig * @param Mage_Core_Controller_Varien_Front $frontController * @param Mage_Core_Model_Factory_Helper $helperFactory * @param Magento_Filesystem $filesystem * @param Mage_Backend_Model_Config_Structure $configStructure * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct(Mage_Core_Controller_Request_Http $request, Mage_Core_Model_Layout $layout, Mage_Core_Model_Event_Manager $eventManager, Mage_Backend_Model_Url $urlBuilder, Mage_Core_Model_Translate $translator, Mage_Core_Model_Cache $cache, Mage_Core_Model_Design_Package $designPackage, Mage_Core_Model_Session $session, Mage_Core_Model_Store_Config $storeConfig, Mage_Core_Controller_Varien_Front $frontController, Mage_Core_Model_Factory_Helper $helperFactory, Magento_Filesystem $filesystem, Mage_Backend_Model_Config_Structure $configStructure, array $data = array()) { parent::__construct($request, $layout, $eventManager, $urlBuilder, $translator, $cache, $designPackage, $session, $storeConfig, $frontController, $helperFactory, $filesystem, $data); $this->_tabs = $configStructure->getTabs(); $this->setId('system_config_tabs'); $this->setTitle($this->helper('Mage_Backend_Helper_Data')->__('Configuration')); $this->_currentSectionId = $this->getRequest()->getParam('section'); $this->helper('Mage_Backend_Helper_Data')->addPageHelpUrl($this->getRequest()->getParam('section') . '/'); }
/** * This method is called before rendering HTML * * @return Mage_Backend_Block_Widget_Form|Mage_Core_Block_Abstract */ protected function _beforeToHtml() { $this->_prepareForm(); $this->_initFormValues(); return parent::_beforeToHtml(); }
/** * Sets Massaction template */ public function __construct() { parent::__construct(); $this->setTemplate('Mage_Backend::widget/grid/massaction.phtml'); $this->setErrorText(Mage::helper('Mage_Backend_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Backend_Helper_Data')->__('Please select items.'))); }
public function __construct($data = array()) { parent::__construct($data); }
/** * Return row url for js event handlers * * @param Mage_Catalog_Model_Product|Varien_Object * @return string */ public function getRowUrl($item) { $res = parent::getRowUrl($item); return $res ? $res : '#'; }
public function testGetSuffixId() { $block = new Mage_Backend_Block_Widget(); $this->assertStringEndsNotWith('_test', $block->getSuffixId('suffix')); $this->assertStringEndsWith('_test', $block->getSuffixId('test')); }
/** * Initialize grid before rendering * * @return Mage_Core_Block_Abstract */ protected function _beforeToHtml() { $this->_prepareGrid(); return parent::_beforeToHtml(); }
/** * Prepare layout object * * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { /** @var $section Mage_Backend_Model_Config_Structure_Element_Section */ $section = $this->_configStructure->getElement($this->getRequest()->getParam('section')); $this->_formBlockName = $section->getFrontendModel(); if (empty($this->_formBlockName)) { $this->_formBlockName = self::DEFAULT_SECTION_BLOCK; } $this->setTitle($section->getLabel()); $this->setHeaderCss($section->getHeaderCss()); $this->addChild('save_button', 'Mage_Backend_Block_Widget_Button', array('label' => Mage::helper('Mage_Backend_Helper_Data')->__('Save Config'), 'class' => 'save', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'save', 'target' => '#config-edit-form'))))); $block = $this->getLayout()->createBlock($this->_formBlockName); $this->setChild('form', $block); return parent::_prepareLayout(); }
/** * Sets Massaction template */ public function _construct() { parent::_construct(); $this->setErrorText(Mage::helper('Mage_Backend_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Backend_Helper_Data')->__('Please select items.'))); }
protected function _construct() { parent::_construct(); $this->_systemConfig = $this->hasData('systemConfig') ? $this->getData('systemConfig') : Mage::getSingleton('Mage_Backend_Model_Config_Structure_Reader')->getConfiguration(); $this->setId('system_config_tabs'); $this->setTitle($this->helper('Mage_Backend_Helper_Data')->__('Configuration')); }
/** * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { $this->addChild('save_button', 'Mage_Backend_Block_Widget_Button', array('label' => Mage::helper('Mage_Backend_Helper_Data')->__('Save Config'), 'class' => 'save', 'data_attr' => array('widget-button' => array('event' => 'save', 'related' => '#config-edit-form')))); return parent::_prepareLayout(); }
/** * Prepare export button * * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { $this->setChild('export_button', $this->getLayout()->createBlock('Mage_Backend_Block_Widget_Button')->setData(array('label' => Mage::helper('Mage_Backend_Helper_Data')->__('Export'), 'onclick' => $this->getParentBlock()->getJsObjectName() . '.doExport()', 'class' => 'task'))); return parent::_prepareLayout(); }
protected function _beforeToHtml() { if ($activeTab = $this->getRequest()->getParam('active_tab')) { $this->setActiveTab($activeTab); } elseif ($activeTabId = Mage::getSingleton('Mage_Backend_Model_Auth_Session')->getActiveTabId()) { $this->_setActiveTab($activeTabId); } $_new = array(); foreach ($this->_tabs as $key => $tab) { foreach ($this->_tabs as $k => $t) { if ($t->getAfter() == $key) { $_new[$key] = $tab; $_new[$k] = $t; } else { if (!$tab->getAfter() || !in_array($tab->getAfter(), array_keys($this->_tabs))) { $_new[$key] = $tab; } } } } $this->_tabs = $_new; unset($_new); $this->assign('tabs', $this->_tabs); return parent::_beforeToHtml(); }
/** * Block constructor * * @param array $data */ public function __construct($data = array()) { $this->_rendererTypes = array('date' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Date', 'datetime' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Datetime', 'number' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Number', 'currency' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Currency', 'price' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Price', 'country' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Country', 'concat' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Concat', 'action' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Action', 'options' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Options', 'checkbox' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Checkbox', 'massaction' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Massaction', 'radio' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Radio', 'input' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Input', 'select' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Select', 'text' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Longtext', 'store' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Store', 'wrapline' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Wrapline', 'default' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Text'); $this->_filterTypes = array('datetime' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Datetime', 'date' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Date', 'range' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Range', 'number' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Range', 'currency' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Range', 'price' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Price', 'country' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Country', 'options' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Select', 'massaction' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Massaction', 'checkbox' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Checkbox', 'radio' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Radio', 'store' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Store', 'theme' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Theme', 'default' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Text'); parent::__construct($data); }