diff --git a/assets/lib/class.modxRTEbridge.php b/assets/lib/class.modxRTEbridge.php index 07902c3bfa..3d03310ec9 100644 --- a/assets/lib/class.modxRTEbridge.php +++ b/assets/lib/class.modxRTEbridge.php @@ -216,31 +216,34 @@ public function getEditorScript() $ph['configRawString'] = $this->renderConfigRawString(); $ph['editorKey'] = $this->editorKey; $ph['themeKey'] = $this->theme; - $ph['selector'] = $selector; + $ph['selector'][] = $selector; $ph['documentIdentifier'] = $modx->documentIdentifier; $ph = array_merge($ph, $this->customPlaceholders, $this->mergeParamArrays()); // Big list.. - - // Init only once at all - Load Editors-Library, CSS etc - if (!defined($this->editorKey . '_INIT_ONCE')) { - define($this->editorKey . '_INIT_ONCE', 1); - $output .= file_get_contents("{$this->pluginParams['base_path']}tpl/tpl.{$this->editorKey}.init_once.html") ."\n"; - if (!empty($this->initOnceArr)) { - $output .= implode("\n", $this->initOnceArr); - } - } - - // Init only once per config (enables multiple config-objects i.e. for richtext / richtextmini via [+configJs+]) - if (!defined($this->editorKey . '_INIT_CONFIG_' . $this->theme)) { - define($this->editorKey . '_INIT_CONFIG_' . $this->theme, 1); - $output .= file_get_contents("{$this->pluginParams['base_path']}tpl/tpl.{$this->editorKey}.config.html") ."\n"; + } + + // Array of selectors + $ph['selector'] = implode(','.$ph['selectorPrefix'], $ph['selector']); + + // Init only once at all - Load Editors-Library, CSS etc + if (!defined($this->editorKey . '_INIT_ONCE')) { + define($this->editorKey . '_INIT_ONCE', 1); + $output .= file_get_contents("{$this->pluginParams['base_path']}tpl/tpl.{$this->editorKey}.init_once.html") ."\n"; + if (!empty($this->initOnceArr)) { + $output .= implode("\n", $this->initOnceArr); } + } - // Loop through tvs - $output .= file_get_contents("{$this->pluginParams['base_path']}tpl/tpl.{$this->editorKey}.init.html") ."\n"; - $output = $modx->parseText($output, $ph); + // Init only once per config (enables multiple config-objects i.e. for richtext / richtextmini via [+configJs+]) + if (!defined($this->editorKey . '_INIT_CONFIG_' . $this->theme)) { + define($this->editorKey . '_INIT_CONFIG_' . $this->theme, 1); + $output .= file_get_contents("{$this->pluginParams['base_path']}tpl/tpl.{$this->editorKey}.config.html") ."\n"; } + // Loop through tvs + $output .= file_get_contents("{$this->pluginParams['base_path']}tpl/tpl.{$this->editorKey}.init.html") ."\n"; + $output = $modx->parseText($output, $ph); + } else { exit; // @todo: prepare for editors that need no elements } @@ -901,4 +904,4 @@ public function saveContentProcessor($rid, $ppPluginName, $ppEditableIds='editab return 'Not logged into manager!'; } } -} \ No newline at end of file +}