Exemplo n.º 1
0
 /**
  * Add a field to the form or fieldset
  * Form and fieldset have same abstract
  *
  * @param Varien_Data_Form|Varien_Data_Form_Element_Fieldset $formOrFieldset
  * @param string $elementName
  * @param array $options
  * @param string $type
  * @return Varien_Data_Form_Element_Abstract
  */
 protected function _addField($formOrFieldset, $elementName, $options = array(), $type = 'text')
 {
     $options = array_merge($options, array('name' => $elementName, 'label' => $this->_profile->getFieldLabel($elementName), 'note' => $this->_profile->getFieldComment($elementName), 'disabled' => $this->_isReadOnly));
     if (in_array($elementName, array('period_unit', 'period_frequency'))) {
         $options['required'] = true;
     }
     return $formOrFieldset->addField($elementName, $type, $options);
 }