Esempio n. 1
0
 public function _construct()
 {
     if ($this->hasData('grouped')) {
         $this->_isGrouped = (bool) $this->getData('grouped');
     }
     parent::_construct();
 }
Esempio n. 2
0
 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');
     }
 }
Esempio n. 3
0
 /**
  * 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');
     }
 }
Esempio n. 4
0
 public function __construct()
 {
     parent::__construct();
 }
Esempio n. 5
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('Mage_Backend::widget/accordion.phtml');
 }
Esempio n. 6
0
 /**
  * Define block template
  */
 protected function _construct()
 {
     $this->setTemplate('Mage_Backend::widget/button/split.phtml');
     parent::_construct();
 }
Esempio n. 7
0
 /**
  * @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') . '/');
 }
Esempio n. 8
0
 /**
  * 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();
 }
Esempio n. 9
0
 /**
  * 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.')));
 }
Esempio n. 10
0
 public function __construct($data = array())
 {
     parent::__construct($data);
 }
Esempio n. 11
0
 /**
  * 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 : '#';
 }
Esempio n. 12
0
 public function testGetSuffixId()
 {
     $block = new Mage_Backend_Block_Widget();
     $this->assertStringEndsNotWith('_test', $block->getSuffixId('suffix'));
     $this->assertStringEndsWith('_test', $block->getSuffixId('test'));
 }
Esempio n. 13
0
 /**
  * Initialize grid before rendering
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _beforeToHtml()
 {
     $this->_prepareGrid();
     return parent::_beforeToHtml();
 }
Esempio n. 14
0
 /**
  * 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();
 }
Esempio n. 15
0
 /**
  * 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.')));
 }
Esempio n. 16
0
 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'));
 }
Esempio n. 17
0
 /**
  * @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();
 }
Esempio n. 18
0
 /**
  * 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();
 }
Esempio n. 19
0
 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();
 }
Esempio n. 20
0
 /**
  * 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);
 }