Public Member Functions | |
getDataObject () | |
getAttribute () | |
getAttributeCode () | |
canDisplayUseDefault () | |
usedDefault () | |
checkFieldDisable () | |
getScopeLabel () | |
getElementLabelHtml () | |
getElementHtml () | |
Protected Member Functions | |
_construct () |
Definition at line 34 of file Element.php.
_construct | ( | ) | [protected] |
Initialize block template
Reimplemented from Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element.
Definition at line 39 of file Element.php.
canDisplayUseDefault | ( | ) |
Check "Use default" checkbox display availability
Definition at line 79 of file Element.php.
00080 { 00081 if ($attribute = $this->getAttribute()) { 00082 if (!$attribute->isScopeGlobal() 00083 && $this->getDataObject() 00084 && $this->getDataObject()->getId() 00085 && $this->getDataObject()->getStoreId()) { 00086 return true; 00087 } 00088 } 00089 return false; 00090 }
checkFieldDisable | ( | ) |
Disable field in default value using case
Definition at line 108 of file Element.php.
00109 { 00110 if ($this->canDisplayUseDefault() && $this->usedDefault()) { 00111 $this->getElement()->setDisabled(true); 00112 } 00113 return $this; 00114 }
getAttribute | ( | ) |
Retireve associated with element attribute object
Definition at line 59 of file Element.php.
00060 { 00061 return $this->getElement()->getEntityAttribute(); 00062 }
getAttributeCode | ( | ) |
Retrieve associated attribute code
Definition at line 69 of file Element.php.
00070 { 00071 return $this->getAttribute()->getAttributeCode(); 00072 }
getDataObject | ( | ) |
Retrieve data object related with form
Definition at line 49 of file Element.php.
00050 { 00051 return $this->getElement()->getForm()->getDataObject(); 00052 }
getElementHtml | ( | ) |
Retrieve element html
Reimplemented in Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Extend, and Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Special.
Definition at line 158 of file Element.php.
00159 { 00160 return $this->getElement()->getElementHtml(); 00161 }
getElementLabelHtml | ( | ) |
Retrieve element label html
Definition at line 148 of file Element.php.
00149 { 00150 return $this->getElement()->getLabelHtml(); 00151 }
getScopeLabel | ( | ) |
Retrieve label of attribute scope
GLOBAL | WEBSITE | STORE
Definition at line 123 of file Element.php.
00124 { 00125 $html = ''; 00126 $attribute = $this->getElement()->getEntityAttribute(); 00127 if (!$attribute || Mage::app()->isSingleStoreMode() || $attribute->getFrontendInput()=='gallery') { 00128 return $html; 00129 } 00130 if ($attribute->isScopeGlobal()) { 00131 $html.= '[GLOBAL]'; 00132 } 00133 elseif ($attribute->isScopeWebsite()) { 00134 $html.= '[WEBSITE]'; 00135 } 00136 elseif ($attribute->isScopeStore()) { 00137 $html.= '[STORE VIEW]'; 00138 } 00139 00140 return $html; 00141 }
usedDefault | ( | ) |
Check default value usage fact
Definition at line 97 of file Element.php.
00098 { 00099 $devaultValue = $this->getDataObject()->getAttributeDefaultValue($this->getAttribute()->getAttributeCode()); 00100 return is_null($devaultValue); 00101 }