1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_GoogleBase_Block_Adminhtml_Types_Grid extends Mage_Adminhtml_Block_Widget_Grid
35: {
36: public function __construct()
37: {
38: parent::__construct();
39: $this->setId('types_grid');
40: $this->setSaveParametersInSession(true);
41: $this->setUseAjax(true);
42: }
43:
44: protected function _prepareCollection()
45: {
46: $collection = Mage::getResourceModel('googlebase/type_collection')->addItemsCount();
47: $this->setCollection($collection);
48: parent::_prepareCollection();
49: return $this;
50: }
51:
52: protected function _prepareColumns()
53: {
54: $this->addColumn('attribute_set_name',
55: array(
56: 'header' => $this->__('Attributes Set'),
57: 'index' => 'attribute_set_name',
58: ));
59:
60: $this->addColumn('gbase_itemtype',
61: array(
62: 'header' => $this->__('Google Base Item type'),
63: 'index' => 'gbase_itemtype',
64: ));
65:
66: $this->addColumn('target_country',
67: array(
68: 'header' => $this->__('Target Country'),
69: 'width' => '150px',
70: 'index' => 'target_country',
71: 'renderer' => 'googlebase/adminhtml_types_renderer_country',
72: 'filter' => false
73: ));
74:
75: $this->addColumn('items_total',
76: array(
77: 'header' => Mage::helper('catalog')->__('Total Qty Base Items'),
78: 'width' => '150px',
79: 'index' => 'items_total',
80: 'filter' => false
81: ));
82:
83: return parent::_prepareColumns();
84: }
85:
86: public function getRowUrl($row)
87: {
88: return $this->getUrl('*/*/edit', array('id'=>$row->getId(), '_current'=>true));
89: }
90:
91: public function getGridUrl()
92: {
93: return $this->getUrl('*/*/grid', array('_current'=>true));
94: }
95: }
96: