Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element:

Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element Mage_Adminhtml_Block_Template Varien_Data_Form_Element_Renderer_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Extend Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Special

List of all members.

Public Member Functions

 getDataObject ()
 getAttribute ()
 getAttributeCode ()
 canDisplayUseDefault ()
 usedDefault ()
 checkFieldDisable ()
 getScopeLabel ()
 getElementLabelHtml ()
 getElementHtml ()

Protected Member Functions

 _construct ()


Detailed Description

Definition at line 34 of file Element.php.


Member Function Documentation

_construct (  )  [protected]

Initialize block template

Reimplemented from Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element.

Definition at line 39 of file Element.php.

00040     {
00041         $this->setTemplate('catalog/form/renderer/fieldset/element.phtml');
00042     }

canDisplayUseDefault (  ) 

Check "Use default" checkbox display availability

Returns:
bool

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

Returns:
Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element

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

Returns:
Mage_Catalog_Model_Resource_Eav_Attribute

Definition at line 59 of file Element.php.

00060     {
00061         return $this->getElement()->getEntityAttribute();
00062     }

getAttributeCode (  ) 

Retrieve associated attribute code

Returns:
string

Definition at line 69 of file Element.php.

00070     {
00071         return $this->getAttribute()->getAttributeCode();
00072     }

getDataObject (  ) 

Retrieve data object related with form

Returns:
Mage_Catalog_Model_Product || Mage_Catalog_Model_Category

Definition at line 49 of file Element.php.

00050     {
00051         return $this->getElement()->getForm()->getDataObject();
00052     }

getElementHtml (  ) 

Retrieve element html

Returns:
string

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

Returns:
string

Definition at line 148 of file Element.php.

00149     {
00150         return $this->getElement()->getLabelHtml();
00151     }

getScopeLabel (  ) 

Retrieve label of attribute scope

GLOBAL | WEBSITE | STORE

Returns:
string

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

Returns:
bool

Definition at line 97 of file Element.php.

00098     {
00099         $devaultValue = $this->getDataObject()->getAttributeDefaultValue($this->getAttribute()->getAttributeCode());
00100         return is_null($devaultValue);
00101     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:43 2009 for Magento by  doxygen 1.5.8