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_Adminhtml_Cms_PageController
  • Mage_Adminhtml_Model_System_Config_Source_Cms_Wysiwyg_Enabled
  • Mage_Cms_Block_Block
  • Mage_Cms_Block_Page
  • Mage_Cms_Block_Widget_Block
  • Mage_Cms_Block_Widget_Page_Link
  • Mage_Cms_Controller_Router
  • Mage_Cms_Helper_Data
  • Mage_Cms_Helper_Page
  • Mage_Cms_Helper_Wysiwyg_Images
  • Mage_Cms_IndexController
  • Mage_Cms_Model_Block
  • Mage_Cms_Model_Mysql4_Block
  • Mage_Cms_Model_Mysql4_Block_Collection
  • Mage_Cms_Model_Mysql4_Page
  • Mage_Cms_Model_Mysql4_Page_Collection
  • Mage_Cms_Model_Mysql4_Page_Service
  • Mage_Cms_Model_Observer
  • Mage_Cms_Model_Page
  • Mage_Cms_Model_Resource_Block
  • Mage_Cms_Model_Resource_Block_Collection
  • Mage_Cms_Model_Resource_Page
  • Mage_Cms_Model_Resource_Page_Collection
  • Mage_Cms_Model_Resource_Page_Service
  • Mage_Cms_Model_Template_Filter
  • Mage_Cms_Model_Wysiwyg_Config
  • Mage_Cms_Model_Wysiwyg_Images_Storage
  • Mage_Cms_Model_Wysiwyg_Images_Storage_Collection
  • Mage_Cms_PageController
  • 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_Cms
 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:  * Wysiwyg Config for Editor HTML Element
 29:  *
 30:  * @category    Mage
 31:  * @package     Mage_Cms
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Cms_Model_Wysiwyg_Config extends Varien_Object
 35: {
 36:     /**
 37:      * Wysiwyg behaviour
 38:      */
 39:     const WYSIWYG_ENABLED = 'enabled';
 40:     const WYSIWYG_HIDDEN = 'hidden';
 41:     const WYSIWYG_DISABLED = 'disabled';
 42:     const IMAGE_DIRECTORY = 'wysiwyg';
 43: 
 44:     /**
 45:      * Return Wysiwyg config as Varien_Object
 46:      *
 47:      * Config options description:
 48:      *
 49:      * enabled:                 Enabled Visual Editor or not
 50:      * hidden:                  Show Visual Editor on page load or not
 51:      * use_container:           Wrap Editor contents into div or not
 52:      * no_display:              Hide Editor container or not (related to use_container)
 53:      * translator:              Helper to translate phrases in lib
 54:      * files_browser_*:         Files Browser (media, images) settings
 55:      * encode_directives:       Encode template directives with JS or not
 56:      *
 57:      * @param $data Varien_Object constructor params to override default config values
 58:      * @return Varien_Object
 59:      */
 60:     public function getConfig($data = array())
 61:     {
 62:         $config = new Varien_Object();
 63: 
 64:         $config->setData(array(
 65:             'enabled'                       => $this->isEnabled(),
 66:             'hidden'                        => $this->isHidden(),
 67:             'use_container'                 => false,
 68:             'add_variables'                 => true,
 69:             'add_widgets'                   => true,
 70:             'no_display'                    => false,
 71:             'translator'                    => Mage::helper('cms'),
 72:             'encode_directives'             => true,
 73:             'directives_url'                => Mage::getSingleton('adminhtml/url')->getUrl('*/cms_wysiwyg/directive'),
 74:             'popup_css'                     =>
 75:                 Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css',
 76:             'content_css'                   =>
 77:                 Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css',
 78:             'width'                         => '100%',
 79:             'plugins'                       => array()
 80:         ));
 81: 
 82:         $config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));
 83: 
 84:         if (Mage::getSingleton('admin/session')->isAllowed('cms/media_gallery')) {
 85:             $config->addData(array(
 86:                 'add_images'               => true,
 87:                 'files_browser_window_url' => Mage::getSingleton('adminhtml/url')->getUrl('*/cms_wysiwyg_images/index'),
 88:                 'files_browser_window_width' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width'),
 89:                 'files_browser_window_height'=> (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height'),
 90:             ));
 91:         }
 92: 
 93:         if (is_array($data)) {
 94:             $config->addData($data);
 95:         }
 96: 
 97:         Mage::dispatchEvent('cms_wysiwyg_config_prepare', array('config' => $config));
 98: 
 99:         return $config;
100:     }
101: 
102:     /**
103:      * Return URL for skin images placeholder
104:      *
105:      * @return string
106:      */
107:     public function getSkinImagePlaceholderUrl()
108:     {
109:         return Mage::getDesign()->getSkinUrl('images/wysiwyg/skin_image.png');
110:     }
111: 
112:     /**
113:      * Check whether Wysiwyg is enabled or not
114:      *
115:      * @return bool
116:      */
117:     public function isEnabled()
118:     {
119:         $storeId = $this->getStoreId();
120:         if (!is_null($storeId)) {
121:             $wysiwygState = Mage::getStoreConfig('cms/wysiwyg/enabled', $storeId);
122:         } else {
123:             $wysiwygState = Mage::getStoreConfig('cms/wysiwyg/enabled');
124:         }
125:         return in_array($wysiwygState, array(self::WYSIWYG_ENABLED, self::WYSIWYG_HIDDEN));
126:     }
127: 
128:     /**
129:      * Check whether Wysiwyg is loaded on demand or not
130:      *
131:      * @return bool
132:      */
133:     public function isHidden()
134:     {
135:         return Mage::getStoreConfig('cms/wysiwyg/enabled') == self::WYSIWYG_HIDDEN;
136:     }
137: }
138: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0