Mage_CatalogSearch_Block_Advanced_Result Class Reference

Inheritance diagram for Mage_CatalogSearch_Block_Advanced_Result:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 setListOrders ()
 setListModes ()
 setListCollection ()
 getSearchModel ()
 getResultCount ()
 getProductListHtml ()
 getFormUrl ()
 getSearchCriterias ()

Protected Member Functions

 _prepareLayout ()
 _getProductCollection ()


Detailed Description

Definition at line 34 of file Result.php.


Member Function Documentation

_getProductCollection (  )  [protected]

Definition at line 78 of file Result.php.

00078                                               {
00079         return $this->getSearchModel()->getProductCollection();
00080     }

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 36 of file Result.php.

00037     {
00038         if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) {
00039             $breadcrumbs->addCrumb('home', array(
00040                 'label'=>Mage::helper('catalogsearch')->__('Home'),
00041                 'title'=>Mage::helper('catalogsearch')->__('Go to Home Page'),
00042                 'link'=>Mage::getBaseUrl()
00043             ))->addCrumb('search', array(
00044                 'label'=>Mage::helper('catalogsearch')->__('Catalog Advanced Search'),
00045                 'link'=>$this->getUrl('*/*/')
00046             ))->addCrumb('search_result', array(
00047                 'label'=>Mage::helper('catalogsearch')->__('Results')
00048             ));
00049         }
00050         return parent::_prepareLayout();
00051     }

getFormUrl (  ) 

Definition at line 101 of file Result.php.

00102     {
00103         return Mage::getModel('core/url')
00104             ->setQueryParams($this->getRequest()->getQuery())
00105             ->getUrl('*/*/', array('_escape' => true));
00106     }

getProductListHtml (  ) 

Definition at line 96 of file Result.php.

00097     {
00098         return $this->getChildHtml('search_result_list');
00099     }

getResultCount (  ) 

Definition at line 87 of file Result.php.

00088     {
00089         if (!$this->getData('result_count')) {
00090             $size = $this->getSearchModel()->getProductCollection()->getSize();
00091             $this->setResultCount($size);
00092         }
00093         return $this->getData('result_count');
00094     }

getSearchCriterias (  ) 

Definition at line 108 of file Result.php.

00109     {
00110         $searchCriterias = $this->getSearchModel()->getSearchCriterias();
00111         $middle = ceil(count($searchCriterias) / 2);
00112         $left = array_slice($searchCriterias, 0, $middle);
00113         $right = array_slice($searchCriterias, $middle);
00114 
00115         return array('left'=>$left, 'right'=>$right);
00116     }

getSearchModel (  ) 

Definition at line 82 of file Result.php.

00083     {
00084         return Mage::getSingleton('catalogsearch/advanced');
00085     }

setListCollection (  ) 

Definition at line 73 of file Result.php.

00073                                         {
00074         $this->getChild('search_result_list')
00075            ->setCollection($this->_getProductCollection());
00076     }

setListModes (  ) 

Definition at line 65 of file Result.php.

00065                                    {
00066         $this->getChild('search_result_list')
00067             ->setModes(array(
00068                 'grid' => Mage::helper('catalogsearch')->__('Grid'),
00069                 'list' => Mage::helper('catalogsearch')->__('List'))
00070             );
00071     }

setListOrders (  ) 

Definition at line 53 of file Result.php.

00053                                     {
00054         $category = Mage::getSingleton('catalog/layer')
00055             ->getCurrentCategory();
00056         /* @var $category Mage_Catalog_Model_Category */
00057 
00058         $availableOrders = $category->getAvailableSortByOptions();
00059         unset($availableOrders['position']);
00060 
00061         $this->getChild('search_result_list')
00062             ->setAvailableOrders($availableOrders);
00063     }


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

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