*/ class Mage_Core_Model_Variable_Config { /** * Prepare variable wysiwyg config * * @param Varien_Object $config * @return array */ public function getWysiwygPluginSettings($config) { $variableConfig = array(); $onclickParts = array( 'search' => array('html_id'), 'subject' => 'MagentovariablePlugin.loadChooser(\''.$this->getVariablesWysiwygActionUrl().'\', \'{{html_id}}\');' ); $variableWysiwygPlugin = array(array('name' => 'magentovariable', 'src' => $this->getWysiwygJsPluginSrc(), 'options' => array( 'title' => Mage::helper('adminhtml')->__('Insert Variable...'), 'url' => $this->getVariablesWysiwygActionUrl(), 'onclick' => $onclickParts, 'class' => 'add-variable plugin' ))); $configPlugins = $config->getData('plugins'); $variableConfig['plugins'] = array_merge($configPlugins, $variableWysiwygPlugin); return $variableConfig; } /** * Return url to wysiwyg plugin * * @return string */ public function getWysiwygJsPluginSrc() { return Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js'; } /** * Return url of action to get variables * * @return string */ public function getVariablesWysiwygActionUrl() { return Mage::getSingleton('adminhtml/url')->getUrl('*/system_variable/wysiwygPlugin'); } }