*/ class Mage_Page_Block_Html_Breadcrumbs extends Mage_Core_Block_Template { /** * Array of breadcrumbs * * array( * [$index] => array( * ['label'] * ['title'] * ['link'] * ['first'] * ['last'] * ) * ) * * @var array */ protected $_crumbs = null; function __construct() { parent::__construct(); $this->setTemplate('page/html/breadcrumbs.phtml'); } function addCrumb($crumbName, $crumbInfo, $after = false) { $this->_prepareArray($crumbInfo, array('label', 'title', 'link', 'first', 'last', 'readonly')); if ((!isset($this->_crumbs[$crumbName])) || (!$this->_crumbs[$crumbName]['readonly'])) { $this->_crumbs[$crumbName] = $crumbInfo; } return $this; } protected function _toHtml() { if (is_array($this->_crumbs)) { reset($this->_crumbs); $this->_crumbs[key($this->_crumbs)]['first'] = true; end($this->_crumbs); $this->_crumbs[key($this->_crumbs)]['last'] = true; } $this->assign('crumbs', $this->_crumbs); return parent::_toHtml(); } }