Mage_Adminhtml_Block_Poll_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Poll_Grid:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getRowUrl ($row)

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Grid.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 37 of file Grid.php.

00038     {
00039         parent::__construct();
00040         $this->setId('pollGrid');
00041         $this->setDefaultSort('poll_title');
00042         $this->setDefaultDir('ASC');
00043         $this->setSaveParametersInSession(true);
00044     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 46 of file Grid.php.

00047     {
00048         $collection = Mage::getModel('poll/poll')->getCollection();
00049         $this->setCollection($collection);
00050         parent::_prepareCollection();
00051 
00052         if (!Mage::app()->isSingleStoreMode()) {
00053             $this->getCollection()->addStoreData();
00054         }
00055 
00056         return $this;
00057     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 59 of file Grid.php.

00060     {
00061         $this->addColumn('poll_id', array(
00062             'header'    => Mage::helper('poll')->__('ID'),
00063             'align'     =>'right',
00064             'width'     => '50px',
00065             'index'     => 'poll_id',
00066         ));
00067 
00068         $this->addColumn('poll_title', array(
00069             'header'    => Mage::helper('poll')->__('Poll Question'),
00070             'align'     =>'left',
00071             'index'     => 'poll_title',
00072         ));
00073 
00074         $this->addColumn('votes_count', array(
00075             'header'    => Mage::helper('poll')->__('Number of Responses'),
00076             'width'     => '50px',
00077             'type'      => 'number',
00078             'index'     => 'votes_count',
00079         ));
00080 
00081         $this->addColumn('date_posted', array(
00082             'header'    => Mage::helper('poll')->__('Date Posted'),
00083             'align'     => 'left',
00084             'width'     => '120px',
00085             'type'      => 'date',
00086             'index'     => 'date_posted',
00087         ));
00088 
00089         $this->addColumn('date_closed', array(
00090             'header'    => Mage::helper('poll')->__('Date Closed'),
00091             'align'     => 'left',
00092             'width'     => '120px',
00093             'type'      => 'date',
00094             'default'   => '--',
00095             'index'     => 'date_closed',
00096         ));
00097 
00098         if (!Mage::app()->isSingleStoreMode()) {
00099             $this->addColumn('visible_in', array(
00100                 'header'    => Mage::helper('review')->__('Visible In'),
00101                 'index'     => 'stores',
00102                 'type'      => 'store',
00103                 'store_view' => true,
00104                 'sortable'   => false,
00105             ));
00106         }
00107 
00108         /*
00109         $this->addColumn('active', array(
00110             'header'    => Mage::helper('poll')->__('Status'),
00111             'align'     => 'left',
00112             'width'     => '80px',
00113             'index'     => 'active',
00114             'type'      => 'options',
00115             'options'   => array(
00116                 1 => 'Active',
00117                 0 => 'Inactive',
00118             ),
00119         ));
00120         */
00121         $this->addColumn('closed', array(
00122             'header'    => Mage::helper('poll')->__('Status'),
00123             'align'     => 'left',
00124             'width'     => '80px',
00125             'index'     => 'closed',
00126             'type'      => 'options',
00127             'options'   => array(
00128                 1 => Mage::helper('poll')->__('Closed'),
00129                 0 => Mage::helper('poll')->__('Open')
00130             ),
00131         ));
00132 
00133         return parent::_prepareColumns();
00134     }

getRowUrl ( row  ) 

Definition at line 136 of file Grid.php.

00137     {
00138         return $this->getUrl('*/*/edit', array('id' => $row->getId()));
00139     }


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