Mage_Adminhtml_Block_Tag_Grid_All Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Tag_Grid_All:

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 ()
 _addColumnFilterToCollection ($column)


Detailed Description

Definition at line 34 of file All.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 36 of file All.php.

00037     {
00038         parent::__construct();
00039         $this->setId('tagsGrid');
00040         $this->setDefaultSort('tag_id', 'desc');
00041     }


Member Function Documentation

_addColumnFilterToCollection ( column  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 88 of file All.php.

00089     {
00090         if ($this->getCollection() && $column->getFilter()->getValue()) {
00091             if($column->getIndex()=='stores') {
00092                 $this->getCollection()->addAttributeToFilter( $column->getIndex(), $column->getFilter()->getCondition());
00093             } else {
00094                 $this->getCollection()->addStoreFilter($column->getFilter()->getCondition());
00095             }
00096         }
00097         return $this;
00098     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 43 of file All.php.

00044     {
00045         $collection = Mage::getResourceModel('tag/tag_collection')
00046 //            ->addStoreFilter(Mage::app()->getStore()->getId())
00047                ->addStoresVisibility()
00048         ;
00049         $this->setCollection($collection);
00050         return parent::_prepareCollection();
00051     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 53 of file All.php.

00054     {
00055         $this->addColumn('name', array(
00056             'header'    => Mage::helper('tag')->__('Tag'),
00057             'index'     => 'name',
00058         ));
00059         $this->addColumn('total_used', array(
00060             'header'    => Mage::helper('tag')->__('# of Uses'),
00061             'width'     => '140px',
00062             'align'     => 'center',
00063             'index'     => 'total_used',
00064             'type'      => 'number',
00065         ));
00066         $this->addColumn('status', array(
00067             'header'    => Mage::helper('tag')->__('Status'),
00068             'width'     => '90px',
00069             'index'     => 'status',
00070             'type'      => 'options',
00071             'options'    => array(
00072                 Mage_Tag_Model_Tag::STATUS_DISABLED => Mage::helper('tag')->__('Disabled'),
00073                 Mage_Tag_Model_Tag::STATUS_PENDING  => Mage::helper('tag')->__('Pending'),
00074                 Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('tag')->__('Approved'),
00075             ),
00076         ));
00077 
00078 
00079 
00080         $this->setColumnFilter('id')
00081             ->setColumnFilter('name')
00082             ->setColumnFilter('total_used')
00083         ;
00084 
00085         return parent::_prepareColumns();
00086     }

getRowUrl ( row  ) 

Definition at line 100 of file All.php.

00101     {
00102         return $this->getUrl('*/*/products', array('tag_id' => $row->getId()));
00103     }


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

Generated on Sat Jul 4 17:23:05 2009 for Magento by  doxygen 1.5.8