Mage_Adminhtml_Block_Tag_Grid_Products Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Tag_Grid_Products:

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.

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Products.php.


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 37 of file Products.php.

00038     {
00039         $collection = Mage::getResourceModel('tag/product_collection')
00040             ->addAttributeToSelect('sku')
00041             ->addAttributeToSelect('name')
00042         ;
00043         if ($tagId = $this->getRequest()->getParam('tag_id')) {
00044             $collection->addTagFilter($tagId);
00045         }
00046         if ($customerId = $this->getRequest()->getParam('customer_id')) {
00047             $collection->addCustomerFilter($customerId);
00048         }
00049         $this->setCollection($collection);
00050 
00051         return parent::_prepareCollection();
00052     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 54 of file Products.php.

00055     {
00056         $this->addColumn('product_id', array(
00057             'header'    => Mage::helper('tag')->__('ID'),
00058             'align'     => 'center',
00059             'width'     => '60px',
00060             'sortable'  => false,
00061             'index'     => 'product_id'
00062         ));
00063         $this->addColumn('sku', array(
00064             'header'    => Mage::helper('tag')->__('SKU'),
00065             'align'     => 'center',
00066             'index'     => 'sku'
00067         ));
00068         $this->addColumn('name', array(
00069             'header'    => Mage::helper('tag')->__('Name'),
00070             'index'     => 'name'
00071         ));
00072         $this->addColumn('tags', array(
00073             'header'    => Mage::helper('tag')->__('Tags'),
00074             'index'     => 'tags',
00075             'sortable'  => false,
00076             'filter'    => false,
00077             'renderer'  => 'adminhtml/tag_grid_column_renderer_tags'
00078         ));
00079         $this->addColumn('action', array(
00080             'header'    => Mage::helper('tag')->__('Action'),
00081             'align'     => 'center',
00082             'width'     => '120px',
00083             'format'    => '<a href="'.$this->getUrl('*/*/customers/product_id/$product_id').'">'.Mage::helper('tag')->__('View Customers').'</a>',
00084             'filter'    => false,
00085             'sortable'  => false,
00086             'is_system' => true
00087         ));
00088 
00089         return parent::_prepareColumns();
00090     }


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