Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
[C] #577 TinyMCE4 code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Deesen committed Mar 20, 2018
1 parent 22eeec8 commit 8389d3c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion assets/plugins/tinymce4/bridge.tinymce4.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public function bridge_theme($selector) {

// inlite-theme is only compatible with inline-mode / frontend
if($this->modxParams['skintheme'] == 'inlite' && $modx->event->name != 'OnWebPagePrerender') {
$this->set('theme', 'modern'); // Fallback to modern-theme in backend
$this->force('theme', 'modern'); // Fallback to modern-theme in backend
}

return NULL;
Expand Down
2 changes: 1 addition & 1 deletion assets/plugins/tinymce4/gsettings/gsettings.rows.inc.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$params = isset($params) ? $params : array('base_url'=>'', 'skinsDirectory'=>'');
$params = isset($params) ? $params : array('base_url'=>'', 'skinsDirectory'=>'', 'skinthemeDirectory'=>'');
// Hold general settings based on old Modx TinyMCE-Settings

// Settings interface rows configuration
Expand Down
14 changes: 5 additions & 9 deletions assets/plugins/tinymce4/plugin.tinymce.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
if (!defined('MODX_BASE_PATH')) { die('What are you doing? Get out of here!'); }

// Init
if( !file_exists(MODX_BASE_PATH."assets/lib/class.modxRTEbridge.php")) { // Add Fall-Back for now
require_once(MODX_BASE_PATH."assets/plugins/tinymce4/class.modxRTEbridge.php");
} else {
require_once(MODX_BASE_PATH."assets/lib/class.modxRTEbridge.php");
}
require_once(MODX_BASE_PATH."assets/lib/class.modxRTEbridge.php");
require_once(MODX_BASE_PATH."assets/plugins/tinymce4/bridge.tinymce4.inc.php");

$e = &$modx->event;
Expand Down Expand Up @@ -46,11 +42,11 @@
if ($editor === $editorLabel) {
// Handle introtext-RTE
if($introtextRte == 'enabled' && isset($rte->pluginParams['elements']) && !defined($editor . '_INIT_INTROTEXT')) {
define($editor . '_INIT_INTROTEXT', 1);
define($editor . '_INIT_INTROTEXT', 1);
if(!in_array('introtext',$rte->pluginParams['elements'])) {
$rte->pluginParams['elements'][] = 'introtext';
$rte->tvOptions['introtext']['theme'] = 'introtext';
};
$rte->pluginParams['elements'][] = 'introtext';
$rte->tvOptions['introtext']['theme'] = 'introtext';
};
}
$script = $rte->getEditorScript();
$e->output($script);
Expand Down

0 comments on commit 8389d3c

Please sign in to comment.