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_Email_Template_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 protected function _construct()
00038 {
00039 $this->setEmptyText(Mage::helper('adminhtml')->__('No Templates Found'));
00040 }
00041
00042 protected function _prepareCollection()
00043 {
00044 $collection = Mage::getResourceSingleton('core/email_template_collection');
00045
00046 $this->setCollection($collection);
00047
00048 return parent::_prepareCollection();
00049 }
00050
00051 protected function _prepareColumns()
00052 {
00053 $this->addColumn('template_id',
00054 array(
00055 'header'=>Mage::helper('adminhtml')->__('ID'),
00056 'index'=>'template_id'
00057 )
00058 );
00059
00060 $this->addColumn('code',
00061 array(
00062 'header'=>Mage::helper('adminhtml')->__('Template Name'),
00063 'index'=>'template_code'
00064 ));
00065
00066 $this->addColumn('added_at',
00067 array(
00068 'header'=>Mage::helper('adminhtml')->__('Date Added'),
00069 'index'=>'added_at',
00070 'gmtoffset' => true,
00071 'type'=>'datetime'
00072 ));
00073
00074 $this->addColumn('modified_at',
00075 array(
00076 'header'=>Mage::helper('adminhtml')->__('Date Updated'),
00077 'index'=>'modified_at',
00078 'gmtoffset' => true,
00079 'type'=>'datetime'
00080 ));
00081
00082 $this->addColumn('subject',
00083 array(
00084 'header'=>Mage::helper('adminhtml')->__('Subject'),
00085 'index'=>'template_subject'
00086 ));
00087
00088
00089
00090
00091
00092
00093
00094
00095 $this->addColumn('type',
00096 array(
00097 'header'=>Mage::helper('adminhtml')->__('Template Type'),
00098 'index'=>'template_type',
00099 'filter' => 'adminhtml/system_email_template_grid_filter_type',
00100 'renderer' => 'adminhtml/system_email_template_grid_renderer_type'
00101 ));
00102
00103 $this->addColumn('action',
00104 array(
00105 'header' => Mage::helper('adminhtml')->__('Action'),
00106 'index' => 'template_id',
00107 'sortable' => false,
00108 'filter' => false,
00109 'width' => '100px',
00110 'renderer' => 'adminhtml/system_email_template_grid_renderer_action'
00111 ));
00112 return $this;
00113 }
00114
00115 public function getRowUrl($row)
00116 {
00117 return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
00118 }
00119
00120 }
00121