Mage_Adminhtml_Block_Dashboard_Searches_Top Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Dashboard_Searches_Top:

Mage_Adminhtml_Block_Dashboard_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 ()

Protected Attributes

 $_collection


Detailed Description

Definition at line 35 of file Top.php.


Constructor & Destructor Documentation

__construct (  ) 

Setting default for every grid on dashboard

Reimplemented from Mage_Adminhtml_Block_Dashboard_Grid.

Definition at line 39 of file Top.php.

00040     {
00041         parent::__construct();
00042         $this->setId('topSearchGrid');
00043     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 45 of file Top.php.

00046     {
00047         $this->_collection = Mage::getModel('catalogsearch/query')
00048             ->getResourceCollection();
00049 
00050         if ($this->getRequest()->getParam('store')) {
00051             $storeIds = $this->getRequest()->getParam('store');
00052         } else if ($this->getRequest()->getParam('website')){
00053             $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
00054         } else if ($this->getRequest()->getParam('group')){
00055             $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
00056         } else {
00057             $storeIds = '';
00058         }
00059 
00060         $this->_collection
00061             ->setPopularQueryFilter($storeIds);
00062 
00063         $this->setCollection($this->_collection);
00064 
00065         return parent::_prepareCollection();
00066     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 68 of file Top.php.

00069     {
00070         $this->addColumn('search_query', array(
00071             'header'    => $this->__('Search Term'),
00072             'sortable'  => false,
00073             'index'     => 'query_text',
00074             'renderer'  => 'adminhtml/dashboard_searches_renderer_searchquery',
00075         ));
00076 
00077         $this->addColumn('num_results', array(
00078             'header'    => $this->__('Results'),
00079             'sortable'  => false,
00080             'index'     => 'num_results',
00081             'type'      => 'number'
00082         ));
00083 
00084         $this->addColumn('popularity', array(
00085             'header'    => $this->__('Number of Uses'),
00086             'sortable'  => false,
00087             'index'     => 'popularity',
00088             'type'      => 'number'
00089         ));
00090 
00091         $this->setFilterVisibility(false);
00092         $this->setPagerVisibility(false);
00093 
00094         return parent::_prepareColumns();
00095     }

getRowUrl ( row  ) 

Definition at line 97 of file Top.php.

00098     {
00099         return $this->getUrl('*/catalog_search/edit', array('id'=>$row->getId()));
00100     }


Member Data Documentation

$_collection [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 37 of file Top.php.


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

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