Public Member Functions | |
__construct ($attributes=array()) | |
getSeparator () | |
getElementHtml () | |
Protected Member Functions | |
_optionToHtml ($option, $selected) |
Definition at line 34 of file Radios.php.
__construct | ( | $ | attributes = array() |
) |
Enter description here...
array | $attributes |
Reimplemented from Varien_Data_Form_Element_Abstract.
Definition at line 36 of file Radios.php.
00037 { 00038 parent::__construct($attributes); 00039 $this->setType('radios'); 00040 }
_optionToHtml | ( | $ | option, | |
$ | selected | |||
) | [protected] |
Definition at line 64 of file Radios.php.
00065 { 00066 $html = '<input type="radio"'.$this->serialize(array('name', 'class', 'style')); 00067 if (is_array($option)) { 00068 $html.= 'value="'.$this->_escape($option['value']).'" id="'.$this->getHtmlId().$option['value'].'"'; 00069 if ($option['value'] == $selected) { 00070 $html.= ' checked="checked"'; 00071 } 00072 $html.= ' />'; 00073 $html.= '<label class="inline" for="'.$this->getHtmlId().$option['value'].'">'.$option['label'].'</label>'; 00074 } 00075 elseif ($option instanceof Varien_Object) { 00076 $html.= 'id="'.$this->getHtmlId().$option->getValue().'"'.$option->serialize(array('label', 'title', 'value', 'class', 'style')); 00077 if (in_array($option->getValue(), $selected)) { 00078 $html.= ' checked="checked"'; 00079 } 00080 $html.= ' />'; 00081 $html.= '<label class="inline" for="'.$this->getHtmlId().$option->getValue().'">'.$option->getLabel().'</label>'; 00082 } 00083 $html.= $this->getSeparator() . "\n"; 00084 return $html; 00085 }
getElementHtml | ( | ) |
Reimplemented from Varien_Data_Form_Element_Abstract.
Definition at line 51 of file Radios.php.
00052 { 00053 $html = ''; 00054 $value = $this->getValue(); 00055 if ($values = $this->getValues()) { 00056 foreach ($values as $option) { 00057 $html.= $this->_optionToHtml($option, $value); 00058 } 00059 } 00060 $html.= $this->getAfterElementHtml(); 00061 return $html; 00062 }
getSeparator | ( | ) |
Definition at line 42 of file Radios.php.
00043 { 00044 $separator = $this->getData('separator'); 00045 if (is_null($separator)) { 00046 $separator = ' '; 00047 } 00048 return $separator; 00049 }