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
00035 class Mage_Catalog_Block_Breadcrumbs extends Mage_Core_Block_Template
00036 {
00037
00038
00039
00040
00041
00042
00043 public function getTitleSeparator($store = null)
00044 {
00045 $separator = (string)Mage::getStoreConfig('catalog/seo/title_separator', $store);
00046 return ' ' . $separator . ' ';
00047 }
00048
00049
00050
00051
00052
00053
00054 protected function _prepareLayout()
00055 {
00056 if ($breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs')) {
00057 $breadcrumbsBlock->addCrumb('home', array(
00058 'label'=>Mage::helper('catalog')->__('Home'),
00059 'title'=>Mage::helper('catalog')->__('Go to Home Page'),
00060 'link'=>Mage::getBaseUrl()
00061 ));
00062
00063 $title = array();
00064 $path = Mage::helper('catalog')->getBreadcrumbPath();
00065
00066 foreach ($path as $name => $breadcrumb) {
00067 $breadcrumbsBlock->addCrumb($name, $breadcrumb);
00068 $title[] = $breadcrumb['label'];
00069 }
00070
00071 if ($headBlock = $this->getLayout()->getBlock('head')) {
00072 $headBlock->setTitle(join($this->getTitleSeparator(), array_reverse($title)));
00073 }
00074 }
00075 return parent::_prepareLayout();
00076 }
00077 }