Mage_Adminhtml_Block_Cms_Block_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Cms_Block_Grid:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getRowUrl ($row)

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()
 _afterLoadCollection ()
 _filterStoreCondition ($collection, $column)


Detailed Description

Definition at line 34 of file Grid.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 37 of file Grid.php.

00038     {
00039         parent::__construct();
00040         $this->setId('cmsBlockGrid');
00041         $this->setDefaultSort('block_identifier');
00042         $this->setDefaultDir('ASC');
00043     }


Member Function Documentation

_afterLoadCollection (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 107 of file Grid.php.

00108     {
00109         $this->getCollection()->walk('afterLoad');
00110         parent::_afterLoadCollection();
00111     }

_filterStoreCondition ( collection,
column 
) [protected]

Definition at line 113 of file Grid.php.

00114     {
00115         if (!$value = $column->getFilter()->getValue()) {
00116             return;
00117         }
00118 
00119         $this->getCollection()->addStoreFilter($value);
00120     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 45 of file Grid.php.

00046     {
00047         $collection = Mage::getModel('cms/block')->getCollection();
00048         /* @var $collection Mage_Cms_Model_Mysql4_Block_Collection */
00049         $this->setCollection($collection);
00050         return parent::_prepareCollection();
00051     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 53 of file Grid.php.

00054     {
00055         $baseUrl = $this->getUrl();
00056 
00057         $this->addColumn('title', array(
00058             'header'    => Mage::helper('cms')->__('Title'),
00059             'align'     => 'left',
00060             'index'     => 'title',
00061         ));
00062 
00063         $this->addColumn('identifier', array(
00064             'header'    => Mage::helper('cms')->__('Identifier'),
00065             'align'     => 'left',
00066             'index'     => 'identifier'
00067         ));
00068 
00069         if (!Mage::app()->isSingleStoreMode()) {
00070             $this->addColumn('store_id', array(
00071                 'header'        => Mage::helper('cms')->__('Store View'),
00072                 'index'         => 'store_id',
00073                 'type'          => 'store',
00074                 'store_all'     => true,
00075                 'store_view'    => true,
00076                 'sortable'      => false,
00077                 'filter_condition_callback'
00078                                 => array($this, '_filterStoreCondition'),
00079             ));
00080         }
00081 
00082         $this->addColumn('is_active', array(
00083             'header'    => Mage::helper('cms')->__('Status'),
00084             'index'     => 'is_active',
00085             'type'      => 'options',
00086             'options'   => array(
00087                 0 => Mage::helper('cms')->__('Disabled'),
00088                 1 => Mage::helper('cms')->__('Enabled')
00089             ),
00090         ));
00091 
00092         $this->addColumn('creation_time', array(
00093             'header'    => Mage::helper('cms')->__('Date Created'),
00094             'index'     => 'creation_time',
00095             'type'      => 'datetime',
00096         ));
00097 
00098         $this->addColumn('update_time', array(
00099             'header'    => Mage::helper('cms')->__('Last Modified'),
00100             'index'     => 'update_time',
00101             'type'      => 'datetime',
00102         ));
00103 
00104         return parent::_prepareColumns();
00105     }

getRowUrl ( row  ) 

Row click url

Returns:
string

Definition at line 127 of file Grid.php.

00128     {
00129         return $this->getUrl('*/*/edit', array('block_id' => $row->getId()));
00130     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:47 2009 for Magento by  doxygen 1.5.8