Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Catalog_Block_Seo_Sitemap_Tree_Pager
  • Mage_Page_Block_Html
  • Mage_Page_Block_Html_Breadcrumbs
  • Mage_Page_Block_Html_Footer
  • Mage_Page_Block_Html_Head
  • Mage_Page_Block_Html_Header
  • Mage_Page_Block_Html_Notices
  • Mage_Page_Block_Html_Pager
  • Mage_Page_Block_Html_Topmenu
  • Mage_Page_Block_Html_Welcome
  • Mage_Page_Block_Html_Wrapper
  • Mage_Page_Block_Js_Cookie
  • Mage_Page_Block_Redirect
  • Mage_Page_Helper_Data
  • Mage_Page_Helper_Html
  • Mage_Page_Helper_Layout
  • Mage_Page_Model_Config
  • Mage_Page_Model_Source_Layout
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Page
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Html page block
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Page
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Page_Block_Html extends Mage_Core_Block_Template
 35: {
 36:     protected $_urls = array();
 37:     protected $_title = '';
 38: 
 39:     public function __construct()
 40:     {
 41:         parent::__construct();
 42:         $this->_urls = array(
 43:             'base'      => Mage::getBaseUrl('web'),
 44:             'baseSecure'=> Mage::getBaseUrl('web', true),
 45:             'current'   => $this->getRequest()->getRequestUri()
 46:         );
 47: 
 48:         $action = Mage::app()->getFrontController()->getAction();
 49:         if ($action) {
 50:             $this->addBodyClass($action->getFullActionName('-'));
 51:         }
 52: 
 53:         $this->_beforeCacheUrl();
 54:     }
 55: 
 56:     public function getBaseUrl()
 57:     {
 58:         return $this->_urls['base'];
 59:     }
 60: 
 61:     public function getBaseSecureUrl()
 62:     {
 63:         return $this->_urls['baseSecure'];
 64:     }
 65: 
 66:     public function getCurrentUrl()
 67:     {
 68:         return $this->_urls['current'];
 69:     }
 70: 
 71:     /**
 72:      *  Print Logo URL (Conf -> Sales -> Invoice and Packing Slip Design)
 73:      *
 74:      *  @return   string
 75:      */
 76:     public function getPrintLogoUrl ()
 77:     {
 78:         // load html logo
 79:         $logo = Mage::getStoreConfig('sales/identity/logo_html');
 80:         if (!empty($logo)) {
 81:             $logo = 'sales/store/logo_html/' . $logo;
 82:         }
 83: 
 84:         // load default logo
 85:         if (empty($logo)) {
 86:             $logo = Mage::getStoreConfig('sales/identity/logo');
 87:             if (!empty($logo)) {
 88:                 // prevent tiff format displaying in html
 89:                 if (strtolower(substr($logo, -5)) === '.tiff' || strtolower(substr($logo, -4)) === '.tif') {
 90:                     $logo = '';
 91:                 }
 92:                 else {
 93:                     $logo = 'sales/store/logo/' . $logo;
 94:                 }
 95:             }
 96:         }
 97: 
 98:         // buld url
 99:         if (!empty($logo)) {
100:             $logo = Mage::getStoreConfig('web/unsecure/base_media_url') . $logo;
101:         }
102:         else {
103:             $logo = '';
104:         }
105: 
106:         return $logo;
107:     }
108: 
109:     public function getPrintLogoText()
110:     {
111:         return Mage::getStoreConfig('sales/identity/address');
112:     }
113: 
114:     public function setHeaderTitle($title)
115:     {
116:         $this->_title = $title;
117:         return $this;
118:     }
119: 
120:     public function getHeaderTitle()
121:     {
122:         return $this->_title;
123:     }
124: 
125:     /**
126:      * Add CSS class to page body tag
127:      *
128:      * @param string $className
129:      * @return Mage_Page_Block_Html
130:      */
131:     public function addBodyClass($className)
132:     {
133:         $className = preg_replace('#[^a-z0-9]+#', '-', strtolower($className));
134:         $this->setBodyClass($this->getBodyClass() . ' ' . $className);
135:         return $this;
136:     }
137: 
138:     public function getLang()
139:     {
140:         if (!$this->hasData('lang')) {
141:             $this->setData('lang', substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2));
142:         }
143:         return $this->getData('lang');
144:     }
145: 
146:     public function setTheme($theme)
147:     {
148:         $arr = explode('/', $theme);
149:         if (isset($arr[1])) {
150:             Mage::getDesign()->setPackageName($arr[0])->setTheme($arr[1]);
151:         } else {
152:             Mage::getDesign()->setTheme($theme);
153:         }
154:         return $this;
155:     }
156: 
157:     public function getBodyClass()
158:     {
159:         return $this->_getData('body_class');
160:     }
161: 
162:     public function getAbsoluteFooter()
163:     {
164:         return Mage::getStoreConfig('design/footer/absolute_footer');
165:     }
166: 
167:     /**
168:      * Processing block html after rendering
169:      *
170:      * @param   string $html
171:      * @return  string
172:      */
173:     protected function _afterToHtml($html)
174:     {
175:         return $this->_afterCacheUrl($html);
176:     }
177: }
178: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0