Example #1
0
 /**
  * Preparing global layout
  *
  * You can redefine this method in child classes for changing layout
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _prepareLayout()
 {
     Varien_Data_Form::setElementRenderer($this->getLayout()->createBlock('Mage_Backend_Block_Widget_Form_Renderer_Element', $this->getNameInLayout() . '_element'));
     Varien_Data_Form::setFieldsetRenderer($this->getLayout()->createBlock('Mage_Backend_Block_Widget_Form_Renderer_Fieldset', $this->getNameInLayout() . '_fieldset'));
     Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('Mage_Backend_Block_Widget_Form_Renderer_Fieldset_Element', $this->getNameInLayout() . '_fieldset_element'));
     return parent::_prepareLayout();
 }
Example #2
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();
 }
Example #3
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();
 }
Example #4
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();
 }