Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Academy_Informations_Block_Adminhtml_Messages_Grid extends Mage_Adminhtml_Block_Widget_Grid
- {
- public function __construct()
- {
- parent::__construct();
- $this->setDefaultSort('message_id');
- $this->setDefaultDir('DESC');
- }
- protected function _prepareCollection()
- {
- $messageModel = Mage::getModel('academy_informations/message');
- $messageCollection = $messageModel->getCollection();
- $this->setCollection($messageCollection);
- return parent::_prepareCollection();
- }
- protected function _prepareColumns()
- {
- $this->addColumn('message_id', array(
- 'index' => 'message_id',
- 'header' => $this->__('Message Id')
- ));
- $this->addColumn('content', array(
- 'index' => 'content',
- 'header' => $this->__('Content')
- ));
- $this->addColumn('category_id', array(
- 'index' => 'category_id',
- 'header' => $this->__('Category Id'),
- 'type' => 'options',
- 'options' => array('0' => 'machin',
- '1' => 'bidule',
- '2' => 'truc',
- '3' => 'pouet',
- '4' => 'pouetpouet')
- ));
- $this->addColumn('action',
- array(
- 'header' => $this->__('Action'),
- 'width' => '50px',
- 'type' => 'action',
- 'getter' => 'getId',
- 'actions' => array(
- array(
- 'caption' => Mage::helper('catalog')->__('Edit'),
- 'url' => array(
- 'base'=>'*/*/edit',
- 'params'=>array('store'=>$this->getRequest()->getParam('store'))
- ),
- 'field' => 'id'
- )
- ),
- 'filter' => false,
- 'sortable' => false,
- 'index' => 'stores',
- ));
- }
- public function getRowUrl($row)
- {
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
- }
- }
Add Comment
Please, Sign In to add comment