Mage_Adminhtml_Block_Dashboard_Searches_Last Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Dashboard_Searches_Last:

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 Last.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 Last.php.

00040     {
00041         parent::__construct();
00042         $this->setId('lastSearchGrid');
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 Last.php.

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

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 66 of file Last.php.

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

getRowUrl ( row  ) 

Definition at line 95 of file Last.php.

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


Member Data Documentation

$_collection [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 37 of file Last.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