Mage_Adminhtml_Block_Report_Tag_Popular_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Report_Tag_Popular_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('grid');
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         if ($this->getRequest()->getParam('website')) {
00047             $storeId = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
00048         } else if ($this->getRequest()->getParam('group')) {
00049             $storeId = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
00050         } else if ($this->getRequest()->getParam('store')) {
00051             $storeId = (int)$this->getRequest()->getParam('store');
00052         } else {
00053             $storeId = '';
00054         }
00055 
00056         $collection = Mage::getResourceModel('reports/tag_collection')
00057             ->addSummary($storeId)
00058             ->addStatusFilter(Mage::getModel('tag/tag')->getApprovedStatus());
00059 
00060         if($storeId != '') {
00061             $collection->addStoreFilter($storeId);
00062         }
00063 
00064         $this->setCollection($collection);
00065         return parent::_prepareCollection();
00066     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 68 of file Grid.php.

00069     {
00070         $this->addColumn('name', array(
00071             'header'    =>Mage::helper('reports')->__('Tag Name'),
00072             'sortable'  =>false,
00073             'index'     =>'name'
00074         ));
00075 
00076         $this->addColumn('taged', array(
00077             'header'    =>Mage::helper('reports')->__('Popularity'),
00078             'width'     =>'50px',
00079             'align'     =>'right',
00080             'sortable'  =>false,
00081             'index'     =>'popularity'
00082         ));
00083 
00084         $this->addColumn('uses', array(
00085             'header'    =>Mage::helper('reports')->__('Number Of Uses'),
00086             'width'     =>'50px',
00087             'align'     =>'right',
00088             'sortable'  =>false,
00089             'index'     =>'uses'
00090         ));
00091 
00092         $this->addColumn('historical_uses', array(
00093             'header'    =>Mage::helper('reports')->__('Number Of Historical Uses'),
00094             'width'     =>'50px',
00095             'align'     =>'right',
00096             'sortable'  =>false,
00097             'index'     =>'historical_uses'
00098         ));
00099 
00100         $this->addColumn('action',
00101             array(
00102                 'header'    => Mage::helper('catalog')->__('Action'),
00103                 'width'     => '100%',
00104                 'type'      => 'action',
00105                 'getter'    => 'getId',
00106                 'actions'   => array(
00107                     array(
00108                         'caption' => Mage::helper('catalog')->__('Show Details'),
00109                         'url'     => array(
00110                             'base'=>'*/*/tagDetail'
00111                         ),
00112                         'field'   => 'id'
00113                     )
00114                 ),
00115                 'filter'    => false,
00116                 'sortable'  => false,
00117                 'index'     => 'stores',
00118         ));
00119         $this->setFilterVisibility(false);
00120 
00121         $this->addExportType('*/*/exportPopularCsv', Mage::helper('reports')->__('CSV'));
00122         $this->addExportType('*/*/exportPopularExcel', Mage::helper('reports')->__('Excel'));
00123 
00124         return parent::_prepareColumns();
00125     }

getRowUrl ( row  ) 

Definition at line 127 of file Grid.php.

00128     {
00129         return $this->getUrl('*/*/tagDetail', array('id'=>$row->getTagId()));
00130     }


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