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_GoogleBase_Block_Adminhtml_Types_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036 public function __construct()
00037 {
00038 parent::__construct();
00039 $this->setId('types_grid');
00040 $this->setSaveParametersInSession(true);
00041 $this->setUseAjax(true);
00042 }
00043
00044 protected function _prepareCollection()
00045 {
00046 $collection = Mage::getResourceModel('googlebase/type_collection')->addItemsCount();
00047 $this->setCollection($collection);
00048 parent::_prepareCollection();
00049 return $this;
00050 }
00051
00052 protected function _prepareColumns()
00053 {
00054 $this->addColumn('attribute_set_name',
00055 array(
00056 'header' => $this->__('Attributes Set'),
00057 'width' => '150px',
00058 'index' => 'attribute_set_name',
00059 ));
00060
00061 $this->addColumn('gbase_itemtype',
00062 array(
00063 'header' => $this->__('Google Base Item type'),
00064 'width' => '150px',
00065 'index' => 'gbase_itemtype',
00066 ));
00067
00068 $this->addColumn('target_country',
00069 array(
00070 'header' => $this->__('Target Country'),
00071 'width' => '150px',
00072 'index' => 'target_country',
00073 'renderer' => 'googlebase/adminhtml_types_renderer_country',
00074 'filter' => false
00075 ));
00076
00077 $this->addColumn('items_total',
00078 array(
00079 'header' => Mage::helper('catalog')->__('Total Qty Base Items'),
00080 'width' => '150px',
00081 'index' => 'items_total',
00082 'filter' => false
00083 ));
00084
00085 return parent::_prepareColumns();
00086 }
00087
00088 public function getRowUrl($row)
00089 {
00090 return $this->getUrl('*/*/edit', array('id'=>$row->getId(), '_current'=>true));
00091 }
00092
00093 public function getGridUrl()
00094 {
00095 return $this->getUrl('*/*/grid', array('_current'=>true));
00096 }
00097 }