Exemplo n.º 1
0
 /**
  * Getter for period unit options with "Please Select" label
  *
  * @return array
  */
 protected function _getPeriodUnitOptions($emptyLabel)
 {
     $options = array();
     $options[''] = $emptyLabel;
     foreach (Customweb_Subscription_Model_PeriodUnit::values() as $periodUnit) {
         $options[$periodUnit->getName()] = $periodUnit->getLabel();
     }
     return $options;
 }
Exemplo n.º 2
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $this->setElement($element);
     $value = $this->_getValue();
     $html = '<input style="width: 50px;" id="' . $this->getElement()->getHtmlId() . '-count" name="' . $this->getElement()->getName() . '[count]" value="' . (isset($value['count']) ? $value['count'] : '') . '" class=" input-text" type="text" ' . $this->_getDisabled() . '>';
     $html .= '<select style="width: 234px; margin-left: 10px; id="' . $this->getElement()->getHtmlId() . '-unit" name="' . $this->getElement()->getName() . '[unit]" ' . $this->_getDisabled() . '>';
     foreach (Customweb_Subscription_Model_PeriodUnit::values() as $unit) {
         $html .= '<option value="' . $unit->getName() . '" ' . (isset($value['unit']) && $value['unit'] == $unit->getName() ? 'selected="selected"' : '') . '>' . $unit->getLabel() . '</option>';
     }
     $html .= '</select>';
     return $html;
 }