Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery:

Varien_Data_Form_Element_Abstract Varien_Data_Form_Abstract Varien_Object

List of all members.

Public Member Functions

 getElementHtml ()
 getContentHtml ()
 getLabel ()
 canDisplayUseDefault ($attribute)
 usedDefault ($attribute)
 getScopeLabel ($attribute)
 getDataObject ()
 getAttributeFieldName ($attribute)
 getAttributeReadonly ($attribute)
 toHtml ()


Detailed Description

Definition at line 35 of file Gallery.php.


Member Function Documentation

canDisplayUseDefault ( attribute  ) 

Check "Use default" checkbox display availability

Parameters:
Mage_Eav_Model_Entity_Attribute $attribute
Returns:
bool

Definition at line 73 of file Gallery.php.

00074     {
00075         if (!$attribute->isScopeGlobal() && $this->getDataObject()->getStoreId()) {
00076             return true;
00077         }
00078 
00079         return false;
00080     }

getAttributeFieldName ( attribute  ) 

Retrieve attribute field name

Parameters:
Mage_Eav_Model_Entity_Attribute $attribute
Returns:
string

Definition at line 138 of file Gallery.php.

00139     {
00140         $name = $attribute->getAttributeCode();
00141         if ($suffix = $this->getForm()->getFieldNameSuffix()) {
00142             $name = $this->getForm()->addSuffixToName($name, $suffix);
00143         }
00144         return $name;
00145     }

getAttributeReadonly ( attribute  ) 

Check readonly attribute

Parameters:
Mage_Eav_Model_Entity_Attribute|string $attribute
Returns:
boolean

Definition at line 153 of file Gallery.php.

00154     {
00155         if (is_object($attribute)) {
00156             $attribute = $attribute->getAttributeCode();
00157         }
00158 
00159         if ($this->getDataObject()->isLockedAttribute($attribute)) {
00160             return true;
00161         }
00162 
00163         return false;
00164     }

getContentHtml (  ) 

Prepares content block

Returns:
string

Definition at line 50 of file Gallery.php.

00051     {
00052 
00053         /* @var $content Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content */
00054         $content = Mage::getSingleton('core/layout')
00055             ->createBlock('adminhtml/catalog_product_helper_form_gallery_content');
00056 
00057         $content->setId($this->getHtmlId() . '_content')
00058             ->setElement($this);
00059         return $content->toHtml();
00060     }

getDataObject (  ) 

Retrieve data object related with form

Returns:
Mage_Catalog_Model_Product || Mage_Catalog_Model_Category

Definition at line 126 of file Gallery.php.

00127     {
00128         return $this->getForm()->getDataObject();
00129     }

getElementHtml (  ) 

Reimplemented from Varien_Data_Form_Element_Abstract.

Definition at line 38 of file Gallery.php.

00039     {
00040         $html = $this->getContentHtml();
00041         //$html.= $this->getAfterElementHtml();
00042         return $html;
00043     }

getLabel (  ) 

Definition at line 62 of file Gallery.php.

00063     {
00064         return '';
00065     }

getScopeLabel ( attribute  ) 

Retrieve label of attribute scope

GLOBAL | WEBSITE | STORE

Parameters:
Mage_Eav_Model_Entity_Attribute $attribute
Returns:
string

Definition at line 102 of file Gallery.php.

00103     {
00104         $html = '';
00105         if (Mage::app()->isSingleStoreMode()) {
00106             return $html;
00107         }
00108 
00109         if ($attribute->isScopeGlobal()) {
00110             $html.= '<br/>[GLOBAL]';
00111         }
00112         elseif ($attribute->isScopeWebsite()) {
00113             $html.= '<br/>[WEBSITE]';
00114         }
00115         elseif ($attribute->isScopeStore()) {
00116             $html.= '<br/>[STORE VIEW]';
00117         }
00118         return $html;
00119     }

toHtml (  ) 

Reimplemented from Varien_Data_Form_Element_Abstract.

Definition at line 166 of file Gallery.php.

00167     {
00168         return '<tr><td class="value" colspan="3">' . $this->getElementHtml() . '</td></tr>';
00169     }

usedDefault ( attribute  ) 

Check default value usage fact

Parameters:
Mage_Eav_Model_Entity_Attribute $attribute
Returns:
bool

Definition at line 88 of file Gallery.php.

00089     {
00090         $devaultValue = $this->getDataObject()->getAttributeDefaultValue($attribute->getAttributeCode());
00091         return is_null($devaultValue);
00092     }


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

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