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 class Mage_Page_Block_Html_Breadcrumbs extends Mage_Core_Block_Template
00035 {
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 protected $_crumbs = null;
00052
00053 function __construct()
00054 {
00055 parent::__construct();
00056 $this->setTemplate('page/html/breadcrumbs.phtml');
00057 }
00058
00059 function addCrumb($crumbName, $crumbInfo, $after = false)
00060 {
00061 $this->_prepareArray($crumbInfo, array('label', 'title', 'link', 'first', 'last', 'readonly'));
00062 if ((!isset($this->_crumbs[$crumbName])) || (!$this->_crumbs[$crumbName]['readonly'])) {
00063 $this->_crumbs[$crumbName] = $crumbInfo;
00064 }
00065 return $this;
00066 }
00067
00068 protected function _toHtml()
00069 {
00070 if (is_array($this->_crumbs)) {
00071 reset($this->_crumbs);
00072 $this->_crumbs[key($this->_crumbs)]['first'] = true;
00073 end($this->_crumbs);
00074 $this->_crumbs[key($this->_crumbs)]['last'] = true;
00075 }
00076 $this->assign('crumbs', $this->_crumbs);
00077 return parent::_toHtml();
00078 }
00079 }