Public Member Functions | |
__construct () | |
getRowUrl ($row) | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () | |
Protected Attributes | |
$_collection |
Definition at line 35 of file Last.php.
__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 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
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 | ) |
$_collection [protected] |