Mage_Catalog_Block_Layer_State Class Reference

Inheritance diagram for Mage_Catalog_Block_Layer_State:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getActiveFilters ()
 getClearUrl ()
 getLayer ()


Detailed Description

Definition at line 34 of file State.php.


Constructor & Destructor Documentation

__construct (  ) 

Initialize Layer State template

Reimplemented from Varien_Object.

Definition at line 40 of file State.php.

00041     {
00042         parent::__construct();
00043         $this->setTemplate('catalog/layer/state.phtml');
00044     }


Member Function Documentation

getActiveFilters (  ) 

Retrieve active filters

Returns:
array

Definition at line 51 of file State.php.

00052     {
00053         $filters = $this->getLayer()->getState()->getFilters();
00054         if (!is_array($filters)) {
00055             $filters = array();
00056         }
00057         return $filters;
00058     }

getClearUrl (  ) 

Retrieve Clear Filters URL

Returns:
string

Definition at line 65 of file State.php.

00066     {
00067         $filterState = array();
00068         foreach ($this->getActiveFilters() as $item) {
00069             $filterState[$item->getFilter()->getRequestVar()] = $item->getFilter()->getResetValue();
00070         }
00071         $params['_current'] = true;
00072         $params['_use_rewrite'] = true;
00073         $params['_query']   = $filterState;
00074         return Mage::getUrl('*/*/*', $params);
00075     }

getLayer (  ) 

Retrieve Layer object

Returns:
Mage_Catalog_Model_Layer

Definition at line 82 of file State.php.

00083     {
00084         if (!$this->hasData('layer')) {
00085             $this->setLayer(Mage::getSingleton('catalog/layer'));
00086         }
00087         return $this->_getData('layer');
00088     }


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

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