Advertisement
Allnickaretaken

Grid.php

Jun 8th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.25 KB | None | 0 0
  1. <?php
  2.  
  3. class Offline_Store_Block_Adminhtml_Store_Grid extends Mage_Adminhtml_Block_Widget_Grid
  4. {
  5.  
  6.     public function __construct()
  7.     {
  8.         parent::__construct();
  9.         $this->setId('cmsBlockGrid');
  10.         $this->setDefaultSort('store_identifier');
  11.         $this->setDefaultDir('ASC');
  12.     }
  13.  
  14.     protected function _prepareCollection()
  15.     {
  16.         $collection = Mage::getModel('store/block')->getCollection();
  17.         /* @var $collection Mage_Cms_Model_Mysql4_Block_Collection */
  18.         $this->setCollection($collection);
  19.         return parent::_prepareCollection();
  20.     }
  21.  
  22.     protected function _prepareColumns()
  23.     {
  24. //        $baseUrl = $this->getUrl();
  25.  
  26.         $this->addColumn('store_id', array(
  27.             'header'    => Mage::helper('store')->__('Id'),
  28.             'align'     => 'left',
  29.             'index'     => 'store_id',
  30.         ));
  31.  
  32.         $this->addColumn('name', array(
  33.             'header'    => Mage::helper('store')->__('Name'),
  34.             'align'     => 'left',
  35.             'index'     => 'name',
  36.         ));
  37.  
  38.         $this->addColumn('country', array(
  39.             'header'    => Mage::helper('store')->__('Country'),
  40.             'align'     => 'left',
  41.             'index'     => 'country'
  42.         ));
  43.  
  44.         $this->addColumn('city', array(
  45.             'header'    => Mage::helper('store')->__('City'),
  46.             'align'     => 'left',
  47.             'index'     => 'city'
  48.         ));
  49.  
  50.  
  51.         $this->addColumn('street', array(
  52.             'header'    => Mage::helper('store')->__('Street'),
  53.             'align'     => 'left',
  54.             'index'     => 'street'
  55.         ));
  56.  
  57.         $this->addColumn('status', array(
  58.             'header'    => Mage::helper('store')->__('Status'),
  59.             'index'     => 'status',
  60.             'type'      => 'options',
  61.             'options'   => array(
  62.                 0 => Mage::helper('store')->__('Disabled'),
  63.                 1 => Mage::helper('store')->__('Enabled')
  64.             ),
  65.         ));
  66.  
  67.         return parent::_prepareColumns();
  68.     }
  69.  
  70.     /**
  71.      * Row click url
  72.      *
  73.      * @return string
  74.      */
  75.     public function getRowUrl($row)
  76.     {
  77.         return $this->getUrl('*/*/edit', array('store_id' => $row->getId()));
  78.     }
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement