From bf7160c636a33b07a95f87e8e218456844c8d44b Mon Sep 17 00:00:00 2001 From: alec Date: Sun, 13 Sep 2009 07:48:22 +0000 Subject: - Added 'html_editor' hook (#1486068) git-svn-id: https://svn.roundcube.net/trunk@2951 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/main.inc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'roundcubemail/program/include') diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index ce27b75de..e79cc0287 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/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'].'");'); +} /** -- cgit v1.2.3