summaryrefslogtreecommitdiff
path: root/program/include/rcmail.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r--program/include/rcmail.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index d4305b505..7a952cfe3 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1769,17 +1769,20 @@ class rcmail extends rcube
return;
}
- $lang = strtolower($_SESSION['language']);
+ $lang_codes = array($_SESSION['language']);
- // TinyMCE uses two-letter lang codes, with exception of Chinese
- if (strpos($lang, 'zh_') === 0) {
- $lang = str_replace('_', '-', $lang);
+ if ($pos = strpos($_SESSION['language'], '_')) {
+ $lang_codes[] = substr($_SESSION['language'], 0, $pos);
}
- else {
- $lang = substr($lang, 0, 2);
+
+ foreach ($lang_codes as $code) {
+ if (file_exists(INSTALL_PATH . 'program/js/tinymce/langs/'.$code.'.js')) {
+ $lang = $code;
+ break;
+ }
}
- if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$lang.'.js')) {
+ if (empty($lang)) {
$lang = 'en';
}
@@ -1791,7 +1794,8 @@ class rcmail extends rcube
'spelldict' => intval($this->config->get('spellcheck_dictionary'))
));
- $this->output->include_script('tiny_mce/tiny_mce.js');
+ $this->output->add_label('selectimage', 'addimage');
+ $this->output->include_script('tinymce/tinymce.min.js');
$this->output->include_script('editor.js');
$this->output->add_script("rcmail_editor_init($script)", 'docready');
}
@@ -1825,8 +1829,8 @@ class rcmail extends rcube
);
foreach ($emoticons as $idx => $file) {
- // <img title="Cry" src="http://.../program/js/tiny_mce/plugins/emotions/img/smiley-cry.gif" border="0" alt="Cry" />
- $search[] = '/<img title="[a-z ]+" src="https?:\/\/[a-z0-9_.\/-]+\/tiny_mce\/plugins\/emotions\/img\/'.$file.'.gif"[^>]+\/>/i';
+ // <img title="Cry" src="http://.../program/js/tinymce/plugins/emoticons/img/smiley-cry.gif" border="0" alt="Cry" />
+ $search[] = '/<img title="[a-z ]+" src="https?:\/\/[a-z0-9_.\/-]+\/tinymce\/plugins\/emoticons\/img\/'.$file.'.gif"[^>]+\/>/i';
$replace[] = $idx;
}