Mage_Page_Block_Html Class Reference

Inheritance diagram for Mage_Page_Block_Html:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getBaseUrl ()
 getBaseSecureUrl ()
 getCurrentUrl ()
 getPrintLogoUrl ()
 getPrintLogoText ()
 setHeaderTitle ($title)
 getHeaderTitle ()
 addBodyClass ($className)
 getLang ()
 setTheme ($theme)
 getBodyClass ()
 getAbsoluteFooter ()

Protected Member Functions

 _afterToHtml ($html)

Protected Attributes

 $_urls = array()
 $_title = ''


Detailed Description

Definition at line 34 of file Html.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 39 of file Html.php.

00040     {
00041         parent::__construct();
00042         $this->_urls = array(
00043             'base'      => Mage::getBaseUrl('web'),
00044             'baseSecure'=> Mage::getBaseUrl('web', true),
00045             'current'   => $this->getRequest()->getRequestUri()
00046         );
00047 
00048         $action = Mage::app()->getFrontController()->getAction();
00049         if ($action) {
00050             $this->addBodyClass($action->getFullActionName('-'));
00051         }
00052 
00053         $this->_beforeCacheUrl();
00054     }


Member Function Documentation

_afterToHtml ( html  )  [protected]

Processing block html after rendering

Parameters:
string $html
Returns:
string

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 173 of file Html.php.

00174     {
00175         return $this->_afterCacheUrl($html);
00176     }

addBodyClass ( className  ) 

Add CSS class to page body tag

Parameters:
string $className
Returns:
Mage_Page_Block_Html

Definition at line 131 of file Html.php.

00132     {
00133         $className = preg_replace('#[^a-z0-9]+#', '-', strtolower($className));
00134         $this->setBodyClass($this->getBodyClass() . ' ' . $className);
00135         return $this;
00136     }

getAbsoluteFooter (  ) 

Definition at line 162 of file Html.php.

00163     {
00164         return Mage::getStoreConfig('design/footer/absolute_footer');
00165     }

getBaseSecureUrl (  ) 

Definition at line 61 of file Html.php.

00062     {
00063         return $this->_urls['baseSecure'];
00064     }

getBaseUrl (  ) 

Get base url of the application

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 56 of file Html.php.

00057     {
00058         return $this->_urls['base'];
00059     }

getBodyClass (  ) 

Definition at line 157 of file Html.php.

00158     {
00159         return $this->_getData('body_class');
00160     }

getCurrentUrl (  ) 

Definition at line 66 of file Html.php.

00067     {
00068         return $this->_urls['current'];
00069     }

getHeaderTitle (  ) 

Definition at line 120 of file Html.php.

00121     {
00122         return $this->_title;
00123     }

getLang (  ) 

Definition at line 138 of file Html.php.

00139     {
00140         if (!$this->hasData('lang')) {
00141             $this->setData('lang', substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2));
00142         }
00143         return $this->getData('lang');
00144     }

getPrintLogoText (  ) 

Definition at line 109 of file Html.php.

00110     {
00111         return Mage::getStoreConfig('sales/identity/address');
00112     }

getPrintLogoUrl (  ) 

Print Logo URL (Conf -> Sales -> Invoice and Packing Slip Design)

Returns:
string

Definition at line 76 of file Html.php.

00077     {
00078         // load html logo
00079         $logo = Mage::getStoreConfig('sales/identity/logo_html');
00080         if (!empty($logo)) {
00081             $logo = 'sales/store/logo_html/' . $logo;
00082         }
00083 
00084         // load default logo
00085         if (empty($logo)) {
00086             $logo = Mage::getStoreConfig('sales/identity/logo');
00087             if (!empty($logo)) {
00088                 // prevent tiff format displaying in html
00089                 if (strtolower(substr($logo, -5)) === '.tiff' || strtolower(substr($logo, -4)) === '.tif') {
00090                     $logo = '';
00091                 }
00092                 else {
00093                     $logo = 'sales/store/logo/' . $logo;
00094                 }
00095             }
00096         }
00097 
00098         // buld url
00099         if (!empty($logo)) {
00100             $logo = Mage::getStoreConfig('web/unsecure/base_media_url') . $logo;
00101         }
00102         else {
00103             $logo = '';
00104         }
00105 
00106         return $logo;
00107     }

setHeaderTitle ( title  ) 

Definition at line 114 of file Html.php.

00115     {
00116         $this->_title = $title;
00117         return $this;
00118     }

setTheme ( theme  ) 

Definition at line 146 of file Html.php.

00147     {
00148         $arr = explode('/', $theme);
00149         if (isset($arr[1])) {
00150             Mage::getDesign()->setPackageName($arr[0])->setTheme($arr[1]);
00151         } else {
00152             Mage::getDesign()->setTheme($theme);
00153         }
00154         return $this;
00155     }


Member Data Documentation

$_title = '' [protected]

Definition at line 37 of file Html.php.

$_urls = array() [protected]

Definition at line 36 of file Html.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:30 2009 for Magento by  doxygen 1.5.8