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:  * Page layouts source
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Page
 32:  * @author     Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Page_Model_Source_Layout
 35: {
 36: 
 37:     /**
 38:      * Page layout options
 39:      *
 40:      * @var array
 41:      */
 42:     protected $_options = null;
 43: 
 44:     /**
 45:      * Default option
 46:      * @var string
 47:      */
 48:     protected $_defaultValue = null;
 49: 
 50:     /**
 51:      * Retrieve page layout options
 52:      *
 53:      * @return array
 54:      */
 55:     public function getOptions()
 56:     {
 57:         if ($this->_options === null) {
 58:             $this->_options = array();
 59:             foreach (Mage::getSingleton('page/config')->getPageLayouts() as $layout) {
 60:                 $this->_options[$layout->getCode()] = $layout->getLabel();
 61:                 if ($layout->getIsDefault()) {
 62:                     $this->_defaultValue = $layout->getCode();
 63:                 }
 64:             }
 65:         }
 66: 
 67:         return $this->_options;
 68:     }
 69: 
 70:     /**
 71:      * Retrieve page layout options array
 72:      *
 73:      * @return array
 74:      */
 75:     public function toOptionArray($withEmpty = false)
 76:     {
 77:         $options = array();
 78: 
 79:         foreach ($this->getOptions() as $value => $label) {
 80:             $options[] = array(
 81:                 'label' => $label,
 82:                 'value' => $value
 83:             );
 84:         }
 85: 
 86:         if ($withEmpty) {
 87:             array_unshift($options, array('value'=>'', 'label'=>Mage::helper('page')->__('-- Please Select --')));
 88:         }
 89: 
 90:         return $options;
 91:     }
 92: 
 93:     /**
 94:      * Default options value getter
 95:      * @return string
 96:      */
 97:     public function getDefaultValue()
 98:     {
 99:         $this->getOptions();
100:         return $this->_defaultValue;
101:     }
102: }
103: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0