Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_List Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_List:

Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getDeleteButtonHtml ()
 getAddButtonHtml ()

Protected Member Functions

 _toHtml ()
 _prepareLayout ()


Detailed Description

Definition at line 33 of file List.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 35 of file List.php.

00036     {
00037         $this->setTemplate('poll/answers/list.phtml');
00038     }


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 56 of file List.php.

00057     {
00058         $this->setChild('deleteButton',
00059             $this->getLayout()->createBlock('adminhtml/widget_button')
00060                 ->setData(array(
00061                     'label'     => Mage::helper('poll')->__('Delete'),
00062                     'onclick'   => 'answer.del(this)',
00063                     'class' => 'delete f-right'
00064                 ))
00065         );
00066 
00067         $this->setChild('addButton',
00068             $this->getLayout()->createBlock('adminhtml/widget_button')
00069                 ->setData(array(
00070                     'label'     => Mage::helper('poll')->__('Add New Answer'),
00071                     'onclick'   => 'answer.add(this)',
00072                     'class' => 'add'
00073                 ))
00074         );
00075         return parent::_prepareLayout();
00076     }

_toHtml (  )  [protected]

Render block HTML

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 40 of file List.php.

00041     {
00042         if( !Mage::registry('poll_data') ) {
00043             $this->assign('answers', false);
00044             return parent::_toHtml();
00045         }
00046 
00047         $collection = Mage::getModel('poll/poll_answer')
00048             ->getResourceCollection()
00049             ->addPollFilter(Mage::registry('poll_data')->getId())
00050             ->load();
00051         $this->assign('answers', $collection);
00052 
00053         return parent::_toHtml();
00054     }

getAddButtonHtml (  ) 

Definition at line 83 of file List.php.

00084     {
00085         return $this->getChildHtml('addButton');
00086     }

getDeleteButtonHtml (  ) 

Definition at line 78 of file List.php.

00079     {
00080         return $this->getChildHtml('deleteButton');
00081     }


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

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