00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 abstract class Mage_Catalog_Block_Layer_Filter_Abstract extends Mage_Core_Block_Template
00035 {
00036
00037
00038
00039
00040
00041 protected $_filter;
00042
00043
00044
00045
00046
00047
00048 protected $_filterModelName;
00049
00050
00051
00052
00053
00054 public function __construct()
00055 {
00056 parent::__construct();
00057 $this->setTemplate('catalog/layer/filter.phtml');
00058 }
00059
00060
00061
00062
00063
00064
00065 public function init()
00066 {
00067 $this->_initFilter();
00068 return $this;
00069 }
00070
00071
00072
00073
00074
00075
00076 protected function _initFilter()
00077 {
00078 if (!$this->_filterModelName) {
00079 Mage::throwException(Mage::helper('catalog')->__('Filter model name must be declared'));
00080 }
00081 $this->_filter = Mage::getModel($this->_filterModelName)
00082 ->setLayer($this->getLayer());
00083 $this->_prepareFilter();
00084
00085 $this->_filter->apply($this->getRequest(), $this);
00086 return $this;
00087 }
00088
00089
00090
00091
00092
00093
00094 protected function _prepareFilter()
00095 {
00096 return $this;
00097 }
00098
00099
00100
00101
00102
00103
00104 public function getName()
00105 {
00106 return $this->_filter->getName();
00107 }
00108
00109
00110
00111
00112
00113
00114 public function getItems()
00115 {
00116 return $this->_filter->getItems();
00117 }
00118
00119
00120
00121
00122
00123
00124 public function getItemsCount()
00125 {
00126 return $this->_filter->getItemsCount();
00127 }
00128
00129
00130
00131
00132
00133
00134 public function getHtml()
00135 {
00136 return parent::_toHtml();
00137 }
00138 }