Mage_Adminhtml_Block_Widget_Form_Element_Gallery Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Form_Element_Gallery:

Mage_Adminhtml_Block_Template Varien_Data_Form_Element_Renderer_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 render (Varien_Data_Form_Element_Abstract $element)
 setElement (Varien_Data_Form_Element_Abstract $element)
 getElement ()
 getValues ()
 getAddButtonHtml ()
 getDeleteButtonHtml ($image)

Protected Member Functions

 _prepareLayout ()

Protected Attributes

 $_element = null


Detailed Description

Definition at line 34 of file Gallery.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 39 of file Gallery.php.

00040     {
00041         $this->setTemplate('widget/form/element/gallery.phtml');
00042     }


Member Function Documentation

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 66 of file Gallery.php.

00067     {
00068         $this->setChild('delete_button',
00069             $this->getLayout()->createBlock('adminhtml/widget_button')
00070                 ->setData(array(
00071                     'label'     => Mage::helper('adminhtml')->__('Delete'),
00072                     'onclick'   => "deleteImage(#image#)",
00073                     'class' => 'delete'
00074                 )));
00075 
00076         $this->setChild('add_button',
00077             $this->getLayout()->createBlock('adminhtml/widget_button')
00078                 ->setData(array(
00079                     'label'     => Mage::helper('adminhtml')->__('Add New Image'),
00080                     'onclick'   => 'addNewImage()',
00081                     'class' => 'add'
00082                 )));
00083         return parent::_prepareLayout();
00084     }

getAddButtonHtml (  ) 

Definition at line 86 of file Gallery.php.

00087     {
00088         return $this->getChildHtml('add_button');
00089     }

getDeleteButtonHtml ( image  ) 

Definition at line 91 of file Gallery.php.

00092     {
00093         return str_replace('#image#', $image, $this->getChildHtml('delete_button'));
00094     }

getElement (  ) 

Definition at line 56 of file Gallery.php.

00057     {
00058         return $this->_element;
00059     }

getValues (  ) 

Definition at line 61 of file Gallery.php.

00062     {
00063         return $this->getElement()->getValue();
00064     }

render ( Varien_Data_Form_Element_Abstract element  ) 

Implements Varien_Data_Form_Element_Renderer_Interface.

Definition at line 44 of file Gallery.php.

00045     {
00046         $this->setElement($element);
00047         return $this->toHtml();
00048     }

setElement ( Varien_Data_Form_Element_Abstract element  ) 

Definition at line 50 of file Gallery.php.

00051     {
00052         $this->_element = $element;
00053         return $this;
00054     }


Member Data Documentation

$_element = null [protected]

Definition at line 37 of file Gallery.php.


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

Generated on Sat Jul 4 17:23:07 2009 for Magento by  doxygen 1.5.8