Mage_Adminhtml_Block_Report_Tag_Product_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Report_Tag_Product_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 ()


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('gridProducts');
00041     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 43 of file Grid.php.

00044     {
00045 
00046         $collection = Mage::getResourceModel('reports/tag_product_collection');
00047 
00048         $collection->addUniqueTagedCount()
00049             ->addAllTagedCount()
00050             ->addStatusFilter(Mage::getModel('tag/tag')->getApprovedStatus())
00051             ->addGroupByProduct();
00052 
00053         $this->setCollection($collection);
00054         return parent::_prepareCollection();
00055     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 57 of file Grid.php.

00058     {
00059 
00060         $this->addColumn('entity_id', array(
00061             'header'    =>Mage::helper('reports')->__('ID'),
00062             'width'     =>'50px',
00063             'align'     =>'right',
00064             'index'     =>'entity_id'
00065         ));
00066 
00067         $this->addColumn('name', array(
00068             'header'    =>Mage::helper('reports')->__('Product Name'),
00069             'index'     =>'name'
00070         ));
00071 
00072         $this->addColumn('utaged', array(
00073             'header'    =>Mage::helper('reports')->__('Number of Unique Tags'),
00074             'width'     =>'50px',
00075             'align'     =>'right',
00076             'index'     =>'utaged'
00077         ));
00078 
00079         $this->addColumn('taged', array(
00080             'header'    =>Mage::helper('reports')->__('Number of Total Tags'),
00081             'width'     =>'50px',
00082             'align'     =>'right',
00083             'index'     =>'taged'
00084         ));
00085 
00086         $this->addColumn('action',
00087             array(
00088                 'header'    => Mage::helper('catalog')->__('Action'),
00089                 'width'     => '100%',
00090                 'type'      => 'action',
00091                 'getter'    => 'getId',
00092                 'actions'   => array(
00093                     array(
00094                         'caption' => Mage::helper('catalog')->__('Show Tags'),
00095                         'url'     => array(
00096                             'base'=>'*/*/productDetail'
00097                         ),
00098                         'field'   => 'id'
00099                     )
00100                 ),
00101                 'filter'    => false,
00102                 'sortable'  => false,
00103                 'index'     => 'stores',
00104         ));
00105 
00106         $this->setFilterVisibility(false);
00107 
00108         $this->addExportType('*/*/exportProductCsv', Mage::helper('reports')->__('CSV'));
00109         $this->addExportType('*/*/exportProductExcel', Mage::helper('reports')->__('Excel'));
00110 
00111         return parent::_prepareColumns();
00112     }

getRowUrl ( row  ) 

Definition at line 114 of file Grid.php.

00115     {
00116         return $this->getUrl('*/*/productDetail', array('id'=>$row->getId()));
00117     }


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

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