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_Backup_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 protected function _construct()
00038 {
00039 $this->setSaveParametersInSession(true);
00040 $this->setId('backupsGrid');
00041 $this->setDefaultSort('time', 'desc');
00042 }
00043
00044
00045
00046
00047 protected function _prepareCollection()
00048 {
00049 $collection = Mage::getSingleton('backup/fs_collection');
00050 $this->setCollection($collection);
00051 return parent::_prepareCollection();
00052 }
00053
00054
00055
00056
00057 protected function _prepareColumns()
00058 {
00059 $url7zip = Mage::helper('adminhtml')->__('The archive can be uncompressed with <a href="%s">%s</a> on Windows systems', 'http://www.7-zip.org/', '7-Zip');
00060
00061 $this->addColumn('time', array(
00062 'header' => Mage::helper('backup')->__('Time'),
00063 'index' => 'time_formated',
00064 'type' => 'datetime'
00065 ));
00066
00067 $this->addColumn('size', array(
00068 'header' => Mage::helper('backup')->__('Size, byte'),
00069 'index' => 'size',
00070 'type' => 'number',
00071 'sortable' => false,
00072 'filter' => false
00073 ));
00074
00075 $this->addColumn('type', array(
00076 'header' => Mage::helper('backup')->__('Type'),
00077 'filter' => 'adminhtml/backup_grid_filter_type',
00078 'renderer' => 'adminhtml/backup_grid_renderer_type',
00079 'index' =>'type'
00080 ));
00081
00082 $this->addColumn('download', array(
00083 'header' => Mage::helper('backup')->__('Download'),
00084 'format' => '<a href="' . $this->getUrl('*/*/download', array('time' => '$time', 'type' => '$type')) .'">gz</a> <small>('.$url7zip.')</small>',
00085 'index' => 'type',
00086 'sortable' => false,
00087 'filter' => false
00088 ));
00089
00090 $this->addColumn('action', array(
00091 'header' => Mage::helper('backup')->__('Action'),
00092 'type' => 'action',
00093 'width' => '80px',
00094 'filter' => false,
00095 'sortable' => false,
00096 'actions' => array(array(
00097 'url' => $this->getUrl('*/*/delete', array('time' => '$time', 'type' => '$type')),
00098 'caption' => Mage::helper('adminhtml')->__('Delete'),
00099 'confirm' => Mage::helper('adminhtml')->__('Are you sure you want to do this?')
00100 )),
00101 'index' => 'type',
00102 'sortable' => false
00103 ));
00104
00105 return $this;
00106 }
00107
00108 }