summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-01-20 18:46:28 +0100
committerAleksander Machniak <alec@alec.pl>2014-01-20 18:46:28 +0100
commit6fa5b437a48485927e5d90abe061ee723f3b45c2 (patch)
tree118a32ddde4af92c7def9838b10beddb9f0fe241 /program/include
parentfac59dc441d25f7204fb6013bf88db90c01ae34b (diff)
Update to TinyMCE 4.x
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index a927b7946..e297b24bc 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1774,17 +1774,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';
}
@@ -1796,7 +1799,7 @@ class rcmail extends rcube
'spelldict' => intval($this->config->get('spellcheck_dictionary'))
));
- $this->output->include_script('tiny_mce/tiny_mce.js');
+ $this->output->include_script('tinymce/tinymce.min.js');
$this->output->include_script('editor.js');
$this->output->add_script("rcmail_editor_init($script)", 'docready');
}
@@ -1830,8 +1833,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;
}