summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-09-13 07:48:22 +0000
committeralecpl <alec@alec.pl>2009-09-13 07:48:22 +0000
commit9ab7bc6b169619ac82c8e93f111d8d8fa905a2b8 (patch)
treee5d48c4e333fc7cfebbb8bda8ecb164025344436 /program/include
parent0f6e0e1d429c9d570750f2c2e99f25f07c3ea376 (diff)
- Added 'html_editor' hook (#1486068)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc22
1 files changed, 14 insertions, 8 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index ce27b75de..e79cc0287 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1378,17 +1378,23 @@ function rcmail_localize_foldername($name)
*/
function rcube_html_editor($mode='')
{
- global $OUTPUT, $CONFIG;
+ global $RCMAIL, $CONFIG;
- $lang = $tinylang = strtolower(substr($_SESSION['language'], 0, 2));
- if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$tinylang.'.js'))
- $tinylang = 'en';
+ $lang = strtolower(substr($_SESSION['language'], 0, 2));
+ if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$lang.'.js'))
+ $lang = 'en';
- $OUTPUT->include_script('tiny_mce/tiny_mce.js');
- $OUTPUT->include_script('editor.js');
- $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.JQ($tinylang).'", '.intval($CONFIG['enable_spellcheck']).', "'.$mode.'");');
-}
+ $hook = $RCMAIL->plugins->exec_hook('hmtl_editor', array('abort' => false,
+ 'mode' => $mode, 'lang' => $lang));
+ if ($hook['abort'])
+ return;
+
+ $RCMAIL->output->include_script('tiny_mce/tiny_mce.js');
+ $RCMAIL->output->include_script('editor.js');
+ $RCMAIL->output->add_script('rcmail_editor_init("$__skin_path",
+ "'.JQ($hook['lang']).'", '.intval($CONFIG['enable_spellcheck']).', "'.$hook['mode'].'");');
+}
/**