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_Sitemap_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('sitemapGrid');
00041 $this->setDefaultSort('sitemap_id');
00042
00043 }
00044
00045 protected function _prepareCollection()
00046 {
00047 $collection = Mage::getModel('sitemap/sitemap')->getCollection();
00048
00049 $this->setCollection($collection);
00050 return parent::_prepareCollection();
00051 }
00052
00053 protected function _prepareColumns()
00054 {
00055 $this->addColumn('sitemap_id', array(
00056 'header' => Mage::helper('sitemap')->__('ID'),
00057 'width' => '50px',
00058 'index' => 'sitemap_id'
00059 ));
00060
00061 $this->addColumn('sitemap_filename', array(
00062 'header' => Mage::helper('sitemap')->__('Filename'),
00063 'index' => 'sitemap_filename'
00064 ));
00065
00066 $this->addColumn('sitemap_path', array(
00067 'header' => Mage::helper('sitemap')->__('Path'),
00068 'index' => 'sitemap_path'
00069 ));
00070
00071 $this->addColumn('link', array(
00072 'header' => Mage::helper('sitemap')->__('Link for Google'),
00073 'index' => 'concat(sitemap_path, sitemap_filename)',
00074 'renderer' => 'adminhtml/sitemap_grid_renderer_link',
00075 ));
00076
00077 $this->addColumn('sitemap_time', array(
00078 'header' => Mage::helper('sitemap')->__('Last Time Generated'),
00079 'width' => '150px',
00080 'index' => 'sitemap_time',
00081 'type' => 'datetime',
00082 ));
00083
00084
00085 if (!Mage::app()->isSingleStoreMode()) {
00086 $this->addColumn('store_id', array(
00087 'header' => Mage::helper('sitemap')->__('Store View'),
00088 'index' => 'store_id',
00089 'type' => 'store',
00090 ));
00091 }
00092
00093 $this->addColumn('action', array(
00094 'header' => Mage::helper('sitemap')->__('Action'),
00095 'filter' => false,
00096 'sortable' => false,
00097 'width' => '100',
00098 'renderer' => 'adminhtml/sitemap_grid_renderer_action'
00099 ));
00100
00101 return parent::_prepareColumns();
00102 }
00103
00104
00105
00106
00107
00108
00109 public function getRowUrl($row)
00110 {
00111 return $this->getUrl('*/*/edit', array('sitemap_id' => $row->getId()));
00112 }
00113
00114 }