setData(array( 'enabled' => $this->isEnabled(), 'hidden' => $this->isHidden(), 'use_container' => false, 'add_variables' => true, 'add_widgets' => true, 'no_display' => false, 'translator' => Mage::helper('cms'), 'encode_directives' => true, 'directives_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive'), 'popup_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css', 'content_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css', 'width' => '100%', 'plugins' => array() )); $config->setData('directives_url_quoted', preg_quote($config->getData('directives_url'))); if (Mage::getSingleton('admin/session')->isAllowed('cms/media_gallery')) { $config->addData(array( 'add_images' => true, 'files_browser_window_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index'), 'files_browser_window_width' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width'), 'files_browser_window_height' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height'), 'encode_directives' => true, 'directives_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive'), )); } if (is_array($data)) { $config->addData($data); } Mage::dispatchEvent('cms_wysiwyg_config_prepare', array('config' => $config)); return $config; } /** * Return URL for skin images placeholder * * @return string */ public function getSkinImagePlaceholderUrl() { return Mage::getDesign()->getSkinUrl('images/wysiwyg/skin_image.png'); } /** * Check whether Wysiwyg is enabled or not * * @return bool */ public function isEnabled() { $storeId = $this->getStoreId(); if (!is_null($storeId)) { $wysiwygState = Mage::getStoreConfig('cms/wysiwyg/enabled', $storeId); } else { $wysiwygState = Mage::getStoreConfig('cms/wysiwyg/enabled'); } return in_array($wysiwygState, array(self::WYSIWYG_ENABLED, self::WYSIWYG_HIDDEN)); } /** * Check whether Wysiwyg is loaded on demand or not * * @return bool */ public function isHidden() { return Mage::getStoreConfig('cms/wysiwyg/enabled') == self::WYSIWYG_HIDDEN; } }