00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_System_Design_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037
00038
00039
00040 public function __construct()
00041 {
00042 parent::__construct();
00043 $this->setId('designGrid');
00044 $this->setSaveParametersInSession(true);
00045 $this->setUseAjax(true);
00046 }
00047
00048
00049
00050
00051
00052
00053 protected function _prepareCollection()
00054 {
00055 $storeId = (int) $this->getRequest()->getParam('store', 0);
00056
00057 $collection = Mage::getResourceModel('core/design_collection');
00058
00059 $this->setCollection($collection);
00060 parent::_prepareCollection();
00061 return $this;
00062 }
00063
00064
00065
00066
00067
00068
00069 protected function _prepareColumns()
00070 {
00071 if (!Mage::app()->isSingleStoreMode()) {
00072 $this->addColumn('store_id', array(
00073 'header' => Mage::helper('catalog')->__('Store'),
00074 'width' => '100px',
00075 'type' => 'store',
00076 'store_view' => true,
00077 'sortable' => false,
00078 'index' => 'store_id',
00079 ));
00080 }
00081
00082 $this->addColumn('package', array(
00083 'header' => Mage::helper('catalog')->__('Design'),
00084 'width' => '150px',
00085 'index' => 'design',
00086 ));
00087 $this->addColumn('date_from', array(
00088 'header' => Mage::helper('catalogrule')->__('Date From'),
00089 'align' => 'left',
00090 'width' => '100px',
00091 'type' => 'date',
00092 'index' => 'date_from',
00093 ));
00094
00095 $this->addColumn('date_to', array(
00096 'header' => Mage::helper('catalogrule')->__('Date To'),
00097 'align' => 'left',
00098 'width' => '100px',
00099 'type' => 'date',
00100 'index' => 'date_to',
00101 ));
00102
00103 return parent::_prepareColumns();
00104 }
00105
00106
00107
00108
00109
00110
00111
00112 public function getRowUrl($row)
00113 {
00114 return $this->getUrl('*/*/edit', array('id' => $row->getId()));
00115 }
00116
00117
00118
00119
00120
00121
00122 public function getGridUrl()
00123 {
00124 return $this->getUrl('*/*/grid', array('_current' => true));
00125 }
00126
00127 }