Public Member Functions | |
__construct () | |
getRowUrl ($row) | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () | |
_afterLoadCollection () | |
_filterStoreCondition ($collection, $column) |
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('cmsPageGrid'); 00041 $this->setDefaultSort('identifier'); 00042 $this->setDefaultDir('ASC'); 00043 }
_afterLoadCollection | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 129 of file Grid.php.
00130 { 00131 $this->getCollection()->walk('afterLoad'); 00132 parent::_afterLoadCollection(); 00133 }
_filterStoreCondition | ( | $ | collection, | |
$ | column | |||
) | [protected] |
Definition at line 135 of file Grid.php.
00136 { 00137 if (!$value = $column->getFilter()->getValue()) { 00138 return; 00139 } 00140 00141 $this->getCollection()->addStoreFilter($value); 00142 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 45 of file Grid.php.
00046 { 00047 $collection = Mage::getModel('cms/page')->getCollection(); 00048 /* @var $collection Mage_Cms_Model_Mysql4_Page_Collection */ 00049 $collection->setFirstStoreFlag(true); 00050 $this->setCollection($collection); 00051 00052 return parent::_prepareCollection(); 00053 }
_prepareColumns | ( | ) | [protected] |
Check is single store mode
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 55 of file Grid.php.
00056 { 00057 $baseUrl = $this->getUrl(); 00058 00059 $this->addColumn('title', array( 00060 'header' => Mage::helper('cms')->__('Title'), 00061 'align' => 'left', 00062 'index' => 'title', 00063 )); 00064 00065 $this->addColumn('identifier', array( 00066 'header' => Mage::helper('cms')->__('Identifier'), 00067 'align' => 'left', 00068 'index' => 'identifier' 00069 )); 00070 00071 00072 00073 $this->addColumn('root_template', array( 00074 'header' => Mage::helper('cms')->__('Layout'), 00075 'index' => 'root_template', 00076 'type' => 'options', 00077 'options' => Mage::getSingleton('page/source_layout')->getOptions(), 00078 )); 00079 00080 /** 00081 * Check is single store mode 00082 */ 00083 if (!Mage::app()->isSingleStoreMode()) { 00084 $this->addColumn('store_id', array( 00085 'header' => Mage::helper('cms')->__('Store View'), 00086 'index' => 'store_id', 00087 'type' => 'store', 00088 'store_all' => true, 00089 'store_view' => true, 00090 'sortable' => false, 00091 'filter_condition_callback' 00092 => array($this, '_filterStoreCondition'), 00093 )); 00094 } 00095 00096 $this->addColumn('is_active', array( 00097 'header' => Mage::helper('cms')->__('Status'), 00098 'index' => 'is_active', 00099 'type' => 'options', 00100 'options' => array( 00101 0 => Mage::helper('cms')->__('Disabled'), 00102 1 => Mage::helper('cms')->__('Enabled') 00103 ), 00104 )); 00105 00106 $this->addColumn('creation_time', array( 00107 'header' => Mage::helper('cms')->__('Date Created'), 00108 'index' => 'creation_time', 00109 'type' => 'datetime', 00110 )); 00111 00112 $this->addColumn('update_time', array( 00113 'header' => Mage::helper('cms')->__('Last Modified'), 00114 'index' => 'update_time', 00115 'type' => 'datetime', 00116 )); 00117 00118 $this->addColumn('page_actions', array( 00119 'header' => Mage::helper('cms')->__('Action'), 00120 'width' => 10, 00121 'sortable' => false, 00122 'filter' => false, 00123 'renderer' => 'adminhtml/cms_page_grid_renderer_action', 00124 )); 00125 00126 return parent::_prepareColumns(); 00127 }
getRowUrl | ( | $ | row | ) |