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_Header extends Mage_Core_Block_Template
00035 {
00036 public function _construct()
00037 {
00038 $this->setTemplate('page/html/header.phtml');
00039 }
00040
00041 public function setLogo($logo_src, $logo_alt)
00042 {
00043 $this->setLogoSrc($logo_src);
00044 $this->setLogoAlt($logo_alt);
00045 return $this;
00046 }
00047
00048 public function getLogoSrc()
00049 {
00050 if (empty($this->_data['logo_src'])) {
00051 $this->_data['logo_src'] = Mage::getStoreConfig('design/header/logo_src');
00052 }
00053 return $this->getSkinUrl($this->_data['logo_src']);
00054 }
00055
00056 public function getLogoAlt()
00057 {
00058 if (empty($this->_data['logo_alt'])) {
00059 $this->_data['logo_alt'] = Mage::getStoreConfig('design/header/logo_alt');
00060 }
00061 return $this->_data['logo_alt'];
00062 }
00063
00064 public function getWelcome()
00065 {
00066 if (empty($this->_data['welcome'])) {
00067 if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
00068 $this->_data['welcome'] = $this->__('Welcome, %s!', $this->htmlEscape(Mage::getSingleton('customer/session')->getCustomer()->getName()));
00069 } else {
00070 $this->_data['welcome'] = Mage::getStoreConfig('design/header/welcome');
00071 }
00072 }
00073
00074 return $this->_data['welcome'];
00075 }
00076
00077 }