Ejemplo n.º 1
0
 protected function _construct()
 {
     $this->_systemConfig = $this->hasData('systemConfig') ? $this->getData('systemConfig') : Mage::getSingleton('Mage_Backend_Model_Config_Structure_Reader')->getConfiguration();
     parent::_construct();
     $sectionCode = $this->getRequest()->getParam('section');
     $this->_section = $this->_systemConfig->getSection($sectionCode);
     $this->setTitle($this->_section['label']);
     $this->setHeaderCss(isset($this->_section['header_css']) ? $this->_section['header_css'] : '');
 }
Ejemplo n.º 2
0
 /**
  * Initialize form
  *
  * @return Mage_Backend_Block_System_Config_Form
  */
 public function initForm()
 {
     $this->_initObjects();
     /** @var Varien_Data_Form $form */
     $form = $this->_formFactory->create();
     $section = $this->_systemConfig->getSection($this->getSectionCode(), $this->getWebsiteCode(), $this->getStoreCode());
     if (!empty($section) && false !== $this->_canShowField($section)) {
         $groups = $section['groups'];
         usort($groups, array($this, '_sortForm'));
         foreach ($groups as $group) {
             /* @var $group array */
             if (false == $this->_canShowField($group)) {
                 continue;
             }
             $this->_initGroup($group, $section, $form);
         }
     }
     $this->setForm($form);
     return $this;
 }