From 8e5defd55f02cfd5f438cfdee823221bb3e8ed45 Mon Sep 17 00:00:00 2001 From: svncommit Date: Wed, 16 Apr 2008 03:59:45 +0000 Subject: added language support to HTML editing (#1484862) --- program/js/editor.js | 7 ++++--- program/steps/mail/compose.inc | 8 +++++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'program') diff --git a/program/js/editor.js b/program/js/editor.js index bdb0e1957..13298cd29 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -15,15 +15,16 @@ // Initialize the message editor -function rcmail_editor_init(skin_path) +function rcmail_editor_init(skin_path, editor_lang) { tinyMCE.init({ mode : "textareas", editor_selector : "mce_editor", accessibility_focus : false, apply_source_formatting : true, theme : "advanced", - plugins : "emotions,media,nonbreaking,table,searchreplace,spellchecker,visualchars", - theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,emotions,charmap,code,forecolor,backcolor,fontselect,fontsizeselect, separator,undo,redo,image,media,spellchecker", + language : editor_lang, + plugins : "emotions,media,nonbreaking,table,searchreplace,visualchars,directionality", + theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,emotions,charmap,code,forecolor,backcolor,fontselect,fontsizeselect, separator,undo,redo,image,media,ltr,rtl", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_location : "top", diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 0ee55f8a9..4c4121a35 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -410,9 +410,15 @@ function rcmail_compose_body($attrib) $body = rcmail_create_draft_body($body, $isHtml); } + $tinylang = substr($_SESSION['user_lang'], 0, 2); + if (!file_exists('program/js/tiny_mce/langs/'.$tinylang.'.js')) + { + $tinylang = 'en'; + } + $OUTPUT->include_script('tiny_mce/tiny_mce.js'); $OUTPUT->include_script("editor.js"); - $OUTPUT->add_script('rcmail_editor_init("$__skin_path");'); + $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.$tinylang.'");'); $out = $form_start ? "$form_start\n" : ''; -- cgit v1.2.3