Mage_Adminhtml_Block_Catalog_Product_Frontend_Product_Watermark Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Frontend_Product_Watermark:

Mage_Adminhtml_Block_Abstract Varien_Data_Form_Element_Renderer_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 render (Varien_Data_Form_Element_Abstract $element)

Public Attributes

const XML_PATH_IMAGE_TYPES = 'global/catalog/product/media/image_types'

Protected Member Functions

 _getHeaderHtml ($element)
 _getFooterHtml ($element)


Detailed Description

Definition at line 34 of file Watermark.php.


Member Function Documentation

_getFooterHtml ( element  )  [protected]

Definition at line 102 of file Watermark.php.

00103     {
00104         $html = '</tbody></table></fieldset>';
00105         return $html;
00106     }

_getHeaderHtml ( element  )  [protected]

Definition at line 83 of file Watermark.php.

00084     {
00085         $id = $element->getHtmlId();
00086         $default = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
00087 
00088         $html = '<h4 class="icon-head head-edit-form">'.$element->getLegend().'</h4>';
00089         $html.= '<fieldset class="config" id="'.$element->getHtmlId().'">';
00090         $html.= '<legend>'.$element->getLegend().'</legend>';
00091 
00092         // field label column
00093         $html.= '<table cellspacing="0"><colgroup class="label" /><colgroup class="value" />';
00094         if (!$default) {
00095             $html.= '<colgroup class="use-default" />';
00096         }
00097         $html.= '<tbody>';
00098 
00099         return $html;
00100     }

render ( Varien_Data_Form_Element_Abstract element  ) 

Watermark size field

Watermark upload field

Watermark position field

Implements Varien_Data_Form_Element_Renderer_Interface.

Definition at line 38 of file Watermark.php.

00039     {
00040         $html = $this->_getHeaderHtml($element);
00041         $renderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
00042 
00043         $attributes = Mage::getConfig()->getNode(self::XML_PATH_IMAGE_TYPES)->asArray();
00044 
00045         foreach ($attributes as $key => $attribute) {
00046             /**
00047              * Watermark size field
00048              */
00049             $field = new Varien_Data_Form_Element_Text();
00050             $field->setName("groups[watermark][fields][{$key}_size][value]")
00051                 ->setForm( $this->getForm() )
00052                 ->setLabel(Mage::helper('adminhtml')->__('Size for %s', $attribute['title']))
00053                 ->setRenderer($renderer);
00054             $html.= $field->toHtml();
00055 
00056             /**
00057              * Watermark upload field
00058              */
00059             $field = new Varien_Data_Form_Element_Imagefile();
00060             $field->setName("groups[watermark][fields][{$key}_image][value]")
00061                 ->setForm( $this->getForm() )
00062                 ->setLabel(Mage::helper('adminhtml')->__('Watermark File for %s', $attribute['title']))
00063                 ->setRenderer($renderer);
00064             $html.= $field->toHtml();
00065 
00066             /**
00067              * Watermark position field
00068              */
00069             $field = new Varien_Data_Form_Element_Select();
00070             $field->setName("groups[watermark][fields][{$key}_position][value]")
00071                 ->setForm( $this->getForm() )
00072                 ->setLabel(Mage::helper('adminhtml')->__('Position of Watermark for %s', $attribute['title']))
00073                 ->setRenderer($renderer)
00074                 ->setValues(Mage::getSingleton('adminhtml/system_config_source_catalog_product_watermark_position')->toOptionArray());
00075             $html.= $field->toHtml();
00076         }
00077 
00078         $html .= $this->_getFooterHtml($element);
00079 
00080         return $html;
00081     }


Member Data Documentation

const XML_PATH_IMAGE_TYPES = 'global/catalog/product/media/image_types'

Definition at line 36 of file Watermark.php.


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