From b96b80f29414e8b29d81b9f5eb5e541a468fbcf8 Mon Sep 17 00:00:00 2001 From: Jeongkyu Shin Date: Wed, 11 Mar 2015 13:49:12 +0900 Subject: [PATCH] refs #1749 : added - plugin variables in context model for editor plugins. - --- library/model/common.module.php | 3 +++ library/view/ownerView.php | 2 ++ plugins/ED_tinyMCE/index.php | 1 + 3 files changed, 6 insertions(+) diff --git a/library/model/common.module.php b/library/model/common.module.php index a02b29e33..d0d9a5250 100644 --- a/library/model/common.module.php +++ b/library/model/common.module.php @@ -32,6 +32,9 @@ function getEditorInfo($editor) { $pluginURL = $context->getProperty('service.path') . '/plugins/' . $editorMappings[$editor]['plugin']; $pluginName = $editorMappings[$editor]['plugin']; $pluginPath = ROOT . "/plugins/{$pluginName}"; + $context->setProperty('plugin.url',$context->getProperty('service.path') . '/plugins/' . $editorMappings[$editor]['plugin']); + $context->setProperty('plugin.name', $editorMappings[$editor]['plugin']); + $context->setProperty('plugin.path',ROOT . "/plugins/{$pluginName}"); if (!empty($configMappings[$pluginName]['config'])) { $configVal = getCurrentSetting($pluginName); } else { diff --git a/library/view/ownerView.php b/library/view/ownerView.php index fcebeff93..ddada30eb 100644 --- a/library/view/ownerView.php +++ b/library/view/ownerView.php @@ -143,6 +143,8 @@ function getEditor() { if (isset($editor['initfunc']) && function_exists($editor['initfunc'])) { echo "\t\t\n".call_user_func_array($editor['initfunc'], array(&$editor))."\t\t\n"; $pluginURL = $pluginName = ""; + $context->unsetProperty('plugin.url'); + $context->unsetProperty('plugin.name'); } } } diff --git a/plugins/ED_tinyMCE/index.php b/plugins/ED_tinyMCE/index.php index df9d465ac..e165f1605 100644 --- a/plugins/ED_tinyMCE/index.php +++ b/plugins/ED_tinyMCE/index.php @@ -19,6 +19,7 @@ function tinyMCE_editorinit($editor) { if(empty($config['editormode'])) $config['editormode'] = 'simple'; if(empty($config['width'])) $config['width'] = 'skin'; if(empty($config['srctheme'])) $config['srctheme'] = 'default'; +// var_dump($context->getAllFromNamespace("plugin")); ob_start(); ?> var editor = new tinymce.Editor('editWindow', {