Public Member Functions | |
__construct () | |
getRowUrl ($row) | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () |
Definition at line 34 of file Grid.php.
__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 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
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 | ) |