Skip to content

Commit

Permalink
refs #1773 : updated - tinyMCE editor global variable reference to use
Browse files Browse the repository at this point in the history
 context model.

 -
  • Loading branch information
inureyes committed Mar 10, 2015
1 parent afb88d4 commit 8144597
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions plugins/ED_tinyMCE/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/***
TinyMCE Editor for Textcube
2.0
Needlworks / Jeongkyu Shin (https://github.com/inureyes)
CodeMirror plugin by zvuc (https://github.com/zvuc)
Expand All @@ -12,9 +13,8 @@ function tinyMCE_handleconfig($configVal) {
}

function tinyMCE_editorinit($editor) {
global $configVal, $pluginURL, $pluginPath;
global $configVal;
$context = Model_Context::getInstance();
$blogid = getBlogId();
$config = Setting::fetchConfigVal($configVal);
if(empty($config['editormode'])) $config['editormode'] = 'simple';
if(empty($config['width'])) $config['width'] = 'skin';
Expand All @@ -28,13 +28,13 @@ function tinyMCE_editorinit($editor) {
theme : 'modern',
skin : 'light',
<?php
if (file_exists($pluginPath.'/tinymce/langs/'.$context->getProperty('blog.language').'.js')) {
if (file_exists($context->getProperty("plugin.path","").'/tinymce/langs/'.$context->getProperty('blog.language').'.js')) {
?>
language : '<?php echo strtolower($context->getProperty('blog.language'));?>',
<?php
}
?>
popup_css_add: "<?php echo $pluginURL;?>/popup.css",
popup_css_add: "<?php echo $context->getProperty("plugin.uri");?>/popup.css",
menubar: false,
fixed_toolbar_container: "#formatbox-container",
toolbar_location : "external",
Expand Down Expand Up @@ -155,12 +155,11 @@ function tinyMCE_editorinit($editor) {
}

function tinyMCE_adminheader($target, $mother) {
global $suri, $pluginURL;
$context = Model_Context::getInstance();
if ($context->getProperty('editor.key') == 'tinyMCE') {
if ($context->getProperty('suri.directive') == '/owner/entry/post' || $suri['directive'] == '/owner/entry/edit') {
$target .= "\t<script type=\"text/javascript\" src=\"$pluginURL/tinymce/tinymce.min.js\"></script>\n";
$target .= "\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"$pluginURL/override.css\" />\n";
if ($context->getProperty('suri.directive') == '/owner/entry/post' || $context->getProperty("suri.directive") == '/owner/entry/edit') {
$target .= "\t<script type=\"text/javascript\" src=\"".$context->getProperty("plugin.uri","")."/tinymce/tinymce.min.js\"></script>\n";
$target .= "\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"".$context->getProperty("plugin.uri","")."/override.css\" />\n";
}
}
return $target;
Expand Down

0 comments on commit 8144597

Please sign in to comment.