Public Member Functions | |
__construct ($attributes=array()) | |
addElement (Varien_Data_Form_Element_Abstract $element, $after=false) | |
getId () | |
getType () | |
getForm () | |
setId ($id) | |
getHtmlId () | |
getName () | |
setType ($type) | |
setForm ($form) | |
removeField ($elementId) | |
getHtmlAttributes () | |
addClass ($class) | |
getEscapedValue ($index=null) | |
setRenderer (Varien_Data_Form_Element_Renderer_Interface $renderer) | |
getRenderer () | |
getElementHtml () | |
getAfterElementHtml () | |
getLabelHtml ($idSuffix= '') | |
getDefaultHtml () | |
getHtml () | |
toHtml () | |
serialize ($attributes=array(), $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
setReadonly ($readonly, $useDisabled=false) | |
getReadonly () | |
Protected Member Functions | |
_escape ($string) | |
Protected Attributes | |
$_id | |
$_type | |
$_form | |
$_elements | |
$_renderer |
Definition at line 35 of file Abstract.php.
__construct | ( | $ | attributes = array() |
) |
Enter description here...
array | $attributes |
Reimplemented from Varien_Data_Form_Abstract.
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean, Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price, Mage_Adminhtml_Block_System_Config_Form_Field_Import, Varien_Data_Form_Element_Button, Varien_Data_Form_Element_Checkbox, Varien_Data_Form_Element_Checkboxes, Varien_Data_Form_Element_Column, Varien_Data_Form_Element_Date, Varien_Data_Form_Element_Editor, Varien_Data_Form_Element_Fieldset, Varien_Data_Form_Element_File, Varien_Data_Form_Element_Gallery, Varien_Data_Form_Element_Hidden, Varien_Data_Form_Element_Image, Varien_Data_Form_Element_Imagefile, Varien_Data_Form_Element_Label, Varien_Data_Form_Element_Multiline, Varien_Data_Form_Element_Multiselect, Varien_Data_Form_Element_Note, Varien_Data_Form_Element_Password, Varien_Data_Form_Element_Radio, Varien_Data_Form_Element_Radios, Varien_Data_Form_Element_Reset, Varien_Data_Form_Element_Select, Varien_Data_Form_Element_Submit, Varien_Data_Form_Element_Text, Varien_Data_Form_Element_Textarea, and Varien_Data_Form_Element_Time.
Definition at line 43 of file Abstract.php.
00044 { 00045 parent::__construct($attributes); 00046 $this->_renderer = Varien_Data_Form::getElementRenderer(); 00047 }
_escape | ( | $ | string | ) | [protected] |
addClass | ( | $ | class | ) |
Definition at line 126 of file Abstract.php.
00127 { 00128 $oldClass = $this->getClass(); 00129 $this->setClass($oldClass.' '.$class); 00130 return $this; 00131 }
addElement | ( | Varien_Data_Form_Element_Abstract $ | element, | |
$ | after = false | |||
) |
Add form element
Varien_Data_Form_Element_Abstract | $element |
Reimplemented from Varien_Data_Form_Abstract.
Definition at line 55 of file Abstract.php.
00056 { 00057 if ($this->getForm()) { 00058 $this->getForm()->checkElementId($element->getId()); 00059 $this->getForm()->addElementToCollection($element); 00060 } 00061 00062 parent::addElement($element, $after); 00063 return $this; 00064 }
getAfterElementHtml | ( | ) |
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price, and Mage_Adminhtml_Block_System_Config_Form_Field_Select_Allowspecific.
Definition at line 167 of file Abstract.php.
00168 { 00169 return $this->getData('after_element_html'); 00170 }
getDefaultHtml | ( | ) |
Reimplemented in Varien_Data_Form_Element_Fieldset, Varien_Data_Form_Element_Hidden, Varien_Data_Form_Element_Multiline, and Varien_Data_Form_Element_Multiselect.
Definition at line 184 of file Abstract.php.
00185 { 00186 $html = $this->getData('default_html'); 00187 if (is_null($html)) { 00188 $html = ( $this->getNoSpan() === true ) ? '' : '<span class="field-row">'."\n"; 00189 $html.= $this->getLabelHtml(); 00190 $html.= $this->getElementHtml(); 00191 $html.= ( $this->getNoSpan() === true ) ? '' : '</span>'."\n"; 00192 } 00193 return $html; 00194 }
getElementHtml | ( | ) |
Reimplemented in Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Available, Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Default, Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Apply, Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery, Mage_Adminhtml_Block_System_Config_Form_Field_Export, Mage_Adminhtml_Block_System_Config_Form_Field_Import, Varien_Data_Form_Element_Checkbox, Varien_Data_Form_Element_Checkboxes, Varien_Data_Form_Element_Date, Varien_Data_Form_Element_Editor, Varien_Data_Form_Element_Fieldset, Varien_Data_Form_Element_Gallery, Varien_Data_Form_Element_Image, Varien_Data_Form_Element_Label, Varien_Data_Form_Element_Multiline, Varien_Data_Form_Element_Multiselect, Varien_Data_Form_Element_Note, Varien_Data_Form_Element_Radios, Varien_Data_Form_Element_Select, Varien_Data_Form_Element_Textarea, and Varien_Data_Form_Element_Time.
Definition at line 159 of file Abstract.php.
00160 { 00161 $html = '<input id="'.$this->getHtmlId().'" name="'.$this->getName() 00162 .'" value="'.$this->getEscapedValue().'" '.$this->serialize($this->getHtmlAttributes()).'/>'."\n"; 00163 $html.= $this->getAfterElementHtml(); 00164 return $html; 00165 }
getEscapedValue | ( | $ | index = null |
) |
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price, and Varien_Data_Form_Element_Obscure.
Definition at line 138 of file Abstract.php.
00139 { 00140 $value = $this->getValue($index); 00141 00142 if ($filter = $this->getValueFilter()) { 00143 $value = $filter->filter($value); 00144 } 00145 return $this->_escape($value); 00146 }
getForm | ( | ) |
getHtml | ( | ) |
Reimplemented in Mage_Adminhtml_Block_System_Config_Form_Field_Select_Allowspecific, Varien_Data_Form_Element_Password, Varien_Data_Form_Element_Submit, and Varien_Data_Form_Element_Text.
Definition at line 196 of file Abstract.php.
00197 { 00198 if ($this->_renderer) { 00199 $html = $this->_renderer->render($this); 00200 } 00201 else { 00202 $html = $this->getDefaultHtml(); 00203 } 00204 return $html; 00205 }
getHtmlAttributes | ( | ) |
Reimplemented in Varien_Data_Form_Element_Checkbox, Varien_Data_Form_Element_Checkboxes, Varien_Data_Form_Element_Multiline, Varien_Data_Form_Element_Multiselect, Varien_Data_Form_Element_Select, Varien_Data_Form_Element_Text, and Varien_Data_Form_Element_Textarea.
Definition at line 121 of file Abstract.php.
00122 { 00123 return array('type', 'title', 'class', 'style', 'onclick', 'onchange', 'disabled', 'readonly'); 00124 }
getHtmlId | ( | ) |
Definition at line 88 of file Abstract.php.
00089 { 00090 return $this->getForm()->getHtmlIdPrefix() . $this->getData('html_id') . $this->getForm()->getHtmlIdSuffix(); 00091 }
getId | ( | ) |
Retrieve object id
Reimplemented from Varien_Object.
Definition at line 66 of file Abstract.php.
getLabelHtml | ( | $ | idSuffix = '' |
) |
Reimplemented in Varien_Data_Form_Element_Multiline.
Definition at line 172 of file Abstract.php.
00173 { 00174 if (!is_null($this->getLabel())) { 00175 $html = '<label for="'.$this->getHtmlId() . $idSuffix . '">'.$this->getLabel() 00176 . ( $this->getRequired() ? ' <span class="required">*</span>' : '' ).'</label>'."\n"; 00177 } 00178 else { 00179 $html = ''; 00180 } 00181 return $html; 00182 }
getName | ( | ) |
Reimplemented in Varien_Data_Form_Element_Gallery, Varien_Data_Form_Element_Image, Varien_Data_Form_Element_Multiselect, and Varien_Data_Form_Element_Time.
Definition at line 93 of file Abstract.php.
00094 { 00095 $name = $this->getData('name'); 00096 if ($suffix = $this->getForm()->getFieldNameSuffix()) { 00097 $name = $this->getForm()->addSuffixToName($name, $suffix); 00098 } 00099 return $name; 00100 }
getReadonly | ( | ) |
Definition at line 241 of file Abstract.php.
00242 { 00243 if ($this->hasData('readonly_disabled')) { 00244 return $this->_getData('readonly_disabled'); 00245 } 00246 00247 return $this->_getData('readonly'); 00248 }
getRenderer | ( | ) |
getType | ( | ) |
removeField | ( | $ | elementId | ) |
Enter description here...
string | $elementId |
Reimplemented from Varien_Data_Form_Abstract.
Definition at line 115 of file Abstract.php.
00116 { 00117 $this->getForm()->removeField($elementId); 00118 return parent::removeField($elementId); 00119 }
serialize | ( | $ | attributes = array() , |
|
$ | valueSeparator = '=' , |
|||
$ | fieldSeparator = ' ' , |
|||
$ | quote = '"' | |||
) |
serialize object attributes
array | $attributes | |
string | $valueSeparator | |
string | $fieldSeparator | |
string | $quote |
Reimplemented from Varien_Object.
Definition at line 212 of file Abstract.php.
00213 { 00214 if (in_array('disabled', $attributes) && !empty($this->_data['disabled'])) { 00215 $this->_data['disabled'] = 'disabled'; 00216 } 00217 else { 00218 unset($this->_data['disabled']); 00219 } 00220 if (in_array('checked', $attributes) && !empty($this->_data['checked'])) { 00221 $this->_data['checked'] = 'checked'; 00222 } 00223 else { 00224 unset($this->_data['checked']); 00225 } 00226 return parent::serialize($attributes, $valueSeparator, $fieldSeparator, $quote); 00227 }
setForm | ( | $ | form | ) |
setId | ( | $ | value | ) |
Set object id field value
mixed | $value |
Reimplemented from Varien_Object.
Definition at line 81 of file Abstract.php.
00082 { 00083 $this->_id = $id; 00084 $this->setData('html_id', $id); 00085 return $this; 00086 }
setReadonly | ( | $ | readonly, | |
$ | useDisabled = false | |||
) |
Definition at line 229 of file Abstract.php.
00230 { 00231 if ($useDisabled) { 00232 $this->setDisabled($readonly); 00233 $this->setData('readonly_disabled', $readonly); 00234 } else { 00235 $this->setData('readonly', $readonly); 00236 } 00237 00238 return $this; 00239 }
setRenderer | ( | Varien_Data_Form_Element_Renderer_Interface $ | renderer | ) |
setType | ( | $ | type | ) |
Definition at line 102 of file Abstract.php.
00103 { 00104 $this->_type = $type; 00105 $this->setData('type', $type); 00106 return $this; 00107 }
toHtml | ( | ) |
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery.
Definition at line 207 of file Abstract.php.
00208 { 00209 return $this->getHtml(); 00210 }
$_elements [protected] |
$_form [protected] |
Definition at line 39 of file Abstract.php.
$_id [protected] |
Definition at line 37 of file Abstract.php.
$_renderer [protected] |
Definition at line 41 of file Abstract.php.
$_type [protected] |
Definition at line 38 of file Abstract.php.