summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/.htaccess4
-rw-r--r--program/include/bc.php2
-rw-r--r--program/include/clisetup.php2
-rw-r--r--program/include/iniset.php1
-rw-r--r--program/include/rcmail.php1688
-rw-r--r--program/include/rcmail_html_page.php7
-rw-r--r--program/include/rcmail_output.php2
-rw-r--r--program/include/rcmail_output_html.php80
-rw-r--r--program/include/rcmail_output_json.php2
-rw-r--r--program/include/rcmail_string_replacer.php23
-rw-r--r--program/js/app.js1216
-rw-r--r--program/js/common.js95
-rw-r--r--program/js/editor.js7
-rw-r--r--program/js/jquery.min.js6
-rw-r--r--program/js/list.js330
-rw-r--r--program/js/tiny_mce/langs/en.js2
-rw-r--r--program/js/tiny_mce/license.txt2
-rw-r--r--program/js/tiny_mce/plugins/advlink/js/advlink.js10
-rw-r--r--program/js/tiny_mce/plugins/autolink/editor_plugin.js2
-rw-r--r--program/js/tiny_mce/plugins/autolink/editor_plugin_src.js4
-rw-r--r--program/js/tiny_mce/plugins/emotions/langs/en_dlg.js2
-rw-r--r--program/js/tiny_mce/plugins/example/editor_plugin_src.js2
-rw-r--r--program/js/tiny_mce/plugins/fullscreen/editor_plugin.js2
-rw-r--r--program/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js131
-rw-r--r--program/js/tiny_mce/plugins/fullscreen/fullscreen.htm25
-rw-r--r--program/js/tiny_mce/plugins/inlinepopups/editor_plugin.js2
-rw-r--r--program/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js26
-rw-r--r--program/js/tiny_mce/plugins/media/js/media.js44
-rw-r--r--program/js/tiny_mce/plugins/media/langs/en_dlg.js2
-rw-r--r--program/js/tiny_mce/plugins/paste/editor_plugin.js2
-rw-r--r--program/js/tiny_mce/plugins/paste/editor_plugin_src.js28
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js6
-rw-r--r--program/js/tiny_mce/plugins/spellchecker/editor_plugin.js2
-rw-r--r--program/js/tiny_mce/plugins/spellchecker/editor_plugin_src.js45
-rw-r--r--program/js/tiny_mce/plugins/style/langs/en_dlg.js2
-rw-r--r--program/js/tiny_mce/plugins/table/editor_plugin.js2
-rw-r--r--program/js/tiny_mce/plugins/table/editor_plugin_src.js15
-rw-r--r--program/js/tiny_mce/plugins/table/js/row.js17
-rw-r--r--program/js/tiny_mce/plugins/table/js/table.js14
-rw-r--r--program/js/tiny_mce/plugins/table/row.htm30
-rw-r--r--program/js/tiny_mce/themes/advanced/editor_template.js2
-rw-r--r--program/js/tiny_mce/themes/advanced/editor_template_src.js16
-rw-r--r--program/js/tiny_mce/themes/advanced/langs/en_dlg.js2
-rw-r--r--program/js/tiny_mce/tiny_mce.js2
-rw-r--r--program/js/tiny_mce/tiny_mce_popup.js2
-rw-r--r--program/js/tiny_mce/tiny_mce_src.js532
-rw-r--r--program/js/treelist.js60
-rw-r--r--program/lib/Crypt/GPG.php812
-rw-r--r--program/lib/Crypt/GPG/ByteUtils.php105
-rw-r--r--program/lib/Crypt/GPG/DecryptStatusHandler.php40
-rw-r--r--program/lib/Crypt/GPG/Engine.php560
-rw-r--r--program/lib/Crypt/GPG/Exceptions.php129
-rw-r--r--program/lib/Crypt/GPG/Key.php2
-rw-r--r--program/lib/Crypt/GPG/KeyGenerator.php790
-rw-r--r--program/lib/Crypt/GPG/KeyGeneratorErrorHandler.php121
-rw-r--r--program/lib/Crypt/GPG/KeyGeneratorStatusHandler.php173
-rw-r--r--program/lib/Crypt/GPG/PinEntry.php875
-rw-r--r--program/lib/Crypt/GPG/ProcessControl.php150
-rw-r--r--program/lib/Crypt/GPG/Signature.php9
-rw-r--r--program/lib/Crypt/GPG/SubKey.php27
-rw-r--r--program/lib/Crypt/GPG/UserId.php2
-rw-r--r--program/lib/Crypt/GPG/VerifyStatusHandler.php2
-rw-r--r--program/lib/Crypt/GPGAbstract.php508
-rw-r--r--program/lib/Roundcube/html.php16
-rw-r--r--program/lib/Roundcube/rcube.php74
-rw-r--r--program/lib/Roundcube/rcube_addressbook.php34
-rw-r--r--program/lib/Roundcube/rcube_browser.php42
-rw-r--r--program/lib/Roundcube/rcube_charset.php10
-rw-r--r--program/lib/Roundcube/rcube_config.php20
-rw-r--r--program/lib/Roundcube/rcube_contacts.php56
-rw-r--r--program/lib/Roundcube/rcube_csv2vcard.php10
-rw-r--r--program/lib/Roundcube/rcube_db.php29
-rw-r--r--program/lib/Roundcube/rcube_html2text.php8
-rw-r--r--program/lib/Roundcube/rcube_imap.php57
-rw-r--r--program/lib/Roundcube/rcube_imap_cache.php6
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php34
-rw-r--r--program/lib/Roundcube/rcube_ldap.php92
-rw-r--r--program/lib/Roundcube/rcube_ldap_generic.php4
-rw-r--r--program/lib/Roundcube/rcube_message.php14
-rw-r--r--program/lib/Roundcube/rcube_mime.php6
-rw-r--r--program/lib/Roundcube/rcube_plugin.php8
-rw-r--r--program/lib/Roundcube/rcube_plugin_api.php11
-rw-r--r--program/lib/Roundcube/rcube_result_index.php19
-rw-r--r--program/lib/Roundcube/rcube_result_thread.php35
-rw-r--r--program/lib/Roundcube/rcube_session.php45
-rw-r--r--program/lib/Roundcube/rcube_smtp.php14
-rw-r--r--program/lib/Roundcube/rcube_spellcheck_atd.php12
-rw-r--r--program/lib/Roundcube/rcube_spellcheck_enchant.php18
-rw-r--r--program/lib/Roundcube/rcube_spellcheck_engine.php7
-rw-r--r--program/lib/Roundcube/rcube_spellcheck_googie.php36
-rw-r--r--program/lib/Roundcube/rcube_spellcheck_pspell.php29
-rw-r--r--program/lib/Roundcube/rcube_spellchecker.php58
-rw-r--r--program/lib/Roundcube/rcube_storage.php17
-rw-r--r--program/lib/Roundcube/rcube_user.php50
-rw-r--r--program/lib/Roundcube/rcube_utils.php125
-rw-r--r--program/lib/Roundcube/rcube_vcard.php33
-rw-r--r--program/lib/Roundcube/rcube_washtml.php94
-rw-r--r--program/localization/ar/labels.inc123
-rw-r--r--program/localization/ast/labels.inc2
-rw-r--r--program/localization/az_AZ/labels.inc18
-rw-r--r--program/localization/az_AZ/messages.inc11
-rw-r--r--program/localization/be_BE/labels.inc65
-rw-r--r--program/localization/be_BE/messages.inc19
-rw-r--r--program/localization/bg_BG/labels.inc24
-rw-r--r--program/localization/bg_BG/messages.inc13
-rw-r--r--program/localization/bs_BA/labels.inc14
-rw-r--r--program/localization/bs_BA/messages.inc6
-rw-r--r--program/localization/ca_ES/labels.inc98
-rw-r--r--program/localization/ca_ES/messages.inc31
-rw-r--r--program/localization/cs_CZ/labels.inc14
-rw-r--r--program/localization/cs_CZ/messages.inc6
-rw-r--r--program/localization/cy_GB/labels.inc14
-rw-r--r--program/localization/cy_GB/messages.inc17
-rw-r--r--program/localization/da_DK/labels.inc18
-rw-r--r--program/localization/da_DK/messages.inc6
-rw-r--r--program/localization/de_CH/labels.inc14
-rw-r--r--program/localization/de_CH/messages.inc9
-rw-r--r--program/localization/de_DE/labels.inc16
-rw-r--r--program/localization/de_DE/messages.inc11
-rw-r--r--program/localization/el_GR/labels.inc6
-rw-r--r--program/localization/el_GR/messages.inc10
-rw-r--r--program/localization/en_CA/labels.inc496
-rw-r--r--program/localization/en_CA/messages.inc176
-rw-r--r--program/localization/en_GB/labels.inc35
-rw-r--r--program/localization/en_GB/messages.inc20
-rw-r--r--program/localization/en_US/labels.inc16
-rw-r--r--program/localization/en_US/messages.inc8
-rw-r--r--program/localization/es_419/labels.inc423
-rw-r--r--program/localization/es_419/messages.inc (renamed from program/localization/fy_NL/messages.inc)10
-rw-r--r--program/localization/es_ES/labels.inc14
-rw-r--r--program/localization/es_ES/messages.inc11
-rw-r--r--program/localization/eu_ES/labels.inc18
-rw-r--r--program/localization/eu_ES/messages.inc9
-rw-r--r--program/localization/fa_IR/labels.inc22
-rw-r--r--program/localization/fa_IR/messages.inc40
-rw-r--r--program/localization/fi_FI/labels.inc17
-rw-r--r--program/localization/fi_FI/messages.inc10
-rw-r--r--program/localization/fo_FO/labels.inc394
-rw-r--r--program/localization/fo_FO/messages.inc175
-rw-r--r--program/localization/fr_FR/labels.inc14
-rw-r--r--program/localization/gl_ES/labels.inc170
-rw-r--r--program/localization/gl_ES/messages.inc151
-rw-r--r--program/localization/he_IL/labels.inc18
-rw-r--r--program/localization/he_IL/messages.inc9
-rw-r--r--program/localization/hr_HR/labels.inc315
-rw-r--r--program/localization/hr_HR/messages.inc240
-rw-r--r--program/localization/hu_HU/labels.inc14
-rw-r--r--program/localization/hu_HU/messages.inc6
-rw-r--r--program/localization/hy_AM/labels.inc29
-rw-r--r--program/localization/ia/messages.inc2
-rw-r--r--program/localization/index.inc12
-rw-r--r--program/localization/it_IT/labels.inc14
-rw-r--r--program/localization/it_IT/messages.inc11
-rw-r--r--program/localization/ja_JP/labels.inc14
-rw-r--r--program/localization/ja_JP/messages.inc6
-rw-r--r--program/localization/km_KH/labels.inc70
-rw-r--r--program/localization/km_KH/messages.inc31
-rw-r--r--program/localization/kn_IN/labels.inc166
-rw-r--r--program/localization/kn_IN/messages.inc54
-rw-r--r--program/localization/lb_LU/labels.inc28
-rw-r--r--program/localization/lb_LU/messages.inc11
-rw-r--r--program/localization/lt_LT/labels.inc15
-rw-r--r--program/localization/lt_LT/messages.inc5
-rw-r--r--program/localization/lv_LV/labels.inc15
-rw-r--r--program/localization/lv_LV/messages.inc9
-rw-r--r--program/localization/ml_IN/messages.inc2
-rw-r--r--program/localization/nl_NL/labels.inc16
-rw-r--r--program/localization/nl_NL/messages.inc8
-rw-r--r--program/localization/pl_PL/labels.inc14
-rw-r--r--program/localization/pl_PL/messages.inc8
-rw-r--r--program/localization/pt_BR/labels.inc14
-rw-r--r--program/localization/pt_BR/messages.inc9
-rw-r--r--program/localization/pt_PT/labels.inc14
-rw-r--r--program/localization/pt_PT/messages.inc6
-rw-r--r--program/localization/ro_RO/messages.inc5
-rw-r--r--program/localization/ru_RU/labels.inc14
-rw-r--r--program/localization/ru_RU/messages.inc8
-rw-r--r--program/localization/sk_SK/csv2vcard.inc84
-rw-r--r--program/localization/sk_SK/labels.inc376
-rw-r--r--program/localization/sk_SK/messages.inc265
-rw-r--r--program/localization/sl_SI/labels.inc18
-rw-r--r--program/localization/sl_SI/messages.inc9
-rw-r--r--program/localization/sv_SE/labels.inc50
-rw-r--r--program/localization/sv_SE/messages.inc127
-rw-r--r--program/localization/ti/labels.inc62
-rw-r--r--program/localization/ti/messages.inc (renamed from program/localization/ur_PK/messages.inc)8
-rw-r--r--program/localization/tr_TR/labels.inc14
-rw-r--r--program/localization/tr_TR/messages.inc57
-rw-r--r--program/localization/uk_UA/labels.inc10
-rw-r--r--program/localization/uk_UA/messages.inc15
-rw-r--r--program/localization/vi_VN/labels.inc33
-rw-r--r--program/localization/vi_VN/messages.inc20
-rw-r--r--program/localization/zh_CN/labels.inc23
-rw-r--r--program/localization/zh_CN/messages.inc9
-rw-r--r--program/localization/zh_TW/labels.inc75
-rw-r--r--program/localization/zh_TW/messages.inc19
-rw-r--r--program/steps/addressbook/copy.inc9
-rw-r--r--program/steps/addressbook/delete.inc26
-rw-r--r--program/steps/addressbook/edit.inc132
-rw-r--r--program/steps/addressbook/export.inc86
-rw-r--r--program/steps/addressbook/func.inc219
-rw-r--r--program/steps/addressbook/groups.inc207
-rw-r--r--program/steps/addressbook/import.inc332
-rw-r--r--program/steps/addressbook/mailto.inc29
-rw-r--r--program/steps/addressbook/move.inc4
-rw-r--r--program/steps/addressbook/photo.inc8
-rw-r--r--program/steps/addressbook/save.inc321
-rw-r--r--program/steps/addressbook/search.inc34
-rw-r--r--program/steps/addressbook/show.inc49
-rw-r--r--program/steps/addressbook/undo.inc8
-rw-r--r--program/steps/addressbook/upload_photo.inc16
-rw-r--r--program/steps/mail/addcontact.inc121
-rw-r--r--program/steps/mail/attachments.inc255
-rw-r--r--program/steps/mail/autocomplete.inc217
-rw-r--r--program/steps/mail/check_recent.inc28
-rw-r--r--program/steps/mail/compose.inc2526
-rw-r--r--program/steps/mail/copy.inc17
-rw-r--r--program/steps/mail/folders.inc35
-rw-r--r--program/steps/mail/func.inc2990
-rw-r--r--program/steps/mail/get.inc656
-rw-r--r--program/steps/mail/getunread.inc52
-rw-r--r--program/steps/mail/headers.inc5
-rw-r--r--program/steps/mail/import.inc17
-rw-r--r--program/steps/mail/list.inc30
-rw-r--r--program/steps/mail/list_contacts.inc58
-rw-r--r--program/steps/mail/mark.inc223
-rw-r--r--program/steps/mail/move_del.inc42
-rw-r--r--program/steps/mail/pagenav.inc14
-rw-r--r--program/steps/mail/search.inc143
-rw-r--r--program/steps/mail/search_contacts.inc20
-rw-r--r--program/steps/mail/sendmail.inc1269
-rw-r--r--program/steps/mail/sendmdn.inc17
-rw-r--r--program/steps/mail/show.inc523
-rw-r--r--program/steps/mail/viewsource.inc66
-rw-r--r--program/steps/settings/about.inc127
-rw-r--r--program/steps/settings/delete_identity.inc46
-rw-r--r--program/steps/settings/edit_folder.inc109
-rw-r--r--program/steps/settings/edit_identity.inc252
-rw-r--r--program/steps/settings/edit_prefs.inc84
-rw-r--r--program/steps/settings/edit_response.inc108
-rw-r--r--program/steps/settings/folders.inc139
-rw-r--r--program/steps/settings/func.inc378
-rw-r--r--program/steps/settings/identities.inc29
-rw-r--r--program/steps/settings/responses.inc133
-rw-r--r--program/steps/settings/save_folder.inc38
-rw-r--r--program/steps/settings/save_identity.inc224
-rw-r--r--program/steps/settings/save_prefs.inc240
-rw-r--r--program/steps/utils/error.inc73
-rw-r--r--program/steps/utils/html2text.inc2
-rw-r--r--program/steps/utils/modcss.inc2
-rw-r--r--program/steps/utils/save_pref.inc24
-rw-r--r--program/steps/utils/spell.inc11
-rw-r--r--program/steps/utils/spell_html.inc2
253 files changed, 18433 insertions, 9600 deletions
diff --git a/program/.htaccess b/program/.htaccess
deleted file mode 100644
index be9e7e25a..000000000
--- a/program/.htaccess
+++ /dev/null
@@ -1,4 +0,0 @@
-<IfModule mod_rewrite.c>
-RewriteEngine On
-RewriteRule !^(js|resources) - [F]
-</IfModule>
diff --git a/program/include/bc.php b/program/include/bc.php
index a7d7b5ac1..2cb151798 100644
--- a/program/include/bc.php
+++ b/program/include/bc.php
@@ -22,7 +22,7 @@
/**
* Roundcube Webmail deprecated functions
*
- * @package Core
+ * @package Webmail
* @subpackage Legacy
* @author Thomas Bruederli <roundcube@gmail.com>
*/
diff --git a/program/include/clisetup.php b/program/include/clisetup.php
index 07e318521..47a40719a 100644
--- a/program/include/clisetup.php
+++ b/program/include/clisetup.php
@@ -20,7 +20,7 @@
*/
if (php_sapi_name() != 'cli') {
- die('Not on the "shell" (php-cli).');
+ die('Not on the "shell" (php-cli).');
}
require_once INSTALL_PATH . 'program/include/iniset.php';
diff --git a/program/include/iniset.php b/program/include/iniset.php
index 919cc7682..f6ad466da 100644
--- a/program/include/iniset.php
+++ b/program/include/iniset.php
@@ -84,4 +84,3 @@ function rcmail_autoload($classname)
return false;
}
-
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 0483f0e18..d1b544135 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -5,8 +5,8 @@
| program/include/rcmail.php |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2008-2012, The Roundcube Dev Team |
- | Copyright (C) 2011-2012, Kolab Systems AG |
+ | Copyright (C) 2008-2014, The Roundcube Dev Team |
+ | Copyright (C) 2011-2014, Kolab Systems AG |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,584 +21,642 @@
+-----------------------------------------------------------------------+
*/
-
/**
* Application class of Roundcube Webmail
* implemented as singleton
*
- * @package Core
+ * @package Webmail
*/
class rcmail extends rcube
{
- /**
- * Main tasks.
- *
- * @var array
- */
- static public $main_tasks = array('mail','settings','addressbook','login','logout','utils','dummy');
-
- /**
- * Current task.
- *
- * @var string
- */
- public $task;
-
- /**
- * Current action.
- *
- * @var string
- */
- public $action = '';
- public $comm_path = './';
- public $filename = '';
-
- private $address_books = array();
- private $action_map = array();
-
-
- const ERROR_STORAGE = -2;
- const ERROR_INVALID_REQUEST = 1;
- const ERROR_INVALID_HOST = 2;
- const ERROR_COOKIES_DISABLED = 3;
-
-
- /**
- * This implements the 'singleton' design pattern
- *
- * @param string Environment name to run (e.g. live, dev, test)
- * @return rcmail The one and only instance
- */
- static function get_instance($env = '')
- {
- if (!self::$instance || !is_a(self::$instance, 'rcmail')) {
- self::$instance = new rcmail($env);
- self::$instance->startup(); // init AFTER object was linked with self::$instance
- }
+ /**
+ * Main tasks.
+ *
+ * @var array
+ */
+ static public $main_tasks = array('mail','settings','addressbook','login','logout','utils','dummy');
- return self::$instance;
- }
-
-
- /**
- * Initial startup function
- * to register session, create database and imap connections
- */
- protected function startup()
- {
- $this->init(self::INIT_WITH_DB | self::INIT_WITH_PLUGINS);
-
- // set filename if not index.php
- if (($basename = basename($_SERVER['SCRIPT_FILENAME'])) && $basename != 'index.php')
- $this->filename = $basename;
-
- // start session
- $this->session_init();
-
- // create user object
- $this->set_user(new rcube_user($_SESSION['user_id']));
-
- // set task and action properties
- $this->set_task(rcube_utils::get_input_value('_task', rcube_utils::INPUT_GPC));
- $this->action = asciiwords(rcube_utils::get_input_value('_action', rcube_utils::INPUT_GPC));
-
- // reset some session parameters when changing task
- if ($this->task != 'utils') {
- // we reset list page when switching to another task
- // but only to the main task interface - empty action (#1489076)
- // this will prevent from unintentional page reset on cross-task requests
- if ($this->session && $_SESSION['task'] != $this->task && empty($this->action))
- $this->session->remove('page');
- // set current task to session
- $_SESSION['task'] = $this->task;
- }
+ /**
+ * Current task.
+ *
+ * @var string
+ */
+ public $task;
- // init output class
- if (!empty($_REQUEST['_remote']))
- $GLOBALS['OUTPUT'] = $this->json_init();
- else
- $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed']));
-
- // load plugins
- $this->plugins->init($this, $this->task);
- $this->plugins->load_plugins((array)$this->config->get('plugins', array()), array('filesystem_attachments', 'jqueryui'));
- }
-
-
- /**
- * Setter for application task
- *
- * @param string Task to set
- */
- public function set_task($task)
- {
- $task = asciiwords($task, true);
-
- if ($this->user && $this->user->ID)
- $task = !$task ? 'mail' : $task;
- else
- $task = 'login';
-
- $this->task = $task;
- $this->comm_path = $this->url(array('task' => $this->task));
-
- if ($this->output)
- $this->output->set_env('task', $this->task);
- }
-
-
- /**
- * Setter for system user object
- *
- * @param rcube_user Current user instance
- */
- public function set_user($user)
- {
- if (is_object($user)) {
- $this->user = $user;
-
- // overwrite config with user preferences
- $this->config->set_user_prefs((array)$this->user->get_prefs());
- }
+ /**
+ * Current action.
+ *
+ * @var string
+ */
+ public $action = '';
+ public $comm_path = './';
+ public $filename = '';
- $lang = $this->language_prop($this->config->get('language', $_SESSION['language']));
- $_SESSION['language'] = $this->user->language = $lang;
+ private $address_books = array();
+ private $action_map = array();
- // set localization
- setlocale(LC_ALL, $lang . '.utf8', $lang . '.UTF-8', 'en_US.utf8', 'en_US.UTF-8');
- // workaround for http://bugs.php.net/bug.php?id=18556
- if (version_compare(PHP_VERSION, '5.5.0', '<') && in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
- setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8');
- }
- }
-
-
- /**
- * Return instance of the internal address book class
- *
- * @param string Address book identifier (-1 for default addressbook)
- * @param boolean True if the address book needs to be writeable
- *
- * @return rcube_contacts Address book object
- */
- public function get_address_book($id, $writeable = false)
- {
- $contacts = null;
- $ldap_config = (array)$this->config->get('ldap_public');
-
- // 'sql' is the alias for '0' used by autocomplete
- if ($id == 'sql')
- $id = '0';
- else if ($id == -1) {
- $id = $this->config->get('default_addressbook');
- $default = true;
- }
+ const ERROR_STORAGE = -2;
+ const ERROR_INVALID_REQUEST = 1;
+ const ERROR_INVALID_HOST = 2;
+ const ERROR_COOKIES_DISABLED = 3;
- // use existing instance
- if (isset($this->address_books[$id]) && ($this->address_books[$id] instanceof rcube_addressbook)) {
- $contacts = $this->address_books[$id];
- }
- else if ($id && $ldap_config[$id]) {
- $contacts = new rcube_ldap($ldap_config[$id], $this->config->get('ldap_debug'), $this->config->mail_domain($_SESSION['storage_host']));
- }
- else if ($id === '0') {
- $contacts = new rcube_contacts($this->db, $this->get_user_id());
- }
- else {
- $plugin = $this->plugins->exec_hook('addressbook_get', array('id' => $id, 'writeable' => $writeable));
- // plugin returned instance of a rcube_addressbook
- if ($plugin['instance'] instanceof rcube_addressbook) {
- $contacts = $plugin['instance'];
- }
- }
+ /**
+ * This implements the 'singleton' design pattern
+ *
+ * @param string Environment name to run (e.g. live, dev, test)
+ *
+ * @return rcmail The one and only instance
+ */
+ static function get_instance($env = '')
+ {
+ if (!self::$instance || !is_a(self::$instance, 'rcmail')) {
+ self::$instance = new rcmail($env);
+ // init AFTER object was linked with self::$instance
+ self::$instance->startup();
+ }
- // when user requested default writeable addressbook
- // we need to check if default is writeable, if not we
- // will return first writeable book (if any exist)
- if ($contacts && $default && $contacts->readonly && $writeable) {
- $contacts = null;
+ return self::$instance;
}
- // Get first addressbook from the list if configured default doesn't exist
- // This can happen when user deleted the addressbook (e.g. Kolab folder)
- if (!$contacts && (!$id || $default)) {
- $source = reset($this->get_address_sources($writeable, !$default));
- if (!empty($source)) {
- $contacts = $this->get_address_book($source['id']);
- if ($contacts) {
- $id = $source['id'];
+ /**
+ * Initial startup function
+ * to register session, create database and imap connections
+ */
+ protected function startup()
+ {
+ $this->init(self::INIT_WITH_DB | self::INIT_WITH_PLUGINS);
+
+ // set filename if not index.php
+ if (($basename = basename($_SERVER['SCRIPT_FILENAME'])) && $basename != 'index.php') {
+ $this->filename = $basename;
}
- }
- }
- if (!$contacts) {
- // there's no default, just return
- if ($default) {
- return null;
- }
-
- self::raise_error(array(
- 'code' => 700, 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Addressbook source ($id) not found!"),
- true, true);
- }
+ // start session
+ $this->session_init();
- // add to the 'books' array for shutdown function
- $this->address_books[$id] = $contacts;
+ // create user object
+ $this->set_user(new rcube_user($_SESSION['user_id']));
- if ($writeable && $contacts->readonly) {
- return null;
- }
+ // set task and action properties
+ $this->set_task(rcube_utils::get_input_value('_task', rcube_utils::INPUT_GPC));
+ $this->action = asciiwords(rcube_utils::get_input_value('_action', rcube_utils::INPUT_GPC));
- // set configured sort order
- if ($sort_col = $this->config->get('addressbook_sort_col')) {
- $contacts->set_sort_order($sort_col);
- }
+ // reset some session parameters when changing task
+ if ($this->task != 'utils') {
+ // we reset list page when switching to another task
+ // but only to the main task interface - empty action (#1489076)
+ // this will prevent from unintentional page reset on cross-task requests
+ if ($this->session && $_SESSION['task'] != $this->task && empty($this->action)) {
+ $this->session->remove('page');
+ }
- return $contacts;
- }
-
-
- /**
- * Return identifier of the address book object
- *
- * @param rcube_addressbook Addressbook source object
- *
- * @return string Source identifier
- */
- public function get_address_book_id($object)
- {
- foreach ($this->address_books as $index => $book) {
- if ($book === $object) {
- return $index;
- }
- }
- }
-
-
- /**
- * Return address books list
- *
- * @param boolean True if the address book needs to be writeable
- * @param boolean True if the address book needs to be not hidden
- *
- * @return array Address books array
- */
- public function get_address_sources($writeable = false, $skip_hidden = false)
- {
- $abook_type = (string) $this->config->get('address_book_type');
- $ldap_config = (array) $this->config->get('ldap_public');
- $autocomplete = (array) $this->config->get('autocomplete_addressbooks');
- $list = array();
-
- // We are using the DB address book or a plugin address book
- if (!empty($abook_type) && strtolower($abook_type) != 'ldap') {
- if (!isset($this->address_books['0']))
- $this->address_books['0'] = new rcube_contacts($this->db, $this->get_user_id());
- $list['0'] = array(
- 'id' => '0',
- 'name' => $this->gettext('personaladrbook'),
- 'groups' => $this->address_books['0']->groups,
- 'readonly' => $this->address_books['0']->readonly,
- 'autocomplete' => in_array('sql', $autocomplete),
- 'undelete' => $this->address_books['0']->undelete && $this->config->get('undo_timeout'),
- );
- }
+ // set current task to session
+ $_SESSION['task'] = $this->task;
+ }
- if (!empty($ldap_config)) {
- foreach ($ldap_config as $id => $prop) {
- // handle misconfiguration
- if (empty($prop) || !is_array($prop)) {
- continue;
- }
- $list[$id] = array(
- 'id' => $id,
- 'name' => html::quote($prop['name']),
- 'groups' => !empty($prop['groups']) || !empty($prop['group_filters']),
- 'readonly' => !$prop['writable'],
- 'hidden' => $prop['hidden'],
- 'autocomplete' => in_array($id, $autocomplete)
- );
- }
- }
+ // init output class
+ if (!empty($_REQUEST['_remote']))
+ $GLOBALS['OUTPUT'] = $this->json_init();
+ else
+ $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed']));
- $plugin = $this->plugins->exec_hook('addressbooks_list', array('sources' => $list));
- $list = $plugin['sources'];
-
- foreach ($list as $idx => $item) {
- // register source for shutdown function
- if (!is_object($this->address_books[$item['id']])) {
- $this->address_books[$item['id']] = $item;
- }
- // remove from list if not writeable as requested
- if ($writeable && $item['readonly']) {
- unset($list[$idx]);
- }
- // remove from list if hidden as requested
- else if ($skip_hidden && $item['hidden']) {
- unset($list[$idx]);
- }
+ // load plugins
+ $this->plugins->init($this, $this->task);
+ $this->plugins->load_plugins((array)$this->config->get('plugins', array()),
+ array('filesystem_attachments', 'jqueryui'));
}
- return $list;
- }
-
-
- /**
- * Init output object for GUI and add common scripts.
- * This will instantiate a rcmail_output_html object and set
- * environment vars according to the current session and configuration
- *
- * @param boolean True if this request is loaded in a (i)frame
- * @return rcube_output Reference to HTML output object
- */
- public function load_gui($framed = false)
- {
- // init output page
- if (!($this->output instanceof rcmail_output_html))
- $this->output = new rcmail_output_html($this->task, $framed);
-
- // set refresh interval
- $this->output->set_env('refresh_interval', $this->config->get('refresh_interval', 0));
- $this->output->set_env('session_lifetime', $this->config->get('session_lifetime', 0) * 60);
-
- if ($framed) {
- $this->comm_path .= '&_framed=1';
- $this->output->set_env('framed', true);
- }
+ /**
+ * Setter for application task
+ *
+ * @param string Task to set
+ */
+ public function set_task($task)
+ {
+ $task = asciiwords($task, true);
- $this->output->set_env('task', $this->task);
- $this->output->set_env('action', $this->action);
- $this->output->set_env('comm_path', $this->comm_path);
- $this->output->set_charset(RCUBE_CHARSET);
-
- // add some basic labels to client
- $this->output->add_label('loading', 'servererror', 'requesttimedout', 'refreshing');
-
- return $this->output;
- }
-
-
- /**
- * Create an output object for JSON responses
- *
- * @return rcube_output Reference to JSON output object
- */
- public function json_init()
- {
- if (!($this->output instanceof rcmail_output_json))
- $this->output = new rcmail_output_json($this->task);
-
- return $this->output;
- }
-
-
- /**
- * Create session object and start the session.
- */
- public function session_init()
- {
- parent::session_init();
-
- // set initial session vars
- if (!$_SESSION['user_id'])
- $_SESSION['temp'] = true;
-
- // restore skin selection after logout
- if ($_SESSION['temp'] && !empty($_SESSION['skin']))
- $this->config->set('skin', $_SESSION['skin']);
- }
-
-
- /**
- * Perfom login to the mail server and to the webmail service.
- * This will also create a new user entry if auto_create_user is configured.
- *
- * @param string Mail storage (IMAP) user name
- * @param string Mail storage (IMAP) password
- * @param string Mail storage (IMAP) host
- * @param bool Enables cookie check
- *
- * @return boolean True on success, False on failure
- */
- function login($username, $pass, $host = null, $cookiecheck = false)
- {
- $this->login_error = null;
-
- if (empty($username)) {
- return false;
- }
+ if ($this->user && $this->user->ID)
+ $task = !$task ? 'mail' : $task;
+ else
+ $task = 'login';
- if ($cookiecheck && empty($_COOKIE)) {
- $this->login_error = self::ERROR_COOKIES_DISABLED;
- return false;
- }
+ $this->task = $task;
+ $this->comm_path = $this->url(array('task' => $this->task));
- $config = $this->config->all();
-
- if (!$host)
- $host = $config['default_host'];
-
- // Validate that selected host is in the list of configured hosts
- if (is_array($config['default_host'])) {
- $allowed = false;
- foreach ($config['default_host'] as $key => $host_allowed) {
- if (!is_numeric($key))
- $host_allowed = $key;
- if ($host == $host_allowed) {
- $allowed = true;
- break;
- }
- }
- if (!$allowed) {
- $host = null;
- }
- }
- else if (!empty($config['default_host']) && $host != rcube_utils::parse_host($config['default_host'])) {
- $host = null;
+ if ($this->output) {
+ $this->output->set_env('task', $this->task);
+ }
}
- if (!$host) {
- $this->login_error = self::ERROR_INVALID_HOST;
- return false;
- }
+ /**
+ * Setter for system user object
+ *
+ * @param rcube_user Current user instance
+ */
+ public function set_user($user)
+ {
+ parent::set_user($user);
- // parse $host URL
- $a_host = parse_url($host);
- if ($a_host['host']) {
- $host = $a_host['host'];
- $ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;
- if (!empty($a_host['port']))
- $port = $a_host['port'];
- else if ($ssl && $ssl != 'tls' && (!$config['default_port'] || $config['default_port'] == 143))
- $port = 993;
- }
+ $lang = $this->language_prop($this->config->get('language', $_SESSION['language']));
+ $_SESSION['language'] = $this->user->language = $lang;
- if (!$port) {
- $port = $config['default_port'];
+ // set localization
+ setlocale(LC_ALL, $lang . '.utf8', $lang . '.UTF-8', 'en_US.utf8', 'en_US.UTF-8');
+
+ // workaround for http://bugs.php.net/bug.php?id=18556
+ if (version_compare(PHP_VERSION, '5.5.0', '<') && in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
+ setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8');
+ }
}
- // Check if we need to add/force domain to username
- if (!empty($config['username_domain'])) {
- $domain = is_array($config['username_domain']) ? $config['username_domain'][$host] : $config['username_domain'];
+ /**
+ * Return instance of the internal address book class
+ *
+ * @param string Address book identifier (-1 for default addressbook)
+ * @param boolean True if the address book needs to be writeable
+ *
+ * @return rcube_contacts Address book object
+ */
+ public function get_address_book($id, $writeable = false)
+ {
+ $contacts = null;
+ $ldap_config = (array)$this->config->get('ldap_public');
- if ($domain = rcube_utils::parse_host((string)$domain, $host)) {
- $pos = strpos($username, '@');
+ // 'sql' is the alias for '0' used by autocomplete
+ if ($id == 'sql')
+ $id = '0';
+ else if ($id == -1) {
+ $id = $this->config->get('default_addressbook');
+ $default = true;
+ }
- // force configured domains
- if (!empty($config['username_domain_forced']) && $pos !== false) {
- $username = substr($username, 0, $pos) . '@' . $domain;
+ // use existing instance
+ if (isset($this->address_books[$id]) && ($this->address_books[$id] instanceof rcube_addressbook)) {
+ $contacts = $this->address_books[$id];
}
- // just add domain if not specified
- else if ($pos === false) {
- $username .= '@' . $domain;
+ else if ($id && $ldap_config[$id]) {
+ $domain = $this->config->mail_domain($_SESSION['storage_host']);
+ $contacts = new rcube_ldap($ldap_config[$id], $this->config->get('ldap_debug'), $domain);
}
- }
- }
+ else if ($id === '0') {
+ $contacts = new rcube_contacts($this->db, $this->get_user_id());
+ }
+ else {
+ $plugin = $this->plugins->exec_hook('addressbook_get', array('id' => $id, 'writeable' => $writeable));
- if (!isset($config['login_lc'])) {
- $config['login_lc'] = 2; // default
- }
+ // plugin returned instance of a rcube_addressbook
+ if ($plugin['instance'] instanceof rcube_addressbook) {
+ $contacts = $plugin['instance'];
+ }
+ }
- // Convert username to lowercase. If storage backend
- // is case-insensitive we need to store always the same username (#1487113)
- if ($config['login_lc']) {
- if ($config['login_lc'] == 2 || $config['login_lc'] === true) {
- $username = mb_strtolower($username);
- }
- else if (strpos($username, '@')) {
- // lowercase domain name
- list($local, $domain) = explode('@', $username);
- $username = $local . '@' . mb_strtolower($domain);
- }
+ // when user requested default writeable addressbook
+ // we need to check if default is writeable, if not we
+ // will return first writeable book (if any exist)
+ if ($contacts && $default && $contacts->readonly && $writeable) {
+ $contacts = null;
+ }
+
+ // Get first addressbook from the list if configured default doesn't exist
+ // This can happen when user deleted the addressbook (e.g. Kolab folder)
+ if (!$contacts && (!$id || $default)) {
+ $source = reset($this->get_address_sources($writeable, !$default));
+ if (!empty($source)) {
+ $contacts = $this->get_address_book($source['id']);
+ if ($contacts) {
+ $id = $source['id'];
+ }
+ }
+ }
+
+ if (!$contacts) {
+ // there's no default, just return
+ if ($default) {
+ return null;
+ }
+
+ self::raise_error(array(
+ 'code' => 700,
+ 'file' => __FILE__,
+ 'line' => __LINE__,
+ 'message' => "Addressbook source ($id) not found!"
+ ),
+ true, true);
+ }
+
+ // add to the 'books' array for shutdown function
+ $this->address_books[$id] = $contacts;
+
+ if ($writeable && $contacts->readonly) {
+ return null;
+ }
+
+ // set configured sort order
+ if ($sort_col = $this->config->get('addressbook_sort_col')) {
+ $contacts->set_sort_order($sort_col);
+ }
+
+ return $contacts;
}
- // try to resolve email address from virtuser table
- if (strpos($username, '@') && ($virtuser = rcube_user::email2user($username))) {
- $username = $virtuser;
+ /**
+ * Return identifier of the address book object
+ *
+ * @param rcube_addressbook Addressbook source object
+ *
+ * @return string Source identifier
+ */
+ public function get_address_book_id($object)
+ {
+ foreach ($this->address_books as $index => $book) {
+ if ($book === $object) {
+ return $index;
+ }
+ }
}
- // Here we need IDNA ASCII
- // Only rcube_contacts class is using domain names in Unicode
- $host = rcube_utils::idn_to_ascii($host);
- $username = rcube_utils::idn_to_ascii($username);
+ /**
+ * Return address books list
+ *
+ * @param boolean True if the address book needs to be writeable
+ * @param boolean True if the address book needs to be not hidden
+ *
+ * @return array Address books array
+ */
+ public function get_address_sources($writeable = false, $skip_hidden = false)
+ {
+ $abook_type = (string) $this->config->get('address_book_type');
+ $ldap_config = (array) $this->config->get('ldap_public');
+ $autocomplete = (array) $this->config->get('autocomplete_addressbooks');
+ $list = array();
+
+ // We are using the DB address book or a plugin address book
+ if (!empty($abook_type) && strtolower($abook_type) != 'ldap') {
+ if (!isset($this->address_books['0'])) {
+ $this->address_books['0'] = new rcube_contacts($this->db, $this->get_user_id());
+ }
+
+ $list['0'] = array(
+ 'id' => '0',
+ 'name' => $this->gettext('personaladrbook'),
+ 'groups' => $this->address_books['0']->groups,
+ 'readonly' => $this->address_books['0']->readonly,
+ 'undelete' => $this->address_books['0']->undelete && $this->config->get('undo_timeout'),
+ 'autocomplete' => in_array('sql', $autocomplete),
+ );
+ }
+
+ if (!empty($ldap_config)) {
+ foreach ($ldap_config as $id => $prop) {
+ // handle misconfiguration
+ if (empty($prop) || !is_array($prop)) {
+ continue;
+ }
- // user already registered -> overwrite username
- if ($user = rcube_user::query($username, $host)) {
- $username = $user->data['username'];
+ $list[$id] = array(
+ 'id' => $id,
+ 'name' => html::quote($prop['name']),
+ 'groups' => !empty($prop['groups']) || !empty($prop['group_filters']),
+ 'readonly' => !$prop['writable'],
+ 'hidden' => $prop['hidden'],
+ 'autocomplete' => in_array($id, $autocomplete)
+ );
+ }
+ }
+
+ $plugin = $this->plugins->exec_hook('addressbooks_list', array('sources' => $list));
+ $list = $plugin['sources'];
+
+ foreach ($list as $idx => $item) {
+ // register source for shutdown function
+ if (!is_object($this->address_books[$item['id']])) {
+ $this->address_books[$item['id']] = $item;
+ }
+ // remove from list if not writeable as requested
+ if ($writeable && $item['readonly']) {
+ unset($list[$idx]);
+ }
+ // remove from list if hidden as requested
+ else if ($skip_hidden && $item['hidden']) {
+ unset($list[$idx]);
+ }
+ }
+
+ return $list;
}
- $storage = $this->get_storage();
+ /**
+ * Getter for compose responses.
+ * These are stored in local config and user preferences.
+ *
+ * @param boolean True to sort the list alphabetically
+ * @param boolean True if only this user's responses shall be listed
+ *
+ * @return array List of the current user's stored responses
+ */
+ public function get_compose_responses($sorted = false, $user_only = false)
+ {
+ $responses = array();
+
+ if (!$user_only) {
+ foreach ($this->config->get('compose_responses_static', array()) as $response) {
+ if (empty($response['key'])) {
+ $response['key'] = substr(md5($response['name']), 0, 16);
+ }
+
+ $response['static'] = true;
+ $response['class'] = 'readonly';
+
+ $k = $sorted ? '0000-' . strtolower($response['name']) : $response['key'];
+ $responses[$k] = $response;
+ }
+ }
+
+ foreach ($this->config->get('compose_responses', array()) as $response) {
+ if (empty($response['key'])) {
+ $response['key'] = substr(md5($response['name']), 0, 16);
+ }
- // try to log in
- if (!$storage->connect($host, $username, $pass, $port, $ssl)) {
- return false;
+ $k = $sorted ? strtolower($response['name']) : $response['key'];
+ $responses[$k] = $response;
+ }
+
+ // sort list by name
+ if ($sorted) {
+ ksort($responses, SORT_LOCALE_STRING);
+ }
+
+ return array_values($responses);
}
- // user already registered -> update user's record
- if (is_object($user)) {
- // update last login timestamp
- $user->touch();
+ /**
+ * Init output object for GUI and add common scripts.
+ * This will instantiate a rcmail_output_html object and set
+ * environment vars according to the current session and configuration
+ *
+ * @param boolean True if this request is loaded in a (i)frame
+ *
+ * @return rcube_output Reference to HTML output object
+ */
+ public function load_gui($framed = false)
+ {
+ // init output page
+ if (!($this->output instanceof rcmail_output_html)) {
+ $this->output = new rcmail_output_html($this->task, $framed);
+ }
+
+ // set refresh interval
+ $this->output->set_env('refresh_interval', $this->config->get('refresh_interval', 0));
+ $this->output->set_env('session_lifetime', $this->config->get('session_lifetime', 0) * 60);
+
+ if ($framed) {
+ $this->comm_path .= '&_framed=1';
+ $this->output->set_env('framed', true);
+ }
+
+ $this->output->set_env('task', $this->task);
+ $this->output->set_env('action', $this->action);
+ $this->output->set_env('comm_path', $this->comm_path);
+ $this->output->set_charset(RCUBE_CHARSET);
+
+ if ($this->user && $this->user->ID) {
+ $this->output->set_env('user_id', $this->user->get_hash());
+ }
+
+ // add some basic labels to client
+ $this->output->add_label('loading', 'servererror', 'requesttimedout', 'refreshing');
+
+ return $this->output;
}
- // create new system user
- else if ($config['auto_create_user']) {
- if ($created = rcube_user::create($username, $host)) {
- $user = $created;
- }
- else {
- self::raise_error(array(
- 'code' => 620, 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Failed to create a user record. Maybe aborted by a plugin?"
- ), true, false);
- }
+
+ /**
+ * Create an output object for JSON responses
+ *
+ * @return rcube_output Reference to JSON output object
+ */
+ public function json_init()
+ {
+ if (!($this->output instanceof rcmail_output_json)) {
+ $this->output = new rcmail_output_json($this->task);
+ }
+
+ return $this->output;
}
- else {
- self::raise_error(array(
- 'code' => 621, 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Access denied for new user $username. 'auto_create_user' is disabled"
- ), true, false);
+
+ /**
+ * Create session object and start the session.
+ */
+ public function session_init()
+ {
+ parent::session_init();
+
+ // set initial session vars
+ if (!$_SESSION['user_id']) {
+ $_SESSION['temp'] = true;
+ }
+
+ // restore skin selection after logout
+ if ($_SESSION['temp'] && !empty($_SESSION['skin'])) {
+ $this->config->set('skin', $_SESSION['skin']);
+ }
}
- // login succeeded
- if (is_object($user) && $user->ID) {
- // Configure environment
- $this->set_user($user);
- $this->set_storage_prop();
+ /**
+ * Perfom login to the mail server and to the webmail service.
+ * This will also create a new user entry if auto_create_user is configured.
+ *
+ * @param string Mail storage (IMAP) user name
+ * @param string Mail storage (IMAP) password
+ * @param string Mail storage (IMAP) host
+ * @param bool Enables cookie check
+ *
+ * @return boolean True on success, False on failure
+ */
+ function login($username, $pass, $host = null, $cookiecheck = false)
+ {
+ $this->login_error = null;
- // fix some old settings according to namespace prefix
- $this->fix_namespace_settings($user);
+ if (empty($username)) {
+ return false;
+ }
- // create default folders on first login
- if ($config['create_default_folders'] && (!empty($created) || empty($user->data['last_login']))) {
- $storage->create_default_folders();
- }
+ if ($cookiecheck && empty($_COOKIE)) {
+ $this->login_error = self::ERROR_COOKIES_DISABLED;
+ return false;
+ }
- // set session vars
- $_SESSION['user_id'] = $user->ID;
- $_SESSION['username'] = $user->data['username'];
- $_SESSION['storage_host'] = $host;
- $_SESSION['storage_port'] = $port;
- $_SESSION['storage_ssl'] = $ssl;
- $_SESSION['password'] = $this->encrypt($pass);
- $_SESSION['login_time'] = time();
+ $default_host = $this->config->get('default_host');
+ $default_port = $this->config->get('default_port');
+ $username_domain = $this->config->get('username_domain');
+ $login_lc = $this->config->get('login_lc', 2);
- if (isset($_REQUEST['_timezone']) && $_REQUEST['_timezone'] != '_default_')
- $_SESSION['timezone'] = rcube_utils::get_input_value('_timezone', rcube_utils::INPUT_GPC);
+ if (!$host) {
+ $host = $default_host;
+ }
- // force reloading complete list of subscribed mailboxes
- $storage->clear_cache('mailboxes', true);
+ // Validate that selected host is in the list of configured hosts
+ if (is_array($default_host)) {
+ $allowed = false;
- return true;
- }
+ foreach ($default_host as $key => $host_allowed) {
+ if (!is_numeric($key)) {
+ $host_allowed = $key;
+ }
+ if ($host == $host_allowed) {
+ $allowed = true;
+ break;
+ }
+ }
+
+ if (!$allowed) {
+ $host = null;
+ }
+ }
+ else if (!empty($default_host) && $host != rcube_utils::parse_host($default_host)) {
+ $host = null;
+ }
+
+ if (!$host) {
+ $this->login_error = self::ERROR_INVALID_HOST;
+ return false;
+ }
+
+ // parse $host URL
+ $a_host = parse_url($host);
+ if ($a_host['host']) {
+ $host = $a_host['host'];
+ $ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;
+
+ if (!empty($a_host['port']))
+ $port = $a_host['port'];
+ else if ($ssl && $ssl != 'tls' && (!$default_port || $default_port == 143))
+ $port = 993;
+ }
+
+ if (!$port) {
+ $port = $default_port;
+ }
- return false;
- }
+ // Check if we need to add/force domain to username
+ if (!empty($username_domain)) {
+ $domain = is_array($username_domain) ? $username_domain[$host] : $username_domain;
+ if ($domain = rcube_utils::parse_host((string)$domain, $host)) {
+ $pos = strpos($username, '@');
+
+ // force configured domains
+ if ($pos !== false && $this->config->get('username_domain_forced')) {
+ $username = substr($username, 0, $pos) . '@' . $domain;
+ }
+ // just add domain if not specified
+ else if ($pos === false) {
+ $username .= '@' . $domain;
+ }
+ }
+ }
+
+ // Convert username to lowercase. If storage backend
+ // is case-insensitive we need to store always the same username (#1487113)
+ if ($login_lc) {
+ if ($login_lc == 2 || $login_lc === true) {
+ $username = mb_strtolower($username);
+ }
+ else if (strpos($username, '@')) {
+ // lowercase domain name
+ list($local, $domain) = explode('@', $username);
+ $username = $local . '@' . mb_strtolower($domain);
+ }
+ }
+
+ // try to resolve email address from virtuser table
+ if (strpos($username, '@') && ($virtuser = rcube_user::email2user($username))) {
+ $username = $virtuser;
+ }
+
+ // Here we need IDNA ASCII
+ // Only rcube_contacts class is using domain names in Unicode
+ $host = rcube_utils::idn_to_ascii($host);
+ $username = rcube_utils::idn_to_ascii($username);
+
+ // user already registered -> overwrite username
+ if ($user = rcube_user::query($username, $host)) {
+ $username = $user->data['username'];
+ }
+
+ $storage = $this->get_storage();
+
+ // try to log in
+ if (!$storage->connect($host, $username, $pass, $port, $ssl)) {
+ return false;
+ }
+
+ // user already registered -> update user's record
+ if (is_object($user)) {
+ // update last login timestamp
+ $user->touch();
+ }
+ // create new system user
+ else if ($this->config->get('auto_create_user')) {
+ if ($created = rcube_user::create($username, $host)) {
+ $user = $created;
+ }
+ else {
+ self::raise_error(array(
+ 'code' => 620,
+ 'file' => __FILE__,
+ 'line' => __LINE__,
+ 'message' => "Failed to create a user record. Maybe aborted by a plugin?"
+ ),
+ true, false);
+ }
+ }
+ else {
+ self::raise_error(array(
+ 'code' => 621,
+ 'file' => __FILE__,
+ 'line' => __LINE__,
+ 'message' => "Access denied for new user $username. 'auto_create_user' is disabled"
+ ),
+ true, false);
+ }
+
+ // login succeeded
+ if (is_object($user) && $user->ID) {
+ // Configure environment
+ $this->set_user($user);
+ $this->set_storage_prop();
+
+ // set session vars
+ $_SESSION['user_id'] = $user->ID;
+ $_SESSION['username'] = $user->data['username'];
+ $_SESSION['storage_host'] = $host;
+ $_SESSION['storage_port'] = $port;
+ $_SESSION['storage_ssl'] = $ssl;
+ $_SESSION['password'] = $this->encrypt($pass);
+ $_SESSION['login_time'] = time();
+
+ if (isset($_REQUEST['_timezone']) && $_REQUEST['_timezone'] != '_default_') {
+ $_SESSION['timezone'] = rcube_utils::get_input_value('_timezone', rcube_utils::INPUT_GPC);
+ }
+
+ // fix some old settings according to namespace prefix
+ $this->fix_namespace_settings($user);
+
+ // create default folders on login
+ if ($this->config->get('create_default_folders')) {
+ $storage->create_default_folders();
+ }
+
+ // clear all mailboxes related cache(s)
+ $storage->clear_cache('mailboxes', true);
+
+ return true;
+ }
+
+ return false;
+ }
/**
* Returns error code of last login operation
@@ -616,315 +674,317 @@ class rcmail extends rcube
}
}
+ /**
+ * Auto-select IMAP host based on the posted login information
+ *
+ * @return string Selected IMAP host
+ */
+ public function autoselect_host()
+ {
+ $default_host = $this->config->get('default_host');
+ $host = null;
- /**
- * Auto-select IMAP host based on the posted login information
- *
- * @return string Selected IMAP host
- */
- public function autoselect_host()
- {
- $default_host = $this->config->get('default_host');
- $host = null;
-
- if (is_array($default_host)) {
- $post_host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
- $post_user = rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST);
-
- list(, $domain) = explode('@', $post_user);
-
- // direct match in default_host array
- if ($default_host[$post_host] || in_array($post_host, array_values($default_host))) {
- $host = $post_host;
- }
- // try to select host by mail domain
- else if (!empty($domain)) {
- foreach ($default_host as $storage_host => $mail_domains) {
- if (is_array($mail_domains) && in_array_nocase($domain, $mail_domains)) {
- $host = $storage_host;
- break;
- }
- else if (stripos($storage_host, $domain) !== false || stripos(strval($mail_domains), $domain) !== false) {
- $host = is_numeric($storage_host) ? $mail_domains : $storage_host;
- break;
- }
+ if (is_array($default_host)) {
+ $post_host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
+ $post_user = rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST);
+
+ list(, $domain) = explode('@', $post_user);
+
+ // direct match in default_host array
+ if ($default_host[$post_host] || in_array($post_host, array_values($default_host))) {
+ $host = $post_host;
+ }
+ // try to select host by mail domain
+ else if (!empty($domain)) {
+ foreach ($default_host as $storage_host => $mail_domains) {
+ if (is_array($mail_domains) && in_array_nocase($domain, $mail_domains)) {
+ $host = $storage_host;
+ break;
+ }
+ else if (stripos($storage_host, $domain) !== false || stripos(strval($mail_domains), $domain) !== false) {
+ $host = is_numeric($storage_host) ? $mail_domains : $storage_host;
+ break;
+ }
+ }
+ }
+
+ // take the first entry if $host is still not set
+ if (empty($host)) {
+ list($key, $val) = each($default_host);
+ $host = is_numeric($key) ? $val : $key;
+ }
+ }
+ else if (empty($default_host)) {
+ $host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
+ }
+ else {
+ $host = rcube_utils::parse_host($default_host);
}
- }
- // take the first entry if $host is still not set
- if (empty($host)) {
- list($key, $val) = each($default_host);
- $host = is_numeric($key) ? $val : $key;
- }
+ return $host;
}
- else if (empty($default_host)) {
- $host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
+
+ /**
+ * Destroy session data and remove cookie
+ */
+ public function kill_session()
+ {
+ $this->plugins->exec_hook('session_destroy');
+
+ $this->session->kill();
+ $_SESSION = array('language' => $this->user->language, 'temp' => true, 'skin' => $this->config->get('skin'));
+ $this->user->reset();
}
- else
- $host = rcube_utils::parse_host($default_host);
- return $host;
- }
+ /**
+ * Do server side actions on logout
+ */
+ public function logout_actions()
+ {
+ $config = $this->config->all();
+ $storage = $this->get_storage();
+ if ($config['logout_purge'] && !empty($config['trash_mbox'])) {
+ $storage->clear_folder($config['trash_mbox']);
+ }
- /**
- * Destroy session data and remove cookie
- */
- public function kill_session()
- {
- $this->plugins->exec_hook('session_destroy');
+ if ($config['logout_expunge']) {
+ $storage->expunge_folder('INBOX');
+ }
- $this->session->kill();
- $_SESSION = array('language' => $this->user->language, 'temp' => true, 'skin' => $this->config->get('skin'));
- $this->user->reset();
- }
+ // Try to save unsaved user preferences
+ if (!empty($_SESSION['preferences'])) {
+ $this->user->save_prefs(unserialize($_SESSION['preferences']));
+ }
+ }
+ /**
+ * Generate a unique token to be used in a form request
+ *
+ * @return string The request token
+ */
+ public function get_request_token()
+ {
+ $sess_id = $_COOKIE[ini_get('session.name')];
- /**
- * Do server side actions on logout
- */
- public function logout_actions()
- {
- $config = $this->config->all();
- $storage = $this->get_storage();
+ if (!$sess_id) {
+ $sess_id = session_id();
+ }
- if ($config['logout_purge'] && !empty($config['trash_mbox'])) {
- $storage->clear_folder($config['trash_mbox']);
- }
+ $plugin = $this->plugins->exec_hook('request_token', array(
+ 'value' => md5('RT' . $this->get_user_id() . $this->config->get('des_key') . $sess_id)));
- if ($config['logout_expunge']) {
- $storage->expunge_folder('INBOX');
+ return $plugin['value'];
}
- // Try to save unsaved user preferences
- if (!empty($_SESSION['preferences'])) {
- $this->user->save_prefs(unserialize($_SESSION['preferences']));
- }
- }
-
-
- /**
- * Generate a unique token to be used in a form request
- *
- * @return string The request token
- */
- public function get_request_token()
- {
- $sess_id = $_COOKIE[ini_get('session.name')];
- if (!$sess_id) $sess_id = session_id();
-
- $plugin = $this->plugins->exec_hook('request_token', array(
- 'value' => md5('RT' . $this->get_user_id() . $this->config->get('des_key') . $sess_id)));
-
- return $plugin['value'];
- }
-
-
- /**
- * Check if the current request contains a valid token
- *
- * @param int Request method
- * @return boolean True if request token is valid false if not
- */
- public function check_request($mode = rcube_utils::INPUT_POST)
- {
- $token = rcube_utils::get_input_value('_token', $mode);
- $sess_id = $_COOKIE[ini_get('session.name')];
- return !empty($sess_id) && $token == $this->get_request_token();
- }
-
-
- /**
- * Build a valid URL to this instance of Roundcube
- *
- * @param mixed Either a string with the action or url parameters as key-value pairs
- *
- * @return string Valid application URL
- */
- public function url($p)
- {
- if (!is_array($p)) {
- if (strpos($p, 'http') === 0)
- return $p;
-
- $p = array('_action' => @func_get_arg(0));
- }
+ /**
+ * Check if the current request contains a valid token
+ *
+ * @param int Request method
+ *
+ * @return boolean True if request token is valid false if not
+ */
+ public function check_request($mode = rcube_utils::INPUT_POST)
+ {
+ $token = rcube_utils::get_input_value('_token', $mode);
+ $sess_id = $_COOKIE[ini_get('session.name')];
- $task = $p['_task'] ? $p['_task'] : ($p['task'] ? $p['task'] : $this->task);
- $p['_task'] = $task;
- unset($p['task']);
-
- $url = './' . $this->filename;
- $delm = '?';
- foreach (array_reverse($p) as $key => $val) {
- if ($val !== '' && $val !== null) {
- $par = $key[0] == '_' ? $key : '_'.$key;
- $url .= $delm.urlencode($par).'='.urlencode($val);
- $delm = '&';
- }
+ return !empty($sess_id) && $token == $this->get_request_token();
}
- return $url;
- }
+ /**
+ * Build a valid URL to this instance of Roundcube
+ *
+ * @param mixed Either a string with the action or url parameters as key-value pairs
+ *
+ * @return string Valid application URL
+ */
+ public function url($p)
+ {
+ if (!is_array($p)) {
+ if (strpos($p, 'http') === 0) {
+ return $p;
+ }
- /**
- * Function to be executed in script shutdown
- */
- public function shutdown()
- {
- parent::shutdown();
+ $p = array('_action' => @func_get_arg(0));
+ }
- foreach ($this->address_books as $book) {
- if (is_object($book) && is_a($book, 'rcube_addressbook'))
- $book->close();
- }
+ $task = $p['_task'] ? $p['_task'] : ($p['task'] ? $p['task'] : $this->task);
+ $p['_task'] = $task;
+ unset($p['task']);
- // write performance stats to logs/console
- if ($this->config->get('devel_mode')) {
- if (function_exists('memory_get_usage'))
- $mem = $this->show_bytes(memory_get_usage());
- if (function_exists('memory_get_peak_usage'))
- $mem .= '/'.$this->show_bytes(memory_get_peak_usage());
-
- $log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : '');
- if (defined('RCMAIL_START'))
- self::print_timer(RCMAIL_START, $log);
- else
- self::console($log);
- }
- }
-
-
- /**
- * Registers action aliases for current task
- *
- * @param array $map Alias-to-filename hash array
- */
- public function register_action_map($map)
- {
- if (is_array($map)) {
- foreach ($map as $idx => $val) {
- $this->action_map[$idx] = $val;
- }
- }
- }
-
-
- /**
- * Returns current action filename
- *
- * @param array $map Alias-to-filename hash array
- */
- public function get_action_file()
- {
- if (!empty($this->action_map[$this->action])) {
- return $this->action_map[$this->action];
- }
+ $url = './' . $this->filename;
+ $delm = '?';
- return strtr($this->action, '-', '_') . '.inc';
- }
-
-
- /**
- * Fixes some user preferences according to namespace handling change.
- * Old Roundcube versions were using folder names with removed namespace prefix.
- * Now we need to add the prefix on servers where personal namespace has prefix.
- *
- * @param rcube_user $user User object
- */
- private function fix_namespace_settings($user)
- {
- $prefix = $this->storage->get_namespace('prefix');
- $prefix_len = strlen($prefix);
-
- if (!$prefix_len)
- return;
-
- $prefs = $this->config->all();
- if (!empty($prefs['namespace_fixed']))
- return;
-
- // Build namespace prefix regexp
- $ns = $this->storage->get_namespace();
- $regexp = array();
-
- foreach ($ns as $entry) {
- if (!empty($entry)) {
- foreach ($entry as $item) {
- if (strlen($item[0])) {
- $regexp[] = preg_quote($item[0], '/');
- }
+ foreach (array_reverse($p) as $key => $val) {
+ if ($val !== '' && $val !== null) {
+ $par = $key[0] == '_' ? $key : '_'.$key;
+ $url .= $delm.urlencode($par).'='.urlencode($val);
+ $delm = '&';
+ }
}
- }
+
+ return $url;
}
- $regexp = '/^('. implode('|', $regexp).')/';
- // Fix preferences
- $opts = array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox', 'archive_mbox');
- foreach ($opts as $opt) {
- if ($value = $prefs[$opt]) {
- if ($value != 'INBOX' && !preg_match($regexp, $value)) {
- $prefs[$opt] = $prefix.$value;
+ /**
+ * Function to be executed in script shutdown
+ */
+ public function shutdown()
+ {
+ parent::shutdown();
+
+ foreach ($this->address_books as $book) {
+ if (is_object($book) && is_a($book, 'rcube_addressbook'))
+ $book->close();
}
- }
- }
- if (!empty($prefs['default_folders'])) {
- foreach ($prefs['default_folders'] as $idx => $name) {
- if ($name != 'INBOX' && !preg_match($regexp, $name)) {
- $prefs['default_folders'][$idx] = $prefix.$name;
+ // write performance stats to logs/console
+ if ($this->config->get('devel_mode')) {
+ if (function_exists('memory_get_usage'))
+ $mem = $this->show_bytes(memory_get_usage());
+ if (function_exists('memory_get_peak_usage'))
+ $mem .= '/'.$this->show_bytes(memory_get_peak_usage());
+
+ $log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : '');
+
+ if (defined('RCMAIL_START'))
+ self::print_timer(RCMAIL_START, $log);
+ else
+ self::console($log);
}
- }
}
- if (!empty($prefs['search_mods'])) {
- $folders = array();
- foreach ($prefs['search_mods'] as $idx => $value) {
- if ($idx != 'INBOX' && $idx != '*' && !preg_match($regexp, $idx)) {
- $idx = $prefix.$idx;
+ /**
+ * Registers action aliases for current task
+ *
+ * @param array $map Alias-to-filename hash array
+ */
+ public function register_action_map($map)
+ {
+ if (is_array($map)) {
+ foreach ($map as $idx => $val) {
+ $this->action_map[$idx] = $val;
+ }
}
- $folders[$idx] = $value;
- }
- $prefs['search_mods'] = $folders;
}
- if (!empty($prefs['message_threading'])) {
- $folders = array();
- foreach ($prefs['message_threading'] as $idx => $value) {
- if ($idx != 'INBOX' && !preg_match($regexp, $idx)) {
- $idx = $prefix.$idx;
+ /**
+ * Returns current action filename
+ *
+ * @param array $map Alias-to-filename hash array
+ */
+ public function get_action_file()
+ {
+ if (!empty($this->action_map[$this->action])) {
+ return $this->action_map[$this->action];
}
- $folders[$prefix.$idx] = $value;
- }
- $prefs['message_threading'] = $folders;
+
+ return strtr($this->action, '-', '_') . '.inc';
}
- if (!empty($prefs['collapsed_folders'])) {
- $folders = explode('&&', $prefs['collapsed_folders']);
- $count = count($folders);
- $folders_str = '';
+ /**
+ * Fixes some user preferences according to namespace handling change.
+ * Old Roundcube versions were using folder names with removed namespace prefix.
+ * Now we need to add the prefix on servers where personal namespace has prefix.
+ *
+ * @param rcube_user $user User object
+ */
+ private function fix_namespace_settings($user)
+ {
+ $prefix = $this->storage->get_namespace('prefix');
+ $prefix_len = strlen($prefix);
- if ($count) {
- $folders[0] = substr($folders[0], 1);
- $folders[$count-1] = substr($folders[$count-1], 0, -1);
- }
+ if (!$prefix_len)
+ return;
+
+ $prefs = $this->config->all();
+ if (!empty($prefs['namespace_fixed']))
+ return;
- foreach ($folders as $value) {
- if ($value != 'INBOX' && !preg_match($regexp, $value)) {
- $value = $prefix.$value;
+ // Build namespace prefix regexp
+ $ns = $this->storage->get_namespace();
+ $regexp = array();
+
+ foreach ($ns as $entry) {
+ if (!empty($entry)) {
+ foreach ($entry as $item) {
+ if (strlen($item[0])) {
+ $regexp[] = preg_quote($item[0], '/');
+ }
+ }
+ }
+ }
+ $regexp = '/^('. implode('|', $regexp).')/';
+
+ // Fix preferences
+ $opts = array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox', 'archive_mbox');
+ foreach ($opts as $opt) {
+ if ($value = $prefs[$opt]) {
+ if ($value != 'INBOX' && !preg_match($regexp, $value)) {
+ $prefs[$opt] = $prefix.$value;
+ }
+ }
}
- $folders_str .= '&'.$value.'&';
- }
- $prefs['collapsed_folders'] = $folders_str;
- }
- $prefs['namespace_fixed'] = true;
+ if (!empty($prefs['default_folders'])) {
+ foreach ($prefs['default_folders'] as $idx => $name) {
+ if ($name != 'INBOX' && !preg_match($regexp, $name)) {
+ $prefs['default_folders'][$idx] = $prefix.$name;
+ }
+ }
+ }
- // save updated preferences and reset imap settings (default folders)
- $user->save_prefs($prefs);
- $this->set_storage_prop();
- }
+ if (!empty($prefs['search_mods'])) {
+ $folders = array();
+ foreach ($prefs['search_mods'] as $idx => $value) {
+ if ($idx != 'INBOX' && $idx != '*' && !preg_match($regexp, $idx)) {
+ $idx = $prefix.$idx;
+ }
+ $folders[$idx] = $value;
+ }
+ $prefs['search_mods'] = $folders;
+ }
+
+ if (!empty($prefs['message_threading'])) {
+ $folders = array();
+ foreach ($prefs['message_threading'] as $idx => $value) {
+ if ($idx != 'INBOX' && !preg_match($regexp, $idx)) {
+ $idx = $prefix.$idx;
+ }
+ $folders[$prefix.$idx] = $value;
+ }
+
+ $prefs['message_threading'] = $folders;
+ }
+
+ if (!empty($prefs['collapsed_folders'])) {
+ $folders = explode('&&', $prefs['collapsed_folders']);
+ $count = count($folders);
+ $folders_str = '';
+
+ if ($count) {
+ $folders[0] = substr($folders[0], 1);
+ $folders[$count-1] = substr($folders[$count-1], 0, -1);
+ }
+
+ foreach ($folders as $value) {
+ if ($value != 'INBOX' && !preg_match($regexp, $value)) {
+ $value = $prefix.$value;
+ }
+ $folders_str .= '&'.$value.'&';
+ }
+
+ $prefs['collapsed_folders'] = $folders_str;
+ }
+
+ $prefs['namespace_fixed'] = true;
+
+ // save updated preferences and reset imap settings (default folders)
+ $user->save_prefs($prefs);
+ $this->set_storage_prop();
+ }
/**
* Overwrite action variable
@@ -937,6 +997,17 @@ class rcmail extends rcube
$this->output->set_env('action', $action);
}
+ /**
+ * Set environment variables for specified config options
+ */
+ public function set_env_config($options)
+ {
+ foreach ((array) $options as $option) {
+ if ($this->config->get($option)) {
+ $this->output->set_env($option, true);
+ }
+ }
+ }
/**
* Returns RFC2822 formatted current date in user's timezone
@@ -957,7 +1028,6 @@ class rcmail extends rcube
return $date->format('r');
}
-
/**
* Write login data (name, ID, IP address) to the 'userlogins' log file.
*/
@@ -982,14 +1052,13 @@ class rcmail extends rcube
}
$message = sprintf('Successful login for %s (ID: %d) from %s in session %s',
- $user_name, $user_id, rcube_utils::remote_ip(), session_id());
+ $user_name, $user_id, rcube_utils::remote_ip(), session_id());
}
// log login
self::write_log('userlogins', $message);
}
-
/**
* Create a HTML table based on the given data
*
@@ -1039,7 +1108,6 @@ class rcmail extends rcube
return $table->show($attrib);
}
-
/**
* Convert the given date to a human readable form
* This uses the date formatting properties from config
@@ -1169,7 +1237,6 @@ class rcmail extends rcube
return $out;
}
-
/**
* Return folders list in HTML
*
@@ -1241,19 +1308,27 @@ class rcmail extends rcube
}
else {
$js_mailboxlist = array();
- $out = html::tag('ul', $attrib, $rcmail->render_folder_tree_html($a_mailboxes, $mbox_name, $js_mailboxlist, $attrib), html::$common_attrib);
+ $tree = $rcmail->render_folder_tree_html($a_mailboxes, $mbox_name, $js_mailboxlist, $attrib);
+
+ if ($type != 'js') {
+ $out = html::tag('ul', $attrib, $tree, html::$common_attrib);
+
+ $rcmail->output->include_script('treelist.js');
+ $rcmail->output->add_gui_object('mailboxlist', $attrib['id']);
+ $rcmail->output->set_env('unreadwrap', $attrib['unreadwrap']);
+ $rcmail->output->set_env('collapsed_folders', (string)$rcmail->config->get('collapsed_folders'));
+ }
- $rcmail->output->include_script('treelist.js');
- $rcmail->output->add_gui_object('mailboxlist', $attrib['id']);
$rcmail->output->set_env('mailboxes', $js_mailboxlist);
- $rcmail->output->set_env('unreadwrap', $attrib['unreadwrap']);
- $rcmail->output->set_env('collapsed_folders', (string)$rcmail->config->get('collapsed_folders'));
+
+ // we can't use object keys in javascript because they are unordered
+ // we need sorted folders list for folder-selector widget
+ $rcmail->output->set_env('mailboxes_list', array_keys($js_mailboxlist));
}
return $out;
}
-
/**
* Return folders list as html_select object
*
@@ -1297,7 +1372,6 @@ class rcmail extends rcube
return $select;
}
-
/**
* Create a hierarchical array of the mailbox list
*/
@@ -1355,7 +1429,6 @@ class rcmail extends rcube
}
}
-
/**
* Return html for a structured list &lt;ul&gt; for the mailbox tree
*/
@@ -1432,9 +1505,13 @@ class rcmail extends rcube
$jslist[$folder['id']] = array(
'id' => $folder['id'],
'name' => $foldername,
- 'virtual' => $folder['virtual']
+ 'virtual' => $folder['virtual'],
);
+ if (!empty($folder_class)) {
+ $jslist[$folder['id']]['class'] = $folder_class;
+ }
+
if (!empty($folder['folders'])) {
$out .= html::tag('ul', array('style' => ($is_collapsed ? "display:none;" : null)),
$this->render_folder_tree_html($folder['folders'], $mbox_name, $jslist, $attrib, $nestLevel+1));
@@ -1446,7 +1523,6 @@ class rcmail extends rcube
return $out;
}
-
/**
* Return html for a flat list <select> for the mailbox tree
*/
@@ -1491,7 +1567,6 @@ class rcmail extends rcube
return $out;
}
-
/**
* Return internal name for the given folder if it matches the configured special folders
*/
@@ -1510,7 +1585,6 @@ class rcmail extends rcube
}
}
-
/**
* Try to localize the given IMAP folder name.
* UTF-7 decode it in case no localized text was found
@@ -1589,7 +1663,7 @@ class rcmail extends rcube
$rcmail->output->add_script('rcmail.set_quota('.rcube_output::json_serialize($quota).');', 'docready');
- return html::span($attrib, '');
+ return html::span($attrib, '&nbsp;');
}
@@ -1628,7 +1702,6 @@ class rcmail extends rcube
return $quota_result;
}
-
/**
* Outputs error message according to server error/response codes
*
@@ -1682,7 +1755,6 @@ class rcmail extends rcube
}
}
-
/**
* Output HTML editor scripts
*
@@ -1723,7 +1795,6 @@ class rcmail extends rcube
$this->output->add_script("rcmail_editor_init($script)", 'docready');
}
-
/**
* Replaces TinyMCE's emoticon images with plain-text representation
*
@@ -1761,7 +1832,6 @@ class rcmail extends rcube
return preg_replace($search, $replace, $html);
}
-
/**
* File upload progress handler.
*/
@@ -1793,7 +1863,6 @@ class rcmail extends rcube
$this->output->send();
}
-
/**
* Initializes file uploading interface.
*/
@@ -1811,19 +1880,19 @@ class rcmail extends rcube
// find max filesize value
$max_filesize = parse_bytes(ini_get('upload_max_filesize'));
$max_postsize = parse_bytes(ini_get('post_max_size'));
+
if ($max_postsize && $max_postsize < $max_filesize) {
$max_filesize = $max_postsize;
}
$this->output->set_env('max_filesize', $max_filesize);
- $max_filesize = self::show_bytes($max_filesize);
+ $max_filesize = $this->show_bytes($max_filesize);
$this->output->set_env('filesizeerror', $this->gettext(array(
'name' => 'filesizeerror', 'vars' => array('size' => $max_filesize))));
return $max_filesize;
}
-
/**
* Initializes client-side autocompletion.
*/
@@ -1850,7 +1919,6 @@ class rcmail extends rcube
$this->output->add_label('autocompletechars', 'autocompletemore');
}
-
/**
* Returns supported font-family specifications
*
@@ -1883,7 +1951,6 @@ class rcmail extends rcube
return $fonts;
}
-
/**
* Create a human readable string for a number of bytes
*
@@ -1911,7 +1978,6 @@ class rcmail extends rcube
return $str;
}
-
/**
* Returns real size (calculated) of the message part
*
diff --git a/program/include/rcmail_html_page.php b/program/include/rcmail_html_page.php
index 5d07b8d04..604d756e7 100644
--- a/program/include/rcmail_html_page.php
+++ b/program/include/rcmail_html_page.php
@@ -23,7 +23,7 @@
/**
* Class to create an empty HTML page with some default styles
*
- * @package Core
+ * @package Webmail
* @subpackage View
*/
class rcmail_html_page extends rcmail_output_html
@@ -38,11 +38,12 @@ class rcmail_html_page extends rcmail_output_html
}
else { // set default styles for warning blocks inside the attachment part frame
$this->add_header(html::tag('style', array('type' => 'text/css'),
- ".rcmail-inline-message { font-family: sans-serif; border:2px solid #ffdf0e; background:#fef893; padding:0.6em 1em; margin-bottom:0.6em }\n" .
+ ".rcmail-inline-message { font-family: sans-serif; border:2px solid #ffdf0e;"
+ . "background:#fef893; padding:0.6em 1em; margin-bottom:0.6em }\n" .
".rcmail-inline-buttons { margin-bottom:0 }"
));
}
parent::write($contents);
}
-} \ No newline at end of file
+}
diff --git a/program/include/rcmail_output.php b/program/include/rcmail_output.php
index 36512ad48..0f7aaf966 100644
--- a/program/include/rcmail_output.php
+++ b/program/include/rcmail_output.php
@@ -22,7 +22,7 @@
/**
* Class for output generation
*
- * @package Core
+ * @package Webmail
* @subpackage View
*/
abstract class rcmail_output extends rcube_output
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index 7cab3725e..17b5b9647 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -5,7 +5,7 @@
| program/include/rcmail_output_html.php |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2006-2012, The Roundcube Dev Team |
+ | Copyright (C) 2006-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -23,7 +23,7 @@
/**
* Class to create HTML page output using a skin template
*
- * @package Core
+ * @package Webmail
* @subpackage View
*/
class rcmail_output_html extends rcmail_output
@@ -45,6 +45,7 @@ class rcmail_output_html extends rcmail_output
protected $footer = '';
protected $body = '';
protected $base_path = '';
+ protected $devel_mode = false;
// deprecated names of templates used before 0.5
protected $deprecated_templates = array(
@@ -64,6 +65,8 @@ class rcmail_output_html extends rcmail_output
{
parent::__construct();
+ $this->devel_mode = $this->config->get('devel_mode');
+
//$this->framed = $framed;
$this->set_env('task', $task);
$this->set_env('x_frame_options', $this->config->get('x_frame_options', 'sameorigin'));
@@ -80,9 +83,9 @@ class rcmail_output_html extends rcmail_output
$this->set_env('skin', $skin);
if (!empty($_REQUEST['_extwin']))
- $this->set_env('extwin', 1);
+ $this->set_env('extwin', 1);
if ($this->framed || !empty($_REQUEST['_framed']))
- $this->set_env('framed', 1);
+ $this->set_env('framed', 1);
// add common javascripts
$this->add_script('var '.self::JS_OBJECT_NAME.' = new rcube_webmail();', 'head_top');
@@ -116,6 +119,7 @@ class rcmail_output_html extends rcmail_output
public function set_env($name, $value, $addtojs = true)
{
$this->env[$name] = $value;
+
if ($addtojs || isset($this->js_env[$name])) {
$this->js_env[$name] = $value;
}
@@ -310,12 +314,14 @@ class rcmail_output_html extends rcmail_output
*/
public function reset($all = false)
{
+ $framed = $this->framed;
$env = $all ? null : array_intersect_key($this->env, array('extwin'=>1, 'framed'=>1));
parent::reset();
// let some env variables survive
$this->env = $this->js_env = $env;
+ $this->framed = $framed || $this->env['framed'];
$this->js_labels = array();
$this->js_commands = array();
$this->script_files = array();
@@ -323,6 +329,11 @@ class rcmail_output_html extends rcmail_output
$this->header = '';
$this->footer = '';
$this->body = '';
+
+ // load defaults
+ if (!$all) {
+ $this->__construct();
+ }
}
/**
@@ -651,16 +662,37 @@ class rcmail_output_html extends rcmail_output
}
// add file modification timestamp
- if (preg_match('/\.(js|css)$/', $file)) {
- if ($fs = @filemtime($file)) {
- $file .= '?s=' . $fs;
- }
+ if (preg_match('/\.(js|css)$/', $file, $m)) {
+ $file = $this->file_mod($file);
}
return $matches[1] . '=' . $matches[2] . $file . $matches[4];
}
/**
+ * Modify file by adding mtime indicator
+ */
+ protected function file_mod($file)
+ {
+ $fs = false;
+ $ext = substr($file, strrpos($file, '.') + 1);
+
+ // use minified file if exists (not in development mode)
+ if (!$this->devel_mode && !preg_match('/\.min\.' . $ext . '$/', $file)) {
+ $minified_file = substr($file, 0, strlen($ext) * -1) . 'min.' . $ext;
+ if ($fs = @filemtime($minified_file)) {
+ return $minified_file . '?s=' . $fs;
+ }
+ }
+
+ if ($fs = @filemtime($file)) {
+ $file .= '?s=' . $fs;
+ }
+
+ return $file;
+ }
+
+ /**
* Public wrapper to dipp into template parsing.
*
* @param string $input
@@ -964,7 +996,7 @@ class rcmail_output_html extends rcmail_output
$content = html::quote($this->get_pagetitle());
}
else if ($object == 'pagetitle') {
- if ($this->config->get('devel_mode') && !empty($_SESSION['username']))
+ if ($this->devel_mode && !empty($_SESSION['username']))
$title = $_SESSION['username'].' :: ';
else if ($prod_name = $this->config->get('product_name'))
$title = $prod_name . ' :: ';
@@ -1165,7 +1197,7 @@ class rcmail_output_html extends rcmail_output
}
else if ($attrib['type'] == 'link') {
$btn_content = isset($attrib['content']) ? $attrib['content'] : ($attrib['label'] ? $attrib['label'] : $attrib['command']);
- $link_attrib = array('href', 'onclick', 'title', 'id', 'class', 'style', 'tabindex', 'target');
+ $link_attrib = array_merge(html::$common_attrib, array('href', 'onclick', 'tabindex', 'target'));
if ($attrib['innerclass'])
$btn_content = html::span($attrib['innerclass'], $btn_content);
}
@@ -1203,26 +1235,17 @@ class rcmail_output_html extends rcmail_output
*/
public function include_script($file, $position='head')
{
- static $sa_files = array();
-
if (!preg_match('|^https?://|i', $file) && $file[0] != '/') {
- $file = $this->scripts_path . $file;
- if ($fs = @filemtime($file)) {
- $file .= '?s=' . $fs;
- }
- }
-
- if (in_array($file, $sa_files)) {
- return;
+ $file = $this->file_mod($this->scripts_path . $file);
}
- $sa_files[] = $file;
-
if (!is_array($this->script_files[$position])) {
$this->script_files[$position] = array();
}
- $this->script_files[$position][] = $file;
+ if (!in_array($file, $this->script_files[$position])) {
+ $this->script_files[$position][] = $file;
+ }
}
/**
@@ -1280,7 +1303,12 @@ class rcmail_output_html extends rcmail_output
*/
public function _write($templ = '', $base_path = '')
{
- $output = empty($templ) ? $this->default_template : trim($templ);
+ $output = trim($templ);
+
+ if (empty($output)) {
+ $output = $this->default_template;
+ $is_empty = true;
+ }
// set default page title
if (empty($this->pagetitle)) {
@@ -1371,8 +1399,8 @@ class rcmail_output_html extends rcmail_output
}
// add css files in head, before scripts, for speed up with parallel downloads
- if (!empty($this->css_files) &&
- (($pos = stripos($output, '<script ')) || ($pos = stripos($output, '</head>')))
+ if (!empty($this->css_files) && !$is_empty
+ && (($pos = stripos($output, '<script ')) || ($pos = stripos($output, '</head>')))
) {
$css = '';
foreach ($this->css_files as $file) {
diff --git a/program/include/rcmail_output_json.php b/program/include/rcmail_output_json.php
index d0e1eec64..fa35824db 100644
--- a/program/include/rcmail_output_json.php
+++ b/program/include/rcmail_output_json.php
@@ -23,7 +23,7 @@
/**
* View class to produce JSON responses
*
- * @package Core
+ * @package Webmail
* @subpackage View
*/
class rcmail_output_json extends rcmail_output
diff --git a/program/include/rcmail_string_replacer.php b/program/include/rcmail_string_replacer.php
index 4fbc611c9..d3fdc3e7f 100644
--- a/program/include/rcmail_string_replacer.php
+++ b/program/include/rcmail_string_replacer.php
@@ -5,7 +5,7 @@
| program/include/rcmail_string_replacer.php |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2012, The Roundcube Dev Team |
+ | Copyright (C) 2012-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,12 +19,11 @@
+-----------------------------------------------------------------------+
*/
-
/**
* Helper class for turning URLs and email addresses in plaintext content
* into clickable links.
*
- * @package Core
+ * @package Webmail
* @subpackage Utils
*/
class rcmail_string_replacer extends rcube_string_replacer
@@ -40,15 +39,15 @@ class rcmail_string_replacer extends rcube_string_replacer
*/
public function mailto_callback($matches)
{
- $href = $matches[1];
- $suffix = $this->parse_url_brackets($href);
+ $href = $matches[1];
+ $suffix = $this->parse_url_brackets($href);
- $i = $this->add(html::a(array(
- 'href' => 'mailto:' . $href,
- 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('compose','".rcube::JQ($href)."',this)",
- ), rcube::Q($href)) . $suffix);
+ $i = $this->add(html::a(array(
+ 'href' => 'mailto:' . $href,
+ 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('compose','".rcube::JQ($href)."',this)",
+ ),
+ rcube::Q($href)) . $suffix);
- return $i >= 0 ? $this->get_replacement($i) : '';
+ return $i >= 0 ? $this->get_replacement($i) : '';
}
-
-} \ No newline at end of file
+}
diff --git a/program/js/app.js b/program/js/app.js
index 7fbab8003..1ef341415 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -34,7 +34,7 @@ function rcube_webmail()
// webmail client settings
this.dblclick_time = 500;
- this.message_time = 4000;
+ this.message_time = 5000;
this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi');
// environment defaults
@@ -198,32 +198,29 @@ function rcube_webmail()
multiselect:true, multiexpand:true, draggable:true, keyboard:true,
column_movable:this.env.col_movable, dblclick_time:this.dblclick_time
});
- this.message_list.row_init = function(o){ p.init_message_row(o); };
- this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); });
- this.message_list.addEventListener('click', function(o){ p.msglist_click(o); });
- this.message_list.addEventListener('keypress', function(o){ p.msglist_keypress(o); });
- this.message_list.addEventListener('select', function(o){ p.msglist_select(o); });
- this.message_list.addEventListener('dragstart', function(o){ p.drag_start(o); });
- this.message_list.addEventListener('dragmove', function(e){ p.drag_move(e); });
- this.message_list.addEventListener('dragend', function(e){ p.drag_end(e); });
- this.message_list.addEventListener('expandcollapse', function(e){ p.msglist_expand(e); });
- this.message_list.addEventListener('column_replace', function(e){ p.msglist_set_coltypes(e); });
- this.message_list.addEventListener('listupdate', function(e){ p.triggerEvent('listupdate', e); });
+ this.message_list
+ .addEventListener('initrow', function(o) { p.init_message_row(o); })
+ .addEventListener('dblclick', function(o) { p.msglist_dbl_click(o); })
+ .addEventListener('click', function(o) { p.msglist_click(o); })
+ .addEventListener('keypress', function(o) { p.msglist_keypress(o); })
+ .addEventListener('select', function(o) { p.msglist_select(o); })
+ .addEventListener('dragstart', function(o) { p.drag_start(o); })
+ .addEventListener('dragmove', function(e) { p.drag_move(e); })
+ .addEventListener('dragend', function(e) { p.drag_end(e); })
+ .addEventListener('expandcollapse', function(o) { p.msglist_expand(o); })
+ .addEventListener('column_replace', function(o) { p.msglist_set_coltypes(o); })
+ .addEventListener('listupdate', function(o) { p.triggerEvent('listupdate', o); })
+ .init();
document.onmouseup = function(e){ return p.doc_mouse_up(e); };
this.gui_objects.messagelist.parentNode.onmousedown = function(e){ return p.click_on_list(e); };
- this.message_list.init();
this.enable_command('toggle_status', 'toggle_flag', 'sort', true);
// load messages
this.command('list');
- }
- if (this.gui_objects.qsearchbox) {
- if (this.env.search_text != null)
- this.gui_objects.qsearchbox.value = this.env.search_text;
- $(this.gui_objects.qsearchbox).focusin(function() { rcmail.message_list && rcmail.message_list.blur(); });
+ $(this.gui_objects.qsearchbox).val(this.env.search_text).focusin(function() { rcmail.message_list.blur(); });
}
this.set_button_titles();
@@ -256,12 +253,14 @@ function rcube_webmail()
}
else if (this.env.action == 'compose') {
this.env.address_group_stack = [];
- this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'cancel', 'toggle-editor', 'list-adresses', 'pushgroup', 'search', 'reset-search', 'extwin'];
+ this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'cancel',
+ 'toggle-editor', 'list-adresses', 'pushgroup', 'search', 'reset-search', 'extwin',
+ 'insert-response', 'save-response'];
if (this.env.drafts_mailbox)
this.env.compose_commands.push('savedraft')
- this.enable_command(this.env.compose_commands, 'identities', true);
+ this.enable_command(this.env.compose_commands, 'identities', 'responses', true);
// add more commands (not enabled)
$.merge(this.env.compose_commands, ['add-recipient', 'firstpage', 'previouspage', 'nextpage', 'lastpage']);
@@ -272,6 +271,23 @@ function rcube_webmail()
this.enable_command('spellcheck', true);
}
+ // init canned response functions
+ if (this.gui_objects.responseslist) {
+ $('a.insertresponse', this.gui_objects.responseslist)
+ .attr('unselectable', 'on')
+ .mousedown(function(e){ return rcube_event.cancel(e); })
+ .mouseup(function(e){
+ ref.command('insert-response', $(this).attr('rel'));
+ $(document.body).trigger('mouseup'); // hides the menu
+ return rcube_event.cancel(e);
+ });
+
+ // avoid textarea loosing focus when hitting the save-response button/link
+ for (var i=0; this.buttons['save-response'] && i < this.buttons['save-response'].length; i++) {
+ $('#'+this.buttons['save-response'][i].id).mousedown(function(e){ return rcube_event.cancel(e); })
+ }
+ }
+
document.onmouseup = function(e){ return p.doc_mouse_up(e); };
// init message compose form
@@ -298,9 +314,11 @@ function rcube_webmail()
if (this.gui_objects.contactslist) {
this.contact_list = new rcube_list_widget(this.gui_objects.contactslist,
{ multiselect:true, draggable:false, keyboard:false });
- this.contact_list.addEventListener('select', function(o){ ref.compose_recipient_select(o); });
- this.contact_list.addEventListener('dblclick', function(o){ ref.compose_add_recipient('to'); });
- this.contact_list.init();
+ this.contact_list
+ .addEventListener('initrow', function(o) { p.triggerEvent('insertrow', { cid:o.uid, row:o }); })
+ .addEventListener('select', function(o) { ref.compose_recipient_select(o); })
+ .addEventListener('dblclick', function(o) { ref.compose_add_recipient('to'); })
+ .init();
}
if (this.gui_objects.addressbookslist) {
@@ -332,26 +350,27 @@ function rcube_webmail()
this.env.contactfolders = $.extend($.extend({}, this.env.address_sources), this.env.contactgroups);
this.enable_command('add', 'import', this.env.writable_source);
- this.enable_command('list', 'listgroup', 'pushgroup', 'popgroup', 'listsearch', 'advanced-search', true);
+ this.enable_command('list', 'listgroup', 'pushgroup', 'popgroup', 'listsearch', 'search', 'reset-search', 'advanced-search', true);
if (this.gui_objects.contactslist) {
this.contact_list = new rcube_list_widget(this.gui_objects.contactslist,
{multiselect:true, draggable:this.gui_objects.folderlist?true:false, keyboard:true});
- this.contact_list.row_init = function(row){ p.triggerEvent('insertrow', { cid:row.uid, row:row }); };
- this.contact_list.addEventListener('keypress', function(o){ p.contactlist_keypress(o); });
- this.contact_list.addEventListener('select', function(o){ p.contactlist_select(o); });
- this.contact_list.addEventListener('dragstart', function(o){ p.drag_start(o); });
- this.contact_list.addEventListener('dragmove', function(e){ p.drag_move(e); });
- this.contact_list.addEventListener('dragend', function(e){ p.drag_end(e); });
- this.contact_list.init();
+ this.contact_list
+ .addEventListener('initrow', function(o) { p.triggerEvent('insertrow', { cid:o.uid, row:o }); })
+ .addEventListener('keypress', function(o) { p.contactlist_keypress(o); })
+ .addEventListener('select', function(o) { p.contactlist_select(o); })
+ .addEventListener('dragstart', function(o) { p.drag_start(o); })
+ .addEventListener('dragmove', function(e) { p.drag_move(e); })
+ .addEventListener('dragend', function(e) { p.drag_end(e); })
+ .init();
if (this.env.cid)
this.contact_list.highlight_row(this.env.cid);
this.gui_objects.contactslist.parentNode.onmousedown = function(e){ return p.click_on_list(e); };
document.onmouseup = function(e){ return p.doc_mouse_up(e); };
- if (this.gui_objects.qsearchbox)
- $(this.gui_objects.qsearchbox).focusin(function() { rcmail.contact_list.blur(); });
+
+ $(this.gui_objects.qsearchbox).focusin(function() { rcmail.contact_list.blur(); });
this.update_group_commands();
this.command('list');
@@ -375,13 +394,10 @@ function rcube_webmail()
this.init_contact_form();
}
- if (this.gui_objects.qsearchbox)
- this.enable_command('search', 'reset-search', true);
-
break;
case 'settings':
- this.enable_command('preferences', 'identities', 'save', 'folders', true);
+ this.enable_command('preferences', 'identities', 'responses', 'save', 'folders', true);
if (this.env.action == 'identities') {
this.enable_command('add', this.env.identities_level < 2);
@@ -389,9 +405,6 @@ function rcube_webmail()
else if (this.env.action == 'edit-identity' || this.env.action == 'add-identity') {
this.enable_command('save', 'edit', 'toggle-editor', true);
this.enable_command('delete', this.env.identities_level < 2);
-
- if (this.env.action == 'add-identity')
- $("input[type='text']").first().select();
}
else if (this.env.action == 'folders') {
this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', true);
@@ -400,26 +413,46 @@ function rcube_webmail()
this.enable_command('save', 'folder-size', true);
parent.rcmail.env.exists = this.env.messagecount;
parent.rcmail.enable_command('purge', this.env.messagecount);
- $("input[type='text']").first().select();
+ }
+ else if (this.env.action == 'responses') {
+ this.enable_command('add', true);
}
if (this.gui_objects.identitieslist) {
- this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist, {multiselect:false, draggable:false, keyboard:false});
- this.identity_list.addEventListener('select', function(o){ p.identity_select(o); });
- this.identity_list.init();
- this.identity_list.focus();
+ this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist,
+ {multiselect:false, draggable:false, keyboard:false});
+ this.identity_list
+ .addEventListener('select', function(o) { p.identity_select(o); })
+ .init()
+ .focus();
if (this.env.iid)
this.identity_list.highlight_row(this.env.iid);
}
else if (this.gui_objects.sectionslist) {
this.sections_list = new rcube_list_widget(this.gui_objects.sectionslist, {multiselect:false, draggable:false, keyboard:false});
- this.sections_list.addEventListener('select', function(o){ p.section_select(o); });
- this.sections_list.init();
- this.sections_list.focus();
+ this.sections_list
+ .addEventListener('select', function(o) { p.section_select(o); })
+ .init()
+ .focus();
}
- else if (this.gui_objects.subscriptionlist)
+ else if (this.gui_objects.subscriptionlist) {
this.init_subscription_list();
+ }
+ else if (this.gui_objects.responseslist) {
+ this.responses_list = new rcube_list_widget(this.gui_objects.responseslist, {multiselect:false, draggable:false, keyboard:false});
+ this.responses_list
+ .addEventListener('select', function(list) {
+ var win, id = list.get_single_selection();
+ p.enable_command('delete', !!id && $.inArray(id, p.env.readonly_responses) < 0);
+ if (id && (win = p.get_frame_window(p.env.contentframe))) {
+ p.set_busy(true);
+ p.location_href({ _action:'edit-response', _key:id, _framed:1 }, win);
+ }
+ })
+ .init()
+ .focus();
+ }
break;
@@ -453,6 +486,11 @@ function rcube_webmail()
break;
}
+ // select first input field in an edit form
+ if (this.gui_objects.editform)
+ $("input,select,textarea", this.gui_objects.editform)
+ .not(':hidden').not(':disabled').first().select();
+
// unset contentframe variable if preview_pane is enabled
if (this.env.contentframe && !$('#' + this.env.contentframe).is(':visible'))
this.env.contentframe = null;
@@ -463,6 +501,7 @@ function rcube_webmail()
// flag object as complete
this.loaded = true;
+ this.env.lastrefresh = new Date();
// show message
if (this.pending_message)
@@ -478,11 +517,12 @@ function rcube_webmail()
id_prefix: 'rcmli',
id_encode: this.html_identifier_encode,
id_decode: this.html_identifier_decode,
- check_droptarget: function(node){ return !node.virtual && ref.check_droptarget(node.id) }
+ check_droptarget: function(node) { return !node.virtual && ref.check_droptarget(node.id) }
});
- this.treelist.addEventListener('collapse', function(node){ ref.folder_collapsed(node) });
- this.treelist.addEventListener('expand', function(node){ ref.folder_collapsed(node) });
- this.treelist.addEventListener('select', function(node){ ref.triggerEvent('selectfolder', { folder:node.id, prefix:'rcmli' }) });
+ this.treelist
+ .addEventListener('collapse', function(node) { ref.folder_collapsed(node) })
+ .addEventListener('expand', function(node) { ref.folder_collapsed(node) })
+ .addEventListener('select', function(node) { ref.triggerEvent('selectfolder', { folder:node.id, prefix:'rcmli' }) });
}
}
@@ -547,9 +587,12 @@ function rcube_webmail()
}
// check input before leaving compose step
- if (this.task == 'mail' && this.env.action == 'compose' && $.inArray(command, this.env.compose_commands)<0) {
+ if (this.task == 'mail' && this.env.action == 'compose' && $.inArray(command, this.env.compose_commands) < 0 && !this.env.server_error) {
if (this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
return false;
+
+ // remove copy from local storage if compose screen is left intentionally
+ this.remove_compose_data(this.env.compose_id);
}
// process external commands
@@ -584,10 +627,10 @@ function rcube_webmail()
break;
// commands to switch task
+ case 'logout':
case 'mail':
case 'addressbook':
case 'settings':
- case 'logout':
this.switch_task(command);
break;
@@ -607,6 +650,7 @@ function rcube_webmail()
var form = this.gui_objects.messageform,
win = this.open_window('');
+ this.save_compose_form_local();
$("input[name='_action']", form).val('compose');
form.action = this.url('mail/compose', { _id: this.env.compose_id, _extwin: 1 });
form.target = win.name;
@@ -725,6 +769,13 @@ function rcube_webmail()
case 'add':
if (this.task == 'addressbook')
this.load_contact(0, 'add');
+ else if (this.task == 'settings' && this.env.action == 'responses') {
+ var frame;
+ if ((frame = this.get_frame_window(this.env.contentframe))) {
+ this.set_busy(true);
+ this.location_href({ _action:'add-response', _framed:1 }, frame);
+ }
+ }
else if (this.task == 'settings') {
this.identity_list.clear_selection();
this.load_identity(0, 'add-identity');
@@ -788,7 +839,10 @@ function rcube_webmail()
// addressbook task
else if (this.task == 'addressbook')
this.delete_contacts();
- // user settings task
+ // settings: canned response
+ else if (this.task == 'settings' && this.env.action == 'responses')
+ this.delete_response();
+ // settings: user identities
else if (this.task == 'settings')
this.delete_identity();
break;
@@ -797,14 +851,14 @@ function rcube_webmail()
case 'move':
case 'moveto': // deprecated
if (this.task == 'mail')
- this.move_messages(props);
+ this.move_messages(props, obj);
else if (this.task == 'addressbook')
this.move_contacts(props);
break;
case 'copy':
if (this.task == 'mail')
- this.copy_messages(props);
+ this.copy_messages(props, obj);
else if (this.task == 'addressbook')
this.copy_contacts(props);
break;
@@ -815,37 +869,24 @@ function rcube_webmail()
break;
case 'toggle_status':
- if (props && !props._row)
- break;
-
- flag = 'read';
-
- if (props._row.uid) {
- uid = props._row.uid;
+ case 'toggle_flag':
+ flag = command == 'toggle_flag' ? 'flagged' : 'read';
+ if (uid = props) {
+ // toggle flagged/unflagged
+ if (flag == 'flagged') {
+ if (this.message_list.rows[uid].flagged)
+ flag = 'unflagged';
+ }
// toggle read/unread
- if (this.message_list.rows[uid].deleted)
+ else if (this.message_list.rows[uid].deleted)
flag = 'undelete';
else if (!this.message_list.rows[uid].unread)
flag = 'unread';
- }
-
- this.mark_message(flag, uid);
- break;
-
- case 'toggle_flag':
- if (props && !props._row)
- break;
- flag = 'flagged';
-
- if (props._row.uid) {
- uid = props._row.uid;
- // toggle flagged/unflagged
- if (this.message_list.rows[uid].flagged)
- flag = 'unflagged';
+ this.mark_message(flag, uid);
}
- this.mark_message(flag, uid);
+
break;
case 'always-load':
@@ -1031,7 +1072,7 @@ function rcube_webmail()
url = {_reply_uid: uid, _mbox: this.env.mailbox};
if (command == 'reply-all')
// do reply-list, when list is detected and popup menu wasn't used
- url._all = (!props && this.commands['reply-list'] ? 'list' : 'all');
+ url._all = (!props && this.env.reply_all_mode == 1 && this.commands['reply-list'] ? 'list' : 'all');
else if (command == 'reply-list')
url._all = 'list';
@@ -1173,6 +1214,7 @@ function rcube_webmail()
// user settings commands
case 'preferences':
case 'identities':
+ case 'responses':
case 'folders':
this.goto_url('settings/' + command);
break;
@@ -1263,8 +1305,10 @@ function rcube_webmail()
return;
var url = this.get_task_url(task);
- if (task=='mail')
+ if (task == 'mail')
url += '&_mbox=INBOX';
+ else if (task == 'logout')
+ this.clear_compose_data();
this.redirect(url);
};
@@ -1376,8 +1420,6 @@ function rcube_webmail()
this.drag_start = function(list)
{
- var model = this.task == 'mail' ? this.env.mailboxes : this.env.contactfolders;
-
this.drag_active = true;
if (this.preview_timer)
@@ -1392,11 +1434,31 @@ function rcube_webmail()
this.drag_end = function(e)
{
- this.drag_active = false;
- this.env.last_folder_target = null;
+ var list, model;
if (this.treelist)
this.treelist.drag_end();
+
+ // execute drag & drop action when mouse was released
+ if (list = this.message_list)
+ model = this.env.mailboxes;
+ else if (list = this.contact_list)
+ model = this.env.contactfolders;
+
+ if (this.drag_active && model && this.env.last_folder_target) {
+ var target = model[this.env.last_folder_target];
+ list.draglayer.hide();
+
+ if (this.contact_list) {
+ if (!this.contacts_drag_menu(e, target))
+ this.command('move', target);
+ }
+ else if (!this.drag_menu(e, target))
+ this.command('move', target);
+ }
+
+ this.drag_active = false;
+ this.env.last_folder_target = null;
};
this.drag_move = function(e)
@@ -1439,7 +1501,7 @@ function rcube_webmail()
// select the folder if one of its childs is currently selected
// don't select if it's virtual (#1488346)
- if (this.env.mailbox && this.env.mailbox.indexOf(name + this.env.delimiter) == 0 && !node.virtual)
+ if (this.env.mailbox && this.env.mailbox.startsWith(name + this.env.delimiter) && !node.virtual)
this.command('list', name);
}
else {
@@ -1457,38 +1519,16 @@ function rcube_webmail()
this.doc_mouse_up = function(e)
{
- var model, list, id;
+ var list, id;
// ignore event if jquery UI dialog is open
if ($(rcube_event.get_target(e)).closest('.ui-dialog, .ui-widget-overlay').length)
return;
- if (list = this.message_list)
- model = this.env.mailboxes;
- else if (list = this.contact_list)
- model = this.env.contactfolders;
- else if (this.ksearch_value)
- this.ksearch_blur();
-
+ list = this.message_list || this.contact_list;
if (list && !rcube_mouse_is_over(e, list.list.parentNode))
list.blur();
- // handle mouse release when dragging
- if (this.drag_active && model && this.env.last_folder_target) {
- var target = model[this.env.last_folder_target];
-
- this.env.last_folder_target = null;
- list.draglayer.hide();
- this.drag_end(e);
-
- if (this.contact_list) {
- if (!this.contacts_drag_menu(e, target))
- this.command('move', target);
- }
- else if (!this.drag_menu(e, target))
- this.command('move', target);
- }
-
// reset 'pressed' buttons
if (this.buttons_sel) {
for (id in this.buttons_sel)
@@ -1620,8 +1660,8 @@ function rcube_webmail()
this.env.coltypes = [];
for (i=0; i<cols.length; i++)
- if (cols[i].id && cols[i].id.match(/^rcm/)) {
- name = cols[i].id.replace(/^rcm/, '');
+ if (cols[i].id && cols[i].id.startsWith('rcm')) {
+ name = cols[i].id.slice(3);
this.env.coltypes.push(name);
}
@@ -1671,7 +1711,7 @@ function rcube_webmail()
url += (url.match(/\?/) ? '&' : '?') + '_extwin=1';
if (this.env.standard_windows)
- extwin = window.open(url, wname);
+ var extwin = window.open(url, wname);
else {
var win = this.is_framed() ? parent.window : window,
page = $(win),
@@ -1691,8 +1731,11 @@ function rcube_webmail()
extwin.document.write('<html><body>' + this.get_label('loading') + '</body></html>');
}
+ // allow plugins to grab the window reference (#1489413)
+ this.triggerEvent('openwindow', { url:url, handle:extwin });
+
// focus window, delayed to bring to front
- window.setTimeout(function() { extwin.focus(); }, 10);
+ window.setTimeout(function() { extwin && extwin.focus(); }, 10);
return extwin;
};
@@ -1704,7 +1747,7 @@ function rcube_webmail()
this.init_message_row = function(row)
{
- var expando, self = this, uid = row.uid,
+ var i, fn = {}, self = this, uid = row.uid,
status_icon = (this.env.status_col != null ? 'status' : 'msg') + 'icn' + row.uid;
if (uid && this.env.messages[uid])
@@ -1712,8 +1755,7 @@ function rcube_webmail()
// set eventhandler to status icon
if (row.icon = document.getElementById(status_icon)) {
- row.icon._row = row.obj;
- row.icon.onclick = function(e) { self.command('toggle_status', this); return rcube_event.cancel(e); };
+ fn.icon = function(e) { self.command('toggle_status', uid); };
}
// save message icon position too
@@ -1722,24 +1764,28 @@ function rcube_webmail()
else
row.msgicon = row.icon;
- // set eventhandler to flag icon, if icon found
+ // set eventhandler to flag icon
if (this.env.flagged_col != null && (row.flagicon = document.getElementById('flagicn'+row.uid))) {
- row.flagicon._row = row.obj;
- row.flagicon.onclick = function(e) { self.command('toggle_flag', this); return rcube_event.cancel(e); };
+ fn.flagicon = function(e) { self.command('toggle_flag', uid); };
}
- if (!row.depth && row.has_children && (expando = document.getElementById('rcmexpando'+row.uid))) {
- row.expando = expando;
- expando.onclick = function(e) { return self.expand_message_row(e, uid); };
+ // set event handler to thread expand/collapse icon
+ if (!row.depth && row.has_children && (row.expando = document.getElementById('rcmexpando'+row.uid))) {
+ fn.expando = function(e) { self.expand_message_row(e, uid); };
+ }
+
+ // attach events
+ $.each(fn, function(i, f) {
+ row[i].onclick = function(e) { f(e); return rcube_event.cancel(e); };
if (bw.touch) {
- expando.addEventListener('touchend', function(e) {
+ row[i].addEventListener('touchend', function(e) {
if (e.changedTouches.length == 1) {
- self.expand_message_row(e, uid);
+ f(e);
return rcube_event.cancel(e);
}
}, false);
}
- }
+ });
this.triggerEvent('insertrow', { uid:uid, row:row });
};
@@ -2006,7 +2052,6 @@ function rcube_webmail()
if (preview && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read >= 0) {
this.preview_read_timer = setTimeout(function() {
ref.set_message(id, 'unread', false);
- ref.update_thread_root(id, 'read');
if (ref.env.unread_counts[ref.env.mailbox]) {
ref.env.unread_counts[ref.env.mailbox] -= 1;
ref.set_unread_count(ref.env.mailbox, ref.env.unread_counts[ref.env.mailbox], ref.env.mailbox == 'INBOX');
@@ -2024,12 +2069,14 @@ function rcube_webmail()
if (name && (frame = this.get_frame_element(name))) {
if (!show && (win = this.get_frame_window(name))) {
- if (win.stop)
- win.stop();
- else // IE
- win.document.execCommand('Stop');
+ if (win.location.href.indexOf(this.env.blankpage) < 0) {
+ if (win.stop)
+ win.stop();
+ else // IE
+ win.document.execCommand('Stop');
- win.location.href = this.env.blankpage;
+ win.location.href = this.env.blankpage;
+ }
}
else if (!bw.safari && !bw.konq)
$(frame)[show ? 'show' : 'hide']();
@@ -2510,8 +2557,11 @@ function rcube_webmail()
if (!row)
return false;
- if (flag == 'unread')
+ if (flag == 'unread') {
+ if (row.unread != status)
+ this.update_thread_root(uid, status ? 'unread' : 'read');
row.unread = status;
+ }
else if(flag == 'deleted')
row.deleted = status;
else if (flag == 'replied')
@@ -2569,10 +2619,12 @@ function rcube_webmail()
};
// copy selected messages to the specified mailbox
- this.copy_messages = function(mbox)
+ this.copy_messages = function(mbox, obj)
{
if (mbox && typeof mbox === 'object')
mbox = mbox.id;
+ else if (!mbox)
+ return this.folder_selector(obj, function(folder) { ref.command('copy', folder); });
// exit if current or no mailbox specified
if (!mbox || mbox == this.env.mailbox)
@@ -2589,10 +2641,12 @@ function rcube_webmail()
};
// move selected messages to the specified mailbox
- this.move_messages = function(mbox)
+ this.move_messages = function(mbox, obj)
{
if (mbox && typeof mbox === 'object')
mbox = mbox.id;
+ else if (!mbox)
+ return this.folder_selector(obj, function(folder) { ref.command('move', folder); });
// exit if current or no mailbox specified
if (!mbox || mbox == this.env.mailbox)
@@ -2619,20 +2673,7 @@ function rcube_webmail()
// delete selected messages from the current mailbox
this.delete_messages = function(event)
{
- var uid, i, len, trash = this.env.trash_mailbox,
- list = this.message_list,
- selection = list ? list.get_selection() : [];
-
- // exit if no mailbox specified or if selection is empty
- if (!this.env.uid && !selection.length)
- return;
-
- // also select childs of collapsed rows
- for (i=0, len=selection.length; i<len; i++) {
- uid = selection[i];
- if (list.rows[uid].has_children && !list.rows[uid].expanded)
- list.select_children(uid);
- }
+ var list = this.message_list, trash = this.env.trash_mailbox;
// if config is set to flag for deletion
if (this.env.flag_for_deletion) {
@@ -2672,7 +2713,7 @@ function rcube_webmail()
this._with_selected_messages('delete', post_data);
};
- // Send a specifc move/delete request with UIDs of all selected messages
+ // Send a specific move/delete request with UIDs of all selected messages
// @private
this._with_selected_messages = function(action, post_data, lock)
{
@@ -2704,9 +2745,6 @@ function rcube_webmail()
}
}
- if (this.env.display_next && this.env.next_uid)
- post_data._next_uid = this.env.next_uid;
-
if (count < 0)
post_data._count = (count*-1);
// remove threads from the end of the list
@@ -2742,6 +2780,9 @@ function rcube_webmail()
if (this.env.search_request)
data._search = this.env.search_request;
+ if (this.env.display_next && this.env.next_uid)
+ data._next_uid = this.env.next_uid;
+
return data;
};
@@ -2808,9 +2849,6 @@ function rcube_webmail()
this.set_message(a_uids[i], 'unread', (flag == 'unread' ? true : false));
this.http_post('mark', post_data, lock);
-
- for (i=0; i<len; i++)
- this.update_thread_root(a_uids[i], flag);
};
// set image to flagged or unflagged
@@ -2992,9 +3030,12 @@ function rcube_webmail()
// test if purge command is allowed
this.purge_mailbox_test = function()
{
- return (this.env.exists && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
- || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))
- || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter))));
+ return (this.env.exists && (
+ this.env.mailbox == this.env.trash_mailbox
+ || this.env.mailbox == this.env.junk_mailbox
+ || this.env.mailbox.startsWith(this.env.trash_mailbox + this.env.delimiter)
+ || this.env.mailbox.startsWith(this.env.junk_mailbox + this.env.delimiter)
+ ));
};
@@ -3080,6 +3121,64 @@ function rcube_webmail()
}
}
+ // check for locally stored compose data
+ if (window.localStorage) {
+ var index = this.local_storage_get_item('compose.index', []);
+
+ for (var key, i = 0; i < index.length; i++) {
+ key = index[i], formdata = this.local_storage_get_item('compose.' + key, null, true);
+ if (!formdata) {
+ continue;
+ }
+ // restore saved copy of current compose_id
+ if (formdata.changed && key == this.env.compose_id) {
+ this.restore_compose_form(key, html_mode);
+ break;
+ }
+ // skip records from 'other' drafts
+ if (this.env.draft_id && formdata.draft_id && formdata.draft_id != this.env.draft_id) {
+ continue;
+ }
+ // skip records on reply
+ if (this.env.reply_msgid && formdata.reply_msgid != this.env.reply_msgid) {
+ continue;
+ }
+ // show dialog asking to restore the message
+ if (formdata.changed && formdata.session != this.env.session_id) {
+ this.show_popup_dialog(
+ this.get_label('restoresavedcomposedata')
+ .replace('$date', new Date(formdata.changed).toLocaleString())
+ .replace('$subject', formdata._subject)
+ .replace(/\n/g, '<br/>'),
+ this.get_label('restoremessage'),
+ [{
+ text: this.get_label('restore'),
+ click: function(){
+ ref.restore_compose_form(key, html_mode);
+ ref.remove_compose_data(key); // remove old copy
+ ref.save_compose_form_local(); // save under current compose_id
+ $(this).dialog('close');
+ }
+ },
+ {
+ text: this.get_label('delete'),
+ click: function(){
+ ref.remove_compose_data(key);
+ $(this).dialog('close');
+ }
+ },
+ {
+ text: this.get_label('ignore'),
+ click: function(){
+ $(this).dialog('close');
+ }
+ }]
+ );
+ break;
+ }
+ }
+ }
+
if (input_to.val() == '')
input_to.focus();
else if (input_subject.val() == '')
@@ -3100,7 +3199,7 @@ function rcube_webmail()
{
this.env.recipients_delimiter = this.env.recipients_separator + ' ';
- obj[bw.ie || bw.safari || bw.chrome ? 'keydown' : 'keypress'](function(e) { return ref.ksearch_keydown(e, this, props); })
+ obj.keydown(function(e) { return ref.ksearch_keydown(e, this, props); })
.attr('autocomplete', 'off');
};
@@ -3285,6 +3384,154 @@ function rcube_webmail()
return true;
};
+ this.insert_response = function(key)
+ {
+ var insert = this.env.textresponses[key] ? this.env.textresponses[key].text : null;
+ if (!insert)
+ return false;
+
+ // insert into tinyMCE editor
+ if ($("input[name='_is_html']").val() == '1') {
+ var editor = tinyMCE.get(this.env.composebody);
+ editor.getWin().focus(); // correct focus in IE & Chrome
+ editor.selection.setContent(this.quote_html(insert).replace(/\r?\n/g, '<br/>'), { format:'text' });
+ }
+ // replace selection in compose textarea
+ else {
+ var textarea = rcube_find_object(this.env.composebody),
+ selection = $(textarea).is(':focus') ? this.get_input_selection(textarea) : { start:0, end:0 },
+ inp_value = textarea.value;
+ pre = inp_value.substring(0, selection.start),
+ end = inp_value.substring(selection.end, inp_value.length);
+
+ // insert response text
+ textarea.value = pre + insert + end;
+
+ // set caret after inserted text
+ this.set_caret_pos(textarea, selection.start + insert.length);
+ textarea.focus();
+ }
+ };
+
+ /**
+ * Open the dialog to save a new canned response
+ */
+ this.save_response = function()
+ {
+ var sigstart, text = '', strip = false;
+
+ // get selected text from tinyMCE editor
+ if ($("input[name='_is_html']").val() == '1') {
+ var editor = tinyMCE.get(this.env.composebody);
+ editor.getWin().focus(); // correct focus in IE & Chrome
+ text = editor.selection.getContent({ format:'text' });
+
+ if (!text) {
+ text = editor.getContent({ format:'text' });
+ strip = true;
+ }
+ }
+ // get selected text from compose textarea
+ else {
+ var textarea = rcube_find_object(this.env.composebody), sigstart;
+ if (textarea && $(textarea).is(':focus')) {
+ text = this.get_input_selection(textarea).text;
+ }
+
+ if (!text && textarea) {
+ text = textarea.value;
+ strip = true;
+ }
+ }
+
+ // strip off signature
+ if (strip) {
+ sigstart = text.indexOf('-- \n');
+ if (sigstart > 0) {
+ text = text.substring(0, sigstart);
+ }
+ }
+
+ // show dialog to enter a name and to modify the text to be saved
+ var buttons = {},
+ html = '<form class="propform">' +
+ '<div class="prop block"><label>' + this.get_label('responsename') + '</label>' +
+ '<input type="text" name="name" id="ffresponsename" size="40" /></div>' +
+ '<div class="prop block"><label>' + this.get_label('responsetext') + '</label>' +
+ '<textarea name="text" id="ffresponsetext" cols="40" rows="8"></textarea></div>' +
+ '</form>';
+
+ buttons[this.gettext('save')] = function(e) {
+ var name = $('#ffresponsename').val(),
+ text = $('#ffresponsetext').val();
+
+ if (!text) {
+ $('#ffresponsetext').select();
+ return false;
+ }
+ if (!name)
+ name = text.substring(0,40);
+
+ var lock = ref.display_message(ref.get_label('savingresponse'), 'loading');
+ ref.http_post('settings/responses', { _insert:1, _name:name, _text:text }, lock);
+ $(this).dialog('close');
+ };
+
+ buttons[this.gettext('cancel')] = function() {
+ $(this).dialog('close');
+ };
+
+ this.show_popup_dialog(html, this.gettext('savenewresponse'), buttons);
+
+ $('#ffresponsetext').val(text);
+ $('#ffresponsename').select();
+ };
+
+ this.add_response_item = function(response)
+ {
+ var key = response.key;
+ this.env.textresponses[key] = response;
+
+ // append to responses list
+ if (this.gui_objects.responseslist) {
+ var li = $('<li>').appendTo(this.gui_objects.responseslist);
+ $('<a>').addClass('insertresponse active')
+ .attr('href', '#')
+ .attr('rel', key)
+ .html(this.quote_html(response.name))
+ .appendTo(li)
+ .mousedown(function(e){
+ return rcube_event.cancel(e);
+ })
+ .mouseup(function(e){
+ ref.command('insert-response', key);
+ $(document.body).trigger('mouseup'); // hides the menu
+ return rcube_event.cancel(e);
+ });
+ }
+ };
+
+ this.edit_responses = function()
+ {
+ // TODO: implement inline editing of responses
+ };
+
+ this.delete_response = function(key)
+ {
+ if (!key && this.responses_list) {
+ var selection = this.responses_list.get_selection();
+ key = selection[0];
+ }
+
+ // submit delete request
+ if (key && confirm(this.get_label('deleteresponseconfirm'))) {
+ this.http_post('settings/delete-response', { _key: key }, false);
+ return true;
+ }
+
+ return false;
+ };
+
this.stop_spellchecking = function()
{
var ed;
@@ -3361,14 +3608,20 @@ function rcube_webmail()
{
var rc;
- if (!this.env.draft_id && id && (rc = this.opener())) {
- // refresh the drafts folder in opener window
- if (rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == this.env.drafts_mailbox)
- rc.command('checkmail');
+ if (id && id != this.env.draft_id) {
+ if (rc = this.opener()) {
+ // refresh the drafts folder in opener window
+ if (rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == this.env.drafts_mailbox)
+ rc.command('checkmail');
+ }
+
+ this.env.draft_id = id;
+ $("input[name='_draft_saveid']").val(id);
+
}
- this.env.draft_id = id;
- $("input[name='_draft_saveid']").val(id);
+ // always remove local copy upon saving as draft
+ this.remove_compose_data(this.env.compose_id);
};
this.auto_save_start = function()
@@ -3376,6 +3629,20 @@ function rcube_webmail()
if (this.env.draft_autosave)
this.save_timer = setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000);
+ // save compose form content to local storage every 5 seconds
+ if (!this.local_save_timer && window.localStorage) {
+ // track typing activity and only save on changes
+ this.compose_type_activity = this.compose_type_activity_last = 0;
+ $(document).bind('keypress', function(e){ ref.compose_type_activity++; });
+
+ this.local_save_timer = setInterval(function(){
+ if (ref.compose_type_activity > ref.compose_type_activity_last) {
+ ref.save_compose_form_local();
+ ref.compose_type_activity_last = ref.compose_type_activity;
+ }
+ }, 5000);
+ }
+
// Unlock interface now that saving is complete
this.busy = false;
};
@@ -3404,6 +3671,118 @@ function rcube_webmail()
return str;
};
+ // store the contents of the compose form to localstorage
+ this.save_compose_form_local = function()
+ {
+ var formdata = { session:this.env.session_id, changed:new Date().getTime() },
+ ed, empty = true;
+
+ // get fresh content from editor
+ if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody))) {
+ tinyMCE.triggerSave();
+ }
+
+ if (this.env.draft_id) {
+ formdata.draft_id = this.env.draft_id;
+ }
+ if (this.env.reply_msgid) {
+ formdata.reply_msgid = this.env.reply_msgid;
+ }
+
+ $('input, select, textarea', this.gui_objects.messageform).each(function(i, elem) {
+ switch (elem.tagName.toLowerCase()) {
+ case 'input':
+ if (elem.type == 'button' || elem.type == 'submit' || (elem.type == 'hidden' && elem.name != '_is_html')) {
+ break;
+ }
+ formdata[elem.name] = elem.type != 'checkbox' || elem.checked ? $(elem).val() : '';
+
+ if (formdata[elem.name] != '' && elem.type != 'hidden')
+ empty = false;
+ break;
+
+ case 'select':
+ formdata[elem.name] = $('option:checked', elem).val();
+ break;
+
+ default:
+ formdata[elem.name] = $(elem).val();
+ if (formdata[elem.name] != '')
+ empty = false;
+ }
+ });
+
+ if (window.localStorage && !empty) {
+ var index = this.local_storage_get_item('compose.index', []),
+ key = this.env.compose_id;
+
+ if ($.inArray(key, index) < 0) {
+ index.push(key);
+ }
+ this.local_storage_set_item('compose.' + key, formdata, true);
+ this.local_storage_set_item('compose.index', index);
+ }
+ };
+
+ // write stored compose data back to form
+ this.restore_compose_form = function(key, html_mode)
+ {
+ var ed, formdata = this.local_storage_get_item('compose.' + key, true);
+
+ if (formdata && typeof formdata == 'object') {
+ $.each(formdata, function(k, value) {
+ if (k[0] == '_') {
+ var elem = $("*[name='"+k+"']");
+ if (elem[0] && elem[0].type == 'checkbox') {
+ elem.prop('checked', value != '');
+ }
+ else {
+ elem.val(value);
+ }
+ }
+ });
+
+ // initialize HTML editor
+ if (formdata._is_html == '1') {
+ if (!html_mode) {
+ tinyMCE.execCommand('mceAddControl', false, this.env.composebody);
+ this.triggerEvent('aftertoggle-editor', { mode:'html' });
+ }
+ }
+ else if (html_mode) {
+ tinyMCE.execCommand('mceRemoveControl', false, this.env.composebody);
+ this.triggerEvent('aftertoggle-editor', { mode:'plain' });
+ }
+ }
+ };
+
+ // remove stored compose data from localStorage
+ this.remove_compose_data = function(key)
+ {
+ if (window.localStorage) {
+ var index = this.local_storage_get_item('compose.index', []);
+
+ if ($.inArray(key, index) >= 0) {
+ this.local_storage_remove_item('compose.' + key);
+ this.local_storage_set_item('compose.index', $.grep(index, function(val,i) { return val != key; }));
+ }
+ }
+ };
+
+ // clear all stored compose data of this user
+ this.clear_compose_data = function()
+ {
+ if (window.localStorage) {
+ var index = this.local_storage_get_item('compose.index', []);
+
+ for (var i=0; i < index.length; i++) {
+ this.local_storage_remove_item('compose.' + index[i]);
+ }
+ this.local_storage_remove_item('compose.index');
+ }
+ }
+
+
this.change_identity = function(obj, show_sig)
{
if (!obj || !obj.options)
@@ -3559,6 +3938,7 @@ function rcube_webmail()
}
this.env.identity = id;
+ this.triggerEvent('change_identity');
return true;
};
@@ -3835,7 +4215,7 @@ function rcube_webmail()
case 38: // arrow up
case 40: // arrow down
if (!this.ksearch_visible())
- break;
+ return;
var dir = key==38 ? 1 : 0;
@@ -3870,8 +4250,7 @@ function rcube_webmail()
case 37: // left
case 39: // right
- if (mod != SHIFT_KEY)
- return;
+ return;
}
// start timer
@@ -3934,8 +4313,10 @@ function rcube_webmail()
if (this.ksearch_input.setSelectionRange)
this.ksearch_input.setSelectionRange(cpos, cpos);
- if (trigger)
+ if (trigger) {
this.triggerEvent('autocomplete_insert', { field:this.ksearch_input, insert:insert });
+ this.compose_type_activity++;
+ }
};
this.replace_group_recipients = function(id, recipients)
@@ -3944,6 +4325,7 @@ function rcube_webmail()
this.group2expand[id].input.value = this.group2expand[id].input.value.replace(this.group2expand[id].name, recipients);
this.triggerEvent('autocomplete_insert', { field:this.group2expand[id].input, insert:recipients });
this.group2expand[id] = null;
+ this.compose_type_activity++;
}
};
@@ -3990,7 +4372,7 @@ function rcube_webmail()
return;
// ...new search value contains old one and previous search was not finished or its result was empty
- if (old_value && old_value.length && q.indexOf(old_value) == 0 && (!ac || ac.num <= 0) && this.env.contacts && !this.env.contacts.length)
+ if (old_value && old_value.length && q.startsWith(old_value) && (!ac || ac.num <= 0) && this.env.contacts && !this.env.contacts.length)
return;
var i, lock, source, xhr, reqid = new Date().getTime(),
@@ -4628,8 +5010,6 @@ function rcube_webmail()
$('input.datepicker').datepicker();
}
- $("input[type='text']:visible").first().focus();
-
// Submit search form on Enter
if (this.env.action == 'search')
$(this.gui_objects.editform).append($('<input type="submit">').hide())
@@ -4674,6 +5054,7 @@ function rcube_webmail()
{
var key = 'G'+prop.source+prop.id;
if (this.treelist.remove(key)) {
+ this.triggerEvent('group_delete', { source:prop.source, id:prop.id });
delete this.env.contactfolders[key];
delete this.env.contactgroups[key];
}
@@ -5171,9 +5552,8 @@ function rcube_webmail()
target = win;
}
- if (action && (id || action == 'add-identity')) {
- this.set_busy(true);
- this.location_href(url, target);
+ if (id || action == 'add-identity') {
+ this.location_href(url, target, true);
}
return true;
@@ -5210,6 +5590,35 @@ function rcube_webmail()
}
};
+ this.update_response_row = function(response, oldkey)
+ {
+ var list = this.responses_list;
+
+ if (list && oldkey) {
+ list.update_row(oldkey, [ response.name ], response.key, true);
+ }
+ else if (list) {
+ list.insert_row({ id:'rcmrow'+response.key, cols:[ { className:'name', innerHTML:response.name } ] });
+ list.select(response.key);
+ }
+ };
+
+ this.remove_response = function(key)
+ {
+ var frame;
+
+ if (this.env.textresponses) {
+ delete this.env.textresponses[key];
+ }
+
+ if (this.responses_list) {
+ this.responses_list.remove_row(key);
+ if (this.env.contentframe && (frame = this.get_frame_window(this.env.contentframe))) {
+ frame.location.href = this.env.blankpage;
+ }
+ }
+ };
+
/*********************************************************/
/********* folder manager methods *********/
@@ -5217,17 +5626,22 @@ function rcube_webmail()
this.init_subscription_list = function()
{
- var p = this;
+ var p = this, delim = RegExp.escape(this.env.delimiter);
+
+ this.last_sub_rx = RegExp('['+delim+']?[^'+delim+']+$');
+
this.subscription_list = new rcube_list_widget(this.gui_objects.subscriptionlist,
{multiselect:false, draggable:true, keyboard:false, toggleselect:true});
- this.subscription_list.addEventListener('select', function(o){ p.subscription_select(o); });
- this.subscription_list.addEventListener('dragstart', function(o){ p.drag_active = true; });
- this.subscription_list.addEventListener('dragend', function(o){ p.subscription_move_folder(o); });
- this.subscription_list.row_init = function (row) {
- row.obj.onmouseover = function() { p.focus_subscription(row.id); };
- row.obj.onmouseout = function() { p.unfocus_subscription(row.id); };
- };
- this.subscription_list.init();
+ this.subscription_list
+ .addEventListener('select', function(o){ p.subscription_select(o); })
+ .addEventListener('dragstart', function(o){ p.drag_active = true; })
+ .addEventListener('dragend', function(o){ p.subscription_move_folder(o); })
+ .addEventListener('initrow', function (row) {
+ row.obj.onmouseover = function() { p.focus_subscription(row.id); };
+ row.obj.onmouseout = function() { p.unfocus_subscription(row.id); };
+ })
+ .init();
+
$('#mailboxroot')
.mouseover(function(){ p.focus_subscription(this.id); })
.mouseout(function(){ p.unfocus_subscription(this.id); })
@@ -5235,9 +5649,7 @@ function rcube_webmail()
this.focus_subscription = function(id)
{
- var row, folder,
- delim = RegExp.escape(this.env.delimiter),
- reg = RegExp('['+delim+']?[^'+delim+']+$');
+ var row, folder;
if (this.drag_active && this.env.mailbox && (row = document.getElementById(id)))
if (this.env.subscriptionrows[id] &&
@@ -5245,8 +5657,8 @@ function rcube_webmail()
) {
if (this.check_droptarget(folder) &&
!this.env.subscriptionrows[this.get_folder_row_id(this.env.mailbox)][2] &&
- (folder != this.env.mailbox.replace(reg, '')) &&
- (!folder.match(new RegExp('^'+RegExp.escape(this.env.mailbox+this.env.delimiter))))
+ folder != this.env.mailbox.replace(this.last_sub_rx, '') &&
+ !folder.startsWith(this.env.mailbox + this.env.delimiter)
) {
this.env.dstfolder = folder;
$(row).addClass('droptarget');
@@ -5259,7 +5671,8 @@ function rcube_webmail()
var row = $('#'+id);
this.env.dstfolder = null;
- if (this.env.subscriptionrows[id] && row[0])
+
+ if (this.env.subscriptionrows[id] && row.length)
row.removeClass('droptarget');
else
$(this.subscription_list.frame).removeClass('droptarget');
@@ -5285,21 +5698,20 @@ function rcube_webmail()
this.subscription_move_folder = function(list)
{
- var delim = RegExp.escape(this.env.delimiter),
- reg = RegExp('['+delim+']?[^'+delim+']+$');
-
- if (this.env.mailbox && this.env.dstfolder !== null && (this.env.dstfolder != this.env.mailbox) &&
- (this.env.dstfolder != this.env.mailbox.replace(reg, ''))
+ if (this.env.mailbox && this.env.dstfolder !== null &&
+ this.env.dstfolder != this.env.mailbox &&
+ this.env.dstfolder != this.env.mailbox.replace(this.last_sub_rx, '')
) {
- reg = new RegExp('[^'+delim+']*['+delim+']', 'g');
- var basename = this.env.mailbox.replace(reg, ''),
- newname = this.env.dstfolder === '' ? basename : this.env.dstfolder+this.env.delimiter+basename;
+ var path = this.env.mailbox.split(this.env.delimiter),
+ basename = path.pop(),
+ newname = this.env.dstfolder === '' ? basename : this.env.dstfolder + this.env.delimiter + basename;
if (newname != this.env.mailbox) {
this.http_post('rename-folder', {_folder_oldname: this.env.mailbox, _folder_newname: newname}, this.set_busy(true, 'foldermoving'));
this.subscription_list.draglayer.hide();
}
}
+
this.drag_active = false;
this.unfocus_subscription(this.get_folder_row_id(this.env.dstfolder));
};
@@ -5328,7 +5740,7 @@ function rcube_webmail()
if (!this.gui_objects.subscriptionlist)
return false;
- var row, n, i, tmp, tmp_name, folders, rowid, list = [], slist = [],
+ var row, n, i, tmp, tmp_name, rowid, folders = [], list = [], slist = [],
tbody = this.gui_objects.subscriptionlist.tBodies[0],
refrow = $('tr', tbody).get(1),
id = 'rcmrow'+((new Date).getTime());
@@ -5343,8 +5755,7 @@ function rcube_webmail()
row = $(refrow).clone(true);
// set ID, reset css class
- row.attr('id', id);
- row.attr('class', class_name);
+ row.attr({id: id, 'class': class_name});
// set folder name
row.find('td:first').html(display_name);
@@ -5354,12 +5765,27 @@ function rcube_webmail()
.prop({checked: subscribed ? true : false, disabled: is_protected ? true : false});
// add to folder/row-ID map
- this.env.subscriptionrows[id] = [name, display_name, 0];
+ this.env.subscriptionrows[id] = [name, display_name, false];
+
+ // sort folders (to find a place where to insert the row)
+ // replace delimiter with \0 character to fix sorting
+ // issue where 'Abc Abc' would be placed before 'Abc/def'
+ var replace_from = RegExp(RegExp.escape(this.env.delimiter), 'g'),
+ replace_to = String.fromCharCode(0);
+
+ $.each(this.env.subscriptionrows, function(k,v) {
+ if (v.length < 4) {
+ var n = v[0];
+ n = n.replace(replace_from, replace_to);
+ v.push(n);
+ }
+ folders.push(v);
+ });
- // sort folders, to find a place where to insert the row
- folders = [];
- $.each(this.env.subscriptionrows, function(k,v){ folders.push(v) });
- folders.sort(function(a,b){ return a[0] < b[0] ? -1 : (a[0] > b[0] ? 1 : 0) });
+ folders.sort(function(a, b) {
+ var len = a.length - 1; n1 = a[len], n2 = b[len];
+ return n1 < n2 ? -1 : 1;
+ });
for (n in folders) {
// protected folder
@@ -5372,7 +5798,7 @@ function rcube_webmail()
tmp = tmp_name;
}
// protected folder's child
- else if (tmp && folders[n][0].indexOf(tmp) == 0)
+ else if (tmp && folders[n][0].startsWith(tmp))
slist.push(folders[n][0]);
// other
else {
@@ -5383,7 +5809,7 @@ function rcube_webmail()
// check if subfolder of a protected folder
for (n=0; n<slist.length; n++) {
- if (name.indexOf(slist[n]+this.env.delimiter) == 0)
+ if (name.startsWith(slist[n] + this.env.delimiter))
rowid = this.get_folder_row_id(slist[n]);
}
@@ -5414,18 +5840,28 @@ function rcube_webmail()
// replace an existing table row with a new folder line (with subfolders)
this.replace_folder_row = function(oldfolder, newfolder, display_name, is_protected, class_name)
{
- if (!this.gui_objects.subscriptionlist)
+ if (!this.gui_objects.subscriptionlist) {
+ if (this.is_framed)
+ return parent.rcmail.replace_folder_row(oldfolder, newfolder, display_name, is_protected, class_name);
return false;
+ }
var i, n, len, name, dispname, oldrow, tmprow, row, level,
tbody = this.gui_objects.subscriptionlist.tBodies[0],
folders = this.env.subscriptionrows,
id = this.get_folder_row_id(oldfolder),
- regex = new RegExp('^'+RegExp.escape(oldfolder)),
+ prefix_len = oldfolder.length,
subscribed = $('input[name="_subscribed[]"]', $('#'+id)).prop('checked'),
// find subfolders of renamed folder
list = this.get_subfolders(oldfolder);
+ // no renaming, only update class_name
+ if (oldfolder == newfolder) {
+ $('#'+id).attr('class', class_name || '');
+ this.subscription_list.focus();
+ return;
+ }
+
// replace an existing table row
this._remove_folder_row(id);
row = $(this.add_folder_row(newfolder, display_name, is_protected, subscribed, true, class_name));
@@ -5446,7 +5882,7 @@ function rcube_webmail()
row.after(tmprow);
row = tmprow;
// update folder index
- name = name.replace(regex, newfolder);
+ name = newfolder + name.slice(prefix_len);
$('input[name="_subscribed[]"]', row).val(name);
this.env.subscriptionrows[id][0] = name;
// update the name if level is changed
@@ -5495,13 +5931,13 @@ function rcube_webmail()
this.get_subfolders = function(folder)
{
var name, list = [],
- regex = new RegExp('^'+RegExp.escape(folder)+RegExp.escape(this.env.delimiter)),
+ prefix = folder + this.env.delimiter,
row = $('#'+this.get_folder_row_id(folder)).get(0);
while (row = row.nextSibling) {
if (row.id) {
name = this.env.subscriptionrows[row.id][0];
- if (regex.test(name)) {
+ if (name && name.startsWith(prefix)) {
list.push(row.id);
}
else
@@ -5691,59 +6127,36 @@ function rcube_webmail()
// mouse over button
this.button_over = function(command, id)
{
- var n, button, obj, a_buttons = this.buttons[command],
- len = a_buttons ? a_buttons.length : 0;
-
- for (n=0; n<len; n++) {
- button = a_buttons[n];
- if (button.id == id && button.status == 'act') {
- obj = document.getElementById(button.id);
- if (obj && button.over) {
- if (button.type == 'image')
- obj.src = button.over;
- else
- obj.className = button.over;
- }
- }
- }
+ this.button_event(command, id, 'over');
};
// mouse down on button
this.button_sel = function(command, id)
{
- var n, button, obj, a_buttons = this.buttons[command],
- len = a_buttons ? a_buttons.length : 0;
-
- for (n=0; n<len; n++) {
- button = a_buttons[n];
- if (button.id == id && button.status == 'act') {
- obj = document.getElementById(button.id);
- if (obj && button.sel) {
- if (button.type == 'image')
- obj.src = button.sel;
- else
- obj.className = button.sel;
- }
- this.buttons_sel[id] = command;
- }
- }
+ this.button_event(command, id, 'sel');
};
// mouse out of button
this.button_out = function(command, id)
{
+ this.button_event(command, id, 'act');
+ };
+
+ // event of button
+ this.button_event = function(command, id, event)
+ {
var n, button, obj, a_buttons = this.buttons[command],
len = a_buttons ? a_buttons.length : 0;
for (n=0; n<len; n++) {
button = a_buttons[n];
if (button.id == id && button.status == 'act') {
- obj = document.getElementById(button.id);
- if (obj && button.act) {
- if (button.type == 'image')
- obj.src = button.act;
- else
- obj.className = button.act;
+ if (button[event] && (obj = document.getElementById(button.id))) {
+ obj[button.type == 'image' ? 'src' : 'className'] = button[event];
+ }
+
+ if (event == 'sel') {
+ this.buttons_sel[id] = command;
}
}
}
@@ -5818,7 +6231,7 @@ function rcube_webmail()
this.triggerEvent('message', { message:msg, type:type, timeout:timeout, object:obj });
if (timeout > 0)
- setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout);
+ setTimeout(function() { ref.hide_message(id, type != 'loading'); }, timeout);
return id;
};
@@ -5898,24 +6311,23 @@ function rcube_webmail()
};
// open a jquery UI dialog with the given content
- this.show_popup_dialog = function(html, title, buttons)
+ this.show_popup_dialog = function(html, title, buttons, options)
{
// forward call to parent window
if (this.is_framed()) {
- parent.rcmail.show_popup_dialog(html, title, buttons);
- return;
+ return parent.rcmail.show_popup_dialog(html, title, buttons, options);
}
var popup = $('<div class="popup">')
.html(html)
- .dialog({
+ .dialog($.extend({
title: title,
buttons: buttons,
modal: true,
resizable: true,
width: 500,
close: function(event, ui) { $(this).remove() }
- });
+ }, options || {}));
// resize and center popup
var win = $(window), w = win.width(), h = win.height(),
@@ -5923,15 +6335,17 @@ function rcube_webmail()
popup.dialog('option', {
height: Math.min(h - 40, height + 75 + (buttons ? 50 : 0)),
- width: Math.min(w - 20, width + 20)
+ width: Math.min(w - 20, width + 36)
});
+
+ return popup;
};
// enable/disable buttons for page shifting
this.set_page_buttons = function()
{
- this.enable_command('nextpage', 'lastpage', (this.env.pagecount > this.env.current_page));
- this.enable_command('previouspage', 'firstpage', (this.env.current_page > 1));
+ this.enable_command('nextpage', 'lastpage', this.env.pagecount > this.env.current_page);
+ this.enable_command('previouspage', 'firstpage', this.env.current_page > 1);
};
// mark a mailbox as selected and set environment variable
@@ -5941,14 +6355,10 @@ function rcube_webmail()
this.treelist.select(name);
}
else if (this.gui_objects.folderlist) {
- var current_li, target_li;
-
- if ((current_li = $('li.selected', this.gui_objects.folderlist))) {
- current_li.removeClass('selected').addClass('unfocused');
- }
- if ((target_li = this.get_folder_li(name, prefix, encode))) {
- $(target_li).removeClass('unfocused').addClass('selected');
- }
+ $('li.selected', this.gui_objects.folderlist)
+ .removeClass('selected').addClass('unfocused');
+ $(this.get_folder_li(name, prefix, encode))
+ .removeClass('unfocused').addClass('selected');
// trigger event hook
this.triggerEvent('selectfolder', { folder:name, prefix:prefix });
@@ -5959,12 +6369,14 @@ function rcube_webmail()
this.mark_folder = function(name, class_name, prefix, encode)
{
$(this.get_folder_li(name, prefix, encode)).addClass(class_name);
+ this.triggerEvent('markfolder', {folder: name, mark: class_name, status: true});
};
// adds a class to selected folder
this.unmark_folder = function(name, class_name, prefix, encode)
{
$(this.get_folder_li(name, prefix, encode)).removeClass(class_name);
+ this.triggerEvent('markfolder', {folder: name, mark: class_name, status: false});
};
// helper method to find a folder list item
@@ -5977,8 +6389,6 @@ function rcube_webmail()
name = this.html_identifier(name, encode);
return document.getElementById(prefix+name);
}
-
- return null;
};
// for reordering column array (Konqueror workaround)
@@ -6070,6 +6480,12 @@ function rcube_webmail()
this.env.quota_content = content;
};
+ // update trash folder state
+ this.set_trash_count = function(count)
+ {
+ this[(count ? 'un' : '') + 'mark_folder'](this.env.trash_mailbox, 'empty', '', true);
+ };
+
// update the mailboxlist
this.set_unread_count = function(mbox, count, set_title, mark)
{
@@ -6103,7 +6519,7 @@ function rcube_webmail()
div.className.match(/collapsed/)) {
// add children's counters
for (var k in this.env.unread_counts)
- if (k.indexOf(mbox + this.env.delimiter) == 0)
+ if (k.startsWith(mbox + this.env.delimiter))
childcount += this.env.unread_counts[k];
}
@@ -6176,6 +6592,105 @@ function rcube_webmail()
elem.onclick = function() { rcmail.command('show-headers', '', elem); };
};
+ // create folder selector popup, position and display it
+ this.folder_selector = function(obj, callback)
+ {
+ var container = this.folder_selector_element;
+
+ if (!container) {
+ var rows = [],
+ delim = this.env.delimiter,
+ ul = $('<ul class="toolbarmenu iconized">'),
+ li = document.createElement('li'),
+ link = document.createElement('a'),
+ span = document.createElement('span');
+
+ container = $('<div id="folder-selector" class="popupmenu"></div>');
+ link.href = '#';
+ link.className = 'icon';
+
+ // loop over sorted folders list
+ $.each(this.env.mailboxes_list, function() {
+ var tmp, n = 0, s = 0,
+ folder = ref.env.mailboxes[this],
+ id = folder.id,
+ a = link.cloneNode(false), row = li.cloneNode(false);
+
+ if (folder.virtual)
+ a.className += ' virtual';
+ else {
+ a.className += ' active';
+ a.onclick = function() { container.hide().data('callback')(folder.id); };
+ }
+
+ if (folder['class'])
+ a.className += ' ' + folder['class'];
+
+ // calculate/set indentation level
+ while ((s = id.indexOf(delim, s)) >= 0) {
+ n++; s++;
+ }
+ a.style.paddingLeft = n ? (n * 16) + 'px' : 0;
+
+ // add folder name element
+ tmp = span.cloneNode(false);
+ $(tmp).text(folder.name);
+ a.appendChild(tmp);
+
+ row.appendChild(a);
+ rows.push(row);
+ });
+
+ ul.append(rows).appendTo(container);
+
+ // temporarily show element to calculate its size
+ container.css({left: '-1000px', top: '-1000px'})
+ .appendTo($('body')).show();
+
+ // set max-height if the list is long
+ if (rows.length > 10)
+ container.css('max-height', $('li', container)[0].offsetHeight * 10 + 9)
+
+ // hide selector on click out of selector element
+ var fn = function(e) { if (e.target != container.get(0)) container.hide(); };
+ $(document.body).on('mouseup', fn);
+ $('iframe').contents().on('mouseup', fn)
+ .load(function(e) { try { $(this).contents().on('mouseup', fn); } catch(e) {}; });
+
+ this.folder_selector_element = container;
+ }
+
+ // position menu on the screen
+ this.element_position(container, obj);
+
+ container.show().data('callback', callback);
+ };
+
+ // position a menu element on the screen in relation to other object
+ this.element_position = function(element, obj)
+ {
+ var obj = $(obj), win = $(window),
+ width = obj.width(),
+ height = obj.height(),
+ win_height = win.height(),
+ elem_height = $(element).height(),
+ elem_width = $(element).width(),
+ pos = obj.offset(),
+ top = pos.top,
+ left = pos.left + width;
+
+ if (top + elem_height > win_height) {
+ top -= elem_height - height;
+ if (top < 0)
+ top = Math.max(0, (win_height - elem_height) / 2);
+ }
+
+ if (left + elem_width > win.width())
+ left -= elem_width + width;
+
+ element.css({left: left + 'px', top: top + 'px'});
+ };
+
/********************************************************/
/********* html to text conversion functions *********/
@@ -6297,7 +6812,7 @@ function rcube_webmail()
if (result === false)
return false;
else
- query = result;
+ url = this.url(action, result);
}
url += '&_remote=1';
@@ -6445,6 +6960,16 @@ function rcube_webmail()
case 'refresh':
case 'check-recent':
+ // update message flags
+ $.each(this.env.recent_flags || {}, function(uid, flags) {
+ ref.set_message(uid, 'deleted', flags.deleted);
+ ref.set_message(uid, 'replied', flags.answered);
+ ref.set_message(uid, 'unread', !flags.seen);
+ ref.set_message(uid, 'forwarded', flags.forwarded);
+ ref.set_message(uid, 'flagged', flags.flagged);
+ });
+ delete this.env.recent_flags;
+
case 'getunread':
case 'search':
this.env.qsearch = null;
@@ -6457,7 +6982,6 @@ function rcube_webmail()
if ((response.action == 'list' || response.action == 'search') && this.message_list) {
this.msglist_select(this.message_list);
- this.message_list.resize();
this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:this.message_list.rowcount });
}
}
@@ -6468,7 +6992,6 @@ function rcube_webmail()
this.enable_command('search-create', this.env.source == '');
this.enable_command('search-delete', this.env.search_id);
this.update_group_commands();
- this.contact_list.resize();
this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount });
}
}
@@ -6522,6 +7045,20 @@ function rcube_webmail()
setTimeout(function(){ ref.keep_alive(); ref.start_keepalive(); }, 30000);
};
+ // handler for session errors detected on the server
+ this.session_error = function(redirect_url)
+ {
+ this.env.server_error = 401;
+
+ // save message in local storage and do not redirect
+ if (this.env.action == 'compose') {
+ this.save_compose_form_local();
+ }
+ else if (redirect_url) {
+ window.setTimeout(function(){ ref.redirect(redirect_url, true); }, 2000);
+ }
+ };
+
// callback when an iframe finished loading
this.iframe_loaded = function(unlock)
{
@@ -6534,7 +7071,7 @@ function rcube_webmail()
// post the given form to a hidden iframe
this.async_upload_form = function(form, action, onload)
{
- var ts = new Date().getTime(),
+ var frame, ts = new Date().getTime(),
frame_name = 'rcmupload'+ts;
// upload progress support
@@ -6553,21 +7090,19 @@ function rcube_webmail()
// have to do it this way for IE
// otherwise the form will be posted to a new window
if (document.all) {
- var html = '<iframe name="'+frame_name+'" src="program/resources/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>';
- document.body.insertAdjacentHTML('BeforeEnd', html);
+ document.body.insertAdjacentHTML('BeforeEnd', '<iframe name="'+frame_name+'"'
+ + ' src="program/resources/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>');
+ frame = $('iframe[name="'+frame_name+'"]');
}
- else { // for standards-compilant browsers
- var frame = document.createElement('iframe');
- frame.name = frame_name;
- frame.style.border = 'none';
- frame.style.width = 0;
- frame.style.height = 0;
- frame.style.visibility = 'hidden';
- document.body.appendChild(frame);
+ // for standards-compliant browsers
+ else {
+ frame = $('<iframe>').attr('name', frame_name)
+ .css({border: 'none', width: 0, height: 0, visibility: 'hidden'})
+ .appendTo(document.body);
}
// handle upload errors, parsing iframe content in onload
- $(frame_name).bind('load', {ts:ts}, onload);
+ frame.bind('load', {ts:ts}, onload);
$(form).attr({
target: frame_name,
@@ -6744,6 +7279,9 @@ function rcube_webmail()
if (this.task == 'mail' && this.gui_objects.mailboxlist)
params = this.check_recent_params();
+ params._last = Math.floor(this.env.lastrefresh.getTime() / 1000);
+ this.env.lastrefresh = new Date();
+
// plugins should bind to 'requestrefresh' event to add own params
this.http_request('refresh', params, lock);
};
@@ -6755,13 +7293,18 @@ function rcube_webmail()
if (this.gui_objects.mailboxlist)
params._folderlist = 1;
- if (this.gui_objects.messagelist)
- params._list = 1;
if (this.gui_objects.quotadisplay)
params._quota = 1;
if (this.env.search_request)
params._search = this.env.search_request;
+ if (this.gui_objects.messagelist) {
+ params._list = 1;
+
+ // message uids for flag updates check
+ params._uids = $.map(this.message_list.rows, function(row, uid) { return uid; }).join(',');
+ }
+
return params;
};
@@ -6770,6 +7313,14 @@ function rcube_webmail()
/********* helper methods *********/
/********************************************************/
+ /**
+ * Quote html entities
+ */
+ this.quote_html = function(str)
+ {
+ return String(str).replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
+ };
+
// get window.opener.rcmail if available
this.opener = function()
{
@@ -6834,6 +7385,57 @@ function rcube_webmail()
}
};
+ // get selected text from an input field
+ // http://stackoverflow.com/questions/7186586/how-to-get-the-selected-text-in-textarea-using-jquery-in-internet-explorer-7
+ this.get_input_selection = function(obj)
+ {
+ var start = 0, end = 0,
+ normalizedValue, range,
+ textInputRange, len, endRange;
+
+ if (typeof obj.selectionStart == "number" && typeof obj.selectionEnd == "number") {
+ normalizedValue = obj.value;
+ start = obj.selectionStart;
+ end = obj.selectionEnd;
+ }
+ else {
+ range = document.selection.createRange();
+
+ if (range && range.parentElement() == obj) {
+ len = obj.value.length;
+ normalizedValue = obj.value; //.replace(/\r\n/g, "\n");
+
+ // create a working TextRange that lives only in the input
+ textInputRange = obj.createTextRange();
+ textInputRange.moveToBookmark(range.getBookmark());
+
+ // Check if the start and end of the selection are at the very end
+ // of the input, since moveStart/moveEnd doesn't return what we want
+ // in those cases
+ endRange = obj.createTextRange();
+ endRange.collapse(false);
+
+ if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
+ start = end = len;
+ }
+ else {
+ start = -textInputRange.moveStart("character", -len);
+ start += normalizedValue.slice(0, start).split("\n").length - 1;
+
+ if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
+ end = len;
+ }
+ else {
+ end = -textInputRange.moveEnd("character", -len);
+ end += normalizedValue.slice(0, end).split("\n").length - 1;
+ }
+ }
+ }
+ }
+
+ return { start:start, end:end, text:normalizedValue.substr(start, end-start) };
+ };
+
// disable/enable all fields of a form
this.lock_form = function(form, lock)
{
@@ -6983,7 +7585,37 @@ function rcube_webmail()
this.set_cookie = function(name, value, expires)
{
setCookie(name, value, expires, this.env.cookie_path, this.env.cookie_domain, this.env.cookie_secure);
- }
+ };
+
+ this.get_local_storage_prefix = function()
+ {
+ if (!this.local_storage_prefix)
+ this.local_storage_prefix = 'roundcube.' + (this.env.user_id || 'anonymous') + '.';
+
+ return this.local_storage_prefix;
+ };
+
+ // wrapper for localStorage.getItem(key)
+ this.local_storage_get_item = function(key, deflt, encrypted)
+ {
+
+ // TODO: add encryption
+ var item = localStorage.getItem(this.get_local_storage_prefix() + key);
+ return item !== null ? JSON.parse(item) : (deflt || null);
+ };
+
+ // wrapper for localStorage.setItem(key, data)
+ this.local_storage_set_item = function(key, data, encrypted)
+ {
+ // TODO: add encryption
+ return localStorage.setItem(this.get_local_storage_prefix() + key, JSON.stringify(data));
+ };
+
+ // wrapper for localStorage.removeItem(key)
+ this.local_storage_remove_item = function(key)
+ {
+ return localStorage.removeItem(this.get_local_storage_prefix() + key);
+ };
} // end object rcube_webmail
diff --git a/program/js/common.js b/program/js/common.js
index afaf91639..722eb3f60 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -37,47 +37,48 @@ function roundcube_browser()
this.vendver = n.vendorSub ? parseFloat(n.vendorSub) : 0;
this.product = n.product ? n.product : '';
this.platform = String(n.platform).toLowerCase();
- this.lang = (n.language) ? n.language.substring(0,2) :
- (n.browserLanguage) ? n.browserLanguage.substring(0,2) :
- (n.systemLanguage) ? n.systemLanguage.substring(0,2) : 'en';
+ this.lang = n.language ? n.language.substring(0,2) :
+ n.browserLanguage ? n.browserLanguage.substring(0,2) :
+ n.systemLanguage ? n.systemLanguage.substring(0,2) : 'en';
- this.win = (this.platform.indexOf('win') >= 0);
- this.mac = (this.platform.indexOf('mac') >= 0);
- this.linux = (this.platform.indexOf('linux') >= 0);
- this.unix = (this.platform.indexOf('unix') >= 0);
+ this.win = this.platform.indexOf('win') >= 0;
+ this.mac = this.platform.indexOf('mac') >= 0;
+ this.linux = this.platform.indexOf('linux') >= 0;
+ this.unix = this.platform.indexOf('unix') >= 0;
this.dom = document.getElementById ? true : false;
- this.dom2 = (document.addEventListener && document.removeEventListener);
-
- this.ie = (document.all && !window.opera);
- this.ie4 = (this.ie && !this.dom);
- this.ie5 = (this.dom && this.appver.indexOf('MSIE 5')>0);
- this.ie8 = (this.dom && this.appver.indexOf('MSIE 8')>0);
- this.ie9 = (this.dom && this.appver.indexOf('MSIE 9')>0);
- this.ie7 = (this.dom && this.appver.indexOf('MSIE 7')>0);
- this.ie6 = (this.dom && !this.ie8 && !this.ie7 && this.appver.indexOf('MSIE 6')>0);
-
- this.ns = ((this.ver < 5 && this.name == 'Netscape') || (this.ver >= 5 && this.vendor.indexOf('Netscape') >= 0));
- this.chrome = (this.agent_lc.indexOf('chrome') > 0);
- this.safari = (!this.chrome && (this.agent_lc.indexOf('safari') > 0 || this.agent_lc.indexOf('applewebkit') > 0));
- this.konq = (this.agent_lc.indexOf('konqueror') > 0);
- this.mz = (this.dom && !this.ie && !this.ns && !this.chrome && !this.safari && !this.konq && this.agent.indexOf('Mozilla') >= 0);
- this.iphone = (this.safari && (this.agent_lc.indexOf('iphone') > 0 || this.agent_lc.indexOf('ipod') > 0));
- this.ipad = (this.safari && this.agent_lc.indexOf('ipad') > 0);
- this.opera = window.opera ? true : false;
-
- if (this.opera && window.RegExp)
- this.vendver = (/opera(\s|\/)([0-9\.]+)/.test(this.agent_lc)) ? parseFloat(RegExp.$2) : -1;
- else if (this.chrome && window.RegExp)
- this.vendver = (/chrome\/([0-9\.]+)/.test(this.agent_lc)) ? parseFloat(RegExp.$1) : 0;
- else if (!this.vendver && this.safari)
- this.vendver = (/(safari|applewebkit)\/([0-9]+)/.test(this.agent_lc)) ? parseInt(RegExp.$2) : 0;
- else if ((!this.vendver && this.mz) || this.agent.indexOf('Camino')>0)
- this.vendver = (/rv:([0-9\.]+)/.test(this.agent)) ? parseFloat(RegExp.$1) : 0;
- else if (this.ie && window.RegExp)
- this.vendver = (/msie\s+([0-9\.]+)/.test(this.agent_lc)) ? parseFloat(RegExp.$1) : 0;
- else if (this.konq && window.RegExp)
- this.vendver = (/khtml\/([0-9\.]+)/.test(this.agent_lc)) ? parseFloat(RegExp.$1) : 0;
+ this.dom2 = document.addEventListener && document.removeEventListener;
+
+ this.webkit = this.agent_lc.indexOf('applewebkit') > 0;
+ this.ie = (document.all && !window.opera) || (this.win && this.agent_lc.indexOf('trident/') > 0);
+
+ if (this.ie) {
+ this.ie6 = this.appver.indexOf('MSIE 6') > 0;
+ this.ie7 = this.appver.indexOf('MSIE 7') > 0;
+ this.ie8 = this.appver.indexOf('MSIE 8') > 0;
+ this.ie9 = this.appver.indexOf('MSIE 9') > 0;
+ }
+ else if (window.opera) {
+ this.opera = true;
+ this.vendver = opera.version();
+ }
+ else {
+ this.chrome = this.agent_lc.indexOf('chrome') > 0;
+ this.safari = !this.chrome && (this.webkit || this.agent_lc.indexOf('safari') > 0);
+ this.konq = this.agent_lc.indexOf('konqueror') > 0;
+ this.mz = this.dom && !this.chrome && !this.safari && !this.konq && this.agent.indexOf('Mozilla') >= 0;
+ this.iphone = this.safari && (this.agent_lc.indexOf('iphone') > 0 || this.agent_lc.indexOf('ipod') > 0);
+ this.ipad = this.safari && this.agent_lc.indexOf('ipad') > 0;
+ }
+
+ if (!this.vendver) {
+ // common version strings
+ this.vendver = /(opera|opr|khtml|chrome|safari|applewebkit|msie)(\s|\/)([0-9\.]+)/.test(this.agent_lc) ? parseFloat(RegExp.$3) : 0;
+
+ // any other (Mozilla, Camino, IE>=11)
+ if (!this.vendver)
+ this.vendver = /rv:([0-9\.]+)/.test(this.agent) ? parseFloat(RegExp.$1) : 0;
+ }
// get real language out of safari's user agent
if (this.safari && (/;\s+([a-z]{2})-[a-z]{2}\)/.test(this.agent_lc)))
@@ -86,11 +87,6 @@ function roundcube_browser()
this.tablet = /ipad|android|xoom|sch-i800|playbook|tablet|kindle/i.test(this.agent_lc);
this.mobile = /iphone|ipod|blackberry|iemobile|opera mini|opera mobi|mobile/i.test(this.agent_lc);
this.touch = this.mobile || this.tablet;
- this.dhtml = ((this.ie4 && this.win) || this.ie5 || this.ie6 || this.ns4 || this.mz);
- this.vml = (this.win && this.ie && this.dom && !this.opera);
- this.pngalpha = (this.mz || (this.opera && this.vendver >= 6) || (this.ie && this.mac && this.vendver >= 5) ||
- (this.ie && this.win && this.vendver >= 5.5) || this.safari);
- this.opacity = (this.mz || (this.ie && this.vendver >= 5.5 && !this.opera) || (this.safari && this.vendver >= 100));
this.cookies = n.cookieEnabled;
// test for XMLHTTP support
@@ -124,7 +120,7 @@ function roundcube_browser()
classname += ' iphone';
else if (this.ipad)
classname += ' ipad';
- else if (this.safari || this.chrome)
+ else if (this.webkit)
classname += ' webkit';
if (this.mobile)
@@ -293,7 +289,6 @@ rcube_event_engine.prototype = {
*
* @param {String} Event name
* @param {Function} Handler function
- * @return Listener ID (used to remove this handler later on)
*/
addEventListener: function(evt, func, obj)
{
@@ -303,6 +298,8 @@ addEventListener: function(evt, func, obj)
this._events[evt] = [];
this._events[evt].push({func:func, obj:obj ? obj : window});
+
+ return this; // chainable
},
/**
@@ -592,6 +589,14 @@ Date.prototype.getStdTimezoneOffset = function()
return tzo;
}
+// define String's startsWith() method for old browsers
+if (!String.prototype.startsWith) {
+ String.prototype.startsWith = function(search, position) {
+ position = position || 0;
+ return this.slice(position, search.length) === search;
+ };
+}
+
// Make getElementById() case-sensitive on IE
if (bw.ie) {
document._getElementById = document.getElementById;
diff --git a/program/js/editor.js b/program/js/editor.js
index 6d7b9538a..df3d41240 100644
--- a/program/js/editor.js
+++ b/program/js/editor.js
@@ -61,6 +61,9 @@ function rcmail_editor_init(config)
if (!active)
rcmail.spellcheck_state();
});
+ ed.onKeyPress.add(function(ed, e) {
+ rcmail.compose_type_activity++;
+ });
}
}
@@ -161,8 +164,8 @@ function rcmail_editor_images()
for (i in files) {
att = files[i];
- if (att.complete && att.mimetype.indexOf('image/') == 0) {
- list.push([att.name, rcmail.env.comm_path+'&_action=display-attachment&_file='+i+'&_id='+rcmail.env.compose_id]);
+ if (att.complete && att.mimetype.startsWith('image/')) {
+ list.push([att.name, rcmail.env.comm_path+'&_id='+rcmail.env.compose_id+'&_action=display-attachment&_file='+i]);
}
}
diff --git a/program/js/jquery.min.js b/program/js/jquery.min.js
index 83589daa7..73f33fb3a 100644
--- a/program/js/jquery.min.js
+++ b/program/js/jquery.min.js
@@ -1,2 +1,4 @@
-/*! jQuery v1.8.3 jquery.com | jquery.org/license */
-(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file
+/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
+}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
+},a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
diff --git a/program/js/list.js b/program/js/list.js
index cb69bc462..d54b59d24 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -20,7 +20,7 @@
/**
* Roundcube List Widget class
- * @contructor
+ * @constructor
*/
function rcube_list_widget(list, p)
{
@@ -31,10 +31,7 @@ function rcube_list_widget(list, p)
this.list = list ? list : null;
this.tagname = this.list ? this.list.nodeName.toLowerCase() : 'table';
- this.thead;
- this.tbody;
- this.fixed_header;
- this.frame = null;
+ this.id_regexp = /^rcmrow([a-z0-9\-_=\+\/]+)/i;
this.rows = {};
this.selection = [];
this.rowcount = 0;
@@ -55,7 +52,6 @@ function rcube_list_widget(list, p)
this.column_fixed = null;
this.last_selected = 0;
this.shift_start = 0;
- this.in_selection_before = false;
this.focused = false;
this.drag_mouse_start = null;
this.dblclick_time = 500; // default value on MS Windows is 500
@@ -91,8 +87,7 @@ init: function()
var r, len, rows = this.tbody.childNodes;
for (r=0, len=rows.length; r<len; r++) {
- this.init_row(rows[r]);
- this.rowcount++;
+ this.rowcount += this.init_row(rows[r]) ? 1 : 0;
}
this.init_header();
@@ -102,6 +97,8 @@ init: function()
if (this.keyboard)
rcube_event.add_listener({event:'keydown', object:this, method:'key_press'});
}
+
+ return this;
},
@@ -111,7 +108,7 @@ init: function()
init_row: function(row)
{
// make references in internal array and set event handlers
- if (row && String(row.id).match(/^rcmrow([a-z0-9\-_=\+\/]+)/i)) {
+ if (row && String(row.id).match(this.id_regexp)) {
var self = this,
uid = RegExp.$1;
row.uid = uid;
@@ -148,6 +145,8 @@ init_row: function(row)
this.row_init(this.rows[uid]); // legacy support
this.triggerEvent('initrow', this.rows[uid]);
+
+ return true;
}
},
@@ -196,6 +195,12 @@ init_fixed_header: function()
var me = this;
$(window).resize(function(){ me.resize() });
+ $(window).scroll(function(){
+ var w = $(window);
+ me.fixed_header.css('marginLeft', (-w.scrollLeft()) + 'px');
+ if (!bw.webkit)
+ me.fixed_header.css('marginTop', (-w.scrollTop()) + 'px');
+ });
}
else {
$(this.fixed_header).find('thead').replaceWith(clone);
@@ -222,6 +227,8 @@ resize: function()
$(this.thead).find('tr td').each(function(index) {
$(this).css('width', column_widths[index]);
});
+
+ $(window).scroll();
},
/**
@@ -248,6 +255,9 @@ clear: function(sel)
// reset scroll position (in Opera)
if (this.frame)
this.frame.scrollTop = 0;
+
+ // fix list header after removing any rows
+ this.resize();
},
@@ -256,7 +266,7 @@ clear: function(sel)
*/
remove_row: function(uid, sel_next)
{
- var node = this.rows[uid] ? this.rows[uid].obj : null;
+ var self = this, node = this.rows[uid] ? this.rows[uid].obj : null;
if (!node)
return;
@@ -268,6 +278,10 @@ remove_row: function(uid, sel_next)
delete this.rows[uid];
this.rowcount--;
+
+ // fix list header after removing any rows
+ clearTimeout(this.resize_timeout)
+ this.resize_timeout = setTimeout(function() { self.resize(); }, 50);
},
@@ -276,7 +290,7 @@ remove_row: function(uid, sel_next)
*/
insert_row: function(row, before)
{
- var tbody = this.tbody;
+ var self = this, tbody = this.tbody;
// create a real dom node first
if (row.nodeName === undefined) {
@@ -304,6 +318,10 @@ insert_row: function(row, before)
this.init_row(row);
this.rowcount++;
+
+ // fix list header after adding any rows
+ clearTimeout(this.resize_timeout)
+ this.resize_timeout = setTimeout(function() { self.resize(); }, 50);
},
/**
@@ -347,7 +365,7 @@ focus: function(e)
// Un-focus already focused elements (#1487123, #1487316, #1488600, #1488620)
// It looks that window.focus() does the job for all browsers, but not Firefox (#1489058)
- $(':focus:not(body)').blur();
+ $('iframe,:focus:not(body)').blur();
window.focus();
if (e || (e = window.event))
@@ -405,10 +423,7 @@ drag_column: function(e, col)
drag_row: function(e, id)
{
// don't do anything (another action processed before)
- var evtarget = rcube_event.get_target(e),
- tagname = evtarget.tagName.toLowerCase();
-
- if (evtarget && (tagname == 'input' || tagname == 'img' || (tagname != 'a' && evtarget.onclick)))
+ if (!this.is_event_target(e))
return true;
// accept right-clicks
@@ -420,12 +435,13 @@ drag_row: function(e, id)
// selects currently unselected row
if (!this.in_selection_before) {
var mod_key = rcube_event.get_modifier(e);
- this.select_row(id, mod_key, false);
+ this.select_row(id, mod_key, true);
}
if (this.draggable && this.selection.length && this.in_selection(id)) {
this.drag_start = true;
this.drag_mouse_start = rcube_event.get_mouse_pos(e);
+
rcube_event.add_listener({event:'mousemove', object:this, method:'drag_mouse_move'});
rcube_event.add_listener({event:'mouseup', object:this, method:'drag_mouse_up'});
if (bw.touch) {
@@ -446,19 +462,16 @@ drag_row: function(e, id)
*/
click_row: function(e, id)
{
- var now = new Date().getTime(),
- mod_key = rcube_event.get_modifier(e),
- evtarget = rcube_event.get_target(e),
- tagname = evtarget.tagName.toLowerCase();
-
- if ((evtarget && (tagname == 'input' || tagname == 'img')))
+ // don't do anything (another action processed before)
+ if (!this.is_event_target(e))
return true;
- var dblclicked = now - this.rows[id].clicked < this.dblclick_time;
+ var now = new Date().getTime(),
+ dblclicked = now - this.rows[id].clicked < this.dblclick_time;
// unselects currently selected row
- if (!this.drag_active && this.in_selection_before == id && !dblclicked)
- this.select_row(id, mod_key, false);
+ if (!this.drag_active && !dblclicked && this.in_selection_before == id)
+ this.select_row(id, rcube_event.get_modifier(e), true);
this.drag_start = false;
this.in_selection_before = false;
@@ -482,6 +495,18 @@ click_row: function(e, id)
},
+/**
+ * Check target of the current event
+ */
+is_event_target: function(e)
+{
+ var target = rcube_event.get_target(e),
+ tagname = target.tagName.toLowerCase();
+
+ return !(target && (tagname == 'input' || tagname == 'img' || (tagname != 'a' && target.onclick)));
+},
+
+
/*
* Returns thread root ID for specified row ID
*/
@@ -523,17 +548,18 @@ expand_row: function(e, id)
collapse: function(row)
{
+ var r, depth = row.depth,
+ new_row = row ? row.obj.nextSibling : null;
+
row.expanded = false;
this.triggerEvent('expandcollapse', { uid:row.uid, expanded:row.expanded, obj:row.obj });
- var depth = row.depth;
- var new_row = row ? row.obj.nextSibling : null;
- var r;
while (new_row) {
if (new_row.nodeType == 1) {
- var r = this.rows[new_row.uid];
+ r = this.rows[new_row.uid];
if (r && r.depth <= depth)
break;
+
$(new_row).css('display', 'none');
if (r.expanded) {
r.expanded = false;
@@ -545,6 +571,7 @@ collapse: function(row)
this.resize();
this.triggerEvent('listupdate');
+
return false;
},
@@ -726,7 +753,7 @@ get_first_row: function()
var i, len, rows = this.tbody.childNodes;
for (i=0, len=rows.length-1; i<len; i++)
- if (rows[i].id && String(rows[i].id).match(/^rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null)
+ if (rows[i].id && String(rows[i].id).match(this.id_regexp) && this.rows[RegExp.$1] != null)
return RegExp.$1;
}
@@ -739,7 +766,7 @@ get_last_row: function()
var i, rows = this.tbody.childNodes;
for (i=rows.length-1; i>=0; i--)
- if (rows[i].id && String(rows[i].id).match(/^rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null)
+ if (rows[i].id && String(rows[i].id).match(this.id_regexp) && this.rows[RegExp.$1] != null)
return RegExp.$1;
}
@@ -769,6 +796,7 @@ get_cell: function(row, index)
select_row: function(id, mod_key, with_mouse)
{
var select_before = this.selection.join(',');
+
if (!this.multiselect)
mod_key = 0;
@@ -787,8 +815,10 @@ select_row: function(id, mod_key, with_mouse)
break;
case CONTROL_KEY:
- if (!with_mouse)
+ if (with_mouse) {
+ this.shift_start = id;
this.highlight_row(id, true);
+ }
break;
case CONTROL_SHIFT_KEY:
@@ -799,6 +829,7 @@ select_row: function(id, mod_key, with_mouse)
this.highlight_row(id, false);
break;
}
+
this.multi_selecting = true;
}
@@ -856,14 +887,8 @@ select_first: function(mod_key)
{
var row = this.get_first_row();
if (row) {
- if (mod_key) {
- this.shift_select(row, mod_key);
- this.triggerEvent('select');
- this.scrollto(row);
- }
- else {
- this.select(row);
- }
+ this.select_row(row, mod_key, false);
+ this.scrollto(row);
}
},
@@ -875,14 +900,8 @@ select_last: function(mod_key)
{
var row = this.get_last_row();
if (row) {
- if (mod_key) {
- this.shift_select(row, mod_key);
- this.triggerEvent('select');
- this.scrollto(row);
- }
- else {
- this.select(row);
- }
+ this.select_row(row, mod_key, false);
+ this.scrollto(row);
}
},
@@ -896,7 +915,7 @@ select_children: function(uid)
for (i=0; i<len; i++)
if (!this.in_selection(children[i]))
- this.select_row(children[i], CONTROL_KEY);
+ this.select_row(children[i], CONTROL_KEY, true);
},
@@ -912,7 +931,8 @@ shift_select: function(id, control)
from_rowIndex = this._rowIndex(this.rows[this.shift_start].obj),
to_rowIndex = this._rowIndex(to_row.obj);
- if (!to_row.expanded && to_row.has_children)
+ // if we're going down the list, and we hit a thread, and it's closed, select the whole thread
+ if (from_rowIndex < to_rowIndex && !to_row.expanded && to_row.has_children)
if (to_row = this.rows[(this.row_children(id)).pop()])
to_rowIndex = this._rowIndex(to_row.obj);
@@ -934,6 +954,7 @@ shift_select: function(id, control)
}
},
+
/**
* Helper method to emulate the rowIndex property of non-tr elements
*/
@@ -948,7 +969,7 @@ _rowIndex: function(obj)
in_selection: function(id)
{
for (var n in this.selection)
- if (this.selection[n]==id)
+ if (this.selection[n] == id)
return true;
return false;
@@ -1044,9 +1065,26 @@ clear_selection: function(id)
/**
* Getter for the selection array
*/
-get_selection: function()
+get_selection: function(deep)
{
- return this.selection;
+ var res = $.merge([], this.selection);
+
+ // return children of selected threads even if only root is selected
+ if (deep !== false && res.length) {
+ for (var uid, uids, i=0, len=res.length; i<len; i++) {
+ uid = res[i];
+ if (this.rows[uid] && this.rows[uid].has_children && !this.rows[uid].expanded) {
+ uids = this.row_children(uid);
+ for (var j=0, uids_len=uids.length; j<uids_len; j++) {
+ uid = uids[j];
+ if (!this.in_selection(uid))
+ res.push(uid);
+ }
+ }
+ }
+ }
+
+ return res;
},
@@ -1120,6 +1158,7 @@ highlight_children: function(id, status)
key_press: function(e)
{
var target = e.target || {};
+
if (this.focused != true || target.nodeName == 'INPUT' || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT')
return true;
@@ -1134,32 +1173,41 @@ key_press: function(e)
// Stop propagation so that the browser doesn't scroll
rcube_event.cancel(e);
return this.use_arrow_key(keyCode, mod_key);
- case 61:
- case 107: // Plus sign on a numeric keypad (fc11 + firefox 3.5.2)
- case 109:
+
case 32:
+ rcube_event.cancel(e);
+ return this.select_row(this.last_selected, mod_key, true);
+
+ case 37: // Left arrow key
+ case 39: // Right arrow key
// Stop propagation
rcube_event.cancel(e);
- var ret = this.use_plusminus_key(keyCode, mod_key);
+ var ret = this.use_arrow_key(keyCode, mod_key);
this.key_pressed = keyCode;
this.modkey = mod_key;
this.triggerEvent('keypress');
this.modkey = 0;
return ret;
+
case 36: // Home
this.select_first(mod_key);
return rcube_event.cancel(e);
+
case 35: // End
this.select_last(mod_key);
return rcube_event.cancel(e);
+
case 27:
if (this.drag_active)
return this.drag_mouse_up(e);
+
if (this.col_drag_active) {
this.selected_column = null;
return this.column_drag_mouse_up(e);
}
+
return rcube_event.cancel(e);
+
default:
this.key_pressed = keyCode;
this.modkey = mod_key;
@@ -1179,46 +1227,49 @@ key_press: function(e)
*/
use_arrow_key: function(keyCode, mod_key)
{
- var new_row;
+ var new_row,
+ selected_row = this.rows[this.last_selected];
+
// Safari uses the nonstandard keycodes 63232/63233 for up/down, if we're
// using the keypress event (but not the keydown or keyup event).
if (keyCode == 40 || keyCode == 63233) // down arrow key pressed
new_row = this.get_next_row();
else if (keyCode == 38 || keyCode == 63232) // up arrow key pressed
new_row = this.get_prev_row();
+ else {
+ if (!selected_row || !selected_row.has_children)
+ return;
- if (new_row) {
- this.select_row(new_row.uid, mod_key, false);
- this.scrollto(new_row.uid);
- }
+ // expand
+ if (keyCode == 39) {
+ if (selected_row.expanded)
+ return;
- return false;
-},
+ if (mod_key == CONTROL_KEY || this.multiexpand)
+ this.expand_all(selected_row);
+ else
+ this.expand(selected_row);
+ }
+ // collapse
+ else {
+ if (!selected_row.expanded)
+ return;
+ if (mod_key == CONTROL_KEY || this.multiexpand)
+ this.collapse_all(selected_row);
+ else
+ this.collapse(selected_row);
+ }
-/**
- * Special handling method for +/- keys
- */
-use_plusminus_key: function(keyCode, mod_key)
-{
- var selected_row = this.rows[this.last_selected];
- if (!selected_row)
- return;
+ this.update_expando(selected_row.uid, selected_row.expanded);
- if (keyCode == 32)
- keyCode = selected_row.expanded ? 109 : 61;
- if (keyCode == 61 || keyCode == 107)
- if (mod_key == CONTROL_KEY || this.multiexpand)
- this.expand_all(selected_row);
- else
- this.expand(selected_row);
- else
- if (mod_key == CONTROL_KEY || this.multiexpand)
- this.collapse_all(selected_row);
- else
- this.collapse(selected_row);
+ return false;
+ }
- this.update_expando(selected_row.uid, selected_row.expanded);
+ if (new_row) {
+ this.select_row(new_row.uid, mod_key, false);
+ this.scrollto(new_row.uid);
+ }
return false;
},
@@ -1231,7 +1282,8 @@ scrollto: function(id)
{
var row = this.rows[id].obj;
if (row && this.frame) {
- var scroll_to = Number(row.offsetTop);
+ var scroll_to = Number(row.offsetTop),
+ head_offset = 0;
// expand thread if target row is hidden (collapsed)
if (!scroll_to && this.rows[id].parent_uid) {
@@ -1240,8 +1292,14 @@ scrollto: function(id)
scroll_to = Number(row.offsetTop);
}
- if (scroll_to < Number(this.frame.scrollTop))
- this.frame.scrollTop = scroll_to;
+ if (this.fixed_header)
+ head_offset = Number(this.thead.offsetHeight);
+
+ // if row is above the frame (or behind header)
+ if (scroll_to < Number(this.frame.scrollTop) + head_offset) {
+ // scroll window so that row isn't behind header
+ this.frame.scrollTop = scroll_to - head_offset;
+ }
else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight))
this.frame.scrollTop = (scroll_to + Number(row.offsetHeight)) - Number(this.frame.offsetHeight);
}
@@ -1263,60 +1321,71 @@ drag_mouse_move: function(e)
if (this.drag_start) {
// check mouse movement, of less than 3 pixels, don't start dragging
- var m = rcube_event.get_mouse_pos(e);
+ var m = rcube_event.get_mouse_pos(e),
+ limit = 10, selection = [], self = this;
if (!this.drag_mouse_start || (Math.abs(m.x - this.drag_mouse_start.x) < 3 && Math.abs(m.y - this.drag_mouse_start.y) < 3))
return false;
+ // remember dragging start position
+ this.drag_start_pos = {left: m.x, top: m.y};
+
+ // initialize drag layer
if (!this.draglayer)
this.draglayer = $('<div>').attr('id', 'rcmdraglayer')
- .css({ position:'absolute', display:'none', 'z-index':2000 })
+ .css({position: 'absolute', display: 'none', 'z-index': 2000})
.appendTo(document.body);
+ else
+ this.draglayer.html('');
- // also select childs of (collapsed) threads for dragging
- var n, uid, selection = $.merge([], this.selection);
- for (n in selection) {
- uid = selection[n];
- if (!this.rows[uid].expanded)
- this.select_children(uid);
- }
+ // get selected rows (in display order), don't use this.selection here
+ $(this.row_tagname() + '.selected', this.tbody).each(function() {
+ if (!String(this.id).match(self.id_regexp))
+ return;
- // reset content
- this.draglayer.html('');
+ var uid = RegExp.$1, row = self.rows[uid];
- // get subjects of selected messages
- var i, n, obj, me;
- for (n=0; n<this.selection.length; n++) {
- // only show 12 lines
- if (n>12) {
- this.draglayer.append('...');
- break;
- }
+ if (!row || $.inArray(uid, selection) > -1)
+ return;
- me = this;
- if (obj = this.rows[this.selection[n]].obj) {
- $('> '+this.col_tagname(), obj).each(function(i,elem){
- if (n == 0)
- me.drag_start_pos = $(elem).offset();
+ selection.push(uid);
- if (me.subject_col < 0 || (me.subject_col >= 0 && me.subject_col == i)) {
- var subject = $(elem).text();
+ // also handle children of (collapsed) trees for dragging (they might be not selected)
+ if (row.has_children && !row.expanded)
+ $.each(self.row_children(uid), function() {
+ if ($.inArray(this, selection) > -1)
+ return;
+ selection.push(this);
+ });
- if (subject) {
- // remove leading spaces
- subject = $.trim(subject);
- // truncate line to 50 characters
- subject = (subject.length > 50 ? subject.substring(0, 50) + '...' : subject);
+ // break the loop asap
+ if (selection.length > limit + 1)
+ return false;
+ });
- var entry = $('<div>').text(subject);
- me.draglayer.append(entry);
- }
+ // append subject (of every row up to the limit) to the drag layer
+ $.each(selection, function(i, uid) {
+ if (i > limit) {
+ self.draglayer.append('...');
+ return false;
+ }
+
+ $('> ' + self.col_tagname(), self.rows[uid].obj).each(function(n, cell) {
+ if (self.subject_col < 0 || (self.subject_col >= 0 && self.subject_col == n)) {
+ var subject = $(cell).text();
+
+ if (subject) {
+ // remove leading spaces
+ subject = $.trim(subject);
+ // truncate line to 50 characters
+ subject = (subject.length > 50 ? subject.substring(0, 50) + '...' : subject);
- return false; // break
+ self.draglayer.append($('<div>').text(subject));
+ return false;
}
- });
- }
- }
+ }
+ });
+ });
this.draglayer.show();
this.drag_active = true;
@@ -1391,6 +1460,9 @@ column_drag_mouse_move: function(e)
var lpos = $(this.list).offset(),
cells = this.thead.rows[0].cells;
+ // fix layer position when list is scrolled
+ lpos.top += this.list.scrollTop + this.list.parentNode.scrollTop;
+
// create dragging layer
this.col_draglayer = $('<div>').attr('id', 'rcmcoldraglayer')
.css(lpos).css({ position:'absolute', 'z-index':2001,
@@ -1501,7 +1573,7 @@ row_children: function(uid)
while (row) {
if (row.nodeType == 1) {
- if ((r = this.rows[row.uid])) {
+ if (r = this.rows[row.uid]) {
if (!r.depth || r.depth <= depth)
break;
res.push(r.uid);
@@ -1536,7 +1608,7 @@ add_dragfix: function()
*/
del_dragfix: function()
{
- $('div.iframe-dragdrop-fix').each(function() { this.parentNode.removeChild(this); });
+ $('div.iframe-dragdrop-fix').remove();
},
diff --git a/program/js/tiny_mce/langs/en.js b/program/js/tiny_mce/langs/en.js
index 16d7a93e0..19324f74c 100644
--- a/program/js/tiny_mce/langs/en.js
+++ b/program/js/tiny_mce/langs/en.js
@@ -1 +1 @@
-tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode_sticky":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"}}}); \ No newline at end of file
+tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}}); \ No newline at end of file
diff --git a/program/js/tiny_mce/license.txt b/program/js/tiny_mce/license.txt
index 60d6d4c8f..5a2534299 100644
--- a/program/js/tiny_mce/license.txt
+++ b/program/js/tiny_mce/license.txt
@@ -20,7 +20,7 @@ free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
+can use it too, but we suggest you first think carefuly about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
diff --git a/program/js/tiny_mce/plugins/advlink/js/advlink.js b/program/js/tiny_mce/plugins/advlink/js/advlink.js
index 9ca955c92..f013aac1e 100644
--- a/program/js/tiny_mce/plugins/advlink/js/advlink.js
+++ b/program/js/tiny_mce/plugins/advlink/js/advlink.js
@@ -64,13 +64,14 @@ function init() {
if (elm != null && elm.nodeName == "A")
action = "update";
- formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
+ formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
setPopupControlsDisabled(true);
if (action == "update") {
var href = inst.dom.getAttrib(elm, 'href');
var onclick = inst.dom.getAttrib(elm, 'onclick');
+ var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self";
// Setup form data
setFormValue('href', href);
@@ -98,7 +99,7 @@ function init() {
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
- setFormValue('target', inst.dom.getAttrib(elm, 'target'));
+ setFormValue('target', linkTarget);
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
// Parse onclick data
@@ -119,7 +120,7 @@ function init() {
addClassesToList('classlist', 'advlink_styles');
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
- selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
+ selectByValue(formObj, 'targetlist', linkTarget, true);
} else
addClassesToList('classlist', 'advlink_styles');
}
@@ -377,6 +378,9 @@ function getAnchorListHTML(id, target) {
for (i=0, len=nodes.length; i<len; i++) {
if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
html += '<option value="#' + name + '">' + name + '</option>';
+
+ if ((name = nodes[i].id) != "" && !nodes[i].href)
+ html += '<option value="#' + name + '">' + name + '</option>';
}
if (html == "")
diff --git a/program/js/tiny_mce/plugins/autolink/editor_plugin.js b/program/js/tiny_mce/plugins/autolink/editor_plugin.js
index d1c3502ac..71d86bbec 100644
--- a/program/js/tiny_mce/plugins/autolink/editor_plugin.js
+++ b/program/js/tiny_mce/plugins/autolink/editor_plugin.js
@@ -1 +1 @@
-(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f>=2?f-2:0);a.setEnd(n,f>=1?f-1:0);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js b/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
index c05fbbc09..5b61f7a20 100644
--- a/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
@@ -107,8 +107,8 @@
do
{
// Move the selection one character backwards.
- r.setStart(endContainer, end - 2);
- r.setEnd(endContainer, end - 1);
+ r.setStart(endContainer, end >= 2 ? end - 2 : 0);
+ r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
end -= 1;
// Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0
diff --git a/program/js/tiny_mce/plugins/emotions/langs/en_dlg.js b/program/js/tiny_mce/plugins/emotions/langs/en_dlg.js
index f5aafc390..037c4b588 100644
--- a/program/js/tiny_mce/plugins/emotions/langs/en_dlg.js
+++ b/program/js/tiny_mce/plugins/emotions/langs/en_dlg.js
@@ -1 +1 @@
-tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed",usage:"Use left and right arrows to navigate."}); \ No newline at end of file
+tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"});
diff --git a/program/js/tiny_mce/plugins/example/editor_plugin_src.js b/program/js/tiny_mce/plugins/example/editor_plugin_src.js
index 9a0e7da15..0a259471d 100644
--- a/program/js/tiny_mce/plugins/example/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/example/editor_plugin_src.js
@@ -49,7 +49,7 @@
},
/**
- * Creates control instances based in the incomming name. This method is normally not
+ * Creates control instances based in the incoming name. This method is normally not
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
* method can be used to create those.
diff --git a/program/js/tiny_mce/plugins/fullscreen/editor_plugin.js b/program/js/tiny_mce/plugins/fullscreen/editor_plugin.js
index a2eb03483..1aa8cc443 100644
--- a/program/js/tiny_mce/plugins/fullscreen/editor_plugin.js
+++ b/program/js/tiny_mce/plugins/fullscreen/editor_plugin.js
@@ -1 +1 @@
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file
+(function(){var b=tinymce.DOM;var a=function(d,f,e){var c=function(g){var i=d.controlManager.get(g);var h=f.controlManager.get(g);if(i&&h){h.displayColor(i.value)}};c("forecolor");c("backcolor");f.setContent(d.getContent({format:"raw"}),{format:"raw"});f.selection.moveToBookmark(e);if(d.plugins.spellchecker&&f.plugins.spellchecker){f.plugins.spellchecker.setLanguage(d.plugins.spellchecker.selectedLang)}};tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(i,c){var l=this,m={},k=b.doc.documentElement,d,o,h,g,f,e,j;i.addCommand("mceFullScreen",function(){var q,r;if(i.getParam("fullscreen_is_enabled")){if(i.getParam("fullscreen_new_window")){closeFullscreen()}else{b.win.setTimeout(function(){var t=i;var s=tinyMCE.get(t.getParam("fullscreen_editor_id"));s.plugins.fullscreen.saveState(t);tinyMCE.remove(t)},10)}return}if(i.getParam("fullscreen_new_window")){l.fullscreenSettings={bookmark:i.selection.getBookmark()};q=b.win.open(c+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{q.resizeTo(screen.availWidth,screen.availHeight)}catch(p){}}else{o=b.getStyle(b.doc.body,"overflow",1)||"auto";h=b.getStyle(k,"overflow",1);d=b.getViewPort();g=d.x;f=d.y;if(tinymce.isOpera&&o=="visible"){o="auto"}if(tinymce.isIE&&o=="scroll"){o="auto"}if(tinymce.isIE&&(h=="visible"||h=="scroll")){h="auto"}if(o=="0px"){o=""}b.setStyle(b.doc.body,"overflow","hidden");k.style.overflow="hidden";d=b.getViewPort();b.win.scrollTo(0,0);if(tinymce.isIE){d.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){e="absolute;top:"+d.y}else{e="fixed;top:0"}n=b.add(b.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+e+";left:0;width:"+d.w+"px;height:"+d.h+"px;z-index:200000;"});b.add(n,"div",{id:"mce_fullscreen"});tinymce.each(i.settings,function(s,t){m[t]=s});m.id="mce_fullscreen";m.width=n.clientWidth;m.height=n.clientHeight-15;m.fullscreen_is_enabled=true;m.fullscreen_editor_id=i.id;m.theme_advanced_resizing=false;m.save_onsavecallback=function(){i.setContent(tinyMCE.get(m.id).getContent());i.execCommand("mceSave")};tinymce.each(i.getParam("fullscreen_settings"),function(t,s){m[s]=t});l.fullscreenSettings={bookmark:i.selection.getBookmark(),fullscreen_overflow:o,fullscreen_html_overflow:h,fullscreen_scrollx:g,fullscreen_scrolly:f};if(m.theme_advanced_toolbar_location==="external"){m.theme_advanced_toolbar_location="top"}tinyMCE.oldSettings=tinyMCE.settings;l.fullscreenEditor=new tinymce.Editor("mce_fullscreen",m);l.fullscreenEditor.onInit.add(function(){l.loadState(l.fullscreenEditor)});l.fullscreenEditor.render();l.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");l.fullscreenElement.update();l.resizeFunc=tinymce.dom.Event.add(b.win,"resize",function(){var v=tinymce.DOM.getViewPort(),t=l.fullscreenEditor,s,u;s=t.dom.getSize(t.getContainer().getElementsByTagName("table")[0]);u=t.dom.getSize(t.getContainer().getElementsByTagName("iframe")[0]);t.theme.resizeTo(v.w-s.w+u.w,v.h-s.h+u.h)})}});i.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});i.onNodeChange.add(function(q,p){p.setActive("fullscreen",q.getParam("fullscreen_is_enabled"))});l.loadState=function(p){if(!(p&&l.fullscreenSettings)){throw"No fullscreen editor to load to"}a(i,p,l.fullscreenSettings.bookmark);p.focus()};l.saveState=function(q){if(!(q&&l.fullscreenSettings)){throw"No fullscreen editor to restore from"}var p=l.fullscreenSettings;a(q,i,q.selection.getBookmark());if(!i.getParam("fullscreen_new_window")){tinymce.dom.Event.remove(b.win,"resize",l.resizeFunc);delete l.resizeFunc;b.remove("mce_fullscreen_container");b.doc.documentElement.style.overflow=p.fullscreen_html_overflow;b.setStyle(b.doc.body,"overflow",p.fullscreen_overflow);b.win.scrollTo(p.fullscreen_scrollx,p.fullscreen_scrolly)}tinyMCE.settings=tinyMCE.oldSettings;delete tinyMCE.oldSettings;delete l.fullscreenEditor;delete l.fullscreenElement;delete l.fullscreenSettings;b.win.setTimeout(function(){i.selection.moveToBookmark(j);i.focus()},10)}},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/program/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js
index 524b487aa..bec886f74 100644
--- a/program/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js
@@ -11,29 +11,48 @@
(function() {
var DOM = tinymce.DOM;
+ // State Transfer function
+ var transferState = function(oldEditor, newEditor, bookmark) {
+ var transferColorButtonState = function(swapme) {
+ var c = oldEditor.controlManager.get(swapme);
+ var newC = newEditor.controlManager.get(swapme);
+
+ if (c && newC) {
+ newC.displayColor(c.value);
+ }
+
+ };
+
+ transferColorButtonState('forecolor');
+ transferColorButtonState('backcolor');
+ newEditor.setContent(oldEditor.getContent({format : 'raw'}), {format : 'raw'});
+ newEditor.selection.moveToBookmark(bookmark);
+
+ if (oldEditor.plugins.spellchecker && newEditor.plugins.spellchecker) {
+ newEditor.plugins.spellchecker.setLanguage(oldEditor.plugins.spellchecker.selectedLang);
+ }
+ };
+
tinymce.create('tinymce.plugins.FullScreenPlugin', {
init : function(ed, url) {
- var t = this, s = {}, vp, posCss;
-
- t.editor = ed;
+ var t = this, s = {}, de = DOM.doc.documentElement, vp, fullscreen_overflow, fullscreen_html_overflow, fullscreen_scrollx, fullscreen_scrolly, posCss, bookmark;
// Register commands
ed.addCommand('mceFullScreen', function() {
- var win, de = DOM.doc.documentElement;
+ var win, oed;
if (ed.getParam('fullscreen_is_enabled')) {
if (ed.getParam('fullscreen_new_window'))
- closeFullscreen(); // Call to close in new window
+ closeFullscreen(); // Call to close in fullscreen.htm
else {
DOM.win.setTimeout(function() {
- tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
- tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
- tinyMCE.remove(ed);
- DOM.remove('mce_fullscreen_container');
- de.style.overflow = ed.getParam('fullscreen_html_overflow');
- DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
- DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
- tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
+ var fullscreenEditor = ed;
+
+ // find the editor that opened this one, execute restore function there
+ var originalEditor = tinyMCE.get(fullscreenEditor.getParam('fullscreen_editor_id'));
+ originalEditor.plugins.fullscreen.saveState(fullscreenEditor);
+
+ tinyMCE.remove(fullscreenEditor);
}, 10);
}
@@ -41,6 +60,9 @@
}
if (ed.getParam('fullscreen_new_window')) {
+ t.fullscreenSettings = {
+ bookmark: ed.selection.getBookmark()
+ };
win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
try {
win.resizeTo(screen.availWidth, screen.availHeight);
@@ -48,27 +70,26 @@
// Ignore
}
} else {
- tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
- s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
- s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
+ fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
+ fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
vp = DOM.getViewPort();
- s.fullscreen_scrollx = vp.x;
- s.fullscreen_scrolly = vp.y;
+ fullscreen_scrollx = vp.x;
+ fullscreen_scrolly = vp.y;
// Fixes an Opera bug where the scrollbars doesn't reappear
- if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
- s.fullscreen_overflow = 'auto';
+ if (tinymce.isOpera && fullscreen_overflow == 'visible')
+ fullscreen_overflow = 'auto';
// Fixes an IE bug where horizontal scrollbars would appear
- if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
- s.fullscreen_overflow = 'auto';
+ if (tinymce.isIE && fullscreen_overflow == 'scroll')
+ fullscreen_overflow = 'auto';
// Fixes an IE bug where the scrollbars doesn't reappear
- if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
- s.fullscreen_html_overflow = 'auto';
+ if (tinymce.isIE && (fullscreen_html_overflow == 'visible' || fullscreen_html_overflow == 'scroll'))
+ fullscreen_html_overflow = 'auto';
- if (s.fullscreen_overflow == '0px')
- s.fullscreen_overflow = '';
+ if (fullscreen_overflow == '0px')
+ fullscreen_overflow = '';
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
de.style.overflow = 'hidden'; //Fix for IE6/7
@@ -108,13 +129,21 @@
s[k] = v;
});
+ t.fullscreenSettings = {
+ bookmark: ed.selection.getBookmark(),
+ fullscreen_overflow: fullscreen_overflow,
+ fullscreen_html_overflow: fullscreen_html_overflow,
+ fullscreen_scrollx: fullscreen_scrollx,
+ fullscreen_scrolly: fullscreen_scrolly
+ };
+
if (s.theme_advanced_toolbar_location === 'external')
s.theme_advanced_toolbar_location = 'top';
+ tinyMCE.oldSettings = tinyMCE.settings; // Store old settings, the Editor constructor overwrites them
t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
t.fullscreenEditor.onInit.add(function() {
- t.fullscreenEditor.setContent(ed.getContent());
- t.fullscreenEditor.focus();
+ t.loadState(t.fullscreenEditor);
});
t.fullscreenEditor.render();
@@ -141,6 +170,52 @@
ed.onNodeChange.add(function(ed, cm) {
cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
});
+
+ // fullscreenEditor is a param here because in window mode we don't create it
+ t.loadState = function(fullscreenEditor) {
+ if (!(fullscreenEditor && t.fullscreenSettings)) {
+ throw "No fullscreen editor to load to";
+ }
+
+ transferState(ed, fullscreenEditor, t.fullscreenSettings.bookmark);
+ fullscreenEditor.focus();
+
+ };
+
+ // fullscreenEditor is a param here because in window mode we don't create it
+ t.saveState = function(fullscreenEditor) {
+ if (!(fullscreenEditor && t.fullscreenSettings)) {
+ throw "No fullscreen editor to restore from";
+ }
+ var settings = t.fullscreenSettings;
+
+ transferState(fullscreenEditor, ed, fullscreenEditor.selection.getBookmark());
+
+ // cleanup only required if window mode isn't used
+ if (!ed.getParam('fullscreen_new_window')) {
+ tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
+ delete t.resizeFunc;
+
+ DOM.remove('mce_fullscreen_container');
+
+ DOM.doc.documentElement.style.overflow = settings.fullscreen_html_overflow;
+ DOM.setStyle(DOM.doc.body, 'overflow', settings.fullscreen_overflow);
+ DOM.win.scrollTo(settings.fullscreen_scrollx, settings.fullscreen_scrolly);
+ }
+ tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
+
+ // clear variables
+ delete tinyMCE.oldSettings;
+ delete t.fullscreenEditor;
+ delete t.fullscreenElement;
+ delete t.fullscreenSettings;
+
+ // allow the fullscreen editor to be removed before restoring focus and selection
+ DOM.win.setTimeout(function() {
+ ed.selection.moveToBookmark(bookmark);
+ ed.focus();
+ }, 10);
+ };
},
getInfo : function() {
diff --git a/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm b/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm
index ffe528e41..baf028b79 100644
--- a/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm
+++ b/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm
@@ -46,7 +46,7 @@
settings['strict_loading_mode'] = true;
settings.save_onsavecallback = function() {
- window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
+ moveContent();
window.opener.tinyMCE.get(oeID).execCommand('mceSave');
window.close();
};
@@ -56,11 +56,15 @@
}
function moveContent() {
- window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
+ // find the original editor, execute restore state in it's plugin instance
+ window.opener.tinyMCE.get(oeID).plugins.fullscreen.saveState(tinyMCE.activeEditor);
+
+ // prevent moveContent from being called twice - e.g. if the unloadHandler runs after moveContent()
+ tinymce.dom.Event.remove(window, "beforeunload", unloadHandler);
}
function closeFullscreen() {
- moveContent();
+ // moveContent() will be called by the unload handler
window.close();
}
@@ -78,17 +82,20 @@
function render() {
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
- e.value = window.opener.tinyMCE.get(oeID).getContent();
-
vp = dom.getViewPort();
settings.width = vp.w;
settings.height = vp.h - 15;
- tinymce.dom.Event.add(window, 'resize', function() {
- var vp = dom.getViewPort();
+ settings.oninit = function() {
+ var ed = tinyMCE.activeEditor;
+ window.opener.tinyMCE.get(oeID).plugins.fullscreen.loadState(ed);
+
+ tinymce.dom.Event.add(window, 'resize', function() {
+ var vp = dom.getViewPort();
- tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
- });
+ tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
+ });
+ }
tinyMCE.init(settings);
}
diff --git a/program/js/tiny_mce/plugins/inlinepopups/editor_plugin.js b/program/js/tiny_mce/plugins/inlinepopups/editor_plugin.js
index 8bb96f9cb..2d71a2e17 100644
--- a/program/js/tiny_mce/plugins/inlinepopups/editor_plugin.js
+++ b/program/js/tiny_mce/plugins/inlinepopups/editor_plugin.js
@@ -1 +1 @@
-(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","<br />"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(i,k){var g=this,f,j=d.doc,h,k;k=g._findId(k||i);if(!g.windows[k]){g.parent(i);return}g.count--;if(g.count==0){d.remove("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","false");g.editor.focus()}if(f=g.windows[k]){g.onClose.dispatch(g);a.remove(j,"mousedown",f.mousedownFunc);a.remove(j,"click",f.clickFunc);a.clear(k);a.clear(k+"_ifr");d.setAttrib(k+"_ifr","src",'javascript:""');f.element.remove();delete g.windows[k];h=g._frontWindow();if(h){g.focus(h.id)}}},_frontWindow:function(){var g,f=0;e(this.windows,function(h){if(h.zIndex>f){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId("mce_inlinepopups_");h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","<br />"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(i,k){var g=this,f,j=d.doc,h,k;k=g._findId(k||i);if(!g.windows[k]){g.parent(i);return}g.count--;if(g.count==0){d.remove("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","false");g.editor.focus()}if(f=g.windows[k]){g.onClose.dispatch(g);a.remove(j,"mousedown",f.mousedownFunc);a.remove(j,"click",f.clickFunc);a.clear(k);a.clear(k+"_ifr");d.setAttrib(k+"_ifr","src",'javascript:""');f.element.remove();delete g.windows[k];h=g._frontWindow();if(h){g.focus(h.id)}}},_frontWindow:function(){var g,f=0;e(this.windows,function(h){if(h.zIndex>f){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/program/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
index 67123ca31..da6ee2493 100644
--- a/program/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
@@ -55,12 +55,12 @@
if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
}
-
+
// Only store selection if the type is a normal window
if (!f.type)
t.bookmark = ed.selection.getBookmark(1);
- id = DOM.uniqueId();
+ id = DOM.uniqueId("mce_inlinepopups_"); // Use a prefix so this can't conflict with other ids
vp = DOM.getViewPort();
f.width = parseInt(f.width || 320);
f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
@@ -111,17 +111,17 @@
opt += ' mceMovable';
// Create DOM objects
- t._addAll(DOM.doc.body,
- ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
+ t._addAll(DOM.doc.body,
+ ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
- ['div', {id : id + '_top', 'class' : 'mceTop'},
+ ['div', {id : id + '_top', 'class' : 'mceTop'},
['div', {'class' : 'mceLeft'}],
['div', {'class' : 'mceCenter'}],
['div', {'class' : 'mceRight'}],
['span', {id : id + '_title'}, f.title || '']
],
- ['div', {id : id + '_middle', 'class' : 'mceMiddle'},
+ ['div', {id : id + '_middle', 'class' : 'mceMiddle'},
['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
['span', {id : id + '_content'}],
['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
@@ -188,7 +188,7 @@
DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
-
+
Event.add(id, 'keyup', function(evt) {
var VK_ESCAPE = 27;
if (evt.keyCode === VK_ESCAPE) {
@@ -268,7 +268,7 @@
}
}
});
-
+
// Make sure the tab order loops within the dialog.
Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
var iframe = DOM.get(id + '_ifr');
@@ -284,7 +284,7 @@
DOM.get(id + '_ok').focus();
}
});
-
+
// Add window
w = t.windows[id] = {
id : id,
@@ -341,7 +341,7 @@
DOM.removeClass(t.lastId, 'mceFocus');
DOM.addClass(id, 'mceFocus');
t.lastId = id;
-
+
if (w.focussedElement) {
w.focussedElement.focus();
} else if (DOM.get(id + '_ok')) {
@@ -486,7 +486,7 @@
dw = v;
}
-
+
if (dh < (v = w.features.min_height - sz.h)) {
if (dy !== 0)
dy += dh - v;
@@ -505,7 +505,7 @@
if (dx + dy !== 0) {
if (sx + dx < 0)
dx = 0;
-
+
if (sy + dy < 0)
dy = 0;
@@ -567,7 +567,7 @@
t.focus(fw.id);
}
},
-
+
// Find front most window
_frontWindow : function() {
var fw, ix = 0;
diff --git a/program/js/tiny_mce/plugins/media/js/media.js b/program/js/tiny_mce/plugins/media/js/media.js
index f6a081a63..89cea2a41 100644
--- a/program/js/tiny_mce/plugins/media/js/media.js
+++ b/program/js/tiny_mce/plugins/media/js/media.js
@@ -295,30 +295,40 @@
} else {
src = getVal("src");
- // YouTube *NEW*
- if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
+ // YouTube Embed
+ if (src.match(/youtube\.com\/embed\/\w+/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
- src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
- }
+ } else {
+ // YouTube *NEW*
+ if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) {
+ data.width = 425;
+ data.height = 350;
+ data.params.frameborder = '0';
+ data.type = 'iframe';
+ src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
+ setVal('src', src);
+ setVal('media_type', data.type);
+ }
- // YouTube
- if (src.match(/youtube.com(.+)v=([^&]+)/)) {
- data.width = 425;
- data.height = 350;
- data.params.frameborder = '0';
- data.type = 'iframe';
- src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
- setVal('src', src);
- setVal('media_type', data.type);
+ // YouTube
+ if (src.match(/youtube\.com(.+)v=([^&]+)/)) {
+ data.width = 425;
+ data.height = 350;
+ data.params.frameborder = '0';
+ data.type = 'iframe';
+ src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
+ setVal('src', src);
+ setVal('media_type', data.type);
+ }
}
// Google video
- if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
+ if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) {
data.width = 425;
data.height = 326;
data.type = 'flash';
@@ -328,7 +338,7 @@
}
// Vimeo
- if (src.match(/vimeo.com\/([0-9]+)/)) {
+ if (src.match(/vimeo\.com\/([0-9]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
@@ -339,7 +349,7 @@
}
// stream.cz
- if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) {
+ if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
@@ -350,7 +360,7 @@
}
// Google maps
- if (src.match(/maps.google.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
+ if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
diff --git a/program/js/tiny_mce/plugins/media/langs/en_dlg.js b/program/js/tiny_mce/plugins/media/langs/en_dlg.js
index b247f85cd..ecef3a801 100644
--- a/program/js/tiny_mce/plugins/media/langs/en_dlg.js
+++ b/program/js/tiny_mce/plugins/media/langs/en_dlg.js
@@ -1 +1 @@
-tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right",flash:"",quicktime:"","embedded_audio_options":"Embedded Audio Options",windowsmedia:"",realmedia:"",shockwave:"",audio:"",video:"","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide",iframe:"",embeddedaudio:""}); \ No newline at end of file
+tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
diff --git a/program/js/tiny_mce/plugins/paste/editor_plugin.js b/program/js/tiny_mce/plugins/paste/editor_plugin.js
index be7eee8f1..f69f263f9 100644
--- a/program/js/tiny_mce/plugins/paste/editor_plugin.js
+++ b/program/js/tiny_mce/plugins/paste/editor_plugin.js
@@ -1 +1 @@
-(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/&quot;/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"<br />"]])}else{if(e=="p"){h([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{h([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file
+(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<?!(ol|ul)[^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1");j=j.replace(/(<(ol|ul)[^>]*\s)(?:id|name|language|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/&quot;/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length<d){i+="\n"}e([[l,i]])}j=h.dom.decode(tinymce.html.Entities.encodeRaw(j));if(g(k,"array")){e(k)}else{if(g(k,"string")){e(new RegExp(k,"gi"))}}if(f=="none"){e([[/\n+/g," "]])}else{if(f=="br"){e([[/\n/g,"<br />"]])}else{if(f=="p"){e([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{e([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/paste/editor_plugin_src.js b/program/js/tiny_mce/plugins/paste/editor_plugin_src.js
index 9f1c35476..6f1734299 100644
--- a/program/js/tiny_mce/plugins/paste/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/paste/editor_plugin_src.js
@@ -23,6 +23,7 @@
paste_convert_headers_to_strong : false,
paste_dialog_width : "450",
paste_dialog_height : "400",
+ paste_max_consecutive_linebreaks: 2,
paste_text_use_dialog : false,
paste_text_sticky : false,
paste_text_sticky_default : false,
@@ -290,7 +291,7 @@
}
}
- // Check if we should use the new auto process method
+ // Check if we should use the new auto process method
if (getParam(ed, "paste_auto_cleanup_on_paste")) {
// Is it's Opera or older FF use key handler
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
@@ -353,7 +354,7 @@
h = h.replace(v[0], v[1]);
});
}
-
+
if (ed.settings.paste_enable_default_filters == false) {
return;
}
@@ -412,7 +413,9 @@
// If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
do {
len = h.length;
- h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
+ // Don't remove the type attribute for lists so that non-default list types display correctly.
+ h = h.replace(/(<?!(ol|ul)[^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
+ h = h.replace(/(<(ol|ul)[^>]*\s)(?:id|name|language|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
} while (len != h.length);
// Remove all spans if no styles is to be retained
@@ -588,7 +591,7 @@
if (ed.settings.paste_enable_default_filters == false) {
return;
}
-
+
if (o.wordContent) {
// Remove named anchors or TOC links
each(dom.select('a', o.node), function(a) {
@@ -790,10 +793,23 @@
[/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
/<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
[/&nbsp;/gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
- [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars.
- [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks
+ [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars.
]);
+ var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks"));
+ if (maxLinebreaks > -1) {
+ var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g");
+ var linebreakReplacement = "";
+
+ while (linebreakReplacement.length < maxLinebreaks) {
+ linebreakReplacement += "\n";
+ }
+
+ process([
+ [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks
+ ]);
+ }
+
content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
// Perform default or custom replacements
diff --git a/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js b/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
index 80284b9f3..eb9b6eea8 100644
--- a/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
+++ b/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
@@ -14,6 +14,7 @@ var SearchReplaceDialog = {
mcTabs.onChange.add(function(tab_id, panel_id) {
t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
});
+
},
switchMode : function(m) {
@@ -39,6 +40,11 @@ var SearchReplaceDialog = {
searchNext : function(a) {
var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
+ if (tinymce.isIE11 && !window.find) {
+ ed.windowManager.alert("This feature is not available in IE 11+. Upgrade TinyMCE to 4.x to get this functionallity back.");
+ return;
+ }
+
// Get input
f = document.forms[0];
s = f[m + '_panel_searchstring'].value;
diff --git a/program/js/tiny_mce/plugins/spellchecker/editor_plugin.js b/program/js/tiny_mce/plugins/spellchecker/editor_plugin.js
index 48549c923..6b57241a9 100644
--- a/program/js/tiny_mce/plugins/spellchecker/editor_plugin.js
+++ b/program/js/tiny_mce/plugins/spellchecker/editor_plugin.js
@@ -1 +1 @@
-(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+" "}});if(e.getParam("spellchecker_word_pattern")){h=d.match("("+e.getParam("spellchecker_word_pattern")+")","gi")}else{d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));h=d.split(" ")}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(d){var e=this.editor,h=e.dom,g=e.selection,f=g.getRng(true);c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!d||h.decode(i.innerHTML)==d){h.remove(i,1)}}});g.setRng(f)},_markWords:function(l){var h=this.editor,g=h.dom,j=h.getDoc(),i=h.selection,d=i.getRng(true),e=[],k=l.join("|"),m=this._getSeparators(),f=new RegExp("(^|["+m+"])("+k+")(?=["+m+"]|$)","g");this._walk(h.getBody(),function(o){if(o.nodeType==3){e.push(o)}});c(e,function(t){var r,q,o,s,p=t.nodeValue;if(f.test(p)){p=g.encode(p);q=g.create("span",{"class":"mceItemHidden"});if(tinymce.isIE){p=p.replace(f,"$1<mcespell>$2</mcespell>");while((s=p.indexOf("<mcespell>"))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(g.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("</mcespell>");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(g.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(g.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(f,'$1<span class="mceItemHiddenSpellWord">$2</span>')}g.replace(q,t)}});i.setRng(d)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file
+(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);f.menuItems={};c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}f._updateMenu(l);f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);f.menuItems[n]=l;if(n==f.selectedLang){f.selectedItem=l}})});return g}},setLanguage:function(e){var d=this;if(e==d.selectedLang){return}if(tinymce.grep(d.languages,function(f){return f===e}).length===0){throw"Unknown language: "+e}d.selectedLang=e;if(d.menuItems){d._updateMenu(d.menuItems[e])}if(d.active){d._done()}},_updateMenu:function(d){d.setSelected(1);this.selectedItem.setSelected(0);this.selectedItem=d},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+" "}});if(e.getParam("spellchecker_word_pattern")){h=d.match("("+e.getParam("spellchecker_word_pattern")+")","gi")}else{d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));h=d.split(" ")}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(d){var e=this.editor,h=e.dom,g=e.selection,f=g.getRng(true);c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!d||h.decode(i.innerHTML)==d){h.remove(i,1)}}});g.setRng(f)},_markWords:function(l){var h=this.editor,g=h.dom,j=h.getDoc(),i=h.selection,d=i.getRng(true),e=[],k=l.join("|"),m=this._getSeparators(),f=new RegExp("(^|["+m+"])("+k+")(?=["+m+"]|$)","g");this._walk(h.getBody(),function(o){if(o.nodeType==3){e.push(o)}});c(e,function(t){var r,q,o,s,p=t.nodeValue;f.lastIndex=0;if(f.test(p)){p=g.encode(p);q=g.create("span",{"class":"mceItemHidden"});if(tinymce.isIE){p=p.replace(f,"$1<mcespell>$2</mcespell>");while((s=p.indexOf("<mcespell>"))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(g.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("</mcespell>");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(g.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(g.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(f,'$1<span class="mceItemHiddenSpellWord">$2</span>')}g.replace(q,t)}});i.setRng(d)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/program/js/tiny_mce/plugins/spellchecker/editor_plugin_src.js
index 86fdfceb4..5751b0e52 100644
--- a/program/js/tiny_mce/plugins/spellchecker/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/spellchecker/editor_plugin_src.js
@@ -126,6 +126,7 @@
c.onRenderMenu.add(function(c, m) {
m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
+ t.menuItems = {};
each(t.languages, function(v, k) {
var o = {icon : 1}, mi;
@@ -133,27 +134,60 @@
if (v == t.selectedLang) {
return;
}
- mi.setSelected(1);
- t.selectedItem.setSelected(0);
- t.selectedItem = mi;
+ t._updateMenu(mi);
t.selectedLang = v;
};
o.title = k;
mi = m.add(o);
mi.setSelected(v == t.selectedLang);
-
+ t.menuItems[v] = mi;
if (v == t.selectedLang)
t.selectedItem = mi;
- })
+ });
});
+
+
return c;
}
},
+ setLanguage: function(lang) {
+ var t = this;
+
+ if (lang == t.selectedLang) {
+ // allowed
+ return;
+ }
+
+ if (tinymce.grep(t.languages, function(v) { return v === lang; }).length === 0) {
+ throw "Unknown language: " + lang;
+ }
+
+ t.selectedLang = lang;
+
+ // if the menu has been shown, update it as well
+ if (t.menuItems) {
+ t._updateMenu(t.menuItems[lang]);
+ }
+
+ if (t.active) {
+ // clear error in the old language.
+ t._done();
+
+ // Don't immediately block the UI to check spelling in the new language, this is an API not a user action.
+ }
+ },
+
// Internal functions
+ _updateMenu: function(mi) {
+ mi.setSelected(1);
+ this.selectedItem.setSelected(0);
+ this.selectedItem = mi;
+ },
+
_walk : function(n, f) {
var d = this.editor.getDoc(), w;
@@ -235,6 +269,7 @@
each(nl, function(n) {
var node, elem, txt, pos, v = n.nodeValue;
+ rx.lastIndex = 0;
if (rx.test(v)) {
// Encode the content
v = dom.encode(v);
diff --git a/program/js/tiny_mce/plugins/style/langs/en_dlg.js b/program/js/tiny_mce/plugins/style/langs/en_dlg.js
index 9a1d4a223..35881b3ac 100644
--- a/program/js/tiny_mce/plugins/style/langs/en_dlg.js
+++ b/program/js/tiny_mce/plugins/style/langs/en_dlg.js
@@ -1 +1 @@
-tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"}); \ No newline at end of file
+tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
diff --git a/program/js/tiny_mce/plugins/table/editor_plugin.js b/program/js/tiny_mce/plugins/table/editor_plugin.js
index 23c1a83f3..4a92e1b36 100644
--- a/program/js/tiny_mce/plugins/table/editor_plugin.js
+++ b/program/js/tiny_mce/plugins/table/editor_plugin.js
@@ -1 +1 @@
-(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,"mceSelected")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{L=D=null;e(g,function(Z,aa){e(Z,function(ac,ab){if(j(ac)){if(!L){L={x:ab,y:aa}}D={x:ab,y:aa}}})});P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colSpan",(X-P)+1);s(T,"rowSpan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,"rowspan");if(O>1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colSpan",1);s(R,"rowSpan",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}});G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected")}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE?"&nbsp;":'<br data-mce-bogus="1" />')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});if(d.isGecko){r.onKeyDown.add(function(z,B){if(B.keyCode===d.VK.ENTER&&B.shiftKey){var A=z.selection.getRng().startContainer;var C=q.getParent(A,"td,th");if(C){var w=z.getDoc().createTextNode("\uFEFF");q.insertAfter(w,A)}}})}s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file
+(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,"mceSelected")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE&&!d.isIE11?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE||d.isIE11){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{L=D=null;e(g,function(Z,aa){e(Z,function(ac,ab){if(j(ac)){if(!L){L={x:ab,y:aa}}D={x:ab,y:aa}}})});P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colSpan",(X-P)+1);s(T,"rowSpan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,"rowspan");if(O>1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){if(!O){return}var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colSpan",1);s(R,"rowSpan",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}});G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected")}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE&&!d.isIE11?"&nbsp;":'<br data-mce-bogus="1" />')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/table/editor_plugin_src.js b/program/js/tiny_mce/plugins/table/editor_plugin_src.js
index 54bab56c3..045648376 100644
--- a/program/js/tiny_mce/plugins/table/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/table/editor_plugin_src.js
@@ -166,7 +166,7 @@
// Add something to the inner node
if (curNode)
- curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />';
+ curNode.innerHTML = tinymce.isIE && !tinymce.isIE11 ? '&nbsp;' : '<br data-mce-bogus="1" />';
return false;
}
@@ -179,7 +179,7 @@
if (formatNode) {
cell.appendChild(formatNode);
} else {
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
cell.innerHTML = '<br data-mce-bogus="1" />';
}
@@ -566,6 +566,10 @@
};
function pasteRows(rows, before) {
+ // If we don't have any rows in the clipboard, return immediately
+ if(!rows)
+ return;
+
var selectedRows = getSelectedRows(),
targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
targetCellCount = targetRow.cells.length;
@@ -1245,7 +1249,7 @@
if (last && last.nodeName == 'TABLE') {
if (ed.settings.forced_root_block)
- ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />');
+ ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE && !tinymce.isIE11 ? '&nbsp;' : '<br data-mce-bogus="1" />');
else
ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
}
@@ -1294,7 +1298,10 @@
/**
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
+ *
+ * Removed: Since the new enter logic seems to fix this one.
*/
+ /*
if (tinymce.isGecko) {
ed.onKeyDown.add(function(ed, e) {
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
@@ -1307,7 +1314,7 @@
}
});
}
-
+ */
fixTableCaretPos();
ed.startContent = ed.getContent({format : 'raw'});
diff --git a/program/js/tiny_mce/plugins/table/js/row.js b/program/js/tiny_mce/plugins/table/js/row.js
index a13d69592..0c678de46 100644
--- a/program/js/tiny_mce/plugins/table/js/row.js
+++ b/program/js/tiny_mce/plugins/table/js/row.js
@@ -25,6 +25,7 @@ function init() {
var dir = dom.getAttrib(trElm, 'dir');
selectByValue(formObj, 'rowtype', rowtype);
+ setActionforRowType(formObj, rowtype);
// Any cells selected
if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {
@@ -234,4 +235,20 @@ function changedColor() {
formObj.style.value = dom.serializeStyle(st);
}
+function changedRowType() {
+ var formObj = document.forms[0];
+ var rowtype = getSelectValue(formObj, 'rowtype');
+
+ setActionforRowType(formObj, rowtype);
+
+}
+
+function setActionforRowType(formObj, rowtype) {
+ if (rowtype === "tbody") {
+ formObj.action.disabled = false;
+ } else {
+ selectByValue(formObj, 'action', "row");
+ formObj.action.disabled = true;
+ }
+}
tinyMCEPopup.onInit.add(init);
diff --git a/program/js/tiny_mce/plugins/table/js/table.js b/program/js/tiny_mce/plugins/table/js/table.js
index 1db243b63..f427f5f87 100644
--- a/program/js/tiny_mce/plugins/table/js/table.js
+++ b/program/js/tiny_mce/plugins/table/js/table.js
@@ -91,7 +91,7 @@ function insertTable() {
if (!capEl && caption) {
capEl = elm.ownerDocument.createElement('caption');
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
capEl.innerHTML = '<br data-mce-bogus="1"/>';
elm.insertBefore(capEl, elm.firstChild);
@@ -199,7 +199,7 @@ function insertTable() {
html += '>';
if (caption) {
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
html += '<caption><br data-mce-bogus="1"/></caption>';
else
html += '<caption></caption>';
@@ -209,7 +209,7 @@ function insertTable() {
html += "<tr>";
for (var x=0; x<cols; x++) {
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
html += '<td><br data-mce-bogus="1"/></td>';
else
html += '<td></td>';
@@ -242,16 +242,16 @@ function insertTable() {
} else
inst.execCommand('mceInsertContent', false, html);
- tinymce.each(dom.select('table[data-mce-new]'), function(node) {
+ tinymce.each(dom.select('table[data-mce-new]'), function(node) {
var tdorth = dom.select('td,th', node);
-
+
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
- if (tinymce.isIE && node.nextSibling == null) {
+ if (tinymce.isIE && !tinymce.isIE11 && node.nextSibling == null) {
if (inst.settings.forced_root_block)
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
else
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
- }
+ }
try {
// IE9 might fail to do this selection
diff --git a/program/js/tiny_mce/plugins/table/row.htm b/program/js/tiny_mce/plugins/table/row.htm
index 1885401f6..6ebef2842 100644
--- a/program/js/tiny_mce/plugins/table/row.htm
+++ b/program/js/tiny_mce/plugins/table/row.htm
@@ -28,7 +28,7 @@
<tr>
<td><label for="rowtype">{#table_dlg.rowtype}</label></td>
<td class="col2">
- <select id="rowtype" name="rowtype" class="mceFocus">
+ <select id="rowtype" name="rowtype" class="mceFocus" onChange="changedRowType();">
<option value="thead">{#table_dlg.thead}</option>
<option value="tbody">{#table_dlg.tbody}</option>
<option value="tfoot">{#table_dlg.tfoot}</option>
@@ -83,8 +83,8 @@
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
<tr>
- <td class="column1"><label for="id">{#table_dlg.id}</label></td>
- <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
+ <td class="column1"><label for="id">{#table_dlg.id}</label></td>
+ <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
</tr>
<tr>
@@ -93,25 +93,25 @@
</tr>
<tr>
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
+ <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
<td>
- <select id="dir" name="dir" style="width: 200px">
- <option value="">{#not_set}</option>
- <option value="ltr">{#table_dlg.ltr}</option>
- <option value="rtl">{#table_dlg.rtl}</option>
+ <select id="dir" name="dir" style="width: 200px">
+ <option value="">{#not_set}</option>
+ <option value="ltr">{#table_dlg.ltr}</option>
+ <option value="rtl">{#table_dlg.rtl}</option>
</select>
- </td>
+ </td>
</tr>
<tr>
- <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
+ <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
<td>
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
- </td>
+ </td>
</tr>
<tr>
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
+ <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
@@ -119,11 +119,11 @@
<td id="backgroundimagebrowsercontainer">&nbsp;</td>
</tr>
</table>
- </td>
+ </td>
</tr>
<tr>
- <td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
+ <td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
<td>
<span role="group" aria-labelledby="bgcolor_label">
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
@@ -133,7 +133,7 @@
</tr>
</table>
</span>
- </td>
+ </td>
</tr>
</table>
</fieldset>
diff --git a/program/js/tiny_mce/themes/advanced/editor_template.js b/program/js/tiny_mce/themes/advanced/editor_template.js
index 9ab712cb5..4b8d56375 100644
--- a/program/js/tiny_mce/themes/advanced/editor_template.js
+++ b/program/js/tiny_mce/themes/advanced/editor_template.js
@@ -1 +1 @@
-(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(p,m){var k,l,o=p.dom,j="",n,r;previewStyles=p.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function q(s){return s.replace(/%(\w+)/g,"")}k=m.block||m.inline||"span";l=o.create(k);f(m.styles,function(t,s){t=q(t);if(t){o.setStyle(l,s,t)}});f(m.attributes,function(t,s){t=q(t);if(t){o.setAttrib(l,s,t)}});f(m.classes,function(s){s=q(s);if(!o.hasClass(l,s)){o.addClass(l,s)}});o.setStyles(l,{position:"absolute",left:-65535});p.getBody().appendChild(l);n=o.getStyle(p.getBody(),"fontSize",true);n=/px$/.test(n)?parseInt(n,10):0;f(previewStyles.split(" "),function(s){var t=o.getStyle(l,s,true);if(s=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)){t=o.getStyle(p.getBody(),s,true);if(o.toHex(t).toLowerCase()=="#ffffff"){return}}if(s=="font-size"){if(/em|%$/.test(t)){if(n===0){return}t=parseFloat(t,10)/(/%$/.test(t)?100:1);t=(t*n)+"px"}}j+=s+":"+t+";"});o.remove(l);return j}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);n=k.settings;k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;if(!n.theme_advanced_buttons1){n=c({theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap"},n)}m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"top",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},n);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j<o.clientWidth){j=o.clientWidth;i.setStyle(p,"width",o.clientWidth)}}if(l&&m.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+k.id+"_size",{cw:j,ch:n})}},destroy:function(){var j=this.editor.id;g.clear(j+"_resize");g.clear(j+"_path_row");g.clear(j+"_external_close")},_simpleLayout:function(z,u,l,j){var y=this,v=y.editor,w=z.theme_advanced_toolbar_location,q=z.theme_advanced_statusbar_location,m,k,r,x;if(z.readonly){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});return k}if(w=="top"){y._addToolbars(u,l)}if(w=="external"){m=x=i.create("div",{style:"position:relative"});m=i.add(m,"div",{id:v.id+"_external","class":"mceExternalToolbar"});i.add(m,"a",{id:v.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});m=i.add(m,"table",{id:v.id+"_tblext",cellSpacing:0,cellPadding:0});r=i.add(m,"tbody");if(j.firstChild.className=="mceOldBoxModel"){j.firstChild.appendChild(x)}else{j.insertBefore(x,j.firstChild)}y._addToolbars(r,l);v.onMouseUp.add(function(){var o=i.get(v.id+"_external");i.show(o);i.hide(e);var n=g.add(v.id+"_external_close","click",function(){i.hide(v.id+"_external");g.remove(v.id+"_external_close","click",n);return false});i.show(o);i.setStyle(o,"top",0-i.getRect(v.id+"_tblext").h-1);i.hide(o);i.show(o);o.style.filter="";e=v.id+"_external";o=null})}if(q=="top"){y._addStatusBar(u,l)}if(!z.theme_advanced_toolbar_container){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"})}if(w=="bottom"){y._addToolbars(u,l)}if(q=="bottom"){y._addStatusBar(u,l)}return k},_rowLayout:function(x,p,l){var w=this,q=w.editor,v,y,j=q.controlManager,m,k,u,r;v=x.theme_advanced_containers_default_class||"";y=x.theme_advanced_containers_default_align||"center";f(d(x.theme_advanced_containers||""),function(s,o){var n=x["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":m=i.add(p,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":w._addStatusBar(p,l);break;default:r=(x["theme_advanced_container_"+s+"_align"]||y).toLowerCase();r="mce"+w._ufirst(r);m=i.add(i.add(p,"tr"),"td",{"class":"mceToolbar "+(x["theme_advanced_container_"+s+"_class"]||v)+" "+r||y});u=j.createToolbar("toolbar"+o);w._addControls(n,u);i.setHTML(m,u.renderHTML());l.deltaHeight-=x.theme_advanced_row_height}});return k},_addControls:function(k,j){var l=this,m=l.settings,n,o=l.editor.controlManager;if(m.theme_advanced_disable&&!l._disabled){n={};f(d(m.theme_advanced_disable),function(p){n[p]=1});l._disabled=n}else{n=l._disabled}f(d(k),function(q){var p;if(n&&n[q]){return}if(q=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(r){r=l.createControl(r,o);if(r){j.add(r)}});return}p=l.createControl(q,o);if(p){j.add(p)}})},_addToolbars:function(y,k){var B=this,q,p,u=B.editor,C=B.settings,A,j=u.controlManager,w,l,r=[],z,x,m=false;x=j.createToolbarGroup("toolbargroup",{name:u.getLang("advanced.toolbar"),tab_focus_toolbar:u.getParam("theme_advanced_tab_focus_toolbar")});B.toolbarGroup=x;z=C.theme_advanced_toolbar_align.toLowerCase();z="mce"+B._ufirst(z);l=i.add(i.add(y,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+z,role:"presentation"});for(q=1;(A=C["theme_advanced_buttons"+q]);q++){m=true;p=j.createToolbar("toolbar"+q,{"class":"mceToolbarRow"+q});if(C["theme_advanced_buttons"+q+"_add"]){A+=","+C["theme_advanced_buttons"+q+"_add"]}if(C["theme_advanced_buttons"+q+"_add_before"]){A=C["theme_advanced_buttons"+q+"_add_before"]+","+A}B._addControls(A,p);x.add(p);k.deltaHeight-=C.theme_advanced_row_height}if(!m){k.deltaHeight-=C.theme_advanced_row_height}r.push(x.renderHTML());r.push(i.createHTML("a",{href:"#",accesskey:"z",title:u.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+u.id+"').focus();"},"<!-- IE -->"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{},"&#160;")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true);q.nodeChanged()}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}u.setActive("visualaid",o.hasVisual);z._updateUndoStatus(o);u.setDisabled("outdent",!o.queryCommandState("Outdent"));D=q("A");if(H=u.get("link")){H.setDisabled((!D&&r)||(D&&!D.href));H.setActive(!!D&&(!D.name&&!D.id))}if(H=u.get("unlink")){H.setDisabled(!D&&r);H.setActive(!!D&&!D.name&&!D.id)}if(H=u.get("anchor")){H.setActive(!r&&!!D&&(D.name||(D.id&&!D.href)))}D=q("IMG");if(H=u.get("image")){H.setActive(!r&&!!D&&E.className.indexOf("mceItem")==-1)}if(H=u.get("styleselect")){z._importClasses();k=[];f(H.items,function(n){k.push(n.value)});j=o.formatter.matchAll(k);H.select(j[0]);h.each(j,function(p,n){if(n>0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file
+(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(p,m){var k,l,o=p.dom,j="",n,r;previewStyles=p.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function q(s){return s.replace(/%(\w+)/g,"")}k=m.block||m.inline||"span";l=o.create(k);f(m.styles,function(t,s){t=q(t);if(t){o.setStyle(l,s,t)}});f(m.attributes,function(t,s){t=q(t);if(t){o.setAttrib(l,s,t)}});f(m.classes,function(s){s=q(s);if(!o.hasClass(l,s)){o.addClass(l,s)}});o.setStyles(l,{position:"absolute",left:-65535});p.getBody().appendChild(l);n=o.getStyle(p.getBody(),"fontSize",true);n=/px$/.test(n)?parseInt(n,10):0;f(previewStyles.split(" "),function(s){var t=o.getStyle(l,s,true);if(s=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)){t=o.getStyle(p.getBody(),s,true);if(o.toHex(t).toLowerCase()=="#ffffff"){return}}if(s=="font-size"){if(/em|%$/.test(t)){if(n===0){return}t=parseFloat(t,10)/(/%$/.test(t)?100:1);t=(t*n)+"px"}}j+=s+":"+t+";"});o.remove(l);return j}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);n=k.settings;k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;if(!n.theme_advanced_buttons1){n=c({theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap"},n)}m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"top",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},n);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j<o.clientWidth){j=o.clientWidth;i.setStyle(p,"width",o.clientWidth)}}if(l&&m.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+k.id+"_size",{cw:j,ch:n})}},destroy:function(){var j=this.editor.id;g.clear(j+"_resize");g.clear(j+"_path_row");g.clear(j+"_external_close")},_simpleLayout:function(z,u,l,j){var y=this,v=y.editor,w=z.theme_advanced_toolbar_location,q=z.theme_advanced_statusbar_location,m,k,r,x;if(z.readonly){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});return k}if(w=="top"){y._addToolbars(u,l)}if(w=="external"){m=x=i.create("div",{style:"position:relative"});m=i.add(m,"div",{id:v.id+"_external","class":"mceExternalToolbar"});i.add(m,"a",{id:v.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});m=i.add(m,"table",{id:v.id+"_tblext",cellSpacing:0,cellPadding:0});r=i.add(m,"tbody");if(j.firstChild.className=="mceOldBoxModel"){j.firstChild.appendChild(x)}else{j.insertBefore(x,j.firstChild)}y._addToolbars(r,l);v.onMouseUp.add(function(){var o=i.get(v.id+"_external");i.show(o);i.hide(e);var n=g.add(v.id+"_external_close","click",function(){i.hide(v.id+"_external");g.remove(v.id+"_external_close","click",n);return false});i.show(o);i.setStyle(o,"top",0-i.getRect(v.id+"_tblext").h-1);i.hide(o);i.show(o);o.style.filter="";e=v.id+"_external";o=null})}if(q=="top"){y._addStatusBar(u,l)}if(!z.theme_advanced_toolbar_container){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"})}if(w=="bottom"){y._addToolbars(u,l)}if(q=="bottom"){y._addStatusBar(u,l)}return k},_rowLayout:function(x,p,l){var w=this,q=w.editor,v,y,j=q.controlManager,m,k,u,r;v=x.theme_advanced_containers_default_class||"";y=x.theme_advanced_containers_default_align||"center";f(d(x.theme_advanced_containers||""),function(s,o){var n=x["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":m=i.add(p,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":w._addStatusBar(p,l);break;default:r=(x["theme_advanced_container_"+s+"_align"]||y).toLowerCase();r="mce"+w._ufirst(r);m=i.add(i.add(p,"tr"),"td",{"class":"mceToolbar "+(x["theme_advanced_container_"+s+"_class"]||v)+" "+r||y});u=j.createToolbar("toolbar"+o);w._addControls(n,u);i.setHTML(m,u.renderHTML());l.deltaHeight-=x.theme_advanced_row_height}});return k},_addControls:function(k,j){var l=this,m=l.settings,n,o=l.editor.controlManager;if(m.theme_advanced_disable&&!l._disabled){n={};f(d(m.theme_advanced_disable),function(p){n[p]=1});l._disabled=n}else{n=l._disabled}f(d(k),function(q){var p;if(n&&n[q]){return}if(q=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(r){r=l.createControl(r,o);if(r){j.add(r)}});return}p=l.createControl(q,o);if(p){j.add(p)}})},_addToolbars:function(y,k){var B=this,q,p,u=B.editor,C=B.settings,A,j=u.controlManager,w,l,r=[],z,x,m=false;x=j.createToolbarGroup("toolbargroup",{name:u.getLang("advanced.toolbar"),tab_focus_toolbar:u.getParam("theme_advanced_tab_focus_toolbar")});B.toolbarGroup=x;z=C.theme_advanced_toolbar_align.toLowerCase();z="mce"+B._ufirst(z);l=i.add(i.add(y,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+z,role:"toolbar"});for(q=1;(A=C["theme_advanced_buttons"+q]);q++){m=true;p=j.createToolbar("toolbar"+q,{"class":"mceToolbarRow"+q});if(C["theme_advanced_buttons"+q+"_add"]){A+=","+C["theme_advanced_buttons"+q+"_add"]}if(C["theme_advanced_buttons"+q+"_add_before"]){A=C["theme_advanced_buttons"+q+"_add_before"]+","+A}B._addControls(A,p);x.add(p);k.deltaHeight-=C.theme_advanced_row_height}if(!m){k.deltaHeight-=C.theme_advanced_row_height}r.push(x.renderHTML());r.push(i.createHTML("a",{href:"#",accesskey:"z",title:u.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+u.id+"').focus();"},"<!-- IE -->"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{},"&#160;")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true);q.nodeChanged()}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}u.setActive("visualaid",o.hasVisual);z._updateUndoStatus(o);u.setDisabled("outdent",!o.queryCommandState("Outdent"));D=q("A");if(H=u.get("link")){H.setDisabled((!D&&r)||(D&&!D.href));H.setActive(!!D&&(!D.name&&!D.id))}if(H=u.get("unlink")){H.setDisabled(!D&&r);H.setActive(!!D&&!D.name&&!D.id)}if(H=u.get("anchor")){H.setActive(!r&&!!D&&(D.name||(D.id&&!D.href)))}D=q("IMG");if(H=u.get("image")){H.setActive(!r&&!!D&&E.className.indexOf("mceItem")==-1)}if(H=u.get("styleselect")){z._importClasses();k=[];f(H.items,function(n){k.push(n.value)});j=o.formatter.matchAll(k);H.select(j[0]);h.each(j,function(p,n){if(n>0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file
diff --git a/program/js/tiny_mce/themes/advanced/editor_template_src.js b/program/js/tiny_mce/themes/advanced/editor_template_src.js
index afd722d13..82166dcb6 100644
--- a/program/js/tiny_mce/themes/advanced/editor_template_src.js
+++ b/program/js/tiny_mce/themes/advanced/editor_template_src.js
@@ -150,7 +150,7 @@
init : function(ed, url) {
var t = this, s, v, o;
-
+
t.editor = ed;
t.url = url;
t.onResolveName = new tinymce.util.Dispatcher(this);
@@ -167,7 +167,7 @@
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap"
}, s);
}
-
+
// Default settings
t.settings = s = extend({
theme_advanced_path : true,
@@ -678,7 +678,7 @@
if (DOM.get(ed.id + '_path_row')) {
Event.add(ed.id + '_tbl', 'mouseover', function(e) {
var re;
-
+
e = e.target;
if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
@@ -956,7 +956,7 @@
a = s.theme_advanced_toolbar_align.toLowerCase();
a = 'mce' + t._ufirst(a);
- n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
+ n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"});
// Create toolbar and add the controls
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
@@ -986,7 +986,7 @@
var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
n = DOM.add(tb, 'tr');
- n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
+ n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
if (s.theme_advanced_path) {
DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
@@ -994,7 +994,7 @@
} else {
DOM.add(n, 'span', {}, '&#160;');
}
-
+
if (s.theme_advanced_resizing) {
DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});
@@ -1154,7 +1154,7 @@
if (!fn && n.style.fontFamily)
fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
-
+
if (!fc && n.style.color)
fc = n.style.color;
@@ -1185,7 +1185,7 @@
return true;
});
}
-
+
if (s.theme_advanced_show_current_color) {
function updateColor(controlId, color) {
if (c = cm.get(controlId)) {
diff --git a/program/js/tiny_mce/themes/advanced/langs/en_dlg.js b/program/js/tiny_mce/themes/advanced/langs/en_dlg.js
index e451f3774..50cd87e3d 100644
--- a/program/js/tiny_mce/themes/advanced/langs/en_dlg.js
+++ b/program/js/tiny_mce/themes/advanced/langs/en_dlg.js
@@ -1 +1 @@
-tinyMCE.addI18n('en.advanced_dlg',{"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","charmap_usage":"Use left and right arrows to navigate.","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value"}); \ No newline at end of file
+tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""});
diff --git a/program/js/tiny_mce/tiny_mce.js b/program/js/tiny_mce/tiny_mce.js
index af5a80293..208dfcc07 100644
--- a/program/js/tiny_mce/tiny_mce.js
+++ b/program/js/tiny_mce/tiny_mce.js
@@ -1 +1 @@
-(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.6",releaseDate:"2012-07-26",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){r=f[m].href;if(r){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==b}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==b){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];c.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];c.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(n,k){var j,f,h,g=arguments,m;for(j=1,f=g.length;j<f;j++){k=g[j];for(h in k){if(k.hasOwnProperty(h)){m=k[h];if(m!==b){n[h]=m}}}}return n},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){this.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}c.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}c.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this,g;g=function(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(e.detachEvent){e.detachEvent("onbeforeunload",k);e.detachEvent("onunload",g)}else{if(e.removeEventListener){e.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(e.CollectGarbage){CollectGarbage()}}};function k(){var l=document;function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l.readyState=="interactive"){if(l){l.attachEvent("onstop",f)}e.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}j={func:j,scope:i||this};if(!h.unloads){if(e.attachEvent){e.attachEvent("onunload",g);e.attachEvent("onbeforeunload",k)}else{if(e.addEventListener){e.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;c.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){if(!f||c.is(f,"array")){return f}return c.map(f.split(g||","),c.trim)},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(d){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===b){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};c._init();e.tinymce=e.tinyMCE=c})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,inDispatch:false,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(b,a){this.listeners.push({cb:b,scope:a||this.scope});return b},addToTop:function(d,b){var a=this,c={cb:d,scope:b||a.scope};if(a.inDispatch){a.listeners=[c].concat(a.listeners)}else{a.listeners.unshift(c)}return d},remove:function(c){var b=this.listeners,a=null;tinymce.each(b,function(e,d){if(c==e.cb){a=e;b.splice(d,1);return false}});return a},dispatch:function(){var a=this,e,b=arguments,c,d=a.listeners,f;a.inDispatch=true;for(c=0;c<d.length;c++){f=d[c];e=f.cb.apply(f.scope,b.length>0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(c,e,d){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,e,d)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey},metaKeyPressed:function(b){return a.isMac?b.metaKey:b.ctrlKey&&!b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var m=tinymce.VK,t=m.BACKSPACE,u=m.DELETE,p=d.dom,E=d.selection,s=d.settings;function c(I,H){try{d.getDoc().execCommand(I,false,H)}catch(G){}}function z(){var G=d.getDoc().documentMode;return G?G:6}function j(){function G(J){var H,L,I,K;H=E.getRng();L=p.getParent(H.startContainer,p.isBlock);if(J){L=p.getNext(L,p.isBlock)}if(L){I=L.firstChild;while(I&&I.nodeType==3&&I.nodeValue.length===0){I=I.nextSibling}if(I&&I.nodeName==="SPAN"){K=I.cloneNode(false)}}d.getDoc().execCommand(J?"ForwardDelete":"Delete",false,null);L=p.getParent(H.startContainer,p.isBlock);tinymce.each(p.select("span.Apple-style-span,font.Apple-style-span",L),function(M){var N=E.getBookmark();if(K){p.replace(K.cloneNode(false),M,true)}else{p.remove(M,true)}E.moveToBookmark(N)})}d.onKeyDown.add(function(H,J){var I;I=J.keyCode==u;if(!J.isDefaultPrevented()&&(I||J.keyCode==t)&&!m.modifierPressed(J)){J.preventDefault();G(I)}});d.addCommand("Delete",function(){G()})}function F(){function G(J){var I=p.create("body");var K=J.cloneContents();I.appendChild(K);return E.serializer.serialize(I,{format:"html"})}function H(I){var K=G(I);var L=p.createRng();L.selectNode(d.getBody());var J=G(L);return K===J}d.onKeyDown.add(function(J,L){var K=L.keyCode,I;if(!L.isDefaultPrevented()&&(K==u||K==t)){I=J.selection.isCollapsed();if(I&&!p.isEmpty(J.getBody())){return}if(tinymce.isIE&&!I){return}if(!I&&!H(J.selection.getRng())){return}J.setContent("");J.selection.setCursorLocation(J.getBody(),0);J.nodeChanged()}})}function x(){d.onKeyDown.add(function(G,H){if(H.keyCode==65&&m.metaKeyPressed(H)){H.preventDefault();G.execCommand("SelectAll")}})}function y(){if(!d.settings.content_editable){p.bind(d.getDoc(),"focusin",function(G){E.setRng(E.getRng())});p.bind(d.getDoc(),"mousedown",function(G){if(G.target==d.getDoc().documentElement){d.getWin().focus();E.setRng(E.getRng())}})}}function n(){d.onKeyDown.add(function(G,J){if(!J.isDefaultPrevented()&&J.keyCode===t){if(E.isCollapsed()&&E.getRng(true).startOffset===0){var I=E.getNode();var H=I.previousSibling;if(H&&H.nodeName&&H.nodeName.toLowerCase()==="hr"){p.remove(H);tinymce.dom.Event.cancel(J)}}}})}function b(){if(!Range.prototype.getClientRects){d.onMouseDown.add(function(H,I){if(I.target.nodeName==="HTML"){var G=H.getBody();G.blur();setTimeout(function(){G.focus()},0)}})}}function B(){d.onClick.add(function(G,H){H=H.target;if(/^(IMG|HR)$/.test(H.nodeName)){E.getSel().setBaseAndExtent(H,0,H,1)}if(H.nodeName=="A"&&p.hasClass(H,"mceItemAnchor")){E.select(H)}G.nodeChanged()})}function C(){function H(){var J=p.getAttribs(E.getStart().cloneNode(false));return function(){var K=E.getStart();if(K!==d.getBody()){p.setAttrib(K,"style",null);tinymce.each(J,function(L){K.setAttributeNode(L.cloneNode(true))})}}}function G(){return !E.isCollapsed()&&p.getParent(E.getStart(),p.isBlock)!=p.getParent(E.getEnd(),p.isBlock)}function I(J,K){K.preventDefault();return false}d.onKeyPress.add(function(J,L){var K;if((L.keyCode==8||L.keyCode==46)&&G()){K=H();J.getDoc().execCommand("delete",false,null);K();L.preventDefault();return false}});p.bind(d.getDoc(),"cut",function(K){var J;if(G()){J=H();d.onKeyUp.addToTop(I);setTimeout(function(){J();d.onKeyUp.remove(I)},0)}})}function k(){var H,G;p.bind(d.getDoc(),"selectionchange",function(){if(G){clearTimeout(G);G=0}G=window.setTimeout(function(){var I=E.getRng();if(!H||!tinymce.dom.RangeUtils.compareRanges(I,H)){d.nodeChanged();H=I}},50)})}function D(){document.body.setAttribute("role","application")}function A(){d.onKeyDown.add(function(G,I){if(!I.isDefaultPrevented()&&I.keyCode===t){if(E.isCollapsed()&&E.getRng(true).startOffset===0){var H=E.getNode().previousSibling;if(H&&H.nodeName&&H.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(I)}}}})}function h(){if(z()>7){return}c("RespectVisibilityInDesign",true);d.contentStyles.push(".mceHideBrInPre pre br {display: none}");p.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(G,I){var J=G.length,L,H,M,K;while(J--){L=G[J].getAll("br");H=L.length;while(H--){M=L[H];K=M.prev;if(K&&K.type===3&&K.value.charAt(K.value-1)!="\n"){K.value+="\n"}else{M.parent.insert(new tinymce.html.Node("#text",3),M,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(G,I){var J=G.length,L,H,M,K;while(J--){L=G[J].getAll("br");H=L.length;while(H--){M=L[H];K=M.prev;if(K&&K.type==3){K.value=K.value.replace(/\r?\n$/,"")}}}})}function f(){p.bind(d.getBody(),"mouseup",function(I){var H,G=E.getNode();if(G.nodeName=="IMG"){if(H=p.getStyle(G,"width")){p.setAttrib(G,"width",H.replace(/[^0-9%]+/g,""));p.setStyle(G,"width","")}if(H=p.getStyle(G,"height")){p.setAttrib(G,"height",H.replace(/[^0-9%]+/g,""));p.setStyle(G,"height","")}}})}function r(){d.onKeyDown.add(function(M,N){var L,G,H,J,K,O,I;L=N.keyCode==u;if(!N.isDefaultPrevented()&&(L||N.keyCode==t)&&!m.modifierPressed(N)){G=E.getRng();H=G.startContainer;J=G.startOffset;I=G.collapsed;if(H.nodeType==3&&H.nodeValue.length>0&&((J===0&&!I)||(I&&J===(L?0:1)))){nonEmptyElements=M.schema.getNonEmptyElements();N.preventDefault();K=p.create("br",{id:"__tmp"});H.parentNode.insertBefore(K,H);M.getDoc().execCommand(L?"ForwardDelete":"Delete",false,null);H=E.getRng().startContainer;O=H.previousSibling;if(O&&O.nodeType==1&&!p.isBlock(O)&&p.isEmpty(O)&&!nonEmptyElements[O.nodeName.toLowerCase()]){p.remove(O)}p.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(K,L){var I,H,M,G,J;if(L.isDefaultPrevented()||L.keyCode!=m.BACKSPACE){return}I=E.getRng();H=I.startContainer;M=I.startOffset;G=p.getRoot();J=H;if(!I.collapsed||M!==0){return}while(J&&J.parentNode&&J.parentNode.firstChild==J&&J.parentNode!=G){J=J.parentNode}if(J.tagName==="BLOCKQUOTE"){K.formatter.toggle("blockquote",null,J);I.setStart(H,0);I.setEnd(H,0);E.setRng(I);E.collapse(false)}})}function l(){function G(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!s.object_resizing){c("enableObjectResizing",false)}}if(!s.readonly){d.onBeforeExecCommand.add(G);d.onMouseDown.add(G)}}function o(){function G(H,I){tinymce.each(p.select("a"),function(L){var J=L.parentNode,K=p.getRoot();if(J.lastChild===L){while(J&&!p.isBlock(J)){if(J.parentNode.lastChild!==J||J===K){return}J=J.parentNode}p.add(J,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(H,I){if(I==="CreateLink"){G(H)}});d.onSetContent.add(E.onSetContent.add(G))}function v(){if(s.forced_root_block){d.onInit.add(function(){c("DefaultParagraphSeparator",s.forced_root_block)})}}function a(){function G(I,H){if(!I||!H.initial){d.execCommand("mceRepaint")}}d.onUndo.add(G);d.onRedo.add(G);d.onSetContent.add(G)}function q(){d.onKeyDown.add(function(H,I){var G;if(!I.isDefaultPrevented()&&I.keyCode==t){G=H.getDoc().selection.createRange();if(G&&G.item){I.preventDefault();H.undoManager.beforeChange();p.remove(G.item(0));H.undoManager.add()}}})}function i(){var G;if(z()>=10){G="";tinymce.each("p div h1 h2 h3 h4 h5 h6".split(" "),function(H,I){G+=(I>0?",":"")+H+":empty"});d.contentStyles.push(G+"{padding-right: 1px !important}")}}function g(){var I,H,Y,G,T,W,U,X,J,K,V,R,Q,S=document,O=d.getDoc();if(!s.object_resizing||s.webkit_fake_resize===false){return}c("enableObjectResizing",false);V={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};function M(ac){var ab,aa;ab=ac.screenX-W;aa=ac.screenY-U;R=ab*T[2]+X;Q=aa*T[3]+J;R=R<5?5:R;Q=Q<5?5:Q;if(m.modifierPressed(ac)||(Y.nodeName=="IMG"&&T[2]*T[3]!==0)){R=Math.round(Q/K);Q=Math.round(R*K)}p.setStyles(G,{width:R,height:Q});if(T[2]<0&&G.clientWidth<=R){p.setStyle(G,"left",I+(X-R))}if(T[3]<0&&G.clientHeight<=Q){p.setStyle(G,"top",H+(J-Q))}}function Z(){function aa(ab,ac){if(ac){if(Y.style[ab]||!d.schema.isValid(Y.nodeName.toLowerCase(),ab)){p.setStyle(Y,ab,ac)}else{p.setAttrib(Y,ab,ac)}}}aa("width",R);aa("height",Q);p.unbind(O,"mousemove",M);p.unbind(O,"mouseup",Z);if(S!=O){p.unbind(S,"mousemove",M);p.unbind(S,"mouseup",Z)}p.remove(G);L(Y)}function L(ad){var ab,ac,aa;N();ab=p.getPos(ad);I=ab.x;H=ab.y;ac=ad.offsetWidth;aa=ad.offsetHeight;if(Y!=ad){Y=ad;R=Q=0}tinymce.each(V,function(ag,ae){var af;af=p.get("mceResizeHandle"+ae);if(!af){af=p.add(O.documentElement,"div",{id:"mceResizeHandle"+ae,"class":"mceResizeHandle",style:"cursor:"+ae+"-resize; margin:0; padding:0"});p.bind(af,"mousedown",function(ah){ah.preventDefault();Z();W=ah.screenX;U=ah.screenY;X=Y.clientWidth;J=Y.clientHeight;K=J/X;T=ag;G=Y.cloneNode(true);p.addClass(G,"mceClonedResizable");p.setStyles(G,{left:I,top:H,margin:0});O.documentElement.appendChild(G);p.bind(O,"mousemove",M);p.bind(O,"mouseup",Z);if(S!=O){p.bind(S,"mousemove",M);p.bind(S,"mouseup",Z)}})}else{p.show(af)}p.setStyles(af,{left:(ac*ag[0]+I)-(af.offsetWidth/2),top:(aa*ag[1]+H)-(af.offsetHeight/2)})});if(!tinymce.isOpera&&Y.nodeName=="IMG"){Y.setAttribute("data-mce-selected","1")}}function N(){if(Y){Y.removeAttribute("data-mce-selected")}for(var aa in V){p.hide("mceResizeHandle"+aa)}}d.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}");function P(){var aa=p.getParent(E.getNode(),"table,img");tinymce.each(p.select("img[data-mce-selected]"),function(ab){ab.removeAttribute("data-mce-selected")});if(aa){L(aa)}else{N()}}d.onNodeChange.add(P);p.bind(O,"selectionchange",P);d.serializer.addAttributeFilter("data-mce-selected",function(aa,ab){var ac=aa.length;while(ac--){aa[ac].attr(ab,null)}})}A();e();F();if(tinymce.isWebKit){r();j();y();B();v();if(tinymce.isIDevice){k()}else{g();x()}}if(tinymce.isIE){n();D();h();f();q();i()}if(tinymce.isGecko){n();b();C();l();o();a()}if(tinymce.isOpera){g()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"};d={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g<j.length;g++){a[j[g]]="\uFEFF"+g;a["\uFEFF"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K<G;K++){F=N.exec(L[K]);if(F){W=F[1];Q=F[2];E=F[3];X=F[4];O={};J=[];I={attributes:O,attributesOrder:J};if(W==="#"){I.paddEmpty=true}if(W==="-"){I.removeEmpty=true}if(S){for(ad in S){O[ad]=S[ad]}J.push.apply(J,H)}if(X){X=d(X,"|");for(Z=0,V=X.length;Z<V;Z++){F=R.exec(X[Z]);if(F){U={};ac=F[1];Y=F[2].replace(/::/g,":");W=F[3];T=F[4];if(ac==="!"){I.attributesRequired=I.attributesRequired||[];I.attributesRequired.push(Y);U.required=true}if(ac==="-"){delete O[Y];J.splice(f.inArray(J,Y),1);continue}if(W){if(W==="="){I.attributesDefault=I.attributesDefault||[];I.attributesDefault.push({name:Y,value:T});U.defaultValue=T}if(W===":"){I.attributesForced=I.attributesForced||[];I.attributesForced.push({name:Y,value:T});U.forcedValue=T}if(W==="<"){U.validValues=e(T,"?")}}if(M.test(Y)){I.attributePatterns=I.attributePatterns||[];U.pattern=i(Y);I.attributePatterns.push(U)}else{if(!O[Y]){J.push(Y)}O[Y]=U}}}}if(!S&&Q=="@"){S=O;H=J}if(E){I.outputName=Q;s[E]=I}if(M.test(Q)){I.pattern=i(Q);j.push(I)}else{s[Q]=I}}}}}function t(E){s={};j=[];C(E);g(y,function(G,F){k[F]=G.children})}function l(F){var E=/^(~)?(.+)$/;if(F){g(d(F),function(J){var H=E.exec(J),I=H[1]==="~",K=I?"span":"div",G=H[2];k[G]=k[K];p[G]=K;if(!I){v[G]={}}g(k,function(L,M){if(L[K]){L[G]=L[K]}})})}}function x(F){var E=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(F){g(d(F),function(J){var I=E.exec(J),G,H;if(I){H=I[1];if(H){G=k[I[2]]}else{G=k[I[2]]={"#comment":{}}}G=k[I[2]];g(d(I[3],"|"),function(K){if(H==="-"){delete G[K]}else{G[K]={}}})}})}}function B(E){var G=s[E],F;if(G){return G}F=j.length;while(F--){G=j[F];if(G.pattern.test(E)){return G}}}if(!A.valid_elements){g(y,function(F,E){s[E]={attributes:F.attributes,attributesOrder:F.attributesOrder};k[E]=F.children});if(A.schema!="html5"){g(d("strong/b,em/i"),function(E){E=d(E,"/");s[E[1]].outputName=E[0]})}s.img.attributesDefault=[{name:"alt",value:""}];g(d("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i"),function(E){if(s[E]){s[E].removeEmpty=true}});g(d("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(E){s[E].paddEmpty=true})}else{t(A.valid_elements)}l(A.custom_elements);x(A.valid_children);C(A.extended_valid_elements);x("+ol[ul|ol],+ul[ul|ol]");if(A.invalid_elements){f.each(f.explode(A.invalid_elements),function(E){if(s[E]){delete s[E]}})}if(!B("span")){C("span[!data-mce-type|*]")}u.children=k;u.styles=D;u.getBoolAttrs=function(){return r};u.getBlockElements=function(){return v};u.getShortEndedElements=function(){return z};u.getSelfClosingElements=function(){return q};u.getNonEmptyElements=function(){return n};u.getWhiteSpaceElements=function(){return o};u.isValidChild=function(E,G){var F=k[E];return !!(F&&F[G])};u.isValid=function(F,E){var H,G,I=B(F);if(I){if(E){if(I.attributes[E]){return true}H=I.attributePatterns;if(H){G=H.length;while(G--){if(H[G].pattern.test(F)){return true}}}}else{return true}}return false};u.getElementRule=B;u.getCustomElements=function(){return p};u.addValidElements=C;u.setValidElements=t;u.addCustomElements=l;u.addValidChildren=x}})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(E){var n=this,g,G=0,I,B,A=[],N,Q,C,r,z,s,M,H,O,v,m,k,t,R,o,P,F,S,L,f,J,l,D,K,h,x=0,j=a.html.Entities.decode,y,q;function u(T){var V,U;V=A.length;while(V--){if(A[V].name===T){break}}if(V>=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G<g.index){n.text(j(E.substr(G,g.index-G)))}if(I=g[6]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}u(I)}else{if(I=g[7]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}O=I in M;if(y&&J[I]&&A.length>0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G<E.length){n.text(j(E.substr(G)))}for(Q=A.length-1;Q>=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-")===0){return false}}}if(j.type===8){return false}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true},walk:function(f){return a(this,null,f)}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(m){var o,p,x,v,z,n,q,l,t,u,k,s,y,r;s=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();for(o=0;o<m.length;o++){p=m[o];if(!p.parent){continue}v=[p];for(x=p.parent;x&&!h.isValidChild(x.name,p.name)&&!s[x.name];x=x.parent){v.push(x)}if(x&&v.length>1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t<v.length-1;t++){if(h.isValidChild(n.name,v[t].name)){q=f.filterNode(v[t].clone());n.append(q)}else{q=n}for(l=v[t].firstChild;l&&l!=v[t+1];){r=l.next;q.append(l);l=r}n=q}if(!z.isEmpty(k)){x.insert(z,v[0],true);x.insert(p,z)}else{x.insert(p,v[0],true)}x=v[0];if(x.isEmpty(k)||x.firstChild===x.lastChild&&x.firstChild.name==="br"){x.empty().remove()}}else{if(p.parent){if(p.name==="li"){y=p.prev;if(y&&(y.name==="ul"||y.name==="ul")){y.append(p);continue}y=p.next;if(y&&(y.name==="ul"||y.name==="ul")){y.insert(p,y.firstChild,true);continue}p.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(p.parent.name,"div")&&h.isValidChild("div",p.name)){p.wrap(f.filterNode(new a("div",1)))}else{if(p.name==="style"||p.name==="script"){p.empty().remove()}else{p.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(v,m){var n,J,B,A,D,C,x,r,F,N,z,o,E,M=[],L,t,k,y,s,p,u,q;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());u=h.getNonEmptyElements();p=h.children;z=g.validate;q="forced_root_block" in m?m.forced_root_block:g.forced_root_block;s=h.getWhiteSpaceElements();E=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;y=/^[ \t\r\n]+$/;function G(){var O=J.firstChild,l,P;while(O){l=O.next;if(O.type==3||(O.type==1&&O.name!=="p"&&!o[O.name]&&!O.attr("data-mce-type"))){if(!P){P=K(q,1);J.insert(P,O);P.append(O)}else{P.append(O)}}else{P=null}O=l}}function K(l,O){var P=new a(l,O),Q;if(l in e){Q=i[l];if(Q){Q.push(P)}else{i[l]=[P]}}return P}function I(P){var Q,l,O;for(Q=P.prev;Q&&Q.type===3;){l=Q.value.replace(t,"");if(l.length>0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}S=B.prev;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R}else{S.remove()}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D<C;D++){F[D](A,N,m)}}for(D=0,C=d.length;D<C;D++){F=d[D];if(F.name in c){A=c[F.name];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(x=0,r=F.callbacks.length;x<r;x++){F.callbacks[x](A,F.name,m)}}}}return J};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,v=b.extend({},h.getBlockElements()),k=h.getNonEmptyElements(),t,s,p,u;v.body=1;for(r=0;r<q;r++){o=n[r];t=o.parent;if(v[o.parent.name]&&o===t.lastChild){p=o.prev;while(p){u=p.name;if(u!=="span"||p.attr("data-mce-type")!=="bookmark"){if(u!=="br"){break}if(u==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(t.isEmpty(k)){elementRule=h.getElementRule(t.name);if(elementRule){if(elementRule.removeEmpty){t.remove()}else{if(elementRule.paddEmpty){t.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}else{s=o;while(t.firstChild===s&&t.lastChild===s){s=t;if(v[t.name]){break}t=t.parent}if(s===t){textNode=new b.html.Node("#text",3);textNode.value="\u00a0";o.replace(textNode)}}}})}if(!g.allow_html_in_named_anchor){f.addAttributeFilter("id,name",function(k,l){var n=k.length,p,m,o,q;while(n--){q=k[n];if(q.name==="a"&&q.firstChild&&!q.attr("href")){o=q.parent;p=q.lastChild;do{m=p.prev;o.insert(p,q);p=m}while(p)}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);tinymce.dom={};(function(b,h){var g=!!document.addEventListener;function c(k,j,l,i){if(k.addEventListener){k.addEventListener(j,l,i||false)}else{if(k.attachEvent){k.attachEvent("on"+j,l)}}}function e(k,j,l,i){if(k.removeEventListener){k.removeEventListener(j,l,i||false)}else{if(k.detachEvent){k.detachEvent("on"+j,l)}}}function a(n,l){var i,k=l||{};function j(){return false}function m(){return true}for(i in n){if(i!=="layerX"&&i!=="layerY"){k[i]=n[i]}}if(!k.target){k.target=k.srcElement||document}k.preventDefault=function(){k.isDefaultPrevented=m;if(n){if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}}};k.stopPropagation=function(){k.isPropagationStopped=m;if(n){if(n.stopPropagation){n.stopPropagation()}else{n.cancelBubble=true}}};k.stopImmediatePropagation=function(){k.isImmediatePropagationStopped=m;k.stopPropagation()};if(!k.isDefaultPrevented){k.isDefaultPrevented=j;k.isPropagationStopped=j;k.isImmediatePropagationStopped=j}return k}function d(m,n,l){var k=m.document,j={type:"ready"};function i(){if(!l.domLoaded){l.domLoaded=true;n(j)}}if(g){c(m,"DOMContentLoaded",i)}else{c(k,"readystatechange",function(){if(k.readyState==="complete"){e(k,"readystatechange",arguments.callee);i()}});if(k.documentElement.doScroll&&m===m.top){(function(){try{k.documentElement.doScroll("left")}catch(o){setTimeout(arguments.callee,0);return}i()})()}}c(m,"load",i)}function f(k){var q=this,p={},i,o,n,m,l;m="onmouseenter" in document.documentElement;n="onfocusin" in document.documentElement;l={mouseenter:"mouseover",mouseleave:"mouseout"};i=1;q.domLoaded=false;q.events=p;function j(t,x){var s,u,r,v;s=p[x][t.type];if(s){for(u=0,r=s.length;u<r;u++){v=s[u];if(v&&v.func.call(v.scope,t)===false){t.preventDefault()}if(t.isImmediatePropagationStopped()){return}}}}q.bind=function(x,A,D,E){var s,t,u,r,B,z,C,v=window;function y(F){j(a(F||v.event),s)}if(!x||x.nodeType===3||x.nodeType===8){return}if(!x[h]){s=i++;x[h]=s;p[s]={}}else{s=x[h];if(!p[s]){p[s]={}}}E=E||x;A=A.split(" ");u=A.length;while(u--){r=A[u];z=y;B=C=false;if(r==="DOMContentLoaded"){r="ready"}if((q.domLoaded||x.readyState=="complete")&&r==="ready"){q.domLoaded=true;D.call(E,a({type:r}));continue}if(!m){B=l[r];if(B){z=function(F){var H,G;H=F.currentTarget;G=F.relatedTarget;if(G&&H.contains){G=H.contains(G)}else{while(G&&G!==H){G=G.parentNode}}if(!G){F=a(F||v.event);F.type=F.type==="mouseout"?"mouseleave":"mouseenter";F.target=H;j(F,s)}}}}if(!n&&(r==="focusin"||r==="focusout")){C=true;B=r==="focusin"?"focus":"blur";z=function(F){F=a(F||v.event);F.type=F.type==="focus"?"focusin":"focusout";j(F,s)}}t=p[s][r];if(!t){p[s][r]=t=[{func:D,scope:E}];t.fakeName=B;t.capture=C;t.nativeHandler=z;if(!g){t.proxyHandler=k(s)}if(r==="ready"){d(x,z,q)}else{c(x,B||r,g?z:t.proxyHandler,C)}}else{t.push({func:D,scope:E})}}x=t=0;return D};q.unbind=function(x,z,A){var s,u,v,B,r,t;if(!x||x.nodeType===3||x.nodeType===8){return q}s=x[h];if(s){t=p[s];if(z){z=z.split(" ");v=z.length;while(v--){r=z[v];u=t[r];if(u){if(A){B=u.length;while(B--){if(u[B].func===A){u.splice(B,1)}}}if(!A||u.length===0){delete t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}}}}else{for(r in t){u=t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}t={}}for(r in t){return q}delete p[s];try{delete x[h]}catch(y){x[h]=null}}return q};q.fire=function(u,s,r){var v,t;if(!u||u.nodeType===3||u.nodeType===8){return q}t=a(null,r);t.type=s;do{v=u[h];if(v){j(t,v)}u=u.parentNode||u.ownerDocument||u.defaultView||u.parentWindow}while(u&&!t.isPropagationStopped());return q};q.clean=function(u){var s,r,t=q.unbind;if(!u||u.nodeType===3||u.nodeType===8){return q}if(u[h]){t(u)}if(!u.getElementsByTagName){u=u.document}if(u&&u.getElementsByTagName){t(u);r=u.getElementsByTagName("*");s=r.length;while(s--){u=r[s];if(u[h]){t(u)}}}return q};q.callNativeHandler=function(s,r){if(p){p[s][r.type].nativeHandler(r)}};q.destory=function(){p={}};q.add=function(v,s,u,t){if(typeof(v)==="string"){v=document.getElementById(v)}if(v&&v instanceof Array){var r=v.length;while(r--){q.add(v[r],s,u,t)}return}if(s==="init"){s="ready"}return q.bind(v,s instanceof Array?s.join(" "):s,u,t)};q.remove=function(v,s,u,t){if(!v){return q}if(typeof(v)==="string"){v=document.getElementById(v)}if(v instanceof Array){var r=v.length;while(r--){q.remove(v[r],s,u,t)}return q}return q.unbind(v,s instanceof Array?s.join(" "):s,u)};q.clear=function(r){if(typeof(r)==="string"){r=document.getElementById(r)}return q.clean(r)};q.cancel=function(r){if(r){q.prevent(r);q.stop(r)}return false};q.prevent=function(r){if(!r.preventDefault){r=a(r)}r.preventDefault();return false};q.stop=function(r){if(!r.stopPropagation){r=a(r)}r.stopPropagation();return false}}b.EventUtils=f;b.Event=new f(function(i){return function(j){tinymce.dom.Event.callNativeHandler(i,j)}});b.Event.bind(window,"ready",function(){});b=0})(tinymce.dom,"data-mce-expando");tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(e){var g=e.each,d=e.is,f=e.isWebKit,b=e.isIE,h=e.html.Entities,c=/^([a-z0-9],?)+$/i,a=/^[ \t\r\n]*$/;e.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(o,l){var k=this,i,j,n;k.doc=o;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!e.isIE||o.documentMode>=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+"</"+q+">"}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},addStyle:function(j){var k=this.doc,i;styleElm=k.getElementById("mceDefaultStyles");if(!styleElm){styleElm=k.createElement("style"),styleElm.id="mceDefaultStyles";styleElm.type="text/css";i=k.getElementsByTagName("head")[0];if(i.firstChild){i.insertBefore(styleElm,i.firstChild)}else{i.appendChild(styleElm)}}if(styleElm.styleSheet){styleElm.styleSheet.cssText+=j}else{styleElm.appendChild(k.createTextNode(j))}},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="<br />"+j;m.removeChild(m.firstChild)}catch(l){var n=i.create("div");n.innerHTML="<br />"+j;g(e.grep(n.childNodes),function(p,o){if(o&&m.canHaveHTML){m.appendChild(p)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab<aa){return -1}return 1}ac=X;while(ac&&ac.parentNode!=Z){ac=ac.parentNode}if(ac){Y=0;t=Z.firstChild;while(t!=ac&&Y<ab){Y++;t=t.nextSibling}if(ab<=Y){return -1}return 1}ac=Z;while(ac&&ac.parentNode!=X){ac=ac.parentNode}if(ac){Y=0;t=X.firstChild;while(t!=ac&&Y<aa){Y++;t=t.nextSibling}if(Y<aa){return -1}return 1}ad=c.findCommonAncestor(Z,X);af=Z;while(af&&af.parentNode!=ad){af=af.parentNode}if(!af){af=ad}ae=X;while(ae&&ae.parentNode!=ad){ae=ae.parentNode}if(!ae){ae=ad}if(af==ae){return 0}t=ad.firstChild;while(t){if(t==af){return -1}if(t==ae){return 1}t=t.nextSibling}}function C(X,aa,Z){var t,Y;if(X){O[h]=aa;O[W]=Z}else{O[Q]=aa;O[A]=Z}t=O[Q];while(t.parentNode){t=t.parentNode}Y=O[h];while(Y.parentNode){Y=Y.parentNode}if(Y==t){if(H(O[h],O[W],O[Q],O[A])>0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,v,q,t,s=d.dom.doc,m=s.body,r,u;function j(C){var y,B,x,A,z;x=h.create("a");y=C?k:v;B=C?p:q;A=n.duplicate();if(y==s||y==s.documentElement){y=m;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);h.remove(x);n.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){h.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{if(y.canHaveHTML){y.innerHTML="<span>\uFEFF</span>";x=y.firstChild;A.moveToElementText(x);A.collapse(f)}}n.setEndPoint(C?"StartToStart":"EndToEnd",A);h.remove(x)}}k=i.startContainer;p=i.startOffset;v=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==v&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){t=k.previousSibling;if(t&&!t.hasChildNodes()&&h.isBlock(t)){t.innerHTML="\uFEFF"}else{t=null}k.innerHTML="<span>\uFEFF</span><span>\uFEFF</span>";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(t){t.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{u=k.childNodes[p];l=m.createControlRange();l.addElement(u);l.select();r=d.getRng();if(r.item&&u===r.item(0)){return}}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e<y.length;e++){if(y[e]===y[e-1]){y.splice(e--,1)}}}}return y};d.matches=function(e,y){return d(e,null,null,y)};d.matchesSelector=function(e,y){return d(y,null,null,[e]).length>0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z<B;z++){C=k.order[z];if((A=k.leftMatch[C].exec(E))){y=A[1];A.splice(1,1);if(y.substr(y.length-1)!=="\\"){A[1]=(A[1]||"").replace(q,"");D=k.find[C](A,e,F);if(D!=null){E=E.replace(k.match[C],"");break}}}}if(!D){D=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:D,expr:E}};d.filter=function(I,H,L,B){var D,e,G,N,K,y,A,C,J,z=I,M=[],F=H,E=H&&H[0]&&d.isXML(H[0]);while(I&&H.length){for(G in k.filter){if((D=k.leftMatch[G].exec(I))!=null&&D[2]){y=k.filter[G];A=D[1];e=false;D.splice(1,1);if(A.substr(A.length-1)==="\\"){continue}if(F===M){M=[]}if(k.preFilter[G]){D=k.preFilter[G](D,F,L,M,B,E);if(!D){e=N=true}else{if(D===true){continue}}}if(D){for(C=0;(K=F[C])!=null;C++){if(K){N=y(K,D,C,F);J=B^N;if(L&&N!=null){if(J){e=true}else{F[C]=false}}else{if(J){M.push(K);e=true}}}}}if(N!==undefined){if(!L){F=M}I=I.replace(k.match[G],"");if(!e){return[]}break}}}if(I===z){if(e==null){d.error(I)}else{break}}z=I}return F};d.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var b=d.getText=function(B){var z,A,e=B.nodeType,y="";if(e){if(e===1||e===9||e===11){if(typeof B.textContent==="string"){return B.textContent}else{if(typeof B.innerText==="string"){return B.innerText.replace(u,"")}else{for(B=B.firstChild;B;B=B.nextSibling){y+=b(B)}}}}else{if(e===3||e===4){return B.nodeValue}}}else{for(z=0;(A=B[z]);z++){if(A.nodeType!==8){y+=b(A)}}}return y};var k=d.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(D,y){var A=typeof y==="string",C=A&&!x.test(y),E=A&&!C;if(C){y=y.toLowerCase()}for(var z=0,e=D.length,B;z<e;z++){if((B=D[z])){while((B=B.previousSibling)&&B.nodeType!==1){}D[z]=E||B&&B.nodeName.toLowerCase()===y?B||false:B===y}}if(E){d.filter(y,D,true)}},">":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z<e;z++){C=D[z];if(C){var A=C.parentNode;D[z]=A.nodeName.toLowerCase()===y?A:false}}}else{for(;z<e;z++){C=D[z];if(C){D[z]=B?C.parentNode:C.parentNode===y}}if(B){d.filter(y,D,true)}}},"":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("parentNode",y,z,A,B,C)},"~":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("previousSibling",y,z,A,B,C)}},find:{ID:function(y,z,A){if(typeof z.getElementById!=="undefined"&&!A){var e=z.getElementById(y[1]);return e&&e.parentNode?[e]:[]}},NAME:function(z,C){if(typeof C.getElementsByName!=="undefined"){var y=[],B=C.getElementsByName(z[1]);for(var A=0,e=B.length;A<e;A++){if(B[A].getAttribute("name")===z[1]){y.push(B[A])}}return y.length===0?null:y}},TAG:function(e,y){if(typeof y.getElementsByTagName!=="undefined"){return y.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(A,y,z,e,D,E){A=" "+A[1].replace(q,"")+" ";if(E){return A}for(var B=0,C;(C=y[B])!=null;B++){if(C){if(D^(C.className&&(" "+C.className+" ").replace(/[\t\n\r]/g," ").indexOf(A)>=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return y<e[3]-0},gt:function(z,y,e){return y>e[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C<B;C++){if(A[C]===z){return false}}return true}else{d.error(e)}}}},CHILD:function(z,B){var A,H,D,G,e,C,F,E=B[1],y=z;switch(E){case"only":case"first":while((y=y.previousSibling)){if(y.nodeType===1){return false}}if(E==="first"){return true}y=z;case"last":while((y=y.nextSibling)){if(y.nodeType===1){return false}}return true;case"nth":A=B[2];H=B[3];if(A===1&&H===0){return true}D=B[0];G=z.parentNode;if(G&&(G[i]!==D||!z.nodeIndex)){C=0;for(y=G.firstChild;y;y=y.nextSibling){if(y.nodeType===1){y.nodeIndex=++C}}G[i]=D}F=z.nodeIndex-H;if(A===0){return F===0}else{return(F%A===0&&F/A>=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z<e;z++){y.push(B[z])}}else{for(;B[z];z++){y.push(B[z])}}}return y}}var p,m;if(document.documentElement.compareDocumentPosition){p=function(y,e){if(y===e){h=true;return 0}if(!y.compareDocumentPosition||!e.compareDocumentPosition){return y.compareDocumentPosition?-1:1}return y.compareDocumentPosition(e)&4?-1:1}}else{p=function(F,E){if(F===E){h=true;return 0}else{if(F.sourceIndex&&E.sourceIndex){return F.sourceIndex-E.sourceIndex}}var C,y,z=[],e=[],B=F.parentNode,D=E.parentNode,G=B;if(B===D){return m(F,E)}else{if(!B){return -1}else{if(!D){return 1}}}while(G){z.unshift(G);G=G.parentNode}G=D;while(G){e.unshift(G);G=G.parentNode}C=z.length;y=e.length;for(var A=0;A<C&&A<y;A++){if(z[A]!==e[A]){return m(z[A],e[A])}}return A===C?m(F,e[A],-1):m(z[A],E,1)};m=function(y,e,z){if(y===e){return z}var A=y.nextSibling;while(A){if(A===e){return -1}A=A.nextSibling}return 1}}(function(){var y=document.createElement("div"),z="script"+(new Date()).getTime(),e=document.documentElement;y.innerHTML="<a name='"+z+"'/>";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="<p class='TEST'></p>";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1&&!F){e[i]=C;e.sizset=A}if(e.nodeName.toLowerCase()===D){B=e;break}e=e[y]}G[A]=B}}}function t(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1){if(!F){e[i]=C;e.sizset=A}if(typeof D!=="string"){if(e===D){B=true;break}}else{if(d.filter(D,[e]).length>0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A<y;A++){d(z,F[A],E,D)}return d.filter(B,E)};window.tinymce.dom.Sizzle=d})();(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(d){function f(g){return g.replace(/[\n\r]+/g,"")}var c=d.is,b=d.isIE,e=d.each,a=d.dom.TreeWalker;d.create("tinymce.dom.Selection",{Selection:function(k,j,i,h){var g=this;g.dom=k;g.win=j;g.serializer=i;g.editor=h;e(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(l){g[l]=new d.util.Dispatcher(g)});if(!g.win.getSelection){g.tridentSel=new d.dom.TridentSelection(g)}if(d.isIE&&k.boxModel){this._fixIESelection()}d.addUnload(g.destroy,g)},setCursorLocation:function(i,j){var g=this;var h=g.dom.createRng();h.setStart(i,j);h.setEnd(i,j);g.setRng(h);g.collapse(false)},getContent:function(h){var g=this,i=g.getRng(),m=g.dom.create("body"),k=g.getSel(),j,l,o;h=h||{};j=l="";h.get=true;h.format=h.format||"html";h.forced_root_block="";g.onBeforeGetContent.dispatch(g,h);if(h.format=="text"){return g.isCollapsed()?"":(i.text||(k.toString?k.toString():""))}if(i.cloneContents){o=i.cloneContents();if(o){m.appendChild(o)}}else{if(c(i.item)||c(i.htmlText)){m.innerHTML="<br>"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='<span id="__caret">_</span>';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('<span id="__mce_tmp">_</span>'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var i=this,h=i.getRng(),j,g,l,k;if(h.duplicate||h.item){if(h.item){return h.item(0)}l=h.duplicate();l.collapse(1);j=l.parentElement();if(j.ownerDocument!==i.dom.doc){j=i.dom.getRoot()}g=k=h.parentElement();while(k=k.parentNode){if(k==j){j=g;break}}return j}else{j=h.startContainer;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[Math.min(j.childNodes.length-1,h.startOffset)]}if(j&&j.nodeType==3){return j.parentNode}return j}},getEnd:function(){var h=this,g=h.getRng(),j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);j=g.parentElement();if(j.ownerDocument!==h.dom.doc){j=h.dom.getRoot()}if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=g.endContainer;i=g.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[i>0?i-1:i]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_start" style="'+x+'">'+m+"</span>");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_end" style="'+x+'">'+m+"</span>")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='<br data-mce-bogus="1" />'}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},selectorChanged:function(g,j){var h=this,i;if(!h.selectorChangedData){h.selectorChangedData={};i={};h.editor.onNodeChange.addToTop(function(l,k,o){var p=h.dom,m=p.getParents(o,null,p.getRoot()),n={};e(h.selectorChangedData,function(r,q){e(m,function(s){if(p.is(s,q)){if(!i[q]){e(r,function(t){t(true,{node:s,selector:q,parents:m})});i[q]=r}n[q]=r;return false}})});e(i,function(r,q){if(!n[q]){delete i[q];e(r,function(s){s(false,{node:o,selector:q,parents:m})})}})})}if(!h.selectorChangedData[g]){h.selectorChangedData[g]=[]}h.selectorChangedData[g].push(j);return h},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&d<h.nodeValue.length){i=f(h,d);h=i.previousSibling;if(g>d){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d<h.nodeValue.length){h=f(h,d);d=0}if(i.nodeType==3&&g>0&&g<i.nodeValue.length){i=f(i,g).previousSibling;g=i.nodeValue.length}}return{startContainer:h,startOffset:d,endContainer:i,endOffset:g}}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var q=this,n=e.root,m=e.items,o=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,l=e.excludeFromTabOrder,k,h,p,d,g;f=f||b.DOM;k=function(r){g=r.target.id};h=function(r){f.setAttrib(r.target.id,"tabindex","-1")};d=function(r){var s=f.get(g);f.setAttrib(s,"tabindex","0");s.focus()};q.focus=function(){f.get(g).focus()};q.destroy=function(){c(m,function(s){var t=f.get(s.id);f.unbind(t,"focus",k);f.unbind(t,"blur",h)});var r=f.get(n);f.unbind(r,"focus",d);f.unbind(r,"keydown",p);m=f=n=q.focus=k=h=p=d=null;q.destroy=function(){}};q.moveFocus=function(v,s){var r=-1,u=q.controls,t;if(!g){return}c(m,function(y,x){if(y.id===g){r=x;return false}});r+=v;if(r<0){r=m.length-1}else{if(r>=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+='<span class="mceIcon '+e["class"]+'"><img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" /></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='<span role="listbox" aria-haspopup="true" aria-labelledby="'+g.id+'_voiceDesc" aria-describedby="'+g.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+g.id+'" cellpadding="0" cellspacing="0" class="'+k+" "+k+"Enabled"+(i["class"]?(" "+i["class"]):"")+'"><tbody><tr>';j+="<td>"+d.createHTML("span",{id:g.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},g.settings.title);j+=d.createHTML("a",{id:g.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},d.encode(g.settings.title))+"</td>";j+="<td>"+d.createHTML("a",{id:g.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";j+="</tr></tbody></table></span>";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.keyboardNav=new d.ui.KeyboardNavigation({root:f.id+"_menu",items:c.select("a",f.id+"_menu"),onCancel:function(){f.hideMenu();f.focus()}});f.keyboardNav.focus();f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch();f.keyboardNav.destroy()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){var f=this;f.parent();a.clear(f.id+"_menu");a.clear(f.id+"_more");c.remove(f.id+"_menu");if(f.keyboardNav){f.keyboardNav.destroy()}}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(k){var l=k.DOM,j=k.dom.Event,f=k.extend,i=k.each,a=k.isGecko,b=k.isIE,e=k.isWebKit,d=k.is,h=k.ThemeManager,c=k.PluginManager,g=k.explode;k.create("tinymce.Editor",{Editor:function(p,o){var m=this,n=true;m.settings=o=f({id:p,language:"en",theme:"advanced",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:k.documentBaseURL,add_form_submit_trigger:n,submit_patch:n,add_unload_trigger:n,convert_urls:n,relative_urls:n,remove_script_host:n,table_inline_editing:false,object_resizing:n,accessibility_focus:n,doctype:k.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.contentStyles=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(!q.content_editable){p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden"}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.language+".js")}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,G=this,H=G.settings,D,y,z,C=G.getElement(),p,m,E,v,B,F,x,r=[];k.add(G);H.aria_label=H.aria_label||l.getAttrib(C,"aria-label",G.getLang("aria.rich_text_area"));if(H.theme){if(typeof H.theme!="function"){H.theme=H.theme.replace(/-/,"");p=h.get(H.theme);G.theme=new p();if(G.theme.init){G.theme.init(G,h.urls[H.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{G.theme=H.theme}}function A(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){A(u)});n=new t(G,o);G.plugins[s]=n;if(n.init){n.init(G,o);r.push(s)}}}i(g(H.plugins.replace(/\-/g,"")),A);if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new k.ControlManager(G);G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui&&G.theme){G.orgDisplay=C.style.display;if(typeof H.theme!="function"){D=H.width||C.style.width||C.offsetWidth;y=H.height||C.style.height||C.offsetHeight;z=H.min_height||100;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D,10)+(p.deltaWidth||0),100)}if(F.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),z)}p=G.theme.renderUI({targetNode:C,width:D,height:y,deltaWidth:H.delta_width,deltaHeight:H.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:D,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<z){y=z}}else{p=H.theme(G,C);if(p.editorContainer.nodeType){p.editorContainer=p.editorContainer.id=p.editorContainer.id||G.id+"_parent"}if(p.iframeContainer.nodeType){p.iframeContainer=p.iframeContainer.id=p.iframeContainer.id||G.id+"_iframecontainer"}y=p.iframeHeight||C.offsetHeight;if(b){G.onInit.add(function(n){n.dom.bind(n.getBody(),"beforedeactivate keydown",function(){n.lastIERng=n.selection.getRng()})})}}G.editorContainer=p.editorContainer}if(H.content_css){i(g(H.content_css),function(n){G.contentCSS.push(G.documentBaseURI.toAbsolute(n))})}if(H.content_style){G.contentStyles.push(H.content_style)}if(H.content_editable){C=q=p=null;return G.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}G.iframeHTML=H.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(H.document_base_url!=k.documentBaseURL){G.iframeHTML+='<base href="'+G.documentBaseURI.getURI()+'" />'}if(H.ie7_compat){G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}G.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(x=0;x<G.contentCSS.length;x++){G.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+G.contentCSS[x]+'" />'}G.contentCSS=[];v=H.body_id||"tinymce";if(v.indexOf("=")!=-1){v=G.getParam("body_id","","hash");v=v[G.id]||v}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='</head><body id="'+v+'" class="mceContentBody '+B+'" onload="window.parent.tinyMCE.get(\''+G.id+"').onLoad.dispatch();\"><br></body></html>";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",allowTransparency:"true",title:H.aria_label,style:{width:"100%",height:y,display:"block"}});G.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=G.orgDisplay}C.style.visibility=G.orgVisibility;l.get(G.id).style.display="none";l.setAttrib(G.id,"aria-hidden",true);if(!k.relaxedDomain||!E){G.initContentBody()}C=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m,s;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(t,u){var v=t.length,y,A=n.dom,z,x;while(v--){y=t[v];z=y.attr(u);x="data-mce-"+u;if(!y.attributes.map[x]){if(u==="style"){y.attr(x,A.serializeStyle(A.parseStyle(z),y.name))}else{y.attr(x,n.convertURL(z,u,y.name))}}}});n.parser.addNodeFilter("script",function(t,u){var v=t.length,x;while(v--){x=t[v];x.attr("type","mce-"+(x.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(t,u){var v=t.length,x;while(v--){x=t[v];x.type=8;x.name="#comment";x.value="[CDATA["+x.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(u,v){var x=u.length,y,t=n.schema.getNonEmptyElements();while(x--){y=u[x];if(y.isEmpty(t)){y.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer,n);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.onExecCommand.add(function(t,u){if(!/^(FontName|FontSize)$/.test(u)){n.nodeChanged()}});n.serializer.onPreProcess.add(function(t,u){return n.onPreProcess.dispatch(n,u,t)});n.serializer.onPostProcess.add(function(t,u){return n.onPostProcess.dispatch(n,u,t)});n.onPreInit.dispatch(n);if(!p.browser_spellcheck&&!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(t,u){i(p.protect,function(v){u.content=u.content.replace(v,function(x){return"<!--mce:protected "+escape(x)+"-->"})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(t,u){u.content=u.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});if(n.contentStyles.length>0){s="";i(n.contentStyles,function(t){s+=t+"\r\n"});n.dom.addStyle(s)}i(n.contentCSS,function(t){n.dom.loadCSS(t)});if(p.auto_focus){setTimeout(function(){var t=k.get(p.auto_focus);t.selection.select(t.getBody(),1);t.selection.collapse(1);t.getBody().focus();t.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){if(u.lastIERng){t.setRng(u.lastIERng)}n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'><br data-mce-bogus="1"></'+q+">"}else{r='<br data-mce-bogus="1">'}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}if(!o.settings.content_editable||document.activeElement===o.getBody()){o.selection.normalize()}return p.content},getContent:function(o){var n=this,p,m=n.getBody();o=o||{};o.format=o.format||"html";o.get=true;o.getInner=true;if(!o.no_events){n.onBeforeGetContent.dispatch(n,o)}if(o.format=="raw"){p=m.innerHTML}else{if(o.format=="text"){p=m.innerText||m.textContent}else{p=n.serializer.serialize(m,o)}}if(o.format!="text"){o.content=k.trim(p)}else{o.content=p}if(!o.no_events){n.onGetContent.dispatch(n,o)}return o.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!p.getAttrib(s,"href",false)){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.unbind(m.getWin());j.unbind(m.getDoc())}j.unbind(m.getBody());j.clear(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){g.preventDefault();g.stopPropagation()}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(i,m){if(m.keyCode!=65||!a.VK.metaKeyPressed(m)){l.selection.normalize()}l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k(i,n)}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=p.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.y<L.y)||(C.x>L.x+L.w||C.x<L.x)){H=d.isIE?n.getDoc().documentElement:n.getBody();H.scrollLeft=C.x;H.scrollTop=C.y-L.h+25}x=m.createRng();A=D.previousSibling;if(A&&A.nodeType==3){x.setStart(A,A.nodeValue.length)}else{x.setStartBefore(D);x.setEndBefore(D)}m.remove(D);p.setRng(x);p.onSetContent.dispatch(p,G);n.addVisual()},mceInsertRawHTML:function(y,x,v){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceToggleFormat:function(y,x,v){s(v)},mceSetContent:function(y,x,v){n.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=k.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!l("InsertUnorderedList")&&!l("InsertOrderedList")){if(!k.forced_root_block&&!m.getParent(p.getNode(),m.isBlock)){q.apply("div")}e(p.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(d.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){q.toggle(v)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();if(p.getRng().setStart){v.setStart(x,0);v.setEnd(x,x.childNodes.length);p.setRng(v)}else{f("SelectAll")}}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(x){var v=m.getParent(p.getNode(),"ul,ol");return v&&(x==="insertunorderedlist"&&v.tagName==="UL"||x==="insertorderedlist"&&v.tagName==="OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m<e.length-1;m++){e[m]=e[m+1]}e.length--;i=e.length}}p.bookmark=h.selection.getBookmark(2,true);if(i<e.length-1){e.length=i+1}e.push(p);i=e.length-1;l.onAdd.dispatch(l,p);h.isNotDirty=0;return p},undo:function(){var n,m;if(l.typing){l.add();l.typing=false}if(i>0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i<e.length-1){m=e[++i];h.setContent(m.content,{format:"raw"});h.selection.moveToBookmark(m.bookmark);l.onRedo.dispatch(l,m)}return m},clear:function(){e=[];i=0;l.typing=false},hasUndo:function(){return i>0||this.typing},hasRedo:function(){return i<e.length-1&&!this.typing}};return l}})(tinymce);tinymce.ForceBlocks=function(c){var b=c.settings,e=c.dom,a=c.selection,d=c.schema.getBlockElements();function f(){var j=a.getStart(),h=c.getBody(),g,k,o,s,q,i,l,m=-16777215,p,r;if(!j||j.nodeType!==1||!b.forced_root_block){return}while(j&&j!=h){if(d[j.nodeName]){return}j=j.parentNode}g=a.getRng();if(g.setStart){k=g.startContainer;o=g.startOffset;s=g.endContainer;q=g.endOffset}else{if(g.item){j=g.item(0);g=c.getDoc().body.createTextRange();g.moveToElementText(j)}r=g.parentElement().ownerDocument===c.getDoc();tmpRng=g.duplicate();tmpRng.collapse(true);o=tmpRng.move("character",m)*-1;if(!tmpRng.collapsed){tmpRng=g.duplicate();tmpRng.collapse(false);q=(tmpRng.move("character",m)*-1)-o}}j=h.firstChild;while(j){if(j.nodeType===3||(j.nodeType==1&&!d[j.nodeName])){if(j.nodeType===3&&j.nodeValue.length==0){l=j;j=j.nextSibling;e.remove(l);continue}if(!i){i=e.create(b.forced_root_block);j.parentNode.insertBefore(i,j);p=true}l=j;j=j.nextSibling;i.appendChild(l)}else{i=null;j=j.nextSibling}}if(p){if(g.setStart){g.setStart(k,o);g.setEnd(s,q);a.setRng(g)}else{if(r){try{g=c.getDoc().body.createTextRange();g.moveToElementText(h);g.collapse(true);g.moveStart("character",o);if(q>0){g.moveEnd("character",q)}g.select()}catch(n){}}}c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k<g;k++){o=n[k].createControl(j,h);if(o){return h.add(o)}}if(j==="|"||j==="separator"){return h.createSeparator()}if(m.buttons&&(o=m.buttons[j])){return h.createButton(j,o)}return h.add(o)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(aa){var Q={},T=a.each,c=aa.dom,r=aa.selection,t=a.dom.TreeWalker,N=new a.dom.RangeUtils(c),d=aa.schema.isValidChild,H=c.isBlock,m=aa.settings.forced_root_block,s=c.nodeIndex,G="\uFEFF",e=/^(src|href|style)$/,X=false,C=true,P,D,x=c.getContentEditable;function A(ab){return ab instanceof Array}function n(ac,ab){return c.getParents(ac,ab,c.getRoot())}function b(ab){return ab.nodeType===1&&ab.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(ab){return true},onformat:function(ad,ab,ac){T(ac,function(af,ae){c.setAttrib(ad,ae,af)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});T("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(ab){l(ab,{block:ab,remove:"all"})});l(aa.settings.formats)}function W(){aa.addShortcut("ctrl+b","bold_desc","Bold");aa.addShortcut("ctrl+i","italic_desc","Italic");aa.addShortcut("ctrl+u","underline_desc","Underline");for(var ab=1;ab<=6;ab++){aa.addShortcut("ctrl+"+ab,"",["FormatBlock",false,"h"+ab])}aa.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);aa.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);aa.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function V(ab){return ab?Q[ab]:Q}function l(ab,ac){if(ab){if(typeof(ab)!=="string"){T(ab,function(ae,ad){l(ad,ae)})}else{ac=ac.length?ac:[ac];T(ac,function(ad){if(ad.deep===D){ad.deep=!ad.selector}if(ad.split===D){ad.split=!ad.selector||ad.inline}if(ad.remove===D&&ad.selector&&!ad.inline){ad.remove="none"}if(ad.selector&&ad.inline){ad.mixed=true;ad.block_expand=true}if(typeof(ad.classes)==="string"){ad.classes=ad.classes.split(/\s+/)}});Q[ab]=ac}}}var i=function(ac){var ab;aa.dom.getParent(ac,function(ad){ab=aa.dom.getStyle(ad,"text-decoration");return ab&&ab!=="none"});return ab};var L=function(ab){var ac;if(ab.nodeType===1&&ab.parentNode&&ab.parentNode.nodeType===1){ac=i(ab.parentNode);if(aa.dom.getStyle(ab,"color")&&ac){aa.dom.setStyle(ab,"text-decoration",ac)}else{if(aa.dom.getStyle(ab,"textdecoration")===ac){aa.dom.setStyle(ab,"text-decoration",null)}}}};function Y(ae,al,ag){var ah=V(ae),am=ah[0],ak,ac,aj,ai=r.isCollapsed();function ab(aq,ap){ap=ap||am;if(aq){if(ap.onformat){ap.onformat(aq,ap,al,ag)}T(ap.styles,function(at,ar){c.setStyle(aq,ar,q(at,al))});T(ap.attributes,function(at,ar){c.setAttrib(aq,ar,q(at,al))});T(ap.classes,function(ar){ar=q(ar,al);if(!c.hasClass(aq,ar)){c.addClass(aq,ar)}})}}function af(){function ar(ay,aw){var ax=new t(aw);for(ag=ax.current();ag;ag=ax.prev()){if(ag.childNodes.length>1||ag==ay||ag.tagName=="BR"){return ag}}}var aq=aa.selection.getRng();var av=aq.startContainer;var ap=aq.endContainer;if(av!=ap&&aq.endOffset===0){var au=ar(av,ap);var at=au.nodeType==3?au.length:au.childNodes.length;aq.setEnd(au,at)}return aq}function ad(at,ay,aw,av,aq){var ap=[],ar=-1,ax,aA=-1,au=-1,az;T(at.childNodes,function(aC,aB){if(aC.nodeName==="UL"||aC.nodeName==="OL"){ar=aB;ax=aC;return false}});T(at.childNodes,function(aC,aB){if(aC.nodeName==="SPAN"&&c.getAttrib(aC,"data-mce-type")=="bookmark"){if(aC.id==ay.id+"_start"){aA=aB}else{if(aC.id==ay.id+"_end"){au=aB}}}});if(ar<=0||(aA<ar&&au>ar)){T(a.grep(at.childNodes),aq);return 0}else{az=c.clone(aw,X);T(a.grep(at.childNodes),function(aC,aB){if((aA<ar&&aB<ar)||(aA>ar&&aB>ar)){ap.push(aC);aC.parentNode.removeChild(aC)}});if(aA<ar){at.insertBefore(az,ax)}else{if(aA>ar){at.insertBefore(az,ax.nextSibling)}}av.push(az);T(ap,function(aB){az.appendChild(aB)});return az}}function an(aq,at,aw){var ap=[],av,ar,au=true;av=am.inline||am.block;ar=c.create(av);ab(ar);N.walk(aq,function(ax){var ay;function az(aA){var aF,aD,aB,aC,aE;aE=au;aF=aA.nodeName.toLowerCase();aD=aA.parentNode.nodeName.toLowerCase();if(aA.nodeType===1&&x(aA)){aE=au;au=x(aA)==="true";aC=true}if(g(aF,"br")){ay=0;if(am.block){c.remove(aA)}return}if(am.wrapper&&y(aA,ae,al)){ay=0;return}if(au&&!aC&&am.block&&!am.wrapper&&I(aF)){aA=c.rename(aA,av);ab(aA);ap.push(aA);ay=0;return}if(am.selector){T(ah,function(aG){if("collapsed" in aG&&aG.collapsed!==ai){return}if(c.is(aA,aG.selector)&&!b(aA)){ab(aA,aG);aB=true}});if(!am.inline||aB){ay=0;return}}if(au&&!aC&&d(av,aF)&&d(aD,av)&&!(!aw&&aA.nodeType===3&&aA.nodeValue.length===1&&aA.nodeValue.charCodeAt(0)===65279)&&!b(aA)){if(!ay){ay=c.clone(ar,X);aA.parentNode.insertBefore(ay,aA);ap.push(ay)}ay.appendChild(aA)}else{if(aF=="li"&&at){ay=ad(aA,at,ar,ap,az)}else{ay=0;T(a.grep(aA.childNodes),az);if(aC){au=aE}ay=0}}}T(ax,az)});if(am.wrap_links===false){T(ap,function(ax){function ay(aC){var aB,aA,az;if(aC.nodeName==="A"){aA=c.clone(ar,X);ap.push(aA);az=a.grep(aC.childNodes);for(aB=0;aB<az.length;aB++){aA.appendChild(az[aB])}aC.appendChild(aA)}T(a.grep(aC.childNodes),ay)}ay(ax)})}T(ap,function(az){var ax;function aA(aC){var aB=0;T(aC.childNodes,function(aD){if(!f(aD)&&!K(aD)){aB++}});return aB}function ay(aB){var aD,aC;T(aB.childNodes,function(aE){if(aE.nodeType==1&&!K(aE)&&!b(aE)){aD=aE;return X}});if(aD&&h(aD,am)){aC=c.clone(aD,X);ab(aC);c.replace(aC,aB,C);c.remove(aD,1)}return aC||aB}ax=aA(az);if((ap.length>1||!H(az))&&ax===0){c.remove(az,1);return}if(am.inline||am.wrapper){if(!am.exact&&ax===1){az=ay(az)}T(ah,function(aB){T(c.select(aB.inline,az),function(aD){var aC;if(aB.wrap_links===false){aC=aD.parentNode;do{if(aC.nodeName==="A"){return}}while(aC=aC.parentNode)}Z(aB,al,aD,aB.exact?aD:null)})});if(y(az.parentNode,ae,al)){c.remove(az,1);az=0;return C}if(am.merge_with_parents){c.getParent(az.parentNode,function(aB){if(y(aB,ae,al)){c.remove(az,1);az=0;return C}})}if(az&&am.merge_siblings!==false){az=u(E(az),az);az=u(az,E(az,C))}}})}if(am){if(ag){if(ag.nodeType){ac=c.createRng();ac.setStartBefore(ag);ac.setEndAfter(ag);an(p(ac,ah),null,true)}else{an(ag,null,true)}}else{if(!ai||!am.inline||c.select("td.mceSelected,th.mceSelected").length){var ao=aa.selection.getNode();if(!m&&ah[0].defaultBlock&&!c.getParent(ao,c.isBlock)){Y(ah[0].defaultBlock)}aa.selection.setRng(af());ak=r.getBookmark();an(p(r.getRng(C),ah),ak);if(am.styles&&(am.styles.color||am.styles.textDecoration)){a.walk(ao,L,"childNodes");L(ao)}r.moveToBookmark(ak);R(r.getRng(C));aa.nodeChanged()}else{U("apply",ae,al)}}}}function B(ad,am,af){var ag=V(ad),ao=ag[0],ak,aj,ac,al=true;function ae(av){var au,at,ar,aq,ax,aw;if(av.nodeType===1&&x(av)){ax=al;al=x(av)==="true";aw=true}au=a.grep(av.childNodes);if(al&&!aw){for(at=0,ar=ag.length;at<ar;at++){if(Z(ag[at],am,av,av)){break}}}if(ao.deep){if(au.length){for(at=0,ar=au.length;at<ar;at++){ae(au[at])}if(aw){al=ax}}}}function ah(aq){var ar;T(n(aq.parentNode).reverse(),function(at){var au;if(!ar&&at.id!="_start"&&at.id!="_end"){au=y(at,ad,am);if(au&&au.split!==false){ar=at}}});return ar}function ab(au,aq,aw,az){var aA,ay,ax,at,av,ar;if(au){ar=au.parentNode;for(aA=aq.parentNode;aA&&aA!=ar;aA=aA.parentNode){ay=c.clone(aA,X);for(av=0;av<ag.length;av++){if(Z(ag[av],am,ay,ay)){ay=0;break}}if(ay){if(ax){ay.appendChild(ax)}if(!at){at=ay}ax=ay}}if(az&&(!ao.mixed||!H(au))){aq=c.split(au,aq)}if(ax){aw.parentNode.insertBefore(ax,aw);at.appendChild(aw)}}return aq}function an(aq){return ab(ah(aq),aq,aq,true)}function ai(at){var ar=c.get(at?"_start":"_end"),aq=ar[at?"firstChild":"lastChild"];if(K(aq)){aq=aq[at?"firstChild":"lastChild"]}c.remove(ar,true);return aq}function ap(aq){var at,au,ar;aq=p(aq,ag,C);if(ao.split){at=M(aq,C);au=M(aq);if(at!=au){if(/^(TR|TD)$/.test(at.nodeName)&&at.firstChild){at=(at.nodeName=="TD"?at.firstChild:at.firstChild.firstChild)||at}at=S(at,"span",{id:"_start","data-mce-type":"bookmark"});au=S(au,"span",{id:"_end","data-mce-type":"bookmark"});an(at);an(au);at=ai(C);au=ai()}else{at=au=an(at)}aq.startContainer=at.parentNode;aq.startOffset=s(at);aq.endContainer=au.parentNode;aq.endOffset=s(au)+1}N.walk(aq,function(av){T(av,function(aw){ae(aw);if(aw.nodeType===1&&aa.dom.getStyle(aw,"text-decoration")==="underline"&&aw.parentNode&&i(aw.parentNode)==="underline"){Z({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,aw)}})})}if(af){if(af.nodeType){ac=c.createRng();ac.setStartBefore(af);ac.setEndAfter(af);ap(ac)}else{ap(af)}return}if(!r.isCollapsed()||!ao.inline||c.select("td.mceSelected,th.mceSelected").length){ak=r.getBookmark();ap(r.getRng(C));r.moveToBookmark(ak);if(ao.inline&&k(ad,am,r.getStart())){R(r.getRng(true))}aa.nodeChanged()}else{U("remove",ad,am)}}function F(ac,ae,ad){var ab=V(ac);if(k(ac,ae,ad)&&(!("toggle" in ab[0])||ab[0].toggle)){B(ac,ae,ad)}else{Y(ac,ae,ad)}}function y(ac,ab,ah,af){var ad=V(ab),ai,ag,ae;function aj(an,ap,aq){var am,ao,ak=ap[aq],al;if(ap.onmatch){return ap.onmatch(an,ap,aq)}if(ak){if(ak.length===D){for(am in ak){if(ak.hasOwnProperty(am)){if(aq==="attributes"){ao=c.getAttrib(an,am)}else{ao=O(an,am)}if(af&&!ao&&!ap.exact){return}if((!af||ap.exact)&&!g(ao,q(ak[am],ah))){return}}}}else{for(al=0;al<ak.length;al++){if(aq==="attributes"?c.getAttrib(an,ak[al]):O(an,ak[al])){return ap}}}}return ap}if(ad&&ac){for(ag=0;ag<ad.length;ag++){ai=ad[ag];if(h(ac,ai)&&aj(ac,ai,"attributes")&&aj(ac,ai,"styles")){if(ae=ai.classes){for(ag=0;ag<ae.length;ag++){if(!c.hasClass(ac,ae[ag])){return}}}return ai}}}}function k(ad,af,ae){var ac;function ab(ag){ag=c.getParent(ag,function(ah){return !!y(ah,ad,af,true)});return y(ag,ad,af)}if(ae){return ab(ae)}ae=r.getNode();if(ab(ae)){return C}ac=r.getStart();if(ac!=ae){if(ab(ac)){return C}}return X}function v(ai,ah){var af,ag=[],ae={},ad,ac,ab;af=r.getStart();c.getParent(af,function(al){var ak,aj;for(ak=0;ak<ai.length;ak++){aj=ai[ak];if(!ae[aj]&&y(al,aj,ah)){ae[aj]=true;ag.push(aj)}}},c.getRoot());return ag}function z(af){var ah=V(af),ae,ad,ag,ac,ab;if(ah){ae=r.getStart();ad=n(ae);for(ac=ah.length-1;ac>=0;ac--){ab=ah[ac].selector;if(!ab){return C}for(ag=ad.length-1;ag>=0;ag--){if(c.is(ad[ag],ab)){return C}}}}return X}function J(ab,ae,ac){var ad;if(!P){P={};ad={};aa.onNodeChange.addToTop(function(ag,af,ai){var ah=n(ai),aj={};T(P,function(ak,al){T(ah,function(am){if(y(am,al,{},ak.similar)){if(!ad[al]){T(ak,function(an){an(true,{node:am,format:al,parents:ah})});ad[al]=ak}aj[al]=ak;return false}})});T(ad,function(ak,al){if(!aj[al]){delete ad[al];T(ak,function(am){am(false,{node:ai,format:al,parents:ah})})}})})}T(ab.split(","),function(af){if(!P[af]){P[af]=[];P[af].similar=ac}P[af].push(ae)});return this}a.extend(this,{get:V,register:l,apply:Y,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z,formatChanged:J});j();W();function h(ab,ac){if(g(ab,ac.inline)){return C}if(g(ab,ac.block)){return C}if(ac.selector){return c.is(ab,ac.selector)}}function g(ac,ab){ac=ac||"";ab=ab||"";ac=""+(ac.nodeName||ac);ab=""+(ab.nodeName||ab);return ac.toLowerCase()==ab.toLowerCase()}function O(ac,ab){var ad=c.getStyle(ac,ab);if(ab=="color"||ab=="backgroundColor"){ad=c.toHex(ad)}if(ab=="fontWeight"&&ad==700){ad="bold"}return""+ad}function q(ab,ac){if(typeof(ab)!="string"){ab=ab(ac)}else{if(ac){ab=ab.replace(/%(\w+)/g,function(ae,ad){return ac[ad]||ae})}}return ab}function f(ab){return ab&&ab.nodeType===3&&/^([\t \r\n]+|)$/.test(ab.nodeValue)}function S(ad,ac,ab){var ae=c.create(ac,ab);ad.parentNode.insertBefore(ae,ad);ae.appendChild(ad);return ae}function p(ab,am,ae){var ap,an,ah,al,ad=ab.startContainer,ai=ab.startOffset,ar=ab.endContainer,ak=ab.endOffset;function ao(az){var au,ax,ay,aw,av,at;au=ax=az?ad:ar;av=az?"previousSibling":"nextSibling";at=c.getRoot();if(au.nodeType==3&&!f(au)){if(az?ai>0:ak<au.nodeValue.length){return au}}for(;;){if(!am[0].block_expand&&H(ax)){return ax}for(aw=ax[av];aw;aw=aw[av]){if(!K(aw)&&!f(aw)){return ax}}if(ax.parentNode==at){au=ax;break}ax=ax.parentNode}return au}function ag(at,au){if(au===D){au=at.nodeType===3?at.length:at.childNodes.length}while(at&&at.hasChildNodes()){at=at.childNodes[au];if(at){au=at.nodeType===3?at.length:at.childNodes.length}}return{node:at,offset:au}}if(ad.nodeType==1&&ad.hasChildNodes()){an=ad.childNodes.length-1;ad=ad.childNodes[ai>an?an:ai];if(ad.nodeType==3){ai=0}}if(ar.nodeType==1&&ar.hasChildNodes()){an=ar.childNodes.length-1;ar=ar.childNodes[ak>an?an:ak-1];if(ar.nodeType==3){ak=ar.nodeValue.length}}function aq(au){var at=au;while(at){if(at.nodeType===1&&x(at)){return x(at)==="false"?at:au}at=at.parentNode}return au}function aj(au,ay,aA){var ax,av,az,at;function aw(aC,aE){var aF,aB,aD=aC.nodeValue;if(typeof(aE)=="undefined"){aE=aA?aD.length:0}if(aA){aF=aD.lastIndexOf(" ",aE);aB=aD.lastIndexOf("\u00a0",aE);aF=aF>aB?aF:aB;if(aF!==-1&&!ae){aF++}}else{aF=aD.indexOf(" ",aE);aB=aD.indexOf("\u00a0",aE);aF=aF!==-1&&(aB===-1||aF<aB)?aF:aB}return aF}if(au.nodeType===3){az=aw(au,ay);if(az!==-1){return{container:au,offset:az}}at=au}ax=new t(au,c.getParent(au,H)||aa.getBody());while(av=ax[aA?"prev":"next"]()){if(av.nodeType===3){at=av;az=aw(av);if(az!==-1){return{container:av,offset:az}}}else{if(H(av)){break}}}if(at){if(aA){ay=0}else{ay=at.length}return{container:at,offset:ay}}}function af(au,at){var av,aw,ay,ax;if(au.nodeType==3&&au.nodeValue.length===0&&au[at]){au=au[at]}av=n(au);for(aw=0;aw<av.length;aw++){for(ay=0;ay<am.length;ay++){ax=am[ay];if("collapsed" in ax&&ax.collapsed!==ab.collapsed){continue}if(c.is(av[aw],ax.selector)){return av[aw]}}}return au}function ac(au,at,aw){var av;if(!am[0].wrapper){av=c.getParent(au,am[0].block)}if(!av){av=c.getParent(au.nodeType==3?au.parentNode:au,H)}if(av&&am[0].wrapper){av=n(av,"ul,ol").reverse()[0]||av}if(!av){av=au;while(av[at]&&!H(av[at])){av=av[at];if(g(av,"br")){break}}}return av||au}ad=aq(ad);ar=aq(ar);if(K(ad.parentNode)||K(ad)){ad=K(ad)?ad:ad.parentNode;ad=ad.nextSibling||ad;if(ad.nodeType==3){ai=0}}if(K(ar.parentNode)||K(ar)){ar=K(ar)?ar:ar.parentNode;ar=ar.previousSibling||ar;if(ar.nodeType==3){ak=ar.length}}if(am[0].inline){if(ab.collapsed){al=aj(ad,ai,true);if(al){ad=al.container;ai=al.offset}al=aj(ar,ak);if(al){ar=al.container;ak=al.offset}}ah=ag(ar,ak);if(ah.node){while(ah.node&&ah.offset===0&&ah.node.previousSibling){ah=ag(ah.node.previousSibling)}if(ah.node&&ah.offset>0&&ah.node.nodeType===3&&ah.node.nodeValue.charAt(ah.offset-1)===" "){if(ah.offset>1){ar=ah.node;ar.splitText(ah.offset-1)}}}}if(am[0].inline||am[0].block_expand){if(!am[0].inline||(ad.nodeType!=3||ai===0)){ad=ao(true)}if(!am[0].inline||(ar.nodeType!=3||ak===ar.nodeValue.length)){ar=ao()}}if(am[0].selector&&am[0].expand!==X&&!am[0].inline){ad=af(ad,"previousSibling");ar=af(ar,"nextSibling")}if(am[0].block||am[0].selector){ad=ac(ad,"previousSibling");ar=ac(ar,"nextSibling");if(am[0].block){if(!H(ad)){ad=ao(true)}if(!H(ar)){ar=ao()}}}if(ad.nodeType==1){ai=s(ad);ad=ad.parentNode}if(ar.nodeType==1){ak=s(ar)+1;ar=ar.parentNode}return{startContainer:ad,startOffset:ai,endContainer:ar,endOffset:ak}}function Z(ah,ag,ae,ab){var ad,ac,af;if(!h(ae,ah)){return X}if(ah.remove!="all"){T(ah.styles,function(aj,ai){aj=q(aj,ag);if(typeof(ai)==="number"){ai=aj;ab=0}if(!ab||g(O(ab,ai),aj)){c.setStyle(ae,ai,"")}af=1});if(af&&c.getAttrib(ae,"style")==""){ae.removeAttribute("style");ae.removeAttribute("data-mce-style")}T(ah.attributes,function(ak,ai){var aj;ak=q(ak,ag);if(typeof(ai)==="number"){ai=ak;ab=0}if(!ab||g(c.getAttrib(ab,ai),ak)){if(ai=="class"){ak=c.getAttrib(ae,ai);if(ak){aj="";T(ak.split(/\s+/),function(al){if(/mce\w+/.test(al)){aj+=(aj?" ":"")+al}});if(aj){c.setAttrib(ae,ai,aj);return}}}if(ai=="class"){ae.removeAttribute("className")}if(e.test(ai)){ae.removeAttribute("data-mce-"+ai)}ae.removeAttribute(ai)}});T(ah.classes,function(ai){ai=q(ai,ag);if(!ab||c.hasClass(ab,ai)){c.removeClass(ae,ai)}});ac=c.getAttribs(ae);for(ad=0;ad<ac.length;ad++){if(ac[ad].nodeName.indexOf("_")!==0){return X}}}if(ah.remove!="none"){o(ae,ah);return C}}function o(ad,ae){var ab=ad.parentNode,ac;function af(ah,ag,ai){ah=E(ah,ag,ai);return !ah||(ah.nodeName=="BR"||H(ah))}if(ae.block){if(!m){if(H(ad)&&!H(ab)){if(!af(ad,X)&&!af(ad.firstChild,C,1)){ad.insertBefore(c.create("br"),ad.firstChild)}if(!af(ad,C)&&!af(ad.lastChild,X,1)){ad.appendChild(c.create("br"))}}}else{if(ab==c.getRoot()){if(!ae.list_block||!g(ad,ae.list_block)){T(a.grep(ad.childNodes),function(ag){if(d(m,ag.nodeName.toLowerCase())){if(!ac){ac=S(ag,m)}else{ac.appendChild(ag)}}else{ac=0}})}}}}if(ae.selector&&ae.inline&&!g(ae.inline,ad)){return}c.remove(ad,1)}function E(ac,ab,ad){if(ac){ab=ab?"nextSibling":"previousSibling";for(ac=ad?ac:ac[ab];ac;ac=ac[ab]){if(ac.nodeType==1||!f(ac)){return ac}}}}function K(ab){return ab&&ab.nodeType==1&&ab.getAttribute("data-mce-type")=="bookmark"}function u(af,ae){var ab,ad,ac;function ah(ak,aj){if(ak.nodeName!=aj.nodeName){return X}function ai(am){var an={};T(c.getAttribs(am),function(ao){var ap=ao.nodeName.toLowerCase();if(ap.indexOf("_")!==0&&ap!=="style"){an[ap]=c.getAttrib(am,ap)}});return an}function al(ap,ao){var an,am;for(am in ap){if(ap.hasOwnProperty(am)){an=ao[am];if(an===D){return X}if(ap[am]!=an){return X}delete ao[am]}}for(am in ao){if(ao.hasOwnProperty(am)){return X}}return C}if(!al(ai(ak),ai(aj))){return X}if(!al(c.parseStyle(c.getAttrib(ak,"style")),c.parseStyle(c.getAttrib(aj,"style")))){return X}return C}function ag(aj,ai){for(ad=aj;ad;ad=ad[ai]){if(ad.nodeType==3&&ad.nodeValue.length!==0){return aj}if(ad.nodeType==1&&!K(ad)){return ad}}return aj}if(af&&ae){af=ag(af,"previousSibling");ae=ag(ae,"nextSibling");if(ah(af,ae)){for(ad=af.nextSibling;ad&&ad!=ae;){ac=ad;ad=ad.nextSibling;af.appendChild(ac)}c.remove(ae);T(a.grep(ae.childNodes),function(ai){af.appendChild(ai)});return af}}return ae}function I(ab){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(ab)}function M(ac,ag){var ab,af,ad,ae;ab=ac[ag?"startContainer":"endContainer"];af=ac[ag?"startOffset":"endOffset"];if(ab.nodeType==1){ad=ab.childNodes.length-1;if(!ag&&af){af--}ab=ab.childNodes[af>ad?ad:af]}if(ab.nodeType===3&&ag&&af>=ab.nodeValue.length){ab=new t(ab,aa.getBody()).next()||ab}if(ab.nodeType===3&&!ag&&af===0){ab=new t(ab,aa.getBody()).prev()||ab}return ab}function U(ak,ab,ai){var al="_mce_caret",ac=aa.settings.caret_debug;function ad(ap){var ao=c.create("span",{id:al,"data-mce-bogus":true,style:ac?"color:red":""});if(ap){ao.appendChild(aa.getDoc().createTextNode(G))}return ao}function aj(ap,ao){while(ap){if((ap.nodeType===3&&ap.nodeValue!==G)||ap.childNodes.length>1){return false}if(ao&&ap.nodeType===1){ao.push(ap)}ap=ap.firstChild}return true}function ag(ao){while(ao){if(ao.id===al){return ao}ao=ao.parentNode}}function af(ao){var ap;if(ao){ap=new t(ao,ao);for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType===3){return ao}}}}function ae(aq,ap){var ar,ao;if(!aq){aq=ag(r.getStart());if(!aq){while(aq=c.get(al)){ae(aq,false)}}}else{ao=r.getRng(true);if(aj(aq)){if(ap!==false){ao.setStartBefore(aq);ao.setEndBefore(aq)}c.remove(aq)}else{ar=af(aq);if(ar.nodeValue.charAt(0)===G){ar=ar.deleteData(0,1)}c.remove(aq,1)}r.setRng(ao)}}function ah(){var aq,ao,av,au,ar,ap,at;aq=r.getRng(true);au=aq.startOffset;ap=aq.startContainer;at=ap.nodeValue;ao=ag(r.getStart());if(ao){av=af(ao)}if(at&&au>0&&au<at.length&&/\w/.test(at.charAt(au))&&/\w/.test(at.charAt(au-1))){ar=r.getBookmark();aq.collapse(true);aq=p(aq,V(ab));aq=N.split(aq);Y(ab,ai,aq);r.moveToBookmark(ar)}else{if(!ao||av.nodeValue!==G){ao=ad(true);av=ao.firstChild;aq.insertNode(ao);au=1;Y(ab,ai,ao)}else{Y(ab,ai,ao)}r.setCursorLocation(av,au)}}function am(){var ao=r.getRng(true),ap,ar,av,au,aq,ay,ax=[],at,aw;ap=ao.startContainer;ar=ao.startOffset;aq=ap;if(ap.nodeType==3){if(ar!=ap.nodeValue.length||ap.nodeValue===G){au=true}aq=aq.parentNode}while(aq){if(y(aq,ab,ai)){ay=aq;break}if(aq.nextSibling){au=true}ax.push(aq);aq=aq.parentNode}if(!ay){return}if(au){av=r.getBookmark();ao.collapse(true);ao=p(ao,V(ab),true);ao=N.split(ao);B(ab,ai,ao);r.moveToBookmark(av)}else{aw=ad();aq=aw;for(at=ax.length-1;at>=0;at--){aq.appendChild(c.clone(ax[at],false));aq=aq.firstChild}aq.appendChild(c.doc.createTextNode(G));aq=aq.firstChild;c.insertAfter(aw,ay);r.setCursorLocation(aq,1)}}function an(){var ap,ao,aq;ao=ag(r.getStart());if(ao&&!c.isEmpty(ao)){a.walk(ao,function(ar){if(ar.nodeType==1&&ar.id!==al&&!c.isEmpty(ar)){c.setAttrib(ar,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){aa.onBeforeGetContent.addToTop(function(){var ao=[],ap;if(aj(ag(r.getStart()),ao)){ap=ao.length;while(ap--){c.setAttrib(ao[ap],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ao){aa[ao].addToTop(function(){ae();an()})});aa.onKeyDown.addToTop(function(ao,aq){var ap=aq.keyCode;if(ap==8||ap==37||ap==39){ae(ag(r.getStart()))}an()});r.onSetContent.add(an);self._hasCaretEvents=true}if(ak=="apply"){ah()}else{am()}}function R(ac){var ab=ac.startContainer,ai=ac.startOffset,ae,ah,ag,ad,af;if(ab.nodeType==3&&ai>=ab.nodeValue.length){ai=s(ab);ab=ab.parentNode;ae=true}if(ab.nodeType==1){ad=ab.childNodes;ab=ad[Math.min(ai,ad.length-1)];ah=new t(ab,c.getParent(ab,c.isBlock));if(ai>ad.length-1||ae){ah.next()}for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!f(ag)){af=c.create("a",null,G);ag.parentNode.insertBefore(af,ag);ac.setStart(ag,0);r.setRng(ac);c.remove(af);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(f){var i=f.dom,e=f.selection,d=f.settings,h=f.undoManager,c=f.schema.getNonEmptyElements();function g(A){var v=e.getRng(true),G,j,z,u,p,M,B,o,k,n,t,J,x,C;function E(N){return N&&i.isBlock(N)&&!/^(TD|TH|CAPTION|FORM)$/.test(N.nodeName)&&!/^(fixed|absolute)/i.test(N.style.position)&&i.getContentEditable(N)!=="true"}function F(O){var N;if(b.isIE&&i.isBlock(O)){N=e.getRng();O.appendChild(i.create("span",null,"\u00a0"));e.select(O);O.lastChild.outerHTML="";e.setRng(N)}}function y(P){var O=P,Q=[],N;while(O=O.firstChild){if(i.isBlock(O)){return}if(O.nodeType==1&&!c[O.nodeName.toLowerCase()]){Q.push(O)}}N=Q.length;while(N--){O=Q[N];if(!O.hasChildNodes()||(O.firstChild==O.lastChild&&O.firstChild.nodeValue==="")){i.remove(O)}else{if(O.nodeName=="A"&&(O.innerText||O.textContent)===" "){i.remove(O)}}}}function m(O){var T,R,N,U,S,Q=O,P;N=i.createRng();if(O.hasChildNodes()){T=new a(O,O);while(R=T.current()){if(R.nodeType==3){N.setStart(R,0);N.setEnd(R,0);break}if(c[R.nodeName.toLowerCase()]){N.setStartBefore(R);N.setEndBefore(R);break}Q=R;R=T.next()}if(!R){N.setStart(Q,0);N.setEnd(Q,0)}}else{if(O.nodeName=="BR"){if(O.nextSibling&&i.isBlock(O.nextSibling)){if(!M||M<9){P=i.create("br");O.parentNode.insertBefore(P,O)}N.setStartBefore(O);N.setEndBefore(O)}else{N.setStartAfter(O);N.setEndAfter(O)}}else{N.setStart(O,0);N.setEnd(O,0)}}e.setRng(N);i.remove(P);S=i.getViewPort(f.getWin());U=i.getPos(O).y;if(U<S.y||U+25>S.y+S.h){f.getWin().scrollTo(0,U<S.y?U:U-S.h+25)}}function r(O){var P=z,R,Q,N;R=O||t=="TABLE"?i.create(O||x):p.cloneNode(false);N=R;if(d.keep_styles!==false){do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(P.nodeName)){Q=P.cloneNode(false);i.setAttrib(Q,"id","");if(R.hasChildNodes()){Q.appendChild(R.firstChild);R.appendChild(Q)}else{N=Q;R.appendChild(Q)}}}while(P=P.parentNode)}if(!b.isIE){N.innerHTML="<br>"}return R}function q(Q){var P,O,N;if(z.nodeType==3&&(Q?u>0:u<z.nodeValue.length)){return false}if(z.parentNode==p&&C&&!Q){return true}if(Q&&z.nodeType==1&&z==p.firstChild){return true}if(z.nodeName==="TABLE"||(z.previousSibling&&z.previousSibling.nodeName=="TABLE")){return(C&&!Q)||(!C&&Q)}P=new a(z,p);if(z.nodeType==3){if(Q&&u==0){P.prev()}else{if(!Q&&u==z.nodeValue.length){P.next()}}}while(O=P.current()){if(O.nodeType===1){if(!O.getAttribute("data-mce-bogus")){N=O.nodeName.toLowerCase();if(c[N]&&N!=="br"){return false}}}else{if(O.nodeType===3&&!/^[ \t\r\n]*$/.test(O.nodeValue)){return false}}if(Q){P.prev()}else{P.next()}}return true}function l(N,T){var U,S,P,R,Q,O=x||"P";S=i.getParent(N,i.isBlock);if(!S||!E(S)){S=S||j;if(!S.hasChildNodes()){U=i.create(O);S.appendChild(U);v.setStart(U,0);v.setEnd(U,0);return U}R=N;while(R.parentNode!=S){R=R.parentNode}while(R&&!i.isBlock(R)){P=R;R=R.previousSibling}if(P){U=i.create(O);P.parentNode.insertBefore(U,P);R=P;while(R&&!i.isBlock(R)){Q=R.nextSibling;U.appendChild(R);R=Q}v.setStart(N,T);v.setEnd(N,T)}}return N}function H(){function N(P){var O=n[P?"firstChild":"lastChild"];while(O){if(O.nodeType==1){break}O=O[P?"nextSibling":"previousSibling"]}return O===p}o=x?r(x):i.create("BR");if(N(true)&&N()){i.replace(o,n)}else{if(N(true)){n.parentNode.insertBefore(o,n)}else{if(N()){i.insertAfter(o,n);F(o)}else{G=v.cloneRange();G.setStartAfter(p);G.setEndAfter(n);k=G.extractContents();i.insertAfter(k,n);i.insertAfter(o,n)}}}i.remove(p);m(o);h.add()}function D(){var O=new a(z,p),N;while(N=O.current()){if(N.nodeName=="BR"){return true}N=O.next()}}function L(){var O,N;if(z&&z.nodeType==3&&u>=z.nodeValue.length){if(!b.isIE&&!D()){O=i.create("br");v.insertNode(O);v.setStartAfter(O);v.setEndAfter(O);N=true}}O=i.create("br");v.insertNode(O);if(b.isIE&&t=="PRE"&&(!M||M<8)){O.parentNode.insertBefore(i.doc.createTextNode("\r"),O)}if(!N){v.setStartAfter(O);v.setEndAfter(O)}else{v.setStartBefore(O);v.setEndBefore(O)}e.setRng(v);h.add()}function s(N){do{if(N.nodeType===3){N.nodeValue=N.nodeValue.replace(/^[\r\n]+/,"")}N=N.firstChild}while(N)}function K(P){var N=i.getRoot(),O,Q;O=P;while(O!==N&&i.getContentEditable(O)!=="false"){if(i.getContentEditable(O)==="true"){Q=O}O=O.parentNode}return O!==N?Q:N}function I(O){var N;if(!b.isIE){O.normalize();N=O.lastChild;if(!N||(/^(left|right)$/gi.test(i.getStyle(N,"float",true)))){i.add(O,"br")}}}if(!v.collapsed){f.execCommand("Delete");return}if(A.isDefaultPrevented()){return}z=v.startContainer;u=v.startOffset;x=(d.force_p_newlines?"p":"")||d.forced_root_block;x=x?x.toUpperCase():"";M=i.doc.documentMode;B=A.shiftKey;if(z.nodeType==1&&z.hasChildNodes()){C=u>z.childNodes.length-1;z=z.childNodes[Math.min(u,z.childNodes.length-1)]||z;if(C&&z.nodeType==3){u=z.nodeValue.length}else{u=0}}j=K(z);if(!j){return}h.beforeChange();if(!i.isBlock(j)&&j!=i.getRoot()){if(!x||B){L()}return}if((x&&!B)||(!x&&B)){z=l(z,u)}p=i.getParent(z,i.isBlock);n=p?i.getParent(p.parentNode,i.isBlock):null;t=p?p.nodeName.toUpperCase():"";J=n?n.nodeName.toUpperCase():"";if(t=="LI"){if(!x&&B){L();return}if(i.isEmpty(p)){if(/^(UL|OL|LI)$/.test(n.parentNode.nodeName)){return false}H();return}}if(t=="PRE"&&d.br_in_pre!==false){if(!B){L();return}}else{if((!x&&!B&&t!="LI")||(x&&B)){L();return}}x=x||"P";if(q()){if(/^(H[1-6]|PRE)$/.test(t)&&J!="HGROUP"){o=r(x)}else{o=r()}if(d.end_container_on_empty_block&&E(n)&&i.isEmpty(p)){o=i.split(n,p)}else{i.insertAfter(o,p)}m(o)}else{if(q(true)){o=p.parentNode.insertBefore(r(),p);F(o)}else{G=v.cloneRange();G.setEndAfter(p);k=G.extractContents();s(k);o=k.firstChild;i.insertAfter(k,p);y(o);I(p);m(o)}}i.setAttrib(o,"id","");h.add()}f.onKeyDown.add(function(k,j){if(j.keyCode==13){if(g(j)!==false){j.preventDefault()}}})}})(tinymce); \ No newline at end of file
+(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.10",releaseDate:"2013-10-24",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isIE11=g.indexOf("Trident/")!=-1&&(g.indexOf("rv:")!=-1||o.appName.indexOf("Netscape")!=-1);s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName)||s.isIE11;s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&!s.isIE11&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){r=f[m].href;if(r){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==b}if(f=="array"&&c.isArray(g)){return true}return typeof(g)==f},isArray:Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==b){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];c.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];c.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(n,k){var j,f,h,g=arguments,m;for(j=1,f=g.length;j<f;j++){k=g[j];for(h in k){if(k.hasOwnProperty(h)){m=k[h];if(m!==b){n[h]=m}}}}return n},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){this.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}c.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}c.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this,g;g=function(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(e.detachEvent){e.detachEvent("onbeforeunload",k);e.detachEvent("onunload",g)}else{if(e.removeEventListener){e.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(e.CollectGarbage){CollectGarbage()}}};function k(){var l=document;function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l.readyState=="interactive"){if(l){l.attachEvent("onstop",f)}e.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}j={func:j,scope:i||this};if(!h.unloads){if(e.attachEvent){e.attachEvent("onunload",g);e.attachEvent("onbeforeunload",k)}else{if(e.addEventListener){e.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;c.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){if(!f||c.is(f,"array")){return f}return c.map(f.split(g||","),c.trim)},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(d){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===b){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};c._init();e.tinymce=e.tinyMCE=c})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,inDispatch:false,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(b,a){this.listeners.push({cb:b,scope:a||this.scope});return b},addToTop:function(d,b){var a=this,c={cb:d,scope:b||a.scope};if(a.inDispatch){a.listeners=[c].concat(a.listeners)}else{a.listeners.unshift(c)}return d},remove:function(c){var b=this.listeners,a=null;tinymce.each(b,function(e,d){if(c==e.cb){a=e;b.splice(d,1);return false}});return a},dispatch:function(){var a=this,e,b=arguments,c,d=a.listeners,f;a.inDispatch=true;for(c=0;c<d.length;c++){f=d[c];e=f.cb.apply(f.scope,b.length>0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(c,e,d){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,e,d)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&Object.prototype.toString.call(o)==="[object Array]"){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey},metaKeyPressed:function(b){return a.isMac?b.metaKey:b.ctrlKey&&!b.altKey}}})(tinymce);tinymce.util.Quirks=function(a){var j=tinymce.VK,f=j.BACKSPACE,k=j.DELETE,e=a.dom,m=a.selection,I=a.settings,x=a.parser,p=a.serializer,F=tinymce.each;function B(O,N){try{a.getDoc().execCommand(O,false,N)}catch(M){}}function o(){var M=a.getDoc().documentMode;return M?M:6}function A(M){return M.isDefaultPrevented()}function K(){function M(S){var O,Q,N,T,P,R,U;function V(){if(P.nodeType==3){if(S&&R==P.length){return true}if(!S&&R===0){return true}}}O=m.getRng();var W=[O.startContainer,O.startOffset,O.endContainer,O.endOffset];if(!O.collapsed){S=true}P=O[(S?"start":"end")+"Container"];R=O[(S?"start":"end")+"Offset"];if(P.nodeType==3){Q=e.getParent(O.startContainer,e.isBlock);if(S){Q=e.getNext(Q,e.isBlock)}if(Q&&(V()||!O.collapsed)){N=e.create("em",{id:"__mceDel"});F(tinymce.grep(Q.childNodes),function(X){N.appendChild(X)});Q.appendChild(N)}}O=e.createRng();O.setStart(W[0],W[1]);O.setEnd(W[2],W[3]);m.setRng(O);a.getDoc().execCommand(S?"ForwardDelete":"Delete",false,null);if(N){T=m.getBookmark();while(U=e.get("__mceDel")){e.remove(U,true)}m.moveToBookmark(T)}}a.onKeyDown.add(function(N,P){var O;O=P.keyCode==k;if(!A(P)&&(O||P.keyCode==f)&&!j.modifierPressed(P)){P.preventDefault();M(O)}});a.addCommand("Delete",function(){M()})}function r(){function M(P){var O=e.create("body");var Q=P.cloneContents();O.appendChild(Q);return m.serializer.serialize(O,{format:"html"})}function N(O){var Q=M(O);var R=e.createRng();R.selectNode(a.getBody());var P=M(R);return Q===P}a.onKeyDown.add(function(P,R){var Q=R.keyCode,O;if(!A(R)&&(Q==k||Q==f)){O=P.selection.isCollapsed();if(O&&!e.isEmpty(P.getBody())){return}if(tinymce.isIE&&!O){return}if(!O&&!N(P.selection.getRng())){return}P.setContent("");P.selection.setCursorLocation(P.getBody(),0);P.nodeChanged()}})}function J(){a.onKeyDown.add(function(M,N){if(!A(N)&&N.keyCode==65&&j.metaKeyPressed(N)){N.preventDefault();M.execCommand("SelectAll")}})}function L(){if(!a.settings.content_editable){e.bind(a.getDoc(),"focusin",function(M){m.setRng(m.getRng())});e.bind(a.getDoc(),"mousedown",function(M){if(M.target==a.getDoc().documentElement){a.getWin().focus();m.setRng(m.getRng())}})}}function C(){a.onKeyDown.add(function(M,P){if(!A(P)&&P.keyCode===f){if(m.isCollapsed()&&m.getRng(true).startOffset===0){var O=m.getNode();var N=O.previousSibling;if(N&&N.nodeName&&N.nodeName.toLowerCase()==="hr"){e.remove(N);tinymce.dom.Event.cancel(P)}}}})}function z(){if(!Range.prototype.getClientRects){a.onMouseDown.add(function(N,O){if(!A(O)&&O.target.nodeName==="HTML"){var M=N.getBody();M.blur();setTimeout(function(){M.focus()},0)}})}}function h(){a.onClick.add(function(M,N){N=N.target;if(/^(IMG|HR)$/.test(N.nodeName)){m.getSel().setBaseAndExtent(N,0,N,1)}if(N.nodeName=="A"&&e.hasClass(N,"mceItemAnchor")){m.select(N)}M.nodeChanged()})}function c(){function N(){var P=e.getAttribs(m.getStart().cloneNode(false));return function(){var Q=m.getStart();if(Q!==a.getBody()){e.setAttrib(Q,"style",null);F(P,function(R){Q.setAttributeNode(R.cloneNode(true))})}}}function M(){return !m.isCollapsed()&&e.getParent(m.getStart(),e.isBlock)!=e.getParent(m.getEnd(),e.isBlock)}function O(P,Q){Q.preventDefault();return false}a.onKeyPress.add(function(P,R){var Q;if(!A(R)&&(R.keyCode==8||R.keyCode==46)&&M()){Q=N();P.getDoc().execCommand("delete",false,null);Q();R.preventDefault();return false}});e.bind(a.getDoc(),"cut",function(Q){var P;if(!A(Q)&&M()){P=N();a.onKeyUp.addToTop(O);setTimeout(function(){P();a.onKeyUp.remove(O)},0)}})}function b(){var N,M;e.bind(a.getDoc(),"selectionchange",function(){if(M){clearTimeout(M);M=0}M=window.setTimeout(function(){var O=m.getRng();if(!N||!tinymce.dom.RangeUtils.compareRanges(O,N)){a.nodeChanged();N=O}},50)})}function y(){document.body.setAttribute("role","application")}function u(){a.onKeyDown.add(function(M,O){if(!A(O)&&O.keyCode===f){if(m.isCollapsed()&&m.getRng(true).startOffset===0){var N=m.getNode().previousSibling;if(N&&N.nodeName&&N.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(O)}}}})}function D(){if(o()>7){return}B("RespectVisibilityInDesign",true);a.contentStyles.push(".mceHideBrInPre pre br {display: none}");e.addClass(a.getBody(),"mceHideBrInPre");x.addNodeFilter("pre",function(M,O){var P=M.length,R,N,S,Q;while(P--){R=M[P].getAll("br");N=R.length;while(N--){S=R[N];Q=S.prev;if(Q&&Q.type===3&&Q.value.charAt(Q.value-1)!="\n"){Q.value+="\n"}else{S.parent.insert(new tinymce.html.Node("#text",3),S,true).value="\n"}}}});p.addNodeFilter("pre",function(M,O){var P=M.length,R,N,S,Q;while(P--){R=M[P].getAll("br");N=R.length;while(N--){S=R[N];Q=S.prev;if(Q&&Q.type==3){Q.value=Q.value.replace(/\r?\n$/,"")}}}})}function g(){e.bind(a.getBody(),"mouseup",function(O){var N,M=m.getNode();if(M.nodeName=="IMG"){if(N=e.getStyle(M,"width")){e.setAttrib(M,"width",N.replace(/[^0-9%]+/g,""));e.setStyle(M,"width","")}if(N=e.getStyle(M,"height")){e.setAttrib(M,"height",N.replace(/[^0-9%]+/g,""));e.setStyle(M,"height","")}}})}function d(){a.onKeyDown.add(function(S,T){var R,M,N,P,Q,U,O;R=T.keyCode==k;if(!A(T)&&(R||T.keyCode==f)&&!j.modifierPressed(T)){M=m.getRng();N=M.startContainer;P=M.startOffset;O=M.collapsed;if(N.nodeType==3&&N.nodeValue.length>0&&((P===0&&!O)||(O&&P===(R?0:1)))){U=N.previousSibling;if(U&&U.nodeName=="IMG"){return}nonEmptyElements=S.schema.getNonEmptyElements();T.preventDefault();Q=e.create("br",{id:"__tmp"});N.parentNode.insertBefore(Q,N);S.getDoc().execCommand(R?"ForwardDelete":"Delete",false,null);N=m.getRng().startContainer;U=N.previousSibling;if(U&&U.nodeType==1&&!e.isBlock(U)&&e.isEmpty(U)&&!nonEmptyElements[U.nodeName.toLowerCase()]){e.remove(U)}e.remove("__tmp")}}})}function H(){a.onKeyDown.add(function(Q,R){var O,N,S,M,P;if(A(R)||R.keyCode!=j.BACKSPACE){return}O=m.getRng();N=O.startContainer;S=O.startOffset;M=e.getRoot();P=N;if(!O.collapsed||S!==0){return}while(P&&P.parentNode&&P.parentNode.firstChild==P&&P.parentNode!=M){P=P.parentNode}if(P.tagName==="BLOCKQUOTE"){Q.formatter.toggle("blockquote",null,P);O=e.createRng();O.setStart(N,0);O.setEnd(N,0);m.setRng(O)}})}function G(){function M(){a._refreshContentEditable();B("StyleWithCSS",false);B("enableInlineTableEditing",false);if(!I.object_resizing){B("enableObjectResizing",false)}}if(!I.readonly){a.onBeforeExecCommand.add(M);a.onMouseDown.add(M)}}function t(){function M(N,O){F(e.select("a"),function(R){var P=R.parentNode,Q=e.getRoot();if(P.lastChild===R){while(P&&!e.isBlock(P)){if(P.parentNode.lastChild!==P||P===Q){return}P=P.parentNode}e.add(P,"br",{"data-mce-bogus":1})}})}a.onExecCommand.add(function(N,O){if(O==="CreateLink"){M(N)}});a.onSetContent.add(m.onSetContent.add(M))}function n(){if(I.forced_root_block){a.onInit.add(function(){B("DefaultParagraphSeparator",I.forced_root_block)})}}function q(){function M(O,N){if(!O||!N.initial){a.execCommand("mceRepaint")}}a.onUndo.add(M);a.onRedo.add(M);a.onSetContent.add(M)}function i(){a.onKeyDown.add(function(N,O){var M;if(!A(O)&&O.keyCode==f){M=N.getDoc().selection.createRange();if(M&&M.item){O.preventDefault();N.undoManager.beforeChange();e.remove(M.item(0));N.undoManager.add()}}})}function s(){var M;if(o()>=10){M="";F("p div h1 h2 h3 h4 h5 h6".split(" "),function(N,O){M+=(O>0?",":"")+N+":empty"});a.contentStyles.push(M+"{padding-right: 1px !important}")}}function v(){var O,N,ae,M,Z,ac,aa,ad,P,Q,ab,X,W,Y=document,U=a.getDoc();if(!I.object_resizing||I.webkit_fake_resize===false){return}B("enableObjectResizing",false);ab={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};function S(ai){var ah,ag;ah=ai.screenX-ac;ag=ai.screenY-aa;X=ah*Z[2]+ad;W=ag*Z[3]+P;X=X<5?5:X;W=W<5?5:W;if(j.modifierPressed(ai)||(ae.nodeName=="IMG"&&Z[2]*Z[3]!==0)){X=Math.round(W/Q);W=Math.round(X*Q)}e.setStyles(M,{width:X,height:W});if(Z[2]<0&&M.clientWidth<=X){e.setStyle(M,"left",O+(ad-X))}if(Z[3]<0&&M.clientHeight<=W){e.setStyle(M,"top",N+(P-W))}}function af(){function ag(ah,ai){if(ai){if(ae.style[ah]||!a.schema.isValid(ae.nodeName.toLowerCase(),ah)){e.setStyle(ae,ah,ai)}else{e.setAttrib(ae,ah,ai)}}}ag("width",X);ag("height",W);e.unbind(U,"mousemove",S);e.unbind(U,"mouseup",af);if(Y!=U){e.unbind(Y,"mousemove",S);e.unbind(Y,"mouseup",af)}e.remove(M);R(ae)}function R(aj){var ah,ai,ag;T();ah=e.getPos(aj);O=ah.x;N=ah.y;ai=aj.offsetWidth;ag=aj.offsetHeight;if(ae!=aj){ae=aj;X=W=0}F(ab,function(am,ak){var al;al=e.get("mceResizeHandle"+ak);if(!al){al=e.add(U.documentElement,"div",{id:"mceResizeHandle"+ak,"class":"mceResizeHandle",style:"cursor:"+ak+"-resize; margin:0; padding:0"});e.bind(al,"mousedown",function(an){an.preventDefault();af();ac=an.screenX;aa=an.screenY;ad=ae.clientWidth;P=ae.clientHeight;Q=P/ad;Z=am;M=ae.cloneNode(true);e.addClass(M,"mceClonedResizable");e.setStyles(M,{left:O,top:N,margin:0});U.documentElement.appendChild(M);e.bind(U,"mousemove",S);e.bind(U,"mouseup",af);if(Y!=U){e.bind(Y,"mousemove",S);e.bind(Y,"mouseup",af)}})}else{e.show(al)}e.setStyles(al,{left:(ai*am[0]+O)-(al.offsetWidth/2),top:(ag*am[1]+N)-(al.offsetHeight/2)})});if(!tinymce.isOpera&&ae.nodeName=="IMG"){ae.setAttribute("data-mce-selected","1")}}function T(){if(ae){ae.removeAttribute("data-mce-selected")}for(var ag in ab){e.hide("mceResizeHandle"+ag)}}a.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}");function V(){var ag=e.getParent(m.getNode(),"table,img");F(e.select("img[data-mce-selected]"),function(ah){ah.removeAttribute("data-mce-selected")});if(ag){R(ag)}else{T()}}a.onNodeChange.add(V);e.bind(U,"selectionchange",V);a.serializer.addAttributeFilter("data-mce-selected",function(ag,ah){var ai=ag.length;while(ai--){ag[ai].attr(ah,null)}})}function E(){if(o()<9){x.addNodeFilter("noscript",function(M){var N=M.length,O,P;while(N--){O=M[N];P=O.firstChild;if(P){O.attr("data-mce-innertext",P.value)}}});p.addNodeFilter("noscript",function(M){var N=M.length,O,Q,P;while(N--){O=M[N];Q=M[N].firstChild;if(Q){Q.value=tinymce.html.Entities.decode(Q.value)}else{P=O.attributes.map["data-mce-innertext"];if(P){O.attr("data-mce-innertext",null);Q=new tinymce.html.Node("#text",3);Q.value=P;Q.raw=true;O.append(Q)}}}})}}function l(){a.contentStyles.push("body {min-height: 100px}");a.onClick.add(function(M,N){if(N.target.nodeName=="HTML"){a.execCommand("SelectAll");a.selection.collapse(true);a.nodeChanged()}})}u();H();r();if(tinymce.isWebKit){d();K();L();h();n();if(tinymce.isIDevice){b()}else{v();J()}}if(tinymce.isIE&&!tinymce.isIE11){C();y();D();g();i();s();E()}if(tinymce.isIE11){l()}if(tinymce.isGecko&&!tinymce.isIE11){C();z();c();G();t();q()}if(tinymce.isOpera){v()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"};d={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g<j.length;g++){a[j[g]]="\uFEFF"+g;a["\uFEFF"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;if(z["border-image"]==="none"){delete z["border-image"]}F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script noscript style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object script",z);textBlockElementsMap=m("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure");v=m("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",textBlockElementsMap);function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K<G;K++){F=N.exec(L[K]);if(F){W=F[1];Q=F[2];E=F[3];X=F[4];O={};J=[];I={attributes:O,attributesOrder:J};if(W==="#"){I.paddEmpty=true}if(W==="-"){I.removeEmpty=true}if(S){for(ad in S){O[ad]=S[ad]}J.push.apply(J,H)}if(X){X=d(X,"|");for(Z=0,V=X.length;Z<V;Z++){F=R.exec(X[Z]);if(F){U={};ac=F[1];Y=F[2].replace(/::/g,":");W=F[3];T=F[4];if(ac==="!"){I.attributesRequired=I.attributesRequired||[];I.attributesRequired.push(Y);U.required=true}if(ac==="-"){delete O[Y];J.splice(f.inArray(J,Y),1);continue}if(W){if(W==="="){I.attributesDefault=I.attributesDefault||[];I.attributesDefault.push({name:Y,value:T});U.defaultValue=T}if(W===":"){I.attributesForced=I.attributesForced||[];I.attributesForced.push({name:Y,value:T});U.forcedValue=T}if(W==="<"){U.validValues=e(T,"?")}}if(M.test(Y)){I.attributePatterns=I.attributePatterns||[];U.pattern=i(Y);I.attributePatterns.push(U)}else{if(!O[Y]){J.push(Y)}O[Y]=U}}}}if(!S&&Q=="@"){S=O;H=J}if(E){I.outputName=Q;s[E]=I}if(M.test(Q)){I.pattern=i(Q);j.push(I)}else{s[Q]=I}}}}}function t(E){s={};j=[];C(E);g(y,function(G,F){k[F]=G.children})}function l(F){var E=/^(~)?(.+)$/;if(F){g(d(F),function(J){var H=E.exec(J),I=H[1]==="~",K=I?"span":"div",G=H[2];k[G]=k[K];p[G]=K;if(!I){v[G.toUpperCase()]={};v[G]={}}if(!s[G]){s[G]=s[K]}g(k,function(L,M){if(L[K]){L[G]=L[K]}})})}}function x(F){var E=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(F){g(d(F),function(J){var I=E.exec(J),G,H;if(I){H=I[1];if(H){G=k[I[2]]}else{G=k[I[2]]={"#comment":{}}}G=k[I[2]];g(d(I[3],"|"),function(K){if(H==="-"){delete G[K]}else{G[K]={}}})}})}}function B(E){var G=s[E],F;if(G){return G}F=j.length;while(F--){G=j[F];if(G.pattern.test(E)){return G}}}if(!A.valid_elements){g(y,function(F,E){s[E]={attributes:F.attributes,attributesOrder:F.attributesOrder};k[E]=F.children});if(A.schema!="html5"){g(d("strong/b,em/i"),function(E){E=d(E,"/");s[E[1]].outputName=E[0]})}s.img.attributesDefault=[{name:"alt",value:""}];g(d("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i"),function(E){if(s[E]){s[E].removeEmpty=true}});g(d("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(E){s[E].paddEmpty=true})}else{t(A.valid_elements)}l(A.custom_elements);x(A.valid_children);C(A.extended_valid_elements);x("+ol[ul|ol],+ul[ul|ol]");if(A.invalid_elements){f.each(f.explode(A.invalid_elements),function(E){if(s[E]){delete s[E]}})}if(!B("span")){C("span[!data-mce-type|*]")}u.children=k;u.styles=D;u.getBoolAttrs=function(){return r};u.getBlockElements=function(){return v};u.getTextBlockElements=function(){return textBlockElementsMap};u.getShortEndedElements=function(){return z};u.getSelfClosingElements=function(){return q};u.getNonEmptyElements=function(){return n};u.getWhiteSpaceElements=function(){return o};u.isValidChild=function(E,G){var F=k[E];return !!(F&&F[G])};u.isValid=function(F,E){var H,G,I=B(F);if(I){if(E){if(I.attributes[E]){return true}H=I.attributePatterns;if(H){G=H.length;while(G--){if(H[G].pattern.test(F)){return true}}}}else{return true}}return false};u.getElementRule=B;u.getCustomElements=function(){return p};u.addValidElements=C;u.setValidElements=t;u.addCustomElements=l;u.addValidChildren=x;u.elements=s}})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(E){var n=this,g,G=0,I,B,A=[],N,Q,C,r,z,s,M,H,O,v,m,k,t,R,o,P,F,S,L,f,J,l,D,K,h,x=0,j=a.html.Entities.decode,y,q;function u(T){var V,U;V=A.length;while(V--){if(A[V].name===T){break}}if(V>=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G<g.index){n.text(j(E.substr(G,g.index-G)))}if(I=g[6]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}u(I)}else{if(I=g[7]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}O=I in M;if(y&&J[I]&&A.length>0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G<E.length){n.text(j(E.substr(G)))}for(Q=A.length-1;Q>=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-mce-")===0){return false}}}if(j.type===8){return false}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true},walk:function(f){return a(this,null,f)}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(n){var p,q,y,x,A,o,r,l,u,v,k,t,m,z,s;t=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();m=h.getTextBlockElements();for(p=0;p<n.length;p++){q=n[p];if(!q.parent||q.fixed){continue}if(m[q.name]&&q.parent.name=="li"){z=q.next;while(z){if(m[z.name]){z.name="li";z.fixed=true;q.parent.insert(z,q.parent)}else{break}z=z.next}q.unwrap(q);continue}x=[q];for(y=q.parent;y&&!h.isValidChild(y.name,q.name)&&!t[y.name];y=y.parent){x.push(y)}if(y&&x.length>1){x.reverse();A=o=f.filterNode(x[0].clone());for(u=0;u<x.length-1;u++){if(h.isValidChild(o.name,x[u].name)){r=f.filterNode(x[u].clone());o.append(r)}else{r=o}for(l=x[u].firstChild;l&&l!=x[u+1];){s=l.next;r.append(l);l=s}o=r}if(!A.isEmpty(k)){y.insert(A,x[0],true);y.insert(q,A)}else{y.insert(q,x[0],true)}y=x[0];if(y.isEmpty(k)||y.firstChild===y.lastChild&&y.firstChild.name==="br"){y.empty().remove()}}else{if(q.parent){if(q.name==="li"){z=q.prev;if(z&&(z.name==="ul"||z.name==="ul")){z.append(q);continue}z=q.next;if(z&&(z.name==="ul"||z.name==="ul")){z.insert(q,z.firstChild,true);continue}q.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(q.parent.name,"div")&&h.isValidChild("div",q.name)){q.wrap(f.filterNode(new a("div",1)))}else{if(q.name==="style"||q.name==="script"){q.empty().remove()}else{q.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(v,m){var n,J,B,A,D,C,x,r,F,N,z,o,E,M=[],L,t,k,y,s,p,u,q;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());u=h.getNonEmptyElements();p=h.children;z=g.validate;q="forced_root_block" in m?m.forced_root_block:g.forced_root_block;s=h.getWhiteSpaceElements();E=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;y=/^[ \t\r\n]+$/;function G(){var O=J.firstChild,l,P;while(O){l=O.next;if(O.type==3||(O.type==1&&O.name!=="p"&&!o[O.name]&&!O.attr("data-mce-type"))){if(!P){P=K(q,1);J.insert(P,O);P.append(O)}else{P.append(O)}}else{P=null}O=l}}function K(l,O){var P=new a(l,O),Q;if(l in e){Q=i[l];if(Q){Q.push(P)}else{i[l]=[P]}}return P}function I(P){var Q,l,O;for(Q=P.prev;Q&&Q.type===3;){l=Q.value.replace(t,"");if(l.length>0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D<C;D++){F[D](A,N,m)}}for(D=0,C=d.length;D<C;D++){F=d[D];if(F.name in c){A=c[F.name];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(x=0,r=F.callbacks.length;x<r;x++){F.callbacks[x](A,F.name,m)}}}}return J};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,v=b.extend({},h.getBlockElements()),k=h.getNonEmptyElements(),t,s,p,u;v.body=1;for(r=0;r<q;r++){o=n[r];t=o.parent;if(v[o.parent.name]&&o===t.lastChild){p=o.prev;while(p){u=p.name;if(u!=="span"||p.attr("data-mce-type")!=="bookmark"){if(u!=="br"){break}if(u==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(t.isEmpty(k)){elementRule=h.getElementRule(t.name);if(elementRule){if(elementRule.removeEmpty){t.remove()}else{if(elementRule.paddEmpty){t.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}else{s=o;while(t.firstChild===s&&t.lastChild===s){s=t;if(v[t.name]){break}t=t.parent}if(s===t){textNode=new b.html.Node("#text",3);textNode.value="\u00a0";o.replace(textNode)}}}})}if(!g.allow_html_in_named_anchor){f.addAttributeFilter("id,name",function(k,l){var n=k.length,p,m,o,q;while(n--){q=k[n];if(q.name==="a"&&q.firstChild&&!q.attr("href")){o=q.parent;p=q.lastChild;do{m=p.prev;o.insert(p,q);p=m}while(p)}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);tinymce.dom={};(function(b,h){var g=!!document.addEventListener;function c(k,j,l,i){if(k.addEventListener){k.addEventListener(j,l,i||false)}else{if(k.attachEvent){k.attachEvent("on"+j,l)}}}function e(k,j,l,i){if(k.removeEventListener){k.removeEventListener(j,l,i||false)}else{if(k.detachEvent){k.detachEvent("on"+j,l)}}}function a(n,l){var i,k=l||{};function j(){return false}function m(){return true}for(i in n){if(i!=="layerX"&&i!=="layerY"){k[i]=n[i]}}if(!k.target){k.target=k.srcElement||document}k.preventDefault=function(){k.isDefaultPrevented=m;if(n){if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}}};k.stopPropagation=function(){k.isPropagationStopped=m;if(n){if(n.stopPropagation){n.stopPropagation()}else{n.cancelBubble=true}}};k.stopImmediatePropagation=function(){k.isImmediatePropagationStopped=m;k.stopPropagation()};if(!k.isDefaultPrevented){k.isDefaultPrevented=j;k.isPropagationStopped=j;k.isImmediatePropagationStopped=j}return k}function d(m,n,l){var k=m.document,j={type:"ready"};function i(){if(!l.domLoaded){l.domLoaded=true;n(j)}}if(k.readyState=="complete"){i();return}if(g){c(m,"DOMContentLoaded",i)}else{c(k,"readystatechange",function(){if(k.readyState==="complete"){e(k,"readystatechange",arguments.callee);i()}});if(k.documentElement.doScroll&&m===m.top){(function(){try{k.documentElement.doScroll("left")}catch(o){setTimeout(arguments.callee,0);return}i()})()}}c(m,"load",i)}function f(k){var q=this,p={},i,o,n,m,l;m="onmouseenter" in document.documentElement;n="onfocusin" in document.documentElement;l={mouseenter:"mouseover",mouseleave:"mouseout"};i=1;q.domLoaded=false;q.events=p;function j(t,x){var s,u,r,v;s=p[x][t.type];if(s){for(u=0,r=s.length;u<r;u++){v=s[u];if(v&&v.func.call(v.scope,t)===false){t.preventDefault()}if(t.isImmediatePropagationStopped()){return}}}}q.bind=function(x,A,D,E){var s,t,u,r,B,z,C,v=window;function y(F){j(a(F||v.event),s)}if(!x||x.nodeType===3||x.nodeType===8){return}if(!x[h]){s=i++;x[h]=s;p[s]={}}else{s=x[h];if(!p[s]){p[s]={}}}E=E||x;A=A.split(" ");u=A.length;while(u--){r=A[u];z=y;B=C=false;if(r==="DOMContentLoaded"){r="ready"}if((q.domLoaded||x.readyState=="complete")&&r==="ready"){q.domLoaded=true;D.call(E,a({type:r}));continue}if(!m){B=l[r];if(B){z=function(F){var H,G;H=F.currentTarget;G=F.relatedTarget;if(G&&H.contains){G=H.contains(G)}else{while(G&&G!==H){G=G.parentNode}}if(!G){F=a(F||v.event);F.type=F.type==="mouseout"?"mouseleave":"mouseenter";F.target=H;j(F,s)}}}}if(!n&&(r==="focusin"||r==="focusout")){C=true;B=r==="focusin"?"focus":"blur";z=function(F){F=a(F||v.event);F.type=F.type==="focus"?"focusin":"focusout";j(F,s)}}t=p[s][r];if(!t){p[s][r]=t=[{func:D,scope:E}];t.fakeName=B;t.capture=C;t.nativeHandler=z;if(!g){t.proxyHandler=k(s)}if(r==="ready"){d(x,z,q)}else{c(x,B||r,g?z:t.proxyHandler,C)}}else{t.push({func:D,scope:E})}}x=t=0;return D};q.unbind=function(x,z,A){var s,u,v,B,r,t;if(!x||x.nodeType===3||x.nodeType===8){return q}s=x[h];if(s){t=p[s];if(z){z=z.split(" ");v=z.length;while(v--){r=z[v];u=t[r];if(u){if(A){B=u.length;while(B--){if(u[B].func===A){u.splice(B,1)}}}if(!A||u.length===0){delete t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}}}}else{for(r in t){u=t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}t={}}for(r in t){return q}delete p[s];try{delete x[h]}catch(y){x[h]=null}}return q};q.fire=function(u,s,r){var v,t;if(!u||u.nodeType===3||u.nodeType===8){return q}t=a(null,r);t.type=s;do{v=u[h];if(v){j(t,v)}u=u.parentNode||u.ownerDocument||u.defaultView||u.parentWindow}while(u&&!t.isPropagationStopped());return q};q.clean=function(u){var s,r,t=q.unbind;if(!u||u.nodeType===3||u.nodeType===8){return q}if(u[h]){t(u)}if(!u.getElementsByTagName){u=u.document}if(u&&u.getElementsByTagName){t(u);r=u.getElementsByTagName("*");s=r.length;while(s--){u=r[s];if(u[h]){t(u)}}}return q};q.callNativeHandler=function(s,r){if(p){p[s][r.type].nativeHandler(r)}};q.destory=function(){p={}};q.add=function(v,s,u,t){if(typeof(v)==="string"){v=document.getElementById(v)}if(v&&v instanceof Array){var r=v.length;while(r--){q.add(v[r],s,u,t)}return}if(s==="init"){s="ready"}return q.bind(v,s instanceof Array?s.join(" "):s,u,t)};q.remove=function(v,s,u,t){if(!v){return q}if(typeof(v)==="string"){v=document.getElementById(v)}if(v instanceof Array){var r=v.length;while(r--){q.remove(v[r],s,u,t)}return q}return q.unbind(v,s instanceof Array?s.join(" "):s,u)};q.clear=function(r){if(typeof(r)==="string"){r=document.getElementById(r)}return q.clean(r)};q.cancel=function(r){if(r){q.prevent(r);q.stop(r)}return false};q.prevent=function(r){if(!r.preventDefault){r=a(r)}r.preventDefault();return false};q.stop=function(r){if(!r.stopPropagation){r=a(r)}r.stopPropagation();return false}}b.EventUtils=f;b.Event=new f(function(i){return function(j){tinymce.dom.Event.callNativeHandler(i,j)}});b.Event.bind(window,"ready",function(){});b=0})(tinymce.dom,"data-mce-expando");tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(e){var g=e.each,d=e.is,f=e.isWebKit,b=e.isIE,h=e.html.Entities,c=/^([a-z0-9],?)+$/i,a=/^[ \t\r\n]*$/;e.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(o,l){var k=this,i,j,n;k.doc=o;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!e.isIE||o.documentMode>=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){if(!q){return false}var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&!e.isIE11&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||e.isIE11||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+"</"+q+">"}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b&&!e.isIE11){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":(b&&!e.isIE11)?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},addStyle:function(j){var k=this.doc,i;styleElm=k.getElementById("mceDefaultStyles");if(!styleElm){styleElm=k.createElement("style"),styleElm.id="mceDefaultStyles";styleElm.type="text/css";i=k.getElementsByTagName("head")[0];if(i.firstChild){i.insertBefore(styleElm,i.firstChild)}else{i.appendChild(styleElm)}}if(styleElm.styleSheet){styleElm.styleSheet.cssText+=j}else{styleElm.appendChild(k.createTextNode(j))}},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&!e.isIE11&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="<br />"+j;m.removeChild(m.firstChild)}catch(l){var n=i.create("div");n.innerHTML="<br />"+j;g(e.grep(n.childNodes),function(p,o){if(o&&m.canHaveHTML){m.appendChild(p)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(t){switch(t.type||1){case 1:if(t.selectorText){g(t.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:try{q(t.styleSheet)}catch(s){}break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab<aa){return -1}return 1}ac=X;while(ac&&ac.parentNode!=Z){ac=ac.parentNode}if(ac){Y=0;t=Z.firstChild;while(t!=ac&&Y<ab){Y++;t=t.nextSibling}if(ab<=Y){return -1}return 1}ac=Z;while(ac&&ac.parentNode!=X){ac=ac.parentNode}if(ac){Y=0;t=X.firstChild;while(t!=ac&&Y<aa){Y++;t=t.nextSibling}if(Y<aa){return -1}return 1}ad=c.findCommonAncestor(Z,X);af=Z;while(af&&af.parentNode!=ad){af=af.parentNode}if(!af){af=ad}ae=X;while(ae&&ae.parentNode!=ad){ae=ae.parentNode}if(!ae){ae=ad}if(af==ae){return 0}t=ad.firstChild;while(t){if(t==af){return -1}if(t==ae){return 1}t=t.nextSibling}}function C(X,aa,Z){var t,Y;if(X){O[h]=aa;O[W]=Z}else{O[Q]=aa;O[A]=Z}t=O[Q];while(t.parentNode){t=t.parentNode}Y=O[h];while(Y.parentNode){Y=Y.parentNode}if(Y==t){if(H(O[h],O[W],O[Q],O[A])>0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,v,q,t,s=d.dom.doc,m=s.body,r,u;function j(C){var y,B,x,A,z;x=h.create("a");y=C?k:v;B=C?p:q;A=n.duplicate();if(y==s||y==s.documentElement){y=m;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);h.remove(x);n.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){h.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{if(y.canHaveHTML){y.innerHTML="<span>\uFEFF</span>";x=y.firstChild;A.moveToElementText(x);A.collapse(f)}}n.setEndPoint(C?"StartToStart":"EndToEnd",A);h.remove(x)}}k=i.startContainer;p=i.startOffset;v=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==v&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){t=k.previousSibling;if(t&&!t.hasChildNodes()&&h.isBlock(t)){t.innerHTML="\uFEFF"}else{t=null}k.innerHTML="<span>\uFEFF</span><span>\uFEFF</span>";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(t){t.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{u=k.childNodes[p];l=m.createControlRange();l.addElement(u);l.select();r=d.getRng();if(r.item&&u===r.item(0)){return}}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e<y.length;e++){if(y[e]===y[e-1]){y.splice(e--,1)}}}}return y};d.matches=function(e,y){return d(e,null,null,y)};d.matchesSelector=function(e,y){return d(y,null,null,[e]).length>0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z<B;z++){C=k.order[z];if((A=k.leftMatch[C].exec(E))){y=A[1];A.splice(1,1);if(y.substr(y.length-1)!=="\\"){A[1]=(A[1]||"").replace(q,"");D=k.find[C](A,e,F);if(D!=null){E=E.replace(k.match[C],"");break}}}}if(!D){D=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:D,expr:E}};d.filter=function(I,H,L,B){var D,e,G,N,K,y,A,C,J,z=I,M=[],F=H,E=H&&H[0]&&d.isXML(H[0]);while(I&&H.length){for(G in k.filter){if((D=k.leftMatch[G].exec(I))!=null&&D[2]){y=k.filter[G];A=D[1];e=false;D.splice(1,1);if(A.substr(A.length-1)==="\\"){continue}if(F===M){M=[]}if(k.preFilter[G]){D=k.preFilter[G](D,F,L,M,B,E);if(!D){e=N=true}else{if(D===true){continue}}}if(D){for(C=0;(K=F[C])!=null;C++){if(K){N=y(K,D,C,F);J=B^N;if(L&&N!=null){if(J){e=true}else{F[C]=false}}else{if(J){M.push(K);e=true}}}}}if(N!==undefined){if(!L){F=M}I=I.replace(k.match[G],"");if(!e){return[]}break}}}if(I===z){if(e==null){d.error(I)}else{break}}z=I}return F};d.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var b=d.getText=function(B){var z,A,e=B.nodeType,y="";if(e){if(e===1||e===9||e===11){if(typeof B.textContent==="string"){return B.textContent}else{if(typeof B.innerText==="string"){return B.innerText.replace(u,"")}else{for(B=B.firstChild;B;B=B.nextSibling){y+=b(B)}}}}else{if(e===3||e===4){return B.nodeValue}}}else{for(z=0;(A=B[z]);z++){if(A.nodeType!==8){y+=b(A)}}}return y};var k=d.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(D,y){var A=typeof y==="string",C=A&&!x.test(y),E=A&&!C;if(C){y=y.toLowerCase()}for(var z=0,e=D.length,B;z<e;z++){if((B=D[z])){while((B=B.previousSibling)&&B.nodeType!==1){}D[z]=E||B&&B.nodeName.toLowerCase()===y?B||false:B===y}}if(E){d.filter(y,D,true)}},">":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z<e;z++){C=D[z];if(C){var A=C.parentNode;D[z]=A.nodeName.toLowerCase()===y?A:false}}}else{for(;z<e;z++){C=D[z];if(C){D[z]=B?C.parentNode:C.parentNode===y}}if(B){d.filter(y,D,true)}}},"":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("parentNode",y,z,A,B,C)},"~":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("previousSibling",y,z,A,B,C)}},find:{ID:function(y,z,A){if(typeof z.getElementById!=="undefined"&&!A){var e=z.getElementById(y[1]);return e&&e.parentNode?[e]:[]}},NAME:function(z,C){if(typeof C.getElementsByName!=="undefined"){var y=[],B=C.getElementsByName(z[1]);for(var A=0,e=B.length;A<e;A++){if(B[A].getAttribute("name")===z[1]){y.push(B[A])}}return y.length===0?null:y}},TAG:function(e,y){if(typeof y.getElementsByTagName!=="undefined"){return y.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(A,y,z,e,D,E){A=" "+A[1].replace(q,"")+" ";if(E){return A}for(var B=0,C;(C=y[B])!=null;B++){if(C){if(D^(C.className&&(" "+C.className+" ").replace(/[\t\n\r]/g," ").indexOf(A)>=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return y<e[3]-0},gt:function(z,y,e){return y>e[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C<B;C++){if(A[C]===z){return false}}return true}else{d.error(e)}}}},CHILD:function(z,B){var A,H,D,G,e,C,F,E=B[1],y=z;switch(E){case"only":case"first":while((y=y.previousSibling)){if(y.nodeType===1){return false}}if(E==="first"){return true}y=z;case"last":while((y=y.nextSibling)){if(y.nodeType===1){return false}}return true;case"nth":A=B[2];H=B[3];if(A===1&&H===0){return true}D=B[0];G=z.parentNode;if(G&&(G[i]!==D||!z.nodeIndex)){C=0;for(y=G.firstChild;y;y=y.nextSibling){if(y.nodeType===1){y.nodeIndex=++C}}G[i]=D}F=z.nodeIndex-H;if(A===0){return F===0}else{return(F%A===0&&F/A>=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z<e;z++){y.push(B[z])}}else{for(;B[z];z++){y.push(B[z])}}}return y}}var p,m;if(document.documentElement.compareDocumentPosition){p=function(y,e){if(y===e){h=true;return 0}if(!y.compareDocumentPosition||!e.compareDocumentPosition){return y.compareDocumentPosition?-1:1}return y.compareDocumentPosition(e)&4?-1:1}}else{p=function(F,E){if(F===E){h=true;return 0}else{if(F.sourceIndex&&E.sourceIndex){return F.sourceIndex-E.sourceIndex}}var C,y,z=[],e=[],B=F.parentNode,D=E.parentNode,G=B;if(B===D){return m(F,E)}else{if(!B){return -1}else{if(!D){return 1}}}while(G){z.unshift(G);G=G.parentNode}G=D;while(G){e.unshift(G);G=G.parentNode}C=z.length;y=e.length;for(var A=0;A<C&&A<y;A++){if(z[A]!==e[A]){return m(z[A],e[A])}}return A===C?m(F,e[A],-1):m(z[A],E,1)};m=function(y,e,z){if(y===e){return z}var A=y.nextSibling;while(A){if(A===e){return -1}A=A.nextSibling}return 1}}(function(){var y=document.createElement("div"),z="script"+(new Date()).getTime(),e=document.documentElement;y.innerHTML="<a name='"+z+"'/>";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="<p class='TEST'></p>";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1&&!F){e[i]=C;e.sizset=A}if(e.nodeName.toLowerCase()===D){B=e;break}e=e[y]}G[A]=B}}}function t(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1){if(!F){e[i]=C;e.sizset=A}if(typeof D!=="string"){if(e===D){B=true;break}}else{if(d.filter(D,[e]).length>0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A<y;A++){d(z,F[A],E,D)}return d.filter(B,E)};window.tinymce.dom.Sizzle=d})();(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(d){function f(g){return g.replace(/[\n\r]+/g,"")}var c=d.is,b=d.isIE,e=d.each,a=d.dom.TreeWalker;d.create("tinymce.dom.Selection",{Selection:function(k,j,i,h){var g=this;g.dom=k;g.win=j;g.serializer=i;g.editor=h;e(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(l){g[l]=new d.util.Dispatcher(g)});if(!g.win.getSelection){g.tridentSel=new d.dom.TridentSelection(g)}if(d.isIE&&!d.isIE11&&k.boxModel){this._fixIESelection()}d.addUnload(g.destroy,g)},setCursorLocation:function(i,j){var g=this;var h=g.dom.createRng();h.setStart(i,j);h.setEnd(i,j);g.setRng(h);g.collapse(false)},getContent:function(h){var g=this,i=g.getRng(),m=g.dom.create("body"),k=g.getSel(),j,l,o;h=h||{};j=l="";h.get=true;h.format=h.format||"html";h.forced_root_block="";g.onBeforeGetContent.dispatch(g,h);if(h.format=="text"){return g.isCollapsed()?"":(i.text||(k.toString?k.toString():""))}if(i.cloneContents){o=i.cloneContents();if(o){m.appendChild(o)}}else{if(c(i.item)||c(i.htmlText)){m.innerHTML="<br>"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='<span id="__caret">_</span>';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('<span id="__mce_tmp">_</span>'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var i=this,h=i.getRng(),j,g,l,k;if(h.duplicate||h.item){if(h.item){return h.item(0)}l=h.duplicate();l.collapse(1);j=l.parentElement();if(j.ownerDocument!==i.dom.doc){j=i.dom.getRoot()}g=k=h.parentElement();while(k=k.parentNode){if(k==j){j=g;break}}return j}else{j=h.startContainer;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[Math.min(j.childNodes.length-1,h.startOffset)]}if(j&&j.nodeType==3){return j.parentNode}return j}},getEnd:function(){var h=this,g=h.getRng(),j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);j=g.parentElement();if(j.ownerDocument!==h.dom.doc){j=h.dom.getRoot()}if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=g.endContainer;i=g.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[i>0?i-1:i]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){h=y.getRng();if(h.setStart){h={startContainer:h.startContainer,startOffset:h.startOffset,endContainer:h.endContainer,endOffset:h.endOffset}}return{rng:h}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_start" style="'+x+'">'+m+"</span>");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_end" style="'+x+'">'+m+"</span>")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(q){var v=this,n=v.dom,l,j,g,i,u,k,x,r,s;function h(C){var t=q[C?"start":"end"],z,A,B,y;if(t){B=t[0];for(A=u,z=t.length-1;z>=1;z--){y=A.childNodes;if(t[z]>y.length-1){return}A=y[t[z]]}if(A.nodeType===3){B=Math.min(t[0],A.nodeValue.length)}if(A.nodeType===1){B=Math.min(t[0],A.childNodes.length)}if(C){g.setStart(A,B)}else{g.setEnd(A,B)}}return true}function m(D){var y=n.get(q.id+"_"+D),C,t,A,B,z=q.keep;if(y){C=y.parentNode;if(D=="start"){if(!z){t=n.nodeIndex(y)}else{C=y.firstChild;t=1}k=x=C;r=s=t}else{if(!z){t=n.nodeIndex(y)}else{C=y.firstChild;t=1}x=C;s=t}if(!z){B=y.previousSibling;A=y.nextSibling;e(d.grep(y.childNodes),function(E){if(E.nodeType==3){E.nodeValue=E.nodeValue.replace(/\uFEFF/g,"")}});while(y=n.get(q.id+"_"+D)){n.remove(y,1)}if(B&&A&&B.nodeType==A.nodeType&&B.nodeType==3&&!d.isOpera){t=B.nodeValue.length;B.appendData(A.nodeValue);n.remove(A);if(D=="start"){k=x=B;r=s=t}else{x=B;s=t}}}}}function o(t){if(n.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='<br data-mce-bogus="1" />'}return t}if(q){if(q.start){g=n.createRng();u=n.getRoot();if(v.tridentSel){return v.tridentSel.moveToBookmark(q)}if(h(true)&&h()){v.setRng(g)}}else{if(q.id){m("start");m("end");if(k){g=n.createRng();g.setStart(o(k),r);g.setEnd(o(x),s);v.setRng(g)}}else{if(q.name){v.select(n.select(q.name)[q.index])}else{if(q.rng){g=q.rng;if(g.startContainer){i=v.dom.createRng();try{i.setStart(g.startContainer,g.startOffset);i.setEnd(g.endContainer,g.endOffset)}catch(p){}g=i}v.setRng(g)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&!d.isIE11&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},selectorChanged:function(g,j){var h=this,i;if(!h.selectorChangedData){h.selectorChangedData={};i={};h.editor.onNodeChange.addToTop(function(l,k,o){var p=h.dom,m=p.getParents(o,null,p.getRoot()),n={};e(h.selectorChangedData,function(r,q){e(m,function(s){if(p.is(s,q)){if(!i[q]){e(r,function(t){t(true,{node:s,selector:q,parents:m})});i[q]=r}n[q]=r;return false}})});e(i,function(r,q){if(!n[q]){delete i[q];e(r,function(s){s(false,{node:o,selector:q,parents:m})})}})})}if(!h.selectorChangedData[g]){h.selectorChangedData[g]=[]}h.selectorChangedData[g].push(j);return h},scrollIntoView:function(k){var j,h,g=this,i=g.dom;h=i.getViewPort(g.editor.getWin());j=i.getPos(k).y;if(j<h.y||j+25>h.y+h.h){g.editor.getWin().scrollTo(0,j<h.y?j:j-h.h+25)}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("noscript",function(j){var k=j.length,l;while(k--){l=j[k].firstChild;if(l){l.value=a.html.Entities.decode(l.value)}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE||a.isIE11){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&d<h.nodeValue.length){i=f(h,d);h=i.previousSibling;if(g>d){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d<h.nodeValue.length){h=f(h,d);d=0}if(i.nodeType==3&&g>0&&g<i.nodeValue.length){i=f(i,g).previousSibling;g=i.nodeValue.length}}return{startContainer:h,startOffset:d,endContainer:i,endOffset:g}}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var q=this,n=e.root,m=e.items,o=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,l=e.excludeFromTabOrder,k,h,p,d,g;f=f||b.DOM;k=function(r){g=r.target.id};h=function(r){f.setAttrib(r.target.id,"tabindex","-1")};d=function(r){var s=f.get(g);f.setAttrib(s,"tabindex","0");s.focus()};q.focus=function(){f.get(g).focus()};q.destroy=function(){c(m,function(s){var t=f.get(s.id);f.unbind(t,"focus",k);f.unbind(t,"blur",h)});var r=f.get(n);f.unbind(r,"focus",d);f.unbind(r,"keydown",p);m=f=n=q.focus=k=h=p=d=null;q.destroy=function(){}};q.moveFocus=function(v,s){var r=-1,u=q.controls,t;if(!g){return}c(m,function(y,x){if(y.id===g){r=x;return false}});r+=v;if(r<0){r=m.length-1}else{if(r>=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}a.cancel(z);break;case u:if(i){q.moveFocus(1)}a.cancel(z);break;case y:if(o){q.moveFocus(-1)}a.cancel(z);break;case A:if(o){q.moveFocus(1)}a.cancel(z);break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+='<span class="mceIcon '+e["class"]+'"><img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" /></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keydown",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){b.dom.Event.cancel(f);return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='<span role="listbox" aria-haspopup="true" aria-labelledby="'+g.id+'_voiceDesc" aria-describedby="'+g.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+g.id+'" cellpadding="0" cellspacing="0" class="'+k+" "+k+"Enabled"+(i["class"]?(" "+i["class"]):"")+'"><tbody><tr>';j+="<td>"+d.createHTML("span",{id:g.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},g.settings.title);j+=d.createHTML("a",{id:g.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},d.encode(g.settings.title))+"</td>";j+="<td>"+d.createHTML("a",{id:g.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";j+="</tr></tbody></table></span>";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(q){var n,p=37,m=39,l=38,r=40,k=13,o=32;b.remove(h.id,"change",i);j=false;n=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",n)});if(q.keyCode==k||q.keyCode==o){g(q);return b.cancel(q)}else{if(q.keyCode==r||q.keyCode==l){q.stopImmediatePropagation()}}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.keyboardNav=new d.ui.KeyboardNavigation({root:f.id+"_menu",items:c.select("a",f.id+"_menu"),onCancel:function(){f.hideMenu();f.focus()}});f.keyboardNav.focus();f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch();f.keyboardNav.destroy()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){var f=this;f.parent();a.clear(f.id+"_menu");a.clear(f.id+"_more");c.remove(f.id+"_menu");if(f.keyboardNav){f.keyboardNav.destroy()}}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}if(!this.editors.hasOwnProperty(l)){return a}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE&&!j.isIE11){l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(k){var l=k.DOM,j=k.dom.Event,f=k.extend,i=k.each,a=k.isGecko,b=k.isIE,e=k.isWebKit,d=k.is,h=k.ThemeManager,c=k.PluginManager,g=k.explode;k.create("tinymce.Editor",{Editor:function(p,o){var m=this,n=true;m.settings=o=f({id:p,language:"en",theme:"advanced",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:k.documentBaseURL,add_form_submit_trigger:n,submit_patch:n,add_unload_trigger:n,convert_urls:n,relative_urls:n,remove_script_host:n,table_inline_editing:false,object_resizing:n,accessibility_focus:n,doctype:k.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.contentStyles=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(!q.content_editable){p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden"}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.language+".js")}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,G=this,H=G.settings,D,y,z,C=G.getElement(),p,m,E,v,B,F,x,r=[];k.add(G);H.aria_label=H.aria_label||l.getAttrib(C,"aria-label",G.getLang("aria.rich_text_area"));if(H.theme){if(typeof H.theme!="function"){H.theme=H.theme.replace(/-/,"");p=h.get(H.theme);G.theme=new p();if(G.theme.init){G.theme.init(G,h.urls[H.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{G.theme=H.theme}}function A(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){A(u)});n=new t(G,o);G.plugins[s]=n;if(n.init){n.init(G,o);r.push(s)}}}i(g(H.plugins.replace(/\-/g,"")),A);if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new k.ControlManager(G);G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui&&G.theme){G.orgDisplay=C.style.display;if(typeof H.theme!="function"){D=H.width||C.style.width||C.offsetWidth;y=H.height||C.style.height||C.offsetHeight;z=H.min_height||100;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D,10)+(p.deltaWidth||0),100)}if(F.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),z)}p=G.theme.renderUI({targetNode:C,width:D,height:y,deltaWidth:H.delta_width,deltaHeight:H.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:D,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<z){y=z}}else{p=H.theme(G,C);if(p.editorContainer.nodeType){p.editorContainer=p.editorContainer.id=p.editorContainer.id||G.id+"_parent"}if(p.iframeContainer.nodeType){p.iframeContainer=p.iframeContainer.id=p.iframeContainer.id||G.id+"_iframecontainer"}y=p.iframeHeight||C.offsetHeight;if(b){G.onInit.add(function(n){n.dom.bind(n.getBody(),"beforedeactivate keydown keyup",function(){n.bookmark=n.selection.getBookmark(1)})});G.onNodeChange.add(function(n){if(document.activeElement.id==n.id+"_ifr"){n.bookmark=n.selection.getBookmark(1)}})}}G.editorContainer=p.editorContainer}if(H.content_css){i(g(H.content_css),function(n){G.contentCSS.push(G.documentBaseURI.toAbsolute(n))})}if(H.content_style){G.contentStyles.push(H.content_style)}if(H.content_editable){C=q=p=null;return G.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}G.iframeHTML=H.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(H.document_base_url!=k.documentBaseURL){G.iframeHTML+='<base href="'+G.documentBaseURI.getURI()+'" />'}if(k.isIE8){if(H.ie7_compat){G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}}G.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(x=0;x<G.contentCSS.length;x++){G.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+G.contentCSS[x]+'" />'}G.contentCSS=[];v=H.body_id||"tinymce";if(v.indexOf("=")!=-1){v=G.getParam("body_id","","hash");v=v[G.id]||v}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='</head><body id="'+v+'" class="mceContentBody '+B+'" onload="window.parent.tinyMCE.get(\''+G.id+"').onLoad.dispatch();\"><br></body></html>";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",allowTransparency:"true",title:H.aria_label,style:{width:"100%",height:y,display:"block"}});G.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=G.orgDisplay}C.style.visibility=G.orgVisibility;l.get(G.id).style.display="none";l.setAttrib(G.id,"aria-hidden",true);if(!k.relaxedDomain||!E){G.initContentBody()}C=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m,s;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(t,u){var v=t.length,y,A=n.dom,z,x;while(v--){y=t[v];z=y.attr(u);x="data-mce-"+u;if(!y.attributes.map[x]){if(u==="style"){y.attr(x,A.serializeStyle(A.parseStyle(z),y.name))}else{y.attr(x,n.convertURL(z,u,y.name))}}}});n.parser.addNodeFilter("script",function(t,u){var v=t.length,x;while(v--){x=t[v];x.attr("type","mce-"+(x.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(t,u){var v=t.length,x;while(v--){x=t[v];x.type=8;x.name="#comment";x.value="[CDATA["+x.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(u,v){var x=u.length,y,t=n.schema.getNonEmptyElements();while(x--){y=u[x];if(y.isEmpty(t)){y.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer,n);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.onExecCommand.add(function(t,u){if(!/^(FontName|FontSize)$/.test(u)){n.nodeChanged()}});n.serializer.onPreProcess.add(function(t,u){return n.onPreProcess.dispatch(n,u,t)});n.serializer.onPostProcess.add(function(t,u){return n.onPostProcess.dispatch(n,u,t)});n.onPreInit.dispatch(n);if(!p.browser_spellcheck&&!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(t,u){i(p.protect,function(v){u.content=u.content.replace(v,function(x){return"<!--mce:protected "+escape(x)+"-->"})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(t,u){u.content=u.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});if(n.contentStyles.length>0){s="";i(n.contentStyles,function(t){s+=t+"\r\n"});n.dom.addStyle(s)}i(n.contentCSS,function(t){n.dom.loadCSS(t)});if(p.auto_focus){setTimeout(function(){var t=k.get(p.auto_focus);t.selection.select(t.getBody(),1);t.selection.collapse(1);t.getBody().focus();t.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){if(u.bookmark){t.moveToBookmark(u.bookmark);u.bookmark=null}n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive&&!k.isIE11){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'><br data-mce-bogus="1"></'+q+">"}else{r='<br data-mce-bogus="1">'}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}if(!o.settings.content_editable||document.activeElement===o.getBody()){o.selection.normalize()}return p.content},getContent:function(o){var n=this,p,m=n.getBody();o=o||{};o.format=o.format||"html";o.get=true;o.getInner=true;if(!o.no_events){n.onBeforeGetContent.dispatch(n,o)}if(o.format=="raw"){p=m.innerHTML}else{if(o.format=="text"){p=m.innerText||m.textContent}else{p=n.serializer.serialize(m,o)}}if(o.format!="text"){o.content=k.trim(p)}else{o.content=p}if(!o.no_events){n.onGetContent.dispatch(n,o)}return o.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!p.getAttrib(s,"href",false)){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,o=m.getContainer(),n=m.getDoc();if(!m.removed){m.removed=1;if(b&&n){n.execCommand("SelectAll")}m.save();l.setStyle(m.id,"display",m.orgDisplay);if(!m.settings.content_editable){j.unbind(m.getWin());j.unbind(m.getDoc())}j.unbind(m.getBody());j.clear(o);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(o)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){g.preventDefault();g.stopPropagation()}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(i,m){if(m.keyCode!=65||!a.VK.metaKeyPressed(m)){l.selection.normalize()}l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k(i,n)}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=p.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.y<L.y)||(C.x>L.x+L.w||C.x<L.x)){H=d.isIE?n.getDoc().documentElement:n.getBody();H.scrollLeft=C.x;H.scrollTop=C.y-L.h+25}x=m.createRng();A=D.previousSibling;if(A&&A.nodeType==3){x.setStart(A,A.nodeValue.length)}else{x.setStartBefore(D);x.setEndBefore(D)}m.remove(D);p.setRng(x);p.onSetContent.dispatch(p,G);n.addVisual()},mceInsertRawHTML:function(y,x,v){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceToggleFormat:function(y,x,v){s(v)},mceSetContent:function(y,x,v){n.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=k.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!l("InsertUnorderedList")&&!l("InsertOrderedList")){if(!k.forced_root_block&&!m.getParent(p.getNode(),m.isBlock)){q.apply("div")}e(p.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(d.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){q.toggle(v)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();if(p.getRng().setStart){v.setStart(x,0);v.setEnd(x,x.childNodes.length);p.setRng(v)}else{f("SelectAll")}}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(x){var v=m.getParent(p.getNode(),"ul,ol");return v&&(x==="insertunorderedlist"&&v.tagName==="UL"||x==="insertorderedlist"&&v.tagName==="OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getBody(),"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m<e.length-1;m++){e[m]=e[m+1]}e.length--;i=e.length}}p.bookmark=h.selection.getBookmark(2,true);if(i<e.length-1){e.length=i+1}e.push(p);i=e.length-1;l.onAdd.dispatch(l,p);h.isNotDirty=0;return p},undo:function(){var n,m;if(l.typing){l.add();l.typing=false}if(i>0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i<e.length-1){m=e[++i];h.setContent(m.content,{format:"raw"});h.selection.moveToBookmark(m.bookmark);l.onRedo.dispatch(l,m)}return m},clear:function(){e=[];i=0;l.typing=false},hasUndo:function(){return i>0||this.typing},hasRedo:function(){return i<e.length-1&&!this.typing}};return l}})(tinymce);tinymce.ForceBlocks=function(c){var b=c.settings,e=c.dom,a=c.selection,d=c.schema.getBlockElements();function f(){var j=a.getStart(),h=c.getBody(),g,k,o,s,q,i,l,m=-16777215,p,r;if(!j||j.nodeType!==1||!b.forced_root_block){return}while(j&&j!=h){if(d[j.nodeName]){return}j=j.parentNode}g=a.getRng();if(g.setStart){k=g.startContainer;o=g.startOffset;s=g.endContainer;q=g.endOffset}else{if(g.item){j=g.item(0);g=c.getDoc().body.createTextRange();g.moveToElementText(j)}r=g.parentElement().ownerDocument===c.getDoc();tmpRng=g.duplicate();tmpRng.collapse(true);o=tmpRng.move("character",m)*-1;if(!tmpRng.collapsed){tmpRng=g.duplicate();tmpRng.collapse(false);q=(tmpRng.move("character",m)*-1)-o}}j=h.firstChild;while(j){if(j.nodeType===3||(j.nodeType==1&&!d[j.nodeName])){if(j.nodeType===3&&j.nodeValue.length==0){l=j;j=j.nextSibling;e.remove(l);continue}if(!i){i=e.create(b.forced_root_block);j.parentNode.insertBefore(i,j);p=true}l=j;j=j.nextSibling;i.appendChild(l)}else{i=null;j=j.nextSibling}}if(p){if(g.setStart){g.setStart(k,o);g.setEnd(s,q);a.setRng(g)}else{if(r){try{g=c.getDoc().body.createTextRange();g.moveToElementText(h);g.collapse(true);g.moveStart("character",o);if(q>0){g.moveEnd("character",q)}g.select()}catch(n){}}}c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k<g;k++){o=n[k].createControl(j,h);if(o){return h.add(o)}}if(j==="|"||j==="separator"){return h.createSeparator()}if(m.buttons&&(o=m.buttons[j])){return h.createButton(j,o)}return h.add(o)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(aa){var Q={},T=a.each,c=aa.dom,r=aa.selection,t=a.dom.TreeWalker,N=new a.dom.RangeUtils(c),d=aa.schema.isValidChild,A=a.isArray,H=c.isBlock,m=aa.settings.forced_root_block,s=c.nodeIndex,G="\uFEFF",e=/^(src|href|style)$/,X=false,C=true,P,D,x=c.getContentEditable;function I(ab){if(ab.nodeType){ab=ab.nodeName}return !!aa.schema.getTextBlockElements()[ab.toLowerCase()]}function n(ac,ab){return c.getParents(ac,ab,c.getRoot())}function b(ab){return ab.nodeType===1&&ab.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(ab){return true},onformat:function(ad,ab,ac){T(ac,function(af,ae){c.setAttrib(ad,ae,af)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});T("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(ab){l(ab,{block:ab,remove:"all"})});l(aa.settings.formats)}function W(){aa.addShortcut("ctrl+b","bold_desc","Bold");aa.addShortcut("ctrl+i","italic_desc","Italic");aa.addShortcut("ctrl+u","underline_desc","Underline");for(var ab=1;ab<=6;ab++){aa.addShortcut("ctrl+"+ab,"",["FormatBlock",false,"h"+ab])}aa.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);aa.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);aa.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function V(ab){return ab?Q[ab]:Q}function l(ab,ac){if(ab){if(typeof(ab)!=="string"){T(ab,function(ae,ad){l(ad,ae)})}else{ac=ac.length?ac:[ac];T(ac,function(ad){if(ad.deep===D){ad.deep=!ad.selector}if(ad.split===D){ad.split=!ad.selector||ad.inline}if(ad.remove===D&&ad.selector&&!ad.inline){ad.remove="none"}if(ad.selector&&ad.inline){ad.mixed=true;ad.block_expand=true}if(typeof(ad.classes)==="string"){ad.classes=ad.classes.split(/\s+/)}});Q[ab]=ac}}}var i=function(ac){var ab;aa.dom.getParent(ac,function(ad){ab=aa.dom.getStyle(ad,"text-decoration");return ab&&ab!=="none"});return ab};var L=function(ab){var ac;if(ab.nodeType===1&&ab.parentNode&&ab.parentNode.nodeType===1){ac=i(ab.parentNode);if(aa.dom.getStyle(ab,"color")&&ac){aa.dom.setStyle(ab,"text-decoration",ac)}else{if(aa.dom.getStyle(ab,"textdecoration")===ac){aa.dom.setStyle(ab,"text-decoration",null)}}}};function Y(ae,al,ag){var ah=V(ae),am=ah[0],ak,ac,aj,ai=r.isCollapsed();function ab(aq,ap){ap=ap||am;if(aq){if(ap.onformat){ap.onformat(aq,ap,al,ag)}T(ap.styles,function(at,ar){c.setStyle(aq,ar,q(at,al))});T(ap.attributes,function(at,ar){c.setAttrib(aq,ar,q(at,al))});T(ap.classes,function(ar){ar=q(ar,al);if(!c.hasClass(aq,ar)){c.addClass(aq,ar)}})}}function af(){function ar(ay,aw){var ax=new t(aw);for(ag=ax.current();ag;ag=ax.prev()){if(ag.childNodes.length>1||ag==ay||ag.tagName=="BR"){return ag}}}var aq=aa.selection.getRng();var av=aq.startContainer;var ap=aq.endContainer;if(av!=ap&&aq.endOffset===0){var au=ar(av,ap);var at=au.nodeType==3?au.length:au.childNodes.length;aq.setEnd(au,at)}return aq}function ad(at,ay,aw,av,aq){var ap=[],ar=-1,ax,aA=-1,au=-1,az;T(at.childNodes,function(aC,aB){if(aC.nodeName==="UL"||aC.nodeName==="OL"){ar=aB;ax=aC;return false}});T(at.childNodes,function(aC,aB){if(aC.nodeName==="SPAN"&&c.getAttrib(aC,"data-mce-type")=="bookmark"){if(aC.id==ay.id+"_start"){aA=aB}else{if(aC.id==ay.id+"_end"){au=aB}}}});if(ar<=0||(aA<ar&&au>ar)){T(a.grep(at.childNodes),aq);return 0}else{az=c.clone(aw,X);T(a.grep(at.childNodes),function(aC,aB){if((aA<ar&&aB<ar)||(aA>ar&&aB>ar)){ap.push(aC);aC.parentNode.removeChild(aC)}});if(aA<ar){at.insertBefore(az,ax)}else{if(aA>ar){at.insertBefore(az,ax.nextSibling)}}av.push(az);T(ap,function(aB){az.appendChild(aB)});return az}}function an(aq,at,aw){var ap=[],av,ar,au=true;av=am.inline||am.block;ar=c.create(av);ab(ar);N.walk(aq,function(ax){var ay;function az(aA){var aF,aD,aB,aC,aE;aE=au;aF=aA.nodeName.toLowerCase();aD=aA.parentNode.nodeName.toLowerCase();if(aA.nodeType===1&&x(aA)){aE=au;au=x(aA)==="true";aC=true}if(g(aF,"br")){ay=0;if(am.block){c.remove(aA)}return}if(am.wrapper&&y(aA,ae,al)){ay=0;return}if(au&&!aC&&am.block&&!am.wrapper&&I(aF)){aA=c.rename(aA,av);ab(aA);ap.push(aA);ay=0;return}if(am.selector){T(ah,function(aG){if("collapsed" in aG&&aG.collapsed!==ai){return}if(c.is(aA,aG.selector)&&!b(aA)){ab(aA,aG);aB=true}});if(!am.inline||aB){ay=0;return}}if(au&&!aC&&d(av,aF)&&d(aD,av)&&!(!aw&&aA.nodeType===3&&aA.nodeValue.length===1&&aA.nodeValue.charCodeAt(0)===65279)&&!b(aA)&&(!am.inline||!H(aA))){if(!ay){ay=c.clone(ar,X);aA.parentNode.insertBefore(ay,aA);ap.push(ay)}ay.appendChild(aA)}else{if(aF=="li"&&at){ay=ad(aA,at,ar,ap,az)}else{ay=0;T(a.grep(aA.childNodes),az);if(aC){au=aE}ay=0}}}T(ax,az)});if(am.wrap_links===false){T(ap,function(ax){function ay(aC){var aB,aA,az;if(aC.nodeName==="A"){aA=c.clone(ar,X);ap.push(aA);az=a.grep(aC.childNodes);for(aB=0;aB<az.length;aB++){aA.appendChild(az[aB])}aC.appendChild(aA)}T(a.grep(aC.childNodes),ay)}ay(ax)})}T(ap,function(az){var ax;function aA(aC){var aB=0;T(aC.childNodes,function(aD){if(!f(aD)&&!K(aD)){aB++}});return aB}function ay(aB){var aD,aC;T(aB.childNodes,function(aE){if(aE.nodeType==1&&!K(aE)&&!b(aE)){aD=aE;return X}});if(aD&&h(aD,am)){aC=c.clone(aD,X);ab(aC);c.replace(aC,aB,C);c.remove(aD,1)}return aC||aB}ax=aA(az);if((ap.length>1||!H(az))&&ax===0){c.remove(az,1);return}if(am.inline||am.wrapper){if(!am.exact&&ax===1){az=ay(az)}T(ah,function(aB){T(c.select(aB.inline,az),function(aD){var aC;if(aB.wrap_links===false){aC=aD.parentNode;do{if(aC.nodeName==="A"){return}}while(aC=aC.parentNode)}Z(aB,al,aD,aB.exact?aD:null)})});if(y(az.parentNode,ae,al)){c.remove(az,1);az=0;return C}if(am.merge_with_parents){c.getParent(az.parentNode,function(aB){if(y(aB,ae,al)){c.remove(az,1);az=0;return C}})}if(az&&am.merge_siblings!==false){az=u(E(az),az);az=u(az,E(az,C))}}})}if(am){if(ag){if(ag.nodeType){ac=c.createRng();ac.setStartBefore(ag);ac.setEndAfter(ag);an(p(ac,ah),null,true)}else{an(ag,null,true)}}else{if(!ai||!am.inline||c.select("td.mceSelected,th.mceSelected").length){var ao=aa.selection.getNode();if(!m&&ah[0].defaultBlock&&!c.getParent(ao,c.isBlock)){Y(ah[0].defaultBlock)}aa.selection.setRng(af());ak=r.getBookmark();an(p(r.getRng(C),ah),ak);if(am.styles&&(am.styles.color||am.styles.textDecoration)){a.walk(ao,L,"childNodes");L(ao)}r.moveToBookmark(ak);R(r.getRng(C));aa.nodeChanged()}else{U("apply",ae,al)}}}}function B(ad,am,af){var ag=V(ad),ao=ag[0],ak,aj,ac,al=true;function ae(av){var au,at,ar,aq,ax,aw;if(av.nodeType===3){return}if(av.nodeType===1&&x(av)){ax=al;al=x(av)==="true";aw=true}au=a.grep(av.childNodes);if(al&&!aw){for(at=0,ar=ag.length;at<ar;at++){if(Z(ag[at],am,av,av)){break}}}if(ao.deep){if(au.length){for(at=0,ar=au.length;at<ar;at++){ae(au[at])}if(aw){al=ax}}}}function ah(aq){var ar;T(n(aq.parentNode).reverse(),function(at){var au;if(!ar&&at.id!="_start"&&at.id!="_end"){au=y(at,ad,am);if(au&&au.split!==false){ar=at}}});return ar}function ab(au,aq,aw,az){var aA,ay,ax,at,av,ar;if(au){ar=au.parentNode;for(aA=aq.parentNode;aA&&aA!=ar;aA=aA.parentNode){ay=c.clone(aA,X);for(av=0;av<ag.length;av++){if(Z(ag[av],am,ay,ay)){ay=0;break}}if(ay){if(ax){ay.appendChild(ax)}if(!at){at=ay}ax=ay}}if(az&&(!ao.mixed||!H(au))){aq=c.split(au,aq)}if(ax){aw.parentNode.insertBefore(ax,aw);at.appendChild(aw)}}return aq}function an(aq){return ab(ah(aq),aq,aq,true)}function ai(at){var ar=c.get(at?"_start":"_end"),aq=ar[at?"firstChild":"lastChild"];if(K(aq)){aq=aq[at?"firstChild":"lastChild"]}c.remove(ar,true);return aq}function ap(aq){var at,au,ar;aq=p(aq,ag,C);if(ao.split){at=M(aq,C);au=M(aq);if(at!=au){if(/^(TR|TD)$/.test(at.nodeName)&&at.firstChild){at=(at.nodeName=="TD"?at.firstChild:at.firstChild.firstChild)||at}at=S(at,"span",{id:"_start","data-mce-type":"bookmark"});au=S(au,"span",{id:"_end","data-mce-type":"bookmark"});an(at);an(au);at=ai(C);au=ai()}else{at=au=an(at)}aq.startContainer=at.parentNode;aq.startOffset=s(at);aq.endContainer=au.parentNode;aq.endOffset=s(au)+1}N.walk(aq,function(av){T(av,function(aw){ae(aw);if(aw.nodeType===1&&aa.dom.getStyle(aw,"text-decoration")==="underline"&&aw.parentNode&&i(aw.parentNode)==="underline"){Z({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,aw)}})})}if(af){if(af.nodeType){ac=c.createRng();ac.setStartBefore(af);ac.setEndAfter(af);ap(ac)}else{ap(af)}return}if(!r.isCollapsed()||!ao.inline||c.select("td.mceSelected,th.mceSelected").length){ak=r.getBookmark();ap(r.getRng(C));r.moveToBookmark(ak);if(ao.inline&&k(ad,am,r.getStart())){R(r.getRng(true))}aa.nodeChanged()}else{U("remove",ad,am)}}function F(ac,ae,ad){var ab=V(ac);if(k(ac,ae,ad)&&(!("toggle" in ab[0])||ab[0].toggle)){B(ac,ae,ad)}else{Y(ac,ae,ad)}}function y(ac,ab,ah,af){var ad=V(ab),ai,ag,ae;function aj(an,ap,aq){var am,ao,ak=ap[aq],al;if(ap.onmatch){return ap.onmatch(an,ap,aq)}if(ak){if(ak.length===D){for(am in ak){if(ak.hasOwnProperty(am)){if(aq==="attributes"){ao=c.getAttrib(an,am)}else{ao=O(an,am)}if(af&&!ao&&!ap.exact){return}if((!af||ap.exact)&&!g(ao,q(ak[am],ah))){return}}}}else{for(al=0;al<ak.length;al++){if(aq==="attributes"?c.getAttrib(an,ak[al]):O(an,ak[al])){return ap}}}}return ap}if(ad&&ac){for(ag=0;ag<ad.length;ag++){ai=ad[ag];if(h(ac,ai)&&aj(ac,ai,"attributes")&&aj(ac,ai,"styles")){if(ae=ai.classes){for(ag=0;ag<ae.length;ag++){if(!c.hasClass(ac,ae[ag])){return}}}return ai}}}}function k(ad,af,ae){var ac;function ab(ag){ag=c.getParent(ag,function(ah){return !!y(ah,ad,af,true)});return y(ag,ad,af)}if(ae){return ab(ae)}ae=r.getNode();if(ab(ae)){return C}ac=r.getStart();if(ac!=ae){if(ab(ac)){return C}}return X}function v(ai,ah){var af,ag=[],ae={},ad,ac,ab;af=r.getStart();c.getParent(af,function(al){var ak,aj;for(ak=0;ak<ai.length;ak++){aj=ai[ak];if(!ae[aj]&&y(al,aj,ah)){ae[aj]=true;ag.push(aj)}}},c.getRoot());return ag}function z(af){var ah=V(af),ae,ad,ag,ac,ab;if(ah){ae=r.getStart();ad=n(ae);for(ac=ah.length-1;ac>=0;ac--){ab=ah[ac].selector;if(!ab){return C}for(ag=ad.length-1;ag>=0;ag--){if(c.is(ad[ag],ab)){return C}}}}return X}function J(ab,ae,ac){var ad;if(!P){P={};ad={};aa.onNodeChange.addToTop(function(ag,af,ai){var ah=n(ai),aj={};T(P,function(ak,al){T(ah,function(am){if(y(am,al,{},ak.similar)){if(!ad[al]){T(ak,function(an){an(true,{node:am,format:al,parents:ah})});ad[al]=ak}aj[al]=ak;return false}})});T(ad,function(ak,al){if(!aj[al]){delete ad[al];T(ak,function(am){am(false,{node:ai,format:al,parents:ah})})}})})}T(ab.split(","),function(af){if(!P[af]){P[af]=[];P[af].similar=ac}P[af].push(ae)});return this}a.extend(this,{get:V,register:l,apply:Y,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z,formatChanged:J});j();W();function h(ab,ac){if(g(ab,ac.inline)){return C}if(g(ab,ac.block)){return C}if(ac.selector){return c.is(ab,ac.selector)}}function g(ac,ab){ac=ac||"";ab=ab||"";ac=""+(ac.nodeName||ac);ab=""+(ab.nodeName||ab);return ac.toLowerCase()==ab.toLowerCase()}function O(ac,ab){var ad=c.getStyle(ac,ab);if(ab=="color"||ab=="backgroundColor"){ad=c.toHex(ad)}if(ab=="fontWeight"&&ad==700){ad="bold"}return""+ad}function q(ab,ac){if(typeof(ab)!="string"){ab=ab(ac)}else{if(ac){ab=ab.replace(/%(\w+)/g,function(ae,ad){return ac[ad]||ae})}}return ab}function f(ab){return ab&&ab.nodeType===3&&/^([\t \r\n]+|)$/.test(ab.nodeValue)}function S(ad,ac,ab){var ae=c.create(ac,ab);ad.parentNode.insertBefore(ae,ad);ae.appendChild(ad);return ae}function p(ab,am,ae){var ap,an,ah,al,ad=ab.startContainer,ai=ab.startOffset,ar=ab.endContainer,ak=ab.endOffset;function ao(aA){var au,ax,az,aw,av,at;au=ax=aA?ad:ar;av=aA?"previousSibling":"nextSibling";at=c.getRoot();function ay(aB){return aB.nodeName=="BR"&&aB.getAttribute("data-mce-bogus")&&!aB.nextSibling}if(au.nodeType==3&&!f(au)){if(aA?ai>0:ak<au.nodeValue.length){return au}}for(;;){if(!am[0].block_expand&&H(ax)){return ax}for(aw=ax[av];aw;aw=aw[av]){if(!K(aw)&&!f(aw)&&!ay(aw)){return ax}}if(ax.parentNode==at){au=ax;break}ax=ax.parentNode}return au}function ag(at,au){if(au===D){au=at.nodeType===3?at.length:at.childNodes.length}while(at&&at.hasChildNodes()){at=at.childNodes[au];if(at){au=at.nodeType===3?at.length:at.childNodes.length}}return{node:at,offset:au}}if(ad.nodeType==1&&ad.hasChildNodes()){an=ad.childNodes.length-1;ad=ad.childNodes[ai>an?an:ai];if(ad.nodeType==3){ai=0}}if(ar.nodeType==1&&ar.hasChildNodes()){an=ar.childNodes.length-1;ar=ar.childNodes[ak>an?an:ak-1];if(ar.nodeType==3){ak=ar.nodeValue.length}}function aq(au){var at=au;while(at){if(at.nodeType===1&&x(at)){return x(at)==="false"?at:au}at=at.parentNode}return au}function aj(au,ay,aA){var ax,av,az,at;function aw(aC,aE){var aF,aB,aD=aC.nodeValue;if(typeof(aE)=="undefined"){aE=aA?aD.length:0}if(aA){aF=aD.lastIndexOf(" ",aE);aB=aD.lastIndexOf("\u00a0",aE);aF=aF>aB?aF:aB;if(aF!==-1&&!ae){aF++}}else{aF=aD.indexOf(" ",aE);aB=aD.indexOf("\u00a0",aE);aF=aF!==-1&&(aB===-1||aF<aB)?aF:aB}return aF}if(au.nodeType===3){az=aw(au,ay);if(az!==-1){return{container:au,offset:az}}at=au}ax=new t(au,c.getParent(au,H)||aa.getBody());while(av=ax[aA?"prev":"next"]()){if(av.nodeType===3){at=av;az=aw(av);if(az!==-1){return{container:av,offset:az}}}else{if(H(av)){break}}}if(at){if(aA){ay=0}else{ay=at.length}return{container:at,offset:ay}}}function af(au,at){var av,aw,ay,ax;if(au.nodeType==3&&au.nodeValue.length===0&&au[at]){au=au[at]}av=n(au);for(aw=0;aw<av.length;aw++){for(ay=0;ay<am.length;ay++){ax=am[ay];if("collapsed" in ax&&ax.collapsed!==ab.collapsed){continue}if(c.is(av[aw],ax.selector)){return av[aw]}}}return au}function ac(au,at,aw){var av;if(!am[0].wrapper){av=c.getParent(au,am[0].block)}if(!av){av=c.getParent(au.nodeType==3?au.parentNode:au,I)}if(av&&am[0].wrapper){av=n(av,"ul,ol").reverse()[0]||av}if(!av){av=au;while(av[at]&&!H(av[at])){av=av[at];if(g(av,"br")){break}}}return av||au}ad=aq(ad);ar=aq(ar);if(K(ad.parentNode)||K(ad)){ad=K(ad)?ad:ad.parentNode;ad=ad.nextSibling||ad;if(ad.nodeType==3){ai=0}}if(K(ar.parentNode)||K(ar)){ar=K(ar)?ar:ar.parentNode;ar=ar.previousSibling||ar;if(ar.nodeType==3){ak=ar.length}}if(am[0].inline){if(ab.collapsed){al=aj(ad,ai,true);if(al){ad=al.container;ai=al.offset}al=aj(ar,ak);if(al){ar=al.container;ak=al.offset}}ah=ag(ar,ak);if(ah.node){while(ah.node&&ah.offset===0&&ah.node.previousSibling){ah=ag(ah.node.previousSibling)}if(ah.node&&ah.offset>0&&ah.node.nodeType===3&&ah.node.nodeValue.charAt(ah.offset-1)===" "){if(ah.offset>1){ar=ah.node;ar.splitText(ah.offset-1)}}}}if(am[0].inline||am[0].block_expand){if(!am[0].inline||(ad.nodeType!=3||ai===0)){ad=ao(true)}if(!am[0].inline||(ar.nodeType!=3||ak===ar.nodeValue.length)){ar=ao()}}if(am[0].selector&&am[0].expand!==X&&!am[0].inline){ad=af(ad,"previousSibling");ar=af(ar,"nextSibling")}if(am[0].block||am[0].selector){ad=ac(ad,"previousSibling");ar=ac(ar,"nextSibling");if(am[0].block){if(!H(ad)){ad=ao(true)}if(!H(ar)){ar=ao()}}}if(ad.nodeType==1){ai=s(ad);ad=ad.parentNode}if(ar.nodeType==1){ak=s(ar)+1;ar=ar.parentNode}return{startContainer:ad,startOffset:ai,endContainer:ar,endOffset:ak}}function Z(ah,ag,ae,ab){var ad,ac,af;if(!h(ae,ah)){return X}if(ah.remove!="all"){T(ah.styles,function(aj,ai){aj=q(aj,ag);if(typeof(ai)==="number"){ai=aj;ab=0}if(!ab||g(O(ab,ai),aj)){c.setStyle(ae,ai,"")}af=1});if(af&&c.getAttrib(ae,"style")==""){ae.removeAttribute("style");ae.removeAttribute("data-mce-style")}T(ah.attributes,function(ak,ai){var aj;ak=q(ak,ag);if(typeof(ai)==="number"){ai=ak;ab=0}if(!ab||g(c.getAttrib(ab,ai),ak)){if(ai=="class"){ak=c.getAttrib(ae,ai);if(ak){aj="";T(ak.split(/\s+/),function(al){if(/mce\w+/.test(al)){aj+=(aj?" ":"")+al}});if(aj){c.setAttrib(ae,ai,aj);return}}}if(ai=="class"){ae.removeAttribute("className")}if(e.test(ai)){ae.removeAttribute("data-mce-"+ai)}ae.removeAttribute(ai)}});T(ah.classes,function(ai){ai=q(ai,ag);if(!ab||c.hasClass(ab,ai)){c.removeClass(ae,ai)}});ac=c.getAttribs(ae);for(ad=0;ad<ac.length;ad++){if(ac[ad].nodeName.indexOf("_")!==0){return X}}}if(ah.remove!="none"){o(ae,ah);return C}}function o(ad,ae){var ab=ad.parentNode,ac;function af(ah,ag,ai){ah=E(ah,ag,ai);return !ah||(ah.nodeName=="BR"||H(ah))}if(ae.block){if(!m){if(H(ad)&&!H(ab)){if(!af(ad,X)&&!af(ad.firstChild,C,1)){ad.insertBefore(c.create("br"),ad.firstChild)}if(!af(ad,C)&&!af(ad.lastChild,X,1)){ad.appendChild(c.create("br"))}}}else{if(ab==c.getRoot()){if(!ae.list_block||!g(ad,ae.list_block)){T(a.grep(ad.childNodes),function(ag){if(d(m,ag.nodeName.toLowerCase())){if(!ac){ac=S(ag,m)}else{ac.appendChild(ag)}}else{ac=0}})}}}}if(ae.selector&&ae.inline&&!g(ae.inline,ad)){return}c.remove(ad,1)}function E(ac,ab,ad){if(ac){ab=ab?"nextSibling":"previousSibling";for(ac=ad?ac:ac[ab];ac;ac=ac[ab]){if(ac.nodeType==1||!f(ac)){return ac}}}}function K(ab){return ab&&ab.nodeType==1&&ab.getAttribute("data-mce-type")=="bookmark"}function u(af,ae){var ab,ad,ac;function ah(ak,aj){if(ak.nodeName!=aj.nodeName){return X}function ai(am){var an={};T(c.getAttribs(am),function(ao){var ap=ao.nodeName.toLowerCase();if(ap.indexOf("_")!==0&&ap!=="style"){an[ap]=c.getAttrib(am,ap)}});return an}function al(ap,ao){var an,am;for(am in ap){if(ap.hasOwnProperty(am)){an=ao[am];if(an===D){return X}if(ap[am]!=an){return X}delete ao[am]}}for(am in ao){if(ao.hasOwnProperty(am)){return X}}return C}if(!al(ai(ak),ai(aj))){return X}if(!al(c.parseStyle(c.getAttrib(ak,"style")),c.parseStyle(c.getAttrib(aj,"style")))){return X}return C}function ag(aj,ai){for(ad=aj;ad;ad=ad[ai]){if(ad.nodeType==3&&ad.nodeValue.length!==0){return aj}if(ad.nodeType==1&&!K(ad)){return ad}}return aj}if(af&&ae){af=ag(af,"previousSibling");ae=ag(ae,"nextSibling");if(ah(af,ae)){for(ad=af.nextSibling;ad&&ad!=ae;){ac=ad;ad=ad.nextSibling;af.appendChild(ac)}c.remove(ae);T(a.grep(ae.childNodes),function(ai){af.appendChild(ai)});return af}}return ae}function M(ac,ag){var ab,af,ad,ae;ab=ac[ag?"startContainer":"endContainer"];af=ac[ag?"startOffset":"endOffset"];if(ab.nodeType==1){ad=ab.childNodes.length-1;if(!ag&&af){af--}ab=ab.childNodes[af>ad?ad:af]}if(ab.nodeType===3&&ag&&af>=ab.nodeValue.length){ab=new t(ab,aa.getBody()).next()||ab}if(ab.nodeType===3&&!ag&&af===0){ab=new t(ab,aa.getBody()).prev()||ab}return ab}function U(ak,ab,ai){var al="_mce_caret",ac=aa.settings.caret_debug;function ad(ap){var ao=c.create("span",{id:al,"data-mce-bogus":true,style:ac?"color:red":""});if(ap){ao.appendChild(aa.getDoc().createTextNode(G))}return ao}function aj(ap,ao){while(ap){if((ap.nodeType===3&&ap.nodeValue!==G)||ap.childNodes.length>1){return false}if(ao&&ap.nodeType===1){ao.push(ap)}ap=ap.firstChild}return true}function ag(ao){while(ao){if(ao.id===al){return ao}ao=ao.parentNode}}function af(ao){var ap;if(ao){ap=new t(ao,ao);for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType===3){return ao}}}}function ae(aq,ap){var ar,ao;if(!aq){aq=ag(r.getStart());if(!aq){while(aq=c.get(al)){ae(aq,false)}}}else{ao=r.getRng(true);if(aj(aq)){if(ap!==false){ao.setStartBefore(aq);ao.setEndBefore(aq)}c.remove(aq)}else{ar=af(aq);if(ar.nodeValue.charAt(0)===G){ar=ar.deleteData(0,1)}c.remove(aq,1)}r.setRng(ao)}}function ah(){var aq,ao,av,au,ar,ap,at;aq=r.getRng(true);au=aq.startOffset;ap=aq.startContainer;at=ap.nodeValue;ao=ag(r.getStart());if(ao){av=af(ao)}if(at&&au>0&&au<at.length&&/\w/.test(at.charAt(au))&&/\w/.test(at.charAt(au-1))){ar=r.getBookmark();aq.collapse(true);aq=p(aq,V(ab));aq=N.split(aq);Y(ab,ai,aq);r.moveToBookmark(ar)}else{if(!ao||av.nodeValue!==G){ao=ad(true);av=ao.firstChild;aq.insertNode(ao);au=1;Y(ab,ai,ao)}else{Y(ab,ai,ao)}r.setCursorLocation(av,au)}}function am(){var ao=r.getRng(true),ap,at,aw,av,aq,az,ay=[],au,ax;ap=ao.startContainer;at=ao.startOffset;aq=ap;if(ap.nodeType==3){if(at!=ap.nodeValue.length||ap.nodeValue===G){av=true}aq=aq.parentNode}while(aq){if(y(aq,ab,ai)){az=aq;break}if(aq.nextSibling){av=true}ay.push(aq);aq=aq.parentNode}if(!az){return}if(av){aw=r.getBookmark();ao.collapse(true);ao=p(ao,V(ab),true);ao=N.split(ao);B(ab,ai,ao);r.moveToBookmark(aw)}else{ax=ad();aq=ax;for(au=ay.length-1;au>=0;au--){aq.appendChild(c.clone(ay[au],false));aq=aq.firstChild}aq.appendChild(c.doc.createTextNode(G));aq=aq.firstChild;var ar=c.getParent(az,I);if(ar&&c.isEmpty(ar)){az.parentNode.replaceChild(ax,az)}else{c.insertAfter(ax,az)}r.setCursorLocation(aq,1);if(c.isEmpty(az)){c.remove(az)}}}function an(){var ap,ao,aq;ao=ag(r.getStart());if(ao&&!c.isEmpty(ao)){a.walk(ao,function(ar){if(ar.nodeType==1&&ar.id!==al&&!c.isEmpty(ar)){c.setAttrib(ar,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){aa.onBeforeGetContent.addToTop(function(){var ao=[],ap;if(aj(ag(r.getStart()),ao)){ap=ao.length;while(ap--){c.setAttrib(ao[ap],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ao){aa[ao].addToTop(function(){ae();an()})});aa.onKeyDown.addToTop(function(ao,aq){var ap=aq.keyCode;if(ap==8||ap==37||ap==39){ae(ag(r.getStart()))}an()});r.onSetContent.add(an);self._hasCaretEvents=true}if(ak=="apply"){ah()}else{am()}}function R(ac){var ab=ac.startContainer,ai=ac.startOffset,ae,ah,ag,ad,af;if(ab.nodeType==3&&ai>=ab.nodeValue.length){ai=s(ab);ab=ab.parentNode;ae=true}if(ab.nodeType==1){ad=ab.childNodes;ab=ad[Math.min(ai,ad.length-1)];ah=new t(ab,c.getParent(ab,c.isBlock));if(ai>ad.length-1||ae){ah.next()}for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!f(ag)){af=c.create("a",null,G);ag.parentNode.insertBefore(af,ag);ac.setStart(ag,0);r.setRng(ac);c.remove(af);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(f){var i=f.dom,e=f.selection,d=f.settings,h=f.undoManager,c=f.schema.getNonEmptyElements();function g(B){var v=e.getRng(true),G,j,A,u,p,M,C,o,k,n,t,J,x,D;function E(N){return N&&i.isBlock(N)&&!/^(TD|TH|CAPTION|FORM)$/.test(N.nodeName)&&!/^(fixed|absolute)/i.test(N.style.position)&&i.getContentEditable(N)!=="true"}function F(O){var N;if(b.isIE&&!b.isIE11&&i.isBlock(O)){N=e.getRng();O.appendChild(i.create("span",null,"\u00a0"));e.select(O);O.lastChild.outerHTML="";e.setRng(N)}}function z(P){var O=P,Q=[],N;while(O=O.firstChild){if(i.isBlock(O)){return}if(O.nodeType==1&&!c[O.nodeName.toLowerCase()]){Q.push(O)}}N=Q.length;while(N--){O=Q[N];if(!O.hasChildNodes()||(O.firstChild==O.lastChild&&O.firstChild.nodeValue==="")){i.remove(O)}else{if(O.nodeName=="A"&&(O.innerText||O.textContent)===" "){i.remove(O)}}}}function m(O){var T,R,N,U,S,Q=O,P;N=i.createRng();if(O.hasChildNodes()){T=new a(O,O);while(R=T.current()){if(R.nodeType==3){N.setStart(R,0);N.setEnd(R,0);break}if(c[R.nodeName.toLowerCase()]){N.setStartBefore(R);N.setEndBefore(R);break}Q=R;R=T.next()}if(!R){N.setStart(Q,0);N.setEnd(Q,0)}}else{if(O.nodeName=="BR"){if(O.nextSibling&&i.isBlock(O.nextSibling)){if(!M||M<9){P=i.create("br");O.parentNode.insertBefore(P,O)}N.setStartBefore(O);N.setEndBefore(O)}else{N.setStartAfter(O);N.setEndAfter(O)}}else{N.setStart(O,0);N.setEnd(O,0)}}e.setRng(N);i.remove(P);S=i.getViewPort(f.getWin());U=i.getPos(O).y;if(U<S.y||U+25>S.y+S.h){f.getWin().scrollTo(0,U<S.y?U:U-S.h+25)}}function r(O){var P=A,R,Q,N;R=O||t=="TABLE"?i.create(O||x):p.cloneNode(false);N=R;if(d.keep_styles!==false){do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(P.nodeName)){if(P.id=="_mce_caret"){continue}Q=P.cloneNode(false);i.setAttrib(Q,"id","");if(R.hasChildNodes()){Q.appendChild(R.firstChild);R.appendChild(Q)}else{N=Q;R.appendChild(Q)}}}while(P=P.parentNode)}if(!b.isIE||b.isIE11){N.innerHTML='<br data-mce-bogus="1">'}return R}function q(Q){var P,O,N;if(A.nodeType==3&&(Q?u>0:u<A.nodeValue.length)){return false}if(A.parentNode==p&&D&&!Q){return true}if(Q&&A.nodeType==1&&A==p.firstChild){return true}if(A.nodeName==="TABLE"||(A.previousSibling&&A.previousSibling.nodeName=="TABLE")){return(D&&!Q)||(!D&&Q)}P=new a(A,p);if(A.nodeType==3){if(Q&&u==0){P.prev()}else{if(!Q&&u==A.nodeValue.length){P.next()}}}while(O=P.current()){if(O.nodeType===1){if(!O.getAttribute("data-mce-bogus")){N=O.nodeName.toLowerCase();if(c[N]&&N!=="br"){return false}}}else{if(O.nodeType===3&&!/^[ \t\r\n]*$/.test(O.nodeValue)){return false}}if(Q){P.prev()}else{P.next()}}return true}function l(N,T){var U,S,P,R,Q,O=x||"P";S=i.getParent(N,i.isBlock);if(!S||!E(S)){S=S||j;if(!S.hasChildNodes()){U=i.create(O);S.appendChild(U);v.setStart(U,0);v.setEnd(U,0);return U}R=N;while(R.parentNode!=S){R=R.parentNode}while(R&&!i.isBlock(R)){P=R;R=R.previousSibling}if(P){U=i.create(O);P.parentNode.insertBefore(U,P);R=P;while(R&&!i.isBlock(R)){Q=R.nextSibling;U.appendChild(R);R=Q}v.setStart(N,T);v.setEnd(N,T)}}return N}function H(){function N(P){var O=n[P?"firstChild":"lastChild"];while(O){if(O.nodeType==1){break}O=O[P?"nextSibling":"previousSibling"]}return O===p}o=x?r(x):i.create("BR");if(N(true)&&N()){i.replace(o,n)}else{if(N(true)){n.parentNode.insertBefore(o,n)}else{if(N()){i.insertAfter(o,n);F(o)}else{G=v.cloneRange();G.setStartAfter(p);G.setEndAfter(n);k=G.extractContents();i.insertAfter(k,n);i.insertAfter(o,n)}}}i.remove(p);m(o);h.add()}function y(){var O=new a(A,p),N;while(N=O.next()){if(c[N.nodeName.toLowerCase()]||N.length>0){return true}}}function L(){var P,O,N;if(A&&A.nodeType==3&&u>=A.nodeValue.length){if((!b.isIE||b.isIE11)&&!y()){P=i.create("br");v.insertNode(P);v.setStartAfter(P);v.setEndAfter(P);O=true}}P=i.create("br");v.insertNode(P);if((b.isIE&&!b.isIE11)&&t=="PRE"&&(!M||M<8)){P.parentNode.insertBefore(i.doc.createTextNode("\r"),P)}N=i.create("span",{},"&nbsp;");P.parentNode.insertBefore(N,P);e.scrollIntoView(N);i.remove(N);if(!O){v.setStartAfter(P);v.setEndAfter(P)}else{v.setStartBefore(P);v.setEndBefore(P)}e.setRng(v);h.add()}function s(N){do{if(N.nodeType===3){N.nodeValue=N.nodeValue.replace(/^[\r\n]+/,"")}N=N.firstChild}while(N)}function K(P){var N=i.getRoot(),O,Q;O=P;while(O!==N&&i.getContentEditable(O)!=="false"){if(i.getContentEditable(O)==="true"){Q=O}O=O.parentNode}return O!==N?Q:N}function I(O){var N;if(!b.isIE||b.isIE11){O.normalize();N=O.lastChild;if(!N||(/^(left|right)$/gi.test(i.getStyle(N,"float",true)))){i.add(O,"br")}}}if(!v.collapsed){f.execCommand("Delete");return}if(B.isDefaultPrevented()){return}A=v.startContainer;u=v.startOffset;x=(d.force_p_newlines?"p":"")||d.forced_root_block;x=x?x.toUpperCase():"";M=i.doc.documentMode;C=B.shiftKey;if(A.nodeType==1&&A.hasChildNodes()){D=u>A.childNodes.length-1;A=A.childNodes[Math.min(u,A.childNodes.length-1)]||A;if(D&&A.nodeType==3){u=A.nodeValue.length}else{u=0}}j=K(A);if(!j){return}h.beforeChange();if(!i.isBlock(j)&&j!=i.getRoot()){if(!x||C){L()}return}if((x&&!C)||(!x&&C)){A=l(A,u)}p=i.getParent(A,i.isBlock);n=p?i.getParent(p.parentNode,i.isBlock):null;t=p?p.nodeName.toUpperCase():"";J=n?n.nodeName.toUpperCase():"";if(J=="LI"&&!B.ctrlKey){p=n;t=J}if(t=="LI"){if(!x&&C){L();return}if(i.isEmpty(p)){if(/^(UL|OL|LI)$/.test(n.parentNode.nodeName)){return false}H();return}}if(t=="PRE"&&d.br_in_pre!==false){if(!C){L();return}}else{if((!x&&!C&&t!="LI")||(x&&C)){L();return}}x=x||"P";if(q()){if(/^(H[1-6]|PRE)$/.test(t)&&J!="HGROUP"){o=r(x)}else{o=r()}if(d.end_container_on_empty_block&&E(n)&&i.isEmpty(p)){o=i.split(n,p)}else{i.insertAfter(o,p)}m(o)}else{if(q(true)){o=p.parentNode.insertBefore(r(),p);F(o)}else{G=v.cloneRange();G.setEndAfter(p);k=G.extractContents();s(k);o=k.firstChild;i.insertAfter(k,p);z(o);I(p);m(o)}}i.setAttrib(o,"id","");h.add()}f.onKeyDown.add(function(k,j){if(j.keyCode==13){if(g(j)!==false){j.preventDefault()}}})}})(tinymce); \ No newline at end of file
diff --git a/program/js/tiny_mce/tiny_mce_popup.js b/program/js/tiny_mce/tiny_mce_popup.js
index bb8e58c88..0808f8f9b 100644
--- a/program/js/tiny_mce/tiny_mce_popup.js
+++ b/program/js/tiny_mce/tiny_mce_popup.js
@@ -2,4 +2,4 @@
// Uncomment and change this document.domain value if you are loading the script cross subdomains
// document.domain = 'moxiecode.com';
-var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init(); \ No newline at end of file
+var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(a){var a=(a&&a.target)||window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE&&!tinymce.isIE11){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}else{if(tinymce.isIE11){document.addEventListener("mouseup",tinyMCEPopup._restoreSelection,false)}}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init(); \ No newline at end of file
diff --git a/program/js/tiny_mce/tiny_mce_src.js b/program/js/tiny_mce/tiny_mce_src.js
index e38fb7efb..86b162b75 100644
--- a/program/js/tiny_mce/tiny_mce_src.js
+++ b/program/js/tiny_mce/tiny_mce_src.js
@@ -6,18 +6,20 @@
var tinymce = {
majorVersion : '3',
- minorVersion : '5.6',
+ minorVersion : '5.10',
- releaseDate : '2012-07-26',
+ releaseDate : '2013-10-24',
_init : function() {
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
+ t.isIE11 = ua.indexOf('Trident/') != -1 && (ua.indexOf('rv:') != -1 || na.appName.indexOf('Netscape') != -1);
+
t.isOpera = win.opera && opera.buildNumber;
t.isWebKit = /WebKit/.test(ua);
- t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);
+ t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName) || t.isIE11;
t.isIE6 = t.isIE && /MSIE [56]/.test(ua);
@@ -27,7 +29,7 @@
t.isIE9 = t.isIE && /MSIE [9]/.test(ua);
- t.isGecko = !t.isWebKit && /Gecko/.test(ua);
+ t.isGecko = !t.isWebKit && !t.isIE11 && /Gecko/.test(ua);
t.isMac = ua.indexOf('Mac') != -1;
@@ -107,12 +109,16 @@
if (!t)
return o !== undef;
- if (t == 'array' && (o.hasOwnProperty && o instanceof Array))
+ if (t == 'array' && tinymce.isArray(o))
return true;
return typeof(o) == t;
},
+ isArray: Array.isArray || function(obj) {
+ return Object.prototype.toString.call(obj) === "[object Array]";
+ },
+
makeMap : function(items, delim, map) {
var i;
@@ -921,7 +927,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
if (t == 'object') {
- if (o.hasOwnProperty && o instanceof Array) {
+ if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
for (i=0, v = '['; i<o.length; i++)
v += (i > 0 ? ',' : '') + serialize(o[i], quote);
@@ -1093,7 +1099,8 @@ tinymce.create('static tinymce.util.XHR', {
})(tinymce);
tinymce.util.Quirks = function(editor) {
- var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, settings = editor.settings;
+ var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
+ settings = editor.settings, parser = editor.parser, serializer = editor.serializer, each = tinymce.each;
function setEditorCommandState(cmd, state) {
try {
@@ -1109,56 +1116,81 @@ tinymce.util.Quirks = function(editor) {
return documentMode ? documentMode : 6;
};
+ function isDefaultPrevented(e) {
+ return e.isDefaultPrevented();
+ };
+
function cleanupStylesWhenDeleting() {
function removeMergedFormatSpans(isDelete) {
- var rng, blockElm, node, clonedSpan;
+ var rng, blockElm, wrapperElm, bookmark, container, offset, elm;
+
+ function isAtStartOrEndOfElm() {
+ if (container.nodeType == 3) {
+ if (isDelete && offset == container.length) {
+ return true;
+ }
+
+ if (!isDelete && offset === 0) {
+ return true;
+ }
+ }
+ }
rng = selection.getRng();
+ var tmpRng = [rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset];
+
+ if (!rng.collapsed) {
+ isDelete = true;
+ }
- // Find root block
- blockElm = dom.getParent(rng.startContainer, dom.isBlock);
+ container = rng[(isDelete ? 'start' : 'end') + 'Container'];
+ offset = rng[(isDelete ? 'start' : 'end') + 'Offset'];
- // On delete clone the root span of the next block element
- if (isDelete)
- blockElm = dom.getNext(blockElm, dom.isBlock);
+ if (container.nodeType == 3) {
+ blockElm = dom.getParent(rng.startContainer, dom.isBlock);
- // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace
- if (blockElm) {
- node = blockElm.firstChild;
+ // On delete clone the root span of the next block element
+ if (isDelete) {
+ blockElm = dom.getNext(blockElm, dom.isBlock);
+ }
- // Ignore empty text nodes
- while (node && node.nodeType == 3 && node.nodeValue.length === 0)
- node = node.nextSibling;
+ if (blockElm && (isAtStartOrEndOfElm() || !rng.collapsed)) {
+ // Wrap children of block in a EM and let WebKit stick is
+ // runtime styles junk into that EM
+ wrapperElm = dom.create('em', {'id': '__mceDel'});
+
+ each(tinymce.grep(blockElm.childNodes), function(node) {
+ wrapperElm.appendChild(node);
+ });
- if (node && node.nodeName === 'SPAN') {
- clonedSpan = node.cloneNode(false);
+ blockElm.appendChild(wrapperElm);
}
}
// Do the backspace/delete action
+ rng = dom.createRng();
+ rng.setStart(tmpRng[0], tmpRng[1]);
+ rng.setEnd(tmpRng[2], tmpRng[3]);
+ selection.setRng(rng);
editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);
- // Find all odd apple-style-spans
- blockElm = dom.getParent(rng.startContainer, dom.isBlock);
- tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) {
- var bm = selection.getBookmark();
+ // Remove temp wrapper element
+ if (wrapperElm) {
+ bookmark = selection.getBookmark();
- if (clonedSpan) {
- dom.replace(clonedSpan.cloneNode(false), span, true);
- } else {
- dom.remove(span, true);
+ while (elm = dom.get('__mceDel')) {
+ dom.remove(elm, true);
}
- // Restore the selection
- selection.moveToBookmark(bm);
- });
- };
+ selection.moveToBookmark(bookmark);
+ }
+ }
editor.onKeyDown.add(function(editor, e) {
var isDelete;
isDelete = e.keyCode == DELETE;
- if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
+ if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
e.preventDefault();
removeMergedFormatSpans(isDelete);
}
@@ -1189,7 +1221,7 @@ tinymce.util.Quirks = function(editor) {
var keyCode = e.keyCode, isCollapsed;
// Empty the editor if it's needed for example backspace at <p><b>|</b></p>
- if (!e.isDefaultPrevented() && (keyCode == DELETE || keyCode == BACKSPACE)) {
+ if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
isCollapsed = editor.selection.isCollapsed();
// Selection is collapsed but the editor isn't empty
@@ -1217,7 +1249,7 @@ tinymce.util.Quirks = function(editor) {
function selectAll() {
editor.onKeyDown.add(function(editor, e) {
- if (e.keyCode == 65 && VK.metaKeyPressed(e)) {
+ if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) {
e.preventDefault();
editor.execCommand('SelectAll');
}
@@ -1243,7 +1275,7 @@ tinymce.util.Quirks = function(editor) {
function removeHrOnBackspace() {
editor.onKeyDown.add(function(editor, e) {
- if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {
+ if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
var node = selection.getNode();
var previousSibling = node.previousSibling;
@@ -1262,7 +1294,7 @@ tinymce.util.Quirks = function(editor) {
// wouldn't get proper focus if the user clicked on the HTML element
if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
editor.onMouseDown.add(function(editor, e) {
- if (e.target.nodeName === "HTML") {
+ if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {
var body = editor.getBody();
// Blur the body it's focused but not correctly focused
@@ -1306,7 +1338,7 @@ tinymce.util.Quirks = function(editor) {
if (target !== editor.getBody()) {
dom.setAttrib(target, "style", null);
- tinymce.each(template, function(attr) {
+ each(template, function(attr) {
target.setAttributeNode(attr.cloneNode(true));
});
}
@@ -1325,7 +1357,7 @@ tinymce.util.Quirks = function(editor) {
editor.onKeyPress.add(function(editor, e) {
var applyAttributes;
- if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
+ if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
applyAttributes = getAttributeApplyFunction();
editor.getDoc().execCommand('delete', false, null);
applyAttributes();
@@ -1337,7 +1369,7 @@ tinymce.util.Quirks = function(editor) {
dom.bind(editor.getDoc(), 'cut', function(e) {
var applyAttributes;
- if (isSelectionAcrossElements()) {
+ if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
applyAttributes = getAttributeApplyFunction();
editor.onKeyUp.addToTop(blockEvent);
@@ -1376,7 +1408,7 @@ tinymce.util.Quirks = function(editor) {
function disableBackspaceIntoATable() {
editor.onKeyDown.add(function(editor, e) {
- if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {
+ if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
var previousSibling = selection.getNode().previousSibling;
if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
@@ -1400,7 +1432,7 @@ tinymce.util.Quirks = function(editor) {
dom.addClass(editor.getBody(), 'mceHideBrInPre');
// Adds a \n before all BR elements in PRE to get them visual
- editor.parser.addNodeFilter('pre', function(nodes, name) {
+ parser.addNodeFilter('pre', function(nodes, name) {
var i = nodes.length, brNodes, j, brElm, sibling;
while (i--) {
@@ -1421,7 +1453,7 @@ tinymce.util.Quirks = function(editor) {
});
// Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible
- editor.serializer.addNodeFilter('pre', function(nodes, name) {
+ serializer.addNodeFilter('pre', function(nodes, name) {
var i = nodes.length, brNodes, j, brElm, sibling;
while (i--) {
@@ -1464,7 +1496,7 @@ tinymce.util.Quirks = function(editor) {
var isDelete, rng, container, offset, brElm, sibling, collapsed;
isDelete = e.keyCode == DELETE;
- if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
+ if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
rng = selection.getRng();
container = rng.startContainer;
offset = rng.startOffset;
@@ -1473,6 +1505,12 @@ tinymce.util.Quirks = function(editor) {
// Override delete if the start container is a text node and is at the beginning of text or
// just before/after the last character to be deleted in collapsed mode
if (container.nodeType == 3 && container.nodeValue.length > 0 && ((offset === 0 && !collapsed) || (collapsed && offset === (isDelete ? 0 : 1)))) {
+ // Edge case when deleting <p><b><img> |x</b></p>
+ sibling = container.previousSibling;
+ if (sibling && sibling.nodeName == "IMG") {
+ return;
+ }
+
nonEmptyElements = editor.schema.getNonEmptyElements();
// Prevent default logic since it's broken
@@ -1504,7 +1542,7 @@ tinymce.util.Quirks = function(editor) {
editor.onKeyDown.add(function(editor, e) {
var rng, container, offset, root, parent;
- if (e.isDefaultPrevented() || e.keyCode != VK.BACKSPACE) {
+ if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {
return;
}
@@ -1528,10 +1566,10 @@ tinymce.util.Quirks = function(editor) {
editor.formatter.toggle('blockquote', null, parent);
// Move the caret to the beginning of container
+ rng = dom.createRng();
rng.setStart(container, 0);
rng.setEnd(container, 0);
selection.setRng(rng);
- selection.collapse(false);
}
});
};
@@ -1556,7 +1594,7 @@ tinymce.util.Quirks = function(editor) {
function addBrAfterLastLinks() {
function fixLinks(editor, o) {
- tinymce.each(dom.select('a'), function(node) {
+ each(dom.select('a'), function(node) {
var parentNode = node.parentNode, root = dom.getRoot();
if (parentNode.lastChild === node) {
@@ -1606,7 +1644,7 @@ tinymce.util.Quirks = function(editor) {
editor.onKeyDown.add(function(editor, e) {
var rng;
- if (!e.isDefaultPrevented() && e.keyCode == BACKSPACE) {
+ if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {
rng = editor.getDoc().selection.createRange();
if (rng && rng.item) {
e.preventDefault();
@@ -1624,7 +1662,7 @@ tinymce.util.Quirks = function(editor) {
// IE10+
if (getDocumentMode() >= 10) {
emptyBlocksCSS = '';
- tinymce.each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
+ each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
});
@@ -1741,7 +1779,7 @@ tinymce.util.Quirks = function(editor) {
width = height = 0;
}
- tinymce.each(resizeHandles, function(handle, name) {
+ each(resizeHandles, function(handle, name) {
var handleElm;
// Get existing or render resize handle
@@ -1838,7 +1876,7 @@ tinymce.util.Quirks = function(editor) {
var controlElm = dom.getParent(selection.getNode(), 'table,img');
// Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
- tinymce.each(dom.select('img[data-mce-selected]'), function(img) {
+ each(dom.select('img[data-mce-selected]'), function(img) {
img.removeAttribute('data-mce-selected');
});
@@ -1865,6 +1903,57 @@ tinymce.util.Quirks = function(editor) {
});
}
+ function keepNoScriptContents() {
+ if (getDocumentMode() < 9) {
+ parser.addNodeFilter('noscript', function(nodes) {
+ var i = nodes.length, node, textNode;
+
+ while (i--) {
+ node = nodes[i];
+ textNode = node.firstChild;
+
+ if (textNode) {
+ node.attr('data-mce-innertext', textNode.value);
+ }
+ }
+ });
+
+ serializer.addNodeFilter('noscript', function(nodes) {
+ var i = nodes.length, node, textNode, value;
+
+ while (i--) {
+ node = nodes[i];
+ textNode = nodes[i].firstChild;
+
+ if (textNode) {
+ textNode.value = tinymce.html.Entities.decode(textNode.value);
+ } else {
+ // Old IE can't retain noscript value so an attribute is used to store it
+ value = node.attributes.map['data-mce-innertext'];
+ if (value) {
+ node.attr('data-mce-innertext', null);
+ textNode = new tinymce.html.Node('#text', 3);
+ textNode.value = value;
+ textNode.raw = true;
+ node.append(textNode);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ function bodyHeight() {
+ editor.contentStyles.push('body {min-height: 100px}');
+ editor.onClick.add(function(ed, e) {
+ if (e.target.nodeName == 'HTML') {
+ editor.execCommand('SelectAll');
+ editor.selection.collapse(true);
+ editor.nodeChanged();
+ }
+ });
+ }
+
// All browsers
disableBackspaceIntoATable();
removeBlockQuoteOnBackSpace();
@@ -1888,17 +1977,23 @@ tinymce.util.Quirks = function(editor) {
}
// IE
- if (tinymce.isIE) {
+ if (tinymce.isIE && !tinymce.isIE11) {
removeHrOnBackspace();
ensureBodyHasRoleApplication();
addNewLinesBeforeBrInPre();
removePreSerializedStylesWhenSelectingControls();
deleteControlItemOnBackSpace();
renderEmptyBlocksFix();
+ keepNoScriptContents();
+ }
+
+ // IE 11+
+ if (tinymce.isIE11) {
+ bodyHeight();
}
// Gecko
- if (tinymce.isGecko) {
+ if (tinymce.isGecko && !tinymce.isIE11) {
removeHrOnBackspace();
focusBody();
removeStylesWhenDeletingAccrossBlockElements();
@@ -2135,6 +2230,12 @@ tinymce.html.Styles = function(settings, schema) {
function compress(prefix, suffix) {
var top, right, bottom, left;
+ // IE 11 will produce a border-image: none when getting the style attribute from <p style="border: 1px solid red"></p>
+ // So lets asume it shouldn't be there
+ if (styles['border-image'] === 'none') {
+ delete styles['border-image'];
+ }
+
// Get values and check it it needs compressing
top = styles[prefix + '-top' + suffix];
if (!top)
@@ -2449,7 +2550,7 @@ tinymce.html.Styles = function(settings, schema) {
'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' +
'fieldset[A|disabled|form|name][C|legend]' +
'label[A|form|for][B]' +
- 'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' +
+ 'input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' +
'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' +
'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]' +
'select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]' +
@@ -2653,14 +2754,15 @@ tinymce.html.Styles = function(settings, schema) {
}
// Setup map objects
- whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script style textarea');
+ whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea');
selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source wbr');
boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls');
- nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap);
- blockElementsMap = createLookupTable('block_elements', 'h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot ' +
- 'th tr td li ol ul caption blockquote center dl dt dd dir fieldset ' +
- 'noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup');
+ nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap);
+ textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' +
+ 'blockquote center dir fieldset header footer article section hgroup aside nav figure');
+ blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
+ 'th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup', textBlockElementsMap);
// Converts a wildcard expression string to a regexp for example *a will become /.*a/.
function patternToRegExp(str) {
@@ -2834,8 +2936,15 @@ tinymce.html.Styles = function(settings, schema) {
customElementsMap[name] = cloneName;
// If it's not marked as inline then add it to valid block elements
- if (!inline)
+ if (!inline) {
+ blockElementsMap[name.toUpperCase()] = {};
blockElementsMap[name] = {};
+ }
+
+ // Add elements clone if needed
+ if (!elements[name]) {
+ elements[name] = elements[cloneName];
+ }
// Add custom elements at span/div positions
each(children, function(element, child) {
@@ -2960,6 +3069,10 @@ tinymce.html.Styles = function(settings, schema) {
return blockElementsMap;
};
+ self.getTextBlockElements = function() {
+ return textBlockElementsMap;
+ };
+
self.getShortEndedElements = function() {
return shortEndedElementsMap;
};
@@ -3025,6 +3138,8 @@ tinymce.html.Styles = function(settings, schema) {
self.addCustomElements = addCustomElements;
self.addValidChildren = addValidChildren;
+
+ self.elements = elements;
};
})(tinymce);
@@ -3123,10 +3238,10 @@ tinymce.html.Styles = function(settings, schema) {
'(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE
'(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI
'(?:\\/([^>]+)>)|' + // End element
- '(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
+ '(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
')', 'g');
- attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;
+ attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
specialElements = {
'script' : /<\/script[^>]*>/gi,
'style' : /<\/style[^>]*>/gi,
@@ -3609,7 +3724,7 @@ tinymce.html.Styles = function(settings, schema) {
i = node.attributes.length;
while (i--) {
name = node.attributes[i].name;
- if (name === "name" || name.indexOf('data-') === 0)
+ if (name === "name" || name.indexOf('data-mce-') === 0)
return false;
}
}
@@ -3665,17 +3780,40 @@ tinymce.html.Styles = function(settings, schema) {
function fixInvalidChildren(nodes) {
var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i,
- childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode;
+ childClone, nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;
nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table');
nonEmptyElements = schema.getNonEmptyElements();
+ textBlockElements = schema.getTextBlockElements();
for (ni = 0; ni < nodes.length; ni++) {
node = nodes[ni];
- // Already removed
- if (!node.parent)
+ // Already removed or fixed
+ if (!node.parent || node.fixed)
+ continue;
+
+ // If the invalid element is a text block and the text block is within a parent LI element
+ // Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
+ if (textBlockElements[node.name] && node.parent.name == 'li') {
+ // Move sibling text blocks after LI element
+ sibling = node.next;
+ while (sibling) {
+ if (textBlockElements[sibling.name]) {
+ sibling.name = 'li';
+ sibling.fixed = true;
+ node.parent.insert(sibling, node.parent);
+ } else {
+ break;
+ }
+
+ sibling = sibling.next;
+ }
+
+ // Unwrap current text block
+ node.unwrap(node);
continue;
+ }
// Get list of all parent nodes until we find a valid parent to stick the child into
parents = [node];
@@ -4054,7 +4192,8 @@ tinymce.html.Styles = function(settings, schema) {
}
// Trim start white space
- textNode = node.prev;
+ // Removed due to: #5424
+ /*textNode = node.prev;
if (textNode && textNode.type === 3) {
text = textNode.value.replace(startWhiteSpaceRegExp, '');
@@ -4062,7 +4201,7 @@ tinymce.html.Styles = function(settings, schema) {
textNode.value = text;
else
textNode.remove();
- }
+ }*/
}
// Check if we exited a whitespace preserved element
@@ -4572,6 +4711,12 @@ tinymce.dom = {};
}
}
+ // Page already loaded then fire it directly
+ if (doc.readyState == "complete") {
+ readyHandler();
+ return;
+ }
+
// Use W3C method
if (w3cEventModel) {
addEvent(win, 'DOMContentLoaded', readyHandler);
@@ -5115,6 +5260,11 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
blockElementsMap = s.schema ? s.schema.getBlockElements() : {};
t.isBlock = function(node) {
+ // Fix for #5446
+ if (!node) {
+ return false;
+ }
+
// This function is called in module pattern style since it might be executed with the wrong this scope
var type = node.nodeType;
@@ -5129,7 +5279,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
fixDoc: function(doc) {
var settings = this.settings, name;
- if (isIE && settings.schema) {
+ if (isIE && !tinymce.isIE11 && settings.schema) {
// Add missing HTML 4/5 elements to IE
('abbr article aside audio canvas ' +
'details figcaption figure footer ' +
@@ -5150,7 +5300,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
var self = this, clone, doc;
// TODO: Add feature detection here in the future
- if (!isIE || node.nodeType !== 1 || deep) {
+ if (!isIE || tinymce.isIE11 || node.nodeType !== 1 || deep) {
return node.cloneNode(deep);
}
@@ -5423,7 +5573,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
switch (na) {
case 'opacity':
// IE specific opacity
- if (isIE) {
+ if (isIE && ! tinymce.isIE11) {
s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";
if (!n.currentStyle || !n.currentStyle.hasLayout)
@@ -5435,7 +5585,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
break;
case 'float':
- isIE ? s.styleFloat = v : s.cssFloat = v;
+ (isIE && ! tinymce.isIE11) ? s.styleFloat = v : s.cssFloat = v;
break;
default:
@@ -5801,7 +5951,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
// This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading
// It's ugly but it seems to work fine.
- if (isIE && d.documentMode && d.recalc) {
+ if (isIE && !tinymce.isIE11 && d.documentMode && d.recalc) {
link.onload = function() {
if (d.recalc)
d.recalc();
@@ -6120,7 +6270,12 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// Import
case 3:
- addClasses(r.styleSheet);
+ try {
+ addClasses(r.styleSheet);
+ } catch (ex) {
+ // Ignore
+ }
+
break;
}
});
@@ -9222,7 +9377,7 @@ window.tinymce.dom.Sizzle = Sizzle;
if (!t.win.getSelection)
t.tridentSel = new tinymce.dom.TridentSelection(t);
- if (tinymce.isIE && dom.boxModel)
+ if (tinymce.isIE && ! tinymce.isIE11 && dom.boxModel)
this._fixIESelection();
// Prevent leaks
@@ -9514,8 +9669,20 @@ window.tinymce.dom.Sizzle = Sizzle;
}
// Handle simple range
- if (type)
- return {rng : t.getRng()};
+ if (type) {
+ rng = t.getRng();
+
+ if (rng.setStart) {
+ rng = {
+ startContainer: rng.startContainer,
+ startOffset: rng.startOffset,
+ endContainer: rng.endContainer,
+ endOffset: rng.endOffset
+ };
+ }
+
+ return {rng : rng};
+ }
rng = t.getRng();
id = dom.uniqueId();
@@ -9581,7 +9748,7 @@ window.tinymce.dom.Sizzle = Sizzle;
},
moveToBookmark : function(bookmark) {
- var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset;
+ var t = this, dom = t.dom, marker1, marker2, rng, rng2, root, startContainer, endContainer, startOffset, endOffset;
function setEndPoint(start) {
var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
@@ -9711,8 +9878,24 @@ window.tinymce.dom.Sizzle = Sizzle;
}
} else if (bookmark.name) {
t.select(dom.select(bookmark.name)[bookmark.index]);
- } else if (bookmark.rng)
- t.setRng(bookmark.rng);
+ } else if (bookmark.rng) {
+ rng = bookmark.rng;
+
+ if (rng.startContainer) {
+ rng2 = t.dom.createRng();
+
+ try {
+ rng2.setStart(rng.startContainer, rng.startOffset);
+ rng2.setEnd(rng.endContainer, rng.endOffset);
+ } catch (e) {
+ // Might fail with index error
+ }
+
+ rng = rng2;
+ }
+
+ t.setRng(rng);
+ }
}
},
@@ -9811,7 +9994,7 @@ window.tinymce.dom.Sizzle = Sizzle;
}
// We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
- if (tinymce.isIE && rng && rng.setStart && doc.selection.createRange().item) {
+ if (tinymce.isIE && ! tinymce.isIE11 && rng && rng.setStart && doc.selection.createRange().item) {
elm = doc.selection.createRange().item(0);
rng = doc.createRange();
rng.setStartBefore(elm);
@@ -10224,6 +10407,16 @@ window.tinymce.dom.Sizzle = Sizzle;
return self;
},
+ scrollIntoView: function(elm) {
+ var y, viewPort, self = this, dom = self.dom;
+
+ viewPort = dom.getViewPort(self.editor.getWin());
+ y = dom.getPos(elm).y;
+ if (y < viewPort.y || y + 25 > viewPort.y + viewPort.h) {
+ self.editor.getWin().scrollTo(0, y < viewPort.y ? y : y - viewPort.h + 25);
+ }
+ },
+
destroy : function(manual) {
var self = this;
@@ -10396,6 +10589,18 @@ window.tinymce.dom.Sizzle = Sizzle;
}
});
+ htmlParser.addNodeFilter('noscript', function(nodes) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i].firstChild;
+
+ if (node) {
+ node.value = tinymce.html.Entities.decode(node.value);
+ }
+ }
+ });
+
// Force script into CDATA sections and remove the mce- prefix also add comments around styles
htmlParser.addNodeFilter('script,style', function(nodes, name) {
var i = nodes.length, node, value;
@@ -10654,7 +10859,7 @@ window.tinymce.dom.Sizzle = Sizzle;
// Add onload listener for non IE browsers since IE9
// fires onload event before the script is parsed and executed
- if (!tinymce.isIE)
+ if (!tinymce.isIE || tinymce.isIE11)
elm.onload = done;
// Add onerror event will get fired on some browsers but not all of them
@@ -11067,18 +11272,22 @@ window.tinymce.dom.Sizzle = Sizzle;
switch (evt.keyCode) {
case DOM_VK_LEFT:
if (enableLeftRight) t.moveFocus(-1);
+ Event.cancel(evt);
break;
case DOM_VK_RIGHT:
if (enableLeftRight) t.moveFocus(1);
+ Event.cancel(evt);
break;
case DOM_VK_UP:
if (enableUpDown) t.moveFocus(-1);
+ Event.cancel(evt);
break;
case DOM_VK_DOWN:
if (enableUpDown) t.moveFocus(1);
+ Event.cancel(evt);
break;
case DOM_VK_ESCAPE:
@@ -11775,7 +11984,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
else
h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');
- h += '<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="' + this.id + '_voice">' + s.title + '</span>';
+ h += '<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="' + this.id + '_voice">' + s.title + '</span>';
h += '</a>';
return h;
},
@@ -11800,9 +12009,11 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
return s.onclick.call(s.scope, e);
}
});
- tinymce.dom.Event.add(t.id, 'keyup', function(e) {
- if (!t.isDisabled() && e.keyCode==tinymce.VK.SPACEBAR)
+ tinymce.dom.Event.add(t.id, 'keydown', function(e) {
+ if (!t.isDisabled() && e.keyCode==tinymce.VK.SPACEBAR) {
+ tinymce.dom.Event.cancel(e);
return s.onclick.call(s.scope, e);
+ }
});
}
});
@@ -12215,7 +12426,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
// Accessibility keyhandler
Event.add(t.id, 'keydown', function(e) {
- var bf;
+ var bf, DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32;
Event.remove(t.id, 'change', ch);
changeListenerAdded = false;
@@ -12227,14 +12438,12 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
Event.remove(t.id, 'blur', bf);
});
- //prevent default left and right keys on chrome - so that the keyboard navigation is used.
- if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) {
- return Event.prevent(e);
- }
-
- if (e.keyCode == 13 || e.keyCode == 32) {
+ if (e.keyCode == DOM_VK_RETURN || e.keyCode == DOM_VK_SPACE) {
onChange(e);
return Event.cancel(e);
+ } else if (e.keyCode == DOM_VK_DOWN || e.keyCode == DOM_VK_UP) {
+ // allow native implementation (navigate select element options)
+ e.stopImmediatePropagation();
}
});
@@ -13037,6 +13246,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
if (id === undef)
return this.editors;
+ if (!this.editors.hasOwnProperty(id))
+ return undef;
+
return this.editors[id];
},
@@ -13120,7 +13332,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
ed.render();
// Fix IE memory leaks
- if (tinymce.isIE) {
+ if (tinymce.isIE && ! tinymce.isIE11) {
w.attachEvent('onunload', clr);
}
@@ -13518,10 +13730,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Store away the selection when it's changed to it can be restored later with a editor.focus() call
if (isIE) {
t.onInit.add(function(ed) {
- ed.dom.bind(ed.getBody(), 'beforedeactivate keydown', function() {
- ed.lastIERng = ed.selection.getRng();
+ ed.dom.bind(ed.getBody(), 'beforedeactivate keydown keyup', function() {
+ ed.bookmark = ed.selection.getBookmark(1);
});
});
+
+ t.onNodeChange.add(function(ed) {
+ if (document.activeElement.id == ed.id + "_ifr") {
+ ed.bookmark = ed.selection.getBookmark(1);
+ }
+ });
}
}
@@ -13558,10 +13776,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';
// IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.
- if (s.ie7_compat)
- t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
- else
- t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
+ if (tinymce.isIE8) {
+ if (s.ie7_compat)
+ t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
+ else
+ t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
+ }
t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
@@ -13839,8 +14059,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, ieRng, controlElm, doc = self.getDoc(), body;
if (!skip_focus) {
- if (self.lastIERng) {
- selection.setRng(self.lastIERng);
+ if (self.bookmark) {
+ selection.moveToBookmark(self.bookmark);
+ self.bookmark = null;
}
// Get selected control element
@@ -13861,7 +14082,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
body = self.getBody();
// Check for setActive since it doesn't scroll to the element
- if (body.setActive) {
+ if (body.setActive && ! tinymce.isIE11) {
body.setActive();
} else {
body.focus();
@@ -14189,6 +14410,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// We must save before we hide so Safari doesn't crash
self.save();
+
+ // defer the call to hide to prevent an IE9 crash #4921
DOM.hide(self.getContainer());
DOM.setStyle(self.id, 'display', self.orgDisplay);
},
@@ -14468,11 +14691,19 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
},
remove : function() {
- var self = this, elm = self.getContainer();
+ var self = this, elm = self.getContainer(), doc = self.getDoc();
if (!self.removed) {
self.removed = 1; // Cancels post remove event execution
- self.hide();
+
+ // Fixed bug where IE has a blinking cursor left from the editor
+ if (isIE && doc)
+ doc.execCommand('SelectAll');
+
+ // We must save before we hide so Safari doesn't crash
+ self.save();
+
+ DOM.setStyle(self.id, 'display', self.orgDisplay);
// Don't clear the window or document if content editable
// is enabled since other instances might still be present
@@ -15465,7 +15696,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Add undo level on save contents, drag end and blur/focusout
editor.onSaveContent.add(addNonTypingUndoLevel);
editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel);
- editor.dom.bind(editor.getDoc(), tinymce.isGecko ? 'blur' : 'focusout', function(e) {
+ editor.dom.bind(editor.getBody(), 'focusout', function(e) {
if (!editor.removed && self.typing) {
addNonTypingUndoLevel();
}
@@ -16248,6 +16479,7 @@ tinymce.ForceBlocks = function(editor) {
TreeWalker = tinymce.dom.TreeWalker,
rangeUtils = new tinymce.dom.RangeUtils(dom),
isValid = ed.schema.isValidChild,
+ isArray = tinymce.isArray,
isBlock = dom.isBlock,
forcedRootBlock = ed.settings.forced_root_block,
nodeIndex = dom.nodeIndex,
@@ -16259,9 +16491,13 @@ tinymce.ForceBlocks = function(editor) {
undef,
getContentEditable = dom.getContentEditable;
- function isArray(obj) {
- return obj instanceof Array;
- };
+ function isTextBlock(name) {
+ if (name.nodeType) {
+ name = name.nodeName;
+ }
+
+ return !!ed.schema.getTextBlockElements()[name.toLowerCase()];
+ }
function getParents(node, selector) {
return dom.getParents(node, selector, dom.getRoot());
@@ -16621,7 +16857,7 @@ tinymce.ForceBlocks = function(editor) {
// Is it valid to wrap this item
if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) &&
- !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node)) {
+ !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node) && (!format.inline || !isBlock(node))) {
// Start wrapping
if (!currentWrapElm) {
// Wrap the node
@@ -16827,6 +17063,11 @@ tinymce.ForceBlocks = function(editor) {
function process(node) {
var children, i, l, localContentEditable, lastContentEditable, hasContentEditableState;
+ // Skip on text nodes as they have neither format to remove nor children
+ if (node.nodeType === 3) {
+ return;
+ }
+
// Node has a contentEditable value
if (node.nodeType === 1 && getContentEditable(node)) {
lastContentEditable = contentEditable;
@@ -17320,6 +17561,10 @@ tinymce.ForceBlocks = function(editor) {
siblingName = start ? 'previousSibling' : 'nextSibling';
root = dom.getRoot();
+ function isBogusBr(node) {
+ return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;
+ };
+
// If it's a text node and the offset is inside the text
if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {
if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
@@ -17334,7 +17579,7 @@ tinymce.ForceBlocks = function(editor) {
// Walk left/right
for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
- if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) {
+ if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
return parent;
}
}
@@ -17493,7 +17738,7 @@ tinymce.ForceBlocks = function(editor) {
// Expand to first wrappable block element or any block element
if (!node)
- node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);
+ node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isTextBlock);
// Exclude inner lists from wrapping
if (node && format[0].wrapper)
@@ -17892,10 +18137,6 @@ tinymce.ForceBlocks = function(editor) {
return next;
};
- function isTextBlock(name) {
- return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name);
- };
-
function getContainer(rng, start) {
var container, offset, lastIdx, walker;
@@ -18131,11 +18372,23 @@ tinymce.ForceBlocks = function(editor) {
node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));
node = node.firstChild;
- // Insert caret container after the formated node
- dom.insertAfter(caretContainer, formatNode);
+ var block = dom.getParent(formatNode, isTextBlock);
+
+ if (block && dom.isEmpty(block)) {
+ // Replace formatNode with caretContainer when removing format from empty block like <p><b>|</b></p>
+ formatNode.parentNode.replaceChild(caretContainer, formatNode);
+ } else {
+ // Insert caret container after the formated node
+ dom.insertAfter(caretContainer, formatNode);
+ }
// Move selection to text node
selection.setCursorLocation(node, 1);
+
+ // If the formatNode is empty, we can remove it safely.
+ if (dom.isEmpty(formatNode)) {
+ dom.remove(formatNode);
+ }
}
};
@@ -18325,7 +18578,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
function renderBlockOnIE(block) {
var oldRng;
- if (tinymce.isIE && dom.isBlock(block)) {
+ if (tinymce.isIE && !tinymce.isIE11 && dom.isBlock(block)) {
oldRng = selection.getRng();
block.appendChild(dom.create('span', null, '\u00a0'));
selection.select(block);
@@ -18440,6 +18693,11 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
if (settings.keep_styles !== false) {
do {
if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {
+ // Never clone a caret containers
+ if (node.id == '_mce_caret') {
+ continue;
+ }
+
clonedNode = node.cloneNode(false);
dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
@@ -18455,8 +18713,8 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
}
// BR is needed in empty blocks on non IE browsers
- if (!tinymce.isIE) {
- caretNode.innerHTML = '<br>';
+ if (!tinymce.isIE || tinymce.isIE11) {
+ caretNode.innerHTML = '<br data-mce-bogus="1">';
}
return block;
@@ -18617,26 +18875,24 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
undoManager.add();
};
- // Walks the parent block to the right and look for BR elements
- function hasRightSideBr() {
+ // Walks the parent block to the right and look for any contents
+ function hasRightSideContent() {
var walker = new TreeWalker(container, parentBlock), node;
- while (node = walker.current()) {
- if (node.nodeName == 'BR') {
+ while (node = walker.next()) {
+ if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
return true;
}
-
- node = walker.next();
}
}
-
+
// Inserts a BR element if the forced_root_block option is set to false or empty string
function insertBr() {
- var brElm, extraBr;
+ var brElm, extraBr, marker;
if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
// Insert extra BR element at the end block elements
- if (!tinymce.isIE && !hasRightSideBr()) {
+ if ((!tinymce.isIE || tinymce.isIE11) && !hasRightSideContent()) {
brElm = dom.create('br');
rng.insertNode(brElm);
rng.setStartAfter(brElm);
@@ -18649,10 +18905,16 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
rng.insertNode(brElm);
// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it
- if (tinymce.isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
+ if ((tinymce.isIE && !tinymce.isIE11) && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
}
+ // Insert temp marker and scroll to that
+ marker = dom.create('span', {}, '&nbsp;');
+ brElm.parentNode.insertBefore(marker, brElm);
+ selection.scrollIntoView(marker);
+ dom.remove(marker);
+
if (!extraBr) {
rng.setStartAfter(brElm);
rng.setEndAfter(brElm);
@@ -18697,7 +18959,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
var lastChild;
// IE will render the blocks correctly other browsers needs a BR
- if (!tinymce.isIE) {
+ if (!tinymce.isIE || tinymce.isIE11) {
block.normalize(); // Remove empty text nodes that got left behind by the extract
// Check if the block is empty or contains a floated last child
@@ -18772,6 +19034,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+ // Enter inside block contained within a LI then split or insert before/after LI
+ if (containerBlockName == 'LI' && !evt.ctrlKey) {
+ parentBlock = containerBlock;
+ parentBlockName = containerBlockName;
+ }
+
// Handle enter in LI
if (parentBlockName == 'LI') {
if (!newBlockName && shiftKey) {
diff --git a/program/js/treelist.js b/program/js/treelist.js
index 5913f44b4..d940e396c 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -28,6 +28,9 @@ function rcube_treelist_widget(node, p)
id_prefix: '',
autoexpand: 1000,
selectable: false,
+ scroll_delay: 500,
+ scroll_step: 5,
+ scroll_speed: 20,
check_droptarget: function(node){ return !node.virtual }
}, p || {});
@@ -42,6 +45,7 @@ function rcube_treelist_widget(node, p)
autoexpand_item,
body_scroll_top = 0,
list_scroll_top = 0,
+ scroll_timer,
me = this;
@@ -461,6 +465,7 @@ function rcube_treelist_widget(node, p)
body_scroll_top = bw.ie ? 0 : window.pageYOffset;
list_scroll_top = container.parent().scrollTop();
+ pos.top += list_scroll_top;
drag_active = true;
box_coords = {
@@ -476,6 +481,7 @@ function rcube_treelist_widget(node, p)
item = li.children().first().get(0);
if (height = item.offsetHeight) {
pos = $(item).offset();
+ pos.top += list_scroll_top;
item_coords[id] = {
x1: pos.left,
y1: pos.top,
@@ -485,6 +491,38 @@ function rcube_treelist_widget(node, p)
};
}
}
+
+ // enable auto-scrolling of list container
+ if (container.height() > container.parent().height()) {
+ container.parent()
+ .mousemove(function(e) {
+ var scroll = 0,
+ mouse = rcube_event.get_mouse_pos(e);
+ mouse.y -= container.parent().offset().top;
+
+ if (mouse.y < 25 && list_scroll_top > 0) {
+ scroll = -1; // up
+ }
+ else if (mouse.y > container.parent().height() - 25) {
+ scroll = 1; // down
+ }
+
+ if (drag_active && scroll != 0) {
+ if (!scroll_timer)
+ scroll_timer = window.setTimeout(function(){ drag_scroll(scroll); }, p.scroll_delay);
+ }
+ else if (scroll_timer) {
+ window.clearTimeout(scroll_timer);
+ scroll_timer = null;
+ }
+ })
+ .mouseleave(function() {
+ if (scroll_timer) {
+ window.clearTimeout(scroll_timer);
+ scroll_timer = null;
+ }
+ });
+ }
}
/**
@@ -493,6 +531,7 @@ function rcube_treelist_widget(node, p)
function drag_end()
{
drag_active = false;
+ scroll_timer = null;
if (autoexpand_timer) {
clearTimeout(autoexpand_timer);
@@ -504,16 +543,33 @@ function rcube_treelist_widget(node, p)
}
/**
+ * Scroll list container in the given direction
+ */
+ function drag_scroll(dir)
+ {
+ if (!drag_active)
+ return;
+
+ var old_top = list_scroll_top;
+ container.parent().get(0).scrollTop += p.scroll_step * dir;
+ list_scroll_top = container.parent().scrollTop();
+ scroll_timer = null;
+
+ if (list_scroll_top != old_top)
+ scroll_timer = window.setTimeout(function(){ drag_scroll(dir); }, p.scroll_speed);
+ }
+
+ /**
* Determine if the given mouse coords intersect the list and one if its items
*/
function intersects(mouse, highlight)
{
// offsets to compensate for scrolling while dragging a message
var boffset = bw.ie ? -document.documentElement.scrollTop : body_scroll_top,
- moffset = list_scroll_top - container.parent().scrollTop(),
+ moffset = container.parent().scrollTop(),
result = null;
- mouse.top = mouse.y + -moffset - boffset;
+ mouse.top = mouse.y + moffset - boffset;
// no intersection with list bounding box
if (mouse.x < box_coords.x1 || mouse.x >= box_coords.x2 || mouse.top < box_coords.y1 || mouse.top >= box_coords.y2) {
diff --git a/program/lib/Crypt/GPG.php b/program/lib/Crypt/GPG.php
index 6e8e717e8..5c2231289 100644
--- a/program/lib/Crypt/GPG.php
+++ b/program/lib/Crypt/GPG.php
@@ -47,15 +47,20 @@
* @package Crypt_GPG
* @author Nathan Fredrickson <nathan@silverorange.com>
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2005-2010 silverorange
+ * @copyright 2005-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: GPG.php 302814 2010-08-26 15:43:07Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
* @link http://pear.php.net/manual/en/package.encryption.crypt-gpg.php
* @link http://www.gnupg.org/
*/
/**
+ * Base class for GPG methods
+ */
+require_once 'Crypt/GPGAbstract.php';
+
+/**
* Signature handler class
*/
require_once 'Crypt/GPG/VerifyStatusHandler.php';
@@ -65,31 +70,6 @@ require_once 'Crypt/GPG/VerifyStatusHandler.php';
*/
require_once 'Crypt/GPG/DecryptStatusHandler.php';
-/**
- * GPG key class
- */
-require_once 'Crypt/GPG/Key.php';
-
-/**
- * GPG sub-key class
- */
-require_once 'Crypt/GPG/SubKey.php';
-
-/**
- * GPG user id class
- */
-require_once 'Crypt/GPG/UserId.php';
-
-/**
- * GPG process and I/O engine class
- */
-require_once 'Crypt/GPG/Engine.php';
-
-/**
- * GPG exception classes
- */
-require_once 'Crypt/GPG/Exceptions.php';
-
// {{{ class Crypt_GPG
/**
@@ -104,82 +84,13 @@ require_once 'Crypt/GPG/Exceptions.php';
* @package Crypt_GPG
* @author Nathan Fredrickson <nathan@silverorange.com>
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2005-2010 silverorange
+ * @copyright 2005-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @link http://pear.php.net/package/Crypt_GPG
* @link http://www.gnupg.org/
*/
-class Crypt_GPG
+class Crypt_GPG extends Crypt_GPGAbstract
{
- // {{{ class error constants
-
- /**
- * Error code returned when there is no error.
- */
- const ERROR_NONE = 0;
-
- /**
- * Error code returned when an unknown or unhandled error occurs.
- */
- const ERROR_UNKNOWN = 1;
-
- /**
- * Error code returned when a bad passphrase is used.
- */
- const ERROR_BAD_PASSPHRASE = 2;
-
- /**
- * Error code returned when a required passphrase is missing.
- */
- const ERROR_MISSING_PASSPHRASE = 3;
-
- /**
- * Error code returned when a key that is already in the keyring is
- * imported.
- */
- const ERROR_DUPLICATE_KEY = 4;
-
- /**
- * Error code returned the required data is missing for an operation.
- *
- * This could be missing key data, missing encrypted data or missing
- * signature data.
- */
- const ERROR_NO_DATA = 5;
-
- /**
- * Error code returned when an unsigned key is used.
- */
- const ERROR_UNSIGNED_KEY = 6;
-
- /**
- * Error code returned when a key that is not self-signed is used.
- */
- const ERROR_NOT_SELF_SIGNED = 7;
-
- /**
- * Error code returned when a public or private key that is not in the
- * keyring is used.
- */
- const ERROR_KEY_NOT_FOUND = 8;
-
- /**
- * Error code returned when an attempt to delete public key having a
- * private key is made.
- */
- const ERROR_DELETE_PRIVATE_KEY = 9;
-
- /**
- * Error code returned when one or more bad signatures are detected.
- */
- const ERROR_BAD_SIGNATURE = 10;
-
- /**
- * Error code returned when there is a problem reading GnuPG data files.
- */
- const ERROR_FILE_PERMISSIONS = 11;
-
- // }}}
// {{{ class constants for data signing modes
/**
@@ -249,12 +160,27 @@ class Crypt_GPG
const FORMAT_X509 = 3;
// }}}
- // {{{ other class constants
+ // {{{ class constants for boolean options
+
+ /**
+ * Use to specify ASCII armored mode for returned data
+ */
+ const ARMOR_ASCII = true;
+
+ /**
+ * Use to specify binary mode for returned data
+ */
+ const ARMOR_BINARY = false;
+
+ /**
+ * Use to specify that line breaks in signed text should be normalized
+ */
+ const TEXT_NORMALIZED = true;
/**
- * URI at which package bugs may be reported.
+ * Use to specify that line breaks in signed text should not be normalized
*/
- const BUG_URI = 'http://pear.php.net/bugs/report.php?package=Crypt_GPG';
+ const TEXT_RAW = false;
// }}}
// {{{ protected class properties
@@ -326,88 +252,6 @@ class Crypt_GPG
protected $decryptKeys = array();
// }}}
- // {{{ __construct()
-
- /**
- * Creates a new GPG object
- *
- * Available options are:
- *
- * - <kbd>string homedir</kbd> - the directory where the GPG
- * keyring files are stored. If not
- * specified, Crypt_GPG uses the
- * default of <kbd>~/.gnupg</kbd>.
- * - <kbd>string publicKeyring</kbd> - the file path of the public
- * keyring. Use this if the public
- * keyring is not in the homedir, or
- * if the keyring is in a directory
- * not writable by the process
- * invoking GPG (like Apache). Then
- * you can specify the path to the
- * keyring with this option
- * (/foo/bar/pubring.gpg), and specify
- * a writable directory (like /tmp)
- * using the <i>homedir</i> option.
- * - <kbd>string privateKeyring</kbd> - the file path of the private
- * keyring. Use this if the private
- * keyring is not in the homedir, or
- * if the keyring is in a directory
- * not writable by the process
- * invoking GPG (like Apache). Then
- * you can specify the path to the
- * keyring with this option
- * (/foo/bar/secring.gpg), and specify
- * a writable directory (like /tmp)
- * using the <i>homedir</i> option.
- * - <kbd>string trustDb</kbd> - the file path of the web-of-trust
- * database. Use this if the trust
- * database is not in the homedir, or
- * if the database is in a directory
- * not writable by the process
- * invoking GPG (like Apache). Then
- * you can specify the path to the
- * trust database with this option
- * (/foo/bar/trustdb.gpg), and specify
- * a writable directory (like /tmp)
- * using the <i>homedir</i> option.
- * - <kbd>string binary</kbd> - the location of the GPG binary. If
- * not specified, the driver attempts
- * to auto-detect the GPG binary
- * location using a list of known
- * default locations for the current
- * operating system. The option
- * <kbd>gpgBinary</kbd> is a
- * deprecated alias for this option.
- * - <kbd>boolean debug</kbd> - whether or not to use debug mode.
- * When debug mode is on, all
- * communication to and from the GPG
- * subprocess is logged. This can be
- *
- * @param array $options optional. An array of options used to create the
- * GPG object. All options are optional and are
- * represented as key-value pairs.
- *
- * @throws Crypt_GPG_FileException if the <kbd>homedir</kbd> does not exist
- * and cannot be created. This can happen if <kbd>homedir</kbd> is
- * not specified, Crypt_GPG is run as the web user, and the web
- * user has no home directory. This exception is also thrown if any
- * of the options <kbd>publicKeyring</kbd>,
- * <kbd>privateKeyring</kbd> or <kbd>trustDb</kbd> options are
- * specified but the files do not exist or are are not readable.
- * This can happen if the user running the Crypt_GPG process (for
- * example, the Apache user) does not have permission to read the
- * files.
- *
- * @throws PEAR_Exception if the provided <kbd>binary</kbd> is invalid, or
- * if no <kbd>binary</kbd> is provided and no suitable binary could
- * be found.
- */
- public function __construct(array $options = array())
- {
- $this->setEngine(new Crypt_GPG_Engine($options));
- }
-
- // }}}
// {{{ importKey()
/**
@@ -520,7 +364,9 @@ class Crypt_GPG
if ($fingerprint === null) {
throw new Crypt_GPG_KeyNotFoundException(
'Public key not found: ' . $keyId,
- Crypt_GPG::ERROR_KEY_NOT_FOUND, $keyId);
+ self::ERROR_KEY_NOT_FOUND,
+ $keyId
+ );
}
$keyData = '';
@@ -534,11 +380,13 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
- if ($code !== Crypt_GPG::ERROR_NONE) {
+ if ($code !== self::ERROR_NONE) {
throw new Crypt_GPG_Exception(
'Unknown error exporting public key. Please use the ' .
'\'debug\' option when creating the Crypt_GPG object, and ' .
- 'file a bug report at ' . self::BUG_URI, $code);
+ 'file a bug report at ' . self::BUG_URI,
+ $code
+ );
}
return $keyData;
@@ -583,7 +431,9 @@ class Crypt_GPG
if ($fingerprint === null) {
throw new Crypt_GPG_KeyNotFoundException(
'Public key not found: ' . $keyId,
- Crypt_GPG::ERROR_KEY_NOT_FOUND, $keyId);
+ self::ERROR_KEY_NOT_FOUND,
+ $keyId
+ );
}
$operation = '--delete-key ' . escapeshellarg($fingerprint);
@@ -599,17 +449,22 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
switch ($code) {
- case Crypt_GPG::ERROR_NONE:
+ case self::ERROR_NONE:
break;
- case Crypt_GPG::ERROR_DELETE_PRIVATE_KEY:
+ case self::ERROR_DELETE_PRIVATE_KEY:
throw new Crypt_GPG_DeletePrivateKeyException(
'Private key must be deleted before public key can be ' .
- 'deleted.', $code, $keyId);
+ 'deleted.',
+ $code,
+ $keyId
+ );
default:
throw new Crypt_GPG_Exception(
'Unknown error deleting public key. Please use the ' .
'\'debug\' option when creating the Crypt_GPG object, and ' .
- 'file a bug report at ' . self::BUG_URI, $code);
+ 'file a bug report at ' . self::BUG_URI,
+ $code
+ );
}
}
@@ -647,7 +502,9 @@ class Crypt_GPG
if ($fingerprint === null) {
throw new Crypt_GPG_KeyNotFoundException(
'Private key not found: ' . $keyId,
- Crypt_GPG::ERROR_KEY_NOT_FOUND, $keyId);
+ self::ERROR_KEY_NOT_FOUND,
+ $keyId
+ );
}
$operation = '--delete-secret-key ' . escapeshellarg($fingerprint);
@@ -663,17 +520,21 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
switch ($code) {
- case Crypt_GPG::ERROR_NONE:
+ case self::ERROR_NONE:
break;
- case Crypt_GPG::ERROR_KEY_NOT_FOUND:
+ case self::ERROR_KEY_NOT_FOUND:
throw new Crypt_GPG_KeyNotFoundException(
'Private key not found: ' . $keyId,
- $code, $keyId);
+ $code,
+ $keyId
+ );
default:
throw new Crypt_GPG_Exception(
'Unknown error deleting private key. Please use the ' .
'\'debug\' option when creating the Crypt_GPG object, and ' .
- 'file a bug report at ' . self::BUG_URI, $code);
+ 'file a bug report at ' . self::BUG_URI,
+ $code
+ );
}
}
@@ -705,161 +566,7 @@ class Crypt_GPG
*/
public function getKeys($keyId = '')
{
- // get private key fingerprints
- if ($keyId == '') {
- $operation = '--list-secret-keys';
- } else {
- $operation = '--list-secret-keys ' . escapeshellarg($keyId);
- }
-
- // According to The file 'doc/DETAILS' in the GnuPG distribution, using
- // double '--with-fingerprint' also prints the fingerprint for subkeys.
- $arguments = array(
- '--with-colons',
- '--with-fingerprint',
- '--with-fingerprint',
- '--fixed-list-mode'
- );
-
- $output = '';
-
- $this->engine->reset();
- $this->engine->setOutput($output);
- $this->engine->setOperation($operation, $arguments);
- $this->engine->run();
-
- $code = $this->engine->getErrorCode();
-
- switch ($code) {
- case Crypt_GPG::ERROR_NONE:
- case Crypt_GPG::ERROR_KEY_NOT_FOUND:
- // ignore not found key errors
- break;
- case Crypt_GPG::ERROR_FILE_PERMISSIONS:
- $filename = $this->engine->getErrorFilename();
- if ($filename) {
- throw new Crypt_GPG_FileException(sprintf(
- 'Error reading GnuPG data file \'%s\'. Check to make ' .
- 'sure it is readable by the current user.', $filename),
- $code, $filename);
- }
- throw new Crypt_GPG_FileException(
- 'Error reading GnuPG data file. Check to make GnuPG data ' .
- 'files are readable by the current user.', $code);
- default:
- throw new Crypt_GPG_Exception(
- 'Unknown error getting keys. Please use the \'debug\' option ' .
- 'when creating the Crypt_GPG object, and file a bug report ' .
- 'at ' . self::BUG_URI, $code);
- }
-
- $privateKeyFingerprints = array();
-
- $lines = explode(PHP_EOL, $output);
- foreach ($lines as $line) {
- $lineExp = explode(':', $line);
- if ($lineExp[0] == 'fpr') {
- $privateKeyFingerprints[] = $lineExp[9];
- }
- }
-
- // get public keys
- if ($keyId == '') {
- $operation = '--list-public-keys';
- } else {
- $operation = '--list-public-keys ' . escapeshellarg($keyId);
- }
-
- $output = '';
-
- $this->engine->reset();
- $this->engine->setOutput($output);
- $this->engine->setOperation($operation, $arguments);
- $this->engine->run();
-
- $code = $this->engine->getErrorCode();
-
- switch ($code) {
- case Crypt_GPG::ERROR_NONE:
- case Crypt_GPG::ERROR_KEY_NOT_FOUND:
- // ignore not found key errors
- break;
- case Crypt_GPG::ERROR_FILE_PERMISSIONS:
- $filename = $this->engine->getErrorFilename();
- if ($filename) {
- throw new Crypt_GPG_FileException(sprintf(
- 'Error reading GnuPG data file \'%s\'. Check to make ' .
- 'sure it is readable by the current user.', $filename),
- $code, $filename);
- }
- throw new Crypt_GPG_FileException(
- 'Error reading GnuPG data file. Check to make GnuPG data ' .
- 'files are readable by the current user.', $code);
- default:
- throw new Crypt_GPG_Exception(
- 'Unknown error getting keys. Please use the \'debug\' option ' .
- 'when creating the Crypt_GPG object, and file a bug report ' .
- 'at ' . self::BUG_URI, $code);
- }
-
- $keys = array();
-
- $key = null; // current key
- $subKey = null; // current sub-key
-
- $lines = explode(PHP_EOL, $output);
- foreach ($lines as $line) {
- $lineExp = explode(':', $line);
-
- if ($lineExp[0] == 'pub') {
-
- // new primary key means last key should be added to the array
- if ($key !== null) {
- $keys[] = $key;
- }
-
- $key = new Crypt_GPG_Key();
-
- $subKey = Crypt_GPG_SubKey::parse($line);
- $key->addSubKey($subKey);
-
- } elseif ($lineExp[0] == 'sub') {
-
- $subKey = Crypt_GPG_SubKey::parse($line);
- $key->addSubKey($subKey);
-
- } elseif ($lineExp[0] == 'fpr') {
-
- $fingerprint = $lineExp[9];
-
- // set current sub-key fingerprint
- $subKey->setFingerprint($fingerprint);
-
- // if private key exists, set has private to true
- if (in_array($fingerprint, $privateKeyFingerprints)) {
- $subKey->setHasPrivate(true);
- }
-
- } elseif ($lineExp[0] == 'uid') {
-
- $string = stripcslashes($lineExp[9]); // as per documentation
- $userId = new Crypt_GPG_UserId($string);
-
- if ($lineExp[1] == 'r') {
- $userId->setRevoked(true);
- }
-
- $key->addUserId($userId);
-
- }
- }
-
- // add last key
- if ($key !== null) {
- $keys[] = $key;
- }
-
- return $keys;
+ return parent::_getKeys($keyId);
}
// }}}
@@ -895,7 +602,7 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- public function getFingerprint($keyId, $format = Crypt_GPG::FORMAT_NONE)
+ public function getFingerprint($keyId, $format = self::FORMAT_NONE)
{
$output = '';
$operation = '--list-keys ' . escapeshellarg($keyId);
@@ -912,15 +619,17 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
switch ($code) {
- case Crypt_GPG::ERROR_NONE:
- case Crypt_GPG::ERROR_KEY_NOT_FOUND:
+ case self::ERROR_NONE:
+ case self::ERROR_KEY_NOT_FOUND:
// ignore not found key errors
break;
default:
throw new Crypt_GPG_Exception(
'Unknown error getting key fingerprint. Please use the ' .
'\'debug\' option when creating the Crypt_GPG object, and ' .
- 'file a bug report at ' . self::BUG_URI, $code);
+ 'file a bug report at ' . self::BUG_URI,
+ $code
+ );
}
$fingerprint = null;
@@ -932,13 +641,13 @@ class Crypt_GPG
$fingerprint = $lineExp[9];
switch ($format) {
- case Crypt_GPG::FORMAT_CANONICAL:
+ case self::FORMAT_CANONICAL:
$fingerprintExp = str_split($fingerprint, 4);
$format = '%s %s %s %s %s %s %s %s %s %s';
$fingerprint = vsprintf($format, $fingerprintExp);
break;
- case Crypt_GPG::FORMAT_X509:
+ case self::FORMAT_X509:
$fingerprintExp = str_split($fingerprint, 2);
$fingerprint = implode(':', $fingerprintExp);
break;
@@ -976,7 +685,7 @@ class Crypt_GPG
*
* @sensitive $data
*/
- public function encrypt($data, $armor = true)
+ public function encrypt($data, $armor = self::ARMOR_ASCII)
{
return $this->_encrypt($data, false, null, $armor);
}
@@ -1012,8 +721,11 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- public function encryptFile($filename, $encryptedFile = null, $armor = true)
- {
+ public function encryptFile(
+ $filename,
+ $encryptedFile = null,
+ $armor = self::ARMOR_ASCII
+ ) {
return $this->_encrypt($filename, true, $encryptedFile, $armor);
}
@@ -1052,7 +764,7 @@ class Crypt_GPG
*
* @see Crypt_GPG::decryptAndVerify()
*/
- public function encryptAndSign($data, $armor = true)
+ public function encryptAndSign($data, $armor = self::ARMOR_ASCII)
{
return $this->_encryptAndSign($data, false, null, $armor);
}
@@ -1103,8 +815,10 @@ class Crypt_GPG
*
* @see Crypt_GPG::decryptAndVerifyFile()
*/
- public function encryptAndSignFile($filename, $signedFile = null,
- $armor = true
+ public function encryptAndSignFile(
+ $filename,
+ $signedFile = null,
+ $armor = self::ARMOR_ASCII
) {
return $this->_encryptAndSign($filename, true, $signedFile, $armor);
}
@@ -1315,8 +1029,11 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- public function sign($data, $mode = Crypt_GPG::SIGN_MODE_NORMAL,
- $armor = true, $textmode = false
+ public function sign(
+ $data,
+ $mode = self::SIGN_MODE_NORMAL,
+ $armor = self::ARMOR_ASCII,
+ $textmode = self::TEXT_RAW
) {
return $this->_sign($data, false, null, $mode, $armor, $textmode);
}
@@ -1376,8 +1093,12 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- public function signFile($filename, $signedFile = null,
- $mode = Crypt_GPG::SIGN_MODE_NORMAL, $armor = true, $textmode = false
+ public function signFile(
+ $filename,
+ $signedFile = null,
+ $mode = self::SIGN_MODE_NORMAL,
+ $armor = self::ARMOR_ASCII,
+ $textmode = self::TEXT_RAW
) {
return $this->_sign(
$filename,
@@ -1472,7 +1193,7 @@ class Crypt_GPG
* @param string $passphrase optional. The passphrase of the key required
* for decryption.
*
- * @return void
+ * @return Crypt_GPG the current object, for fluent interface.
*
* @see Crypt_GPG::decrypt()
* @see Crypt_GPG::decryptFile()
@@ -1485,6 +1206,7 @@ class Crypt_GPG
public function addDecryptKey($key, $passphrase = null)
{
$this->_addKey($this->decryptKeys, true, false, $key, $passphrase);
+ return $this;
}
// }}}
@@ -1498,7 +1220,7 @@ class Crypt_GPG
* {@link Crypt_GPG_SubKey}. The key must be able to
* encrypt.
*
- * @return void
+ * @return Crypt_GPG the current object, for fluent interface.
*
* @see Crypt_GPG::encrypt()
* @see Crypt_GPG::encryptFile()
@@ -1508,6 +1230,7 @@ class Crypt_GPG
public function addEncryptKey($key)
{
$this->_addKey($this->encryptKeys, true, false, $key);
+ return $this;
}
// }}}
@@ -1523,7 +1246,7 @@ class Crypt_GPG
* @param string $passphrase optional. The passphrase of the key required
* for signing.
*
- * @return void
+ * @return Crypt_GPG the current object, for fluent interface.
*
* @see Crypt_GPG::sign()
* @see Crypt_GPG::signFile()
@@ -1536,6 +1259,7 @@ class Crypt_GPG
public function addSignKey($key, $passphrase = null)
{
$this->_addKey($this->signKeys, false, true, $key, $passphrase);
+ return $this;
}
// }}}
@@ -1544,7 +1268,7 @@ class Crypt_GPG
/**
* Clears all decryption keys
*
- * @return void
+ * @return Crypt_GPG the current object, for fluent interface.
*
* @see Crypt_GPG::decrypt()
* @see Crypt_GPG::addDecryptKey()
@@ -1552,6 +1276,7 @@ class Crypt_GPG
public function clearDecryptKeys()
{
$this->decryptKeys = array();
+ return $this;
}
// }}}
@@ -1560,7 +1285,7 @@ class Crypt_GPG
/**
* Clears all encryption keys
*
- * @return void
+ * @return Crypt_GPG the current object, for fluent interface.
*
* @see Crypt_GPG::encrypt()
* @see Crypt_GPG::addEncryptKey()
@@ -1568,6 +1293,7 @@ class Crypt_GPG
public function clearEncryptKeys()
{
$this->encryptKeys = array();
+ return $this;
}
// }}}
@@ -1576,7 +1302,7 @@ class Crypt_GPG
/**
* Clears all signing keys
*
- * @return void
+ * @return Crypt_GPG the current object, for fluent interface.
*
* @see Crypt_GPG::sign()
* @see Crypt_GPG::addSignKey()
@@ -1584,6 +1310,7 @@ class Crypt_GPG
public function clearSignKeys()
{
$this->signKeys = array();
+ return $this;
}
// }}}
@@ -1658,24 +1385,6 @@ class Crypt_GPG
}
// }}}
- // {{{ setEngine()
-
- /**
- * Sets the I/O engine to use for GnuPG operations
- *
- * Normally this method does not need to be used. It provides a means for
- * dependency injection.
- *
- * @param Crypt_GPG_Engine $engine the engine to use.
- *
- * @return void
- */
- public function setEngine(Crypt_GPG_Engine $engine)
- {
- $this->engine = $engine;
- }
-
- // }}}
// {{{ _addKey()
/**
@@ -1698,7 +1407,7 @@ class Crypt_GPG
*
* @sensitive $passphrase
*/
- private function _addKey(array &$array, $encrypt, $sign, $key,
+ protected function _addKey(array &$array, $encrypt, $sign, $key,
$passphrase = null
) {
$subKeys = array();
@@ -1707,7 +1416,10 @@ class Crypt_GPG
$keys = $this->getKeys($key);
if (count($keys) == 0) {
throw new Crypt_GPG_KeyNotFoundException(
- 'Key "' . $key . '" not found.', 0, $key);
+ 'Key "' . $key . '" not found.',
+ 0,
+ $key
+ );
}
$key = $keys[0];
}
@@ -1715,12 +1427,14 @@ class Crypt_GPG
if ($key instanceof Crypt_GPG_Key) {
if ($encrypt && !$key->canEncrypt()) {
throw new InvalidArgumentException(
- 'Key "' . $key . '" cannot encrypt.');
+ 'Key "' . $key . '" cannot encrypt.'
+ );
}
if ($sign && !$key->canSign()) {
throw new InvalidArgumentException(
- 'Key "' . $key . '" cannot sign.');
+ 'Key "' . $key . '" cannot sign.'
+ );
}
foreach ($key->getSubKeys() as $subKey) {
@@ -1741,18 +1455,21 @@ class Crypt_GPG
if (count($subKeys) === 0) {
throw new InvalidArgumentException(
- 'Key "' . $key . '" is not in a recognized format.');
+ 'Key "' . $key . '" is not in a recognized format.'
+ );
}
foreach ($subKeys as $subKey) {
if ($encrypt && !$subKey->canEncrypt()) {
throw new InvalidArgumentException(
- 'Key "' . $key . '" cannot encrypt.');
+ 'Key "' . $key . '" cannot encrypt.'
+ );
}
if ($sign && !$subKey->canSign()) {
throw new InvalidArgumentException(
- 'Key "' . $key . '" cannot sign.');
+ 'Key "' . $key . '" cannot sign.'
+ );
}
$array[$subKey->getId()] = array(
@@ -1763,6 +1480,37 @@ class Crypt_GPG
}
// }}}
+ // {{{ _setPinEntryEnv()
+
+ /**
+ * Sets the PINENTRY_USER_DATA environment variable with the currently
+ * added keys and passphrases
+ *
+ * Keys and pasphrases are stored as an indexed array of associative
+ * arrays that is JSON encoded to a flat string.
+ *
+ * For GnuPG 2.x this is how passphrases are passed. For GnuPG 1.x the
+ * environment variable is set but not used.
+ *
+ * @param array $keys the internal key array to use.
+ *
+ * @return void
+ */
+ protected function _setPinEntryEnv(array $keys)
+ {
+ $envKeys = array();
+ foreach ($keys as $id => $key) {
+ $envKeys[] = array(
+ 'keyId' => $id,
+ 'fingerprint' => $key['fingerprint'],
+ 'passphrase' => $key['passphrase']
+ );
+ }
+ $envKeys = json_encode($envKeys);
+ $_ENV['PINENTRY_USER_DATA'] = $envKeys;
+ }
+
+ // }}}
// {{{ _importKey()
/**
@@ -1792,21 +1540,26 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- private function _importKey($key, $isFile)
+ protected function _importKey($key, $isFile)
{
$result = array();
if ($isFile) {
$input = @fopen($key, 'rb');
if ($input === false) {
- throw new Crypt_GPG_FileException('Could not open key file "' .
- $key . '" for importing.', 0, $key);
+ throw new Crypt_GPG_FileException(
+ 'Could not open key file "' . $key . '" for importing.',
+ 0,
+ $key
+ );
}
} else {
$input = strval($key);
if ($input == '') {
throw new Crypt_GPG_NoDataException(
- 'No valid GPG key data found.', Crypt_GPG::ERROR_NO_DATA);
+ 'No valid GPG key data found.',
+ self::ERROR_NO_DATA
+ );
}
}
@@ -1836,18 +1589,22 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
switch ($code) {
- case Crypt_GPG::ERROR_DUPLICATE_KEY:
- case Crypt_GPG::ERROR_NONE:
+ case self::ERROR_DUPLICATE_KEY:
+ case self::ERROR_NONE:
// ignore duplicate key import errors
break;
- case Crypt_GPG::ERROR_NO_DATA:
+ case self::ERROR_NO_DATA:
throw new Crypt_GPG_NoDataException(
- 'No valid GPG key data found.', $code);
+ 'No valid GPG key data found.',
+ $code
+ );
default:
throw new Crypt_GPG_Exception(
'Unknown error importing GPG key. Please use the \'debug\' ' .
'option when creating the Crypt_GPG object, and file a bug ' .
- 'report at ' . self::BUG_URI, $code);
+ 'report at ' . self::BUG_URI,
+ $code
+ );
}
return $result;
@@ -1880,18 +1637,23 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- private function _encrypt($data, $isFile, $outputFile, $armor)
+ protected function _encrypt($data, $isFile, $outputFile, $armor)
{
if (count($this->encryptKeys) === 0) {
throw new Crypt_GPG_KeyNotFoundException(
- 'No encryption keys specified.');
+ 'No encryption keys specified.'
+ );
}
if ($isFile) {
$input = @fopen($data, 'rb');
if ($input === false) {
- throw new Crypt_GPG_FileException('Could not open input file "' .
- $data . '" for encryption.', 0, $data);
+ throw new Crypt_GPG_FileException(
+ 'Could not open input file "' . $data .
+ '" for encryption.',
+ 0,
+ $data
+ );
}
} else {
$input = strval($data);
@@ -1905,9 +1667,12 @@ class Crypt_GPG
if ($isFile) {
fclose($input);
}
- throw new Crypt_GPG_FileException('Could not open output ' .
- 'file "' . $outputFile . '" for storing encrypted data.',
- 0, $outputFile);
+ throw new Crypt_GPG_FileException(
+ 'Could not open output file "' . $outputFile .
+ '" for storing encrypted data.',
+ 0,
+ $outputFile
+ );
}
}
@@ -1932,11 +1697,13 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
- if ($code !== Crypt_GPG::ERROR_NONE) {
+ if ($code !== self::ERROR_NONE) {
throw new Crypt_GPG_Exception(
'Unknown error encrypting data. Please use the \'debug\' ' .
'option when creating the Crypt_GPG object, and file a bug ' .
- 'report at ' . self::BUG_URI, $code);
+ 'report at ' . self::BUG_URI,
+ $code
+ );
}
if ($outputFile === null) {
@@ -1976,20 +1743,26 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- private function _decrypt($data, $isFile, $outputFile)
+ protected function _decrypt($data, $isFile, $outputFile)
{
if ($isFile) {
$input = @fopen($data, 'rb');
if ($input === false) {
- throw new Crypt_GPG_FileException('Could not open input file "' .
- $data . '" for decryption.', 0, $data);
+ throw new Crypt_GPG_FileException(
+ 'Could not open input file "' . $data .
+ '" for decryption.',
+ 0,
+ $data
+ );
}
} else {
$input = strval($data);
if ($input == '') {
throw new Crypt_GPG_NoDataException(
'Cannot decrypt data. No PGP encrypted data was found in '.
- 'the provided data.', Crypt_GPG::ERROR_NO_DATA);
+ 'the provided data.',
+ self::ERROR_NO_DATA
+ );
}
}
@@ -2001,14 +1774,22 @@ class Crypt_GPG
if ($isFile) {
fclose($input);
}
- throw new Crypt_GPG_FileException('Could not open output ' .
- 'file "' . $outputFile . '" for storing decrypted data.',
- 0, $outputFile);
+ throw new Crypt_GPG_FileException(
+ 'Could not open output file "' . $outputFile .
+ '" for storing decrypted data.',
+ 0,
+ $outputFile
+ );
}
}
- $handler = new Crypt_GPG_DecryptStatusHandler($this->engine,
- $this->decryptKeys);
+ $handler = new Crypt_GPG_DecryptStatusHandler(
+ $this->engine,
+ $this->decryptKeys
+ );
+
+ // If using gpg-agent, set the decrypt pins used by the pinentry
+ $this->_setPinEntryEnv($this->decryptKeys);
$this->engine->reset();
$this->engine->addStatusHandler(array($handler, 'handle'));
@@ -2080,19 +1861,23 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- private function _sign($data, $isFile, $outputFile, $mode, $armor,
+ protected function _sign($data, $isFile, $outputFile, $mode, $armor,
$textmode
) {
if (count($this->signKeys) === 0) {
throw new Crypt_GPG_KeyNotFoundException(
- 'No signing keys specified.');
+ 'No signing keys specified.'
+ );
}
if ($isFile) {
$input = @fopen($data, 'rb');
if ($input === false) {
- throw new Crypt_GPG_FileException('Could not open input ' .
- 'file "' . $data . '" for signing.', 0, $data);
+ throw new Crypt_GPG_FileException(
+ 'Could not open input file "' . $data . '" for signing.',
+ 0,
+ $data
+ );
}
} else {
$input = strval($data);
@@ -2106,20 +1891,23 @@ class Crypt_GPG
if ($isFile) {
fclose($input);
}
- throw new Crypt_GPG_FileException('Could not open output ' .
- 'file "' . $outputFile . '" for storing signed ' .
- 'data.', 0, $outputFile);
+ throw new Crypt_GPG_FileException(
+ 'Could not open output file "' . $outputFile .
+ '" for storing signed data.',
+ 0,
+ $outputFile
+ );
}
}
switch ($mode) {
- case Crypt_GPG::SIGN_MODE_DETACHED:
+ case self::SIGN_MODE_DETACHED:
$operation = '--detach-sign';
break;
- case Crypt_GPG::SIGN_MODE_CLEAR:
+ case self::SIGN_MODE_CLEAR:
$operation = '--clearsign';
break;
- case Crypt_GPG::SIGN_MODE_NORMAL:
+ case self::SIGN_MODE_NORMAL:
default:
$operation = '--sign';
break;
@@ -2139,6 +1927,9 @@ class Crypt_GPG
escapeshellarg($key['fingerprint']);
}
+ // If using gpg-agent, set the sign pins used by the pinentry
+ $this->_setPinEntryEnv($this->signKeys);
+
$this->engine->reset();
$this->engine->addStatusHandler(array($this, 'handleSignStatus'));
$this->engine->setInput($input);
@@ -2157,24 +1948,32 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
switch ($code) {
- case Crypt_GPG::ERROR_NONE:
+ case self::ERROR_NONE:
break;
- case Crypt_GPG::ERROR_KEY_NOT_FOUND:
+ case self::ERROR_KEY_NOT_FOUND:
throw new Crypt_GPG_KeyNotFoundException(
'Cannot sign data. Private key not found. Import the '.
- 'private key before trying to sign data.', $code,
- $this->engine->getErrorKeyId());
- case Crypt_GPG::ERROR_BAD_PASSPHRASE:
+ 'private key before trying to sign data.',
+ $code,
+ $this->engine->getErrorKeyId()
+ );
+ case self::ERROR_BAD_PASSPHRASE:
throw new Crypt_GPG_BadPassphraseException(
- 'Cannot sign data. Incorrect passphrase provided.', $code);
- case Crypt_GPG::ERROR_MISSING_PASSPHRASE:
+ 'Cannot sign data. Incorrect passphrase provided.',
+ $code
+ );
+ case self::ERROR_MISSING_PASSPHRASE:
throw new Crypt_GPG_BadPassphraseException(
- 'Cannot sign data. No passphrase provided.', $code);
+ 'Cannot sign data. No passphrase provided.',
+ $code
+ );
default:
throw new Crypt_GPG_Exception(
'Unknown error signing data. Please use the \'debug\' option ' .
'when creating the Crypt_GPG object, and file a bug report ' .
- 'at ' . self::BUG_URI, $code);
+ 'at ' . self::BUG_URI,
+ $code
+ );
}
if ($outputFile === null) {
@@ -2216,25 +2015,30 @@ class Crypt_GPG
* Use the <kbd>debug</kbd> option and file a bug report if these
* exceptions occur.
*/
- private function _encryptAndSign($data, $isFile, $outputFile, $armor)
+ protected function _encryptAndSign($data, $isFile, $outputFile, $armor)
{
if (count($this->signKeys) === 0) {
throw new Crypt_GPG_KeyNotFoundException(
- 'No signing keys specified.');
+ 'No signing keys specified.'
+ );
}
if (count($this->encryptKeys) === 0) {
throw new Crypt_GPG_KeyNotFoundException(
- 'No encryption keys specified.');
+ 'No encryption keys specified.'
+ );
}
if ($isFile) {
$input = @fopen($data, 'rb');
if ($input === false) {
- throw new Crypt_GPG_FileException('Could not open input ' .
- 'file "' . $data . '" for encrypting and signing.', 0,
- $data);
+ throw new Crypt_GPG_FileException(
+ 'Could not open input file "' . $data .
+ '" for encrypting and signing.',
+ 0,
+ $data
+ );
}
} else {
$input = strval($data);
@@ -2248,9 +2052,12 @@ class Crypt_GPG
if ($isFile) {
fclose($input);
}
- throw new Crypt_GPG_FileException('Could not open output ' .
- 'file "' . $outputFile . '" for storing encrypted, ' .
- 'signed data.', 0, $outputFile);
+ throw new Crypt_GPG_FileException(
+ 'Could not open output file "' . $outputFile .
+ '" for storing encrypted, signed data.',
+ 0,
+ $outputFile
+ );
}
}
@@ -2261,6 +2068,9 @@ class Crypt_GPG
escapeshellarg($key['fingerprint']);
}
+ // If using gpg-agent, set the sign pins used by the pinentry
+ $this->_setPinEntryEnv($this->signKeys);
+
foreach ($this->encryptKeys as $key) {
$arguments[] = '--recipient ' . escapeshellarg($key['fingerprint']);
}
@@ -2283,25 +2093,32 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
switch ($code) {
- case Crypt_GPG::ERROR_NONE:
+ case self::ERROR_NONE:
break;
- case Crypt_GPG::ERROR_KEY_NOT_FOUND:
+ case self::ERROR_KEY_NOT_FOUND:
throw new Crypt_GPG_KeyNotFoundException(
'Cannot sign encrypted data. Private key not found. Import '.
'the private key before trying to sign the encrypted data.',
- $code, $this->engine->getErrorKeyId());
- case Crypt_GPG::ERROR_BAD_PASSPHRASE:
+ $code,
+ $this->engine->getErrorKeyId()
+ );
+ case self::ERROR_BAD_PASSPHRASE:
throw new Crypt_GPG_BadPassphraseException(
'Cannot sign encrypted data. Incorrect passphrase provided.',
- $code);
- case Crypt_GPG::ERROR_MISSING_PASSPHRASE:
+ $code
+ );
+ case self::ERROR_MISSING_PASSPHRASE:
throw new Crypt_GPG_BadPassphraseException(
- 'Cannot sign encrypted data. No passphrase provided.', $code);
+ 'Cannot sign encrypted data. No passphrase provided.',
+ $code
+ );
default:
throw new Crypt_GPG_Exception(
'Unknown error encrypting and signing data. Please use the ' .
'\'debug\' option when creating the Crypt_GPG object, and ' .
- 'file a bug report at ' . self::BUG_URI, $code);
+ 'file a bug report at ' . self::BUG_URI,
+ $code
+ );
}
if ($outputFile === null) {
@@ -2335,7 +2152,7 @@ class Crypt_GPG
*
* @see Crypt_GPG_Signature
*/
- private function _verify($data, $isFile, $signature)
+ protected function _verify($data, $isFile, $signature)
{
if ($signature == '') {
$operation = '--verify';
@@ -2352,14 +2169,19 @@ class Crypt_GPG
if ($isFile) {
$input = @fopen($data, 'rb');
if ($input === false) {
- throw new Crypt_GPG_FileException('Could not open input ' .
- 'file "' . $data . '" for verifying.', 0, $data);
+ throw new Crypt_GPG_FileException(
+ 'Could not open input file "' . $data . '" for verifying.',
+ 0,
+ $data
+ );
}
} else {
$input = strval($data);
if ($input == '') {
throw new Crypt_GPG_NoDataException(
- 'No valid signature data found.', Crypt_GPG::ERROR_NO_DATA);
+ 'No valid signature data found.',
+ self::ERROR_NO_DATA
+ );
}
}
@@ -2385,21 +2207,27 @@ class Crypt_GPG
$code = $this->engine->getErrorCode();
switch ($code) {
- case Crypt_GPG::ERROR_NONE:
- case Crypt_GPG::ERROR_BAD_SIGNATURE:
+ case self::ERROR_NONE:
+ case self::ERROR_BAD_SIGNATURE:
break;
- case Crypt_GPG::ERROR_NO_DATA:
+ case self::ERROR_NO_DATA:
throw new Crypt_GPG_NoDataException(
- 'No valid signature data found.', $code);
- case Crypt_GPG::ERROR_KEY_NOT_FOUND:
+ 'No valid signature data found.',
+ $code
+ );
+ case self::ERROR_KEY_NOT_FOUND:
throw new Crypt_GPG_KeyNotFoundException(
'Public key required for data verification not in keyring.',
- $code, $this->engine->getErrorKeyId());
+ $code,
+ $this->engine->getErrorKeyId()
+ );
default:
throw new Crypt_GPG_Exception(
'Unknown error validating signature details. Please use the ' .
'\'debug\' option when creating the Crypt_GPG object, and ' .
- 'file a bug report at ' . self::BUG_URI, $code);
+ 'file a bug report at ' . self::BUG_URI,
+ $code
+ );
}
return $handler->getSignatures();
@@ -2445,21 +2273,25 @@ class Crypt_GPG
*
* @see Crypt_GPG_Signature
*/
- private function _decryptAndVerify($data, $isFile, $outputFile)
+ protected function _decryptAndVerify($data, $isFile, $outputFile)
{
if ($isFile) {
$input = @fopen($data, 'rb');
if ($input === false) {
- throw new Crypt_GPG_FileException('Could not open input ' .
- 'file "' . $data . '" for decrypting and verifying.', 0,
- $data);
+ throw new Crypt_GPG_FileException(
+ 'Could not open input file "' . $data .
+ '" for decrypting and verifying.',
+ 0,
+ $data
+ );
}
} else {
$input = strval($data);
if ($input == '') {
throw new Crypt_GPG_NoDataException(
'No valid encrypted signed data found.',
- Crypt_GPG::ERROR_NO_DATA);
+ self::ERROR_NO_DATA
+ );
}
}
@@ -2471,16 +2303,24 @@ class Crypt_GPG
if ($isFile) {
fclose($input);
}
- throw new Crypt_GPG_FileException('Could not open output ' .
- 'file "' . $outputFile . '" for storing decrypted data.',
- 0, $outputFile);
+ throw new Crypt_GPG_FileException(
+ 'Could not open output file "' . $outputFile .
+ '" for storing decrypted data.',
+ 0,
+ $outputFile
+ );
}
}
$verifyHandler = new Crypt_GPG_VerifyStatusHandler();
- $decryptHandler = new Crypt_GPG_DecryptStatusHandler($this->engine,
- $this->decryptKeys);
+ $decryptHandler = new Crypt_GPG_DecryptStatusHandler(
+ $this->engine,
+ $this->decryptKeys
+ );
+
+ // If using gpg-agent, set the decrypt pins used by the pinentry
+ $this->_setPinEntryEnv($this->decryptKeys);
$this->engine->reset();
$this->engine->addStatusHandler(array($verifyHandler, 'handle'));
@@ -2515,13 +2355,17 @@ class Crypt_GPG
'is in the keyring or the public key required for data ' .
'verification is not in the keyring. Import a suitable ' .
'key before trying to decrypt and verify this data.',
- self::ERROR_KEY_NOT_FOUND, $this->engine->getErrorKeyId());
+ self::ERROR_KEY_NOT_FOUND,
+ $this->engine->getErrorKeyId()
+ );
}
if ($e instanceof Crypt_GPG_NoDataException) {
throw new Crypt_GPG_NoDataException(
'Cannot decrypt and verify data. No PGP encrypted data ' .
- 'was found in the provided data.', self::ERROR_NO_DATA);
+ 'was found in the provided data.',
+ self::ERROR_NO_DATA
+ );
}
throw $e;
diff --git a/program/lib/Crypt/GPG/ByteUtils.php b/program/lib/Crypt/GPG/ByteUtils.php
new file mode 100644
index 000000000..342905471
--- /dev/null
+++ b/program/lib/Crypt/GPG/ByteUtils.php
@@ -0,0 +1,105 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * A class for performing byte-wise string operations
+ *
+ * GPG I/O streams are managed using bytes rather than characters.
+ *
+ * PHP version 5
+ *
+ * LICENSE:
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @version CVS: $Id$
+ * @link http://pear.php.net/package/Crypt_GPG
+ */
+
+// {{{ class Crypt_GPG_ByteUtils
+
+/**
+ * A class for performing byte-wise string operations
+ *
+ * GPG I/O streams are managed using bytes rather than characters. This class
+ * requires the mbstring extension to be available.
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://php.net/mbstring
+ */
+class Crypt_GPG_ByteUtils
+{
+ // {{{ strlen()
+
+ /**
+ * Gets the length of a string in bytes
+ *
+ * This is used for stream-based communication with the GPG subprocess.
+ *
+ * @param string $string the string for which to get the length.
+ *
+ * @return integer the length of the string in bytes.
+ */
+ public static function strlen($string)
+ {
+ return mb_strlen($string, '8bit');
+ }
+
+ // }}}
+ // {{{ substr()
+
+ /**
+ * Gets the substring of a string in bytes
+ *
+ * This is used for stream-based communication with the GPG subprocess.
+ *
+ * @param string $string the input string.
+ * @param integer $start the starting point at which to get the substring.
+ * @param integer $length optional. The length of the substring.
+ *
+ * @return string the extracted part of the string. Unlike the default PHP
+ * <kbd>substr()</kbd> function, the returned value is
+ * always a string and never false.
+ */
+ public static function substr($string, $start, $length = null)
+ {
+ if ($length === null) {
+ return mb_substr(
+ $string,
+ $start,
+ self::strlen($string) - $start, '8bit'
+ );
+ }
+
+ return mb_substr($string, $start, $length, '8bit');
+ }
+
+ // }}}
+}
+
+// }}}
+
+?>
diff --git a/program/lib/Crypt/GPG/DecryptStatusHandler.php b/program/lib/Crypt/GPG/DecryptStatusHandler.php
index 40e8d50ed..67c0dd74b 100644
--- a/program/lib/Crypt/GPG/DecryptStatusHandler.php
+++ b/program/lib/Crypt/GPG/DecryptStatusHandler.php
@@ -3,9 +3,9 @@
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
- * Crypt_GPG is a package to use GPG from PHP
+ * Crypt_GPG is a package to use GnuPG from PHP
*
- * This file contains an object that handles GPG's status output for the
+ * This file contains an object that handles GnuPG's status output for the
* decrypt operation.
*
* PHP version 5
@@ -29,9 +29,9 @@
* @category Encryption
* @package Crypt_GPG
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2008-2009 silverorange
+ * @copyright 2008-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: DecryptStatusHandler.php 302814 2010-08-26 15:43:07Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
* @link http://www.gnupg.org/
*/
@@ -42,7 +42,7 @@
require_once 'Crypt/GPG.php';
/**
- * GPG exception classes
+ * Crypt_GPG exception classes
*/
require_once 'Crypt/GPG/Exceptions.php';
@@ -55,8 +55,8 @@ require_once 'Crypt/GPG/Exceptions.php';
*
* This class is responsible for sending the passphrase commands when required
* by the {@link Crypt_GPG::decrypt()} method. See <b>doc/DETAILS</b> in the
- * {@link http://www.gnupg.org/download/ GPG distribution} for detailed
- * information on GPG's status output for the decrypt operation.
+ * {@link http://www.gnupg.org/download/ GnuPG distribution} for detailed
+ * information on GnuPG's status output for the decrypt operation.
*
* This class is also responsible for parsing error status and throwing a
* meaningful exception in the event that decryption fails.
@@ -64,7 +64,7 @@ require_once 'Crypt/GPG/Exceptions.php';
* @category Encryption
* @package Crypt_GPG
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2008 silverorange
+ * @copyright 2008-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @link http://pear.php.net/package/Crypt_GPG
* @link http://www.gnupg.org/
@@ -293,8 +293,10 @@ class Crypt_GPG_DecryptStatusHandler
throw new Crypt_GPG_KeyNotFoundException(
'Cannot decrypt data. No suitable private key is in the ' .
'keyring. Import a suitable private key before trying to ' .
- 'decrypt this data.', $code, $keyId);
-
+ 'decrypt this data.',
+ $code,
+ $keyId
+ );
case Crypt_GPG::ERROR_BAD_PASSPHRASE:
$badPassphrases = array_diff_key(
$this->badPassphrases,
@@ -316,17 +318,23 @@ class Crypt_GPG_DecryptStatusHandler
implode('", "', $badPassphrases) . '".';
}
- throw new Crypt_GPG_BadPassphraseException($message, $code,
- $badPassphrases, $missingPassphrases);
-
+ throw new Crypt_GPG_BadPassphraseException(
+ $message,
+ $code,
+ $badPassphrases,
+ $missingPassphrases
+ );
case Crypt_GPG::ERROR_NO_DATA:
throw new Crypt_GPG_NoDataException(
'Cannot decrypt data. No PGP encrypted data was found in '.
- 'the provided data.', $code);
-
+ 'the provided data.',
+ $code
+ );
default:
throw new Crypt_GPG_Exception(
- 'Unknown error decrypting data.', $code);
+ 'Unknown error decrypting data.',
+ $code
+ );
}
}
diff --git a/program/lib/Crypt/GPG/Engine.php b/program/lib/Crypt/GPG/Engine.php
index 081be8e21..601541443 100644
--- a/program/lib/Crypt/GPG/Engine.php
+++ b/program/lib/Crypt/GPG/Engine.php
@@ -30,9 +30,9 @@
* @package Crypt_GPG
* @author Nathan Fredrickson <nathan@silverorange.com>
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2005-2010 silverorange
+ * @copyright 2005-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: Engine.php 302822 2010-08-26 17:30:57Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
* @link http://www.gnupg.org/
*/
@@ -48,6 +48,16 @@ require_once 'Crypt/GPG.php';
require_once 'Crypt/GPG/Exceptions.php';
/**
+ * Byte string operations.
+ */
+require_once 'Crypt/GPG/ByteUtils.php';
+
+/**
+ * Process control methods.
+ */
+require_once 'Crypt/GPG/ProcessControl.php';
+
+/**
* Standard PEAR exception is used if GPG binary is not found.
*/
require_once 'PEAR/Exception.php';
@@ -70,7 +80,7 @@ require_once 'PEAR/Exception.php';
* @package Crypt_GPG
* @author Nathan Fredrickson <nathan@silverorange.com>
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2005-2010 silverorange
+ * @copyright 2005-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @link http://pear.php.net/package/Crypt_GPG
* @link http://www.gnupg.org/
@@ -163,6 +173,17 @@ class Crypt_GPG_Engine
private $_binary = '';
/**
+ * Location of GnuPG agent binary
+ *
+ * Only used for GnuPG 2.x
+ *
+ * @var string
+ * @see Crypt_GPG_Engine::__construct()
+ * @see Crypt_GPG_Engine::_getAgent()
+ */
+ private $_agent = '';
+
+ /**
* Directory containing the GPG key files
*
* This property only contains the path when the <i>homedir</i> option
@@ -228,6 +249,15 @@ class Crypt_GPG_Engine
private $_pipes = array();
/**
+ * Array of pipes used for communication with the gpg-agent binary
+ *
+ * This is an array of file descriptor resources.
+ *
+ * @var array
+ */
+ private $_agentPipes = array();
+
+ /**
* Array of currently opened pipes
*
* This array is used to keep track of remaining opened pipes so they can
@@ -248,6 +278,20 @@ class Crypt_GPG_Engine
private $_process = null;
/**
+ * A handle for the gpg-agent process
+ *
+ * @var resource
+ */
+ private $_agentProcess = null;
+
+ /**
+ * GPG agent daemon socket and PID for running gpg-agent
+ *
+ * @var string
+ */
+ private $_agentInfo = null;
+
+ /**
* Whether or not the operating system is Darwin (OS X)
*
* @var boolean
@@ -367,18 +411,6 @@ class Crypt_GPG_Engine
*/
private $_version = '';
- /**
- * Cached value indicating whether or not mbstring function overloading is
- * on for strlen
- *
- * This is cached for optimal performance inside the I/O loop.
- *
- * @var boolean
- * @see Crypt_GPG_Engine::_byteLength()
- * @see Crypt_GPG_Engine::_byteSubstring()
- */
- private static $_mbStringOverload = null;
-
// }}}
// {{{ __construct()
@@ -432,6 +464,14 @@ class Crypt_GPG_Engine
* operating system. The option
* <kbd>gpgBinary</kbd> is a
* deprecated alias for this option.
+ * - <kbd>string agent</kbd> - the location of the GnuPG agent
+ * binary. The gpg-agent is only
+ * used for GnuPG 2.x. If not
+ * specified, the engine attempts
+ * to auto-detect the gpg-agent
+ * binary location using a list of
+ * know default locations for the
+ * current operating system.
* - <kbd>boolean debug</kbd> - whether or not to use debug mode.
* When debug mode is on, all
* communication to and from the GPG
@@ -457,24 +497,38 @@ class Crypt_GPG_Engine
* @throws PEAR_Exception if the provided <kbd>binary</kbd> is invalid, or
* if no <kbd>binary</kbd> is provided and no suitable binary could
* be found.
+ *
+ * @throws PEAR_Exception if the provided <kbd>agent</kbd> is invalid, or
+ * if no <kbd>agent</kbd> is provided and no suitable gpg-agent
+ * cound be found.
*/
public function __construct(array $options = array())
{
$this->_isDarwin = (strncmp(strtoupper(PHP_OS), 'DARWIN', 6) === 0);
- // populate mbstring overloading cache if not set
- if (self::$_mbStringOverload === null) {
- self::$_mbStringOverload = (extension_loaded('mbstring')
- && (ini_get('mbstring.func_overload') & 0x02) === 0x02);
- }
-
// get homedir
if (array_key_exists('homedir', $options)) {
$this->_homedir = (string)$options['homedir'];
} else {
- // note: this requires the package OS dep exclude 'windows'
- $info = posix_getpwuid(posix_getuid());
- $this->_homedir = $info['dir'].'/.gnupg';
+ if (extension_loaded('posix')) {
+ // note: this requires the package OS dep exclude 'windows'
+ $info = posix_getpwuid(posix_getuid());
+ $this->_homedir = $info['dir'].'/.gnupg';
+ } else {
+ if (isset($_SERVER['HOME'])) {
+ $this->_homedir = $_SERVER['HOME'];
+ } else {
+ $this->_homedir = getenv('HOME');
+ }
+ }
+
+ if ($this->_homedir === false) {
+ throw new Crypt_GPG_FileException(
+ 'Could not locate homedir. Please specify the homedir ' .
+ 'to use with the \'homedir\' option when instantiating ' .
+ 'the Crypt_GPG object.'
+ );
+ }
}
// attempt to create homedir if it does not exist
@@ -484,16 +538,40 @@ class Crypt_GPG_Engine
// with 0777, homedir is set to 0700.
chmod($this->_homedir, 0700);
} else {
- throw new Crypt_GPG_FileException('The \'homedir\' "' .
- $this->_homedir . '" is not readable or does not exist '.
- 'and cannot be created. This can happen if \'homedir\' '.
- 'is not specified in the Crypt_GPG options, Crypt_GPG is '.
- 'run as the web user, and the web user has no home '.
- 'directory.',
- 0, $this->_homedir);
+ throw new Crypt_GPG_FileException(
+ 'The \'homedir\' "' . $this->_homedir . '" is not ' .
+ 'readable or does not exist and cannot be created. This ' .
+ 'can happen if \'homedir\' is not specified in the ' .
+ 'Crypt_GPG options, Crypt_GPG is run as the web user, ' .
+ 'and the web user has no home directory.',
+ 0,
+ $this->_homedir
+ );
}
}
+ // check homedir permissions (See Bug #19833)
+ if (!is_executable($this->_homedir)) {
+ throw new Crypt_GPG_FileException(
+ 'The \'homedir\' "' . $this->_homedir . '" is not enterable ' .
+ 'by the current user. Please check the permissions on your ' .
+ 'homedir and make sure the current user can both enter and ' .
+ 'write to the directory.',
+ 0,
+ $this->_homedir
+ );
+ }
+ if (!is_writeable($this->_homedir)) {
+ throw new Crypt_GPG_FileException(
+ 'The \'homedir\' "' . $this->_homedir . '" is not writable ' .
+ 'by the current user. Please check the permissions on your ' .
+ 'homedir and make sure the current user can both enter and ' .
+ 'write to the directory.',
+ 0,
+ $this->_homedir
+ );
+ }
+
// get binary
if (array_key_exists('binary', $options)) {
$this->_binary = (string)$options['binary'];
@@ -505,9 +583,26 @@ class Crypt_GPG_Engine
}
if ($this->_binary == '' || !is_executable($this->_binary)) {
- throw new PEAR_Exception('GPG binary not found. If you are sure '.
- 'the GPG binary is installed, please specify the location of '.
- 'the GPG binary using the \'binary\' driver option.');
+ throw new PEAR_Exception(
+ 'GPG binary not found. If you are sure the GPG binary is ' .
+ 'installed, please specify the location of the GPG binary ' .
+ 'using the \'binary\' driver option.'
+ );
+ }
+
+ // get agent
+ if (array_key_exists('agent', $options)) {
+ $this->_agent = (string)$options['agent'];
+ } else {
+ $this->_agent = $this->_getAgent();
+ }
+
+ if ($this->_agent == '' || !is_executable($this->_agent)) {
+ throw new PEAR_Exception(
+ 'gpg-agent binary not found. If you are sure the gpg-agent ' .
+ 'is installed, please specify the location of the gpg-agent ' .
+ 'binary using the \'agent\' driver option.'
+ );
}
/*
@@ -891,7 +986,7 @@ class Crypt_GPG_Engine
}
$matches = array();
- $expression = '/gpg \(GnuPG\) (\S+)/';
+ $expression = '#gpg \(GnuPG[A-Za-z0-9/]*?\) (\S+)#';
if (preg_match($expression, $info, $matches) === 1) {
$this->_version = $matches[1];
@@ -1114,6 +1209,9 @@ class Crypt_GPG_Engine
$fdCommand = $this->_pipes[self::FD_COMMAND];
$fdMessage = $this->_pipes[self::FD_MESSAGE];
+ // select loop delay in milliseconds
+ $delay = 0;
+
while (true) {
$inputStreams = array();
@@ -1166,15 +1264,15 @@ class Crypt_GPG_Engine
$outputStreams[] = $this->_output;
}
- if ($this->_commandBuffer != '') {
+ if ($this->_commandBuffer != '' && is_resource($fdCommand)) {
$outputStreams[] = $fdCommand;
}
- if ($messageBuffer != '') {
+ if ($messageBuffer != '' && is_resource($fdMessage)) {
$outputStreams[] = $fdMessage;
}
- if ($inputBuffer != '') {
+ if ($inputBuffer != '' && is_resource($fdInput)) {
$outputStreams[] = $fdInput;
}
@@ -1209,33 +1307,41 @@ class Crypt_GPG_Engine
}
// write input (to GPG)
- if (in_array($fdInput, $outputStreams)) {
+ if (in_array($fdInput, $outputStreams, true)) {
$this->_debug('GPG is ready for input');
- $chunk = self::_byteSubstring(
+ $chunk = Crypt_GPG_ByteUtils::substr(
$inputBuffer,
0,
self::CHUNK_SIZE
);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$this->_debug(
'=> about to write ' . $length . ' bytes to GPG input'
);
$length = fwrite($fdInput, $chunk, $length);
-
- $this->_debug('=> wrote ' . $length . ' bytes');
-
- $inputBuffer = self::_byteSubstring(
- $inputBuffer,
- $length
- );
+ if ($length === 0) {
+ // If we wrote 0 bytes it was either EAGAIN or EPIPE. Since
+ // the pipe was seleted for writing, we assume it was EPIPE.
+ // There's no way to get the actual erorr code in PHP. See
+ // PHP Bug #39598. https://bugs.php.net/bug.php?id=39598
+ $this->_debug('=> broken pipe on GPG input');
+ $this->_debug('=> closing pipe GPG input');
+ $this->_closePipe(self::FD_INPUT);
+ } else {
+ $this->_debug('=> wrote ' . $length . ' bytes');
+ $inputBuffer = Crypt_GPG_ByteUtils::substr(
+ $inputBuffer,
+ $length
+ );
+ }
}
// read input (from PHP stream)
- if (in_array($this->_input, $inputStreams)) {
+ if (in_array($this->_input, $inputStreams, true)) {
$this->_debug('input stream is ready for reading');
$this->_debug(
'=> about to read ' . self::CHUNK_SIZE .
@@ -1243,36 +1349,48 @@ class Crypt_GPG_Engine
);
$chunk = fread($this->_input, self::CHUNK_SIZE);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$inputBuffer .= $chunk;
$this->_debug('=> read ' . $length . ' bytes');
}
// write message (to GPG)
- if (in_array($fdMessage, $outputStreams)) {
+ if (in_array($fdMessage, $outputStreams, true)) {
$this->_debug('GPG is ready for message data');
- $chunk = self::_byteSubstring(
+ $chunk = Crypt_GPG_ByteUtils::substr(
$messageBuffer,
0,
self::CHUNK_SIZE
);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$this->_debug(
'=> about to write ' . $length . ' bytes to GPG message'
);
$length = fwrite($fdMessage, $chunk, $length);
- $this->_debug('=> wrote ' . $length . ' bytes');
-
- $messageBuffer = self::_byteSubstring($messageBuffer, $length);
+ if ($length === 0) {
+ // If we wrote 0 bytes it was either EAGAIN or EPIPE. Since
+ // the pipe was seleted for writing, we assume it was EPIPE.
+ // There's no way to get the actual erorr code in PHP. See
+ // PHP Bug #39598. https://bugs.php.net/bug.php?id=39598
+ $this->_debug('=> broken pipe on GPG message');
+ $this->_debug('=> closing pipe GPG message');
+ $this->_closePipe(self::FD_MESSAGE);
+ } else {
+ $this->_debug('=> wrote ' . $length . ' bytes');
+ $messageBuffer = Crypt_GPG_ByteUtils::substr(
+ $messageBuffer,
+ $length
+ );
+ }
}
// read message (from PHP stream)
- if (in_array($this->_message, $inputStreams)) {
+ if (in_array($this->_message, $inputStreams, true)) {
$this->_debug('message stream is ready for reading');
$this->_debug(
'=> about to read ' . self::CHUNK_SIZE .
@@ -1280,14 +1398,14 @@ class Crypt_GPG_Engine
);
$chunk = fread($this->_message, self::CHUNK_SIZE);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$messageBuffer .= $chunk;
$this->_debug('=> read ' . $length . ' bytes');
}
// read output (from GPG)
- if (in_array($fdOutput, $inputStreams)) {
+ if (in_array($fdOutput, $inputStreams, true)) {
$this->_debug('GPG output stream ready for reading');
$this->_debug(
'=> about to read ' . self::CHUNK_SIZE .
@@ -1295,23 +1413,23 @@ class Crypt_GPG_Engine
);
$chunk = fread($fdOutput, self::CHUNK_SIZE);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$outputBuffer .= $chunk;
$this->_debug('=> read ' . $length . ' bytes');
}
// write output (to PHP stream)
- if (in_array($this->_output, $outputStreams)) {
+ if (in_array($this->_output, $outputStreams, true)) {
$this->_debug('output stream is ready for data');
- $chunk = self::_byteSubstring(
+ $chunk = Crypt_GPG_ByteUtils::substr(
$outputBuffer,
0,
self::CHUNK_SIZE
);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$this->_debug(
'=> about to write ' . $length . ' bytes to output stream'
@@ -1321,11 +1439,14 @@ class Crypt_GPG_Engine
$this->_debug('=> wrote ' . $length . ' bytes');
- $outputBuffer = self::_byteSubstring($outputBuffer, $length);
+ $outputBuffer = Crypt_GPG_ByteUtils::substr(
+ $outputBuffer,
+ $length
+ );
}
// read error (from GPG)
- if (in_array($fdError, $inputStreams)) {
+ if (in_array($fdError, $inputStreams, true)) {
$this->_debug('GPG error stream ready for reading');
$this->_debug(
'=> about to read ' . self::CHUNK_SIZE .
@@ -1333,14 +1454,14 @@ class Crypt_GPG_Engine
);
$chunk = fread($fdError, self::CHUNK_SIZE);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$errorBuffer .= $chunk;
$this->_debug('=> read ' . $length . ' bytes');
// pass lines to error handlers
while (($pos = strpos($errorBuffer, PHP_EOL)) !== false) {
- $line = self::_byteSubstring($errorBuffer, 0, $pos);
+ $line = Crypt_GPG_ByteUtils::substr($errorBuffer, 0, $pos);
foreach ($this->_errorHandlers as $handler) {
array_unshift($handler['args'], $line);
call_user_func_array(
@@ -1350,15 +1471,15 @@ class Crypt_GPG_Engine
array_shift($handler['args']);
}
- $errorBuffer = self::_byteSubString(
+ $errorBuffer = Crypt_GPG_ByteUtils::substr(
$errorBuffer,
- $pos + self::_byteLength(PHP_EOL)
+ $pos + Crypt_GPG_ByteUtils::strlen(PHP_EOL)
);
}
}
// read status (from GPG)
- if (in_array($fdStatus, $inputStreams)) {
+ if (in_array($fdStatus, $inputStreams, true)) {
$this->_debug('GPG status stream ready for reading');
$this->_debug(
'=> about to read ' . self::CHUNK_SIZE .
@@ -1366,17 +1487,17 @@ class Crypt_GPG_Engine
);
$chunk = fread($fdStatus, self::CHUNK_SIZE);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$statusBuffer .= $chunk;
$this->_debug('=> read ' . $length . ' bytes');
// pass lines to status handlers
while (($pos = strpos($statusBuffer, PHP_EOL)) !== false) {
- $line = self::_byteSubstring($statusBuffer, 0, $pos);
+ $line = Crypt_GPG_ByteUtils::substr($statusBuffer, 0, $pos);
// only pass lines beginning with magic prefix
- if (self::_byteSubstring($line, 0, 9) == '[GNUPG:] ') {
- $line = self::_byteSubstring($line, 9);
+ if (Crypt_GPG_ByteUtils::substr($line, 0, 9) == '[GNUPG:] ') {
+ $line = Crypt_GPG_ByteUtils::substr($line, 9);
foreach ($this->_statusHandlers as $handler) {
array_unshift($handler['args'], $line);
call_user_func_array(
@@ -1387,38 +1508,60 @@ class Crypt_GPG_Engine
array_shift($handler['args']);
}
}
- $statusBuffer = self::_byteSubString(
+ $statusBuffer = Crypt_GPG_ByteUtils::substr(
$statusBuffer,
- $pos + self::_byteLength(PHP_EOL)
+ $pos + Crypt_GPG_ByteUtils::strlen(PHP_EOL)
);
}
}
// write command (to GPG)
- if (in_array($fdCommand, $outputStreams)) {
+ if (in_array($fdCommand, $outputStreams, true)) {
$this->_debug('GPG is ready for command data');
// send commands
- $chunk = self::_byteSubstring(
+ $chunk = Crypt_GPG_ByteUtils::substr(
$this->_commandBuffer,
0,
self::CHUNK_SIZE
);
- $length = self::_byteLength($chunk);
+ $length = Crypt_GPG_ByteUtils::strlen($chunk);
$this->_debug(
'=> about to write ' . $length . ' bytes to GPG command'
);
$length = fwrite($fdCommand, $chunk, $length);
+ if ($length === 0) {
+ // If we wrote 0 bytes it was either EAGAIN or EPIPE. Since
+ // the pipe was seleted for writing, we assume it was EPIPE.
+ // There's no way to get the actual erorr code in PHP. See
+ // PHP Bug #39598. https://bugs.php.net/bug.php?id=39598
+ $this->_debug('=> broken pipe on GPG command');
+ $this->_debug('=> closing pipe GPG command');
+ $this->_closePipe(self::FD_COMMAND);
+ } else {
+ $this->_debug('=> wrote ' . $length);
+ $this->_commandBuffer = Crypt_GPG_ByteUtils::substr(
+ $this->_commandBuffer,
+ $length
+ );
+ }
+ }
- $this->_debug('=> wrote ' . $length);
+ if (count($outputStreams) === 0 || count($inputStreams) === 0) {
+ // we have an I/O imbalance, increase the select loop delay
+ // to smooth things out
+ $delay += 10;
+ } else {
+ // things are running smoothly, decrease the delay
+ $delay -= 8;
+ $delay = max(0, $delay);
+ }
- $this->_commandBuffer = self::_byteSubstring(
- $this->_commandBuffer,
- $length
- );
+ if ($delay > 0) {
+ usleep($delay);
}
} // end loop while streams are open
@@ -1449,12 +1592,83 @@ class Crypt_GPG_Engine
{
$version = $this->getVersion();
+ // Binary operations will not work on Windows with PHP < 5.2.6. This is
+ // in case stream_select() ever works on Windows.
+ $rb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'r' : 'rb';
+ $wb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'w' : 'wb';
+
$env = $_ENV;
// Newer versions of GnuPG return localized results. Crypt_GPG only
// works with English, so set the locale to 'C' for the subprocess.
$env['LC_ALL'] = 'C';
+ // If using GnuPG 2.x start the gpg-agent
+ if (version_compare($version, '2.0.0', 'ge')) {
+ $agentCommandLine = $this->_agent;
+
+ $agentArguments = array(
+ '--options /dev/null', // ignore any saved options
+ '--csh', // output is easier to parse
+ '--keep-display', // prevent passing --display to pinentry
+ '--no-grab',
+ '--ignore-cache-for-signing',
+ '--pinentry-touch-file /dev/null',
+ '--disable-scdaemon',
+ '--no-use-standard-socket',
+ '--pinentry-program ' . escapeshellarg($this->_getPinEntry())
+ );
+
+ if ($this->_homedir) {
+ $agentArguments[] = '--homedir ' .
+ escapeshellarg($this->_homedir);
+ }
+
+
+ $agentCommandLine .= ' ' . implode(' ', $agentArguments)
+ . ' --daemon';
+
+ $agentDescriptorSpec = array(
+ self::FD_INPUT => array('pipe', $rb), // stdin
+ self::FD_OUTPUT => array('pipe', $wb), // stdout
+ self::FD_ERROR => array('pipe', $wb) // stderr
+ );
+
+ $this->_debug('OPENING GPG-AGENT SUBPROCESS WITH THE FOLLOWING COMMAND:');
+ $this->_debug($agentCommandLine);
+
+ $this->_agentProcess = proc_open(
+ $agentCommandLine,
+ $agentDescriptorSpec,
+ $this->_agentPipes,
+ null,
+ $env,
+ array('binary_pipes' => true)
+ );
+
+ if (!is_resource($this->_agentProcess)) {
+ throw new Crypt_GPG_OpenSubprocessException(
+ 'Unable to open gpg-agent subprocess.',
+ 0,
+ $agentCommandLine
+ );
+ }
+
+ // Get GPG_AGENT_INFO and set environment variable for gpg process.
+ // This is a blocking read, but is only 1 line.
+ $agentInfo = fread(
+ $this->_agentPipes[self::FD_OUTPUT],
+ self::CHUNK_SIZE
+ );
+
+ $agentInfo = explode(' ', $agentInfo, 3);
+ $this->_agentInfo = $agentInfo[2];
+ $env['GPG_AGENT_INFO'] = $this->_agentInfo;
+
+ // gpg-agent daemon is started, we can close the launching process
+ $this->_closeAgentLaunchProcess();
+ }
+
$commandLine = $this->_binary;
$defaultArguments = array(
@@ -1511,11 +1725,6 @@ class Crypt_GPG_Engine
$commandLine .= ' ' . implode(' ', $arguments) . ' ' .
$this->_operation;
- // Binary operations will not work on Windows with PHP < 5.2.6. This is
- // in case stream_select() ever works on Windows.
- $rb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'r' : 'rb';
- $wb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'w' : 'wb';
-
$descriptorSpec = array(
self::FD_INPUT => array('pipe', $rb), // stdin
self::FD_OUTPUT => array('pipe', $wb), // stdout
@@ -1525,7 +1734,7 @@ class Crypt_GPG_Engine
self::FD_MESSAGE => array('pipe', $rb) // message
);
- $this->_debug('OPENING SUBPROCESS WITH THE FOLLOWING COMMAND:');
+ $this->_debug('OPENING GPG SUBPROCESS WITH THE FOLLOWING COMMAND:');
$this->_debug($commandLine);
$this->_process = proc_open(
@@ -1542,6 +1751,11 @@ class Crypt_GPG_Engine
'Unable to open GPG subprocess.', 0, $commandLine);
}
+ // Set streams as non-blocking. See Bug #18618.
+ foreach ($this->_pipes as $pipe) {
+ stream_set_blocking($pipe, 0);
+ }
+
$this->_openPipes = $this->_pipes;
$this->_errorCode = Crypt_GPG::ERROR_NONE;
}
@@ -1562,8 +1776,11 @@ class Crypt_GPG_Engine
*/
private function _closeSubprocess()
{
+ // clear PINs from environment if they were set
+ $_ENV['PINENTRY_USER_DATA'] = null;
+
if (is_resource($this->_process)) {
- $this->_debug('CLOSING SUBPROCESS');
+ $this->_debug('CLOSING GPG SUBPROCESS');
// close remaining open pipes
foreach (array_keys($this->_openPipes) as $pipeNumber) {
@@ -1590,9 +1807,55 @@ class Crypt_GPG_Engine
$this->_process = null;
$this->_pipes = array();
}
+
+ $this->_closeAgentLaunchProcess();
+
+ if ($this->_agentInfo !== null) {
+ $this->_debug('STOPPING GPG-AGENT DAEMON');
+
+ $parts = explode(':', $this->_agentInfo, 3);
+ $pid = $parts[1];
+ $process = new Crypt_GPG_ProcessControl($pid);
+
+ // terminate agent daemon
+ $process->terminate();
+
+ while ($process->isRunning()) {
+ usleep(10000); // 10 ms
+ $process->terminate();
+ }
+
+ $this->_agentInfo = null;
+
+ $this->_debug('GPG-AGENT DAEMON STOPPED');
+ }
}
// }}}
+ // {{ _closeAgentLaunchProcess()
+
+ private function _closeAgentLaunchProcess()
+ {
+ if (is_resource($this->_agentProcess)) {
+ $this->_debug('CLOSING GPG-AGENT LAUNCH PROCESS');
+
+ // close agent pipes
+ foreach ($this->_agentPipes as $pipe) {
+ fflush($pipe);
+ fclose($pipe);
+ }
+
+ // close agent launching process
+ proc_close($this->_agentProcess);
+
+ $this->_agentProcess = null;
+ $this->_agentPipes = array();
+
+ $this->_debug('GPG-AGENT LAUNCH PROCESS CLOSED');
+ }
+ }
+
+ // }}
// {{{ _closePipe()
/**
@@ -1658,6 +1921,55 @@ class Crypt_GPG_Engine
}
// }}}
+ // {{ _getAgent()
+
+ private function _getAgent()
+ {
+ $agent = '';
+
+ if ($this->_isDarwin) {
+ $agentFiles = array(
+ '/opt/local/bin/gpg-agent', // MacPorts
+ '/usr/local/bin/gpg-agent', // Mac GPG
+ '/sw/bin/gpg-agent', // Fink
+ '/usr/bin/gpg-agent'
+ );
+ } else {
+ $agentFiles = array(
+ '/usr/bin/gpg-agent',
+ '/usr/local/bin/gpg-agent'
+ );
+ }
+
+ foreach ($agentFiles as $agentFile) {
+ if (is_executable($agentFile)) {
+ $agent = $agentFile;
+ break;
+ }
+ }
+
+ return $agent;
+ }
+
+ // }}
+ // {{ _getPinEntry()
+
+ private function _getPinEntry()
+ {
+ // Check if we're running directly from git or if we're using a
+ // PEAR-packaged version
+ $pinEntry = '@bin-dir@' . DIRECTORY_SEPARATOR . 'crypt-gpg-pinentry';
+
+ if ($pinEntry[0] === '@') {
+ $pinEntry = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
+ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'scripts'
+ . DIRECTORY_SEPARATOR . 'crypt-gpg-pinentry';
+ }
+
+ return $pinEntry;
+ }
+
+ // }}
// {{{ _debug()
/**
@@ -1672,7 +1984,7 @@ class Crypt_GPG_Engine
private function _debug($text)
{
if ($this->_debug) {
- if (array_key_exists('SHELL', $_ENV)) {
+ if (php_sapi_name() === 'cli') {
foreach (explode(PHP_EOL, $text) as $line) {
echo "Crypt_GPG DEBUG: ", $line, PHP_EOL;
}
@@ -1687,70 +1999,6 @@ class Crypt_GPG_Engine
}
// }}}
- // {{{ _byteLength()
-
- /**
- * Gets the length of a string in bytes even if mbstring function
- * overloading is turned on
- *
- * This is used for stream-based communication with the GPG subprocess.
- *
- * @param string $string the string for which to get the length.
- *
- * @return integer the length of the string in bytes.
- *
- * @see Crypt_GPG_Engine::$_mbStringOverload
- */
- private static function _byteLength($string)
- {
- if (self::$_mbStringOverload) {
- return mb_strlen($string, '8bit');
- }
-
- return strlen((binary)$string);
- }
-
- // }}}
- // {{{ _byteSubstring()
-
- /**
- * Gets the substring of a string in bytes even if mbstring function
- * overloading is turned on
- *
- * This is used for stream-based communication with the GPG subprocess.
- *
- * @param string $string the input string.
- * @param integer $start the starting point at which to get the substring.
- * @param integer $length optional. The length of the substring.
- *
- * @return string the extracted part of the string. Unlike the default PHP
- * <kbd>substr()</kbd> function, the returned value is
- * always a string and never false.
- *
- * @see Crypt_GPG_Engine::$_mbStringOverload
- */
- private static function _byteSubstring($string, $start, $length = null)
- {
- if (self::$_mbStringOverload) {
- if ($length === null) {
- return mb_substr(
- $string,
- $start,
- self::_byteLength($string) - $start, '8bit'
- );
- }
-
- return mb_substr($string, $start, $length, '8bit');
- }
-
- if ($length === null) {
- return (string)substr((binary)$string, $start);
- }
-
- return (string)substr((binary)$string, $start, $length);
- }
-
- // }}}
}
// }}}
diff --git a/program/lib/Crypt/GPG/Exceptions.php b/program/lib/Crypt/GPG/Exceptions.php
index 744acf5d4..0ca917db6 100644
--- a/program/lib/Crypt/GPG/Exceptions.php
+++ b/program/lib/Crypt/GPG/Exceptions.php
@@ -32,9 +32,9 @@
* @package Crypt_GPG
* @author Nathan Fredrickson <nathan@silverorange.com>
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2005 silverorange
+ * @copyright 2005-2011 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: Exceptions.php 273745 2009-01-18 05:24:25Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
*/
@@ -469,5 +469,130 @@ class Crypt_GPG_DeletePrivateKeyException extends Crypt_GPG_Exception
}
// }}}
+// {{{ class Crypt_GPG_KeyNotCreatedException
+
+/**
+ * An exception thrown when an attempt is made to generate a key and the
+ * attempt fails
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2011 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ */
+class Crypt_GPG_KeyNotCreatedException extends Crypt_GPG_Exception
+{
+}
+
+// }}}
+// {{{ class Crypt_GPG_InvalidKeyParamsException
+
+/**
+ * An exception thrown when an attempt is made to generate a key and the
+ * key parameters set on the key generator are invalid
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2011 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ */
+class Crypt_GPG_InvalidKeyParamsException extends Crypt_GPG_Exception
+{
+ // {{{ private class properties
+
+ /**
+ * The key algorithm
+ *
+ * @var integer
+ */
+ private $_algorithm = 0;
+
+ /**
+ * The key size
+ *
+ * @var integer
+ */
+ private $_size = 0;
+
+ /**
+ * The key usage
+ *
+ * @var integer
+ */
+ private $_usage = 0;
+
+ // }}}
+ // {{{ __construct()
+
+ /**
+ * Creates a new Crypt_GPG_InvalidKeyParamsException
+ *
+ * @param string $message an error message.
+ * @param integer $code a user defined error code.
+ * @param string $algorithm the key algorithm.
+ * @param string $size the key size.
+ * @param string $usage the key usage.
+ */
+ public function __construct(
+ $message,
+ $code = 0,
+ $algorithm = 0,
+ $size = 0,
+ $usage = 0
+ ) {
+ parent::__construct($message, $code);
+
+ $this->_algorithm = $algorithm;
+ $this->_size = $size;
+ $this->_usage = $usage;
+ }
+
+ // }}}
+ // {{{ getAlgorithm()
+
+ /**
+ * Gets the key algorithm
+ *
+ * @return integer the key algorithm.
+ */
+ public function getAlgorithm()
+ {
+ return $this->_algorithm;
+ }
+
+ // }}}
+ // {{{ getSize()
+
+ /**
+ * Gets the key size
+ *
+ * @return integer the key size.
+ */
+ public function getSize()
+ {
+ return $this->_size;
+ }
+
+ // }}}
+ // {{{ getUsage()
+
+ /**
+ * Gets the key usage
+ *
+ * @return integer the key usage.
+ */
+ public function getUsage()
+ {
+ return $this->_usage;
+ }
+
+ // }}}
+}
+
+// }}}
?>
diff --git a/program/lib/Crypt/GPG/Key.php b/program/lib/Crypt/GPG/Key.php
index 67a4b9c7d..6ecb538bc 100644
--- a/program/lib/Crypt/GPG/Key.php
+++ b/program/lib/Crypt/GPG/Key.php
@@ -28,7 +28,7 @@
* @author Michael Gauthier <mike@silverorange.com>
* @copyright 2008-2010 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: Key.php 295621 2010-03-01 04:18:54Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
*/
diff --git a/program/lib/Crypt/GPG/KeyGenerator.php b/program/lib/Crypt/GPG/KeyGenerator.php
new file mode 100644
index 000000000..f59c0ee3a
--- /dev/null
+++ b/program/lib/Crypt/GPG/KeyGenerator.php
@@ -0,0 +1,790 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Crypt_GPG is a package to use GPG from PHP
+ *
+ * This file contains an object that handles GnuPG key generation.
+ *
+ * PHP version 5
+ *
+ * LICENSE:
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2011-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @version CVS: $Id:$
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://www.gnupg.org/
+ */
+
+/**
+ * Base class for GPG methods
+ */
+require_once 'Crypt/GPGAbstract.php';
+
+/**
+ * Status output handler for key generation
+ */
+require_once 'Crypt/GPG/KeyGeneratorStatusHandler.php';
+
+/**
+ * Error output handler for key generation
+ */
+require_once 'Crypt/GPG/KeyGeneratorErrorHandler.php';
+
+// {{{ class Crypt_GPG_KeyGenerator
+
+/**
+ * GnuPG key generator
+ *
+ * This class provides an object oriented interface for generating keys with
+ * the GNU Privacy Guard (GPG).
+ *
+ * Secure key generation requires true random numbers, and as such can be slow.
+ * If the operating system runs out of entropy, key generation will block until
+ * more entropy is available.
+ *
+ * If quick key generation is important, a hardware entropy generator, or an
+ * entropy gathering daemon may be installed. For example, administrators of
+ * Debian systems may want to install the 'randomsound' package.
+ *
+ * This class uses the experimental automated key generation support available
+ * in GnuPG. See <b>doc/DETAILS</b> in the
+ * {@link http://www.gnupg.org/download/ GPG distribution} for detailed
+ * information on the key generation format.
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Nathan Fredrickson <nathan@silverorange.com>
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2005-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://www.gnupg.org/
+ */
+class Crypt_GPG_KeyGenerator extends Crypt_GPGAbstract
+{
+ // {{{ protected properties
+
+ /**
+ * The expiration date of generated keys
+ *
+ * @var integer
+ *
+ * @see Crypt_GPG_KeyGenerator::setExpirationDate()
+ */
+ protected $expirationDate = 0;
+
+ /**
+ * The passphrase of generated keys
+ *
+ * @var string
+ *
+ * @see Crypt_GPG_KeyGenerator::setPassphrase()
+ */
+ protected $passphrase = '';
+
+ /**
+ * The algorithm for generated primary keys
+ *
+ * @var integer
+ *
+ * @see Crypt_GPG_KeyGenerator::setKeyParams()
+ */
+ protected $keyAlgorithm = Crypt_GPG_SubKey::ALGORITHM_DSA;
+
+ /**
+ * The size of generated primary keys
+ *
+ * @var integer
+ *
+ * @see Crypt_GPG_KeyGenerator::setKeyParams()
+ */
+ protected $keySize = 1024;
+
+ /**
+ * The usages of generated primary keys
+ *
+ * This is a bitwise combination of the usage constants in
+ * {@link Crypt_GPG_SubKey}.
+ *
+ * @var integer
+ *
+ * @see Crypt_GPG_KeyGenerator::setKeyParams()
+ */
+ protected $keyUsage = 6; // USAGE_SIGN | USAGE_CERTIFY
+
+ /**
+ * The algorithm for generated sub-keys
+ *
+ * @var integer
+ *
+ * @see Crypt_GPG_KeyGenerator::setSubKeyParams()
+ */
+ protected $subKeyAlgorithm = Crypt_GPG_SubKey::ALGORITHM_ELGAMAL_ENC;
+
+ /**
+ * The size of generated sub-keys
+ *
+ * @var integer
+ *
+ * @see Crypt_GPG_KeyGenerator::setSubKeyParams()
+ */
+ protected $subKeySize = 2048;
+
+ /**
+ * The usages of generated sub-keys
+ *
+ * This is a bitwise combination of the usage constants in
+ * {@link Crypt_GPG_SubKey}.
+ *
+ * @var integer
+ *
+ * @see Crypt_GPG_KeyGenerator::setSubKeyParams()
+ */
+ protected $subKeyUsage = Crypt_GPG_SubKey::USAGE_ENCRYPT;
+
+ /**
+ * The GnuPG status handler to use for key generation
+ *
+ * @var Crypt_GPG_KeyGeneratorStatusHandler
+ *
+ * @see Crypt_GPG_KeyGenerator::setStatusHandler()
+ */
+ protected $statusHandler = null;
+
+ /**
+ * The GnuPG error handler to use for key generation
+ *
+ * @var Crypt_GPG_KeyGeneratorErrorHandler
+ *
+ * @see Crypt_GPG_KeyGenerator::setErrorHandler()
+ */
+ protected $errorHandler = null;
+
+ // }}}
+ // {{{ __construct()
+
+ /**
+ * Creates a new GnuPG key generator
+ *
+ * Available options are:
+ *
+ * - <kbd>string homedir</kbd> - the directory where the GPG
+ * keyring files are stored. If not
+ * specified, Crypt_GPG uses the
+ * default of <kbd>~/.gnupg</kbd>.
+ * - <kbd>string publicKeyring</kbd> - the file path of the public
+ * keyring. Use this if the public
+ * keyring is not in the homedir, or
+ * if the keyring is in a directory
+ * not writable by the process
+ * invoking GPG (like Apache). Then
+ * you can specify the path to the
+ * keyring with this option
+ * (/foo/bar/pubring.gpg), and specify
+ * a writable directory (like /tmp)
+ * using the <i>homedir</i> option.
+ * - <kbd>string privateKeyring</kbd> - the file path of the private
+ * keyring. Use this if the private
+ * keyring is not in the homedir, or
+ * if the keyring is in a directory
+ * not writable by the process
+ * invoking GPG (like Apache). Then
+ * you can specify the path to the
+ * keyring with this option
+ * (/foo/bar/secring.gpg), and specify
+ * a writable directory (like /tmp)
+ * using the <i>homedir</i> option.
+ * - <kbd>string trustDb</kbd> - the file path of the web-of-trust
+ * database. Use this if the trust
+ * database is not in the homedir, or
+ * if the database is in a directory
+ * not writable by the process
+ * invoking GPG (like Apache). Then
+ * you can specify the path to the
+ * trust database with this option
+ * (/foo/bar/trustdb.gpg), and specify
+ * a writable directory (like /tmp)
+ * using the <i>homedir</i> option.
+ * - <kbd>string binary</kbd> - the location of the GPG binary. If
+ * not specified, the driver attempts
+ * to auto-detect the GPG binary
+ * location using a list of known
+ * default locations for the current
+ * operating system. The option
+ * <kbd>gpgBinary</kbd> is a
+ * deprecated alias for this option.
+ * - <kbd>string agent</kbd> - the location of the GnuPG agent
+ * binary. The gpg-agent is only
+ * used for GnuPG 2.x. If not
+ * specified, the engine attempts
+ * to auto-detect the gpg-agent
+ * binary location using a list of
+ * know default locations for the
+ * current operating system.
+ * - <kbd>boolean debug</kbd> - whether or not to use debug mode.
+ * When debug mode is on, all
+ * communication to and from the GPG
+ * subprocess is logged. This can be
+ *
+ * @param array $options optional. An array of options used to create the
+ * GPG object. All options are optional and are
+ * represented as key-value pairs.
+ *
+ * @throws Crypt_GPG_FileException if the <kbd>homedir</kbd> does not exist
+ * and cannot be created. This can happen if <kbd>homedir</kbd> is
+ * not specified, Crypt_GPG is run as the web user, and the web
+ * user has no home directory. This exception is also thrown if any
+ * of the options <kbd>publicKeyring</kbd>,
+ * <kbd>privateKeyring</kbd> or <kbd>trustDb</kbd> options are
+ * specified but the files do not exist or are are not readable.
+ * This can happen if the user running the Crypt_GPG process (for
+ * example, the Apache user) does not have permission to read the
+ * files.
+ *
+ * @throws PEAR_Exception if the provided <kbd>binary</kbd> is invalid, or
+ * if no <kbd>binary</kbd> is provided and no suitable binary could
+ * be found.
+ *
+ * @throws PEAR_Exception if the provided <kbd>agent</kbd> is invalid, or
+ * if no <kbd>agent</kbd> is provided and no suitable gpg-agent
+ * cound be found.
+ */
+ public function __construct(array $options = array())
+ {
+ parent::__construct($options);
+
+ $this->statusHandler = new Crypt_GPG_KeyGeneratorStatusHandler();
+ $this->errorHandler = new Crypt_GPG_KeyGeneratorErrorHandler();
+ }
+
+ // }}}
+ // {{{ setExpirationDate()
+
+ /**
+ * Sets the expiration date of generated keys
+ *
+ * @param string|integer $date either a string that may be parsed by
+ * PHP's strtotime() function, or an integer
+ * timestamp representing the number of seconds
+ * since the UNIX epoch. This date must be at
+ * least one date in the future. Keys that
+ * expire in the past may not be generated. Use
+ * an expiration date of 0 for keys that do not
+ * expire.
+ *
+ * @throws InvalidArgumentException if the date is not a valid format, or
+ * if the date is not at least one day in
+ * the future, or if the date is greater
+ * than 2038-01-19T03:14:07.
+ *
+ * @return Crypt_GPG_KeyGenerator the current object, for fluent interface.
+ */
+ public function setExpirationDate($date)
+ {
+ if (is_int($date) || ctype_digit(strval($date))) {
+ $expirationDate = intval($date);
+ } else {
+ $expirationDate = strtotime($date);
+ }
+
+ if ($expirationDate === false) {
+ throw new InvalidArgumentException(
+ sprintf(
+ 'Invalid expiration date format: "%s". Please use a ' .
+ 'format compatible with PHP\'s strtotime().',
+ $date
+ )
+ );
+ }
+
+ if ($expirationDate !== 0 && $expirationDate < time() + 86400) {
+ throw new InvalidArgumentException(
+ 'Expiration date must be at least a day in the future.'
+ );
+ }
+
+ // GnuPG suffers from the 2038 bug
+ if ($expirationDate > 2147483647) {
+ throw new InvalidArgumentException(
+ 'Expiration date must not be greater than 2038-01-19T03:14:07.'
+ );
+ }
+
+ $this->expirationDate = $expirationDate;
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ setPassphrase()
+
+ /**
+ * Sets the passphrase of generated keys
+ *
+ * @param string $passphrase the passphrase to use for generated keys. Use
+ * null or an empty string for no passphrase.
+ *
+ * @return Crypt_GPG_KeyGenerator the current object, for fluent interface.
+ */
+ public function setPassphrase($passphrase)
+ {
+ $this->passphrase = strval($passphrase);
+ return $this;
+ }
+
+ // }}}
+ // {{{ setKeyParams()
+
+ /**
+ * Sets the parameters for the primary key of generated key-pairs
+ *
+ * @param integer $algorithm the algorithm used by the key. This should be
+ * one of the Crypt_GPG_SubKey::ALGORITHM_*
+ * constants.
+ * @param integer $size optional. The size of the key. Different
+ * algorithms have different size requirements.
+ * If not specified, the default size for the
+ * specified algorithm will be used. If an
+ * invalid key size is used, GnuPG will do its
+ * best to round it to a valid size.
+ * @param integer $usage optional. A bitwise combination of key usages.
+ * If not specified, the primary key will be used
+ * only to sign and certify. This is the default
+ * behavior of GnuPG in interactive mode. Use
+ * the Crypt_GPG_SubKey::USAGE_* constants here.
+ * The primary key may be used to certify even
+ * if the certify usage is not specified.
+ *
+ * @return Crypt_GPG_KeyGenerator the current object, for fluent interface.
+ */
+ public function setKeyParams($algorithm, $size = 0, $usage = 0)
+ {
+ $apgorithm = intval($algorithm);
+
+ if ($algorithm === Crypt_GPG_SubKey::ALGORITHM_ELGAMAL_ENC) {
+ throw new Crypt_GPG_InvalidKeyParamsException(
+ 'Primary key algorithm must be capable of signing. The ' .
+ 'Elgamal algorithm can only encrypt.',
+ 0,
+ $algorithm,
+ $size,
+ $usage
+ );
+ }
+
+ if ($size != 0) {
+ $size = intval($size);
+ }
+
+ if ($usage != 0) {
+ $usage = intval($usage);
+ }
+
+ $usageEncrypt = Crypt_GPG_SubKey::USAGE_ENCRYPT;
+
+ if ( $algorithm === Crypt_GPG_SubKey::ALGORITHM_DSA
+ && ($usage & $usageEncrypt) === $usageEncrypt
+ ) {
+ throw new Crypt_GPG_InvalidKeyParamsException(
+ 'The DSA algorithm is not capable of encrypting. Please ' .
+ 'specify a different algorithm or do not include encryption ' .
+ 'as a usage for the primary key.',
+ 0,
+ $algorithm,
+ $size,
+ $usage
+ );
+ }
+
+ $this->keyAlgorithm = $algorithm;
+
+ if ($size != 0) {
+ $this->keySize = $size;
+ }
+
+ if ($usage != 0) {
+ $this->keyUsage = $usage;
+ }
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ setSubKeyParams()
+
+ /**
+ * Sets the parameters for the sub-key of generated key-pairs
+ *
+ * @param integer $algorithm the algorithm used by the key. This should be
+ * one of the Crypt_GPG_SubKey::ALGORITHM_*
+ * constants.
+ * @param integer $size optional. The size of the key. Different
+ * algorithms have different size requirements.
+ * If not specified, the default size for the
+ * specified algorithm will be used. If an
+ * invalid key size is used, GnuPG will do its
+ * best to round it to a valid size.
+ * @param integer $usage optional. A bitwise combination of key usages.
+ * If not specified, the sub-key will be used
+ * only to encrypt. This is the default behavior
+ * of GnuPG in interactive mode. Use the
+ * Crypt_GPG_SubKey::USAGE_* constants here.
+ *
+ * @return Crypt_GPG_KeyGenerator the current object, for fluent interface.
+ */
+ public function setSubKeyParams($algorithm, $size = '', $usage = 0)
+ {
+ $apgorithm = intval($algorithm);
+
+ if ($size != 0) {
+ $size = intval($size);
+ }
+
+ if ($usage != 0) {
+ $usage = intval($usage);
+ }
+
+ $usageSign = Crypt_GPG_SubKey::USAGE_SIGN;
+
+ if ( $algorithm === Crypt_GPG_SubKey::ALGORITHM_ELGAMAL_ENC
+ && ($usage & $usageSign) === $usageSign
+ ) {
+ throw new Crypt_GPG_InvalidKeyParamsException(
+ 'The Elgamal algorithm is not capable of signing. Please ' .
+ 'specify a different algorithm or do not include signing ' .
+ 'as a usage for the sub-key.',
+ 0,
+ $algorithm,
+ $size,
+ $usage
+ );
+ }
+
+ $usageEncrypt = Crypt_GPG_SubKey::USAGE_ENCRYPT;
+
+ if ( $algorithm === Crypt_GPG_SubKey::ALGORITHM_DSA
+ && ($usage & $usageEncrypt) === $usageEncrypt
+ ) {
+ throw new Crypt_GPG_InvalidKeyParamsException(
+ 'The DSA algorithm is not capable of encrypting. Please ' .
+ 'specify a different algorithm or do not include encryption ' .
+ 'as a usage for the sub-key.',
+ 0,
+ $algorithm,
+ $size,
+ $usage
+ );
+ }
+
+ $this->subKeyAlgorithm = $algorithm;
+
+ if ($size != 0) {
+ $this->subKeySize = $size;
+ }
+
+ if ($usage != 0) {
+ $this->subKeyUsage = $usage;
+ }
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ setStatusHandler()
+
+ /**
+ * Sets the status handler to use for key generation
+ *
+ * Normally this method does not need to be used. It provides a means for
+ * dependency injection.
+ *
+ * @param Crypt_GPG_KeyStatusHandler $handler the key status handler to
+ * use.
+ *
+ * @return Crypt_GPG_KeyGenerator the current object, for fluent interface.
+ */
+ public function setStatusHandler(
+ Crypt_GPG_KeyGeneratorStatusHandler $handler
+ ) {
+ $this->statusHandler = $handler;
+ return $this;
+ }
+
+ // }}}
+ // {{{ setErrorHandler()
+
+ /**
+ * Sets the error handler to use for key generation
+ *
+ * Normally this method does not need to be used. It provides a means for
+ * dependency injection.
+ *
+ * @param Crypt_GPG_KeyErrorHandler $handler the key error handler to
+ * use.
+ *
+ * @return Crypt_GPG_KeyGenerator the current object, for fluent interface.
+ */
+ public function setErrorHandler(
+ Crypt_GPG_KeyGeneratorErrorHandler $handler
+ ) {
+ $this->errorHandler = $handler;
+ return $this;
+ }
+
+ // }}}
+ // {{{ generateKey()
+
+ /**
+ * Generates a new key-pair in the current keyring
+ *
+ * Secure key generation requires true random numbers, and as such can be
+ * solw. If the operating system runs out of entropy, key generation will
+ * block until more entropy is available.
+ *
+ * If quick key generation is important, a hardware entropy generator, or
+ * an entropy gathering daemon may be installed. For example,
+ * administrators of Debian systems may want to install the 'randomsound'
+ * package.
+ *
+ * @param string|Crypt_GPG_UserId $name either a {@link Crypt_GPG_UserId}
+ * object, or a string containing
+ * the name of the user id.
+ * @param string $email optional. If <i>$name</i> is
+ * specified as a string, this is
+ * the email address of the user id.
+ * @param string $comment optional. If <i>$name</i> is
+ * specified as a string, this is
+ * the comment of the user id.
+ *
+ * @return Crypt_GPG_Key the newly generated key.
+ *
+ * @throws Crypt_GPG_KeyNotCreatedException if the key parameters are
+ * incorrect, if an unknown error occurs during key generation, or
+ * if the newly generated key is not found in the keyring.
+ *
+ * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs.
+ * Use the <kbd>debug</kbd> option and file a bug report if these
+ * exceptions occur.
+ */
+ public function generateKey($name, $email = '', $comment = '')
+ {
+ $handle = uniqid('key', true);
+
+ $userId = $this->getUserId($name, $email, $comment);
+
+ $keyParams = array(
+ 'Key-Type' => $this->keyAlgorithm,
+ 'Key-Length' => $this->keySize,
+ 'Key-Usage' => $this->getUsage($this->keyUsage),
+ 'Subkey-Type' => $this->subKeyAlgorithm,
+ 'Subkey-Length' => $this->subKeySize,
+ 'Subkey-Usage' => $this->getUsage($this->subKeyUsage),
+ 'Name-Real' => $userId->getName(),
+ 'Handle' => $handle,
+ );
+
+ if ($this->expirationDate != 0) {
+ // GnuPG only accepts granularity of days
+ $expirationDate = date('Y-m-d', $this->expirationDate);
+ $keyParams['Expire-Date'] = $expirationDate;
+ }
+
+ if ($this->passphrase != '') {
+ $keyParams['Passphrase'] = $this->passphrase;
+ }
+
+ if ($userId->getEmail() != '') {
+ $keyParams['Name-Email'] = $userId->getEmail();
+ }
+
+ if ($userId->getComment() != '') {
+ $keyParams['Name-Comment'] = $userId->getComment();
+ }
+
+
+ $keyParamsFormatted = array();
+ foreach ($keyParams as $name => $value) {
+ $keyParamsFormatted[] = $name . ': ' . $value;
+ }
+
+ $input = implode("\n", $keyParamsFormatted) . "\n%commit\n";
+
+ $statusHandler = clone $this->statusHandler;
+ $statusHandler->setHandle($handle);
+
+ $errorHandler = clone $this->errorHandler;
+
+ $this->engine->reset();
+ $this->engine->addStatusHandler(array($statusHandler, 'handle'));
+ $this->engine->addErrorHandler(array($errorHandler, 'handle'));
+ $this->engine->setInput($input);
+ $this->engine->setOutput($output);
+ $this->engine->setOperation('--gen-key', array('--batch'));
+ $this->engine->run();
+
+ $code = $errorHandler->getErrorCode();
+ switch ($code) {
+ case self::ERROR_BAD_KEY_PARAMS:
+ switch ($errorHandler->getLineNumber()) {
+ case 1:
+ throw new Crypt_GPG_InvalidKeyParamsException(
+ 'Invalid primary key algorithm specified.',
+ 0,
+ $this->keyAlgorithm,
+ $this->keySize,
+ $this->keyUsage
+ );
+ case 4:
+ throw new Crypt_GPG_InvalidKeyParamsException(
+ 'Invalid sub-key algorithm specified.',
+ 0,
+ $this->subKeyAlgorithm,
+ $this->subKeySize,
+ $this->subKeyUsage
+ );
+ default:
+ throw new Crypt_GPG_InvalidKeyParamsException(
+ 'Invalid key algorithm specified.'
+ );
+ }
+ }
+
+ $code = $this->engine->getErrorCode();
+
+ switch ($code) {
+ case self::ERROR_NONE:
+ break;
+ default:
+ throw new Crypt_GPG_Exception(
+ 'Unknown error generating key-pair. Please use the \'debug\' ' .
+ 'option when creating the Crypt_GPG object, and file a bug ' .
+ 'report at ' . self::BUG_URI,
+ $code
+ );
+ }
+
+ $code = $statusHandler->getErrorCode();
+
+ switch ($code) {
+ case self::ERROR_NONE:
+ break;
+ case self::ERROR_KEY_NOT_CREATED:
+ throw new Crypt_GPG_KeyNotCreatedException(
+ 'Unable to create new key-pair. Invalid key parameters. ' .
+ 'Make sure the specified key algorithms and sizes are ' .
+ 'correct.',
+ $code
+ );
+ }
+
+ $fingerprint = $statusHandler->getKeyFingerprint();
+ $keys = $this->_getKeys($fingerprint);
+
+ if (count($keys) === 0) {
+ throw new Crypt_GPG_KeyNotCreatedException(
+ sprintf(
+ 'Newly created key "%s" not found in keyring.',
+ $fingerprint
+ )
+ );
+ }
+
+ return $keys[0];
+ }
+
+ // }}}
+ // {{{ getUsage()
+
+ /**
+ * Builds a GnuPG key usage string suitable for key generation
+ *
+ * See <b>doc/DETAILS</b> in the
+ * {@link http://www.gnupg.org/download/ GPG distribution} for detailed
+ * information on the key usage format.
+ *
+ * @param integer $usage a bitwise combination of the key usages. This is
+ * a combination of the Crypt_GPG_SubKey::USAGE_*
+ * constants.
+ *
+ * @return string the key usage string.
+ */
+ protected function getUsage($usage)
+ {
+ $map = array(
+ Crypt_GPG_SubKey::USAGE_ENCRYPT => 'encrypt',
+ Crypt_GPG_SubKey::USAGE_SIGN => 'sign',
+ Crypt_GPG_SubKey::USAGE_CERTIFY => 'cert',
+ Crypt_GPG_SubKey::USAGE_AUTHENTICATION => 'auth',
+ );
+
+ // cert is always used for primary keys and does not need to be
+ // specified
+ $usage &= ~Crypt_GPG_SubKey::USAGE_CERTIFY;
+
+ $usageArray = array();
+
+ foreach ($map as $key => $value) {
+ if (($usage & $key) === $key) {
+ $usageArray[] = $value;
+ }
+ }
+
+ return implode(',', $usageArray);
+ }
+
+ // }}}
+ // {{{ getUserId()
+
+ /**
+ * Gets a user id object from parameters
+ *
+ * @param string|Crypt_GPG_UserId $name either a {@link Crypt_GPG_UserId}
+ * object, or a string containing
+ * the name of the user id.
+ * @param string $email optional. If <i>$name</i> is
+ * specified as a string, this is
+ * the email address of the user id.
+ * @param string $comment optional. If <i>$name</i> is
+ * specified as a string, this is
+ * the comment of the user id.
+ *
+ * @return Crypt_GPG_UserId a user id object for the specified parameters.
+ */
+ protected function getUserId($name, $email = '', $comment = '')
+ {
+ if ($name instanceof Crypt_GPG_UserId) {
+ $userId = $name;
+ } else {
+ $userId = new Crypt_GPG_UserId();
+ $userId->setName($name)->setEmail($email)->setComment($comment);
+ }
+
+ return $userId;
+ }
+
+ // }}}
+}
+
+// }}}
+
+?>
diff --git a/program/lib/Crypt/GPG/KeyGeneratorErrorHandler.php b/program/lib/Crypt/GPG/KeyGeneratorErrorHandler.php
new file mode 100644
index 000000000..ad9ebf395
--- /dev/null
+++ b/program/lib/Crypt/GPG/KeyGeneratorErrorHandler.php
@@ -0,0 +1,121 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Crypt_GPG is a package to use GPG from PHP
+ *
+ * This file contains an object that handles GPG's error output for the
+ * key generation operation.
+ *
+ * PHP version 5
+ *
+ * LICENSE:
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2011-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @version CVS: $Id:$
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://www.gnupg.org/
+ */
+
+/**
+ * Error line handler for the key generation operation
+ *
+ * This class is used internally by Crypt_GPG and does not need be used
+ * directly. See the {@link Crypt_GPG} class for end-user API.
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2011-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://www.gnupg.org/
+ */
+class Crypt_GPG_KeyGeneratorErrorHandler
+{
+ // {{{ protected properties
+
+ /**
+ * Error code (if any) caused by key generation
+ *
+ * @var integer
+ */
+ protected $errorCode = Crypt_GPG::ERROR_NONE;
+
+ /**
+ * Line number at which the error occurred
+ *
+ * @var integer
+ */
+ protected $lineNumber = null;
+
+ // }}}
+ // {{{ handle()
+
+ /**
+ * Handles an error line
+ *
+ * @param string $line the error line to handle.
+ *
+ * @return void
+ */
+ public function handle($line)
+ {
+ $matches = array();
+ $pattern = '/:([0-9]+): invalid algorithm$/';
+ if (preg_match($pattern, $line, $matches) === 1) {
+ $this->errorCode = Crypt_GPG::ERROR_BAD_KEY_PARAMS;
+ $this->lineNumber = intval($matches[1]);
+ }
+ }
+
+ // }}}
+ // {{{ getErrorCode()
+
+ /**
+ * Gets the error code resulting from key gneration
+ *
+ * @return integer the error code resulting from key generation.
+ */
+ public function getErrorCode()
+ {
+ return $this->errorCode;
+ }
+
+ // }}}
+ // {{{ getLineNumber()
+
+ /**
+ * Gets the line number at which the error occurred
+ *
+ * @return integer the line number at which the error occurred. Null if
+ * no error occurred.
+ */
+ public function getLineNumber()
+ {
+ return $this->lineNumber;
+ }
+
+ // }}}
+}
+
+?>
diff --git a/program/lib/Crypt/GPG/KeyGeneratorStatusHandler.php b/program/lib/Crypt/GPG/KeyGeneratorStatusHandler.php
new file mode 100644
index 000000000..8b4c85c7a
--- /dev/null
+++ b/program/lib/Crypt/GPG/KeyGeneratorStatusHandler.php
@@ -0,0 +1,173 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Crypt_GPG is a package to use GPG from PHP
+ *
+ * This file contains an object that handles GPG's status output for the
+ * key generation operation.
+ *
+ * PHP version 5
+ *
+ * LICENSE:
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2011-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @version CVS: $Id:$
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://www.gnupg.org/
+ */
+
+/**
+ * Status line handler for the key generation operation
+ *
+ * This class is used internally by Crypt_GPG and does not need be used
+ * directly. See the {@link Crypt_GPG} class for end-user API.
+ *
+ * This class is responsible for parsing the final key fingerprint from the
+ * status output and for updating the key generation progress file. See
+ * <b>doc/DETAILS</b> in the
+ * {@link http://www.gnupg.org/download/ GPG distribution} for detailed
+ * information on GPG's status output for the batch key generation operation.
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2011-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://www.gnupg.org/
+ */
+class Crypt_GPG_KeyGeneratorStatusHandler
+{
+ // {{{ protected properties
+
+ /**
+ * The key fingerprint
+ *
+ * Ths key fingerprint is emitted by GPG after the key generation is
+ * complete.
+ *
+ * @var string
+ */
+ protected $keyFingerprint = '';
+
+ /**
+ * The unique key handle used by this handler
+ *
+ * The key handle is used to track GPG status output for a particular key
+ * before the key has its own identifier.
+ *
+ * @var string
+ *
+ * @see Crypt_GPG_KeyGeneratorStatusHandler::setHandle()
+ */
+ protected $handle = '';
+
+ /**
+ * Error code (if any) caused by key generation
+ *
+ * @var integer
+ */
+ protected $errorCode = Crypt_GPG::ERROR_NONE;
+
+ // }}}
+ // {{{ setHandle()
+
+ /**
+ * Sets the unique key handle used by this handler
+ *
+ * The key handle is used to track GPG status output for a particular key
+ * before the key has its own identifier.
+ *
+ * @param string $handle the key handle this status handle will use.
+ *
+ * @return Crypt_GPG_KeyGeneratorStatusHandler the current object, for
+ * fluent interface.
+ */
+ public function setHandle($handle)
+ {
+ $this->handle = strval($handle);
+ return $this;
+ }
+
+ // }}}
+ // {{{ handle()
+
+ /**
+ * Handles a status line
+ *
+ * @param string $line the status line to handle.
+ *
+ * @return void
+ */
+ public function handle($line)
+ {
+ $tokens = explode(' ', $line);
+ switch ($tokens[0]) {
+ case 'KEY_CREATED':
+ if ($tokens[3] == $this->handle) {
+ $this->keyFingerprint = $tokens[2];
+ }
+ break;
+
+ case 'KEY_NOT_CREATED':
+ if ($tokens[1] == $this->handle) {
+ $this->errorCode = Crypt_GPG::ERROR_KEY_NOT_CREATED;
+ }
+ break;
+
+ case 'PROGRESS':
+ // todo: at some point, support reporting status async
+ break;
+ }
+ }
+
+ // }}}
+ // {{{ getKeyFingerprint()
+
+ /**
+ * Gets the key fingerprint parsed by this handler
+ *
+ * @return array the key fingerprint parsed by this handler.
+ */
+ public function getKeyFingerprint()
+ {
+ return $this->keyFingerprint;
+ }
+
+ // }}}
+ // {{{ getErrorCode()
+
+ /**
+ * Gets the error code resulting from key gneration
+ *
+ * @return integer the error code resulting from key generation.
+ */
+ public function getErrorCode()
+ {
+ return $this->errorCode;
+ }
+
+ // }}}
+}
+
+?>
diff --git a/program/lib/Crypt/GPG/PinEntry.php b/program/lib/Crypt/GPG/PinEntry.php
new file mode 100644
index 000000000..c09703617
--- /dev/null
+++ b/program/lib/Crypt/GPG/PinEntry.php
@@ -0,0 +1,875 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Contains a class implementing automatic pinentry for gpg-agent
+ *
+ * PHP version 5
+ *
+ * LICENSE:
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @version CVS: $Id$
+ * @link http://pear.php.net/package/Crypt_GPG
+ */
+
+/**
+ * CLI user-interface and parser.
+ */
+require_once 'Console/CommandLine.php';
+
+// {{{ class Crypt_GPG_PinEntry
+
+/**
+ * A command-line dummy pinentry program for use with gpg-agent and Crypt_GPG
+ *
+ * This pinentry receives passphrases through en environment variable and
+ * automatically enters the PIN in response to gpg-agent requests. No user-
+ * interaction required.
+ *
+ * Thie pinentry can be run independently for testing and debugging with the
+ * following syntax:
+ *
+ * <pre>
+ * Usage:
+ * crypt-gpg-pinentry [options]
+ *
+ * Options:
+ * -l log, --log=log Optional location to log pinentry activity.
+ * -v, --verbose Sets verbosity level. Use multiples for more detail
+ * (e.g. "-vv").
+ * -h, --help show this help message and exit
+ * --version show the program version and exit
+ * </pre>
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @see Crypt_GPG::getKeys()
+ */
+class Crypt_GPG_PinEntry
+{
+ // {{{ class constants
+
+ /**
+ * Verbosity level for showing no output.
+ */
+ const VERBOSITY_NONE = 0;
+
+ /**
+ * Verbosity level for showing error output.
+ */
+ const VERBOSITY_ERRORS = 1;
+
+ /**
+ * Verbosity level for showing all output, including Assuan protocol
+ * messages.
+ */
+ const VERBOSITY_ALL = 2;
+
+ /**
+ * Length of buffer for reading lines from the Assuan server.
+ *
+ * PHP reads 8192 bytes. If this is set to less than 8192, PHP reads 8192
+ * and buffers the rest so we might as well just read 8192.
+ *
+ * Using values other than 8192 also triggers PHP bugs.
+ *
+ * @see http://bugs.php.net/bug.php?id=35224
+ */
+ const CHUNK_SIZE = 8192;
+
+ // }}}
+ // {{{ protected properties
+
+ /**
+ * File handle for the input stream
+ *
+ * @var resource
+ */
+ protected $stdin = null;
+
+ /**
+ * File handle for the output stream
+ *
+ * @var resource
+ */
+ protected $stdout = null;
+
+ /**
+ * File handle for the log file if a log file is used
+ *
+ * @var resource
+ */
+ protected $logFile = null;
+
+ /**
+ * Whether or not this pinentry is finished and is exiting
+ *
+ * @var boolean
+ */
+ protected $moribund = false;
+
+ /**
+ * Verbosity level
+ *
+ * One of:
+ * - {@link Crypt_GPG_PinEntry::VERBOSITY_NONE},
+ * - {@link Crypt_GPG_PinEntry::VERBOSITY_ERRORS}, or
+ * - {@link Crypt_GPG_PinEntry::VERBOSITY_ALL}
+ *
+ * @var integer
+ */
+ protected $verbosity = self::VERBOSITY_NONE;
+
+ /**
+ * The command-line interface parser for this pinentry
+ *
+ * @var Console_CommandLine
+ *
+ * @see Crypt_GPG_PinEntry::getParser()
+ */
+ protected $parser = null;
+
+ /**
+ * PINs to be entered by this pinentry
+ *
+ * An indexed array of associative arrays in the form:
+ * <code>
+ * <?php
+ * array(
+ * array(
+ * 'keyId' => $keyId,
+ * 'passphrase' => $passphrase
+ * ),
+ * ...
+ * );
+ * ?>
+ * </code>
+ *
+ * This array is parsed from the environment variable
+ * <kbd>PINENTRY_USER_DATA</kbd>.
+ *
+ * @var array
+ *
+ * @see Crypt_GPG_PinEntry::initPinsFromENV()
+ */
+ protected $pins = array();
+
+ /**
+ * PINs that have been tried for the current PIN
+ *
+ * This is an associative array indexed by the key identifier with
+ * values being the same as elements in the {@link Crypt_GPG_PinEntry::$pins}
+ * array.
+ *
+ * @var array
+ */
+ protected $triedPins = array();
+
+ /**
+ * The PIN currently being requested by the Assuan server
+ *
+ * If set, this is an associative array in the form:
+ * <code>
+ * <?php
+ * array(
+ * 'keyId' => $shortKeyId,
+ * 'userId' => $userIdString
+ * );
+ * ?>
+ * </code>
+ *
+ * @var array|null
+ */
+ protected $currentPin = null;
+
+ // }}}
+ // {{{ __invoke()
+
+ /**
+ * Runs this pinentry
+ *
+ * @return void
+ */
+ public function __invoke()
+ {
+ $this->parser = $this->getCommandLineParser();
+
+ try {
+ $result = $this->parser->parse();
+
+ $this->setVerbosity($result->options['verbose']);
+ $this->setLogFilename($result->options['log']);
+
+ $this->connect();
+ $this->initPinsFromENV();
+
+ while (($line = fgets($this->stdin, self::CHUNK_SIZE)) !== false) {
+ $this->parseCommand(mb_substr($line, 0, -1, '8bit'));
+ if ($this->moribund) {
+ break;
+ }
+ }
+
+ $this->disconnect();
+
+ } catch (Console_CommandLineException $e) {
+ $this->log($e->getMessage() . PHP_EOL, slf::VERBOSITY_ERRORS);
+ exit(1);
+ } catch (Exception $e) {
+ $this->log($e->getMessage() . PHP_EOL, self::VERBOSITY_ERRORS);
+ $this->log($e->getTraceAsString() . PHP_EOL, self::VERBOSITY_ERRORS);
+ exit(1);
+ }
+ }
+
+ // }}}
+ // {{{ setVerbosity()
+
+ /**
+ * Sets the verbosity of logging for this pinentry
+ *
+ * Verbosity levels are:
+ *
+ * - {@link Crypt_GPG_PinEntry::VERBOSITY_NONE} - no logging.
+ * - {@link Crypt_GPG_PinEntry::VERBOSITY_ERRORS} - log errors only.
+ * - {@link Crypt_GPG_PinEntry::VERBOSITY_ALL} - log everything, including
+ * the assuan protocol.
+ *
+ * @param integer $verbosity the level of verbosity of this pinentry.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ public function setVerbosity($verbosity)
+ {
+ $this->verbosity = (integer)$verbosity;
+ return $this;
+ }
+
+ // }}}
+ // {{{ setLogFilename()
+
+ /**
+ * Sets the log file location
+ *
+ * @param string $filename the new log filename to use. If an empty string
+ * is used, file-based logging is disabled.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ public function setLogFilename($filename)
+ {
+ if (is_resource($this->logFile)) {
+ fflush($this->logFile);
+ fclose($this->logFile);
+ $this->logFile = null;
+ }
+
+ if ($filename != '') {
+ if (($this->logFile = fopen($filename, 'w')) === false) {
+ $this->log(
+ 'Unable to open log file "' . $filename . '" '
+ . 'for writing.' . PHP_EOL,
+ self::VERBOSITY_ERRORS
+ );
+ exit(1);
+ } else {
+ stream_set_write_buffer($this->logFile, 0);
+ }
+ }
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ getUIXML()
+
+ /**
+ * Gets the CLI user-interface definition for this pinentry
+ *
+ * Detects whether or not this package is PEAR-installed and appropriately
+ * locates the XML UI definition.
+ *
+ * @return string the location of the CLI user-interface definition XML.
+ */
+ protected function getUIXML()
+ {
+ $dir = '@data-dir@' . DIRECTORY_SEPARATOR
+ . '@package-name@' . DIRECTORY_SEPARATOR . 'data';
+
+ // Check if we're running directly from a git checkout or if we're
+ // running from a PEAR-packaged version.
+ if ($dir[0] == '@') {
+ $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
+ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data';
+ }
+
+ return $dir . DIRECTORY_SEPARATOR . 'pinentry-cli.xml';
+ }
+
+ // }}}
+ // {{{ getCommandLineParser()
+
+ /**
+ * Gets the CLI parser for this pinentry
+ *
+ * @return Console_CommandLine the CLI parser for this pinentry.
+ */
+ protected function getCommandLineParser()
+ {
+ return Console_CommandLine::fromXmlFile($this->getUIXML());
+ }
+
+ // }}}
+ // {{{ log()
+
+ /**
+ * Logs a message at the specified verbosity level
+ *
+ * If a log file is used, the message is written to the log. Otherwise,
+ * the message is sent to STDERR.
+ *
+ * @param string $data the message to log.
+ * @param integer $level the verbosity level above which the message should
+ * be logged.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function log($data, $level)
+ {
+ if ($this->verbosity >= $level) {
+ if (is_resource($this->logFile)) {
+ fwrite($this->logFile, $data);
+ fflush($this->logFile);
+ } else {
+ $this->parser->outputter->stderr($data);
+ }
+ }
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ connect()
+
+ /**
+ * Connects this pinentry to the assuan server
+ *
+ * Opens I/O streams and sends initial handshake.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function connect()
+ {
+ // Binary operations will not work on Windows with PHP < 5.2.6.
+ $rb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'r' : 'rb';
+ $wb = (version_compare(PHP_VERSION, '5.2.6') < 0) ? 'w' : 'wb';
+
+ $this->stdin = fopen('php://stdin', $rb);
+ $this->stdout = fopen('php://stdout', $wb);
+
+ if (function_exists('stream_set_read_buffer')) {
+ stream_set_read_buffer($this->stdin, 0);
+ }
+ stream_set_write_buffer($this->stdout, 0);
+
+ // initial handshake
+ $this->send($this->getOK('Crypt_GPG pinentry ready and waiting'));
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ parseCommand()
+
+ /**
+ * Parses an assuan command and performs the appropriate action
+ *
+ * Documentation of the assuan commands for pinentry is limited to
+ * non-existent. Most of these commands were taken from the C source code
+ * to gpg-agent and pinentry.
+ *
+ * Additional context was provided by using strace -f when calling the
+ * gpg-agent.
+ *
+ * @param string $line the assuan command line to parse
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function parseCommand($line)
+ {
+ $this->log('<- ' . $line . PHP_EOL, self::VERBOSITY_ALL);
+
+ $parts = explode(' ', $line, 2);
+
+ $command = $parts[0];
+
+ if (count($parts) === 2) {
+ $data = $parts[1];
+ } else {
+ $data = null;
+ }
+
+ switch ($command) {
+ case 'SETDESC':
+ return $this->sendSetDescription($data);
+
+ case 'SETPROMPT':
+ case 'SETERROR':
+ case 'SETOK':
+ case 'SETNOTOK':
+ case 'SETCANCEL':
+ case 'SETQUALITYBAR':
+ case 'SETQUALITYBAR_TT':
+ case 'OPTION':
+ return $this->sendNotImplementedOK();
+
+ case 'MESSAGE':
+ return $this->sendMessage();
+
+ case 'CONFIRM':
+ return $this->sendConfirm();
+
+ case 'GETINFO':
+ return $this->sendGetInfo($data);
+
+ case 'GETPIN':
+ return $this->sendGetPin($data);
+
+ case 'RESET':
+ return $this->sendReset();
+
+ case 'BYE':
+ return $this->sendBye();
+ }
+ }
+
+ // }}}
+ // {{{ initPinsFromENV()
+
+ /**
+ * Initializes the PINs to be entered by this pinentry from the environment
+ * variable PINENTRY_USER_DATA
+ *
+ * The PINs are parsed from a JSON-encoded string.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function initPinsFromENV()
+ {
+ if (($userData = getenv('PINENTRY_USER_DATA')) !== false) {
+ $pins = json_decode($userData, true);
+ if ($pins === null) {
+ $this->log(
+ '-- failed to parse user data' . PHP_EOL,
+ self::VERBOSITY_ERRORS
+ );
+ } else {
+ $this->pins = $pins;
+ $this->log(
+ '-- got user data [not showing passphrases]' . PHP_EOL,
+ self::VERBOSITY_ALL
+ );
+ }
+ }
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ disconnect()
+
+ /**
+ * Disconnects this pinentry from the Assuan server
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function disconnect()
+ {
+ $this->log('-- disconnecting' . PHP_EOL, self::VERBOSITY_ALL);
+
+ fflush($this->stdout);
+ fclose($this->stdout);
+ fclose($this->stdin);
+
+ $this->stdin = null;
+ $this->stdout = null;
+
+ $this->log('-- disconnected' . PHP_EOL, self::VERBOSITY_ALL);
+
+ if (is_resource($this->logFile)) {
+ fflush($this->logFile);
+ fclose($this->logFile);
+ $this->logFile = null;
+ }
+
+ return $this;
+ }
+
+ // }}}
+ // {{{ sendNotImplementedOK()
+
+ /**
+ * Sends an OK response for a not implemented feature
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendNotImplementedOK()
+ {
+ return $this->send($this->getOK());
+ }
+
+ // }}}
+ // {{{ sendSetDescription()
+
+ /**
+ * Parses the currently requested key identifier and user identifier from
+ * the description passed to this pinentry
+ *
+ * @param string $text the raw description sent from gpg-agent.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendSetDescription($text)
+ {
+ $text = rawurldecode($text);
+ $matches = array();
+ // TODO: handle user id with quotation marks
+ $exp = '/\n"(.+)"\n.*\sID ([A-Z0-9]+),\n/mu';
+ if (preg_match($exp, $text, $matches) === 1) {
+ $userId = $matches[1];
+ $keyId = $matches[2];
+
+ // only reset tried pins for new requested pin
+ if ( $this->currentPin === null
+ || $this->currentPin['keyId'] !== $keyId
+ ) {
+ $this->currentPin = array(
+ 'userId' => $userId,
+ 'keyId' => $keyId
+ );
+ $this->triedPins = array();
+ $this->log(
+ '-- looking for PIN for ' . $keyId . PHP_EOL,
+ self::VERBOSITY_ALL
+ );
+ }
+ }
+
+ return $this->send($this->getOK());
+ }
+
+ // }}}
+ // {{{ sendConfirm()
+
+ /**
+ * Tells the assuan server the PIN entry was confirmed (not cancelled)
+ * by pressing the fake 'close' button
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendConfirm()
+ {
+ return $this->sendButtonInfo('close');
+ }
+
+ // }}}
+ // {{{ sendMessage()
+
+ /**
+ * Tells the assuan server that any requested pop-up messages were confirmed
+ * by pressing the fake 'close' button
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendMessage()
+ {
+ return $this->sendButtonInfo('close');
+ }
+
+ // }}}
+ // {{{ sendButtonInfo()
+
+ /**
+ * Sends information about pressed buttons to the assuan server
+ *
+ * This is used to fake a user-interface for this pinentry.
+ *
+ * @param string $text the button status to send.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendButtonInfo($text)
+ {
+ return $this->send('BUTTON_INFO ' . $text . "\n");
+ }
+
+ // }}}
+ // {{{ sendGetPin()
+
+ /**
+ * Sends the PIN value for the currently requested key
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendGetPin()
+ {
+ $foundPin = '';
+
+ if (is_array($this->currentPin)) {
+ $keyIdLength = mb_strlen($this->currentPin['keyId'], '8bit');
+
+ // search for the pin
+ foreach ($this->pins as $pin) {
+ // only check pins we haven't tried
+ if (!isset($this->triedPins[$pin['keyId']])) {
+
+ // get last X characters of key identifier to compare
+ $keyId = mb_substr(
+ $pin['keyId'],
+ -$keyIdLength,
+ mb_strlen($pin['keyId'], '8bit'),
+ '8bit'
+ );
+
+ if ($keyId === $this->currentPin['keyId']) {
+ $foundPin = $pin['passphrase'];
+ $this->triedPins[$pin['keyId']] = $pin;
+ break;
+ }
+ }
+ }
+ }
+
+ return $this
+ ->send($this->getData($foundPin))
+ ->send($this->getOK());
+ }
+
+ // }}}
+ // {{{ sendGetInfo()
+
+ /**
+ * Sends information about this pinentry
+ *
+ * @param string $data the information requested by the assuan server.
+ * Currently only 'pid' is supported. Other requests
+ * return no information.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendGetInfo($data)
+ {
+ $parts = explode(' ', $data, 2);
+ $command = reset($parts);
+
+ switch ($command) {
+ case 'pid':
+ return $this->sendGetInfoPID();
+ default:
+ return $this->send($this->getOK());
+ }
+
+ return $this;
+ }
+ // }}}
+ // {{{ sendGetInfoPID()
+
+ /**
+ * Sends the PID of this pinentry to the assuan server
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendGetInfoPID()
+ {
+ return $this
+ ->send($this->getData(getmypid()))
+ ->send($this->getOK());
+ }
+
+ // }}}
+ // {{{ sendBye()
+
+ /**
+ * Flags this pinentry for disconnection and sends an OK response
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendBye()
+ {
+ $return = $this->send($this->getOK('closing connection'));
+ $this->moribund = true;
+ return $return;
+ }
+
+ // }}}
+ // {{{ sendReset()
+
+ /**
+ * Resets this pinentry and sends an OK response
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function sendReset()
+ {
+ $this->currentPin = null;
+ $this->triedPins = array();
+ return $this->send($this->getOK());
+ }
+
+ // }}}
+ // {{{ getOK()
+
+ /**
+ * Gets an OK response to send to the assuan server
+ *
+ * @param string $data an optional message to include with the OK response.
+ *
+ * @return string the OK response.
+ */
+ protected function getOK($data = null)
+ {
+ $return = 'OK';
+
+ if ($data) {
+ $return .= ' ' . $data;
+ }
+
+ return $return . "\n";
+ }
+
+ // }}}
+ // {{{ getData()
+
+ /**
+ * Gets data ready to send to the assuan server
+ *
+ * Data is appropriately escaped and long lines are wrapped.
+ *
+ * @param string $data the data to send to the assuan server.
+ *
+ * @return string the properly escaped, formatted data.
+ *
+ * @see http://www.gnupg.org/documentation/manuals/assuan/Server-responses.html
+ */
+ protected function getData($data)
+ {
+ // Escape data. Only %, \n and \r need to be escaped but other
+ // values are allowed to be escaped. See
+ // http://www.gnupg.org/documentation/manuals/assuan/Server-responses.html
+ $data = rawurlencode($data);
+ $data = $this->getWordWrappedData($data, 'D');
+ return $data;
+ }
+
+ // }}}
+ // {{{ getComment()
+
+ /**
+ * Gets a comment ready to send to the assuan server
+ *
+ * @param string $data the comment to send to the assuan server.
+ *
+ * @return string the properly formatted comment.
+ *
+ * @see http://www.gnupg.org/documentation/manuals/assuan/Server-responses.html
+ */
+ protected function getComment($data)
+ {
+ return $this->getWordWrappedData($data, '#');
+ }
+
+ // }}}
+ // {{{ getWordWrappedData()
+
+ /**
+ * Wraps strings at 1,000 bytes without splitting UTF-8 multibyte
+ * characters
+ *
+ * Each line is prepended with the specified line prefix. Wrapped lines
+ * are automatically appended with \ characters.
+ *
+ * Protocol strings are UTF-8 but maximum line length is 1,000 bytes.
+ * <kbd>mb_strcut()</kbd> is used so we can limit line length by bytes
+ * and not split characters across multiple lines.
+ *
+ * @param string $data the data to wrap.
+ * @param string $prefix a single character to use as the line prefix. For
+ * example, 'D' or '#'.
+ *
+ * @return string the word-wrapped, prefixed string.
+ *
+ * @see http://www.gnupg.org/documentation/manuals/assuan/Server-responses.html
+ */
+ protected function getWordWrappedData($data, $prefix)
+ {
+ $lines = array();
+
+ do {
+ if (mb_strlen($data, '8bit') > 997) {
+ $line = $prefix . ' ' . mb_strcut($data, 0, 996, 'utf-8') . "\\\n";
+ $lines[] = $line;
+ $lineLength = mb_strlen($line, '8bit') - 1;
+ $dataLength = mb_substr($data, '8bit');
+ $data = mb_substr(
+ $data,
+ $lineLength,
+ $dataLength - $lineLength,
+ '8bit'
+ );
+ } else {
+ $lines[] = $prefix . ' ' . $data . "\n";
+ $data = '';
+ }
+ } while ($data != '');
+
+ return implode('', $lines);
+ }
+
+ // }}}
+ // {{{ send()
+
+ /**
+ * Sends raw data to the assuan server
+ *
+ * @param string $data the data to send.
+ *
+ * @return Crypt_GPG_PinEntry the current object, for fluent interface.
+ */
+ protected function send($data)
+ {
+ $this->log('-> ' . $data, self::VERBOSITY_ALL);
+ fwrite($this->stdout, $data);
+ fflush($this->stdout);
+ return $this;
+ }
+
+ // }}}
+}
+
+// }}}
+
+?>
diff --git a/program/lib/Crypt/GPG/ProcessControl.php b/program/lib/Crypt/GPG/ProcessControl.php
new file mode 100644
index 000000000..d6dae0325
--- /dev/null
+++ b/program/lib/Crypt/GPG/ProcessControl.php
@@ -0,0 +1,150 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * A class for monitoring and terminating processes
+ *
+ * PHP version 5
+ *
+ * LICENSE:
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @version CVS: $Id$
+ * @link http://pear.php.net/package/Crypt_GPG
+ */
+
+// {{{ class Crypt_GPG_ProcessControl
+
+/**
+ * A class for monitoring and terminating processes by PID
+ *
+ * This is used to safely terminate the gpg-agent for GnuPG 2.x. This class
+ * is limited in its abilities and can only check if a PID is running and
+ * send a PID SIGTERM.
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ */
+class Crypt_GPG_ProcessControl
+{
+ // {{{ protected properties
+
+ /**
+ * The PID (process identifier) being monitored
+ *
+ * @var integer
+ */
+ protected $pid;
+
+ // }}}
+ // {{{ __construct()
+
+ /**
+ * Creates a new process controller from the given PID (process identifier)
+ *
+ * @param integer $pid the PID (process identifier).
+ */
+ public function __construct($pid)
+ {
+ $this->pid = $pid;
+ }
+
+ // }}}
+ // {{{ public function getPid()
+
+ /**
+ * Gets the PID (process identifier) being controlled
+ *
+ * @return integer the PID being controlled.
+ */
+ public function getPid()
+ {
+ return $this->pid;
+ }
+
+ // }}}
+ // {{{ isRunning()
+
+ /**
+ * Checks if the process is running
+ *
+ * Uses <kbd>ps</kbd> on UNIX-like systems and <kbd>tasklist</kbd> on
+ * Windows.
+ *
+ * @return boolean true if the process is running, false if not.
+ */
+ public function isRunning()
+ {
+ $running = false;
+
+ if (PHP_OS === 'WINNT') {
+ $command = 'tasklist /fo csv /nh /fi '
+ . escapeshellarg('PID eq ' . $this->pid);
+
+ $result = exec($command);
+ $parts = explode(',', $result);
+ $running = (count($parts) > 1 && trim($parts[1], '"') == $this->pid);
+ } else {
+ $result = exec('ps -p ' . escapeshellarg($this->pid) . ' -o pid=');
+ $running = (trim($result) == $this->pid);
+ }
+
+ return $running;
+ }
+
+ // }}}
+ // {{{ terminate()
+
+ /**
+ * Ends the process gracefully
+ *
+ * The signal SIGTERM is sent to the process. The gpg-agent process will
+ * end gracefully upon receiving the SIGTERM signal. Upon 3 consecutive
+ * SIGTERM signals the gpg-agent will forcefully shut down.
+ *
+ * If the <kbd>posix</kbd> extension is available, <kbd>posix_kill()</kbd>
+ * is used. Otherwise <kbd>kill</kbd> is used on UNIX-like systems and
+ * <kbd>taskkill</kbd> is used in Windows.
+ *
+ * @return void
+ */
+ public function terminate()
+ {
+ if (function_exists('posix_kill')) {
+ posix_kill($this->pid, 15);
+ } elseif (PHP_OS === 'WINNT') {
+ exec('taskkill /PID ' . escapeshellarg($this->pid));
+ } else {
+ exec('kill -15 ' . escapeshellarg($this->pid));
+ }
+ }
+
+ // }}}
+}
+
+// }}}
+
+?>
diff --git a/program/lib/Crypt/GPG/Signature.php b/program/lib/Crypt/GPG/Signature.php
index 03ab44c53..1d28a1188 100644
--- a/program/lib/Crypt/GPG/Signature.php
+++ b/program/lib/Crypt/GPG/Signature.php
@@ -28,9 +28,10 @@
* @category Encryption
* @package Crypt_GPG
* @author Nathan Fredrickson <nathan@silverorange.com>
- * @copyright 2005-2010 silverorange
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2005-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: Signature.php 302773 2010-08-25 14:16:28Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
*/
@@ -50,7 +51,7 @@ require_once 'Crypt/GPG/UserId.php';
* @package Crypt_GPG
* @author Nathan Fredrickson <nathan@silverorange.com>
* @author Michael Gauthier <mike@silverorange.com>
- * @copyright 2005-2010 silverorange
+ * @copyright 2005-2013 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @link http://pear.php.net/package/Crypt_GPG
* @see Crypt_GPG::verify()
@@ -159,8 +160,6 @@ class Crypt_GPG_Signature
if ($signature->_userId instanceof Crypt_GPG_UserId) {
$this->_userId = clone $signature->_userId;
- } else {
- $this->_userId = $signature->_userId;
}
}
diff --git a/program/lib/Crypt/GPG/SubKey.php b/program/lib/Crypt/GPG/SubKey.php
index b6316e99f..59245cac1 100644
--- a/program/lib/Crypt/GPG/SubKey.php
+++ b/program/lib/Crypt/GPG/SubKey.php
@@ -29,7 +29,7 @@
* @author Nathan Fredrickson <nathan@silverorange.com>
* @copyright 2005-2010 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: SubKey.php 302768 2010-08-25 13:45:52Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
*/
@@ -53,7 +53,7 @@
*/
class Crypt_GPG_SubKey
{
- // {{{ class constants
+ // {{{ algorithm class constants
/**
* RSA encryption algorithm.
@@ -77,6 +77,29 @@ class Crypt_GPG_SubKey
const ALGORITHM_ELGAMAL_ENC_SGN = 20;
// }}}
+ // {{{ usage class constants
+
+ /**
+ * Key can be used to encrypt
+ */
+ const USAGE_ENCRYPT = 1;
+
+ /**
+ * Key can be used to sign
+ */
+ const USAGE_SIGN = 2;
+
+ /**
+ * Key can be used to certify other keys
+ */
+ const USAGE_CERTIFY = 4;
+
+ /**
+ * Key can be used for authentication
+ */
+ const USAGE_AUTHENTICATION = 8;
+
+ // }}}
// {{{ class properties
/**
diff --git a/program/lib/Crypt/GPG/UserId.php b/program/lib/Crypt/GPG/UserId.php
index 04435708c..a367bceb3 100644
--- a/program/lib/Crypt/GPG/UserId.php
+++ b/program/lib/Crypt/GPG/UserId.php
@@ -28,7 +28,7 @@
* @author Michael Gauthier <mike@silverorange.com>
* @copyright 2008-2010 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: UserId.php 295621 2010-03-01 04:18:54Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
*/
diff --git a/program/lib/Crypt/GPG/VerifyStatusHandler.php b/program/lib/Crypt/GPG/VerifyStatusHandler.php
index 083bd3012..8904be149 100644
--- a/program/lib/Crypt/GPG/VerifyStatusHandler.php
+++ b/program/lib/Crypt/GPG/VerifyStatusHandler.php
@@ -31,7 +31,7 @@
* @author Michael Gauthier <mike@silverorange.com>
* @copyright 2008 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id: VerifyStatusHandler.php 302908 2010-08-31 03:56:54Z gauthierm $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Crypt_GPG
* @link http://www.gnupg.org/
*/
diff --git a/program/lib/Crypt/GPGAbstract.php b/program/lib/Crypt/GPGAbstract.php
new file mode 100644
index 000000000..214133936
--- /dev/null
+++ b/program/lib/Crypt/GPGAbstract.php
@@ -0,0 +1,508 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Crypt_GPG is a package to use GPG from PHP
+ *
+ * This package provides an object oriented interface to GNU Privacy
+ * Guard (GPG). It requires the GPG executable to be on the system.
+ *
+ * Though GPG can support symmetric-key cryptography, this package is intended
+ * only to facilitate public-key cryptography.
+ *
+ * This file contains an abstract implementation of a user of the
+ * {@link Crypt_GPG_Engine} class.
+ *
+ * PHP version 5
+ *
+ * LICENSE:
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Nathan Fredrickson <nathan@silverorange.com>
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2005-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @version CVS: $Id: GPG.php 305428 2010-11-17 02:47:56Z gauthierm $
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://pear.php.net/manual/en/package.encryption.crypt-gpg.php
+ * @link http://www.gnupg.org/
+ */
+
+/**
+ * GPG key class
+ */
+require_once 'Crypt/GPG/Key.php';
+
+/**
+ * GPG sub-key class
+ */
+require_once 'Crypt/GPG/SubKey.php';
+
+/**
+ * GPG user id class
+ */
+require_once 'Crypt/GPG/UserId.php';
+
+/**
+ * GPG process and I/O engine class
+ */
+require_once 'Crypt/GPG/Engine.php';
+
+/**
+ * GPG exception classes
+ */
+require_once 'Crypt/GPG/Exceptions.php';
+
+// {{{ class Crypt_GPGAbstract
+
+/**
+ * Base class for implementing a user of {@link Crypt_GPG_Engine}
+ *
+ * @category Encryption
+ * @package Crypt_GPG
+ * @author Nathan Fredrickson <nathan@silverorange.com>
+ * @author Michael Gauthier <mike@silverorange.com>
+ * @copyright 2005-2013 silverorange
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
+ * @link http://pear.php.net/package/Crypt_GPG
+ * @link http://www.gnupg.org/
+ */
+abstract class Crypt_GPGAbstract
+{
+ // {{{ class error constants
+
+ /**
+ * Error code returned when there is no error.
+ */
+ const ERROR_NONE = 0;
+
+ /**
+ * Error code returned when an unknown or unhandled error occurs.
+ */
+ const ERROR_UNKNOWN = 1;
+
+ /**
+ * Error code returned when a bad passphrase is used.
+ */
+ const ERROR_BAD_PASSPHRASE = 2;
+
+ /**
+ * Error code returned when a required passphrase is missing.
+ */
+ const ERROR_MISSING_PASSPHRASE = 3;
+
+ /**
+ * Error code returned when a key that is already in the keyring is
+ * imported.
+ */
+ const ERROR_DUPLICATE_KEY = 4;
+
+ /**
+ * Error code returned the required data is missing for an operation.
+ *
+ * This could be missing key data, missing encrypted data or missing
+ * signature data.
+ */
+ const ERROR_NO_DATA = 5;
+
+ /**
+ * Error code returned when an unsigned key is used.
+ */
+ const ERROR_UNSIGNED_KEY = 6;
+
+ /**
+ * Error code returned when a key that is not self-signed is used.
+ */
+ const ERROR_NOT_SELF_SIGNED = 7;
+
+ /**
+ * Error code returned when a public or private key that is not in the
+ * keyring is used.
+ */
+ const ERROR_KEY_NOT_FOUND = 8;
+
+ /**
+ * Error code returned when an attempt to delete public key having a
+ * private key is made.
+ */
+ const ERROR_DELETE_PRIVATE_KEY = 9;
+
+ /**
+ * Error code returned when one or more bad signatures are detected.
+ */
+ const ERROR_BAD_SIGNATURE = 10;
+
+ /**
+ * Error code returned when there is a problem reading GnuPG data files.
+ */
+ const ERROR_FILE_PERMISSIONS = 11;
+
+ /**
+ * Error code returned when a key could not be created.
+ */
+ const ERROR_KEY_NOT_CREATED = 12;
+
+ /**
+ * Error code returned when bad key parameters are used during key
+ * generation.
+ */
+ const ERROR_BAD_KEY_PARAMS = 13;
+
+ // }}}
+ // {{{ other class constants
+
+ /**
+ * URI at which package bugs may be reported.
+ */
+ const BUG_URI = 'http://pear.php.net/bugs/report.php?package=Crypt_GPG';
+
+ // }}}
+ // {{{ protected class properties
+
+ /**
+ * Engine used to control the GPG subprocess
+ *
+ * @var Crypt_GPG_Engine
+ *
+ * @see Crypt_GPGAbstract::setEngine()
+ */
+ protected $engine = null;
+
+ // }}}
+ // {{{ __construct()
+
+ /**
+ * Creates a new GPG object
+ *
+ * Available options are:
+ *
+ * - <kbd>string homedir</kbd> - the directory where the GPG
+ * keyring files are stored. If not
+ * specified, Crypt_GPG uses the
+ * default of <kbd>~/.gnupg</kbd>.
+ * - <kbd>string publicKeyring</kbd> - the file path of the public
+ * keyring. Use this if the public
+ * keyring is not in the homedir, or
+ * if the keyring is in a directory
+ * not writable by the process
+ * invoking GPG (like Apache). Then
+ * you can specify the path to the
+ * keyring with this option
+ * (/foo/bar/pubring.gpg), and specify
+ * a writable directory (like /tmp)
+ * using the <i>homedir</i> option.
+ * - <kbd>string privateKeyring</kbd> - the file path of the private
+ * keyring. Use this if the private
+ * keyring is not in the homedir, or
+ * if the keyring is in a directory
+ * not writable by the process
+ * invoking GPG (like Apache). Then
+ * you can specify the path to the
+ * keyring with this option
+ * (/foo/bar/secring.gpg), and specify
+ * a writable directory (like /tmp)
+ * using the <i>homedir</i> option.
+ * - <kbd>string trustDb</kbd> - the file path of the web-of-trust
+ * database. Use this if the trust
+ * database is not in the homedir, or
+ * if the database is in a directory
+ * not writable by the process
+ * invoking GPG (like Apache). Then
+ * you can specify the path to the
+ * trust database with this option
+ * (/foo/bar/trustdb.gpg), and specify
+ * a writable directory (like /tmp)
+ * using the <i>homedir</i> option.
+ * - <kbd>string binary</kbd> - the location of the GPG binary. If
+ * not specified, the driver attempts
+ * to auto-detect the GPG binary
+ * location using a list of known
+ * default locations for the current
+ * operating system. The option
+ * <kbd>gpgBinary</kbd> is a
+ * deprecated alias for this option.
+ * - <kbd>string agent</kbd> - the location of the GnuPG agent
+ * binary. The gpg-agent is only
+ * used for GnuPG 2.x. If not
+ * specified, the engine attempts
+ * to auto-detect the gpg-agent
+ * binary location using a list of
+ * know default locations for the
+ * current operating system.
+ * - <kbd>boolean debug</kbd> - whether or not to use debug mode.
+ * When debug mode is on, all
+ * communication to and from the GPG
+ * subprocess is logged. This can be
+ *
+ * @param array $options optional. An array of options used to create the
+ * GPG object. All options are optional and are
+ * represented as key-value pairs.
+ *
+ * @throws Crypt_GPG_FileException if the <kbd>homedir</kbd> does not exist
+ * and cannot be created. This can happen if <kbd>homedir</kbd> is
+ * not specified, Crypt_GPG is run as the web user, and the web
+ * user has no home directory. This exception is also thrown if any
+ * of the options <kbd>publicKeyring</kbd>,
+ * <kbd>privateKeyring</kbd> or <kbd>trustDb</kbd> options are
+ * specified but the files do not exist or are are not readable.
+ * This can happen if the user running the Crypt_GPG process (for
+ * example, the Apache user) does not have permission to read the
+ * files.
+ *
+ * @throws PEAR_Exception if the provided <kbd>binary</kbd> is invalid, or
+ * if no <kbd>binary</kbd> is provided and no suitable binary could
+ * be found.
+ *
+ * @throws PEAR_Exception if the provided <kbd>agent</kbd> is invalid, or
+ * if no <kbd>agent</kbd> is provided and no suitable gpg-agent
+ * cound be found.
+ */
+ public function __construct(array $options = array())
+ {
+ $this->setEngine(new Crypt_GPG_Engine($options));
+ }
+
+ // }}}
+ // {{{ setEngine()
+
+ /**
+ * Sets the I/O engine to use for GnuPG operations
+ *
+ * Normally this method does not need to be used. It provides a means for
+ * dependency injection.
+ *
+ * @param Crypt_GPG_Engine $engine the engine to use.
+ *
+ * @return Crypt_GPGAbstract the current object, for fluent interface.
+ */
+ public function setEngine(Crypt_GPG_Engine $engine)
+ {
+ $this->engine = $engine;
+ return $this;
+ }
+
+ // }}}
+ // {{{ _getKeys()
+
+ /**
+ * Gets the available keys in the keyring
+ *
+ * Calls GPG with the <kbd>--list-keys</kbd> command and grabs keys. See
+ * the first section of <b>doc/DETAILS</b> in the
+ * {@link http://www.gnupg.org/download/ GPG package} for a detailed
+ * description of how the GPG command output is parsed.
+ *
+ * @param string $keyId optional. Only keys with that match the specified
+ * pattern are returned. The pattern may be part of
+ * a user id, a key id or a key fingerprint. If not
+ * specified, all keys are returned.
+ *
+ * @return array an array of {@link Crypt_GPG_Key} objects. If no keys
+ * match the specified <kbd>$keyId</kbd> an empty array is
+ * returned.
+ *
+ * @throws Crypt_GPG_Exception if an unknown or unexpected error occurs.
+ * Use the <kbd>debug</kbd> option and file a bug report if these
+ * exceptions occur.
+ *
+ * @see Crypt_GPG_Key
+ */
+ protected function _getKeys($keyId = '')
+ {
+ // get private key fingerprints
+ if ($keyId == '') {
+ $operation = '--list-secret-keys';
+ } else {
+ $operation = '--list-secret-keys ' . escapeshellarg($keyId);
+ }
+
+ // According to The file 'doc/DETAILS' in the GnuPG distribution, using
+ // double '--with-fingerprint' also prints the fingerprint for subkeys.
+ $arguments = array(
+ '--with-colons',
+ '--with-fingerprint',
+ '--with-fingerprint',
+ '--fixed-list-mode'
+ );
+
+ $output = '';
+
+ $this->engine->reset();
+ $this->engine->setOutput($output);
+ $this->engine->setOperation($operation, $arguments);
+ $this->engine->run();
+
+ $code = $this->engine->getErrorCode();
+
+ switch ($code) {
+ case self::ERROR_NONE:
+ case self::ERROR_KEY_NOT_FOUND:
+ // ignore not found key errors
+ break;
+ case self::ERROR_FILE_PERMISSIONS:
+ $filename = $this->engine->getErrorFilename();
+ if ($filename) {
+ throw new Crypt_GPG_FileException(
+ sprintf(
+ 'Error reading GnuPG data file \'%s\'. Check to make ' .
+ 'sure it is readable by the current user.',
+ $filename
+ ),
+ $code,
+ $filename
+ );
+ }
+ throw new Crypt_GPG_FileException(
+ 'Error reading GnuPG data file. Check to make GnuPG data ' .
+ 'files are readable by the current user.',
+ $code
+ );
+ default:
+ throw new Crypt_GPG_Exception(
+ 'Unknown error getting keys. Please use the \'debug\' option ' .
+ 'when creating the Crypt_GPG object, and file a bug report ' .
+ 'at ' . self::BUG_URI,
+ $code
+ );
+ }
+
+ $privateKeyFingerprints = array();
+
+ $lines = explode(PHP_EOL, $output);
+ foreach ($lines as $line) {
+ $lineExp = explode(':', $line);
+ if ($lineExp[0] == 'fpr') {
+ $privateKeyFingerprints[] = $lineExp[9];
+ }
+ }
+
+ // get public keys
+ if ($keyId == '') {
+ $operation = '--list-public-keys';
+ } else {
+ $operation = '--list-public-keys ' . escapeshellarg($keyId);
+ }
+
+ $output = '';
+
+ $this->engine->reset();
+ $this->engine->setOutput($output);
+ $this->engine->setOperation($operation, $arguments);
+ $this->engine->run();
+
+ $code = $this->engine->getErrorCode();
+
+ switch ($code) {
+ case self::ERROR_NONE:
+ case self::ERROR_KEY_NOT_FOUND:
+ // ignore not found key errors
+ break;
+ case self::ERROR_FILE_PERMISSIONS:
+ $filename = $this->engine->getErrorFilename();
+ if ($filename) {
+ throw new Crypt_GPG_FileException(
+ sprintf(
+ 'Error reading GnuPG data file \'%s\'. Check to make ' .
+ 'sure it is readable by the current user.',
+ $filename
+ ),
+ $code,
+ $filename
+ );
+ }
+ throw new Crypt_GPG_FileException(
+ 'Error reading GnuPG data file. Check to make GnuPG data ' .
+ 'files are readable by the current user.',
+ $code
+ );
+ default:
+ throw new Crypt_GPG_Exception(
+ 'Unknown error getting keys. Please use the \'debug\' option ' .
+ 'when creating the Crypt_GPG object, and file a bug report ' .
+ 'at ' . self::BUG_URI,
+ $code
+ );
+ }
+
+ $keys = array();
+
+ $key = null; // current key
+ $subKey = null; // current sub-key
+
+ $lines = explode(PHP_EOL, $output);
+ foreach ($lines as $line) {
+ $lineExp = explode(':', $line);
+
+ if ($lineExp[0] == 'pub') {
+
+ // new primary key means last key should be added to the array
+ if ($key !== null) {
+ $keys[] = $key;
+ }
+
+ $key = new Crypt_GPG_Key();
+
+ $subKey = Crypt_GPG_SubKey::parse($line);
+ $key->addSubKey($subKey);
+
+ } elseif ($lineExp[0] == 'sub') {
+
+ $subKey = Crypt_GPG_SubKey::parse($line);
+ $key->addSubKey($subKey);
+
+ } elseif ($lineExp[0] == 'fpr') {
+
+ $fingerprint = $lineExp[9];
+
+ // set current sub-key fingerprint
+ $subKey->setFingerprint($fingerprint);
+
+ // if private key exists, set has private to true
+ if (in_array($fingerprint, $privateKeyFingerprints)) {
+ $subKey->setHasPrivate(true);
+ }
+
+ } elseif ($lineExp[0] == 'uid') {
+
+ $string = stripcslashes($lineExp[9]); // as per documentation
+ $userId = new Crypt_GPG_UserId($string);
+
+ if ($lineExp[1] == 'r') {
+ $userId->setRevoked(true);
+ }
+
+ $key->addUserId($userId);
+
+ }
+ }
+
+ // add last key
+ if ($key !== null) {
+ $keys[] = $key;
+ }
+
+ return $keys;
+ }
+
+ // }}}
+}
+
+// }}}
+
+?>
diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php
index 5911c04d7..33517fbcd 100644
--- a/program/lib/Roundcube/html.php
+++ b/program/lib/Roundcube/html.php
@@ -3,7 +3,7 @@
/*
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2011, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,8 +32,8 @@ class html
public static $doctype = 'xhtml';
public static $lc_tags = true;
- public static $common_attrib = array('id','class','style','title','align');
- public static $containers = array('iframe','div','span','p','h1','h2','h3','form','textarea','table','thead','tbody','tr','th','td','style','script');
+ public static $common_attrib = array('id','class','style','title','align','unselectable');
+ public static $containers = array('iframe','div','span','p','h1','h2','h3','ul','form','textarea','table','thead','tbody','tr','th','td','style','script');
/**
@@ -645,7 +645,7 @@ class html_select extends html
$option_content = self::quote($option_content);
}
- $this->content .= self::tag('option', $attr + $option, $option_content, array('class','style','title','disabled'));
+ $this->content .= self::tag('option', $attr + $option, $option_content, array('value','label','class','style','title','disabled','selected'));
}
return parent::show();
@@ -677,8 +677,8 @@ class html_table extends html
*/
public function __construct($attrib = array())
{
- $default_attrib = self::$doctype == 'xhtml' ? array('summary' => '', 'border' => 0) : array();
- $this->attrib = array_merge($attrib, $default_attrib);
+ $default_attrib = self::$doctype == 'xhtml' ? array('summary' => '', 'border' => '0') : array();
+ $this->attrib = array_merge($attrib, $default_attrib);
if (!empty($attrib['tagname']) && $attrib['tagname'] != 'table') {
$this->tagname = $attrib['tagname'];
@@ -880,7 +880,7 @@ class html_table extends html
private function _row_tagname()
{
static $row_tagnames = array('table' => 'tr', 'ul' => 'li', '*' => 'div');
- return $row_tagnames[$this->tagname] ?: $row_tagnames['*'];
+ return $row_tagnames[$this->tagname] ? $row_tagnames[$this->tagname] : $row_tagnames['*'];
}
/**
@@ -889,7 +889,7 @@ class html_table extends html
private function _col_tagname()
{
static $col_tagnames = array('table' => 'td', '*' => 'span');
- return $col_tagnames[$this->tagname] ?: $col_tagnames['*'];
+ return $col_tagnames[$this->tagname] ? $col_tagnames[$this->tagname] : $col_tagnames['*'];
}
}
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index 399f84fd8..69d95f023 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -3,8 +3,8 @@
/*
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2008-2012, The Roundcube Dev Team |
- | Copyright (C) 2011-2012, Kolab Systems AG |
+ | Copyright (C) 2008-2014, The Roundcube Dev Team |
+ | Copyright (C) 2011-2014, Kolab Systems AG |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -94,6 +94,13 @@ class rcube
*/
public $plugins;
+ /**
+ * Instance of rcube_user class.
+ *
+ * @var rcube_user
+ */
+ public $user;
+
/* private/protected vars */
protected $texts;
@@ -642,10 +649,11 @@ class rcube
/**
* Load a localization package
*
- * @param string Language ID
- * @param array Additional text labels/messages
+ * @param string $lang Language ID
+ * @param array $add Additional text labels/messages
+ * @param array $merge Additional text labels/messages to merge
*/
- public function load_language($lang = null, $add = array())
+ public function load_language($lang = null, $add = array(), $merge = array())
{
$lang = $this->language_prop(($lang ? $lang : $_SESSION['language']));
@@ -685,6 +693,11 @@ class rcube
if (is_array($add) && !empty($add)) {
$this->texts += $add;
}
+
+ // merge additional texts (from plugin)
+ if (is_array($merge) && !empty($merge)) {
+ $this->texts = array_merge($this->texts, $merge);
+ }
}
@@ -1108,7 +1121,20 @@ class rcube
// log_driver == 'file' is assumed here
$line = sprintf("[%s]: %s\n", $date, $line);
- $log_dir = self::$instance ? self::$instance->config->get('log_dir') : null;
+ $log_dir = null;
+
+ // per-user logging is activated
+ if (self::$instance && self::$instance->config->get('per_user_logging', false) && self::$instance->get_user_id()) {
+ $log_dir = self::$instance->get_user_log_dir();
+ if (empty($log_dir))
+ return false;
+ }
+ else if (!empty($log['dir'])) {
+ $log_dir = $log['dir'];
+ }
+ else if (self::$instance) {
+ $log_dir = self::$instance->config->get('log_dir');
+ }
if (empty($log_dir)) {
$log_dir = RCUBE_INSTALL_PATH . 'logs';
@@ -1146,7 +1172,6 @@ class rcube
// handle PHP exceptions
if (is_object($arg) && is_a($arg, 'Exception')) {
$arg = array(
- 'type' => 'php',
'code' => $arg->getCode(),
'line' => $arg->getLine(),
'file' => $arg->getFile(),
@@ -1154,7 +1179,7 @@ class rcube
);
}
else if (is_string($arg)) {
- $arg = array('message' => $arg, 'type' => 'php');
+ $arg = array('message' => $arg);
}
if (empty($arg['code'])) {
@@ -1170,7 +1195,7 @@ class rcube
$cli = php_sapi_name() == 'cli';
- if (($log || $terminate) && !$cli && $arg['type'] && $arg['message']) {
+ if (($log || $terminate) && !$cli && $arg['message']) {
$arg['fatal'] = $terminate;
self::log_bug($arg);
}
@@ -1198,7 +1223,7 @@ class rcube
*/
public static function log_bug($arg_arr)
{
- $program = strtoupper($arg_arr['type']);
+ $program = strtoupper(!empty($arg_arr['type']) ? $arg_arr['type'] : 'php');
$level = self::get_instance()->config->get('debug_level');
// disable errors for ajax requests, write to log instead (#1487831)
@@ -1284,6 +1309,20 @@ class rcube
self::write_log($dest, sprintf("%s: %0.4f sec", $label, $diff));
}
+ /**
+ * Setter for system user object
+ *
+ * @param rcube_user Current user instance
+ */
+ public function set_user($user)
+ {
+ if (is_object($user)) {
+ $this->user = $user;
+
+ // overwrite config with user preferences
+ $this->config->set_user_prefs((array)$this->user->get_prefs());
+ }
+ }
/**
* Getter for logged user ID.
@@ -1347,6 +1386,17 @@ class rcube
}
}
+ /**
+ * Get the per-user log directory
+ */
+ protected function get_user_log_dir()
+ {
+ $log_dir = $this->config->get('log_dir', RCUBE_INSTALL_PATH . 'logs');
+ $user_name = $this->get_user_name();
+ $user_log_dir = $log_dir . '/' . $user_name;
+
+ return !empty($user_name) && is_writable($user_log_dir) ? $user_log_dir : false;
+ }
/**
* Getter for logged user language code.
@@ -1537,6 +1587,10 @@ class rcube
!empty($response) ? join('; ', $response) : ''));
}
}
+ else {
+ // allow plugins to catch sending errors with the same parameters as in 'message_before_send'
+ $this->plugins->exec_hook('message_send_error', $plugin + array('error' => $error));
+ }
if (is_resource($msg_body)) {
fclose($msg_body);
diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php
index 6e2b439d8..4d9fa3db1 100644
--- a/program/lib/Roundcube/rcube_addressbook.php
+++ b/program/lib/Roundcube/rcube_addressbook.php
@@ -209,6 +209,7 @@ abstract class rcube_addressbook
public function validate(&$save_data, $autofix = false)
{
$rcube = rcube::get_instance();
+ $valid = true;
// check validity of email addresses
foreach ($this->get_col_values('email', $save_data, true) as $email) {
@@ -216,12 +217,28 @@ abstract class rcube_addressbook
if (!rcube_utils::check_email(rcube_utils::idn_to_ascii($email))) {
$error = $rcube->gettext(array('name' => 'emailformaterror', 'vars' => array('email' => $email)));
$this->set_error(self::ERROR_VALIDATE, $error);
- return false;
+ $valid = false;
+ break;
}
}
}
- return true;
+ // allow plugins to do contact validation and auto-fixing
+ $plugin = $rcube->plugins->exec_hook('contact_validate', array(
+ 'record' => $save_data,
+ 'autofix' => $autofix,
+ 'valid' => $valid,
+ ));
+
+ if ($valid && !$plugin['valid']) {
+ $this->set_error(self::ERROR_VALIDATE, $plugin['error']);
+ }
+
+ if (is_array($plugin['record'])) {
+ $save_data = $plugin['record'];
+ }
+
+ return $plugin['valid'];
}
/**
@@ -264,7 +281,8 @@ abstract class rcube_addressbook
* @param array Assoziative array with save data
* Keys: Field name with optional section in the form FIELD:SECTION
* Values: Field value. Can be either a string or an array of strings for multiple values
- * @return boolean True on success, False on error
+ *
+ * @return mixed On success if ID has been changed returns ID, otherwise True, False on error
*/
function update($id, $save_cols)
{
@@ -294,8 +312,10 @@ abstract class rcube_addressbook
/**
* Mark all records in database as deleted
+ *
+ * @param bool $with_groups Remove also groups
*/
- function delete_all()
+ function delete_all($with_groups = false)
{
/* empty for read-only address books */
}
@@ -515,8 +535,12 @@ abstract class rcube_addressbook
$fn = join(' ', array($contact['surname'], $contact['firstname'], $contact['middlename']));
else if ($compose_mode == 1)
$fn = join(' ', array($contact['firstname'], $contact['middlename'], $contact['surname']));
- else
+ else if ($compose_mode == 0)
$fn = !empty($contact['name']) ? $contact['name'] : join(' ', array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix']));
+ else {
+ $plugin = rcube::get_instance()->plugins->exec_hook('contact_listname', array('contact' => $contact));
+ $fn = $plugin['fn'];
+ }
$fn = trim($fn, ', ');
diff --git a/program/lib/Roundcube/rcube_browser.php b/program/lib/Roundcube/rcube_browser.php
index 34128291b..b9642d8f9 100644
--- a/program/lib/Roundcube/rcube_browser.php
+++ b/program/lib/Roundcube/rcube_browser.php
@@ -28,32 +28,30 @@ class rcube_browser
{
$HTTP_USER_AGENT = strtolower($_SERVER['HTTP_USER_AGENT']);
- $this->ver = 0;
- $this->win = strpos($HTTP_USER_AGENT, 'win') != false;
- $this->mac = strpos($HTTP_USER_AGENT, 'mac') != false;
+ $this->ver = 0;
+ $this->win = strpos($HTTP_USER_AGENT, 'win') != false;
+ $this->mac = strpos($HTTP_USER_AGENT, 'mac') != false;
$this->linux = strpos($HTTP_USER_AGENT, 'linux') != false;
$this->unix = strpos($HTTP_USER_AGENT, 'unix') != false;
- $this->opera = strpos($HTTP_USER_AGENT, 'opera') !== false;
- $this->ns4 = strpos($HTTP_USER_AGENT, 'mozilla/4') !== false && strpos($HTTP_USER_AGENT, 'msie') === false;
- $this->ns = ($this->ns4 || strpos($HTTP_USER_AGENT, 'netscape') !== false);
- $this->ie = !$this->opera && strpos($HTTP_USER_AGENT, 'compatible; msie') !== false;
- $this->khtml = strpos($HTTP_USER_AGENT, 'khtml') !== false;
- $this->mz = !$this->ie && !$this->khtml && strpos($HTTP_USER_AGENT, 'mozilla/5') !== false;
- $this->chrome = strpos($HTTP_USER_AGENT, 'chrome') !== false;
- $this->safari = !$this->chrome && ($this->khtml || strpos($HTTP_USER_AGENT, 'safari') !== false);
+ $this->webkit = strpos($HTTP_USER_AGENT, 'applewebkit') !== false;
+ $this->opera = strpos($HTTP_USER_AGENT, 'opera') !== false || ($this->webkit && strpos($HTTP_USER_AGENT, 'opr/') !== false);
+ $this->ns = strpos($HTTP_USER_AGENT, 'netscape') !== false;
+ $this->chrome = !$this->opera && strpos($HTTP_USER_AGENT, 'chrome') !== false;
+ $this->ie = !$this->opera && (strpos($HTTP_USER_AGENT, 'compatible; msie') !== false || strpos($HTTP_USER_AGENT, 'trident/') !== false);
+ $this->safari = !$this->opera && !$this->chrome && ($this->webkit || strpos($HTTP_USER_AGENT, 'safari') !== false);
+ $this->mz = !$this->ie && !$this->safari && !$this->chrome && !$this->ns && !$this->opera && strpos($HTTP_USER_AGENT, 'mozilla') !== false;
- if ($this->ns || $this->chrome) {
- $test = preg_match('/(mozilla|chrome)\/([0-9.]+)/', $HTTP_USER_AGENT, $regs);
- $this->ver = $test ? (float)$regs[2] : 0;
+ if ($this->opera) {
+ if (preg_match('/(opera|opr)\/([0-9.]+)/', $HTTP_USER_AGENT, $regs)) {
+ $this->ver = (float) $regs[2];
+ }
}
- else if ($this->mz) {
- $test = preg_match('/rv:([0-9.]+)/', $HTTP_USER_AGENT, $regs);
- $this->ver = $test ? (float)$regs[1] : 0;
+ else if (preg_match('/(chrome|msie|version|khtml)(\s*|\/)([0-9.]+)/', $HTTP_USER_AGENT, $regs)) {
+ $this->ver = (float) $regs[3];
}
- else if ($this->ie || $this->opera) {
- $test = preg_match('/(msie|opera) ([0-9.]+)/', $HTTP_USER_AGENT, $regs);
- $this->ver = $test ? (float)$regs[2] : 0;
+ else if (preg_match('/rv:([0-9.]+)/', $HTTP_USER_AGENT, $regs)) {
+ $this->ver = (float) $regs[1];
}
if (preg_match('/ ([a-z]{2})-([a-z]{2})/', $HTTP_USER_AGENT, $regs))
@@ -61,10 +59,10 @@ class rcube_browser
else
$this->lang = 'en';
- $this->dom = ($this->mz || $this->safari || ($this->ie && $this->ver>=5) || ($this->opera && $this->ver>=7));
+ $this->dom = $this->mz || $this->safari || ($this->ie && $this->ver>=5) || ($this->opera && $this->ver>=7);
$this->pngalpha = $this->mz || $this->safari || ($this->ie && $this->ver>=5.5) ||
($this->ie && $this->ver>=5 && $this->mac) || ($this->opera && $this->ver>=7) ? true : false;
- $this->imgdata = !$this->ie;
+ $this->imgdata = !$this->ie;
}
}
diff --git a/program/lib/Roundcube/rcube_charset.php b/program/lib/Roundcube/rcube_charset.php
index 19dbf6cbc..8612e7fca 100644
--- a/program/lib/Roundcube/rcube_charset.php
+++ b/program/lib/Roundcube/rcube_charset.php
@@ -199,10 +199,13 @@ class rcube_charset
$iconv_options = '';
}
}
+ else {
+ $iconv_options = false;
+ }
}
// convert charset using iconv module
- if ($iconv_options !== null && $from != 'UTF7-IMAP' && $to != 'UTF7-IMAP') {
+ if ($iconv_options !== false && $from != 'UTF7-IMAP' && $to != 'UTF7-IMAP') {
// throw an exception if iconv reports an illegal character in input
// it means that input string has been truncated
set_error_handler(array('rcube_charset', 'error_handler'), E_NOTICE);
@@ -224,10 +227,13 @@ class rcube_charset
$mbstring_list = mb_list_encodings();
$mbstring_list = array_map('strtoupper', $mbstring_list);
}
+ else {
+ $mbstring_list = false;
+ }
}
// convert charset using mbstring module
- if ($mbstring_list !== null) {
+ if ($mbstring_list !== false) {
$aliases['WINDOWS-1257'] = 'ISO-8859-13';
// it happens that mbstring supports ASCII but not US-ASCII
if (($from == 'US-ASCII' || $to == 'US-ASCII') && !in_array('US-ASCII', $mbstring_list)) {
diff --git a/program/lib/Roundcube/rcube_config.php b/program/lib/Roundcube/rcube_config.php
index 04b914c3d..afe13e879 100644
--- a/program/lib/Roundcube/rcube_config.php
+++ b/program/lib/Roundcube/rcube_config.php
@@ -63,7 +63,7 @@ class rcube_config
$this->paths = explode(PATH_SEPARATOR, $paths);
// make all paths absolute
foreach ($this->paths as $i => $path) {
- if (!$this->_is_absolute($path)) {
+ if (!rcube_utils::is_absolute_path($path)) {
if ($realpath = realpath(RCUBE_INSTALL_PATH . $path)) {
$this->paths[$i] = unslashify($realpath) . '/';
}
@@ -243,8 +243,8 @@ class rcube_config
*/
public function resolve_paths($file, $use_env = true)
{
- $files = array();
- $abs_path = $this->_is_absolute($file);
+ $files = array();
+ $abs_path = rcube_utils::is_absolute_path($file);
foreach ($this->paths as $basepath) {
$realpath = $abs_path ? $file : realpath($basepath . '/' . $file);
@@ -270,14 +270,6 @@ class rcube_config
}
/**
- * Determine whether the given file path is absolute or relative
- */
- private function _is_absolute($path)
- {
- return $path[0] == DIRECTORY_SEPARATOR || preg_match('!^[a-z]:[\\\\/]!i', $path);
- }
-
- /**
* Getter for a specific config parameter
*
* @param string $name Parameter name
@@ -373,7 +365,11 @@ class rcube_config
*/
public function all()
{
- return $this->prop;
+ $rcube = rcube::get_instance();
+ $plugin = $rcube->plugins->exec_hook('config_get', array(
+ 'name' => '*', 'result' => $this->prop));
+
+ return $plugin['result'];
}
/**
diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php
index 6d01368a1..d215760cf 100644
--- a/program/lib/Roundcube/rcube_contacts.php
+++ b/program/lib/Roundcube/rcube_contacts.php
@@ -350,7 +350,7 @@ class rcube_contacts extends rcube_addressbook
if (in_array($col, $this->table_cols)) {
switch ($mode) {
case 1: // strict
- $where[] = '(' . $this->db->quoteIdentifier($col) . ' = ' . $this->db->quote($val)
+ $where[] = '(' . $this->db->quote_identifier($col) . ' = ' . $this->db->quote($val)
. ' OR ' . $this->db->ilike($col, $val . $AS . '%')
. ' OR ' . $this->db->ilike($col, '%' . $AS . $val . $AS . '%')
. ' OR ' . $this->db->ilike($col, '%' . $AS . $val) . ')';
@@ -390,7 +390,7 @@ class rcube_contacts extends rcube_addressbook
}
foreach (array_intersect($required, $this->table_cols) as $col) {
- $and_where[] = $this->db->quoteIdentifier($col).' <> '.$this->db->quote('');
+ $and_where[] = $this->db->quote_identifier($col).' <> '.$this->db->quote('');
}
if (!empty($where)) {
@@ -592,8 +592,8 @@ class rcube_contacts extends rcube_addressbook
// validate e-mail addresses
$valid = parent::validate($save_data, $autofix);
- // require at least one e-mail address (syntax check is already done)
- if ($valid && !array_filter($this->get_col_values('email', $save_data, true))) {
+ // require at least one email address or a name
+ if ($valid && !strlen($save_data['firstname'].$save_data['surname'].$save_data['name']) && !array_filter($this->get_col_values('email', $save_data, true))) {
$this->set_error(self::ERROR_VALIDATE, 'noemailwarning');
$valid = false;
}
@@ -626,11 +626,11 @@ class rcube_contacts extends rcube_addressbook
}
}
- $save_data = $this->convert_save_data($save_data);
+ $save_data = $this->convert_save_data($save_data);
$a_insert_cols = $a_insert_values = array();
foreach ($save_data as $col => $value) {
- $a_insert_cols[] = $this->db->quoteIdentifier($col);
+ $a_insert_cols[] = $this->db->quote_identifier($col);
$a_insert_values[] = $this->db->quote($value);
}
@@ -655,17 +655,18 @@ class rcube_contacts extends rcube_addressbook
*
* @param mixed Record identifier
* @param array Assoziative array with save data
+ *
* @return boolean True on success, False on error
*/
function update($id, $save_cols)
{
- $updated = false;
+ $updated = false;
$write_sql = array();
- $record = $this->get_record($id, true);
+ $record = $this->get_record($id, true);
$save_cols = $this->convert_save_data($save_cols, $record);
foreach ($save_cols as $col => $value) {
- $write_sql[] = sprintf("%s=%s", $this->db->quoteIdentifier($col), $this->db->quote($value));
+ $write_sql[] = sprintf("%s=%s", $this->db->quote_identifier($col), $this->db->quote($value));
}
if (!empty($write_sql)) {
@@ -683,7 +684,7 @@ class rcube_contacts extends rcube_addressbook
$this->result = null; // clear current result (from get_record())
}
- return $updated;
+ return $updated ? true : false;
}
@@ -812,16 +813,30 @@ class rcube_contacts extends rcube_addressbook
/**
* Remove all records from the database
+ *
+ * @param bool $with_groups Remove also groups
+ *
+ * @return int Number of removed records
*/
- function delete_all()
+ function delete_all($with_groups = false)
{
$this->cache = null;
- $this->db->query("UPDATE ".$this->db->table_name($this->db_name).
- " SET del=1, changed=".$this->db->now().
- " WHERE user_id = ?", $this->user_id);
+ $this->db->query("UPDATE " . $this->db->table_name($this->db_name)
+ . " SET del = 1, changed = " . $this->db->now()
+ . " WHERE user_id = ?", $this->user_id);
- return $this->db->affected_rows();
+ $count = $this->db->affected_rows();
+
+ if ($with_groups) {
+ $this->db->query("UPDATE " . $this->db->table_name($this->db_groups)
+ . " SET del = 1, changed = " . $this->db->now()
+ . " WHERE user_id = ?", $this->user_id);
+
+ $count += $this->db->affected_rows();
+ }
+
+ return $count;
}
@@ -860,11 +875,11 @@ class rcube_contacts extends rcube_addressbook
function delete_group($gid)
{
// flag group record as deleted
- $sql_result = $this->db->query(
- "UPDATE ".$this->db->table_name($this->db_groups).
- " SET del=1, changed=".$this->db->now().
- " WHERE contactgroup_id=?".
- " AND user_id=?",
+ $this->db->query(
+ "UPDATE " . $this->db->table_name($this->db_groups)
+ . " SET del = 1, changed = " . $this->db->now()
+ . " WHERE contactgroup_id = ?"
+ . " AND user_id = ?",
$gid, $this->user_id
);
@@ -873,7 +888,6 @@ class rcube_contacts extends rcube_addressbook
return $this->db->affected_rows();
}
-
/**
* Rename a specific contact group
*
diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php
index 00e6d4e20..aa385dce4 100644
--- a/program/lib/Roundcube/rcube_csv2vcard.php
+++ b/program/lib/Roundcube/rcube_csv2vcard.php
@@ -47,7 +47,7 @@ class rcube_csv2vcard
//'business_street_2' => '',
//'business_street_3' => '',
'car_phone' => 'phone:car',
- 'categories' => 'categories',
+ 'categories' => 'groups',
//'children' => '',
'company' => 'organization',
//'company_main_phone' => '',
@@ -146,6 +146,9 @@ class rcube_csv2vcard
'work_title' => 'jobtitle',
'work_zip' => 'zipcode:work',
'group' => 'groups',
+
+ // GMail
+ 'groups' => 'groups',
);
/**
@@ -427,6 +430,11 @@ class rcube_csv2vcard
$contact['birthday'] = $contact['birthday-y'] .'-' .$contact['birthday-m'] . '-' . $contact['birthday-d'];
}
+ // categories/groups separator in vCard is ',' not ';'
+ if (!empty($contact['groups'])) {
+ $contact['groups'] = str_replace(';', ',', $contact['groups']);
+ }
+
// Empty dates, e.g. "0/0/00", "0000-00-00 00:00:00"
foreach (array('birthday', 'anniversary') as $key) {
if (!empty($contact[$key])) {
diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php
index aaba28172..2828f26ee 100644
--- a/program/lib/Roundcube/rcube_db.php
+++ b/program/lib/Roundcube/rcube_db.php
@@ -392,7 +392,7 @@ class rcube_db
*/
protected function _query($query, $offset, $numrows, $params)
{
- $query = trim($query);
+ $query = ltrim($query);
$this->db_connect($this->dsn_select($query), true);
@@ -405,27 +405,28 @@ class rcube_db
$query = $this->set_limit($query, $numrows, $offset);
}
- $params = (array) $params;
-
// Because in Roundcube we mostly use queries that are
// executed only once, we will not use prepared queries
$pos = 0;
$idx = 0;
- while ($pos = strpos($query, '?', $pos)) {
- if ($query[$pos+1] == '?') { // skip escaped ?
- $pos += 2;
- }
- else {
- $val = $this->quote($params[$idx++]);
- unset($params[$idx-1]);
- $query = substr_replace($query, $val, $pos, 1);
- $pos += strlen($val);
+ if (count($params)) {
+ while ($pos = strpos($query, '?', $pos)) {
+ if ($query[$pos+1] == '?') { // skip escaped '?'
+ $pos += 2;
+ }
+ else {
+ $val = $this->quote($params[$idx++]);
+ unset($params[$idx-1]);
+ $query = substr_replace($query, $val, $pos, 1);
+ $pos += strlen($val);
+ }
}
}
- // replace escaped ? back to normal
- $query = rtrim(strtr($query, array('??' => '?')), ';');
+ // replace escaped '?' back to normal, see self::quote()
+ $query = str_replace('??', '?', $query);
+ $query = rtrim($query, " \t\n\r\0\x0B;");
$this->debug($query);
diff --git a/program/lib/Roundcube/rcube_html2text.php b/program/lib/Roundcube/rcube_html2text.php
index 6f79e2f8e..3b4508da9 100644
--- a/program/lib/Roundcube/rcube_html2text.php
+++ b/program/lib/Roundcube/rcube_html2text.php
@@ -608,7 +608,7 @@ class rcube_html2text
$this->width = $p_width;
// Add citation markers and create <pre> block
- $body = preg_replace_callback('/((?:^|\n)>*)([^\n]*)/', array($this, 'blockquote_citation_ballback'), trim($body));
+ $body = preg_replace_callback('/((?:^|\n)>*)([^\n]*)/', array($this, 'blockquote_citation_callback'), trim($body));
$body = '<pre>' . htmlspecialchars($body) . '</pre>';
$text = substr_replace($text, $body . "\n", $start, $end + 13 - $start);
@@ -616,6 +616,10 @@ class rcube_html2text
break;
}
+ // abort on invalid tag structure (e.g. no closing tag found)
+ else {
+ break;
+ }
}
while ($end || $next);
}
@@ -624,7 +628,7 @@ class rcube_html2text
/**
* Callback function to correctly add citation markers for blockquote contents
*/
- public function blockquote_citation_ballback($m)
+ public function blockquote_citation_callback($m)
{
$line = ltrim($m[2]);
$space = $line[0] == '>' ? '' : ' ';
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 9faf1bbc6..432227091 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -680,6 +680,41 @@ class rcube_imap extends rcube_storage
/**
+ * Public method for listing message flags
+ *
+ * @param string $folder Folder name
+ * @param array $uids Message UIDs
+ * @param int $mod_seq Optional MODSEQ value (of last flag update)
+ *
+ * @return array Indexed array with message flags
+ */
+ public function list_flags($folder, $uids, $mod_seq = null)
+ {
+ if (!strlen($folder)) {
+ $folder = $this->folder;
+ }
+
+ if (!$this->check_connection()) {
+ return array();
+ }
+
+ // @TODO: when cache was synchronized in this request
+ // we might already have asked for flag updates, use it.
+
+ $flags = $this->conn->fetch($folder, $uids, true, array('FLAGS'), $mod_seq);
+ $result = array();
+
+ if (!empty($flags)) {
+ foreach ($flags as $message) {
+ $result[$message->uid] = $message->flags;
+ }
+ }
+
+ return $result;
+ }
+
+
+ /**
* Public method for listing headers
*
* @param string $folder Folder name
@@ -1409,7 +1444,7 @@ class rcube_imap extends rcube_storage
public function search_once($folder = null, $str = 'ALL')
{
if (!$str) {
- return 'ALL';
+ $str = 'ALL';
}
if (!strlen($folder)) {
@@ -2121,7 +2156,7 @@ class rcube_imap extends rcube_storage
// convert charset (if text or message part)
if ($body && preg_match('/^(text|message)$/', $o_part->ctype_primary)) {
// Remove NULL characters if any (#1486189)
- if (strpos($body, "\x00") !== false) {
+ if ($formatted && strpos($body, "\x00") !== false) {
$body = str_replace("\x00", '', $body);
}
@@ -2843,12 +2878,21 @@ class rcube_imap extends rcube_storage
/**
* Filter the given list of folders according to access rights
+ *
+ * For performance reasons we assume user has full rights
+ * on all personal folders.
*/
protected function filter_rights($a_folders, $rights)
{
$regex = '/('.$rights.')/';
+
foreach ($a_folders as $idx => $folder) {
+ if ($this->folder_namespace($folder) == 'personal') {
+ continue;
+ }
+
$myrights = join('', (array)$this->my_rights($folder));
+
if ($myrights !== null && !preg_match($regex, $myrights)) {
unset($a_folders[$idx]);
}
@@ -3848,9 +3892,12 @@ class rcube_imap extends rcube_storage
/**
* Sort folders first by default folders and then in alphabethical order
*
- * @param array $a_folders Folders list
+ * @param array $a_folders Folders list
+ * @param bool $skip_default Skip default folders handling
+ *
+ * @return array Sorted list
*/
- protected function sort_folder_list($a_folders)
+ public function sort_folder_list($a_folders, $skip_default = false)
{
$a_out = $a_defaults = $folders = array();
@@ -3862,7 +3909,7 @@ class rcube_imap extends rcube_storage
continue;
}
- if (($p = array_search($folder, $this->default_folders)) !== false && !$a_defaults[$p]) {
+ if (!$skip_default && ($p = array_search($folder, $this->default_folders)) !== false && !$a_defaults[$p]) {
$a_defaults[$p] = $folder;
}
else {
diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php
index a8166545e..0c3edeaad 100644
--- a/program/lib/Roundcube/rcube_imap_cache.php
+++ b/program/lib/Roundcube/rcube_imap_cache.php
@@ -1250,10 +1250,8 @@ class rcube_imap_cache
unset($msg->replaces);
- if (is_array($msg->structure->parts)) {
- foreach ($msg->structure->parts as $part) {
- $this->message_object_prepare($part, $size);
- }
+ if (is_object($msg->structure)) {
+ $this->message_object_prepare($msg->structure, $size);
}
if (is_array($msg->parts)) {
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index f9a62f010..9035840a8 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -73,6 +73,7 @@ class rcube_imap_generic
const COMMAND_NORESPONSE = 1;
const COMMAND_CAPABILITY = 2;
const COMMAND_LASTLINE = 4;
+ const COMMAND_ANONYMIZED = 8;
const DEBUG_LINE_LENGTH = 4098; // 4KB + 2B for \r\n
@@ -88,16 +89,28 @@ class rcube_imap_generic
*
* @param string $string Command string
* @param bool $endln True if CRLF need to be added at the end of command
+ * @param bool $anonymized Don't write the given data to log but a placeholder
*
* @param int Number of bytes sent, False on error
*/
- function putLine($string, $endln=true)
+ function putLine($string, $endln=true, $anonymized=false)
{
if (!$this->fp)
return false;
if ($this->_debug) {
- $this->debug('C: '. rtrim($string));
+ // anonymize the sent command for logging
+ $cut = $endln ? 2 : 0;
+ if ($anonymized && preg_match('/^(A\d+ (?:[A-Z]+ )+)(.+)/', $string, $m)) {
+ $log = $m[1] . sprintf('****** [%d]', strlen($m[2]) - $cut);
+ }
+ else if ($anonymized) {
+ $log = sprintf('****** [%d]', strlen($string) - $cut);
+ }
+ else {
+ $log = rtrim($string);
+ }
+ $this->debug('C: ' . $log);
}
$res = fwrite($this->fp, $string . ($endln ? "\r\n" : ''));
@@ -116,10 +129,11 @@ class rcube_imap_generic
*
* @param string $string Command string
* @param bool $endln True if CRLF need to be added at the end of command
+ * @param bool $anonymized Don't write the given data to log but a placeholder
*
* @return int|bool Number of bytes sent, False on error
*/
- function putLineC($string, $endln=true)
+ function putLineC($string, $endln=true, $anonymized=false)
{
if (!$this->fp) {
return false;
@@ -138,7 +152,7 @@ class rcube_imap_generic
$parts[$i+1] = sprintf("{%d+}\r\n", $matches[1]);
}
- $bytes = $this->putLine($parts[$i].$parts[$i+1], false);
+ $bytes = $this->putLine($parts[$i].$parts[$i+1], false, $anonymized);
if ($bytes === false)
return false;
$res += $bytes;
@@ -153,7 +167,7 @@ class rcube_imap_generic
$i++;
}
else {
- $bytes = $this->putLine($parts[$i], false);
+ $bytes = $this->putLine($parts[$i], false, $anonymized);
if ($bytes === false)
return false;
$res += $bytes;
@@ -519,7 +533,7 @@ class rcube_imap_generic
$reply = base64_encode($user . ' ' . $hash);
// send result
- $this->putLine($reply);
+ $this->putLine($reply, true, true);
}
else {
// RFC2831: DIGEST-MD5
@@ -537,7 +551,7 @@ class rcube_imap_generic
base64_decode($challenge), $this->host, 'imap', $user));
// send result
- $this->putLine($reply);
+ $this->putLine($reply, true, true);
$line = trim($this->readReply());
if ($line[0] == '+') {
@@ -577,7 +591,7 @@ class rcube_imap_generic
// RFC 4959 (SASL-IR): save one round trip
if ($this->getCapability('SASL-IR')) {
list($result, $line) = $this->execute("AUTHENTICATE PLAIN", array($reply),
- self::COMMAND_LASTLINE | self::COMMAND_CAPABILITY);
+ self::COMMAND_LASTLINE | self::COMMAND_CAPABILITY | self::COMMAND_ANONYMIZED);
}
else {
$this->putLine($this->nextTag() . " AUTHENTICATE PLAIN");
@@ -588,7 +602,7 @@ class rcube_imap_generic
}
// send result, get reply and process it
- $this->putLine($reply);
+ $this->putLine($reply, true, true);
$line = $this->readReply();
$result = $this->parseResult($line);
}
@@ -3419,7 +3433,7 @@ class rcube_imap_generic
}
// Send command
- if (!$this->putLineC($query)) {
+ if (!$this->putLineC($query, true, ($options & self::COMMAND_ANONYMIZED))) {
$this->setError(self::ERROR_COMMAND, "Unable to send command: $query");
return $noresp ? self::ERROR_COMMAND : array(self::ERROR_COMMAND, '');
}
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index 64288f973..de3790e5c 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -52,7 +52,7 @@ class rcube_ldap extends rcube_addressbook
*
* @var array
*/
- private static $group_types = array(
+ private $group_types = array(
'group' => 'member',
'groupofnames' => 'member',
'kolabgroupofnames' => 'member',
@@ -94,6 +94,9 @@ class rcube_ldap extends rcube_addressbook
$this->prop['groups']['name_attr'] = 'cn';
if (empty($this->prop['groups']['scope']))
$this->prop['groups']['scope'] = 'sub';
+ // extend group objectclass => member attribute mapping
+ if (!empty($this->prop['groups']['class_member_attr']))
+ $this->group_types = array_merge($this->group_types, $this->prop['groups']['class_member_attr']);
// add group name attrib to the list of attributes to be fetched
$fetch_attributes[] = $this->prop['groups']['name_attr'];
@@ -292,6 +295,14 @@ class rcube_ldap extends rcube_addressbook
if ($this->prop['search_base_dn'] && $this->prop['search_filter']
&& (strstr($bind_dn, '%dn') || strstr($this->base_dn, '%dn') || strstr($this->groups_base_dn, '%dn'))
) {
+ $search_attribs = array('uid');
+ if ($search_bind_attrib = (array)$this->prop['search_bind_attrib']) {
+ foreach ($search_bind_attrib as $r => $attr) {
+ $search_attribs[] = $attr;
+ $replaces[$r] = '';
+ }
+ }
+
$search_bind_dn = strtr($this->prop['search_bind_dn'], $replaces);
$search_base_dn = strtr($this->prop['search_base_dn'], $replaces);
$search_filter = strtr($this->prop['search_filter'], $replaces);
@@ -321,10 +332,18 @@ class rcube_ldap extends rcube_addressbook
}
}
- $res = $ldap->search($search_base_dn, $search_filter, 'sub', array('uid'));
+ $res = $ldap->search($search_base_dn, $search_filter, 'sub', $search_attribs);
if ($res) {
$res->rewind();
$replaces['%dn'] = $res->get_dn();
+
+ // add more replacements from 'search_bind_attrib' config
+ if ($search_bind_attrib) {
+ $res = $res->current();
+ foreach ($search_bind_attrib as $r => $attr) {
+ $replaces[$r] = $res[$attr][0];
+ }
+ }
}
if ($ldap != $this->ldap) {
@@ -355,6 +374,23 @@ class rcube_ldap extends rcube_addressbook
$this->base_dn = strtr($this->base_dn, $replaces);
$this->groups_base_dn = strtr($this->groups_base_dn, $replaces);
+ // replace placeholders in filter settings
+ if (!empty($this->prop['filter']))
+ $this->prop['filter'] = strtr($this->prop['filter'], $replaces);
+ if (!empty($this->prop['groups']['filter']))
+ $this->prop['groups']['filter'] = strtr($this->prop['groups']['filter'], $replaces);
+ if (!empty($this->prop['groups']['member_filter']))
+ $this->prop['groups']['member_filter'] = strtr($this->prop['groups']['member_filter'], $replaces);
+
+ if (!empty($this->prop['group_filters'])) {
+ foreach ($this->prop['group_filters'] as $i => $gf) {
+ if (!empty($gf['base_dn']))
+ $this->prop['group_filters'][$i]['base_dn'] = strtr($gf['base_dn'], $replaces);
+ if (!empty($gf['filter']))
+ $this->prop['group_filters'][$i]['filter'] = strtr($gf['filter'], $replaces);
+ }
+ }
+
if (empty($bind_user)) {
$bind_user = $u;
}
@@ -518,7 +554,7 @@ class rcube_ldap extends rcube_addressbook
}
else {
$prop = $this->group_id ? $this->group_data : $this->prop;
- $base_dn = $this->group_id ? $this->group_base_dn : $this->base_dn;
+ $base_dn = $this->group_id ? $prop['base_dn'] : $this->base_dn;
// use global search filter
if (!empty($this->filter))
@@ -559,9 +595,10 @@ class rcube_ldap extends rcube_addressbook
/**
* Get all members of the given group
*
- * @param string Group DN
- * @param array Group entries (if called recursively)
- * @return array Accumulated group members
+ * @param string Group DN
+ * @param boolean Count only
+ * @param array Group entries (if called recursively)
+ * @return array Accumulated group members
*/
function list_group_members($dn, $count = false, $entries = null)
{
@@ -569,7 +606,7 @@ class rcube_ldap extends rcube_addressbook
// fetch group object
if (empty($entries)) {
- $attribs = array('dn','objectClass','member','uniqueMember','memberURL');
+ $attribs = array_merge(array('dn','objectClass','memberURL'), array_values($this->group_types));
$entries = $this->ldap->read_entries($dn, '(objectClass=*)', $attribs);
if ($entries === false) {
return $group_members;
@@ -581,17 +618,17 @@ class rcube_ldap extends rcube_addressbook
$attrs = array();
foreach ((array)$entry['objectclass'] as $objectclass) {
- if (strtolower($objectclass) == 'groupofurls') {
- $members = $this->_list_group_memberurl($dn, $entry, $count);
- $group_members = array_merge($group_members, $members);
- }
- else if (($member_attr = $this->get_group_member_attr(array($objectclass), ''))
+ if (($member_attr = $this->get_group_member_attr(array($objectclass), ''))
&& ($member_attr = strtolower($member_attr)) && !in_array($member_attr, $attrs)
) {
$members = $this->_list_group_members($dn, $entry, $member_attr, $count);
$group_members = array_merge($group_members, $members);
$attrs[] = $member_attr;
}
+ else if (!empty($entry['memberurl'])) {
+ $members = $this->_list_group_memberurl($dn, $entry, $count);
+ $group_members = array_merge($group_members, $members);
+ }
if ($this->prop['sizelimit'] && count($group_members) > $this->prop['sizelimit']) {
break 2;
@@ -608,6 +645,7 @@ class rcube_ldap extends rcube_addressbook
* @param string Group DN
* @param array Group entry
* @param string Member attribute to use
+ * @param boolean Count only
* @return array Accumulated group members
*/
private function _list_group_members($dn, $entry, $attr, $count)
@@ -621,8 +659,7 @@ class rcube_ldap extends rcube_addressbook
// read these attributes for all members
$attrib = $count ? array('dn','objectClass') : $this->prop['list_attributes'];
- $attrib[] = 'member';
- $attrib[] = 'uniqueMember';
+ $attrib = array_merge($attrib, array_values($this->group_types));
$attrib[] = 'memberURL';
$filter = $this->prop['groups']['member_filter'] ? $this->prop['groups']['member_filter'] : '(objectclass=*)';
@@ -669,7 +706,7 @@ class rcube_ldap extends rcube_addressbook
if ($result = $this->ldap->search($m[1], $filter, $m[2], $attrs, $this->group_data)) {
$entries = $result->entries();
for ($j = 0; $j < $entries['count']; $j++) {
- if (self::is_group_entry($entries[$j]) && ($nested_group_members = $this->list_group_members($entries[$j]['dn'], $count)))
+ if ($this->is_group_entry($entries[$j]) && ($nested_group_members = $this->list_group_members($entries[$j]['dn'], $count)))
$group_members = array_merge($group_members, $nested_group_members);
else
$group_members[] = $entries[$j];
@@ -1287,8 +1324,10 @@ class rcube_ldap extends rcube_addressbook
/**
* Remove all contact records
+ *
+ * @param bool $with_groups Delete also groups if enabled
*/
- function delete_all()
+ function delete_all($with_groups = false)
{
// searching for contact entries
$dn_list = $this->ldap->list_entries($this->base_dn, $this->prop['filter'] ? $this->prop['filter'] : '(objectclass=*)');
@@ -1299,6 +1338,16 @@ class rcube_ldap extends rcube_addressbook
}
$this->delete($dn_list);
}
+
+ if ($with_groups && $this->groups && ($groups = $this->_fetch_groups()) && count($groups)) {
+ foreach ($groups as $group) {
+ $this->ldap->delete($group['dn']);
+ }
+
+ if ($this->cache) {
+ $this->cache->remove('groups');
+ }
+ }
}
/**
@@ -1354,7 +1403,7 @@ class rcube_ldap extends rcube_addressbook
$out[$this->primary_key] = self::dn_encode($rec['dn']);
// determine record type
- if (self::is_group_entry($rec)) {
+ if ($this->is_group_entry($rec)) {
$out['_type'] = 'group';
$out['readonly'] = true;
$fieldmap['name'] = $this->group_data['name_attr'] ? $this->group_data['name_attr'] : $this->prop['groups']['name_attr'];
@@ -1479,11 +1528,11 @@ class rcube_ldap extends rcube_addressbook
/**
* Determines whether the given LDAP entry is a group record
*/
- private static function is_group_entry($entry)
+ private function is_group_entry($entry)
{
$classes = array_map('strtolower', (array)$entry['objectclass']);
- return count(array_intersect(array_keys(self::$group_types), $classes)) > 0;
+ return count(array_intersect(array_keys($this->group_types), $classes)) > 0;
}
/**
@@ -1569,11 +1618,12 @@ class rcube_ldap extends rcube_addressbook
// special case: list groups from 'group_filters' config
if ($vlv_page === null && !empty($this->prop['group_filters'])) {
$groups = array();
+ $rcube = rcube::get_instance();
// list regular groups configuration as special filter
if (!empty($this->prop['groups']['filter'])) {
$id = '__groups__';
- $groups[$id] = array('ID' => $id, 'name' => rcube_label('groups'), 'virtual' => true) + $this->prop['groups'];
+ $groups[$id] = array('ID' => $id, 'name' => $rcube->gettext('groups'), 'virtual' => true) + $this->prop['groups'];
}
foreach ($this->prop['group_filters'] as $id => $prop) {
@@ -1914,7 +1964,7 @@ class rcube_ldap extends rcube_addressbook
if (!empty($object_classes)) {
foreach ((array)$object_classes as $oc) {
- if ($attr = self::$group_types[strtolower($oc)]) {
+ if ($attr = $this->group_types[strtolower($oc)]) {
return $attr;
}
}
diff --git a/program/lib/Roundcube/rcube_ldap_generic.php b/program/lib/Roundcube/rcube_ldap_generic.php
index 923a12a41..b85afe4ce 100644
--- a/program/lib/Roundcube/rcube_ldap_generic.php
+++ b/program/lib/Roundcube/rcube_ldap_generic.php
@@ -240,7 +240,7 @@ class rcube_ldap_generic
$method = 'DIGEST-MD5';
}
- $this->_debug("C: SASL Bind [mech: $method, authc: $authc, authz: $authz, pass: $pass]");
+ $this->_debug("C: SASL Bind [mech: $method, authc: $authc, authz: $authz, pass: **** [" . strlen($pass) . "]");
if (ldap_sasl_bind($this->conn, NULL, $pass, $method, NULL, $authc, $authz)) {
$this->_debug("S: OK");
@@ -271,7 +271,7 @@ class rcube_ldap_generic
return false;
}
- $this->_debug("C: Bind $dn [pass: $pass]");
+ $this->_debug("C: Bind $dn, pass: **** [" . strlen($pass) . "]");
if (@ldap_bind($this->conn, $dn, $pass)) {
$this->_debug("S: OK");
diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php
index 9b662a286..f24ec3ed8 100644
--- a/program/lib/Roundcube/rcube_message.php
+++ b/program/lib/Roundcube/rcube_message.php
@@ -211,16 +211,19 @@ class rcube_message
}
$level = explode('.', $part->mime_id);
+ $depth = count($level);
// Check if the part belongs to higher-level's multipart part
- // this can be alternative/related/signed/encrypted, but not mixed
+ // this can be alternative/related/signed/encrypted or mixed
while (array_pop($level) !== null) {
- if (!count($level)) {
+ $parent_depth = count($level);
+ if (!$parent_depth) {
return true;
}
$parent = $this->mime_parts[join('.', $level)];
- if (!preg_match('/^multipart\/(alternative|related|signed|encrypted)$/', $parent->mimetype)) {
+ if (!preg_match('/^multipart\/(alternative|related|signed|encrypted|mixed)$/', $parent->mimetype)
+ || ($parent->mimetype == 'multipart/mixed' && $parent_depth < $depth - 1)) {
continue 2;
}
}
@@ -529,8 +532,9 @@ class rcube_message
$part_mimetype = $mail_part->real_mimetype;
list($primary_type, $secondary_type) = explode('/', $part_mimetype);
}
- else
- $part_mimetype = $mail_part->mimetype;
+ else {
+ $part_mimetype = $part_orig_mimetype = $mail_part->mimetype;
+ }
// multipart/alternative
if ($primary_type == 'multipart') {
diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php
index 9c2220328..55b70f67c 100644
--- a/program/lib/Roundcube/rcube_mime.php
+++ b/program/lib/Roundcube/rcube_mime.php
@@ -378,6 +378,10 @@ class rcube_mime
}
if ($decode) {
$name = self::decode_header($name, $fallback);
+ // some clients encode addressee name with quotes around it
+ if ($name[0] == '"' && $name[strlen($name)-1] == '"') {
+ $name = substr($name, 1, -1);
+ }
}
}
@@ -810,7 +814,7 @@ class rcube_mime
}
$mime_types = $mime_extensions = array();
- $regex = "/([\w\+\-\.\/]+)\t+([\w\s]+)/i";
+ $regex = "/([\w\+\-\.\/]+)\s+([\w\s]+)/i";
foreach((array)$lines as $line) {
// skip comments or mime types w/o any extensions
if ($line[0] == '#' || !preg_match($regex, $line, $matches))
diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php
index 3153a8410..f0af95332 100644
--- a/program/lib/Roundcube/rcube_plugin.php
+++ b/program/lib/Roundcube/rcube_plugin.php
@@ -109,7 +109,7 @@ abstract class rcube_plugin
*/
public function require_plugin($plugin_name)
{
- return $this->api->load_plugin($plugin_name);
+ return $this->api->load_plugin($plugin_name, true);
}
/**
@@ -125,13 +125,17 @@ abstract class rcube_plugin
$fpath = $this->home.'/'.$fname;
$rcube = rcube::get_instance();
- if (is_file($fpath) && !$rcube->config->load_from_file($fpath)) {
+ if (($is_local = is_file($fpath)) && !$rcube->config->load_from_file($fpath)) {
rcube::raise_error(array(
'code' => 527, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Failed to load config from $fpath"), true, false);
return false;
}
+ else if (!$is_local) {
+ // Search plugin_name.inc.php file in any configured path
+ return $rcube->config->load_from_file($this->ID . '.inc.php');
+ }
return true;
}
diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index 5a25ada02..461c3cc07 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -35,8 +35,9 @@ class rcube_plugin_api
public $url = 'plugins/';
public $task = '';
public $output;
- public $handlers = array();
- public $allowed_prefs = array();
+ public $handlers = array();
+ public $allowed_prefs = array();
+ public $allowed_session_prefs = array();
protected $plugins = array();
protected $tasks = array();
@@ -167,10 +168,11 @@ class rcube_plugin_api
* Load the specified plugin
*
* @param string Plugin name
+ * @param boolean Force loading of the plugin even if it doesn't match the filter
*
* @return boolean True on success, false if not loaded or failure
*/
- public function load_plugin($plugin_name)
+ public function load_plugin($plugin_name, $force = false)
{
static $plugins_dir;
@@ -196,7 +198,7 @@ class rcube_plugin_api
// check inheritance...
if (is_subclass_of($plugin, 'rcube_plugin')) {
// ... task, request type and framed mode
- if ((!$plugin->task || preg_match('/^('.$plugin->task.')$/i', $this->task))
+ if (($force || !$plugin->task || preg_match('/^('.$plugin->task.')$/i', $this->task))
&& (!$plugin->noajax || (is_object($this->output) && $this->output->type == 'html'))
&& (!$plugin->noframe || empty($_REQUEST['_framed']))
) {
@@ -282,6 +284,7 @@ class rcube_plugin_api
$composer = INSTALL_PATH . "/plugins/$plugin_name/composer.json";
if (file_exists($composer) && ($json = @json_decode(file_get_contents($composer), true))) {
list($info['vendor'], $info['name']) = explode('/', $json['name']);
+ $info['version'] = $json['version'];
$info['license'] = $json['license'];
if ($license_uri = $license_uris[$info['license']])
$info['license_uri'] = $license_uri;
diff --git a/program/lib/Roundcube/rcube_result_index.php b/program/lib/Roundcube/rcube_result_index.php
index 5f592c54f..058f25c6f 100644
--- a/program/lib/Roundcube/rcube_result_index.php
+++ b/program/lib/Roundcube/rcube_result_index.php
@@ -231,29 +231,13 @@ class rcube_result_index
/**
- * Filters data set. Removes elements listed in $ids list.
+ * Filters data set. Removes elements not listed in $ids list.
*
* @param array $ids List of IDs to remove.
*/
public function filter($ids = array())
{
$data = $this->get();
- $data = array_diff($data, $ids);
-
- $this->meta = array();
- $this->meta['count'] = count($data);
- $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);
- }
-
-
- /**
- * Filters data set. Removes elements not listed in $ids list.
- *
- * @param array $ids List of IDs to keep.
- */
- public function intersect($ids = array())
- {
- $data = $this->get();
$data = array_intersect($data, $ids);
$this->meta = array();
@@ -332,6 +316,7 @@ class rcube_result_index
if (empty($this->raw_data)) {
return array();
}
+
return explode(self::SEPARATOR_ELEMENT, $this->raw_data);
}
diff --git a/program/lib/Roundcube/rcube_result_thread.php b/program/lib/Roundcube/rcube_result_thread.php
index 7657550be..ceaaf59a6 100644
--- a/program/lib/Roundcube/rcube_result_thread.php
+++ b/program/lib/Roundcube/rcube_result_thread.php
@@ -453,7 +453,7 @@ class rcube_result_thread
// when sorting search result it's good to make the index smaller
if ($index->count() != $this->count_messages()) {
- $index->intersect($this->get());
+ $index->filter($this->get());
}
$result = array_fill_keys($index->get(), null);
@@ -606,33 +606,39 @@ class rcube_result_thread
// arrays handling is much more expensive
// For the following structure: THREAD (2)(3 6 (4 23)(44 7 96))
// -- 2
- //
// -- 3
// \-- 6
// |-- 4
// | \-- 23
// |
// \-- 44
- // \-- 7
- // \-- 96
+ // \-- 7
+ // \-- 96
//
// The output will be: 2,3^1:6^2:4^3:23^2:44^3:7^4:96
if ($str[$begin] != '(') {
- $stop = $begin + strspn($str, '1234567890', $begin, $end - $begin);
- $msg = substr($str, $begin, $stop - $begin);
- if (!$msg) {
+ // find next bracket
+ $stop = $begin + strcspn($str, '()', $begin, $end - $begin);
+ $messages = explode(' ', trim(substr($str, $begin, $stop - $begin)));
+
+ if (empty($messages)) {
return $node;
}
- $this->meta['messages']++;
-
- $node .= ($depth ? self::SEPARATOR_ITEM.$depth.self::SEPARATOR_LEVEL : '').$msg;
+ foreach ($messages as $msg) {
+ if ($msg) {
+ $node .= ($depth ? self::SEPARATOR_ITEM.$depth.self::SEPARATOR_LEVEL : '').$msg;
+ $this->meta['messages']++;
+ $depth++;
+ }
+ }
- if ($stop + 1 < $end) {
- $node .= $this->parse_thread($str, $stop + 1, $end, $depth + 1);
+ if ($stop < $end) {
+ $node .= $this->parse_thread($str, $stop, $end, $depth);
}
- } else {
+ }
+ else {
$off = $begin;
while ($off < $end) {
$start = $off;
@@ -649,7 +655,8 @@ class rcube_result_thread
if ($p1 !== false && $p1 < $p) {
$off = $p1 + 1;
$n++;
- } else {
+ }
+ else {
$off = $p + 1;
$n--;
}
diff --git a/program/lib/Roundcube/rcube_session.php b/program/lib/Roundcube/rcube_session.php
index 67072df41..caca262c6 100644
--- a/program/lib/Roundcube/rcube_session.php
+++ b/program/lib/Roundcube/rcube_session.php
@@ -34,6 +34,7 @@ class rcube_session
private $changed;
private $time_diff = 0;
private $reloaded = false;
+ private $appends = array();
private $unsets = array();
private $gc_handlers = array();
private $cookiename = 'roundcube_sessauth';
@@ -441,8 +442,19 @@ class rcube_session
$node = &$this->get_node(explode('.', $path), $_SESSION);
- if ($key !== null) $node[$key] = $value;
- else $node[] = $value;
+ if ($key !== null) {
+ $node[$key] = $value;
+ $path .= '.' . $key;
+ }
+ else {
+ $node[] = $value;
+ }
+
+ $this->appends[] = $path;
+
+ // when overwriting a previously unset variable
+ if ($this->unsets[$path])
+ unset($this->unsets[$path]);
}
@@ -491,13 +503,40 @@ class rcube_session
*/
public function reload()
{
+ // collect updated data from previous appends
+ $merge_data = array();
+ foreach ((array)$this->appends as $var) {
+ $path = explode('.', $var);
+ $value = $this->get_node($path, $_SESSION);
+ $k = array_pop($path);
+ $node = &$this->get_node($path, $merge_data);
+ $node[$k] = $value;
+ }
+
if ($this->key && $this->memcache)
$data = $this->mc_read($this->key);
else if ($this->key)
$data = $this->db_read($this->key);
- if ($data)
+ if ($data) {
session_decode($data);
+
+ // apply appends and unsets to reloaded data
+ $_SESSION = array_merge_recursive($_SESSION, $merge_data);
+
+ foreach ((array)$this->unsets as $var) {
+ if (isset($_SESSION[$var])) {
+ unset($_SESSION[$var]);
+ }
+ else {
+ $path = explode('.', $var);
+ $k = array_pop($path);
+ $node = &$this->get_node($path, $_SESSION);
+ unset($node[$k]);
+ }
+ }
+ }
+
}
/**
diff --git a/program/lib/Roundcube/rcube_smtp.php b/program/lib/Roundcube/rcube_smtp.php
index 60b1389ea..70f15dc7b 100644
--- a/program/lib/Roundcube/rcube_smtp.php
+++ b/program/lib/Roundcube/rcube_smtp.php
@@ -29,6 +29,7 @@ class rcube_smtp
private $conn = null;
private $response;
private $error;
+ private $anonymize_log = 0;
// define headers delimiter
const SMTP_MIME_CRLF = "\r\n";
@@ -67,6 +68,7 @@ class rcube_smtp
'smtp_auth_type' => $rcube->config->get('smtp_auth_type'),
'smtp_helo_host' => $rcube->config->get('smtp_helo_host'),
'smtp_timeout' => $rcube->config->get('smtp_timeout'),
+ 'smtp_conn_options' => $rcube->config->get('smtp_conn_options'),
'smtp_auth_callbacks' => array(),
));
@@ -106,10 +108,11 @@ class rcube_smtp
// IDNA Support
$smtp_host = rcube_utils::idn_to_ascii($smtp_host);
- $this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host);
+ $this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host, false, 0, $CONFIG['smtp_conn_options']);
if ($rcube->config->get('smtp_debug')) {
$this->conn->setDebug(true, array($this, 'debug_handler'));
+ $this->anonymize_log = 0;
}
// register authentication methods
@@ -329,6 +332,15 @@ class rcube_smtp
*/
public function debug_handler(&$smtp, $message)
{
+ // catch AUTH commands and set anonymization flag for subsequent sends
+ if (preg_match('/^Send: AUTH ([A-Z]+)/', $message, $m)) {
+ $this->anonymize_log = $m[1] == 'LOGIN' ? 2 : 1;
+ }
+ // anonymize this log entry
+ else if ($this->anonymize_log > 0 && strpos($message, 'Send:') === 0 && --$this->anonymize_log == 0) {
+ $message = sprintf('Send: ****** [%d]', strlen($message) - 8);
+ }
+
if (($len = strlen($message)) > self::DEBUG_LINE_LENGTH) {
$diff = $len - self::DEBUG_LINE_LENGTH;
$message = substr($message, 0, self::DEBUG_LINE_LENGTH)
diff --git a/program/lib/Roundcube/rcube_spellcheck_atd.php b/program/lib/Roundcube/rcube_spellcheck_atd.php
index 68e8b7cb8..9f073f56f 100644
--- a/program/lib/Roundcube/rcube_spellcheck_atd.php
+++ b/program/lib/Roundcube/rcube_spellcheck_atd.php
@@ -39,6 +39,18 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine
);
/**
+ * Return a list of languages supported by this backend
+ *
+ * @see rcube_spellcheck_engine::languages()
+ */
+ function languages()
+ {
+ $langs = array_values($this->langhosts);
+ $langs[] = 'en';
+ return $langs;
+ }
+
+ /**
* Set content and check spelling
*
* @see rcube_spellcheck_engine::check()
diff --git a/program/lib/Roundcube/rcube_spellcheck_enchant.php b/program/lib/Roundcube/rcube_spellcheck_enchant.php
index a22251e00..14d6fff46 100644
--- a/program/lib/Roundcube/rcube_spellcheck_enchant.php
+++ b/program/lib/Roundcube/rcube_spellcheck_enchant.php
@@ -31,6 +31,24 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine
private $matches = array();
/**
+ * Return a list of languages supported by this backend
+ *
+ * @see rcube_spellcheck_engine::languages()
+ */
+ function languages()
+ {
+ $this->init();
+
+ $langs = array();
+ $dicts = enchant_broker_list_dicts($this->enchant_broker);
+ foreach ($dicts as $dict) {
+ $langs[] = preg_replace('/-.*$/', '', $dict['lang_tag']);
+ }
+
+ return array_unique($langs);
+ }
+
+ /**
* Initializes Enchant dictionary
*/
private function init()
diff --git a/program/lib/Roundcube/rcube_spellcheck_engine.php b/program/lib/Roundcube/rcube_spellcheck_engine.php
index 88e10ac05..3cb4ca3de 100644
--- a/program/lib/Roundcube/rcube_spellcheck_engine.php
+++ b/program/lib/Roundcube/rcube_spellcheck_engine.php
@@ -43,6 +43,13 @@ abstract class rcube_spellcheck_engine
}
/**
+ * Return a list of languages supported by this backend
+ *
+ * @return array Indexed list of language codes
+ */
+ abstract function languages();
+
+ /**
* Set content and check spelling
*
* @param string $text Text content for spellchecking
diff --git a/program/lib/Roundcube/rcube_spellcheck_googie.php b/program/lib/Roundcube/rcube_spellcheck_googie.php
index 70507dc23..3777942a6 100644
--- a/program/lib/Roundcube/rcube_spellcheck_googie.php
+++ b/program/lib/Roundcube/rcube_spellcheck_googie.php
@@ -26,13 +26,28 @@
*/
class rcube_spellcheck_googie extends rcube_spellcheck_engine
{
- const GOOGLE_HOST = 'ssl://www.google.com';
- const GOOGLE_PORT = 443;
+ const GOOGIE_HOST = 'ssl://spell.roundcube.net';
+ const GOOGIE_PORT = 443;
private $matches = array();
private $content;
/**
+ * Return a list of languages supported by this backend
+ *
+ * @see rcube_spellcheck_engine::languages()
+ */
+ function languages()
+ {
+ return array('am','ar','ar','bg','br','ca','cs','cy','da',
+ 'de_CH','de_DE','el','en_GB','en_US',
+ 'eo','es','et','eu','fa','fi','fr_FR','ga','gl','gl',
+ 'he','hr','hu','hy','is','it','ku','lt','lv','nl',
+ 'pl','pt_BR','pt_PT','ro','ru',
+ 'sk','sl','sv','uk');
+ }
+
+ /**
* Set content and check spelling
*
* @see rcube_spellcheck_engine::check()
@@ -52,25 +67,25 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine
$path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '') . $this->lang;
}
else {
- $host = self::GOOGLE_HOST;
- $port = self::GOOGLE_PORT;
+ $host = self::GOOGIE_HOST;
+ $port = self::GOOGIE_PORT;
$path = '/tbproxy/spell?lang=' . $this->lang;
}
- // Google has some problem with spaces, use \n instead
- $gtext = str_replace(' ', "\n", $text);
+ $path .= sprintf('&key=%06d', $_SESSION['user_id']);
$gtext = '<?xml version="1.0" encoding="utf-8" ?>'
.'<spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1">'
- .'<text>' . $gtext . '</text>'
+ .'<text>' . htmlspecialchars($text, ENT_QUOTES, RCUBE_CHARSET) . '</text>'
.'</spellrequest>';
$store = '';
if ($fp = fsockopen($host, $port, $errno, $errstr, 30)) {
$out = "POST $path HTTP/1.0\r\n";
$out .= "Host: " . str_replace('ssl://', '', $host) . "\r\n";
+ $out .= "User-Agent: Roundcube Webmail/" . RCMAIL_VERSION . " (Googiespell Wrapper)\r\n";
$out .= "Content-Length: " . strlen($gtext) . "\r\n";
- $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
+ $out .= "Content-Type: text/xml\r\n";
$out .= "Connection: Close\r\n\r\n";
$out .= $gtext;
fwrite($fp, $out);
@@ -83,8 +98,10 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine
// parse HTTP response
if (preg_match('!^HTTP/1.\d (\d+)(.+)!', $store, $m)) {
$http_status = $m[1];
- if ($http_status != '200')
+ if ($http_status != '200') {
$this->error = 'HTTP ' . $m[1] . $m[2];
+ $this->error .= "\n" . $store;
+ }
}
if (!$store) {
@@ -92,6 +109,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine
}
else if (preg_match('/<spellresult error="([^"]+)"/', $store, $m) && $m[1]) {
$this->error = "Error code $m[1] returned";
+ $this->error .= preg_match('/<errortext>([^<]+)/', $store, $m) ? ": " . html_entity_decode($m[1]) : '';
}
preg_match_all('/<c o="([^"]*)" l="([^"]*)" s="([^"]*)">([^<]*)<\/c>/', $store, $matches, PREG_SET_ORDER);
diff --git a/program/lib/Roundcube/rcube_spellcheck_pspell.php b/program/lib/Roundcube/rcube_spellcheck_pspell.php
index ce089ed8f..b12684e43 100644
--- a/program/lib/Roundcube/rcube_spellcheck_pspell.php
+++ b/program/lib/Roundcube/rcube_spellcheck_pspell.php
@@ -30,6 +30,35 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine
private $matches = array();
/**
+ * Return a list of languages supported by this backend
+ *
+ * @see rcube_spellcheck_engine::languages()
+ */
+ function languages()
+ {
+ $defaults = array('en');
+ $langs = array();
+
+ // get aspell dictionaries
+ exec('aspell dump dicts', $dicts);
+ if (!empty($dicts)) {
+ $seen = array();
+ foreach ($dicts as $lang) {
+ $lang = preg_replace('/-.*$/', '', $lang);
+ $langc = strlen($lang) == 2 ? $lang.'_'.strtoupper($lang) : $lang;
+ if (!$seen[$langc]++)
+ $langs[] = $lang;
+ }
+ $langs = array_unique($langs);
+ }
+ else {
+ $langs = $defaults;
+ }
+
+ return $langs;
+ }
+
+ /**
* Initializes PSpell dictionary
*/
private function init()
diff --git a/program/lib/Roundcube/rcube_spellchecker.php b/program/lib/Roundcube/rcube_spellchecker.php
index 31835dbb5..5b77bda02 100644
--- a/program/lib/Roundcube/rcube_spellchecker.php
+++ b/program/lib/Roundcube/rcube_spellchecker.php
@@ -65,6 +65,52 @@ class rcube_spellchecker
}
}
+ /**
+ * Return a list of supported languages
+ */
+ function languages()
+ {
+ // trust configuration
+ $configured = $this->rc->config->get('spellcheck_languages');
+ if (!empty($configured) && is_array($configured) && !$configured[0]) {
+ return $configured;
+ }
+ else if (!empty($configured)) {
+ $langs = (array)$configured;
+ }
+ else if ($this->backend) {
+ $langs = $this->backend->languages();
+ }
+
+ // load index
+ @include(RCUBE_LOCALIZATION_DIR . 'index.inc');
+
+ // add correct labels
+ $languages = array();
+ foreach ($langs as $lang) {
+ $langc = strtolower(substr($lang, 0, 2));
+ $alias = $rcube_language_aliases[$langc];
+ if (!$alias) {
+ $alias = $langc.'_'.strtoupper($langc);
+ }
+ if ($rcube_languages[$lang]) {
+ $languages[$lang] = $rcube_languages[$lang];
+ }
+ else if ($rcube_languages[$alias]) {
+ $languages[$lang] = $rcube_languages[$alias];
+ }
+ else {
+ $languages[$lang] = ucfirst($lang);
+ }
+ }
+
+ // remove possible duplicates (#1489395)
+ $languages = array_unique($languages);
+
+ asort($languages);
+
+ return $languages;
+ }
/**
* Set content and check spelling
@@ -152,7 +198,7 @@ class rcube_spellchecker
// send output
$out = '<?xml version="1.0" encoding="'.RCUBE_CHARSET.'"?><spellresult charschecked="'.mb_strlen($this->content).'">';
- foreach ($this->matches as $item) {
+ foreach ((array)$this->matches as $item) {
$out .= '<c o="'.$item[1].'" l="'.$item[2].'">';
$out .= is_array($item[4]) ? implode("\t", $item[4]) : $item[4];
$out .= '</c>';
@@ -173,7 +219,7 @@ class rcube_spellchecker
{
$result = array();
- foreach ($this->matches as $item) {
+ foreach ((array)$this->matches as $item) {
if ($this->engine == 'pspell') {
$word = $item[0];
}
@@ -306,7 +352,7 @@ class rcube_spellchecker
"UPDATE ".$this->rc->db->table_name('dictionary')
." SET data = ?"
." WHERE user_id " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
- ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?",
+ ." AND " . $this->rc->db->quote_identifier('language') . " = ?",
implode(' ', $plugin['dictionary']), $plugin['language']);
}
// don't store empty dict
@@ -314,14 +360,14 @@ class rcube_spellchecker
$this->rc->db->query(
"DELETE FROM " . $this->rc->db->table_name('dictionary')
." WHERE user_id " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
- ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?",
+ ." AND " . $this->rc->db->quote_identifier('language') . " = ?",
$plugin['language']);
}
}
else if (!empty($this->dict)) {
$this->rc->db->query(
"INSERT INTO " .$this->rc->db->table_name('dictionary')
- ." (user_id, " . $this->rc->db->quoteIdentifier('language') . ", data) VALUES (?, ?, ?)",
+ ." (user_id, " . $this->rc->db->quote_identifier('language') . ", data) VALUES (?, ?, ?)",
$plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary']));
}
}
@@ -348,7 +394,7 @@ class rcube_spellchecker
$sql_result = $this->rc->db->query(
"SELECT data FROM ".$this->rc->db->table_name('dictionary')
." WHERE user_id ". ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
- ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?",
+ ." AND " . $this->rc->db->quote_identifier('language') . " = ?",
$plugin['language']);
if ($sql_arr = $this->rc->db->fetch_assoc($sql_result)) {
diff --git a/program/lib/Roundcube/rcube_storage.php b/program/lib/Roundcube/rcube_storage.php
index e697b2c73..c09f05328 100644
--- a/program/lib/Roundcube/rcube_storage.php
+++ b/program/lib/Roundcube/rcube_storage.php
@@ -360,6 +360,18 @@ abstract class rcube_storage
/**
+ * Public method for listing message flags
+ *
+ * @param string $folder Folder name
+ * @param array $uids Message UIDs
+ * @param int $mod_seq Optional MODSEQ value
+ *
+ * @return array Indexed array with message flags
+ */
+ abstract function list_flags($folder, $uids, $mod_seq = null);
+
+
+ /**
* Public method for listing headers.
*
* @param string $folder Folder name
@@ -601,7 +613,7 @@ abstract class rcube_storage
/**
* Parse message UIDs input
*
- * @param mixed $uids UIDs array or comma-separated list or '*' or '1:*'
+ * @param mixed $uids UIDs array or comma-separated list or '*' or '1:*'
*
* @return array Two elements array with UIDs converted to list and ALL flag
*/
@@ -621,6 +633,9 @@ abstract class rcube_storage
if (is_array($uids)) {
$uids = join(',', $uids);
}
+ else if (strpos($uids, ':')) {
+ $uids = join(',', rcube_imap_generic::uncompressMessageSet($uids));
+ }
if (preg_match('/[^0-9,]/', $uids)) {
$uids = '';
diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php
index 5e9c9af80..e232736c9 100644
--- a/program/lib/Roundcube/rcube_user.php
+++ b/program/lib/Roundcube/rcube_user.php
@@ -125,8 +125,10 @@ class rcube_user
*/
function get_prefs()
{
+ $prefs = array();
+
if (!empty($this->language))
- $prefs = array('language' => $this->language);
+ $prefs['language'] = $this->language;
if ($this->ID) {
// Preferences from session (write-master is unavailable)
@@ -163,8 +165,16 @@ class rcube_user
if (!$this->ID)
return false;
- $config = $this->rc->config;
- $old_prefs = (array)$this->get_prefs();
+ $plugin = $this->rc->plugins->exec_hook('preferences_update', array(
+ 'userid' => $this->ID, 'prefs' => $a_user_prefs, 'old' => (array)$this->get_prefs()));
+
+ if (!empty($plugin['abort'])) {
+ return;
+ }
+
+ $a_user_prefs = $plugin['prefs'];
+ $old_prefs = $plugin['old'];
+ $config = $this->rc->config;
// merge (partial) prefs array with existing settings
$save_prefs = $a_user_prefs + $old_prefs;
@@ -213,6 +223,14 @@ class rcube_user
return false;
}
+ /**
+ * Generate a unique hash to identify this user which
+ */
+ function get_hash()
+ {
+ $key = substr($this->rc->config->get('des_key'), 1, 4);
+ return md5($this->data['user_id'] . $key . $this->data['username'] . '@' . $this->data['mail_host']);
+ }
/**
* Get default identity of this user
@@ -249,7 +267,7 @@ class rcube_user
"SELECT * FROM ".$this->db->table_name('identities').
" WHERE del <> 1 AND user_id = ?".
($sql_add ? " ".$sql_add : "").
- " ORDER BY ".$this->db->quoteIdentifier('standard')." DESC, name ASC, identity_id ASC",
+ " ORDER BY ".$this->db->quote_identifier('standard')." DESC, name ASC, identity_id ASC",
$this->ID);
while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
@@ -284,7 +302,7 @@ class rcube_user
$query_cols = $query_params = array();
foreach ((array)$data as $col => $value) {
- $query_cols[] = $this->db->quoteIdentifier($col) . ' = ?';
+ $query_cols[] = $this->db->quote_identifier($col) . ' = ?';
$query_params[] = $value;
}
$query_params[] = $iid;
@@ -320,7 +338,7 @@ class rcube_user
$insert_cols = $insert_values = array();
foreach ((array)$data as $col => $value) {
- $insert_cols[] = $this->db->quoteIdentifier($col);
+ $insert_cols[] = $this->db->quote_identifier($col);
$insert_values[] = $value;
}
$insert_cols[] = 'user_id';
@@ -385,7 +403,7 @@ class rcube_user
if ($this->ID && $iid) {
$this->db->query(
"UPDATE ".$this->db->table_name('identities').
- " SET ".$this->db->quoteIdentifier('standard')." = '0'".
+ " SET ".$this->db->quote_identifier('standard')." = '0'".
" WHERE user_id = ?".
" AND identity_id <> ?".
" AND del <> 1",
@@ -625,11 +643,11 @@ class rcube_user
$result = array();
$sql_result = $this->db->query(
- "SELECT search_id AS id, ".$this->db->quoteIdentifier('name')
+ "SELECT search_id AS id, ".$this->db->quote_identifier('name')
." FROM ".$this->db->table_name('searches')
." WHERE user_id = ?"
- ." AND ".$this->db->quoteIdentifier('type')." = ?"
- ." ORDER BY ".$this->db->quoteIdentifier('name'),
+ ." AND ".$this->db->quote_identifier('type')." = ?"
+ ." ORDER BY ".$this->db->quote_identifier('name'),
(int) $this->ID, (int) $type);
while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
@@ -657,9 +675,9 @@ class rcube_user
}
$sql_result = $this->db->query(
- "SELECT ".$this->db->quoteIdentifier('name')
- .", ".$this->db->quoteIdentifier('data')
- .", ".$this->db->quoteIdentifier('type')
+ "SELECT ".$this->db->quote_identifier('name')
+ .", ".$this->db->quote_identifier('data')
+ .", ".$this->db->quote_identifier('type')
." FROM ".$this->db->table_name('searches')
." WHERE user_id = ?"
." AND search_id = ?",
@@ -714,11 +732,11 @@ class rcube_user
$insert_cols[] = 'user_id';
$insert_values[] = (int) $this->ID;
- $insert_cols[] = $this->db->quoteIdentifier('type');
+ $insert_cols[] = $this->db->quote_identifier('type');
$insert_values[] = (int) $data['type'];
- $insert_cols[] = $this->db->quoteIdentifier('name');
+ $insert_cols[] = $this->db->quote_identifier('name');
$insert_values[] = $data['name'];
- $insert_cols[] = $this->db->quoteIdentifier('data');
+ $insert_cols[] = $this->db->quote_identifier('data');
$insert_values[] = serialize($data['data']);
$sql = "INSERT INTO ".$this->db->table_name('searches')
diff --git a/program/lib/Roundcube/rcube_utils.php b/program/lib/Roundcube/rcube_utils.php
index b73bc0812..46d53ac91 100644
--- a/program/lib/Roundcube/rcube_utils.php
+++ b/program/lib/Roundcube/rcube_utils.php
@@ -454,6 +454,9 @@ class rcube_utils
// cut out all contents between { and }
while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos))) {
+ $nested = strpos($source, '{', $pos+1);
+ if ($nested && $nested < $pos2) // when dealing with nested blocks (e.g. @media), take the inner one
+ $pos = $nested;
$length = $pos2 - $pos - 1;
$styles = substr($source, $pos+1, $length);
@@ -619,6 +622,10 @@ class rcube_utils
*/
public static function parse_host($name, $host = '')
{
+ if (!is_string($name)) {
+ return $name;
+ }
+
// %n - host
$n = preg_replace('/:\d+$/', '', $_SERVER['SERVER_NAME']);
// %t - host name without first part, e.g. %n=mail.domain.tld, %t=domain.tld
@@ -639,8 +646,7 @@ class rcube_utils
}
}
- $name = str_replace(array('%n', '%t', '%d', '%h', '%z', '%s'), array($n, $t, $d, $h, $z, $s[2]), $name);
- return $name;
+ return str_replace(array('%n', '%t', '%d', '%h', '%z', '%s'), array($n, $t, $d, $h, $z, $s[2]), $name);
}
@@ -677,9 +683,17 @@ class rcube_utils
*/
public static function remote_addr()
{
- foreach (array('HTTP_X_FORWARDED_FOR','HTTP_X_REAL_IP','REMOTE_ADDR') as $prop) {
- if (!empty($_SERVER[$prop]))
- return $_SERVER[$prop];
+ if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+ $hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'], 2);
+ return $hosts[0];
+ }
+
+ if (!empty($_SERVER['HTTP_X_REAL_IP'])) {
+ return $_SERVER['HTTP_X_REAL_IP'];
+ }
+
+ if (!empty($_SERVER['REMOTE_ADDR'])) {
+ return $_SERVER['REMOTE_ADDR'];
}
return '';
@@ -744,40 +758,13 @@ class rcube_utils
*/
public static function strtotime($date)
{
- $date = trim($date);
-
- // check for MS Outlook vCard date format YYYYMMDD
- if (preg_match('/^([12][90]\d\d)([01]\d)([0123]\d)$/', $date, $m)) {
- return mktime(0,0,0, intval($m[2]), intval($m[3]), intval($m[1]));
- }
-
- // common little-endian formats, e.g. dd/mm/yyyy (not all are supported by strtotime)
- if (preg_match('/^(\d{1,2})[.\/-](\d{1,2})[.\/-](\d{4})$/', $date, $m)
- && $m[1] > 0 && $m[1] <= 31 && $m[2] > 0 && $m[2] <= 12 && $m[3] >= 1970
- ) {
- return mktime(0,0,0, intval($m[2]), intval($m[1]), intval($m[3]));
- }
+ $date = self::clean_datestr($date);
// unix timestamp
if (is_numeric($date)) {
return (int) $date;
}
- // Clean malformed data
- $date = preg_replace(
- array(
- '/GMT\s*([+-][0-9]+)/', // support non-standard "GMTXXXX" literal
- '/[^a-z0-9\x20\x09:+-]/i', // remove any invalid characters
- '/\s*(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s*/i', // remove weekday names
- ),
- array(
- '\\1',
- '',
- '',
- ), $date);
-
- $date = trim($date);
-
// if date parsing fails, we have a date in non-rfc format.
// remove token from the end and try again
while ((($ts = @strtotime($date)) === false) || ($ts < 0)) {
@@ -805,8 +792,8 @@ class rcube_utils
return $date;
}
- $dt = false;
- $date = trim($date);
+ $dt = false;
+ $date = self::clean_datestr($date);
// try to parse string with DateTime first
if (!empty($date)) {
@@ -831,6 +818,52 @@ class rcube_utils
return $dt;
}
+ /**
+ * Clean up date string for strtotime() input
+ *
+ * @param string $date Date string
+ *
+ * @return string Date string
+ */
+ public static function clean_datestr($date)
+ {
+ $date = trim($date);
+
+ // check for MS Outlook vCard date format YYYYMMDD
+ if (preg_match('/^([12][90]\d\d)([01]\d)([0123]\d)$/', $date, $m)) {
+ return sprintf('%04d-%02d-%02d 00:00:00', intval($m[1]), intval($m[2]), intval($m[3]));
+ }
+
+ // Clean malformed data
+ $date = preg_replace(
+ array(
+ '/GMT\s*([+-][0-9]+)/', // support non-standard "GMTXXXX" literal
+ '/[^a-z0-9\x20\x09:+-\/]/i', // remove any invalid characters
+ '/\s*(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s*/i', // remove weekday names
+ ),
+ array(
+ '\\1',
+ '',
+ '',
+ ), $date);
+
+ $date = trim($date);
+
+ // try to fix dd/mm vs. mm/dd discrepancy, we can't do more here
+ if (preg_match('/^(\d{1,2})[.\/-](\d{1,2})[.\/-](\d{4})$/', $date, $m)) {
+ $mdy = $m[2] > 12 && $m[1] <= 12;
+ $day = $mdy ? $m[2] : $m[1];
+ $month = $mdy ? $m[1] : $m[2];
+ $date = sprintf('%04d-%02d-%02d 00:00:00', intval($m[3]), $month, $day);
+ }
+ // I've found that YYYY.MM.DD is recognized wrong, so here's a fix
+ else if (preg_match('/^(\d{4})\.(\d{1,2})\.(\d{1,2})$/', $date)) {
+ $date = str_replace('.', '-', $date) . ' 00:00:00';
+ }
+
+ return $date;
+ }
+
/*
* Idn_to_ascii wrapper.
* Intl/Idn modules version of this function doesn't work with e-mail address
@@ -890,10 +923,20 @@ class rcube_utils
*
* @param string Input string (UTF-8)
* @param boolean True to return list of words as array
+ *
* @return mixed Normalized string or a list of normalized tokens
*/
public static function normalize_string($str, $as_array = false)
{
+ // replace 4-byte unicode characters with '?' character,
+ // these are not supported in default utf-8 charset on mysql,
+ // the chance we'd need them in searching is very low
+ $str = preg_replace('/('
+ . '\xF0[\x90-\xBF][\x80-\xBF]{2}'
+ . '|[\xF1-\xF3][\x80-\xBF]{3}'
+ . '|\xF4[\x80-\x8F][\x80-\xBF]{2}'
+ . ')/', '?', $str);
+
// split by words
$arr = self::tokenize_string($str);
@@ -1002,4 +1045,16 @@ class rcube_utils
return !in_array($str, array('false', '0', 'no', 'off', 'nein', ''), true);
}
+ /**
+ * OS-dependent absolute path detection
+ */
+ public static function is_absolute_path($path)
+ {
+ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
+ return (bool) preg_match('!^[a-z]:[\\\\/]!i', $path);
+ }
+ else {
+ return $path[0] == DIRECTORY_SEPARATOR;
+ }
+ }
}
diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php
index d54dc56ad..a54ee7e11 100644
--- a/program/lib/Roundcube/rcube_vcard.php
+++ b/program/lib/Roundcube/rcube_vcard.php
@@ -378,7 +378,7 @@ class rcube_vcard
default:
if ($field == 'phone' && $this->phonetypemap[$type_uc]) {
$type = $this->phonetypemap[$type_uc];
- }
+ }
if (($tag = self::$fieldmap[$field]) && (is_array($value) || strlen($value))) {
$index = count($this->raw[$tag]);
@@ -518,20 +518,28 @@ class rcube_vcard
*/
public static function cleanup($vcard)
{
- // Convert special types (like Skype) to normal type='skype' classes with this simple regex ;)
- $vcard = preg_replace(
- '/item(\d+)\.(TEL|EMAIL|URL)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w-() ]*)(?:>!\$_)?./s',
- '\2;type=\5\3:\4',
- $vcard);
-
// convert Apple X-ABRELATEDNAMES into X-* fields for better compatibility
$vcard = preg_replace_callback(
'/item(\d+)\.(X-ABRELATEDNAMES)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w-() ]*)(?:>!\$_)?./s',
array('self', 'x_abrelatednames_callback'),
$vcard);
- // Remove cruft like item1.X-AB*, item1.ADR instead of ADR, and empty lines
- $vcard = preg_replace(array('/^item\d*\.X-AB.*$/m', '/^item\d*\./m', "/\n+/"), array('', '', "\n"), $vcard);
+ // Cleanup
+ $vcard = preg_replace(array(
+ // convert special types (like Skype) to normal type='skype' classes with this simple regex ;)
+ '/item(\d+)\.(TEL|EMAIL|URL)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w-() ]*)(?:>!\$_)?./s',
+ '/^item\d*\.X-AB.*$/m', // remove cruft like item1.X-AB*
+ '/^item\d*\./m', // remove item1.ADR instead of ADR
+ '/\n+/', // remove empty lines
+ '/^(N:[^;\R]*)$/m', // if N doesn't have any semicolons, add some
+ ),
+ array(
+ '\2;type=\5\3:\4',
+ '',
+ '',
+ "\n",
+ '\1;;;;',
+ ), $vcard);
// convert X-WAB-GENDER to X-GENDER
if (preg_match('/X-WAB-GENDER:(\d)/', $vcard, $matches)) {
@@ -539,9 +547,6 @@ class rcube_vcard
$vcard = preg_replace('/X-WAB-GENDER:\d/', 'X-GENDER:' . $value, $vcard);
}
- // if N doesn't have any semicolons, add some
- $vcard = preg_replace('/^(N:[^;\R]*)$/m', '\1;;;;', $vcard);
-
return $vcard;
}
@@ -612,8 +617,8 @@ class rcube_vcard
$enc = null;
foreach($regs2[1] as $attrid => $attr) {
+ $attr = preg_replace('/[\s\t\n\r\0\x0B]/', '', $attr);
if ((list($key, $value) = explode('=', $attr)) && $value) {
- $value = trim($value);
if ($key == 'ENCODING') {
$value = strtoupper($value);
// add next line(s) to value string if QP line end detected
@@ -792,7 +797,7 @@ class rcube_vcard
return $result;
}
- $s = strtr($s, $rep2);
+ $s = trim(strtr($s, $rep2));
}
// some implementations (GMail) use non-standard backslash before colon (#1489085)
diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php
index e7467545f..51f7930aa 100644
--- a/program/lib/Roundcube/rcube_washtml.php
+++ b/program/lib/Roundcube/rcube_washtml.php
@@ -184,7 +184,7 @@ class rcube_washtml
'|rgb\(\s*[0-9]+\s*,\s*[0-9]+\s*,\s*[0-9]+\s*\)'.
'|-?[0-9.]+\s*(em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)?'.
'|#[0-9a-f]{3,6}'.
- '|[a-z0-9", -]+'.
+ '|[a-z0-9"\', -]+'.
')\s*/i', $str, $match)
) {
if ($match[2]) {
@@ -418,7 +418,7 @@ class rcube_washtml
$html = preg_replace($html_search, $html_replace, trim($html));
//-> Replace all of those weird MS Word quotes and other high characters
- $badwordchars=array(
+ $badwordchars = array(
"\xe2\x80\x98", // left single quote
"\xe2\x80\x99", // right single quote
"\xe2\x80\x9c", // left double quote
@@ -426,7 +426,7 @@ class rcube_washtml
"\xe2\x80\x94", // em dash
"\xe2\x80\xa6" // elipses
);
- $fixedwordchars=array(
+ $fixedwordchars = array(
"'",
"'",
'"',
@@ -434,7 +434,7 @@ class rcube_washtml
'&mdash;',
'...'
);
- $html = str_replace($badwordchars,$fixedwordchars, $html);
+ $html = str_replace($badwordchars, $fixedwordchars, $html);
// PCRE errors handling (#1486856), should we use something like for every preg_* use?
if ($html === null && ($preg_error = preg_last_error()) != PREG_NO_ERROR) {
@@ -455,13 +455,16 @@ class rcube_washtml
}
// fix (unknown/malformed) HTML tags before "wash"
- $html = preg_replace_callback('/(<(?!\!)[\/]*)([^\s>]+)/', array($this, 'html_tag_callback'), $html);
+ $html = preg_replace_callback('/(<(?!\!)[\/]*)([^\s>]+)([^>]*)/', array($this, 'html_tag_callback'), $html);
// Remove invalid HTML comments (#1487759)
// Don't remove valid conditional comments
// Don't remove MSOutlook (<!-->) conditional comments (#1489004)
$html = preg_replace('/<!--[^->\[\n]+>/', '', $html);
+ // fix broken nested lists
+ self::fix_broken_lists($html);
+
// turn relative into absolute urls
$html = self::resolve_base($html);
@@ -479,7 +482,12 @@ class rcube_washtml
'/[^a-z0-9_\[\]\!-]/i', // forbidden characters
), '', $tagname);
- return $matches[1] . $tagname;
+ // fix invalid closing tags - remove any attributes (#1489446)
+ if ($matches[1] == '</') {
+ $matches[3] = '';
+ }
+
+ return $matches[1] . $tagname . $matches[3];
}
/**
@@ -495,5 +503,77 @@ class rcube_washtml
return $body;
}
-}
+ /**
+ * Fix broken nested lists, they are not handled properly by DOMDocument (#1488768)
+ */
+ public static function fix_broken_lists(&$html)
+ {
+ // do two rounds, one for <ol>, one for <ul>
+ foreach (array('ol', 'ul') as $tag) {
+ $pos = 0;
+ while (($pos = stripos($html, '<' . $tag, $pos)) !== false) {
+ $pos++;
+
+ // make sure this is an ol/ul tag
+ if (!in_array($html[$pos+2], array(' ', '>'))) {
+ continue;
+ }
+
+ $p = $pos;
+ $in_li = false;
+ $li_pos = 0;
+
+ while (($p = strpos($html, '<', $p)) !== false) {
+ $tt = strtolower(substr($html, $p, 4));
+
+ // li open tag
+ if ($tt == '<li>' || $tt == '<li ') {
+ $in_li = true;
+ $p += 4;
+ }
+ // li close tag
+ else if ($tt == '</li' && in_array($html[$p+4], array(' ', '>'))) {
+ $li_pos = $p;
+ $p += 4;
+ $in_li = false;
+ }
+ // ul/ol closing tag
+ else if ($tt == '</' . $tag && in_array($html[$p+4], array(' ', '>'))) {
+ break;
+ }
+ // nested ol/ul element out of li
+ else if (!$in_li && $li_pos && ($tt == '<ol>' || $tt == '<ol ' || $tt == '<ul>' || $tt == '<ul ')) {
+ // find closing tag of this ul/ol element
+ $element = substr($tt, 1, 2);
+ $cpos = $p;
+ do {
+ $tpos = stripos($html, '<' . $element, $cpos+1);
+ $cpos = stripos($html, '</' . $element, $cpos+1);
+ }
+ while ($tpos !== false && $cpos !== false && $cpos > $tpos);
+
+ // not found, this is invalid HTML, skip it
+ if ($cpos === false) {
+ break;
+ }
+
+ // get element content
+ $end = strpos($html, '>', $cpos);
+ $len = $end - $p + 1;
+ $element = substr($html, $p, $len);
+
+ // move element to the end of the last li
+ $html = substr_replace($html, '', $p, $len);
+ $html = substr_replace($html, $element, $li_pos, 0);
+
+ $p = $end;
+ }
+ else {
+ $p++;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/program/localization/ar/labels.inc b/program/localization/ar/labels.inc
new file mode 100644
index 000000000..6fd922ad9
--- /dev/null
+++ b/program/localization/ar/labels.inc
@@ -0,0 +1,123 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/labels.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
+*/
+$labels['welcome'] = 'مرحباً بكم ÙÙŠ $product';
+$labels['username'] = 'اسم المستخدم';
+$labels['password'] = 'كلمة المرور';
+$labels['server'] = 'الخادم';
+$labels['login'] = 'تسجيل الدخول';
+$labels['logout'] = 'تسجيل الخروج';
+$labels['mail'] = 'البريد';
+$labels['settings'] = 'الإعدادات';
+$labels['addressbook'] = 'دÙتر العناوين';
+$labels['inbox'] = 'البريد الوارد';
+$labels['drafts'] = 'المسودات';
+$labels['sent'] = 'البريد المرسل';
+$labels['trash'] = 'المهملات';
+$labels['junk'] = 'الرسائل غير المرغوب Ùيها';
+$labels['subject'] = 'الموضوع';
+$labels['from'] = 'المرسل';
+$labels['cc'] = 'نسخة إلي';
+$labels['bcc'] = 'نسخة مخÙية الوجهة';
+$labels['date'] = 'التاريخ';
+$labels['size'] = 'الحجم';
+$labels['priority'] = 'الأولوية';
+$labels['mailboxlist'] = 'مجلدات';
+$labels['copy'] = 'نسخ';
+$labels['move'] = 'نقل';
+$labels['moveto'] = 'نقل إلى...';
+$labels['download'] = 'تنزيل';
+$labels['showattachment'] = 'إظهار';
+$labels['showanyway'] = 'إظهار ذلك على أي حال';
+$labels['filename'] = 'اسم الملÙ';
+$labels['filesize'] = 'حجم الملÙ';
+$labels['addtoaddressbook'] = 'إضاÙØ© إلى دÙتر العناوين';
+$labels['sun'] = 'أحد';
+$labels['mon'] = 'إثنين';
+$labels['tue'] = 'ثلاثاء';
+$labels['wed'] = 'أربعاء';
+$labels['thu'] = 'خميس';
+$labels['fri'] = 'جمعة';
+$labels['sat'] = 'سبت';
+$labels['sunday'] = 'الأحد';
+$labels['monday'] = 'الإثنين';
+$labels['tuesday'] = 'الثلاثاء';
+$labels['wednesday'] = 'الأربعاء';
+$labels['thursday'] = 'الخميس';
+$labels['friday'] = 'الجمعة';
+$labels['saturday'] = 'السبت';
+$labels['jan'] = 'يناير';
+$labels['feb'] = 'Ùبراير';
+$labels['mar'] = 'مارس';
+$labels['apr'] = 'أبريل';
+$labels['may'] = 'مايو';
+$labels['jun'] = 'يونيو';
+$labels['jul'] = 'يوليو';
+$labels['aug'] = 'أغسطس';
+$labels['sep'] = 'سبتمبر';
+$labels['oct'] = 'أكتوبر';
+$labels['nov'] = 'نوÙمبر';
+$labels['dec'] = 'ديسمبر';
+$labels['longjan'] = 'يناير';
+$labels['longfeb'] = 'Ùبراير';
+$labels['longmar'] = 'مارس';
+$labels['longapr'] = 'أبريل';
+$labels['longmay'] = 'مايو';
+$labels['longjun'] = 'يونيو';
+$labels['longjul'] = 'يوليو';
+$labels['longaug'] = 'أغسطس';
+$labels['longsep'] = 'سبتمبر';
+$labels['longoct'] = 'أكتوبر';
+$labels['longnov'] = 'نوÙمبر';
+$labels['longdec'] = 'ديسمبر';
+$labels['today'] = 'اليوم';
+$labels['refresh'] = 'تحديث';
+$labels['checkmail'] = 'التحقق من وجود رسائل جديدة';
+$labels['compose'] = 'إنشاء';
+$labels['writenewmessage'] = 'إنشاء رسالة جديدة';
+$labels['reply'] = 'رد';
+$labels['replytomessage'] = 'الرد على المرسل';
+$labels['replytoallmessage'] = 'الرد على قائمة أو إلى المرسل وجميع المستلمين';
+$labels['replyall'] = 'الرد على الجميع';
+$labels['replylist'] = 'الرد على القائمة';
+$labels['forward'] = 'إعادة توجيه';
+$labels['deletemessage'] = 'حذ٠الرسالة';
+$labels['movemessagetotrash'] = 'انقل الرسالة إلى سلة المهملات';
+$labels['printmessage'] = 'أطبع هذه الرسالة';
+$labels['previousmessage'] = 'عرض الرسالة السابقة';
+$labels['firstmessage'] = 'عرض الرسالة الأولى';
+$labels['nextmessage'] = 'عرض الرسالة التالية';
+$labels['lastmessage'] = 'عرض الرسالة الأخيرة';
+$labels['backtolist'] = 'العودة إلى قائمة الرسائل';
+$labels['viewsource'] = 'إظهار المصدر';
+$labels['mark'] = 'علامة';
+$labels['markread'] = 'مقروءة';
+$labels['markunread'] = 'غير مقروءة';
+$labels['moreactions'] = 'إجراءات إضاÙية...';
+$labels['more'] = 'المزيد';
+$labels['back'] = 'العودة';
+$labels['options'] = 'خيارات';
+$labels['select'] = 'تحديد';
+$labels['all'] = 'الكل';
+$labels['none'] = 'لاشيء';
+$labels['currpage'] = 'الصÙحة الحالية';
+$labels['unread'] = 'غير مقروءة';
+$labels['flagged'] = 'موسوم';
+$labels['unanswered'] = 'بلا رد';
+$labels['deleted'] = 'محذوÙ';
+$labels['undeleted'] = 'غير محذوÙØ©';
+?>
diff --git a/program/localization/ast/labels.inc b/program/localization/ast/labels.inc
index 7a60238b7..25d09451c 100644
--- a/program/localization/ast/labels.inc
+++ b/program/localization/ast/labels.inc
@@ -197,6 +197,7 @@ $labels['spellcheck'] = 'Correutor ortográficu';
$labels['checkspelling'] = 'Revisar ortografía';
$labels['resumeediting'] = 'Siguir cola edición';
$labels['revertto'] = 'Revertir a';
+$labels['responsename'] = 'Nome';
$labels['attach'] = 'Axuntar';
$labels['attachments'] = 'Axuntos';
$labels['upload'] = 'Xubir';
@@ -428,6 +429,7 @@ $labels['standardwindows'] = 'Xestionar ventanes emerxentes como ventanes están
$labels['forwardmode'] = 'Reunviu de mensaxes';
$labels['inline'] = 'en llinia';
$labels['asattachment'] = 'como axuntu';
+$labels['replyalldefault'] = 'responder a toos';
$labels['folder'] = 'Bandexa';
$labels['folders'] = 'Bandexes';
$labels['foldername'] = 'Nome de bandexa';
diff --git a/program/localization/az_AZ/labels.inc b/program/localization/az_AZ/labels.inc
index 60930a49d..1e4a5e2f5 100644
--- a/program/localization/az_AZ/labels.inc
+++ b/program/localization/az_AZ/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to-dan $count';
$labels['copy'] = 'Kopyala';
$labels['move'] = 'Köçür';
$labels['moveto'] = 'Burada köçür...';
+$labels['copyto'] = 'Bura kopyala...';
$labels['download'] = 'Endir';
$labels['open'] = 'Aç';
$labels['showattachment'] = 'Göstər';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Orfoqrafiya';
$labels['checkspelling'] = 'Orfoqrafiyanı yoxla';
$labels['resumeediting'] = 'Redaktəni davam et';
$labels['revertto'] = 'Dəyişiklikləri ləğv et';
+$labels['restore'] = 'Bərpa';
+$labels['restoremessage'] = 'Məktub bərpa edilsin?';
+$labels['responses'] = 'Cavablar';
+$labels['insertresponse'] = 'Cavab daxil et';
+$labels['manageresponses'] = 'Cavabların idarə edilməsi';
+$labels['savenewresponse'] = 'Yeni cavabı saxla';
+$labels['editresponses'] = 'Cavabları redaktə et';
+$labels['editresponse'] = 'Cavabı redaktə et';
+$labels['responsename'] = 'Ad';
+$labels['responsetext'] = 'Cavab mətni';
$labels['attach'] = 'Fayl əlavə et';
$labels['attachments'] = 'Bərkidilmiş Fayllar';
$labels['upload'] = 'Yüklə';
@@ -316,7 +327,11 @@ $labels['searchdelete'] = 'SorÄŸunu sil';
$labels['import'] = 'Ä°dxal';
$labels['importcontacts'] = 'Ünvanların idxalı';
$labels['importfromfile'] = 'Fayldan idxal:';
+$labels['importtarget'] = 'Kontaktları əlavə et';
$labels['importreplace'] = 'Ünvan kitabçasını dəyiş';
+$labels['importgroups'] = 'Qrup idxalı tapşırığı';
+$labels['importgroupsall'] = 'Hamısı (əgər lazımdırsa qrupun yaradılması)';
+$labels['importgroupsexisting'] = 'Yalnız mövcud qruplar üçün';
$labels['importdesc'] = 'Siz kontaktları mövcud ünvan kitabçasından yükləyə bilərsiniz. <br/> Hal-hazırda biz ünvanların idxalını <a href="http://az.wikipedia.org/wiki/VCard">vCard</a> və ya CSV (vergüllə bölünmüş) formatında olan vizit kartları dəstəkləyirik.';
$labels['done'] = 'Bitdi';
$labels['settingsfor'] = 'Nizamlamaları';
@@ -424,6 +439,9 @@ $labels['standardwindows'] = 'Handle popapsı standart pəncərələr kimi';
$labels['forwardmode'] = 'Məktubların yönəldilməsi';
$labels['inline'] = 'mətndə';
$labels['asattachment'] = 'fayl kimi';
+$labels['replyallmode'] = '[Hamıya cavab] düyməsinin susmaya görə hərəkəti';
+$labels['replyalldefault'] = 'hamıya cavab';
+$labels['replyalllist'] = 'yalnız poçt siyahısına (əgər tapılıbsa) cavab ';
$labels['folder'] = 'Qovluq';
$labels['folders'] = 'Qovluqlar';
$labels['foldername'] = 'Qovluq adı';
diff --git a/program/localization/az_AZ/messages.inc b/program/localization/az_AZ/messages.inc
index ddab8d702..28e5f57d2 100644
--- a/program/localization/az_AZ/messages.inc
+++ b/program/localization/az_AZ/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Səhv sorğu! Məlumat yaddaşda qalmadı.';
$messages['invalidhost'] = 'Səhv server adı.';
$messages['nomessagesfound'] = 'Poçt qutusunda məktub tapılmadı.';
$messages['loggedout'] = 'Çıxış uğurlu oldu. Sağ olun!';
-$messages['mailboxempty'] = 'Poçt qutusu boşdur';
+$messages['mailboxempty'] = 'Poçt boşdur';
+$messages['nomessages'] = 'Məktub yoxdur';
$messages['refreshing'] = 'Yenilənmə...';
$messages['loading'] = 'Yüklənir...';
$messages['uploading'] = 'Fayl yüklənir...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Məktub uğurla göndərildi';
$messages['savingmessage'] = 'Məktubu saxla...';
$messages['messagesaved'] = 'Məktub qaralamada saxlandı';
$messages['successfullysaved'] = 'Yaddaşa yazıldı';
+$messages['savingresponse'] = 'Cavab mətninin saxlanılması...';
+$messages['deleteresponseconfirm'] = 'Siz cavab mətnini silmək istəyirsiniz?';
$messages['addedsuccessfully'] = 'ÆlaqÉ™ ünvan kitabçasına É™lavÉ™ olundu';
$messages['contactexists'] = 'Ünvan kitabçasında bu e-poçtla əlaqə mövcuddur';
$messages['contactnameexists'] = 'Bu adda kontakt artıq mövcuddur.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'Tələb olunan ünvan tapılmadı';
$messages['contactsearchonly'] = 'Kontaqların axtarışı üçün şərti daxil edin';
$messages['sendingfailed'] = 'Məktub göndərilmədi';
$messages['senttooquickly'] = 'Məktub göndərmək üçün $sec saniyə gözləmək gərəkir';
+$messages['errorsavingsent'] = 'Göndərilən məktubun saxlanılması zamanı xəta baş verdi.';
+$messages['errorsaving'] = 'Saxlanılma zamanı xəta baş verdi.';
$messages['errormoving'] = 'Məktubu (məktubları) köçürmək alnmadı';
$messages['errorcopying'] = 'Məktubu (məktubları) kopyalamaq alınmadı';
$messages['errordeleting'] = 'Məktubu (məktubları) silmək alınmadı';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Lütfən, qəbul edənin ünvanını daxil ed
$messages['nosubjectwarning'] = '"Mövzu" sahəsi boşdur. Mövzu daxil etmək istəyirsiniz?';
$messages['nobodywarning'] = 'Məktub boş göndərilsin?';
$messages['notsentwarning'] = 'Məktub göndərilmədi. Göndərilmədən imtina etmək istəyirsiniz?';
+$messages['restoresavedcomposedata'] = 'ÆvvÉ™lki göndÉ™rildi, ancaq göndÉ™rilmÉ™yÉ™n mÉ™ktub da tapıldı.\n\nSubject: $subject\nSaved: $date\n\nSiz bu mÉ™ktubu bÉ™rpa etmÉ™k istÉ™yirsiniz?';
$messages['noldapserver'] = 'Lütfən, axtarış üçün LDAP server seçin';
$messages['nosearchname'] = 'Lütfən, ad və ya e-poçt əlavə edin';
$messages['notuploadedwarning'] = 'ÆlavÉ™lÉ™r tam yüklÉ™nilmÉ™yib. GözlÉ™yin vÉ™ ya yüklÉ™mÉ™ni ləğv edin.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'SMTP Error ($code): $msg';
$messages['emailformaterror'] = 'Səhv ünvan: $email';
$messages['toomanyrecipients'] = 'Qəbul edənlər həddindən artıq çoxdur. Lütfən, $max qədər azaldın.';
$messages['maxgroupmembersreached'] = 'Qrupun ölçüsü imkan verilən maksimumdan artıqdır - $max';
+$messages['internalerror'] = 'Daxili xəta. Lütfən bir daha cəhd edin.';
$messages['contactdelerror'] = 'Kontak(lar)ı silmək alınmadı';
$messages['contactdeleted'] = 'Kontak(lar) uÄŸurla silindi';
$messages['contactrestoreerror'] = 'Silinmiş kontakt(lar)ın bərpası alınmadı';
diff --git a/program/localization/be_BE/labels.inc b/program/localization/be_BE/labels.inc
index b5a3ed6d8..9180b92d7 100644
--- a/program/localization/be_BE/labels.inc
+++ b/program/localization/be_BE/labels.inc
@@ -29,7 +29,7 @@ $labels['drafts'] = 'Чарнавікі';
$labels['sent'] = 'ДаÑланыÑ';
$labels['trash'] = 'Сметніца';
$labels['junk'] = 'Спам';
-$labels['show_real_foldernames'] = 'Паказваць ÑÐ°Ð¿Ñ€Ð°ÑžÐ´Ð½Ñ‹Ñ Ñ–Ð¼Ñ‘Ð½Ñ‹ Ð´Ð»Ñ Ð°Ð´Ð¼Ñ‹Ñловых папак';
+$labels['show_real_foldernames'] = 'Паказваць ÑÐ°Ð¿Ñ€Ð°ÑžÐ´Ð½Ñ‹Ñ Ð½Ð°Ð·Ð²Ñ‹ Ð´Ð»Ñ Ð°Ð´Ð¼Ñ‹Ñловых папак';
$labels['subject'] = 'ТÑма';
$labels['from'] = 'Ðд каго';
$labels['sender'] = 'Ðдпраўнік';
@@ -42,21 +42,21 @@ $labels['date'] = 'Дата';
$labels['size'] = 'Памер';
$labels['priority'] = 'ПрыÑрытÑÑ‚';
$labels['organization'] = 'УÑтанова';
-$labels['readstatus'] = 'Ðе прачытанае';
+$labels['readstatus'] = 'Прачытана';
$labels['listoptions'] = 'Параметры ÑпіÑу...';
-$labels['mailboxlist'] = 'ТÑчкі';
+$labels['mailboxlist'] = 'Папкі';
$labels['messagesfromto'] = 'Паведамленні $from—$to з $count';
$labels['threadsfromto'] = 'Ðбмеркаванні $from—$to з $count';
$labels['messagenrof'] = 'Паведамленне $nr з $count';
$labels['fromtoshort'] = '$from—$to з $count';
-$labels['copy'] = 'Капіраваць';
+$labels['copy'] = 'КапіÑваць';
$labels['move'] = 'ПерамÑÑціць';
$labels['moveto'] = 'ПерамÑÑціць у...';
-$labels['download'] = 'Спампаваць';
-$labels['open'] = 'Ðдчыніць';
+$labels['download'] = 'СцÑгнуць';
+$labels['open'] = 'Ðдкрыць';
$labels['showattachment'] = 'Паказаць';
$labels['showanyway'] = 'УÑÑ‘ адно паказваць';
-$labels['filename'] = 'Ð†Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð°';
+$labels['filename'] = 'Ðазва файла';
$labels['filesize'] = 'Памер файла';
$labels['addtoaddressbook'] = 'Дадаць у адраÑную кнігу';
$labels['sun'] = 'нд';
@@ -118,13 +118,13 @@ $labels['previousmessage'] = 'Паказаць папÑÑ€ÑднÑе паведÐ
$labels['firstmessage'] = 'Паказаць першае паведамленне';
$labels['nextmessage'] = 'Паказаць наÑтупнае паведамленне';
$labels['lastmessage'] = 'Паказаць апошнÑе паведамленне';
-$labels['backtolist'] = 'Ðазад да ÑпіÑа паведамленнÑÑž';
-$labels['viewsource'] = 'Паказаць жарало';
+$labels['backtolist'] = 'Ðазад да ÑпіÑу паведамленнÑÑž';
+$labels['viewsource'] = 'Зыходны Ñ‚ÑкÑÑ‚';
$labels['mark'] = 'Пазначыць';
$labels['markmessages'] = 'Пазначыць паведамленні';
$labels['markread'] = 'Як прачытаныÑ';
$labels['markunread'] = 'Як непрачытаныÑ';
-$labels['markflagged'] = 'УÑтанавіць флаг';
+$labels['markflagged'] = 'ПаÑтавіць флаг';
$labels['markunflagged'] = 'ЗнÑць флаг';
$labels['moreactions'] = 'Больш дзеÑннÑÑž...';
$labels['more'] = 'Больш';
@@ -177,8 +177,8 @@ $labels['msgtext'] = 'УÑÑ‘ паведамленне';
$labels['body'] = 'Цела';
$labels['type'] = 'Тып';
$labels['namex'] = 'ІмÑ';
-$labels['openinextwin'] = 'Ðдчыніць у новым акне';
-$labels['emlsave'] = 'Спампаваць (.eml)';
+$labels['openinextwin'] = 'Ðдкрыць у новым акне';
+$labels['emlsave'] = 'СцÑгнуць (.eml)';
$labels['changeformattext'] = 'Паказаць Ñк проÑÑ‚Ñ‹ Ñ‚ÑкÑÑ‚';
$labels['changeformathtml'] = 'Паказаць Ñк HTML';
$labels['editasnew'] = 'ÐдрÑдагаваць Ñк новае';
@@ -197,11 +197,21 @@ $labels['spellcheck'] = 'ПравапіÑ';
$labels['checkspelling'] = 'Праверыць правапіÑ';
$labels['resumeediting'] = 'ПрацÑгнуць Ñ€Ñдагаванне';
$labels['revertto'] = 'Ðдкаціцца на';
+$labels['restore'] = 'Ðднавіць';
+$labels['restoremessage'] = 'Ðднавіць паведамленне?';
+$labels['responses'] = 'Ðдказы';
+$labels['insertresponse'] = 'УÑтавіць адказ';
+$labels['manageresponses'] = 'Кіраваць адказамі';
+$labels['savenewresponse'] = 'Захаваць новы адказ';
+$labels['editresponses'] = 'РÑдагаваць адказы';
+$labels['editresponse'] = 'РÑдагаваць адказ';
+$labels['responsename'] = 'Ðазва';
+$labels['responsetext'] = 'ТÑкÑÑ‚ адказу';
$labels['attach'] = 'Далучыць';
$labels['attachments'] = 'ДалучÑнні';
-$labels['upload'] = 'Запампаваць';
+$labels['upload'] = 'Ðпублікаваць';
$labels['uploadprogress'] = '$percent ($current з $total)';
-$labels['close'] = 'Зачыніць';
+$labels['close'] = 'Закрыць';
$labels['messageoptions'] = 'Параметры паведамленнÑ...';
$labels['low'] = 'Ðізкі';
$labels['lowest'] = 'Ðайнізшы';
@@ -209,8 +219,8 @@ $labels['normal'] = 'Звычайны';
$labels['high'] = 'Ð’Ñ‹Ñокі';
$labels['highest'] = 'Ðайвышшы';
$labels['nosubject'] = '(без Ñ‚Ñмы)';
-$labels['showimages'] = 'Паказваць відарыÑÑ‹';
-$labels['alwaysshow'] = 'ЗаўÑёды паказваць відарыÑÑ‹ ад $sender';
+$labels['showimages'] = 'Паказваць выÑвы';
+$labels['alwaysshow'] = 'ЗаўÑёды паказваць выÑвы ад $sender';
$labels['isdraft'] = 'ГÑта чарнавік.';
$labels['andnmore'] = 'ÑÑˆÑ‡Ñ $nr...';
$labels['togglemoreheaders'] = 'Паказаць больш загалоўкаў паведамленнÑ';
@@ -227,7 +237,7 @@ $labels['addfollowupto'] = 'Групавы-адказ-на';
$labels['mdnrequest'] = 'Ðдпраўнік пажадаў даведацца аб прачытанні гÑтага паведамленнÑ. ÐпавÑÑціць адпраўніка?';
$labels['receiptread'] = 'Пацверджанне Ð°Ñ‚Ñ€Ñ‹Ð¼Ð°Ð½Ð½Ñ (прачытаннÑ)';
$labels['yourmessage'] = 'ГÑта пацверджанне аб атрыманні вашага паведамленнÑ';
-$labels['receiptnote'] = 'Заўвага: ГÑтае пацверджанне значыць адно, што паведамленне было адлюÑтравана на Ñкране кампутара адраÑата. ÐÑма гарантыі, што атрымальнік прачытаў альбо зразумеў змеÑÑ‚ паведамленнÑ.';
+$labels['receiptnote'] = 'Заўвага: ГÑтае пацверджанне значыць адно, што паведамленне было адлюÑтравана на Ñкране камп\'ютара адраÑата. ÐÑма гарантыі, што атрымальнік прачытаў альбо зразумеў змеÑÑ‚ паведамленнÑ.';
$labels['name'] = 'Экраннае імÑ';
$labels['firstname'] = 'ІмÑ';
$labels['surname'] = 'Прозвішча';
@@ -251,7 +261,7 @@ $labels['birthday'] = 'Дзень народзінаў';
$labels['anniversary'] = 'Юбілей';
$labels['website'] = 'Ð’Ñб-Ñайт';
$labels['instantmessenger'] = 'IM';
-$labels['notes'] = 'Зацемкі';
+$labels['notes'] = 'Занатоўкі';
$labels['male'] = 'мужчына';
$labels['female'] = 'жанчына';
$labels['manager'] = 'Кіраўнік';
@@ -286,10 +296,10 @@ $labels['edit'] = 'РÑдагаваць';
$labels['cancel'] = 'СкаÑаваць';
$labels['save'] = 'Захаваць';
$labels['delete'] = 'Выдаліць';
-$labels['rename'] = 'Перайменаваць';
+$labels['rename'] = 'Пераназваць';
$labels['addphoto'] = 'Дадаць';
$labels['replacephoto'] = 'ЗамÑніць';
-$labels['uploadphoto'] = 'Запампаваць фота';
+$labels['uploadphoto'] = 'Ðпублікаваць фота';
$labels['newcontact'] = 'Стварыць новую картку кантакта';
$labels['deletecontact'] = 'Выдаліць абраных кантактаў';
$labels['composeto'] = 'СклаÑці ліÑÑ‚ да';
@@ -300,7 +310,7 @@ $labels['exportall'] = 'ЭкÑпартаваць уÑÑ‘';
$labels['exportsel'] = 'ЭкÑпартаваць абранае';
$labels['exportvcards'] = 'ЭкÑпартаваць кантакты Ñž фармаце vCard';
$labels['newcontactgroup'] = 'Стварыць новую групу кантактаў';
-$labels['grouprename'] = 'Перайменаваць групу';
+$labels['grouprename'] = 'Пераназваць групу';
$labels['groupdelete'] = 'Выдаліць групу';
$labels['groupremoveselected'] = 'Выдаліць абраных кантакаў з групы';
$labels['previouspage'] = 'ПапÑÑ€ÑднÑÑ Ñтаронка';
@@ -321,7 +331,7 @@ $labels['importreplace'] = 'ЗамÑніць адраÑную кнігу цалÐ
$labels['importgroups'] = 'Імпартаваць прызначÑнні групы';
$labels['importgroupsall'] = 'УÑе (Ñтварыць групы пры неабходнаÑці)';
$labels['importgroupsexisting'] = 'Толькі Ð´Ð»Ñ Ñ–Ñнуючых груп';
-$labels['importdesc'] = 'Кантакты можна запампаваць з Ñ–Ñнуючай адраÑнай кнігі.<br/>Ðа дадзены момант падтрымліваюцца адраÑÑ‹ Ñž фарматах <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> Ñ– CSV (значÑнні цераз коÑку).';
+$labels['importdesc'] = 'Кантакты можна загрузіць з Ñ–Ñнуючай адраÑнай кнігі.<br/>Ðа дадзены момант падтрымліваюцца адраÑÑ‹ Ñž фарматах <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> Ñ– CSV (значÑнні праз коÑку).';
$labels['done'] = 'Гатова';
$labels['settingsfor'] = 'ÐаÑтаўленні длÑ';
$labels['about'] = 'ÐпіÑанне';
@@ -348,13 +358,13 @@ $labels['timezone'] = 'ЧаÑÐ°Ð²Ð°Ñ Ð·Ð¾Ð½Ð°';
$labels['pagesize'] = 'Радкоў на Ñтаронку';
$labels['signature'] = 'ПодпіÑ';
$labels['dstactive'] = 'Летні/зімовы чаÑ';
-$labels['showinextwin'] = 'ÐдчынÑць паведамленне Ñž новым акне';
+$labels['showinextwin'] = 'Ðдкрываць паведамленні Ñž новым акне';
$labels['composeextwin'] = 'Складаць у новым акне';
$labels['htmleditor'] = 'Складаць паведамленні ў HTML';
$labels['htmlonreply'] = 'у адказ на паведамленні ў HTML';
$labels['htmlonreplyandforward'] = 'пры пераÑылцы альбо Ñž адказ на паведамленні Ñž HTML';
$labels['htmlsignature'] = 'ÐŸÐ¾Ð´Ð¿Ñ–Ñ Ñƒ HTML';
-$labels['showemail'] = 'Паказваць Ð°Ð´Ñ€Ð°Ñ Ñлектроннай пошты разам з Ñкранным імем';
+$labels['showemail'] = 'Паказваць Ð°Ð´Ñ€Ð°Ñ Ñлектроннай пошты разам з Ñкраннай назвай';
$labels['previewpane'] = 'ПанÑль праглÑду';
$labels['skin'] = 'ТÑма інтÑрфейÑу';
$labels['logoutclear'] = 'Ðчышчаць Сметніцу па выхадзе';
@@ -384,7 +394,7 @@ $labels['never'] = 'ніколі';
$labels['immediately'] = 'імгненна';
$labels['messagesdisplaying'] = 'ÐдлюÑтраванне паведамленнÑÑž';
$labels['messagescomposition'] = 'Складанне паведамленнÑÑž';
-$labels['mimeparamfolding'] = 'Імёны далучÑннÑÑž';
+$labels['mimeparamfolding'] = 'Ðазвы далучÑннÑÑž';
$labels['2231folding'] = 'Поўны RFC 2231 (Thunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Поўны RFC 2047 (інш.)';
@@ -428,8 +438,11 @@ $labels['standardwindows'] = 'УÑпрымаць вокны-бурбалкі ÑÐ
$labels['forwardmode'] = 'ПераÑылка паведамленнÑÑž';
$labels['inline'] = 'у Ñ‚ÑкÑце';
$labels['asattachment'] = 'Ñк далучÑнне';
+$labels['replyallmode'] = 'Стандартнае дзеÑнне кнопкі [Ðдказаць уÑім]';
+$labels['replyalldefault'] = 'адказаць уÑім';
+$labels['replyalllist'] = 'адказаць толькі Ñž ÑÐ¿Ñ–Ñ Ñ€Ð°ÑÑылкі (калі знойдзены)';
$labels['folder'] = 'Папка';
-$labels['folders'] = 'ТÑчкі';
+$labels['folders'] = 'Папкі';
$labels['foldername'] = 'Ðазва папкі';
$labels['subscribed'] = 'ПадпіÑанаÑ';
$labels['messagecount'] = 'Паведамленні';
diff --git a/program/localization/be_BE/messages.inc b/program/localization/be_BE/messages.inc
index 4b2f07a2f..6afc34b23 100644
--- a/program/localization/be_BE/messages.inc
+++ b/program/localization/be_BE/messages.inc
@@ -35,8 +35,8 @@ $messages['loggedout'] = 'СеÑÑ–Ñ ÑкаÑавана. Да пабачÑннÑ
$messages['mailboxempty'] = 'У Ñкрынцы пуÑта.';
$messages['refreshing'] = 'ÐбнаўлÑецца...';
$messages['loading'] = 'Загружаецца...';
-$messages['uploading'] = 'Файл запампоўваюцца...';
-$messages['uploadingmany'] = 'Файлы запампоўваюцца...';
+$messages['uploading'] = 'Файл зацÑгваецца...';
+$messages['uploadingmany'] = 'Файлы зацÑгваюцца...';
$messages['loadingdata'] = 'Загружаюцца даныÑ...';
$messages['checkingmail'] = 'Праверка новых паведамленнÑÑž...';
$messages['sendingmessage'] = 'Паведамленне адпраўлÑецца...';
@@ -44,6 +44,8 @@ $messages['messagesent'] = 'Паведамленні адпраўлены.';
$messages['savingmessage'] = 'Паведамленне захоўваецца...';
$messages['messagesaved'] = 'Паведамленне захавана ў Чарнавікі.';
$messages['successfullysaved'] = 'Захавана.';
+$messages['savingresponse'] = 'ТÑкÑÑ‚ адказу захоўваецца...';
+$messages['deleteresponseconfirm'] = 'Ðапраўду выдаліць Ñ‚ÑкÑÑ‚ адказу?';
$messages['addedsuccessfully'] = 'Кантакт дададзены Ñž адраÑную кнігу.';
$messages['contactexists'] = 'Кантакт з такім Ñамым адраÑам Ñл. пошты ўжо Ñ–Ñнуе.';
$messages['contactnameexists'] = 'Кантакт з такім Ñамым імем ужо Ñ–Ñнуе.';
@@ -80,9 +82,10 @@ $messages['norecipientwarning'] = 'Задайце хацÑ-б аднаго атÑ
$messages['nosubjectwarning'] = 'ТÑма ліÑта не зададзена. Ці жадаеце задаць Ñе зараз?';
$messages['nobodywarning'] = 'Ðдправіць гÑта паведамленне без Ñ‚ÑкÑту?';
$messages['notsentwarning'] = 'Паведамленне не адпраўлена. Жадаеце ÑкаÑаваць Ñваё паведамленне?';
+$messages['restoresavedcomposedata'] = 'Было знойдзена ўжо Ñкладзенае, але не адпраўленае паведамленне.\n\nТÑма: $subject\nЗахавана: $date\n\nЖадаеце аднавіць гÑтае паведамленне?';
$messages['noldapserver'] = 'Задайце ldap-Ñервер Ð´Ð»Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ.';
$messages['nosearchname'] = 'Задайце Ñ–Ð¼Ñ ÐºÐ°Ð½Ñ‚Ð°ÐºÑ‚Ð° альбо Ð°Ð´Ñ€Ð°Ñ Ñлектроннай пошты.';
-$messages['notuploadedwarning'] = 'Ðе ÑžÑе далучÑнні пакуль ÑÑˆÑ‡Ñ Ð·Ð°Ð¿Ð°Ð¼Ð¿Ð°Ð²Ð°Ð½Ñ‹Ñ. Пачакайце альбо ÑкаÑуйце аперацыю.';
+$messages['notuploadedwarning'] = 'Ðе ÑžÑе далучÑнні пакуль ÑÑˆÑ‡Ñ Ð·Ð°Ñ†ÑгнутыÑ. Пачакайце альбо ÑкаÑуйце аперацыю.';
$messages['searchsuccessful'] = 'Знойдзена $nr паведамленнÑÑž.';
$messages['contactsearchsuccessful'] = 'Знойдзена $nr кантактаў.';
$messages['searchnomatch'] = 'Пошук не даў выніку.';
@@ -97,8 +100,8 @@ $messages['folderexpunged'] = 'Папка ÑціÑнута. ';
$messages['deletedsuccessfully'] = 'Выдалена.';
$messages['converting'] = 'Фарматаванне выдалÑецца...';
$messages['messageopenerror'] = 'Ðе ўдалоÑÑ Ð·Ð°Ð³Ñ€ÑƒÐ·Ñ–Ñ†ÑŒ паведамленне з Ñервера.';
-$messages['fileuploaderror'] = 'Ðе ўдалоÑÑ Ð·Ð°Ð¿Ð°Ð¼Ð¿Ð°Ð²Ð°Ñ†ÑŒ файл.';
-$messages['filesizeerror'] = 'Запампаваны файл перавышае макÑімальна дазволены памер $size.';
+$messages['fileuploaderror'] = 'Ðе ўдалоÑÑ Ð·Ð°Ñ†Ñгнуць файл.';
+$messages['filesizeerror'] = 'ЗацÑгнуты файл перавышае макÑімальна дазволены памер $size.';
$messages['copysuccess'] = '$nr кантактаў ÑкапіÑвана.';
$messages['movesuccess'] = '$nr кантактаў перамешчана.';
$messages['copyerror'] = 'Ðе ўдалоÑÑ ÑкапіÑваць ніводнага кантакта.';
@@ -118,17 +121,17 @@ $messages['errorsendingreceipt'] = 'Ðе ўдалоÑÑ Ð°Ð´Ð¿Ñ€Ð°Ð²Ñ–Ñ†ÑŒ паÑ
$messages['deleteidentityconfirm'] = 'Ðапраўду выдаліць гÑтую тоеÑнаÑць?';
$messages['nodeletelastidentity'] = 'ГÑтую тоеÑнаÑць выдаліць нÑможна, бо апошнÑÑ.';
$messages['forbiddencharacter'] = 'Ðазва папкі змÑшчае забаронены знак.';
-$messages['selectimportfile'] = 'ÐбÑрыце файл на запампоўку.';
+$messages['selectimportfile'] = 'ÐбÑрыце файл да зацÑгваннÑ.';
$messages['addresswriterror'] = 'ÐÐ±Ñ€Ð°Ð½Ð°Ñ Ð°Ð´Ñ€Ð°ÑÐ½Ð°Ñ ÐºÐ½Ñ–Ð³Ð° Ñ‘Ñць толькі-длÑ-чытаннÑ.';
$messages['contactaddedtogroup'] = 'Кантакты дададзены ў групу.';
$messages['contactremovedfromgroup'] = 'Кантакты Ð²Ñ‹Ð´Ð°Ð»ÐµÐ½Ñ‹Ñ Ð· групы.';
$messages['nogroupassignmentschanged'] = 'УÑе прызначÑнні групы заÑталіÑÑ Ð±ÐµÐ· зменаў.';
$messages['importwait'] = 'Ідзе імпартаванне. Чакайце...';
-$messages['importformaterror'] = 'Імпартаванне не ўдалоÑÑ! Запампаваны файл не ўтрымоўвае Ñлушных даных на імпарт.';
+$messages['importformaterror'] = 'Імпартаванне не ўдалоÑÑ! Загружаны файл не ўтрымоўвае Ñлушных даных на імпарт.';
$messages['importconfirm'] = '<b>$inserted кантактаў імпартаваныÑ</b>';
$messages['importconfirmskipped'] = '<b>Прапушчана $skipped Ñ–Ñнуючых запіÑаў</b>';
$messages['importmessagesuccess'] = '$nr паведамленнÑÑž імпартавана';
-$messages['importmessageerror'] = 'Ðе ўдалоÑÑ Ñ–Ð¼Ð¿Ð°Ñ€Ñ‚Ð°Ð²Ð°Ñ†ÑŒ! Запампаваны файл не Ñ‘Ñць Ñлушным паведамленнем альбо файлам паштовай Ñкрынкі';
+$messages['importmessageerror'] = 'Ðе ўдалоÑÑ Ñ–Ð¼Ð¿Ð°Ñ€Ñ‚Ð°Ð²Ð°Ñ†ÑŒ! Загружаны файл не Ñ‘Ñць Ñлушным паведамленнем альбо файлам паштовай Ñкрынкі';
$messages['opnotpermitted'] = 'ÐÐ¿ÐµÑ€Ð°Ñ†Ñ‹Ñ Ð½Ðµ дазволенаÑ!';
$messages['nofromaddress'] = 'У абранай тоеÑнаÑці не Ñтае адраÑу Ñл. пошты.';
$messages['editorwarning'] = 'Змена Ñ€Ñдактара прывÑдзе да Ñтраты фарматаваннÑ. ПрацÑгнуць?';
diff --git a/program/localization/bg_BG/labels.inc b/program/localization/bg_BG/labels.inc
index 29c99e8f4..e7f2f3712 100644
--- a/program/localization/bg_BG/labels.inc
+++ b/program/localization/bg_BG/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to от $count';
$labels['copy'] = 'Копиране';
$labels['move'] = 'ПремеÑтване';
$labels['moveto'] = 'ПремеÑти във...';
+$labels['copyto'] = 'Копирай във...';
$labels['download'] = 'Изтегли';
$labels['open'] = 'Отвори';
$labels['showattachment'] = 'Показване';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'ПравопиÑ';
$labels['checkspelling'] = 'Проверка на правопиÑа';
$labels['resumeediting'] = 'Продължи черновата';
$labels['revertto'] = 'Върни Ñе към';
+$labels['restore'] = 'ВъзÑтанови';
+$labels['restoremessage'] = 'ВъзÑтановÑване на Ñъобщението?';
+$labels['responses'] = 'Отговори';
+$labels['insertresponse'] = 'Вмъкване на отговори';
+$labels['manageresponses'] = 'ÐаÑтройка на отговори';
+$labels['savenewresponse'] = 'Ð—Ð°Ð¿Ð¸Ñ Ð½Ð° нов отговор';
+$labels['editresponses'] = 'Ð ÐµÐ´Ð°ÐºÑ†Ð¸Ñ Ð½Ð° отговори';
+$labels['editresponse'] = 'Ð ÐµÐ´Ð°ÐºÑ†Ð¸Ñ Ð½Ð° отговор';
+$labels['responsename'] = 'Име';
+$labels['responsetext'] = 'ТекÑÑ‚ на отговор';
$labels['attach'] = 'Прикачи';
$labels['attachments'] = 'Прикачени файлове';
$labels['upload'] = 'Качи';
@@ -224,7 +235,7 @@ $labels['addcc'] = 'Копие до';
$labels['addbcc'] = 'Скрито копие до';
$labels['addreplyto'] = 'Отговор до';
$labels['addfollowupto'] = 'Препращане към';
-$labels['mdnrequest'] = 'ПодателÑÑ‚ е поиÑкал да бъде уведомен, че Ñте го прочели това пиÑмо. Желаете ли да изпратите обратна разпиÑка?';
+$labels['mdnrequest'] = 'ПодателÑÑ‚ е поиÑкал да бъде уведомен, че Ñте прочели това пиÑмо. Желаете ли да изпратите обратна разпиÑка?';
$labels['receiptread'] = 'Обратна разпиÑка (прочетено)';
$labels['yourmessage'] = 'Това е обратна разпиÑка отноÑно пиÑмото Ви';
$labels['receiptnote'] = 'Забележка: Тази разпиÑка потвърждава Ñамо, че пиÑмото е било визуализирано на екрана на получателÑÑ‚. ÐÑма никаква гаранциÑ, че той е разбрал и/или дори прочел неговото Ñъдържание.';
@@ -238,8 +249,8 @@ $labels['nickname'] = 'ПÑевдоним';
$labels['jobtitle'] = 'ДлъжноÑÑ‚';
$labels['department'] = 'Отдел';
$labels['gender'] = 'Пол';
-$labels['maidenname'] = 'Бащино име';
-$labels['email'] = 'E-mail';
+$labels['maidenname'] = 'МоминÑко име';
+$labels['email'] = 'Ел. поща';
$labels['phone'] = 'Телефон';
$labels['address'] = 'ÐдреÑ';
$labels['street'] = 'Улица';
@@ -354,7 +365,7 @@ $labels['htmleditor'] = 'ПиÑане на ново пиÑмо като HTML';
$labels['htmlonreply'] = 'Ñамо при отговор на HTML пиÑмо';
$labels['htmlonreplyandforward'] = 'Ñамо при препращане или отговор на HTML пиÑмо';
$labels['htmlsignature'] = 'HTML подпиÑ';
-$labels['showemail'] = 'Показва email Ð°Ð´Ñ€ÐµÑ Ñ ÐµÐºÑ€Ð°Ð½Ð½Ð¾Ñ‚Ð¾ име';
+$labels['showemail'] = 'Показва Ð°Ð´Ñ€ÐµÑ Ð½Ð° ел. поща Ñ ÐµÐºÑ€Ð°Ð½Ð½Ð¾Ñ‚Ð¾ име';
$labels['previewpane'] = 'Показване на панел за преглед';
$labels['skin'] = 'Изглед на потребителÑки интерфейÑ';
$labels['logoutclear'] = 'При изход изтрий вÑичко от Кошче';
@@ -415,7 +426,7 @@ $labels['reqmdn'] = 'Винаги изиÑквай обратна разпиÑк
$labels['reqdsn'] = 'Винаги изиÑквай ÑÑ‚Ð°Ñ‚ÑƒÑ Ð´Ð¾Ñтавка на пиÑмото';
$labels['replysamefolder'] = 'ПоÑтави отговор в папка на пиÑмото, на което Ñе отговарÑ';
$labels['defaultabook'] = 'ÐдреÑна книга по подразбиране';
-$labels['autocompletesingle'] = 'ПропуÑни алтернативни e-mail адреÑи при автоматично попълване';
+$labels['autocompletesingle'] = 'ПропуÑни алтернативни адреÑи на ел. поща при автоматично попълване';
$labels['listnamedisplay'] = 'Форматирай ÑпиÑък Ñ ÐºÐ¾Ð½Ñ‚Ð°ÐºÑ‚Ð¸ като';
$labels['spellcheckbeforesend'] = 'Провери за правопиÑни грешки преди изпращане на пиÑмото';
$labels['spellcheckoptions'] = 'ÐаÑтройки на проверката за правопиÑ';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Обработва изÑкачащи прозор
$labels['forwardmode'] = 'Препращай пиÑмата';
$labels['inline'] = 'цитирани в пиÑмото';
$labels['asattachment'] = 'като прикачен файл';
+$labels['replyallmode'] = 'ДейÑтвие по подразбиране на бутон [Отговор на вÑички]';
+$labels['replyalldefault'] = 'отговори на вÑички';
+$labels['replyalllist'] = 'отговори на ÑпиÑъка Ñамо (ако има)';
$labels['folder'] = 'Папка';
$labels['folders'] = 'Папки';
$labels['foldername'] = 'Име на папката';
diff --git a/program/localization/bg_BG/messages.inc b/program/localization/bg_BG/messages.inc
index 210eda1b1..df9620b30 100644
--- a/program/localization/bg_BG/messages.inc
+++ b/program/localization/bg_BG/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -30,9 +30,10 @@ $messages['erroroverquota'] = 'Ðевъзможно извършване на о
$messages['erroroverquotadelete'] = 'ÐÑма доÑтатъчно Ñвободно диÑково проÑтранÑтво. Ползвайте Shift+Del за да изтриете пиÑма.';
$messages['invalidrequest'] = 'Ðевалидна заÑвка! Данните не Ñа Ñъхранени.';
$messages['invalidhost'] = 'Ðевалидно име на Ñървър.';
-$messages['nomessagesfound'] = 'ÐÑма пиÑма.';
+$messages['nomessagesfound'] = 'ÐÑма пиÑма в тази пощенÑка кутиÑ.';
$messages['loggedout'] = 'СеÑиÑта е прекратена уÑпешно. Довиждане до ÑÐ»ÐµÐ´Ð²Ð°Ñ‰Ð¸Ñ Ð¿ÑŠÑ‚!';
-$messages['mailboxempty'] = 'ПощенÑката ÐºÑƒÑ‚Ð¸Ñ Ðµ празна.';
+$messages['mailboxempty'] = 'ПощенÑката ÐºÑƒÑ‚Ð¸Ñ Ðµ празна';
+$messages['nomessages'] = 'ÐÑма пиÑма';
$messages['refreshing'] = 'ОбновÑване...';
$messages['loading'] = 'Зареждане...';
$messages['uploading'] = 'Качване на файл...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'ПиÑмото е изпратено уÑпешно.
$messages['savingmessage'] = 'ЗапиÑване на пиÑмо...';
$messages['messagesaved'] = 'ПиÑмото е запиÑано в Чернови.';
$messages['successfullysaved'] = 'УÑпешен запиÑ.';
+$messages['savingresponse'] = 'ЗапиÑване текÑÑ‚ на отговор...';
+$messages['deleteresponseconfirm'] = 'Желаете ли да изтриете текÑÑ‚ за отговор?';
$messages['addedsuccessfully'] = 'Контактът е добавен в адреÑната книга.';
$messages['contactexists'] = 'Вече ÑъщеÑтвува контакт Ñ Ñ‚Ð¾Ð·Ð¸ e-mail адреÑ.';
$messages['contactnameexists'] = 'Вече ÑъщеÑтвува контакт Ñ Ñ‚Ð¾Ð²Ð° име.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'ТърÑениÑÑ‚ контакт не е нам
$messages['contactsearchonly'] = 'Използвайте полето за да Ñ‚ÑŠÑ€Ñите контакти';
$messages['sendingfailed'] = 'ÐеуÑпешно изпращане на пиÑмо.';
$messages['senttooquickly'] = 'ÐœÐ¾Ð»Ñ Ð¸Ð·Ñ‡Ð°ÐºÐ°Ð¹Ñ‚Ðµ $sec Ñекунди преди да изпратите пиÑмото.';
+$messages['errorsavingsent'] = 'Възникна грешка при запиÑване на изпратеното пиÑмо.';
+$messages['errorsaving'] = 'Възникна грешка при запиÑването.';
$messages['errormoving'] = 'ПиÑмото не може да бъде премеÑтено.';
$messages['errorcopying'] = 'ПиÑмото не може да бъде копирано.';
$messages['errordeleting'] = 'ПиÑмото не може да бъде изтрито.';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'ÐœÐ¾Ð»Ñ Ð²ÑŠÐ²ÐµÐ´ÐµÑ‚Ðµ поне един Ð
$messages['nosubjectwarning'] = 'Полето "Заглавие" е празно. Желаете ли да въведете заглавие Ñега?';
$messages['nobodywarning'] = 'Изпрати това пиÑмо без текÑÑ‚?';
$messages['notsentwarning'] = 'ПиÑмото не е изпратено. Желаете ли да бъде унищожено?';
+$messages['restoresavedcomposedata'] = 'Ðамерено е неизпратено пиÑмо, което е било в Ð¿Ñ€Ð¾Ñ†ÐµÑ Ð½Ð° Ñъздаване.\n\nОтноÑно: $subject\nЗапазено на: $date\n\nЖелаете ли да възÑтановите пиÑмото?';
$messages['noldapserver'] = 'Изберете LDAP Ñървър за Ñ‚ÑŠÑ€Ñене.';
$messages['nosearchname'] = 'ÐœÐ¾Ð»Ñ Ð²ÑŠÐ²ÐµÐ´ÐµÑ‚Ðµ име на контакта или e-mail адреÑ.';
$messages['notuploadedwarning'] = 'Ð’Ñе още не Ñа качени вÑички прикачени файлове. ÐœÐ¾Ð»Ñ Ð¸Ð·Ñ‡Ð°ÐºÐ°Ð¹Ñ‚Ðµ или откажете качването.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'SMTP грешка: $msg';
$messages['emailformaterror'] = 'Ðевалиден e-mail адреÑ: $email';
$messages['toomanyrecipients'] = 'Прекалено много адреÑи за изпращане (макÑимум: $max).';
$messages['maxgroupmembersreached'] = 'БроÑÑ‚ на членовете на групата е повече от макÑималниÑ: $max.';
+$messages['internalerror'] = 'Възникна вътрешна грешка. ÐœÐ¾Ð»Ñ Ð¾Ð¿Ð¸Ñ‚Ð°Ð¹Ñ‚Ðµ отново.';
$messages['contactdelerror'] = 'Ðевъзможно изтриване на контакти.';
$messages['contactdeleted'] = 'Контактът беше изтрит уÑпешно.';
$messages['contactrestoreerror'] = 'ÐеуÑпешно възÑтановÑване на изтрите контакти.';
diff --git a/program/localization/bs_BA/labels.inc b/program/localization/bs_BA/labels.inc
index df58d8d60..c79cf4ecc 100644
--- a/program/localization/bs_BA/labels.inc
+++ b/program/localization/bs_BA/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to od ukupno $count';
$labels['copy'] = 'Kopiraj';
$labels['move'] = 'Premjesti';
$labels['moveto'] = 'Premjesti u...';
+$labels['copyto'] = 'Kopiraj u...';
$labels['download'] = 'Preuzmi';
$labels['open'] = 'Otvori';
$labels['showattachment'] = 'Prikaži';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Pravopis';
$labels['checkspelling'] = 'Provjera pravopisa';
$labels['resumeediting'] = 'Nastavi uređivanje';
$labels['revertto'] = 'Vrati na';
+$labels['restore'] = 'Vrati';
+$labels['restoremessage'] = 'Vratiti poruku?';
+$labels['responses'] = 'Odgovori';
+$labels['insertresponse'] = 'Umetni odgovor';
+$labels['manageresponses'] = 'Upravljaj odgovorima';
+$labels['savenewresponse'] = 'Snimi novi odgovor';
+$labels['editresponses'] = 'Uredi odgovore';
+$labels['editresponse'] = 'Uredi odgovor';
+$labels['responsename'] = 'Ime';
+$labels['responsetext'] = 'Tekst odgovora';
$labels['attach'] = 'Priloži';
$labels['attachments'] = 'Prilozi';
$labels['upload'] = 'Dodaj';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Tretiraj popup-ove kao standardne prozore';
$labels['forwardmode'] = 'Prosljeđivanje poruka';
$labels['inline'] = 'u istom redu';
$labels['asattachment'] = 'kao prilog';
+$labels['replyallmode'] = 'Zadana radnja za [Odgovori svima] dugme';
+$labels['replyalldefault'] = 'odgovori svima';
+$labels['replyalllist'] = 'odgovori samo listi mailova (ukoliko je pronađena)';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folderi';
$labels['foldername'] = 'Naziv foldera';
diff --git a/program/localization/bs_BA/messages.inc b/program/localization/bs_BA/messages.inc
index 3424013c5..52f865f1e 100644
--- a/program/localization/bs_BA/messages.inc
+++ b/program/localization/bs_BA/messages.inc
@@ -44,6 +44,8 @@ $messages['messagesent'] = 'Poruka je uspješno poslana.';
$messages['savingmessage'] = 'Poruka se snima...';
$messages['messagesaved'] = 'Poruka je uspjeÅ¡no saÄuvana u skicama.';
$messages['successfullysaved'] = 'UspjeÅ¡no saÄuvano.';
+$messages['savingresponse'] = 'Snimam teksta odgovora...';
+$messages['deleteresponseconfirm'] = 'Da li zaista želite obrisati tekst ovog odgovora?';
$messages['addedsuccessfully'] = 'Kontakt uspješno dodan u adresar.';
$messages['contactexists'] = 'Kontakt sa ovom email adresom već postoji u adresaru.';
$messages['contactnameexists'] = 'Kontakt s tim imenom već postoji.';
@@ -54,6 +56,8 @@ $messages['contactnotfound'] = 'Traženi kontakt nije pronađen.';
$messages['contactsearchonly'] = 'Unesite neki pojam za pretragu';
$messages['sendingfailed'] = 'Greška pri slanju poruke.';
$messages['senttooquickly'] = 'Molimo saÄekajte $sec sekundi prije slanja ove poruke.';
+$messages['errorsavingsent'] = 'Desila se greška pri snimanju poslane poruke.';
+$messages['errorsaving'] = 'Desila se greška pri snimanju.';
$messages['errormoving'] = 'Nije moguće premjestiti poruke.';
$messages['errorcopying'] = 'Nije moguće kopirati poruke.';
$messages['errordeleting'] = 'Nije moguće obrisati poruke.';
@@ -78,6 +82,7 @@ $messages['norecipientwarning'] = 'Molimo vas da upišete barem jednog primaoca.
$messages['nosubjectwarning'] = 'Polje \'Naslov\' je prazno. Želite li unijeti naslov?';
$messages['nobodywarning'] = 'Želite li poslati poruku bez teksta?';
$messages['notsentwarning'] = 'Poruka nije poslana. Želite li odbaciti ovu poruku?';
+$messages['restoresavedcomposedata'] = 'Pronađena je prethodno napisana poruka koja nije poslana..\n\nTema:$subject\nSnimljeno: $date\n\nŽelite li vratiti ovu poruku?';
$messages['noldapserver'] = 'Molimo vas da odaberete LDAP server za pretragu.';
$messages['nosearchname'] = 'Molimo vas da upišete ime kontakta ili email adresu.';
$messages['notuploadedwarning'] = 'Neki od priloga joÅ¡ nisu dodani na server. Molimo vas da saÄekate ili da otkažete dodavanje.';
@@ -140,6 +145,7 @@ $messages['smtperror'] = 'SMTP greška: $msg';
$messages['emailformaterror'] = 'NetaÄna email adresa: $email';
$messages['toomanyrecipients'] = 'Previše primaoca. Smanjite broj primaoca na $max.';
$messages['maxgroupmembersreached'] = 'Broj Älanova grupe prelazi maksimum od $max.';
+$messages['internalerror'] = 'Dogodila se interna greška. Molimo vas da pokušate ponovo.';
$messages['contactdelerror'] = 'Kontakti ne mogu biti obrisani.';
$messages['contactdeleted'] = 'Kontakti su uspješno obrisani.';
$messages['contactrestoreerror'] = 'Nije moguće vratiti obrisane kontakte.';
diff --git a/program/localization/ca_ES/labels.inc b/program/localization/ca_ES/labels.inc
index 065431fbc..120e2bc97 100644
--- a/program/localization/ca_ES/labels.inc
+++ b/program/localization/ca_ES/labels.inc
@@ -45,13 +45,14 @@ $labels['organization'] = 'Organització';
$labels['readstatus'] = 'Estat de lectura';
$labels['listoptions'] = 'Llista d\'opcions...';
$labels['mailboxlist'] = 'Carpetes';
-$labels['messagesfromto'] = 'Missatges des de $from a $to de $count';
+$labels['messagesfromto'] = 'Missatges $from a $to de $count';
$labels['threadsfromto'] = 'Fils $from a $to de $count';
$labels['messagenrof'] = 'Missatge $nr de $count';
$labels['fromtoshort'] = '$from - $to de $count';
$labels['copy'] = 'Copia';
$labels['move'] = 'Mou';
$labels['moveto'] = 'Mou a...';
+$labels['copyto'] = 'Copia a...';
$labels['download'] = 'Descarrega';
$labels['open'] = 'Obre';
$labels['showattachment'] = 'Mostra';
@@ -89,7 +90,7 @@ $labels['longjan'] = 'gener';
$labels['longfeb'] = 'febrer';
$labels['longmar'] = 'març';
$labels['longapr'] = 'abril';
-$labels['longmay'] = 'mai';
+$labels['longmay'] = 'maig';
$labels['longjun'] = 'juny';
$labels['longjul'] = 'juliol';
$labels['longaug'] = 'agost';
@@ -99,14 +100,14 @@ $labels['longnov'] = 'novembre';
$labels['longdec'] = 'desembre';
$labels['today'] = 'Avui';
$labels['refresh'] = 'Actualitza';
-$labels['checkmail'] = 'Recupera missatges nous';
+$labels['checkmail'] = 'Comprova si hi ha missatges nous';
$labels['compose'] = 'Escriu un missatge';
$labels['writenewmessage'] = 'Crea un nou missatge';
$labels['reply'] = 'Respon';
$labels['replytomessage'] = 'Respon al remitent';
-$labels['replytoallmessage'] = 'Respon al remitent i a tots els destinataris';
+$labels['replytoallmessage'] = 'Respon a la llista o al remitent i a tots els destinataris';
$labels['replyall'] = 'Respon a tots';
-$labels['replylist'] = 'Llista de resposta';
+$labels['replylist'] = 'Respon a la llista';
$labels['forward'] = 'Reenvia';
$labels['forwardinline'] = 'Reenvia com en línia';
$labels['forwardattachment'] = 'Reenvia com a adjunt';
@@ -134,7 +135,7 @@ $labels['select'] = 'Selecciona';
$labels['all'] = 'Tots';
$labels['none'] = 'Cap';
$labels['currpage'] = 'Pàgina actual';
-$labels['unread'] = 'No llegits';
+$labels['unread'] = 'No llegit';
$labels['flagged'] = 'Marcat';
$labels['unanswered'] = 'No respost';
$labels['withattachment'] = 'Amb fitxer adjunt';
@@ -143,17 +144,17 @@ $labels['undeleted'] = 'No s\'ha suprimit';
$labels['invert'] = 'Inverteix';
$labels['filter'] = 'Filtre';
$labels['list'] = 'Llista';
-$labels['threads'] = 'Fils de discusió';
-$labels['expand-all'] = 'Expandeix tots';
+$labels['threads'] = 'Fils de discussió';
+$labels['expand-all'] = 'Expandeix tot';
$labels['expand-unread'] = 'Expandeix No llegits';
-$labels['collapse-all'] = 'Redueix tots';
+$labels['collapse-all'] = 'Redueix tot';
$labels['threaded'] = 'Encadenat';
$labels['autoexpand_threads'] = 'Expandeix els missatges encadenats';
-$labels['do_expand'] = 'tots els fils de discusió';
+$labels['do_expand'] = 'tots els fils de discussió';
$labels['expand_only_unread'] = 'només amb missatges no llegits';
$labels['fromto'] = 'Remitent/Destinatari';
$labels['flag'] = 'Marca';
-$labels['attachment'] = 'Adjunció';
+$labels['attachment'] = 'Adjunt';
$labels['nonesort'] = 'Cap';
$labels['sentdate'] = 'Data d\'enviament';
$labels['arrival'] = 'Data d\'arribada';
@@ -163,7 +164,7 @@ $labels['listcolumns'] = 'Llista les columnes';
$labels['listsorting'] = 'Columna d\'ordenació';
$labels['listorder'] = 'Ordre d\'ordenació';
$labels['listmode'] = 'Mode de vista de llista';
-$labels['folderactions'] = 'Accions de carpeta';
+$labels['folderactions'] = 'Accions de carpeta...';
$labels['compact'] = 'Compacta';
$labels['empty'] = 'Buida';
$labels['importmessages'] = 'Importa missatges';
@@ -175,16 +176,16 @@ $labels['resetsearch'] = 'Neteja cerca';
$labels['searchmod'] = 'Cerca modificadors';
$labels['msgtext'] = 'Missatge sencer';
$labels['body'] = 'Cos';
-$labels['type'] = 'tipus:';
+$labels['type'] = 'Tipus';
$labels['namex'] = 'Nom';
$labels['openinextwin'] = 'Obre a una nova finestra';
$labels['emlsave'] = 'Descarrega (.eml)';
$labels['changeformattext'] = 'Mostra en format de text net';
$labels['changeformathtml'] = 'Mostra en format HTML';
$labels['editasnew'] = 'Edita com a nou';
-$labels['send'] = 'Enviar';
+$labels['send'] = 'Envia';
$labels['sendmessage'] = 'Envia el missatge';
-$labels['savemessage'] = 'Desa aquest esborrany';
+$labels['savemessage'] = 'Desa com a esborrany';
$labels['addattachment'] = 'Adjunta un fitxer';
$labels['charset'] = 'Codificació de caràcters';
$labels['editortype'] = 'Tipus d\'editor';
@@ -197,8 +198,18 @@ $labels['spellcheck'] = 'Ortografia';
$labels['checkspelling'] = 'Comprova l\'ortografia';
$labels['resumeediting'] = 'Reprèn l\'edició';
$labels['revertto'] = 'Torna a';
+$labels['restore'] = 'Recupera';
+$labels['restoremessage'] = 'Recupera el missatge?';
+$labels['responses'] = 'Respostes';
+$labels['insertresponse'] = 'Introduïu una resposta';
+$labels['manageresponses'] = 'Gestiona respostes';
+$labels['savenewresponse'] = 'Desa una nova resposta';
+$labels['editresponses'] = 'Edita respostes';
+$labels['editresponse'] = 'Edita la resposta';
+$labels['responsename'] = 'Nom';
+$labels['responsetext'] = 'Text de resposta';
$labels['attach'] = 'Adjunta';
-$labels['attachments'] = 'Adjuncions';
+$labels['attachments'] = 'Adjunts';
$labels['upload'] = 'Afegeix';
$labels['uploadprogress'] = '$percent ($current de $total)';
$labels['close'] = 'Tanca';
@@ -214,18 +225,18 @@ $labels['alwaysshow'] = 'Mostra sempre les imatges de $sender';
$labels['isdraft'] = 'Aquest és un missatge esborrany.';
$labels['andnmore'] = '$nr més...';
$labels['togglemoreheaders'] = 'Mostra més capçaleres del missatge';
-$labels['togglefullheaders'] = 'Conmuta les capçaleres de text cru';
+$labels['togglefullheaders'] = 'Commuta les capçaleres del missatge en brut';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Text net';
$labels['savesentmessagein'] = 'Desa el missatge enviat a';
$labels['dontsave'] = 'no ho desis';
-$labels['maxuploadsize'] = 'El mida màxima del fitxer és $size';
+$labels['maxuploadsize'] = 'La mida màxima permesa del fitxer és $size';
$labels['addcc'] = 'Afegeix Cc';
$labels['addbcc'] = 'Afegeix Bcc';
$labels['addreplyto'] = 'Afegeix Respon-A';
$labels['addfollowupto'] = 'Afegir Seguiment-A';
$labels['mdnrequest'] = 'El remitent d\'aquest missatge ha demanat ser notificat quan llegiu aquest missatge. Voleu notificar al remitent?';
-$labels['receiptread'] = 'Confirmació de recepció';
+$labels['receiptread'] = 'Confirmació de recepció (llegit)';
$labels['yourmessage'] = 'Això és una confirmació de recepció per al vostre missatge';
$labels['receiptnote'] = 'Nota: Aquesta confirmació només indica que el missatge ha estat mostrat a l\'ordinador del destinatari. No hi ha garantia que el destinatari hagi llegit o entès el contingut del missatge.';
$labels['name'] = 'Nom a mostrar';
@@ -273,7 +284,7 @@ $labels['typecar'] = 'Cotxe';
$labels['typepager'] = 'Cercapersones';
$labels['typevideo'] = 'Vídeo';
$labels['typeassistant'] = 'Assistent';
-$labels['typehomepage'] = 'Pàgina Inicial';
+$labels['typehomepage'] = 'Pàgina web personal';
$labels['typeblog'] = 'Bloc';
$labels['typeprofile'] = 'Perfil';
$labels['addfield'] = 'Afegeix camp...';
@@ -289,7 +300,7 @@ $labels['delete'] = 'Suprimeix';
$labels['rename'] = 'Reanomena';
$labels['addphoto'] = 'Afegeix';
$labels['replacephoto'] = 'Reemplaça';
-$labels['uploadphoto'] = 'Puja una fotografia';
+$labels['uploadphoto'] = 'Afegeix una fotografia';
$labels['newcontact'] = 'Crea un nou contacte';
$labels['deletecontact'] = 'Suprimeix els contactes seleccionats';
$labels['composeto'] = 'Redacta correu per a';
@@ -310,14 +321,18 @@ $labels['lastpage'] = 'Mostra la darrera pàgina';
$labels['group'] = 'Grup';
$labels['groups'] = 'Grups';
$labels['listgroup'] = 'Llista els membres del grup';
-$labels['personaladrbook'] = 'Llibreta d\'adreces';
+$labels['personaladrbook'] = 'Llibreta d\'adreces personals';
$labels['searchsave'] = 'Desa la cerca';
$labels['searchdelete'] = 'Suprimeix la cerca';
$labels['import'] = 'Importa';
$labels['importcontacts'] = 'Importa contactes';
$labels['importfromfile'] = 'Importa des d\'un fitxer:';
-$labels['importreplace'] = 'Reemplaça la llibreta d\'adreçes sencera';
-$labels['importdesc'] = 'Podeu carregar contactes des d\'una llibreta de direccions.<br/>Actualment donem suport a la importació d\'adreces des de fitxers de tipus <a href="http://ca.wikipedia.org/wiki/VCard">vCard</a> o CSV (valors separats per comes).';
+$labels['importtarget'] = 'Afegeix contactes a';
+$labels['importreplace'] = 'Substitueix la llibreta d\'adreces sencera';
+$labels['importgroups'] = 'Importa assignacions de grup';
+$labels['importgroupsall'] = 'Tot (crea grups si és necessari)';
+$labels['importgroupsexisting'] = 'Només per a grups existents';
+$labels['importdesc'] = 'Podeu afegir contactes des d\'una llibreta d\'adreces.<br/>Actualment donem suport a la importació d\'adreces des de fitxers de tipus <a href="http://ca.wikipedia.org/wiki/VCard">vCard</a> o CSV (valors separats per comes).';
$labels['done'] = 'Fet';
$labels['settingsfor'] = 'Configuració per a';
$labels['about'] = 'Quant a';
@@ -344,11 +359,11 @@ $labels['timezone'] = 'Fus horari';
$labels['pagesize'] = 'Files per pàgina';
$labels['signature'] = 'Signatura';
$labels['dstactive'] = 'Horari d\'estiu';
-$labels['showinextwin'] = 'Obrir el missatge en una nova finestra';
-$labels['composeextwin'] = 'Redactar en una nova finestra';
+$labels['showinextwin'] = 'Obre el missatge en una nova finestra';
+$labels['composeextwin'] = 'Redacta en una nova finestra';
$labels['htmleditor'] = 'Escriu missatges en HTML';
$labels['htmlonreply'] = 'només en resposta a missatges en HTML';
-$labels['htmlonreplyandforward'] = 'en reenviament o resposta a missatge HTML';
+$labels['htmlonreplyandforward'] = 'quan es reenviï o es respongui un missatge en HTML';
$labels['htmlsignature'] = 'Signatura en HTML';
$labels['showemail'] = 'Mostra l\'adreça electrònica amb el nom';
$labels['previewpane'] = 'Mostra el panell de previsualització';
@@ -358,10 +373,10 @@ $labels['logoutcompact'] = 'Compacta la safata d\'entrada al tancar la sessió';
$labels['uisettings'] = 'Interfície de l\'usuari';
$labels['serversettings'] = 'Configuració del servidor';
$labels['mailboxview'] = 'Vista de la bústia';
-$labels['mdnrequests'] = 'Notificacions de confirmació de recepció';
+$labels['mdnrequests'] = 'Quan es demani confirmació de recepció';
$labels['askuser'] = 'demana\'m què vull fer';
$labels['autosend'] = 'envia la confirmació de recepció';
-$labels['autosendknown'] = 'envia la confirmació de recepció als meus contactes, pels demés damana-m\'ho';
+$labels['autosendknown'] = 'envia la confirmació de recepció als meus contactes, pels demés demana-m\'ho';
$labels['autosendknownignore'] = 'envia la confirmació als meus contactes, pels demés ignora-ho';
$labels['ignore'] = 'ignora';
$labels['readwhendeleted'] = 'Marca el missatge com a llegit quan se suprimeixi';
@@ -370,12 +385,12 @@ $labels['skipdeleted'] = 'No mostris els missatges suprimits';
$labels['deletealways'] = 'Si falla quan es mou un missatge a la Paperera, aleshores suprimeix-lo';
$labels['deletejunk'] = 'Suprimeix directament els missatges de Correu brossa';
$labels['showremoteimages'] = 'Mostra les imatges remotes del missatge';
-$labels['fromknownsenders'] = 'de remitent conegut';
+$labels['fromknownsenders'] = 'de remitents coneguts';
$labels['always'] = 'sempre';
$labels['showinlineimages'] = 'Mostra les imatges adjuntes sota el missatge';
$labels['autosavedraft'] = 'Desa l\'esborrany automàticament';
$labels['everynminutes'] = 'cada $n minut(s)';
-$labels['refreshinterval'] = 'Resfrescar (comprovar nous missatges, etc.)';
+$labels['refreshinterval'] = 'Actualitza (comprova nous missatges, etc.)';
$labels['never'] = 'mai';
$labels['immediately'] = 'immediatament';
$labels['messagesdisplaying'] = 'Vista de missatges';
@@ -386,25 +401,25 @@ $labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Compleix RFC 2047 (un altre)';
$labels['force7bit'] = 'Fes servir la codificació MIME per a caràcters de 8-bits';
$labels['advancedoptions'] = 'Opcions avançades';
-$labels['focusonnewmessage'] = 'Envia el focus al navegador quan hi hagi un nou missatge';
+$labels['focusonnewmessage'] = 'Activa la finestra del navegador quan hi hagi un nou missatge';
$labels['checkallfolders'] = 'Comprova totes les carpetes per missatges nous';
-$labels['displaynext'] = 'Mostra el següent missatge després de suprimir-ne o moure\'n un';
-$labels['defaultfont'] = 'Font de lletra per defecte de missatge HTML';
+$labels['displaynext'] = 'Mostra el missatge següent després de suprimir-ne o moure\'n un';
+$labels['defaultfont'] = 'Font de lletra per defecte de missatge en HTML';
$labels['mainoptions'] = 'Opcions principals';
$labels['browseroptions'] = 'Opcions del navegador';
$labels['section'] = 'Secció';
$labels['maintenance'] = 'Manteniment';
$labels['newmessage'] = 'Missatge nou';
$labels['signatureoptions'] = 'Opcions de signatura';
-$labels['whenreplying'] = 'Quan es respon';
-$labels['replyempty'] = 'do citis el missatge original';
+$labels['whenreplying'] = 'Quan es respongui';
+$labels['replyempty'] = 'no citis el missatge original';
$labels['replytopposting'] = 'comença el missatge nou per sobre de l\'original';
$labels['replybottomposting'] = 'comença el missatge nou per sota de l\'original';
-$labels['replyremovesignature'] = 'Quan es contesti, suprimeix la signatura original del missatge';
+$labels['replyremovesignature'] = 'Quan es respongui suprimeix la signatura original del missatge';
$labels['autoaddsignature'] = 'Afegeix la signatura automàticament';
$labels['newmessageonly'] = 'només si és un missatge nou';
$labels['replyandforwardonly'] = 'només a respostes i reenviaments';
-$labels['insertsignature'] = 'Inserta la signatura';
+$labels['insertsignature'] = 'Inclou la signatura';
$labels['previewpanemarkread'] = 'Marca els missatges previsualitzats com a llegits';
$labels['afternseconds'] = 'després de $n segons';
$labels['reqmdn'] = 'Demana sempre la confirmació de recepció';
@@ -423,7 +438,10 @@ $labels['mailtoprotohandler'] = 'Registra controlador de protocol pels enllaços
$labels['standardwindows'] = 'Gestiona les finestres emergents com si fossin finestres normals';
$labels['forwardmode'] = 'Reenviament de missatges';
$labels['inline'] = 'en línia';
-$labels['asattachment'] = 'com adjunt';
+$labels['asattachment'] = 'com un adjunt';
+$labels['replyallmode'] = 'Acció per defecte del botó [Respon a tots]';
+$labels['replyalldefault'] = 'respon a tots';
+$labels['replyalllist'] = 'respon només a la llista de missatges (si n\'hi ha cap)';
$labels['folder'] = 'Carpeta';
$labels['folders'] = 'Carpetes';
$labels['foldername'] = 'Nom de la carpeta';
@@ -448,7 +466,7 @@ $labels['sortby'] = 'Ordena per';
$labels['sortasc'] = 'Ordena ascendentment';
$labels['sortdesc'] = 'Ordena descendentment';
$labels['undo'] = 'Desfés';
-$labels['installedplugins'] = 'Connectors Instal·lats';
+$labels['installedplugins'] = 'Complements Instal·lats';
$labels['plugin'] = 'Complement';
$labels['version'] = 'Versió';
$labels['source'] = 'Font';
diff --git a/program/localization/ca_ES/messages.inc b/program/localization/ca_ES/messages.inc
index 06a72cb50..c71677b44 100644
--- a/program/localization/ca_ES/messages.inc
+++ b/program/localization/ca_ES/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -24,16 +24,17 @@ $messages['servererror'] = 'Error del Servidor!';
$messages['servererrormsg'] = 'Error del Servidor: $msg';
$messages['dberror'] = 'Error a la Base de Dades!';
$messages['requesttimedout'] = 'S\'ha esgotat el temps de la sol·licitud';
-$messages['errorreadonly'] = 'Impossible de realitzar l\'operació. La carpeta és de només lectura.';
-$messages['errornoperm'] = 'Impossible de realitzar l\'operació. Permís denegat.';
+$messages['errorreadonly'] = 'No s\'ha pogut de realitzar l\'operació. La carpeta és de només lectura.';
+$messages['errornoperm'] = 'No s\'ha pogut realitzar l\'operació. Permís denegat.';
$messages['erroroverquota'] = 'No s\'ha pogut completar l\'operació. No hi ha prou espai lliure al disc dur.';
$messages['erroroverquotadelete'] = 'No hi ha prou espai lliure. Feu servir MAJÚS+SUPR per suprimir el missatge.';
$messages['invalidrequest'] = 'Petició no vàlida! No s\'han desat les dades.';
$messages['invalidhost'] = 'Nom de servidor no vàlid.';
$messages['nomessagesfound'] = 'No s\'han trobat missatges en aquesta bústia.';
$messages['loggedout'] = 'Heu tancat la sessió correctament. A reveure!';
-$messages['mailboxempty'] = 'La bústia és buida.';
-$messages['refreshing'] = 'S\'està refrescant...';
+$messages['mailboxempty'] = 'La bústia és buida';
+$messages['nomessages'] = 'No hi ha missatges';
+$messages['refreshing'] = 'S\'està actualitzant...';
$messages['loading'] = 'S\'està carregant…';
$messages['uploading'] = 'S\'està pujant el fitxer...';
$messages['uploadingmany'] = 'S\'estan pujant els fitxers...';
@@ -41,19 +42,23 @@ $messages['loadingdata'] = 'S\'estan carregant les dades...';
$messages['checkingmail'] = 'S’està comprovant si hi ha missatges nous…';
$messages['sendingmessage'] = 'S’està enviant el missatge…';
$messages['messagesent'] = 'Missatge enviat correctament.';
-$messages['savingmessage'] = 'Desant missatge...';
+$messages['savingmessage'] = 'S\'està desant el missatge...';
$messages['messagesaved'] = 'Missatge desat a Esborranys.';
$messages['successfullysaved'] = 'Desat correctament.';
+$messages['savingresponse'] = 'S\'està desant el text de resposta...';
+$messages['deleteresponseconfirm'] = 'Esteu segurs de voler suprimir aquest text de resposta?';
$messages['addedsuccessfully'] = 'Contacte afegit correctament a la llibreta d\'adreces.';
$messages['contactexists'] = 'Ja hi ha un contacte amb aquesta adreça de correu.';
$messages['contactnameexists'] = 'Ja existeix un contacte amb el mateix nom.';
-$messages['blockedimages'] = 'Per protegir la vostra privacitat, les imatges remotes han estat bloquejades en aquest missatge.';
+$messages['blockedimages'] = 'Per protegir la vostra privadesa, les imatges remotes han estat bloquejades en aquest missatge.';
$messages['encryptedmessage'] = 'Aquest és un missatge xifrat i no pot ser mostrat. Ho sento!';
$messages['nocontactsfound'] = 'No s\'ha trobat cap contacte.';
$messages['contactnotfound'] = 'No s\'ha trobat el contacte sol·licitat.';
$messages['contactsearchonly'] = 'Introduïu termes de cerca per trobar contactes';
$messages['sendingfailed'] = 'Error enviant el missatge.';
$messages['senttooquickly'] = 'Si us plau, espereu $sec segon(s) abans d\'enviar aquest missatge.';
+$messages['errorsavingsent'] = 'S\'ha produït un error mentre es desava el missatge enviat.';
+$messages['errorsaving'] = 'S\'ha produït un error mentre es desava.';
$messages['errormoving'] = 'No s\'ha pogut moure el(s) missatge(s).';
$messages['errorcopying'] = 'No s\'ha pogut copiar el(s) missatge(s).';
$messages['errordeleting'] = 'No s\'ha pogut suprimir el(s) missatge(s).';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Si us plau, introduïu com a mínim un destin
$messages['nosubjectwarning'] = 'El camp "Assumpte" és buit. Voleu introduir-ne un ara?';
$messages['nobodywarning'] = 'Voleu enviar aquest missatge sense text?';
$messages['notsentwarning'] = 'El missatge no s\'ha enviat. Voleu descartar el vostre missatge?';
+$messages['restoresavedcomposedata'] = 'S\'ha trobat un missatge començat però que no ha estat enviat.\n\nAssumpte: $subject\nDesat: $date\n\nVoleu recuperar aquest missatge?';
$messages['noldapserver'] = 'Si us plau, seleccioneu un servidor LDAP per cercar.';
$messages['nosearchname'] = 'Si us plau, introduïu un nom de contacte o una adreça de correu.';
$messages['notuploadedwarning'] = 'Encara no s\'han pujat tots els adjunts. Si us plau, espereu o cancel·leu la pujada.';
@@ -112,7 +118,7 @@ $messages['markingmessage'] = 'S\'està marcant missatge(s)...';
$messages['addingmember'] = 'S\'està afegint contacte(s) al grup...';
$messages['removingmember'] = 'S\'està suprimint contacte(s) del grup...';
$messages['receiptsent'] = 'Confirmació de lectura enviada correctament.';
-$messages['errorsendingreceipt'] = 'No es pot enviar la confirmació.';
+$messages['errorsendingreceipt'] = 'No s\'ha pogut enviar la confirmació.';
$messages['deleteidentityconfirm'] = 'Esteu segurs de voler suprimir aquesta identitat?';
$messages['nodeletelastidentity'] = 'No podeu suprimir aquesta identitat, és l\'última.';
$messages['forbiddencharacter'] = 'El nom de carpeta conté un caràcter no permès.';
@@ -129,7 +135,7 @@ $messages['importmessagesuccess'] = '<b>S\'han importat $nr missatges correctame
$messages['importmessageerror'] = 'La importació ha fallat. El fitxer que heu pujat no és un fitxer de missatges vàlid o no és un fitxer de bústia.';
$messages['opnotpermitted'] = 'Operació no permesa!';
$messages['nofromaddress'] = 'Falta l\'adreça de correu a la identitat seleccionada.';
-$messages['editorwarning'] = 'Si canvieu a l\'editor de text pla perdreu tot el format del text. Voleu continuar?';
+$messages['editorwarning'] = 'Si canvieu a l\'editor de text net perdreu tot el format del text. Voleu continuar?';
$messages['httpreceivedencrypterror'] = 'Hi ha hagut un error fatal de configuració. Contacteu amb el vostre administrador immediatament. <b>El vostre missatge no pot ser enviat.</b>';
$messages['smtpconnerror'] = 'Error SMTP ($code): La connexió al servidor ha fallat.';
$messages['smtpautherror'] = 'Error SMTP ($code): La identificació ha fallat.';
@@ -138,8 +144,9 @@ $messages['smtptoerror'] = 'Error SMTP ($code): No s\'ha pogut posar "$to" com a
$messages['smtprecipientserror'] = 'Error SMTP: No s\'ha pogut analitzar la llista de destinataris.';
$messages['smtperror'] = 'Error SMTP: $msg';
$messages['emailformaterror'] = 'Adreça de correu no vàlida: $email';
-$messages['toomanyrecipients'] = 'Massa destinataris. Reduïu el nombre de destinataris a $max.';
+$messages['toomanyrecipients'] = 'Hi ha masses destinataris. Reduïu el nombre de destinataris a $max.';
$messages['maxgroupmembersreached'] = 'El nombre de membres del grup excedeix el màxim de $max.';
+$messages['internalerror'] = 'S\'ha produït un error intern. Si us plau torneu-ho a provar.';
$messages['contactdelerror'] = 'No s\'han pogut suprimir el(s) contacte(s).';
$messages['contactdeleted'] = 'Contacte(s) suprimit(s) correctament.';
$messages['contactrestoreerror'] = 'No s\'ha pogut restaurar el(s) contacte(s) suprimit(s).';
@@ -148,7 +155,7 @@ $messages['groupdeleted'] = 'Grup suprimit correctament.';
$messages['grouprenamed'] = 'Grup reanomenat correctament.';
$messages['groupcreated'] = 'Grup creat correctament.';
$messages['savedsearchdeleted'] = 'S\'ha suprimit correctament la cerca desada.';
-$messages['savedsearchdeleteerror'] = 'No s\'ha pogut suprimit la cerca desada.';
+$messages['savedsearchdeleteerror'] = 'No s\'ha pogut suprimir la cerca desada.';
$messages['savedsearchcreated'] = 'S\'ha creat correctament la cerca desada.';
$messages['savedsearchcreateerror'] = 'No s\'ha pogut crear la cerca desada.';
$messages['messagedeleted'] = 'Missatge(s) suprimit(s) correctament.';
@@ -166,5 +173,5 @@ $messages['mispellingsfound'] = 'S\'han detectat errors d\'ortografia al missatg
$messages['parentnotwritable'] = 'No s\'ha pogut crear/moure la carpeta dins de la carpeta ascendent seleccionada. No hi ha permisos d\'escriptura.';
$messages['messagetoobig'] = 'La part del missatge és massa gran per processar-la.';
$messages['attachmentvalidationerror'] = 'ATENCIÓ! Aquest adjunt és sospitós perquè el seu tipus no coincideix amb el tipus declarat al missatge. Si no confieu en l\'emissor, no l\'hauríeu d\'obrir al navegador perquè pot contenir elements maliciosos. <br/><br/><em>S\'esperava: $expected; s\'ha trobat: $detected</em>';
-$messages['noscriptwarning'] = 'Atenció: Aquest client de correu necessita Javascript! Per a poder fer-lo servir, heu d\'activar Javascript a les opcions del navegador.';
+$messages['noscriptwarning'] = 'Atenció: Aquest client de correu necessita Javascript! Per a poder fer-lo servir heu d\'activar Javascript a les opcions del navegador.';
?>
diff --git a/program/localization/cs_CZ/labels.inc b/program/localization/cs_CZ/labels.inc
index d887d8d0a..2c94306e5 100644
--- a/program/localization/cs_CZ/labels.inc
+++ b/program/localization/cs_CZ/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to z $count';
$labels['copy'] = 'Kopírovat';
$labels['move'] = 'Přesunout';
$labels['moveto'] = 'přesunout do...';
+$labels['copyto'] = 'Kopírovat do...';
$labels['download'] = 'stáhnout';
$labels['open'] = 'Otevřít';
$labels['showattachment'] = 'Zobrazit';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Pravopis';
$labels['checkspelling'] = 'Zkontrolovat pravopis';
$labels['resumeediting'] = 'PokraÄovat v úpravách';
$labels['revertto'] = 'Přejít na';
+$labels['restore'] = 'Obnovit';
+$labels['restoremessage'] = 'Obnovit zprávu?';
+$labels['responses'] = 'Odpovědi';
+$labels['insertresponse'] = 'Vložit odpověd';
+$labels['manageresponses'] = 'Spravovat odpovědí';
+$labels['savenewresponse'] = 'Uložit novou odpovÄ›Ä';
+$labels['editresponses'] = 'Upravit odpovědi';
+$labels['editresponse'] = 'Upravit odpovÄ›Ä';
+$labels['responsename'] = 'Název';
+$labels['responsetext'] = 'Text odpovědi';
$labels['attach'] = 'Přiložit';
$labels['attachments'] = 'Přílohy';
$labels['upload'] = 'Nahrát';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Zacházet s vyskakovacími okny jako se standardnÃ
$labels['forwardmode'] = 'Přeposlat zprávu';
$labels['inline'] = 'vloženě';
$labels['asattachment'] = 'jako přílohu';
+$labels['replyallmode'] = 'Výchozí akce tlaÄítka [OdpovÄ›dÄ›t vÅ¡em]';
+$labels['replyalldefault'] = 'odpovědět všem';
+$labels['replyalllist'] = 'odpovědět pouze do poštovní konference (pokud je nalezena)';
$labels['folder'] = 'Složka';
$labels['folders'] = 'Složky';
$labels['foldername'] = 'Jméno složky';
diff --git a/program/localization/cs_CZ/messages.inc b/program/localization/cs_CZ/messages.inc
index 0bd6b0e82..37f5280e8 100644
--- a/program/localization/cs_CZ/messages.inc
+++ b/program/localization/cs_CZ/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -33,6 +33,7 @@ $messages['invalidhost'] = 'Špatné jméno serveru.';
$messages['nomessagesfound'] = 'Ve schránce nebyla nalezena žádná zpráva';
$messages['loggedout'] = 'Byli jste úspěšně odhlášeni. Na shledanou!';
$messages['mailboxempty'] = 'Schránka je prázdná';
+$messages['nomessages'] = 'Žádné zprávy';
$messages['refreshing'] = 'Obnovuji...';
$messages['loading'] = 'NaÄítám...';
$messages['uploading'] = 'Nahrávám soubor...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Zpráva byla odeslána';
$messages['savingmessage'] = 'Ukládám zprávu...';
$messages['messagesaved'] = 'Zpráva uložena do Rozepsané';
$messages['successfullysaved'] = 'Uloženo';
+$messages['savingresponse'] = 'Ukládám text odpovědi...';
+$messages['deleteresponseconfirm'] = 'Opravdu chcete odstranit tento text odpovědi?';
$messages['addedsuccessfully'] = 'Kontakt byl úspěšně přidán do adresáře';
$messages['contactexists'] = 'Kontakt se zadanou e-mailovou adresou již existuje';
$messages['contactnameexists'] = 'Kontakt se stejným jménem již existuje';
@@ -80,6 +83,7 @@ $messages['norecipientwarning'] = 'Zadejte, prosím, alespoň jednoho příjemce
$messages['nosubjectwarning'] = 'Předmět nebyl vyplňen. Přejete si jej zadat nyní?';
$messages['nobodywarning'] = 'Opravdu chtete odeslat prázdnou zprávu?';
$messages['notsentwarning'] = 'Zpráva nebyla odeslána. Přejete si zprávu zahodit?';
+$messages['restoresavedcomposedata'] = 'Byla nalezena dříve vytvořená ale neodeslaná zpráva.\n\nPředmět: $subject\nUloženo: $date\n\nPřejete si obnovit tuto zprávu?';
$messages['noldapserver'] = 'Zvolte, prosím, LDAP server k hledání';
$messages['nosearchname'] = 'Zadejte, prosím, jméno nebo e-mail kontaktu';
$messages['notuploadedwarning'] = 'JeÅ¡tÄ› nebyly nahrány vÅ¡echny přílohy. PoÄkejte prosím nebo nahrávání zruÅ¡te.';
diff --git a/program/localization/cy_GB/labels.inc b/program/localization/cy_GB/labels.inc
index 37ee5bbc1..770df3bff 100644
--- a/program/localization/cy_GB/labels.inc
+++ b/program/localization/cy_GB/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to o $count';
$labels['copy'] = 'Copio';
$labels['move'] = 'Symud';
$labels['moveto'] = 'Symud i...';
+$labels['copyto'] = 'Copio i...';
$labels['download'] = 'Llwytho lawr';
$labels['open'] = 'Agor';
$labels['showattachment'] = 'Dangos';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Sillafu';
$labels['checkspelling'] = 'Gwirio sillafu';
$labels['resumeediting'] = 'Ail-ddechrau golygu';
$labels['revertto'] = 'Dychwelyd i';
+$labels['restore'] = 'Adfer';
+$labels['restoremessage'] = 'Adfer neges?';
+$labels['responses'] = 'Ymatebion';
+$labels['insertresponse'] = 'Mewnosod ymateb';
+$labels['manageresponses'] = 'Rheoli ymatebion';
+$labels['savenewresponse'] = 'Cadw ymateb newydd';
+$labels['editresponses'] = 'Golygu ymatebion';
+$labels['editresponse'] = 'Golygu ymateb';
+$labels['responsename'] = 'Enw';
+$labels['responsetext'] = 'Testun Ymateb';
$labels['attach'] = 'Atodi';
$labels['attachments'] = 'Atodiadau';
$labels['upload'] = 'Llwytho fyny';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Trin ffenestri naid fel ffenestri arferol';
$labels['forwardmode'] = 'Danfon neges ymlaen';
$labels['inline'] = 'mewnlin';
$labels['asattachment'] = 'fel atodiad';
+$labels['replyallmode'] = 'Gweithred diofyn botwm [Ymateb i bawb]';
+$labels['replyalldefault'] = 'ymateb i bawb';
+$labels['replyalllist'] = 'ymateb i\'r rhestr trafod yn unig (os canfuwyd)';
$labels['folder'] = 'Ffolder';
$labels['folders'] = 'Ffolderi';
$labels['foldername'] = 'Enw ffolder';
diff --git a/program/localization/cy_GB/messages.inc b/program/localization/cy_GB/messages.inc
index 5dd8230c7..5c0ef7e8d 100644
--- a/program/localization/cy_GB/messages.inc
+++ b/program/localization/cy_GB/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -16,10 +16,10 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
$messages['errortitle'] = 'Fe gafwyd gwall!';
-$messages['loginfailed'] = 'Methwyd a\'ch mewngofnodi';
-$messages['cookiesdisabled'] = 'Nid yw eich porwr yn derbyn cwcis';
-$messages['sessionerror'] = 'Mae\'r sesiwn yn anghywir neu wedi dod i ben';
-$messages['storageerror'] = 'Methwyd cysylltu a\'r gweinydd IMAP';
+$messages['loginfailed'] = 'Methwyd mewngofnodi.';
+$messages['cookiesdisabled'] = 'Nid yw eich porwr yn derbyn cwcis.';
+$messages['sessionerror'] = 'Mae\'r sesiwn yn anghywir neu wedi dod i ben.';
+$messages['storageerror'] = 'Methwyd cysylltu a\'r gweinydd storfa.';
$messages['servererror'] = 'Gwall Gweinydd!';
$messages['servererrormsg'] = 'Gwall Gweinydd: $msg';
$messages['dberror'] = 'Gwall Cronfa Ddata!';
@@ -32,7 +32,6 @@ $messages['invalidrequest'] = 'Cais annilys! Ni chadwyd unrhyw wybodaeth.';
$messages['invalidhost'] = 'Enw gweinydd annilys.';
$messages['nomessagesfound'] = 'Dim negeseuon wedi eu canfod yn y blwch hwn';
$messages['loggedout'] = 'Rydych wedi gorffen y sesiwn yn llwyddianus. Hwyl fawr!';
-$messages['mailboxempty'] = 'Blwch yn wag';
$messages['refreshing'] = 'Yn adnewyddu...';
$messages['loading'] = 'Yn llwytho...';
$messages['uploading'] = 'Yn llwytho ffeil i fyny...';
@@ -44,6 +43,8 @@ $messages['messagesent'] = 'Danfonwyd y neges yn llwyddiannus';
$messages['savingmessage'] = 'Yn cadw neges...';
$messages['messagesaved'] = 'Cadwyd neges i\'r Drafftiau';
$messages['successfullysaved'] = 'Cadwyd yn llwyddiannus';
+$messages['savingresponse'] = 'Yn cadw testun ymateb...';
+$messages['deleteresponseconfirm'] = 'Ydych chi wir am ddileu y testun ymateb hwn?';
$messages['addedsuccessfully'] = 'Cyswllt wedi ei ychwanegu i\'r llyfr cyfeiriadau yn llwyddiannus';
$messages['contactexists'] = 'Mae cyswllt gyda\'r cyfeiriad e-bost yma yn bodoli\'n barod';
$messages['contactnameexists'] = 'Mae cyswllt gyda\'r un enw yn bodoli yn barod.';
@@ -54,6 +55,8 @@ $messages['contactnotfound'] = 'Ni gafwyd hyd i\'r cysylltiad gofynnwyd amdano';
$messages['contactsearchonly'] = 'Rhowch dermau chwilio i ganfod cysylltiadau';
$messages['sendingfailed'] = 'Methwyd danfon y neges';
$messages['senttooquickly'] = 'Arhoswch $sec eiliad cyn danfon y neges';
+$messages['errorsavingsent'] = 'Fe gafwyd gwall wrth gadw\'r neges ddanfonwyd.';
+$messages['errorsaving'] = 'Fe gafwyd gwall wrth gadw';
$messages['errormoving'] = 'Methwyd symud y neges';
$messages['errorcopying'] = 'Methwyd copïo\'r neges(euon)';
$messages['errordeleting'] = 'Methwyd dileu y neges';
@@ -78,6 +81,7 @@ $messages['norecipientwarning'] = 'Rhowch o leiaf un derbynnydd';
$messages['nosubjectwarning'] = 'Mae\'r pennawd "Pwnc" yn wag. Hoffech chi roi un fewn nawr?';
$messages['nobodywarning'] = 'Danfon y neges hwn heb destun?';
$messages['notsentwarning'] = 'Ni ddanfonwyd y neges. Hoffech chi gael gwared a\'r neges?';
+$messages['restoresavedcomposedata'] = 'Cafwyd hyd i neges wedi ei ysgrifennu o\'r blaen ond heb ei ddanfon.\n\nPwnc: $subject\nCadwyd: $date\n\nYdych chi am adfer y neges?';
$messages['noldapserver'] = 'Dewiswch weinydd ldap i chwilio';
$messages['nosearchname'] = 'Rhowch enw cyswllt neu gyfeiriad e-bost';
$messages['notuploadedwarning'] = 'Nid yw pob atodiad wedi eu llwytho i fyny eto. Triwch eto neu canslo.';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'Gwall SMTP: $msg';
$messages['emailformaterror'] = 'Cyfeiriad e-bost anghywir: $email';
$messages['toomanyrecipients'] = 'Gormod o dderbynnwyr. Lleihewch y nifer i $max';
$messages['maxgroupmembersreached'] = 'Mae nifer o aelodau\'r grŵp yn fwy na\'r uchafswm o $max';
+$messages['internalerror'] = 'Fe gafwyd gwall mewnol. Rhowch gynnig arni eto.';
$messages['contactdelerror'] = 'Methwyd dileu cyswllt';
$messages['contactdeleted'] = 'Cyswllt wedi ei ddileu yn llwyddiannus';
$messages['contactrestoreerror'] = 'Methwyd adfer y cyswllt/cysylltiadau a ddilëwyd';
diff --git a/program/localization/da_DK/labels.inc b/program/localization/da_DK/labels.inc
index 52de86d92..66103ad63 100644
--- a/program/localization/da_DK/labels.inc
+++ b/program/localization/da_DK/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to af $count';
$labels['copy'] = 'Kopiér';
$labels['move'] = 'Flyt';
$labels['moveto'] = 'Flyt til...';
+$labels['copyto'] = 'Kopier til...';
$labels['download'] = 'Download';
$labels['open'] = 'Ã…ben';
$labels['showattachment'] = 'Vis';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Stav';
$labels['checkspelling'] = 'Stavekontrol';
$labels['resumeediting'] = 'Genoptag redigering';
$labels['revertto'] = 'Vend tilbage til';
+$labels['restore'] = 'Gendan';
+$labels['restoremessage'] = 'Gendan besked';
+$labels['responses'] = 'Svar';
+$labels['insertresponse'] = 'Indsæt et svar';
+$labels['manageresponses'] = 'Administrer svar';
+$labels['savenewresponse'] = 'Gem et nyt svar';
+$labels['editresponses'] = 'Rediger svar';
+$labels['editresponse'] = 'Rediger svar';
+$labels['responsename'] = 'Navn';
+$labels['responsetext'] = 'Svartekst';
$labels['attach'] = 'Vedhæft';
$labels['attachments'] = 'Vedhæftninger';
$labels['upload'] = 'Overfør';
@@ -316,7 +327,11 @@ $labels['searchdelete'] = 'Slet søgning';
$labels['import'] = 'Importér';
$labels['importcontacts'] = 'Importér kontakter';
$labels['importfromfile'] = 'Importér fra fil:';
+$labels['importtarget'] = 'Tilføj kontakter til';
$labels['importreplace'] = 'Overskriv hele adressebogen';
+$labels['importgroups'] = 'Importer gruppetildelinger';
+$labels['importgroupsall'] = 'Alle (opret grupper hvis nødvendigt)';
+$labels['importgroupsexisting'] = 'Kun for eksisterende grupper';
$labels['importdesc'] = 'Du kan uploade kontakter fra en eksisterende adressebog. <br/>I øjeblikket supportere vi import af adresser fra <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> og CSV (komma-separeret) data format.';
$labels['done'] = 'Færdig';
$labels['settingsfor'] = 'Indstillinger for';
@@ -424,6 +439,9 @@ $labels['standardwindows'] = 'Behandl popups som standardvinduer';
$labels['forwardmode'] = 'Videresendelse af besked';
$labels['inline'] = 'inline';
$labels['asattachment'] = 'som vedhæftning';
+$labels['replyallmode'] = 'Standardhandling til [Svar alle]-knap';
+$labels['replyalldefault'] = 'Svar til alle';
+$labels['replyalllist'] = 'svar kun til mail-liste (hvis fundet)';
$labels['folder'] = 'Mappe';
$labels['folders'] = 'Mapper';
$labels['foldername'] = 'Mappenavn';
diff --git a/program/localization/da_DK/messages.inc b/program/localization/da_DK/messages.inc
index c12236eef..1328ed288 100644
--- a/program/localization/da_DK/messages.inc
+++ b/program/localization/da_DK/messages.inc
@@ -44,6 +44,8 @@ $messages['messagesent'] = 'Beskeden blev afsendt succesfuldt.';
$messages['savingmessage'] = 'Gemmer besked...';
$messages['messagesaved'] = 'Beskeden er gemt i kladdemappen.';
$messages['successfullysaved'] = 'Gemt succesfuldt';
+$messages['savingresponse'] = 'Gemmer svartekst...';
+$messages['deleteresponseconfirm'] = 'Er du sikker på, at du ønsker at slette svarteksten?';
$messages['addedsuccessfully'] = 'Kontakten blev tilføjet adressebogen.';
$messages['contactexists'] = 'Der er allerede en kontakt med denne e-mailadresse.';
$messages['contactnameexists'] = 'En kontakt med samme navn eksisterer allerede.';
@@ -54,6 +56,8 @@ $messages['contactnotfound'] = 'Den søgte kontakt blev ikke fundet.';
$messages['contactsearchonly'] = 'Indtast søgeord for at finde kontakter.';
$messages['sendingfailed'] = 'Beskeden kunne ikke sendes.';
$messages['senttooquickly'] = 'Vent venligst $sec sekunder før du sender denne besked.';
+$messages['errorsavingsent'] = 'Der opstod en fejl ved at gemme den sendte besked.';
+$messages['errorsaving'] = 'Der opstod en fejl ved at gemme.';
$messages['errormoving'] = 'Beskeden kunne ikke flyttes.';
$messages['errorcopying'] = 'Beskeden kunne ikke kopieres.';
$messages['errordeleting'] = 'Beskeden kunne ikke slettes.';
@@ -78,6 +82,7 @@ $messages['norecipientwarning'] = 'Indtast mindst én modtager.';
$messages['nosubjectwarning'] = '\'Emne\'-feltet er tomt. Kunne du tænke dig at skrive et nu?';
$messages['nobodywarning'] = 'Send denne besked uden tekst?';
$messages['notsentwarning'] = 'Beskeden er ikke sendt. Vil du kassere din besked?';
+$messages['restoresavedcomposedata'] = 'En tidligere skreven men usendt besked blev fundet.\n\nEmne: $subject\nGemt: $date\n\nØnsker du at gendanne denne besked?';
$messages['noldapserver'] = 'Vælg venligst hvilken LDAP-server der skal søges i.';
$messages['nosearchname'] = 'Indtast venligst en kontakts navn eller e-mailadresse.';
$messages['notuploadedwarning'] = 'Ikke alle vedhæftede filer er blevet uploadet endnu. Vent venligst eller afbryd upload.';
@@ -140,6 +145,7 @@ $messages['smtperror'] = 'SMTP fejl: $msg';
$messages['emailformaterror'] = 'Ugyldig e-mailadresse: $email';
$messages['toomanyrecipients'] = 'For mange modtagere. Reducer antallet af modtagere til $max.';
$messages['maxgroupmembersreached'] = 'Antallet af gruppemedlemmer overstiger maksimum på $max.';
+$messages['internalerror'] = 'En intern fejl opstod. Prøv venligst igen.';
$messages['contactdelerror'] = 'Kunne ikke slette kontakt(er).';
$messages['contactdeleted'] = 'Kontakt(er) slettet.';
$messages['contactrestoreerror'] = 'Kunne ikke gendanne slettede kontakt(er).';
diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc
index e5fe1ec66..f53640ab5 100644
--- a/program/localization/de_CH/labels.inc
+++ b/program/localization/de_CH/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to von $count';
$labels['copy'] = 'Kopieren';
$labels['move'] = 'Verschieben';
$labels['moveto'] = 'Verschieben nach...';
+$labels['copyto'] = 'Kopieren nach...';
$labels['download'] = 'Download';
$labels['open'] = 'Öffnen';
$labels['showattachment'] = 'Anzeigen';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Rechtschreibung';
$labels['checkspelling'] = 'Rechtschreibung prüfen';
$labels['resumeediting'] = 'Bearbeitung fortsetzen';
$labels['revertto'] = 'Zurück zu';
+$labels['restore'] = 'Wiederherstellen';
+$labels['restoremessage'] = 'Nachricht wiederherstellen?';
+$labels['responses'] = 'Antworten';
+$labels['insertresponse'] = 'Antwort einfügen';
+$labels['manageresponses'] = 'Antworten verwalten';
+$labels['savenewresponse'] = 'Neue Antwort speichern';
+$labels['editresponses'] = 'Antworten bearbeiten';
+$labels['editresponse'] = 'Antwort bearbeiten';
+$labels['responsename'] = 'Name';
+$labels['responsetext'] = 'Antworttext';
$labels['attach'] = 'Anhängen';
$labels['attachments'] = 'Anhänge';
$labels['upload'] = 'Hochladen';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Popups als normale Browserfenster öffnen';
$labels['forwardmode'] = 'Weiterleiten einer Nachricht';
$labels['inline'] = 'eingebettet';
$labels['asattachment'] = 'als Anhang';
+$labels['replyallmode'] = 'Standard Funktion für [Allen antworten]';
+$labels['replyalldefault'] = 'Allen antworten';
+$labels['replyalllist'] = 'Nur der Mailing-Liste antworten (falls vorhanden)';
$labels['folder'] = 'Ordner';
$labels['folders'] = 'Ordner';
$labels['foldername'] = 'Ordnername';
diff --git a/program/localization/de_CH/messages.inc b/program/localization/de_CH/messages.inc
index 4e5ccaa46..63a1411d0 100644
--- a/program/localization/de_CH/messages.inc
+++ b/program/localization/de_CH/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -33,6 +33,7 @@ $messages['invalidhost'] = 'Ungültiger Servername';
$messages['nomessagesfound'] = 'Keine Nachrichten in diesem Ordner';
$messages['loggedout'] = 'Sie haben Ihre Session erfolgreich beendet. Auf Wiedersehen!';
$messages['mailboxempty'] = 'Ordner ist leer';
+$messages['nomessages'] = 'Keine Nachrichten';
$messages['refreshing'] = 'Aktualisiere...';
$messages['loading'] = 'Daten werden geladen...';
$messages['uploading'] = 'Datei wird hochgeladen...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Nachricht erfolgreich gesendet';
$messages['savingmessage'] = 'Nachricht wird gespeichert...';
$messages['messagesaved'] = 'Nachricht als Entwurf gespeichert';
$messages['successfullysaved'] = 'Erfolgreich gespeichert';
+$messages['savingresponse'] = 'Antwort wird gespeichert...';
+$messages['deleteresponseconfirm'] = 'Wollen Sie diese Antwort wirklich löschen?';
$messages['addedsuccessfully'] = 'Kontakt zum Adressbuch hinzugefügt';
$messages['contactexists'] = 'Es existiert bereits ein Kontakt mit dieser E-Mail-Adresse.';
$messages['contactnameexists'] = 'Es existiert bereits ein Kontakt mit diesem Namen';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'Die gewählte Adresse wurde nicht gefunden';
$messages['contactsearchonly'] = 'Geben Sie einen Suchbegriff ein, um Kontakte zu finden';
$messages['sendingfailed'] = 'Versand der Nachricht fehlgeschlagen';
$messages['senttooquickly'] = 'Bitte warten Sie $sec Sekunde(n) vor dem Senden dieser Nachricht';
+$messages['errorsavingsent'] = 'Beim Speichern der gesendeten Nachricht ist ein Fehler aufgetreten.';
+$messages['errorsaving'] = 'Beim Speichern ist ein Fehler aufgetreten.';
$messages['errormoving'] = 'Nachricht(en) konnte(n) nicht verschoben werden.';
$messages['errorcopying'] = 'Nachticht(en) konnte(n) nicht kopiert werden.';
$messages['errordeleting'] = 'Nachricht(en) konnte(n) nicht gelöscht werden.';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Bitte geben Sie mindestens einen Empfänger a
$messages['nosubjectwarning'] = 'Die Betreffzeile ist leer. Möchten Sie jetzt einen Betreff eingeben?';
$messages['nobodywarning'] = 'Wollen Sie diese Nachricht ohne Inhalt senden?';
$messages['notsentwarning'] = 'Ihre Nachricht wurde nicht gesendet. Wollen Sie die Nachricht verwerfen?';
+$messages['restoresavedcomposedata'] = 'Eine zuvor verfasste aber nicht gesendete Nachricht wurde gefunden.\n\nBetreff: $subject\nGespeichert: $date\n\nWollen Sie diese Nachricht wiederherstellen?';
$messages['noldapserver'] = 'Bitte wählen Sie einen LDAP-Server aus';
$messages['nosearchname'] = 'Bitte geben Sie einen Namen oder eine E-Mail-Adresse ein.';
$messages['notuploadedwarning'] = 'Es wurden noch nicht alle Dateien hochgeladen. Bitte warten oder Upload abbrechen.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'SMTP Fehler: $msg';
$messages['emailformaterror'] = 'Ungültige E-Mail-Adresse: $email';
$messages['toomanyrecipients'] = 'Zuviele Empfänger angegeben. Reduzieren Sie die Empfängeradressen auf $max.';
$messages['maxgroupmembersreached'] = 'Die Anzahl Adressen in dieser Gruppe überschreitet das Maximum von $max.';
+$messages['internalerror'] = 'Ein interner Fehler ist aufgetreten. Bitte versuchen Sie den Vorgang erneut.';
$messages['contactdelerror'] = 'Fehler beim Löschen.';
$messages['contactdeleted'] = 'Kontakt(e) erfolgreich gelöscht.';
$messages['contactrestoreerror'] = 'Die gelöschten Kontakte konnten nicht wiederhergestellt werden.';
diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc
index e3f4652cc..e0a347e42 100644
--- a/program/localization/de_DE/labels.inc
+++ b/program/localization/de_DE/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to von $count';
$labels['copy'] = 'Kopieren';
$labels['move'] = 'Verschieben';
$labels['moveto'] = 'Verschieben nach...';
+$labels['copyto'] = 'Kopieren nach...';
$labels['download'] = 'Herunterladen';
$labels['open'] = 'Offen';
$labels['showattachment'] = 'Anzeigen';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Rechtschreibung';
$labels['checkspelling'] = 'Rechtschreibung prüfen';
$labels['resumeediting'] = 'Bearbeitung fortsetzen';
$labels['revertto'] = 'Zurück zu';
+$labels['restore'] = 'Wiederherstellen';
+$labels['restoremessage'] = 'Nachricht wiederherstellen?';
+$labels['responses'] = 'Schnellantworten';
+$labels['insertresponse'] = 'Schnellantwort hinzufügen';
+$labels['manageresponses'] = 'Schnellantworten verwalten';
+$labels['savenewresponse'] = 'Neue Schnellantwort speichern';
+$labels['editresponses'] = 'Schnellantworten bearbeiten';
+$labels['editresponse'] = 'Schnellantwort bearbeiten';
+$labels['responsename'] = 'Name';
+$labels['responsetext'] = 'Text der Antwort';
$labels['attach'] = 'Anhängen';
$labels['attachments'] = 'Anhänge';
$labels['upload'] = 'Hochladen';
@@ -318,6 +329,8 @@ $labels['importcontacts'] = 'Kontakte importieren';
$labels['importfromfile'] = 'Import aus Datei:';
$labels['importtarget'] = 'Kontakte hinzufügen zu';
$labels['importreplace'] = 'Bestehendes Adressbuch komplett ersetzen';
+$labels['importgroups'] = 'Gruppenzuordnungen importieren';
+$labels['importgroupsall'] = 'Alle (Gruppen erstellen wenn nötig)';
$labels['importgroupsexisting'] = 'Nur für existierende Gruppen';
$labels['importdesc'] = 'Sie können Kontakte von einem vorhandenen Adressbuch hochladen.<br/>Zur Zeit wird der Import von Adressen im <a href="http://de.wikipedia.org/wiki/VCard">vCard</a> oder <a href="http://de.wikipedia.org/wiki/CSV_(Dateiformat)">CSV</a>Format unterstützt.';
$labels['done'] = 'Fertig';
@@ -426,6 +439,9 @@ $labels['standardwindows'] = 'Popups als Standard Windows behandeln';
$labels['forwardmode'] = 'Nachrichtenweiterleitung';
$labels['inline'] = 'eingebettet';
$labels['asattachment'] = 'als Anhang';
+$labels['replyallmode'] = 'Standardaktion des "Allen antworten" Button';
+$labels['replyalldefault'] = 'Allen antworten';
+$labels['replyalllist'] = 'Nur der Mailingliste antworten (wenn gefunden)';
$labels['folder'] = 'Ordner';
$labels['folders'] = 'Ordner';
$labels['foldername'] = 'Ordnername';
diff --git a/program/localization/de_DE/messages.inc b/program/localization/de_DE/messages.inc
index fbc21521a..d9e6d9687 100644
--- a/program/localization/de_DE/messages.inc
+++ b/program/localization/de_DE/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Ungültige Anfrage! Es wurden keine Daten gespeic
$messages['invalidhost'] = 'Ungültiger Server Name';
$messages['nomessagesfound'] = 'Keine Nachrichten in diesem Ordner.';
$messages['loggedout'] = 'Sie haben Ihre Sitzung erfolgreich beendet. Auf Wiedersehen!';
-$messages['mailboxempty'] = 'Mailbox ist leer.';
+$messages['mailboxempty'] = 'Mailbox ist leer';
+$messages['nomessages'] = 'Keine Nachrichten';
$messages['refreshing'] = 'Aktualisieren…';
$messages['loading'] = 'Wird geladen...';
$messages['uploading'] = 'Datei wird hochgeladen...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Nachricht erfolgreich gesendet.';
$messages['savingmessage'] = 'Nachricht wird gespeichert...';
$messages['messagesaved'] = 'Nachricht als Entwurf gespeichert.';
$messages['successfullysaved'] = 'Erfolgreich gespeichert.';
+$messages['savingresponse'] = 'Antwortvorlage wird gespeichert...';
+$messages['deleteresponseconfirm'] = 'Möchten Sie diese Vorlage wirklich löschen?';
$messages['addedsuccessfully'] = 'Kontakt zum Adressbuch hinzugefügt.';
$messages['contactexists'] = 'Es existiert bereits ein Kontakt mit dieser E-Mail-Adresse.';
$messages['contactnameexists'] = 'Ein Kontakt mit dem gleichen Namen existiert bereits.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'Der angeforderte Kontakt wurde nicht gefunden.';
$messages['contactsearchonly'] = 'Geben Sie einen Suchbegriff ein, um Kontakte zu finden.';
$messages['sendingfailed'] = 'Versenden der Nachricht fehlgeschlagen.';
$messages['senttooquickly'] = 'Bitte warten Sie $sec Sekunde(n) vor dem Senden dieser Nachricht.';
+$messages['errorsavingsent'] = 'Ein Fehler ist beim Speichern der gesendeten Nachricht aufgetreten.';
+$messages['errorsaving'] = 'Beim Speichern ist ein Fehler aufgetreten.';
$messages['errormoving'] = 'Nachricht(en) konnte(n) nicht verschoben werden.';
$messages['errorcopying'] = 'Nachticht(en) konnte(n) nicht kopiert werden.';
$messages['errordeleting'] = 'Nachricht(en) konnte(n) nicht gelöscht werden.';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Bitte geben Sie mindestens einen Empfänger a
$messages['nosubjectwarning'] = 'Die Betreffzeile ist leer. Möchten Sie jetzt einen Betreff eingeben?';
$messages['nobodywarning'] = 'Diese Nachricht ohne Inhalt senden?';
$messages['notsentwarning'] = 'Ihre Nachricht wurde nicht gesendet. Wollen Sie die Nachricht verwerfen?';
+$messages['restoresavedcomposedata'] = 'Es wurde ein nicht versandter Entwurf einer Nachricht gefunden.\n\nBetreff: $subject\nGespeichert am: $date\n\nMöchten Sie diese Nachricht wiederherstellen?';
$messages['noldapserver'] = 'Bitte wählen Sie einen LDAP-Server aus.';
$messages['nosearchname'] = 'Bitte geben Sie einen Namen oder eine E-Mail-Adresse ein.';
$messages['notuploadedwarning'] = 'Es wurden noch nicht alle Dateien hochgeladen. Bitte warten oder Upload abbrechen.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'SMTP Fehler: $msg';
$messages['emailformaterror'] = 'Ungültige E-Mail-Adresse: $email';
$messages['toomanyrecipients'] = 'Zuviele Empfänger. Reduzieren Sie die Anzahl Empfängeradressen auf $max.';
$messages['maxgroupmembersreached'] = 'Die Anzahl Adressen in dieser Gruppe überschreitet das Maximum von $max.';
+$messages['internalerror'] = 'Ein interner Fehler ist aufgetreten. Bitte versuchen es erneut.';
$messages['contactdelerror'] = 'Fehler beim Löschen.';
$messages['contactdeleted'] = 'Kontakt(e) erfolgreich gelöscht.';
$messages['contactrestoreerror'] = 'Konnte die gelöschten Kontakte nicht wiederherstellen.';
diff --git a/program/localization/el_GR/labels.inc b/program/localization/el_GR/labels.inc
index 2e3ab405c..0362673de 100644
--- a/program/localization/el_GR/labels.inc
+++ b/program/localization/el_GR/labels.inc
@@ -197,6 +197,11 @@ $labels['spellcheck'] = 'Συλλαβισμός';
$labels['checkspelling'] = 'Έλεγχος οÏθογÏαφίας';
$labels['resumeediting'] = 'Συνέχεια επεξεÏγασίας';
$labels['revertto'] = 'ΕπαναφοÏά στο';
+$labels['restore'] = 'ΕπαναφοÏά';
+$labels['responses'] = 'Απαντήσεις';
+$labels['insertresponse'] = 'Εισάγετε μια απάντηση';
+$labels['manageresponses'] = 'ΔιαχείÏιση απαντήσεων';
+$labels['responsename'] = 'Όνομα';
$labels['attach'] = 'ΕπισÏναψη';
$labels['attachments'] = 'Συνημμένα';
$labels['upload'] = 'ΦόÏτωση';
@@ -424,6 +429,7 @@ $labels['standardwindows'] = 'ΧειÏιστείτε τα αναδυόμενα Ï
$labels['forwardmode'] = 'ΠÏοώθηση μηνυμάτων';
$labels['inline'] = 'με εσνωμάτωση';
$labels['asattachment'] = 'σαν επισÏναψη';
+$labels['replyalldefault'] = 'απάντηση σε όλους';
$labels['folder'] = 'Φάκελος';
$labels['folders'] = 'Φάκελοι';
$labels['foldername'] = 'Όνομα φακέλου';
diff --git a/program/localization/el_GR/messages.inc b/program/localization/el_GR/messages.inc
index be6639d68..44c69bbb3 100644
--- a/program/localization/el_GR/messages.inc
+++ b/program/localization/el_GR/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -16,7 +16,7 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
$messages['errortitle'] = 'Έχει Ï€ÏοκÏψει κάποιο σφάλμα!';
-$messages['loginfailed'] = 'Είσοδος απέτυχε';
+$messages['loginfailed'] = 'Είσοδος απέτυχε.';
$messages['cookiesdisabled'] = 'Ο πεÏιηγητής σας (browser) δεν αποδέχεται cookies';
$messages['sessionerror'] = 'Η συνεδÏία σας είναι άκυÏη ή έχει λήξει';
$messages['storageerror'] = 'Η σÏνδεση με το διακομιστή IMAP απέτυχε';
@@ -33,6 +33,7 @@ $messages['invalidhost'] = 'ΆκυÏο όνομα εξυπηÏετητή.';
$messages['nomessagesfound'] = 'Δε βÏέθηκαν μηνÏματα σε αυτή τη θυÏίδα';
$messages['loggedout'] = 'Έχετε τεÏματίσει επιτυχώς τη συνεδÏία. Αντίο!';
$messages['mailboxempty'] = 'Η θυÏίδα είναι άδεια';
+$messages['nomessages'] = 'Κανένα μήνυμα';
$messages['refreshing'] = 'Ανανέωση....';
$messages['loading'] = 'ΦόÏτωση...';
$messages['uploading'] = 'Το αÏχείο φοÏτώνεται...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Μήνυμα εστάλη επιτυχώς';
$messages['savingmessage'] = 'Αποθήκευση μηνÏματος...';
$messages['messagesaved'] = 'Μήνυμα αποθηκεÏτηκε στα ΠÏόχειÏα';
$messages['successfullysaved'] = 'ΑποθηκεÏτηκε επιτυχώς';
+$messages['savingresponse'] = 'ΑποθηκεÏετε το κείμενο απάντησης...';
+$messages['deleteresponseconfirm'] = 'ΣίγουÏα θέλετε να διαγÏάψετε αυτό το κείμενο απάντησης;';
$messages['addedsuccessfully'] = 'Η επαφή Ï€Ïοστέθηκε επιτυχώς στις Επαφές';
$messages['contactexists'] = 'ΥπάÏχει ήδη επαφή με αυτή τη διεÏθυνση e-mail';
$messages['contactnameexists'] = 'Μια επαφή με το ίδιο όνομα υπάÏχει ήδη.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'Η ζητοÏμενη επαφή δεν βÏέθ
$messages['contactsearchonly'] = 'Εισάγετε κάποιους ÏŒÏους Ï€Ïος αναζήτηση';
$messages['sendingfailed'] = 'Αποστολή μηνÏματος απέτυχε';
$messages['senttooquickly'] = 'ΠαÏακαλώ πεÏιμένετε $sec δευτεÏόλεπτα, Ï€Ïιν στείλετε το μήνυμα';
+$messages['errorsavingsent'] = 'ΠÏοέκυψε σφάλμα κατά την αποθήκευση σταλμένου μηνÏματος.';
+$messages['errorsaving'] = 'ΠÏοέκυψε σφάλμα κατά την αποθήκευση.';
$messages['errormoving'] = 'Το μήνυμα δε μποÏοÏσε να μετακινηθεί';
$messages['errorcopying'] = 'Δεν είναι δυνατή η αντιγÏαφή του μηνÏματος/των';
$messages['errordeleting'] = 'Το μήνυμα δε μποÏοÏσε να διαγÏαφεί';
@@ -140,6 +145,7 @@ $messages['smtperror'] = 'Σφάλμα SMTP: $msg';
$messages['emailformaterror'] = 'Λανθασμένη διεÏθνση email: $email';
$messages['toomanyrecipients'] = 'Μεγάλο πλήθος αποδεκτών. Μειώστε τον αÏιθμό των αποδεκτών σε $max.';
$messages['maxgroupmembersreached'] = 'Ο αÏιθμός των μελών της ομάδας υπεÏβαίνει τον μέγιστο των $max μελών.';
+$messages['internalerror'] = 'ΠÏοέκυψε εσωτεÏικό σφάλμα. ΠαÏακαλώ δοκιμάστε ξανά.';
$messages['contactdelerror'] = 'Δεν είναι δυνατή η διαγÏαφή της επαφής/ων';
$messages['contactdeleted'] = 'Η επαφή/ές διαγÏάφηκαν με επιτυχία.';
$messages['contactrestoreerror'] = 'Οι διαγÏαφημενη επαφη(ες) δεν μποÏουν να επαναφεÏθουν.';
diff --git a/program/localization/en_CA/labels.inc b/program/localization/en_CA/labels.inc
new file mode 100644
index 000000000..c1c62ff01
--- /dev/null
+++ b/program/localization/en_CA/labels.inc
@@ -0,0 +1,496 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/labels.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
+*/
+$labels['welcome'] = 'Welcome to $product';
+$labels['username'] = 'Username';
+$labels['password'] = 'Password';
+$labels['server'] = 'Server';
+$labels['login'] = 'Login';
+$labels['logout'] = 'Logout';
+$labels['mail'] = 'Mail';
+$labels['settings'] = 'Settings';
+$labels['addressbook'] = 'Address Book';
+$labels['inbox'] = 'Inbox';
+$labels['drafts'] = 'Drafts';
+$labels['sent'] = 'Sent';
+$labels['trash'] = 'Trash';
+$labels['junk'] = 'Junk';
+$labels['show_real_foldernames'] = 'Show real names for special folders';
+$labels['subject'] = 'Subject';
+$labels['from'] = 'From';
+$labels['sender'] = 'Sender';
+$labels['to'] = 'To';
+$labels['cc'] = 'Cc';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Reply-To';
+$labels['followupto'] = 'Followup-To';
+$labels['date'] = 'Date';
+$labels['size'] = 'Size';
+$labels['priority'] = 'Priority';
+$labels['organization'] = 'Organization';
+$labels['readstatus'] = 'Read status';
+$labels['listoptions'] = 'List options...';
+$labels['mailboxlist'] = 'Folders';
+$labels['messagesfromto'] = 'Messages $from to $to of $count';
+$labels['threadsfromto'] = 'Threads $from to $to of $count';
+$labels['messagenrof'] = 'Message $nr of $count';
+$labels['fromtoshort'] = '$from – $to of $count';
+$labels['copy'] = 'Copy';
+$labels['move'] = 'Move';
+$labels['moveto'] = 'Move to...';
+$labels['download'] = 'Download';
+$labels['open'] = 'Open';
+$labels['showattachment'] = 'Show';
+$labels['showanyway'] = 'Show it anyway';
+$labels['filename'] = 'File name';
+$labels['filesize'] = 'File size';
+$labels['addtoaddressbook'] = 'Add to address book';
+$labels['sun'] = 'Sun';
+$labels['mon'] = 'Mon';
+$labels['tue'] = 'Tue';
+$labels['wed'] = 'Wed';
+$labels['thu'] = 'Thu';
+$labels['fri'] = 'Fri';
+$labels['sat'] = 'Sat';
+$labels['sunday'] = 'Sunday';
+$labels['monday'] = 'Monday';
+$labels['tuesday'] = 'Tuesday';
+$labels['wednesday'] = 'Wednesday';
+$labels['thursday'] = 'Thursday';
+$labels['friday'] = 'Friday';
+$labels['saturday'] = 'Saturday';
+$labels['jan'] = 'Jan';
+$labels['feb'] = 'Feb';
+$labels['mar'] = 'Mar';
+$labels['apr'] = 'Apr';
+$labels['may'] = 'May';
+$labels['jun'] = 'Jun';
+$labels['jul'] = 'Jul';
+$labels['aug'] = 'Aug';
+$labels['sep'] = 'Sep';
+$labels['oct'] = 'Oct';
+$labels['nov'] = 'Nov';
+$labels['dec'] = 'Dec';
+$labels['longjan'] = 'January';
+$labels['longfeb'] = 'February';
+$labels['longmar'] = 'March';
+$labels['longapr'] = 'April';
+$labels['longmay'] = 'May';
+$labels['longjun'] = 'June';
+$labels['longjul'] = 'July';
+$labels['longaug'] = 'August';
+$labels['longsep'] = 'September';
+$labels['longoct'] = 'October';
+$labels['longnov'] = 'November';
+$labels['longdec'] = 'December';
+$labels['today'] = 'Today';
+$labels['refresh'] = 'Refresh';
+$labels['checkmail'] = 'Check for new messages';
+$labels['compose'] = 'Compose';
+$labels['writenewmessage'] = 'Create a new message';
+$labels['reply'] = 'Reply';
+$labels['replytomessage'] = 'Reply to sender';
+$labels['replytoallmessage'] = 'Reply to list or to sender and all recipients';
+$labels['replyall'] = 'Reply all';
+$labels['replylist'] = 'Reply list';
+$labels['forward'] = 'Forward';
+$labels['forwardinline'] = 'Forward inline';
+$labels['forwardattachment'] = 'Forward as attachment';
+$labels['forwardmessage'] = 'Forward the message';
+$labels['deletemessage'] = 'Delete message';
+$labels['movemessagetotrash'] = 'Move message to trash';
+$labels['printmessage'] = 'Print this message';
+$labels['previousmessage'] = 'Show previous message';
+$labels['firstmessage'] = 'Show first message';
+$labels['nextmessage'] = 'Show next message';
+$labels['lastmessage'] = 'Show last message';
+$labels['backtolist'] = 'Back to message list';
+$labels['viewsource'] = 'Show source';
+$labels['mark'] = 'Mark';
+$labels['markmessages'] = 'Mark messages';
+$labels['markread'] = 'As read';
+$labels['markunread'] = 'As unread';
+$labels['markflagged'] = 'As flagged';
+$labels['markunflagged'] = 'As unflagged';
+$labels['moreactions'] = 'More actions...';
+$labels['more'] = 'More';
+$labels['back'] = 'Back';
+$labels['options'] = 'Options';
+$labels['select'] = 'Select';
+$labels['all'] = 'All';
+$labels['none'] = 'None';
+$labels['currpage'] = 'Current page';
+$labels['unread'] = 'Unread';
+$labels['flagged'] = 'Flagged';
+$labels['unanswered'] = 'Unanswered';
+$labels['withattachment'] = 'With attachment';
+$labels['deleted'] = 'Deleted';
+$labels['undeleted'] = 'Not deleted';
+$labels['invert'] = 'Invert';
+$labels['filter'] = 'Filter';
+$labels['list'] = 'List';
+$labels['threads'] = 'Threads';
+$labels['expand-all'] = 'Expand All';
+$labels['expand-unread'] = 'Expand Unread';
+$labels['collapse-all'] = 'Collapse All';
+$labels['threaded'] = 'Threaded';
+$labels['autoexpand_threads'] = 'Expand message threads';
+$labels['do_expand'] = 'all threads';
+$labels['expand_only_unread'] = 'only with unread messages';
+$labels['fromto'] = 'From/To';
+$labels['flag'] = 'Flag';
+$labels['attachment'] = 'Attachment';
+$labels['nonesort'] = 'None';
+$labels['sentdate'] = 'Sent date';
+$labels['arrival'] = 'Arrival date';
+$labels['asc'] = 'ascending';
+$labels['desc'] = 'descending';
+$labels['listcolumns'] = 'List columns';
+$labels['listsorting'] = 'Sorting column';
+$labels['listorder'] = 'Sorting order';
+$labels['listmode'] = 'List view mode';
+$labels['folderactions'] = 'Folder actions...';
+$labels['compact'] = 'Compact';
+$labels['empty'] = 'Empty';
+$labels['importmessages'] = 'Import messages';
+$labels['quota'] = 'Disk usage';
+$labels['unknown'] = 'unknown';
+$labels['unlimited'] = 'unlimited';
+$labels['quicksearch'] = 'Quick search';
+$labels['resetsearch'] = 'Reset search';
+$labels['searchmod'] = 'Search modifiers';
+$labels['msgtext'] = 'Entire message';
+$labels['body'] = 'Body';
+$labels['type'] = 'Type';
+$labels['namex'] = 'Name';
+$labels['openinextwin'] = 'Open in new window';
+$labels['emlsave'] = 'Download (.eml)';
+$labels['changeformattext'] = 'Display in plain text format';
+$labels['changeformathtml'] = 'Display in HTML format';
+$labels['editasnew'] = 'Edit as new';
+$labels['send'] = 'Send';
+$labels['sendmessage'] = 'Send message';
+$labels['savemessage'] = 'Save as draft';
+$labels['addattachment'] = 'Attach a file';
+$labels['charset'] = 'Charset';
+$labels['editortype'] = 'Editor type';
+$labels['returnreceipt'] = 'Return receipt';
+$labels['dsn'] = 'Delivery status notification';
+$labels['mailreplyintro'] = 'On $date, $sender wrote:';
+$labels['originalmessage'] = 'Original Message';
+$labels['editidents'] = 'Edit identities';
+$labels['spellcheck'] = 'Spell';
+$labels['checkspelling'] = 'Check spelling';
+$labels['resumeediting'] = 'Resume editing';
+$labels['revertto'] = 'Revert to';
+$labels['restore'] = 'Restore';
+$labels['restoremessage'] = 'Restore message?';
+$labels['responses'] = 'Responses';
+$labels['insertresponse'] = 'Insert a response';
+$labels['manageresponses'] = 'Manage responses';
+$labels['savenewresponse'] = 'Save new response';
+$labels['editresponses'] = 'Edit responses';
+$labels['editresponse'] = 'Edit response';
+$labels['responsename'] = 'Name';
+$labels['responsetext'] = 'Response Text';
+$labels['attach'] = 'Attach';
+$labels['attachments'] = 'Attachments';
+$labels['upload'] = 'Upload';
+$labels['uploadprogress'] = '$percent ($current from $total)';
+$labels['close'] = 'Close';
+$labels['messageoptions'] = 'Message options...';
+$labels['low'] = 'Low';
+$labels['lowest'] = 'Lowest';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'High';
+$labels['highest'] = 'Highest';
+$labels['nosubject'] = '(no subject)';
+$labels['showimages'] = 'Display images';
+$labels['alwaysshow'] = 'Always show images from $sender';
+$labels['isdraft'] = 'This is a draft message.';
+$labels['andnmore'] = '$nr more...';
+$labels['togglemoreheaders'] = 'Show more message headers';
+$labels['togglefullheaders'] = 'Toggle raw message headers';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Plain text';
+$labels['savesentmessagein'] = 'Save sent message in';
+$labels['dontsave'] = 'don\'t save';
+$labels['maxuploadsize'] = 'Maximum allowed file size is $size';
+$labels['addcc'] = 'Add Cc';
+$labels['addbcc'] = 'Add Bcc';
+$labels['addreplyto'] = 'Add Reply-To';
+$labels['addfollowupto'] = 'Add Followup-To';
+$labels['mdnrequest'] = 'The sender of this message has asked to be notified when you read this message. Do you wish to notify the sender?';
+$labels['receiptread'] = 'Return Receipt (read)';
+$labels['yourmessage'] = 'This is a Return Receipt for your message';
+$labels['receiptnote'] = 'Note: This receipt only acknowledges that the message was displayed on the recipient\'s computer. There is no guarantee that the recipient has read or understood the message contents.';
+$labels['name'] = 'Display Name';
+$labels['firstname'] = 'First Name';
+$labels['surname'] = 'Last Name';
+$labels['middlename'] = 'Middle Name';
+$labels['nameprefix'] = 'Prefix';
+$labels['namesuffix'] = 'Suffix';
+$labels['nickname'] = 'Nickname';
+$labels['jobtitle'] = 'Job Title';
+$labels['department'] = 'Department';
+$labels['gender'] = 'Gender';
+$labels['maidenname'] = 'Maiden Name';
+$labels['email'] = 'Email';
+$labels['phone'] = 'Phone';
+$labels['address'] = 'Address';
+$labels['street'] = 'Street';
+$labels['locality'] = 'City';
+$labels['zipcode'] = 'Postal Code';
+$labels['region'] = 'Province';
+$labels['country'] = 'Country';
+$labels['birthday'] = 'Birthday';
+$labels['anniversary'] = 'Anniversary';
+$labels['website'] = 'Website';
+$labels['instantmessenger'] = 'IM';
+$labels['notes'] = 'Notes';
+$labels['male'] = 'male';
+$labels['female'] = 'female';
+$labels['manager'] = 'Manager';
+$labels['assistant'] = 'Assistant';
+$labels['spouse'] = 'Spouse';
+$labels['allfields'] = 'All fields';
+$labels['search'] = 'Search';
+$labels['advsearch'] = 'Advanced Search';
+$labels['advanced'] = 'Advanced';
+$labels['other'] = 'Other';
+$labels['typehome'] = 'Home';
+$labels['typework'] = 'Work';
+$labels['typeother'] = 'Other';
+$labels['typemobile'] = 'Mobile';
+$labels['typemain'] = 'Main';
+$labels['typehomefax'] = 'Home Fax';
+$labels['typeworkfax'] = 'Work Fax';
+$labels['typecar'] = 'Car';
+$labels['typepager'] = 'Pager';
+$labels['typevideo'] = 'Video';
+$labels['typeassistant'] = 'Assistant';
+$labels['typehomepage'] = 'Home Page';
+$labels['typeblog'] = 'Blog';
+$labels['typeprofile'] = 'Profile';
+$labels['addfield'] = 'Add field...';
+$labels['addcontact'] = 'Add new contact';
+$labels['editcontact'] = 'Edit contact';
+$labels['contacts'] = 'Contacts';
+$labels['contactproperties'] = 'Contact properties';
+$labels['personalinfo'] = 'Personal information';
+$labels['edit'] = 'Edit';
+$labels['cancel'] = 'Cancel';
+$labels['save'] = 'Save';
+$labels['delete'] = 'Delete';
+$labels['rename'] = 'Rename';
+$labels['addphoto'] = 'Add';
+$labels['replacephoto'] = 'Replace';
+$labels['uploadphoto'] = 'Upload photo';
+$labels['newcontact'] = 'Create new contact card';
+$labels['deletecontact'] = 'Delete selected contacts';
+$labels['composeto'] = 'Compose mail to';
+$labels['contactsfromto'] = 'Contacts $from to $to of $count';
+$labels['print'] = 'Print';
+$labels['export'] = 'Export';
+$labels['exportall'] = 'Export all';
+$labels['exportsel'] = 'Export selected';
+$labels['exportvcards'] = 'Export contacts in vCard format';
+$labels['newcontactgroup'] = 'Create new contact group';
+$labels['grouprename'] = 'Rename group';
+$labels['groupdelete'] = 'Delete group';
+$labels['groupremoveselected'] = 'Remove selected contacts from group';
+$labels['previouspage'] = 'Show previous page';
+$labels['firstpage'] = 'Show first page';
+$labels['nextpage'] = 'Show next page';
+$labels['lastpage'] = 'Show last page';
+$labels['group'] = 'Group';
+$labels['groups'] = 'Groups';
+$labels['listgroup'] = 'List group members';
+$labels['personaladrbook'] = 'Personal Addresses';
+$labels['searchsave'] = 'Save search';
+$labels['searchdelete'] = 'Delete search';
+$labels['import'] = 'Import';
+$labels['importcontacts'] = 'Import contacts';
+$labels['importfromfile'] = 'Import from file:';
+$labels['importtarget'] = 'Add contacts to';
+$labels['importreplace'] = 'Replace the entire address book';
+$labels['importgroups'] = 'Import group assignments';
+$labels['importgroupsall'] = 'All (create groups if necessary)';
+$labels['importgroupsexisting'] = 'Only for existing groups';
+$labels['importdesc'] = 'You can upload contacts from an existing address book.<br/>We currently support importing addresses from the <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> or CSV (comma-separated) data format.';
+$labels['done'] = 'Done';
+$labels['settingsfor'] = 'Settings for';
+$labels['about'] = 'About';
+$labels['preferences'] = 'Preferences';
+$labels['userpreferences'] = 'User preferences';
+$labels['editpreferences'] = 'Edit user preferences';
+$labels['identities'] = 'Identities';
+$labels['manageidentities'] = 'Manage identities for this account';
+$labels['newidentity'] = 'New identity';
+$labels['newitem'] = 'New item';
+$labels['edititem'] = 'Edit item';
+$labels['preferhtml'] = 'Display HTML';
+$labels['defaultcharset'] = 'Default Character Set';
+$labels['htmlmessage'] = 'HTML Message';
+$labels['messagepart'] = 'Part';
+$labels['digitalsig'] = 'Digital Signature';
+$labels['dateformat'] = 'Date format';
+$labels['timeformat'] = 'Time format';
+$labels['prettydate'] = 'Pretty dates';
+$labels['setdefault'] = 'Set default';
+$labels['autodetect'] = 'Auto';
+$labels['language'] = 'Language';
+$labels['timezone'] = 'Time zone';
+$labels['pagesize'] = 'Rows per page';
+$labels['signature'] = 'Signature';
+$labels['dstactive'] = 'Daylight saving time';
+$labels['showinextwin'] = 'Open message in a new window';
+$labels['composeextwin'] = 'Compose in a new window';
+$labels['htmleditor'] = 'Compose HTML messages';
+$labels['htmlonreply'] = 'on reply to HTML message';
+$labels['htmlonreplyandforward'] = 'on forward or reply to HTML message';
+$labels['htmlsignature'] = 'HTML signature';
+$labels['showemail'] = 'Show email address with display name';
+$labels['previewpane'] = 'Show preview pane';
+$labels['skin'] = 'Interface skin';
+$labels['logoutclear'] = 'Clear Trash on logout';
+$labels['logoutcompact'] = 'Compact Inbox on logout';
+$labels['uisettings'] = 'User Interface';
+$labels['serversettings'] = 'Server Settings';
+$labels['mailboxview'] = 'Mailbox View';
+$labels['mdnrequests'] = 'On request for return receipt';
+$labels['askuser'] = 'ask me';
+$labels['autosend'] = 'send receipt';
+$labels['autosendknown'] = 'send receipt to my contacts, otherwise ask me';
+$labels['autosendknownignore'] = 'send receipt to my contacts, otherwise ignore';
+$labels['ignore'] = 'ignore';
+$labels['readwhendeleted'] = 'Mark the message as read on delete';
+$labels['flagfordeletion'] = 'Flag the message for deletion instead of delete';
+$labels['skipdeleted'] = 'Do not show deleted messages';
+$labels['deletealways'] = 'If moving messages to Trash fails, delete them';
+$labels['deletejunk'] = 'Directly delete messages in Junk';
+$labels['showremoteimages'] = 'Display remote inline images';
+$labels['fromknownsenders'] = 'from known senders';
+$labels['always'] = 'always';
+$labels['showinlineimages'] = 'Display attached images below the message';
+$labels['autosavedraft'] = 'Automatically save draft';
+$labels['everynminutes'] = 'every $n minute(s)';
+$labels['refreshinterval'] = 'Refresh (check for new messages, etc.)';
+$labels['never'] = 'never';
+$labels['immediately'] = 'immediately';
+$labels['messagesdisplaying'] = 'Displaying Messages';
+$labels['messagescomposition'] = 'Composing Messages';
+$labels['mimeparamfolding'] = 'Attachment names';
+$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Full RFC 2047 (other)';
+$labels['force7bit'] = 'Use MIME encoding for 8-bit characters';
+$labels['advancedoptions'] = 'Advanced options';
+$labels['focusonnewmessage'] = 'Focus browser window on new message';
+$labels['checkallfolders'] = 'Check all folders for new messages';
+$labels['displaynext'] = 'After message delete/move display the next message';
+$labels['defaultfont'] = 'Default font of HTML message';
+$labels['mainoptions'] = 'Main Options';
+$labels['browseroptions'] = 'Browser Options';
+$labels['section'] = 'Section';
+$labels['maintenance'] = 'Maintenance';
+$labels['newmessage'] = 'New Message';
+$labels['signatureoptions'] = 'Signature Options';
+$labels['whenreplying'] = 'When replying';
+$labels['replyempty'] = 'do not quote the original message';
+$labels['replytopposting'] = 'start new message above the quote';
+$labels['replybottomposting'] = 'start new message below the quote';
+$labels['replyremovesignature'] = 'When replying remove original signature from message';
+$labels['autoaddsignature'] = 'Automatically add signature';
+$labels['newmessageonly'] = 'new message only';
+$labels['replyandforwardonly'] = 'replies and forwards only';
+$labels['insertsignature'] = 'Insert signature';
+$labels['previewpanemarkread'] = 'Mark previewed messages as read';
+$labels['afternseconds'] = 'after $n seconds';
+$labels['reqmdn'] = 'Always request a return receipt';
+$labels['reqdsn'] = 'Always request a delivery status notification';
+$labels['replysamefolder'] = 'Place replies in the folder of the message being replied to';
+$labels['defaultabook'] = 'Default address book';
+$labels['autocompletesingle'] = 'Skip alternative email addresses in autocompletion';
+$labels['listnamedisplay'] = 'List contacts as';
+$labels['spellcheckbeforesend'] = 'Check spelling before sending a message';
+$labels['spellcheckoptions'] = 'Spellcheck Options';
+$labels['spellcheckignoresyms'] = 'Ignore words with symbols';
+$labels['spellcheckignorenums'] = 'Ignore words with numbers';
+$labels['spellcheckignorecaps'] = 'Ignore words with all letters capitalized';
+$labels['addtodict'] = 'Add to dictionary';
+$labels['mailtoprotohandler'] = 'Register protocol handler for mailto: links';
+$labels['standardwindows'] = 'Handle popups as standard windows';
+$labels['forwardmode'] = 'Messages forwarding';
+$labels['inline'] = 'inline';
+$labels['asattachment'] = 'as attachment';
+$labels['replyallmode'] = 'Default action of [Reply all] button';
+$labels['replyalldefault'] = 'reply to all';
+$labels['replyalllist'] = 'reply to mailing list only (if found)';
+$labels['folder'] = 'Folder';
+$labels['folders'] = 'Folders';
+$labels['foldername'] = 'Folder name';
+$labels['subscribed'] = 'Subscribed';
+$labels['messagecount'] = 'Messages';
+$labels['create'] = 'Create';
+$labels['createfolder'] = 'Create new folder';
+$labels['managefolders'] = 'Manage folders';
+$labels['specialfolders'] = 'Special Folders';
+$labels['properties'] = 'Properties';
+$labels['folderproperties'] = 'Folder properties';
+$labels['parentfolder'] = 'Parent folder';
+$labels['location'] = 'Location';
+$labels['info'] = 'Information';
+$labels['getfoldersize'] = 'Click to get folder size';
+$labels['changesubscription'] = 'Click to change subscription';
+$labels['foldertype'] = 'Folder Type';
+$labels['personalfolder'] = 'Private Folder';
+$labels['otherfolder'] = 'Other User\'s Folder';
+$labels['sharedfolder'] = 'Public Folder';
+$labels['sortby'] = 'Sort by';
+$labels['sortasc'] = 'Sort ascending';
+$labels['sortdesc'] = 'Sort descending';
+$labels['undo'] = 'Undo';
+$labels['installedplugins'] = 'Installed plugins';
+$labels['plugin'] = 'Plugin';
+$labels['version'] = 'Version';
+$labels['source'] = 'Source';
+$labels['license'] = 'License';
+$labels['support'] = 'Get support';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
+$labels['unicode'] = 'Unicode';
+$labels['english'] = 'English';
+$labels['westerneuropean'] = 'Western European';
+$labels['easterneuropean'] = 'Eastern European';
+$labels['southeasterneuropean'] = 'South-Eastern European';
+$labels['baltic'] = 'Baltic';
+$labels['cyrillic'] = 'Cyrillic';
+$labels['arabic'] = 'Arabic';
+$labels['greek'] = 'Greek';
+$labels['hebrew'] = 'Hebrew';
+$labels['turkish'] = 'Turkish';
+$labels['nordic'] = 'Nordic';
+$labels['thai'] = 'Thai';
+$labels['celtic'] = 'Celtic';
+$labels['vietnamese'] = 'Vietnamese';
+$labels['japanese'] = 'Japanese';
+$labels['korean'] = 'Korean';
+$labels['chinese'] = 'Chinese';
+?>
diff --git a/program/localization/en_CA/messages.inc b/program/localization/en_CA/messages.inc
new file mode 100644
index 000000000..169c1c9b1
--- /dev/null
+++ b/program/localization/en_CA/messages.inc
@@ -0,0 +1,176 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/messages.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
+*/
+$messages['errortitle'] = 'An error occurred!';
+$messages['loginfailed'] = 'Login failed.';
+$messages['cookiesdisabled'] = 'Your browser does not accept cookies.';
+$messages['sessionerror'] = 'Your session is invalid or expired.';
+$messages['storageerror'] = 'Connection to storage server failed.';
+$messages['servererror'] = 'Server Error!';
+$messages['servererrormsg'] = 'Server Error: $msg';
+$messages['dberror'] = 'Database Error!';
+$messages['requesttimedout'] = 'Request timed out';
+$messages['errorreadonly'] = 'Unable to perform operation. Folder is read-only.';
+$messages['errornoperm'] = 'Unable to perform operation. Permission denied.';
+$messages['erroroverquota'] = 'Unable to perform operation. No free disk space.';
+$messages['erroroverquotadelete'] = 'No free disk space. Use SHIFT+DEL to delete a message.';
+$messages['invalidrequest'] = 'Invalid request! No data was saved.';
+$messages['invalidhost'] = 'Invalid server name.';
+$messages['nomessagesfound'] = 'No messages found in this mailbox.';
+$messages['loggedout'] = 'You have successfully terminated the session. Good bye!';
+$messages['mailboxempty'] = 'Mailbox is empty.';
+$messages['refreshing'] = 'Refreshing...';
+$messages['loading'] = 'Loading...';
+$messages['uploading'] = 'Uploading file...';
+$messages['uploadingmany'] = 'Uploading files...';
+$messages['loadingdata'] = 'Loading data...';
+$messages['checkingmail'] = 'Checking for new messages...';
+$messages['sendingmessage'] = 'Sending message...';
+$messages['messagesent'] = 'Message sent successfully.';
+$messages['savingmessage'] = 'Saving message...';
+$messages['messagesaved'] = 'Message saved to Drafts.';
+$messages['successfullysaved'] = 'Successfully saved.';
+$messages['savingresponse'] = 'Saving response text...';
+$messages['deleteresponseconfirm'] = 'Do you really want to delete this response text?';
+$messages['addedsuccessfully'] = 'Contact added successfully to address book.';
+$messages['contactexists'] = 'A contact with the same e-mail address already exists.';
+$messages['contactnameexists'] = 'A contact with the same name already exists.';
+$messages['blockedimages'] = 'To protect your privacy, remote images are blocked in this message.';
+$messages['encryptedmessage'] = 'This is an encrypted message and can not be displayed. Sorry!';
+$messages['nocontactsfound'] = 'No contacts found.';
+$messages['contactnotfound'] = 'The requested contact was not found.';
+$messages['contactsearchonly'] = 'Enter some search terms to find contacts';
+$messages['sendingfailed'] = 'Failed to send message.';
+$messages['senttooquickly'] = 'Please wait $sec sec(s). before sending this message.';
+$messages['errorsavingsent'] = 'An error occurred while saving sent message.';
+$messages['errorsaving'] = 'An error occurred while saving.';
+$messages['errormoving'] = 'Could not move the message(s).';
+$messages['errorcopying'] = 'Could not copy the message(s).';
+$messages['errordeleting'] = 'Could not delete the message(s).';
+$messages['errormarking'] = 'Could not mark the message(s).';
+$messages['deletecontactconfirm'] = 'Do you really want to delete selected contact(s)?';
+$messages['deletegroupconfirm'] = 'Do you really want to delete selected group?';
+$messages['deletemessagesconfirm'] = 'Do you really want to delete selected message(s)?';
+$messages['deletefolderconfirm'] = 'Do you really want to delete this folder?';
+$messages['purgefolderconfirm'] = 'Do you really want to delete all messages in this folder?';
+$messages['contactdeleting'] = 'Deleting contact(s)...';
+$messages['groupdeleting'] = 'Deleting group...';
+$messages['folderdeleting'] = 'Deleting folder...';
+$messages['foldermoving'] = 'Moving folder...';
+$messages['foldersubscribing'] = 'Subscribing folder...';
+$messages['folderunsubscribing'] = 'Unsubscribing folder...';
+$messages['formincomplete'] = 'The form was not completely filled out.';
+$messages['noemailwarning'] = 'Please enter a valid email address.';
+$messages['nonamewarning'] = 'Please enter a name.';
+$messages['nopagesizewarning'] = 'Please enter a page size.';
+$messages['nosenderwarning'] = 'Please enter sender e-mail address.';
+$messages['norecipientwarning'] = 'Please enter at least one recipient.';
+$messages['nosubjectwarning'] = 'The "Subject" field is empty. Would you like to enter one now?';
+$messages['nobodywarning'] = 'Send this message without text?';
+$messages['notsentwarning'] = 'Message has not been sent. Do you want to discard your message?';
+$messages['restoresavedcomposedata'] = 'A previously composed but unsent message was found.\n\nSubject: $subject\nSaved: $date\n\nDo you want to restore this message?';
+$messages['noldapserver'] = 'Please select an ldap server to search.';
+$messages['nosearchname'] = 'Please enter a contact name or email address.';
+$messages['notuploadedwarning'] = 'Not all attachments have been uploaded yet. Please wait or cancel the upload.';
+$messages['searchsuccessful'] = '$nr messages found.';
+$messages['contactsearchsuccessful'] = '$nr contacts found.';
+$messages['searchnomatch'] = 'Search returned no matches.';
+$messages['searching'] = 'Searching...';
+$messages['checking'] = 'Checking...';
+$messages['nospellerrors'] = 'No spelling errors found.';
+$messages['folderdeleted'] = 'Folder successfully deleted.';
+$messages['foldersubscribed'] = 'Folder successfully subscribed.';
+$messages['folderunsubscribed'] = 'Folder successfully unsubscribed.';
+$messages['folderpurged'] = 'Folder has successfully been emptied.';
+$messages['folderexpunged'] = 'Folder has successfully been compacted.';
+$messages['deletedsuccessfully'] = 'Successfully deleted.';
+$messages['converting'] = 'Removing formatting...';
+$messages['messageopenerror'] = 'Could not load message from server.';
+$messages['fileuploaderror'] = 'File upload failed.';
+$messages['filesizeerror'] = 'The uploaded file exceeds the maximum size of $size.';
+$messages['copysuccess'] = 'Successfully copied $nr contacts.';
+$messages['movesuccess'] = 'Successfully moved $nr contacts.';
+$messages['copyerror'] = 'Could not copy any contacts.';
+$messages['moveerror'] = 'Could not move any contacts.';
+$messages['sourceisreadonly'] = 'This address source is read only.';
+$messages['errorsavingcontact'] = 'Could not save the contact address.';
+$messages['movingmessage'] = 'Moving message(s)...';
+$messages['copyingmessage'] = 'Copying message(s)...';
+$messages['copyingcontact'] = 'Copying contact(s)...';
+$messages['movingcontact'] = 'Moving contact(s)...';
+$messages['deletingmessage'] = 'Deleting message(s)...';
+$messages['markingmessage'] = 'Marking message(s)...';
+$messages['addingmember'] = 'Adding contact(s) to the group...';
+$messages['removingmember'] = 'Removing contact(s) from the group...';
+$messages['receiptsent'] = 'Successfully sent a read receipt.';
+$messages['errorsendingreceipt'] = 'Could not send the receipt.';
+$messages['deleteidentityconfirm'] = 'Do you really want to delete this identity?';
+$messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
+$messages['forbiddencharacter'] = 'Folder name contains a forbidden character.';
+$messages['selectimportfile'] = 'Please select a file to upload.';
+$messages['addresswriterror'] = 'The selected address book is not writeable.';
+$messages['contactaddedtogroup'] = 'Successfully added the contacts to this group.';
+$messages['contactremovedfromgroup'] = 'Successfully removed contacts from this group.';
+$messages['nogroupassignmentschanged'] = 'No group assignments changed.';
+$messages['importwait'] = 'Importing, please wait...';
+$messages['importformaterror'] = 'Import failed! The uploaded file is not a valid import data file.';
+$messages['importconfirm'] = '<b>Successfully imported $inserted contacts</b>';
+$messages['importconfirmskipped'] = '<b>Skipped $skipped existing entries</b>';
+$messages['importmessagesuccess'] = 'Successfully imported $nr messages';
+$messages['importmessageerror'] = 'Import failed! The uploaded file is not a valid message or mailbox file';
+$messages['opnotpermitted'] = 'Operation not permitted!';
+$messages['nofromaddress'] = 'Missing e-mail address in selected identity.';
+$messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?';
+$messages['httpreceivedencrypterror'] = 'A fatal configuration error occurred. Contact your administrator immediately. <b>Your message can not be sent.</b>';
+$messages['smtpconnerror'] = 'SMTP Error ($code): Connection to server failed.';
+$messages['smtpautherror'] = 'SMTP Error ($code): Authentication failed.';
+$messages['smtpfromerror'] = 'SMTP Error ($code): Failed to set sender "$from" ($msg).';
+$messages['smtptoerror'] = 'SMTP Error ($code): Failed to add recipient "$to" ($msg).';
+$messages['smtprecipientserror'] = 'SMTP Error: Unable to parse recipients list.';
+$messages['smtperror'] = 'SMTP Error: $msg';
+$messages['emailformaterror'] = 'Invalid e-mail address: $email';
+$messages['toomanyrecipients'] = 'Too many recipients. Reduce the number of recipients to $max.';
+$messages['maxgroupmembersreached'] = 'The number of group members exceeds the maximum of $max.';
+$messages['internalerror'] = 'An internal error occurred. Please try again.';
+$messages['contactdelerror'] = 'Could not delete contact(s).';
+$messages['contactdeleted'] = 'Contact(s) deleted successfully.';
+$messages['contactrestoreerror'] = 'Could not restore deleted contact(s).';
+$messages['contactrestored'] = 'Contact(s) restored successfully.';
+$messages['groupdeleted'] = 'Group deleted successfully.';
+$messages['grouprenamed'] = 'Group renamed successfully.';
+$messages['groupcreated'] = 'Group created successfully.';
+$messages['savedsearchdeleted'] = 'Saved search deleted successfully.';
+$messages['savedsearchdeleteerror'] = 'Could not delete saved search.';
+$messages['savedsearchcreated'] = 'Saved search created successfully.';
+$messages['savedsearchcreateerror'] = 'Could not create saved search.';
+$messages['messagedeleted'] = 'Message(s) deleted successfully.';
+$messages['messagemoved'] = 'Message(s) moved successfully.';
+$messages['messagecopied'] = 'Message(s) copied successfully.';
+$messages['messagemarked'] = 'Message(s) marked successfully.';
+$messages['autocompletechars'] = 'Enter at least $min characters for autocompletion.';
+$messages['autocompletemore'] = 'More matching entries found. Please type more characters.';
+$messages['namecannotbeempty'] = 'Name cannot be empty.';
+$messages['nametoolong'] = 'Name is too long.';
+$messages['folderupdated'] = 'Folder updated successfully.';
+$messages['foldercreated'] = 'Folder created successfully.';
+$messages['invalidimageformat'] = 'Not a valid image format.';
+$messages['mispellingsfound'] = 'Spelling errors detected in the message.';
+$messages['parentnotwritable'] = 'Unable to create/move folder into selected parent folder. No access rights.';
+$messages['messagetoobig'] = 'The message part is too big to process it.';
+$messages['attachmentvalidationerror'] = 'WARNING! This attachment is suspicious because its type doesn\'t match the type declared in the message. If you do not trust the sender, you shouldn\'t open it in the browser because it may contain malicious contents.<br/><br/><em>Expected: $expected; found: $detected</em>';
+$messages['noscriptwarning'] = 'Warning: This webmail service requires Javascript! In order to use it please enable Javascript in your browser\'s settings.';
+?>
diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc
index c7778e955..628b41bde 100644
--- a/program/localization/en_GB/labels.inc
+++ b/program/localization/en_GB/labels.inc
@@ -29,8 +29,10 @@ $labels['drafts'] = 'Drafts';
$labels['sent'] = 'Sent';
$labels['trash'] = 'Deleted Items';
$labels['junk'] = 'Junk';
+$labels['show_real_foldernames'] = 'Show real names for special folders';
$labels['subject'] = 'Subject';
$labels['from'] = 'From';
+$labels['sender'] = 'Sender';
$labels['to'] = 'To';
$labels['cc'] = 'Copy';
$labels['bcc'] = 'Bcc';
@@ -50,7 +52,9 @@ $labels['fromtoshort'] = '$from – $to of $count';
$labels['copy'] = 'Copy';
$labels['move'] = 'Move';
$labels['moveto'] = 'Move to...';
+$labels['copyto'] = 'Copy to...';
$labels['download'] = 'Download';
+$labels['open'] = 'Open';
$labels['showattachment'] = 'Show';
$labels['showanyway'] = 'Show it anyway';
$labels['filename'] = 'File name';
@@ -134,6 +138,7 @@ $labels['currpage'] = 'Current page';
$labels['unread'] = 'Unread';
$labels['flagged'] = 'Flagged';
$labels['unanswered'] = 'Unanswered';
+$labels['withattachment'] = 'With attachment';
$labels['deleted'] = 'Deleted';
$labels['undeleted'] = 'Not deleted';
$labels['invert'] = 'Invert';
@@ -162,6 +167,7 @@ $labels['listmode'] = 'List view mode';
$labels['folderactions'] = 'Folder actions...';
$labels['compact'] = 'Compact';
$labels['empty'] = 'Empty';
+$labels['importmessages'] = 'Import messages';
$labels['quota'] = 'Disk usage';
$labels['unknown'] = 'unknown';
$labels['unlimited'] = 'unlimited';
@@ -169,8 +175,13 @@ $labels['quicksearch'] = 'Quick search';
$labels['resetsearch'] = 'Reset search';
$labels['searchmod'] = 'Search modifiers';
$labels['msgtext'] = 'Entire message';
+$labels['body'] = 'Body';
+$labels['type'] = 'Type';
+$labels['namex'] = 'Name';
$labels['openinextwin'] = 'Open in new window';
$labels['emlsave'] = 'Download (.eml)';
+$labels['changeformattext'] = 'Display in plain text format';
+$labels['changeformathtml'] = 'Display in HTML format';
$labels['editasnew'] = 'Edit as new';
$labels['send'] = 'Send';
$labels['sendmessage'] = 'Send now';
@@ -187,6 +198,16 @@ $labels['spellcheck'] = 'Spell';
$labels['checkspelling'] = 'Check spelling';
$labels['resumeediting'] = 'Resume editing';
$labels['revertto'] = 'Revert to';
+$labels['restore'] = 'Restore';
+$labels['restoremessage'] = 'Restore message?';
+$labels['responses'] = 'Responses';
+$labels['insertresponse'] = 'Insert a response';
+$labels['manageresponses'] = 'Manage responses';
+$labels['savenewresponse'] = 'Save new response';
+$labels['editresponses'] = 'Edit responses';
+$labels['editresponse'] = 'Edit response';
+$labels['responsename'] = 'Name';
+$labels['responsetext'] = 'Response Text';
$labels['attach'] = 'Attach';
$labels['attachments'] = 'Attachments';
$labels['upload'] = 'Upload';
@@ -286,6 +307,8 @@ $labels['composeto'] = 'Compose mail to';
$labels['contactsfromto'] = 'Contacts $from to $to of $count';
$labels['print'] = 'Print';
$labels['export'] = 'Export';
+$labels['exportall'] = 'Export all';
+$labels['exportsel'] = 'Export selected';
$labels['exportvcards'] = 'Export contacts in vCard format';
$labels['newcontactgroup'] = 'Create new contact group';
$labels['grouprename'] = 'Rename group';
@@ -297,13 +320,18 @@ $labels['nextpage'] = 'Show next set';
$labels['lastpage'] = 'Show last set';
$labels['group'] = 'Group';
$labels['groups'] = 'Groups';
+$labels['listgroup'] = 'List group members';
$labels['personaladrbook'] = 'Personal Addresses';
$labels['searchsave'] = 'Save search';
$labels['searchdelete'] = 'Delete search';
$labels['import'] = 'Import';
$labels['importcontacts'] = 'Import contacts';
$labels['importfromfile'] = 'Import from file:';
+$labels['importtarget'] = 'Add contacts to';
$labels['importreplace'] = 'Replace the entire address book';
+$labels['importgroups'] = 'Import group assignments';
+$labels['importgroupsall'] = 'All (create groups if necessary)';
+$labels['importgroupsexisting'] = 'Only for existing groups';
$labels['importdesc'] = 'You can upload contacts from an existing address book.<br/>We currently support importing addresses from the <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> or CSV (comma-separated) data format.';
$labels['done'] = 'Done';
$labels['settingsfor'] = 'Settings for';
@@ -319,6 +347,8 @@ $labels['edititem'] = 'Edit item';
$labels['preferhtml'] = 'Display HTML';
$labels['defaultcharset'] = 'Default Character Set';
$labels['htmlmessage'] = 'HTML Message';
+$labels['messagepart'] = 'Part';
+$labels['digitalsig'] = 'Digital Signature';
$labels['dateformat'] = 'Date format';
$labels['timeformat'] = 'Time format';
$labels['prettydate'] = 'Pretty dates';
@@ -335,6 +365,7 @@ $labels['htmleditor'] = 'Compose HTML messages';
$labels['htmlonreply'] = 'on reply to HTML message only';
$labels['htmlonreplyandforward'] = 'on forward or reply to HTML message';
$labels['htmlsignature'] = 'HTML signature';
+$labels['showemail'] = 'Show email address with display name';
$labels['previewpane'] = 'Show preview pane';
$labels['skin'] = 'Interface skin';
$labels['logoutclear'] = 'Clear Trash on logout';
@@ -404,9 +435,13 @@ $labels['spellcheckignorenums'] = 'Ignore words with numbers';
$labels['spellcheckignorecaps'] = 'Ignore words with all letters capitalised';
$labels['addtodict'] = 'Add to dictionary';
$labels['mailtoprotohandler'] = 'Register protocol handler for mailto: links';
+$labels['standardwindows'] = 'Handle popups as standard windows';
$labels['forwardmode'] = 'Messages forwarding';
$labels['inline'] = 'inline';
$labels['asattachment'] = 'as attachment';
+$labels['replyallmode'] = 'Default action of [Reply all] button';
+$labels['replyalldefault'] = 'reply to all';
+$labels['replyalllist'] = 'reply to mailing list only (if found)';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folders';
$labels['foldername'] = 'Folder name';
diff --git a/program/localization/en_GB/messages.inc b/program/localization/en_GB/messages.inc
index 5b6a8f7f2..8ee7aef5a 100644
--- a/program/localization/en_GB/messages.inc
+++ b/program/localization/en_GB/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -26,11 +26,14 @@ $messages['dberror'] = 'Database Error!';
$messages['requesttimedout'] = 'Request timed out';
$messages['errorreadonly'] = 'Unable to perform operation. Folder is read-only.';
$messages['errornoperm'] = 'Unable to perform operation. Permission denied.';
+$messages['erroroverquota'] = 'Unable to perform operation. No free disk space.';
+$messages['erroroverquotadelete'] = 'No free disk space. Use SHIFT+DEL to delete a message.';
$messages['invalidrequest'] = 'Invalid request! No data was saved.';
$messages['invalidhost'] = 'Invalid server name.';
$messages['nomessagesfound'] = 'No messages found in this mailbox.';
$messages['loggedout'] = 'You have successfully terminated the session. Good bye!';
-$messages['mailboxempty'] = 'Mailbox is empty.';
+$messages['mailboxempty'] = 'Mailbox is empty';
+$messages['nomessages'] = 'No messages';
$messages['refreshing'] = 'Refreshing...';
$messages['loading'] = 'Loading...';
$messages['uploading'] = 'Uploading file...';
@@ -42,6 +45,8 @@ $messages['messagesent'] = 'Message sent successfully.';
$messages['savingmessage'] = 'Saving message...';
$messages['messagesaved'] = 'Message saved to Drafts.';
$messages['successfullysaved'] = 'Successfully saved.';
+$messages['savingresponse'] = 'Saving response text...';
+$messages['deleteresponseconfirm'] = 'Do you really want to delete this response text?';
$messages['addedsuccessfully'] = 'Contact successfully added to address book.';
$messages['contactexists'] = 'A contact with this e-mail address already exists.';
$messages['contactnameexists'] = 'A contact with the same name already exists.';
@@ -52,6 +57,8 @@ $messages['contactnotfound'] = 'The requested contact was not found.';
$messages['contactsearchonly'] = 'Enter some search terms to find contacts';
$messages['sendingfailed'] = 'Failed to send message.';
$messages['senttooquickly'] = 'Please wait $sec sec(s). before sending this message.';
+$messages['errorsavingsent'] = 'An error occurred while saving sent message.';
+$messages['errorsaving'] = 'An error occurred while saving.';
$messages['errormoving'] = 'Could not move the message(s).';
$messages['errorcopying'] = 'Could not copy the message(s).';
$messages['errordeleting'] = 'Could not delete the message(s).';
@@ -76,6 +83,7 @@ $messages['norecipientwarning'] = 'Please enter at least one recipient.';
$messages['nosubjectwarning'] = 'The "Subject" field is empty. Would you like to enter one now?';
$messages['nobodywarning'] = 'Send this message without any text?';
$messages['notsentwarning'] = 'Your message has not been sent. Do you want to discard it?';
+$messages['restoresavedcomposedata'] = 'A previously composed but unsent message was found.\n\nSubject: $subject\nSaved: $date\n\nDo you want to restore this message?';
$messages['noldapserver'] = 'Please select an LDAP server to search.';
$messages['nosearchname'] = 'Please enter a contact name or email address.';
$messages['notuploadedwarning'] = 'Not all attachments have been uploaded yet. Please wait or cancel the upload.';
@@ -95,11 +103,16 @@ $messages['converting'] = 'Removing formatting...';
$messages['messageopenerror'] = 'Could not load message from server.';
$messages['fileuploaderror'] = 'File upload failed.';
$messages['filesizeerror'] = 'The uploaded file exceeds the maximum size of $size.';
+$messages['copysuccess'] = 'Successfully copied $nr contacts.';
+$messages['movesuccess'] = 'Successfully moved $nr contacts.';
+$messages['copyerror'] = 'Could not copy any contacts.';
+$messages['moveerror'] = 'Could not move any contacts.';
$messages['sourceisreadonly'] = 'This address book is read-only.';
$messages['errorsavingcontact'] = 'Could not save the contact address.';
$messages['movingmessage'] = 'Moving message(s)...';
$messages['copyingmessage'] = 'Copying message(s)...';
$messages['copyingcontact'] = 'Copying contact(s)...';
+$messages['movingcontact'] = 'Moving contact(s)...';
$messages['deletingmessage'] = 'Deleting message(s)...';
$messages['markingmessage'] = 'Marking message(s)...';
$messages['addingmember'] = 'Adding contact(s) to the group...';
@@ -118,6 +131,8 @@ $messages['importwait'] = 'Importing, please wait...';
$messages['importformaterror'] = 'Import failed! The uploaded file is not a valid import data file.';
$messages['importconfirm'] = '<b>Successfully imported $inserted contacts</b>';
$messages['importconfirmskipped'] = '<b>Skipped $skipped existing entries</b>';
+$messages['importmessagesuccess'] = 'Successfully imported $nr messages';
+$messages['importmessageerror'] = 'Import failed! The uploaded file is not a valid message or mailbox file';
$messages['opnotpermitted'] = 'Operation not permitted!';
$messages['nofromaddress'] = 'Missing e-mail address in selected identity.';
$messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?';
@@ -131,6 +146,7 @@ $messages['smtperror'] = 'SMTP Error: $msg';
$messages['emailformaterror'] = 'Incorrect e-mail address: $email';
$messages['toomanyrecipients'] = 'Too many recipients. Reduce the number of recipients to $max.';
$messages['maxgroupmembersreached'] = 'The number of group members exceeds the maximum of $max.';
+$messages['internalerror'] = 'An internal error occurred. Please try again.';
$messages['contactdelerror'] = 'Could not delete contact(s).';
$messages['contactdeleted'] = 'Contact(s) deleted successfully.';
$messages['contactrestoreerror'] = 'Could not restore deleted contact(s).';
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 840c9358c..61890a642 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -64,6 +64,7 @@ $labels['fromtoshort'] = '$from – $to of $count';
$labels['copy'] = 'Copy';
$labels['move'] = 'Move';
$labels['moveto'] = 'Move to...';
+$labels['copyto'] = 'Copy to...';
$labels['download'] = 'Download';
$labels['open'] = 'Open';
$labels['showattachment'] = 'Show';
@@ -232,6 +233,18 @@ $labels['checkspelling'] = 'Check spelling';
$labels['resumeediting'] = 'Resume editing';
$labels['revertto'] = 'Revert to';
+$labels['restore'] = 'Restore';
+$labels['restoremessage'] = 'Restore message?';
+
+$labels['responses'] = 'Responses';
+$labels['insertresponse'] = 'Insert a response';
+$labels['manageresponses'] = 'Manage responses';
+$labels['savenewresponse'] = 'Save new response';
+$labels['editresponses'] = 'Edit responses';
+$labels['editresponse'] = 'Edit response';
+$labels['responsename'] = 'Name';
+$labels['responsetext'] = 'Response Text';
+
$labels['attach'] = 'Attach';
$labels['attachments'] = 'Attachments';
$labels['upload'] = 'Upload';
@@ -484,6 +497,9 @@ $labels['standardwindows'] = 'Handle popups as standard windows';
$labels['forwardmode'] = 'Messages forwarding';
$labels['inline'] = 'inline';
$labels['asattachment'] = 'as attachment';
+$labels['replyallmode'] = 'Default action of [Reply all] button';
+$labels['replyalldefault'] = 'reply to all';
+$labels['replyalllist'] = 'reply to mailing list only (if found)';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folders';
diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc
index 9733109ad..ce8722812 100644
--- a/program/localization/en_US/messages.inc
+++ b/program/localization/en_US/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -34,7 +34,8 @@ $messages['invalidrequest'] = 'Invalid request! No data was saved.';
$messages['invalidhost'] = 'Invalid server name.';
$messages['nomessagesfound'] = 'No messages found in this mailbox.';
$messages['loggedout'] = 'You have successfully terminated the session. Good bye!';
-$messages['mailboxempty'] = 'Mailbox is empty.';
+$messages['mailboxempty'] = 'Mailbox is empty';
+$messages['nomessages'] = 'No messages';
$messages['refreshing'] = 'Refreshing...';
$messages['loading'] = 'Loading...';
$messages['uploading'] = 'Uploading file...';
@@ -46,6 +47,8 @@ $messages['messagesent'] = 'Message sent successfully.';
$messages['savingmessage'] = 'Saving message...';
$messages['messagesaved'] = 'Message saved to Drafts.';
$messages['successfullysaved'] = 'Successfully saved.';
+$messages['savingresponse'] = 'Saving response text...';
+$messages['deleteresponseconfirm'] = 'Do you really want to delete this response text?';
$messages['addedsuccessfully'] = 'Contact added successfully to address book.';
$messages['contactexists'] = 'A contact with the same e-mail address already exists.';
$messages['contactnameexists'] = 'A contact with the same name already exists.';
@@ -82,6 +85,7 @@ $messages['norecipientwarning'] = 'Please enter at least one recipient.';
$messages['nosubjectwarning'] = 'The "Subject" field is empty. Would you like to enter one now?';
$messages['nobodywarning'] = 'Send this message without text?';
$messages['notsentwarning'] = 'Message has not been sent. Do you want to discard your message?';
+$messages['restoresavedcomposedata'] = 'A previously composed but unsent message was found.\n\nSubject: $subject\nSaved: $date\n\nDo you want to restore this message?';
$messages['noldapserver'] = 'Please select an ldap server to search.';
$messages['nosearchname'] = 'Please enter a contact name or email address.';
$messages['notuploadedwarning'] = 'Not all attachments have been uploaded yet. Please wait or cancel the upload.';
diff --git a/program/localization/es_419/labels.inc b/program/localization/es_419/labels.inc
new file mode 100644
index 000000000..437295bf1
--- /dev/null
+++ b/program/localization/es_419/labels.inc
@@ -0,0 +1,423 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/labels.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
+*/
+$labels['welcome'] = 'Bienvenido a $product';
+$labels['username'] = 'Usuario';
+$labels['password'] = 'Contraseña';
+$labels['server'] = 'Servidor';
+$labels['login'] = 'Login';
+$labels['logout'] = 'Salir';
+$labels['mail'] = 'Correo';
+$labels['settings'] = 'Configuración';
+$labels['addressbook'] = 'Libreta de Direcciones';
+$labels['inbox'] = 'Bandeja de Entrada';
+$labels['drafts'] = 'Borradores';
+$labels['sent'] = 'Enviados';
+$labels['trash'] = 'Papelera';
+$labels['show_real_foldernames'] = 'Mostrar el nombre real para carpetas especiales';
+$labels['subject'] = 'Tema';
+$labels['from'] = 'De';
+$labels['sender'] = 'Remitente';
+$labels['to'] = 'Para';
+$labels['cc'] = 'Cc';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Responder-a';
+$labels['date'] = 'Fecha';
+$labels['size'] = 'Tamaño';
+$labels['priority'] = 'Prioridad';
+$labels['organization'] = 'Organización';
+$labels['readstatus'] = 'Leer estado';
+$labels['listoptions'] = 'Listar opciones';
+$labels['mailboxlist'] = 'Carpetas';
+$labels['messagesfromto'] = 'Mensajes $from a $to de $count';
+$labels['threadsfromto'] = 'Hilo $from hasta $to de $count';
+$labels['messagenrof'] = 'Mensaje $nr de $count';
+$labels['fromtoshort'] = '$from - $to de $count';
+$labels['copy'] = 'Copiar';
+$labels['move'] = 'Mover';
+$labels['moveto'] = 'Mover a...';
+$labels['download'] = 'Descargar';
+$labels['open'] = 'Abrir';
+$labels['showattachment'] = 'Mostrar';
+$labels['showanyway'] = 'Mostrar de todos modos';
+$labels['filename'] = 'Nombre del archivo';
+$labels['filesize'] = 'Tamaño del archivo';
+$labels['addtoaddressbook'] = 'Agregar a la libreta de direcciones';
+$labels['sun'] = 'Dom';
+$labels['mon'] = 'Lun';
+$labels['tue'] = 'Mar';
+$labels['wed'] = 'Mié';
+$labels['thu'] = 'Jue';
+$labels['fri'] = 'Vie';
+$labels['sat'] = 'Sáb';
+$labels['sunday'] = 'Domingo';
+$labels['monday'] = 'Lunes';
+$labels['tuesday'] = 'Martes';
+$labels['wednesday'] = 'Miércoles';
+$labels['thursday'] = 'Jueves';
+$labels['friday'] = 'Viernes';
+$labels['saturday'] = 'Sábado';
+$labels['jan'] = 'Ene';
+$labels['feb'] = 'Feb';
+$labels['mar'] = 'Mar';
+$labels['apr'] = 'Abr';
+$labels['may'] = 'May';
+$labels['jun'] = 'Jun';
+$labels['jul'] = 'Jul';
+$labels['aug'] = 'Ago';
+$labels['sep'] = 'Sep';
+$labels['oct'] = 'Oct';
+$labels['nov'] = 'Nov';
+$labels['dec'] = 'Dec';
+$labels['longjan'] = 'Enero';
+$labels['longfeb'] = 'Febrero';
+$labels['longmar'] = 'Marzo';
+$labels['longapr'] = 'Abril';
+$labels['longmay'] = 'Mayo';
+$labels['longjun'] = 'Junio';
+$labels['longjul'] = 'Julio';
+$labels['longaug'] = 'Agosto';
+$labels['longsep'] = 'Septiembre';
+$labels['longoct'] = 'Octubre';
+$labels['longnov'] = 'Noviembre';
+$labels['longdec'] = 'Diciembre';
+$labels['today'] = 'Hoy';
+$labels['refresh'] = 'Actualizar';
+$labels['checkmail'] = 'Revisar si hay nuevos mensajes';
+$labels['compose'] = 'Escribir';
+$labels['writenewmessage'] = 'Crear mensaje nuevo';
+$labels['reply'] = 'Responder';
+$labels['replytomessage'] = 'Responder a remitente';
+$labels['replytoallmessage'] = 'Responder a la lista o al remittente y todos los destinatarios';
+$labels['replyall'] = 'Responder a todos';
+$labels['replylist'] = 'Responder a la lista';
+$labels['forward'] = 'Re-enviar';
+$labels['forwardinline'] = 'Reenviar en linea';
+$labels['forwardattachment'] = 'Re-enviar como archivo adjunto';
+$labels['forwardmessage'] = 'Re-enviar el mensaje';
+$labels['deletemessage'] = 'Eliminar el mensaje';
+$labels['movemessagetotrash'] = 'Mover a la papelera';
+$labels['printmessage'] = 'Imprimir este mensaje';
+$labels['previousmessage'] = 'Mostrar mensaje anterior';
+$labels['firstmessage'] = 'Mostrar primer mensaje';
+$labels['nextmessage'] = 'Mostrar el siguiente mensaje ';
+$labels['lastmessage'] = 'Mostrar el último mensaje';
+$labels['backtolist'] = 'Volver a la lista de mensajes';
+$labels['viewsource'] = 'Mostrar fuente';
+$labels['mark'] = 'Marcar';
+$labels['markmessages'] = 'Macar mensajes';
+$labels['markread'] = 'Como leido';
+$labels['markunread'] = 'Como no leido';
+$labels['markflagged'] = 'Como marcado';
+$labels['markunflagged'] = 'Como no marcado';
+$labels['moreactions'] = 'Más acciones...';
+$labels['more'] = 'Más';
+$labels['back'] = 'Atrás';
+$labels['options'] = 'Opciones';
+$labels['select'] = 'Seleccionar';
+$labels['all'] = 'Todos';
+$labels['none'] = 'Ninguno';
+$labels['currpage'] = 'Página actual';
+$labels['unread'] = 'No leido';
+$labels['flagged'] = 'Marcado';
+$labels['unanswered'] = 'No respondido';
+$labels['withattachment'] = 'Con archivo adjunto';
+$labels['deleted'] = 'Eliminado';
+$labels['undeleted'] = 'No eliminado';
+$labels['invert'] = 'Invertir';
+$labels['filter'] = 'Filtrar';
+$labels['list'] = 'Enumerar';
+$labels['threads'] = 'Hilos';
+$labels['expand-all'] = 'Expandir todos';
+$labels['expand-unread'] = 'Espandir no leidos';
+$labels['collapse-all'] = 'Colapsar todos';
+$labels['threaded'] = 'En hilo';
+$labels['autoexpand_threads'] = 'Expandir hilos';
+$labels['do_expand'] = 'todos los hilos';
+$labels['expand_only_unread'] = 'solo con mensajes no leidos';
+$labels['fromto'] = 'De/Para';
+$labels['flag'] = 'Marcar';
+$labels['attachment'] = 'Archivo adjunto';
+$labels['nonesort'] = 'Ninguno';
+$labels['sentdate'] = 'Fecha de envío';
+$labels['arrival'] = 'Fecha de recepción';
+$labels['asc'] = 'ascendiente';
+$labels['desc'] = 'descendiente';
+$labels['listcolumns'] = 'Enumerar columnas';
+$labels['listsorting'] = 'Ordenar columnas';
+$labels['listorder'] = 'Ordenado por';
+$labels['folderactions'] = 'Acciones de carpeta';
+$labels['compact'] = 'Comprimir';
+$labels['empty'] = 'Vaciar';
+$labels['importmessages'] = 'Importar mensajes';
+$labels['quota'] = 'Uso de disco';
+$labels['unknown'] = 'desconocido';
+$labels['unlimited'] = 'ilimitado';
+$labels['quicksearch'] = 'Búsqueda rápida';
+$labels['searchmod'] = 'Modificadores de búsqueda';
+$labels['msgtext'] = 'Mensaje completo';
+$labels['body'] = 'Cuerpo';
+$labels['type'] = 'Tipo';
+$labels['namex'] = 'Nombre';
+$labels['openinextwin'] = 'Abrir en una ventana nueva';
+$labels['emlsave'] = 'Descargar (.eml)';
+$labels['changeformattext'] = 'Mostrar en texto plano';
+$labels['changeformathtml'] = 'Mostrar en formato HTML';
+$labels['editasnew'] = 'Editar como nuevo';
+$labels['send'] = 'Enviar';
+$labels['sendmessage'] = 'Enviar mensaje';
+$labels['savemessage'] = 'Guardar como borrador';
+$labels['addattachment'] = 'Adjuntar archivo';
+$labels['editortype'] = 'Tipo de editor';
+$labels['mailreplyintro'] = 'El $date, $sender escribió:';
+$labels['originalmessage'] = 'Mensaje Original';
+$labels['editidents'] = 'Editar identidades';
+$labels['resumeediting'] = 'Resumir edición';
+$labels['revertto'] = 'Revertir a';
+$labels['restore'] = 'Restaurar';
+$labels['restoremessage'] = '¿Restaurar mensaje?';
+$labels['responses'] = 'Respuestas';
+$labels['insertresponse'] = 'Insertar una respuesta';
+$labels['manageresponses'] = 'Administrar respuestas';
+$labels['savenewresponse'] = 'Guardar nueva respuesta';
+$labels['editresponses'] = 'Editar respuestas';
+$labels['editresponse'] = 'Editar respuesta';
+$labels['responsename'] = 'Nombre';
+$labels['attach'] = 'Adjuntar';
+$labels['attachments'] = 'Archivos adjuntos';
+$labels['uploadprogress'] = '$percent ($current de $total)';
+$labels['close'] = 'Cerrar';
+$labels['messageoptions'] = 'Opciones de mensaje';
+$labels['low'] = 'Bajo';
+$labels['lowest'] = 'Más bajo';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Alto';
+$labels['highest'] = 'Más alto';
+$labels['nosubject'] = '(sin título)';
+$labels['showimages'] = 'Mostrar imágenes';
+$labels['alwaysshow'] = 'Mostrar siempre las imagenes de $sender';
+$labels['isdraft'] = 'Este mensaje es un borrador.';
+$labels['andnmore'] = '$nr more...';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Texto plano';
+$labels['savesentmessagein'] = 'Guardar mensaje enviado en ';
+$labels['dontsave'] = 'No guardar';
+$labels['maxuploadsize'] = 'El tamaño máximo permitido por archivo es $size';
+$labels['addcc'] = 'Y Cc';
+$labels['addbcc'] = 'Y Bcc';
+$labels['addreplyto'] = 'Agregar Responder-a';
+$labels['mdnrequest'] = 'El remitente de este mensaje a pedido ser notificado cuando leas el mensaje. ¿Quieres notificar al remitente?';
+$labels['name'] = 'Nombre de pantalla';
+$labels['firstname'] = 'Primer nombre';
+$labels['surname'] = 'Apellido';
+$labels['middlename'] = 'Segundo Nombre';
+$labels['nameprefix'] = 'Prefijo';
+$labels['namesuffix'] = 'Sufijo';
+$labels['nickname'] = 'Sobrenombre';
+$labels['jobtitle'] = 'Puesto';
+$labels['department'] = 'Departamento';
+$labels['maidenname'] = 'Apellido de soltera';
+$labels['email'] = 'Email';
+$labels['phone'] = 'Teléfono';
+$labels['address'] = 'Dirección';
+$labels['street'] = 'Calle';
+$labels['locality'] = 'Ciudad';
+$labels['zipcode'] = 'Código Postal';
+$labels['region'] = 'Estado/Provincia';
+$labels['country'] = 'Pais';
+$labels['birthday'] = 'Cumpleaños';
+$labels['anniversary'] = 'Aniversario';
+$labels['website'] = 'Sitio Web';
+$labels['instantmessenger'] = 'IM';
+$labels['notes'] = 'Notas';
+$labels['male'] = 'masculino';
+$labels['female'] = 'femenino';
+$labels['manager'] = 'Administrador';
+$labels['assistant'] = 'Asistente';
+$labels['spouse'] = 'Conjuge';
+$labels['allfields'] = 'Todos los campos';
+$labels['search'] = 'Buscar';
+$labels['advsearch'] = 'Busqueda Avanzada';
+$labels['advanced'] = 'Avanzado';
+$labels['other'] = 'Otro';
+$labels['typehome'] = 'Casa';
+$labels['typework'] = 'Trabajo';
+$labels['typeother'] = 'Otro';
+$labels['typemobile'] = 'Móvil';
+$labels['typemain'] = 'Principal';
+$labels['typehomefax'] = 'Fax Casa';
+$labels['typeworkfax'] = 'Fax Oficina';
+$labels['typecar'] = 'Auto';
+$labels['typevideo'] = 'Video';
+$labels['typeassistant'] = 'Assistente';
+$labels['typehomepage'] = 'Página Web';
+$labels['typeblog'] = 'Blog';
+$labels['typeprofile'] = 'Perfil';
+$labels['addfield'] = 'Agregar campo...';
+$labels['addcontact'] = 'Agregar nuevo contacto';
+$labels['editcontact'] = 'Editar contacto';
+$labels['contacts'] = 'Contactos';
+$labels['contactproperties'] = 'Propiedades del contacto';
+$labels['personalinfo'] = 'Información Personal';
+$labels['edit'] = 'Editar';
+$labels['cancel'] = 'Cancelar';
+$labels['save'] = 'Guardar';
+$labels['delete'] = 'Eliminar';
+$labels['rename'] = 'Renombrar';
+$labels['addphoto'] = 'Agregar';
+$labels['replacephoto'] = 'Remplazar';
+$labels['uploadphoto'] = 'Subir foto';
+$labels['newcontact'] = 'Crear nueva tarjeta de contacto';
+$labels['deletecontact'] = 'Eliminar contactos seleccionados';
+$labels['composeto'] = 'Escribir mail a ';
+$labels['contactsfromto'] = 'Contactos $from hasta $to de $count';
+$labels['print'] = 'Imprimir';
+$labels['export'] = 'Exportar';
+$labels['exportall'] = 'Exportar todo';
+$labels['exportsel'] = 'Exportar los seleccionados';
+$labels['exportvcards'] = 'Exportar contactos en formato vCard';
+$labels['newcontactgroup'] = 'Crear grupo de contactos nuevo';
+$labels['grouprename'] = 'Renombrar grupo';
+$labels['groupdelete'] = 'Eliminar grupo';
+$labels['groupremoveselected'] = 'Eliminar contactos seleccionados del grupo';
+$labels['previouspage'] = 'Mostrar página anterior';
+$labels['firstpage'] = 'Mostrar primera página';
+$labels['nextpage'] = 'Mostrar página siguiente';
+$labels['lastpage'] = 'Mostrar última página';
+$labels['group'] = 'Grupo';
+$labels['groups'] = 'Grupos';
+$labels['listgroup'] = 'Mostrar miembros del grupo';
+$labels['personaladrbook'] = 'Direcciones personales';
+$labels['searchsave'] = 'Guardar búsqueda';
+$labels['searchdelete'] = 'Eliminar busqueda';
+$labels['import'] = 'Importar';
+$labels['importcontacts'] = 'Importar contactos';
+$labels['importfromfile'] = 'Importar desde archivo';
+$labels['importtarget'] = 'Agregar contactos a';
+$labels['importreplace'] = 'Remplazar la libreta de direcciones completa';
+$labels['importgroups'] = 'Importar tareas del grupo';
+$labels['importgroupsall'] = 'Todo (crear grupos si es necesario)';
+$labels['done'] = 'Listo';
+$labels['about'] = 'Sobre';
+$labels['preferences'] = 'Preferencias';
+$labels['userpreferences'] = 'Preferencias de usuario ';
+$labels['editpreferences'] = 'Editar preferencias de usuario ';
+$labels['identities'] = 'identidades';
+$labels['manageidentities'] = 'Administrar identidades para esta cuenta ';
+$labels['newidentity'] = 'Identidad nueva ';
+$labels['newitem'] = 'Elemento nuevo ';
+$labels['edititem'] = 'Editar elemento ';
+$labels['preferhtml'] = 'Mostrar HTML ';
+$labels['htmlmessage'] = 'Mensaje HTML ';
+$labels['digitalsig'] = 'Firma digital';
+$labels['dateformat'] = 'Formato de fecha';
+$labels['timeformat'] = 'Formato de hora';
+$labels['setdefault'] = 'Predeterminar';
+$labels['autodetect'] = 'Automático';
+$labels['language'] = 'Idioma';
+$labels['timezone'] = 'Zona horaria';
+$labels['pagesize'] = 'Columnas por página ';
+$labels['signature'] = 'Firma';
+$labels['showinextwin'] = 'Abrir mensaje en una ventana nueva ';
+$labels['composeextwin'] = 'Escribir en una ventana nueva ';
+$labels['htmleditor'] = 'Escribir mensajes HTML';
+$labels['htmlsignature'] = 'Firma HTML ';
+$labels['showemail'] = 'Mostrar dirección de email junto al nombre de pantalla';
+$labels['previewpane'] = 'Mostrar vista previa ';
+$labels['logoutclear'] = 'Vaciar la papelera al salir';
+$labels['logoutcompact'] = 'Comprimir la bandeja de entrada al salir';
+$labels['uisettings'] = 'Interfaz de usuario';
+$labels['ignore'] = 'ignorar';
+$labels['readwhendeleted'] = 'Marcar mensaje como leído al elimiarlo ';
+$labels['skipdeleted'] = 'No mostrar mensajes eliminados ';
+$labels['always'] = 'siempre ';
+$labels['showinlineimages'] = 'Mostrar imágenes adjuntas debajo del mensaje';
+$labels['autosavedraft'] = 'Guardar borrador automáticamente';
+$labels['everynminutes'] = 'cada $n minuto(s)';
+$labels['never'] = 'nunca';
+$labels['immediately'] = 'inmediatamente';
+$labels['messagesdisplaying'] = 'Mostrando mensajes';
+$labels['messagescomposition'] = 'Escribiendo mensajes';
+$labels['advancedoptions'] = 'Opciones avanzadas';
+$labels['mainoptions'] = 'Opciones Principales';
+$labels['browseroptions'] = 'Opciones del Navagador';
+$labels['section'] = 'Sección';
+$labels['maintenance'] = 'Mantenimiento';
+$labels['newmessage'] = 'Mensaje Nuevo';
+$labels['signatureoptions'] = 'Opciones de Firma';
+$labels['whenreplying'] = 'Al responder';
+$labels['replyempty'] = 'No citar el mensaje original ';
+$labels['replytopposting'] = 'comenzar mensaje nuevo arriba de la cita';
+$labels['replybottomposting'] = 'comenzar mensaje nuevo debajo de la cita';
+$labels['replyremovesignature'] = 'Al responder borrar la firma original del mensaje';
+$labels['autoaddsignature'] = 'Agregar firma automáticamente';
+$labels['newmessageonly'] = 'solo mensajes nuevos';
+$labels['insertsignature'] = 'insertar firma';
+$labels['spellcheckignoresyms'] = 'Ignorar palabras con símbolos';
+$labels['spellcheckignorenums'] = 'Ignorar palabras con números';
+$labels['addtodict'] = 'Agregar al diccionario';
+$labels['standardwindows'] = 'Tratar popups como ventanas comunes';
+$labels['asattachment'] = 'como adjunto';
+$labels['replyalldefault'] = 'responder a todos';
+$labels['folder'] = 'Carpeta';
+$labels['folders'] = 'Carpetas';
+$labels['foldername'] = 'Nombre de carpeta';
+$labels['messagecount'] = 'Mensajes';
+$labels['create'] = 'Crear';
+$labels['createfolder'] = 'Crear carpeta nueva';
+$labels['managefolders'] = 'Administrar carpetas';
+$labels['specialfolders'] = 'Capetas Especiales';
+$labels['properties'] = 'Propiedades';
+$labels['location'] = 'Ubicación';
+$labels['info'] = 'Información';
+$labels['getfoldersize'] = 'Click para ver el tamaño de la carpeta';
+$labels['changesubscription'] = 'Click para cambiar la subscripción';
+$labels['foldertype'] = 'Tipo de Carpeta';
+$labels['personalfolder'] = 'Carpeta Privada';
+$labels['otherfolder'] = 'Carpeta de otro usuario';
+$labels['sharedfolder'] = 'Carpeta pública';
+$labels['sortby'] = 'Ordenar por';
+$labels['sortasc'] = 'Ordenar ascendientemente';
+$labels['sortdesc'] = 'Ordenar descendientemente';
+$labels['undo'] = 'Deshacer';
+$labels['installedplugins'] = 'Extensiones instaladas';
+$labels['plugin'] = 'Extensión';
+$labels['version'] = 'Versión';
+$labels['source'] = 'Fuente';
+$labels['license'] = 'Licencia';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
+$labels['unicode'] = 'Unicode';
+$labels['english'] = 'Inglés';
+$labels['westerneuropean'] = 'Europeo Occidental';
+$labels['easterneuropean'] = 'Europeo Oriental';
+$labels['southeasterneuropean'] = 'Europeo Sur-Oriental';
+$labels['baltic'] = 'Baltico';
+$labels['arabic'] = 'Arabigo';
+$labels['greek'] = 'Griego';
+$labels['hebrew'] = 'Hebreo';
+$labels['turkish'] = 'Turko';
+$labels['nordic'] = 'Nordico';
+$labels['thai'] = 'Thai';
+$labels['celtic'] = 'Celta';
+$labels['vietnamese'] = 'Vietnamese';
+$labels['japanese'] = 'Japonés';
+$labels['korean'] = 'Koreano';
+$labels['chinese'] = 'Chino';
+?>
diff --git a/program/localization/fy_NL/messages.inc b/program/localization/es_419/messages.inc
index da4e39679..a22c53da8 100644
--- a/program/localization/fy_NL/messages.inc
+++ b/program/localization/es_419/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -15,4 +15,12 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
+$messages['errortitle'] = '¡Ha ocurrido un error!';
+$messages['loginfailed'] = 'Falló el Login';
+$messages['cookiesdisabled'] = 'Su navegador no acepta cookies.';
+$messages['sessionerror'] = 'Su sesión es inválida o ha expirado.';
+$messages['storageerror'] = 'Ha fallado la conexión al servidor de almacenamiento.';
+$messages['servererror'] = '¡Error del servidor!';
+$messages['servererrormsg'] = 'Error del servidor: $msg';
+$messages['dberror'] = 'Error en la base de datos';
?>
diff --git a/program/localization/es_ES/labels.inc b/program/localization/es_ES/labels.inc
index 66fcafd0b..ba17a4dff 100644
--- a/program/localization/es_ES/labels.inc
+++ b/program/localization/es_ES/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to de $count';
$labels['copy'] = 'Copiar';
$labels['move'] = 'Mover';
$labels['moveto'] = 'Mover a…';
+$labels['copyto'] = 'Copiar a...';
$labels['download'] = 'Descargar';
$labels['open'] = 'Abrir';
$labels['showattachment'] = 'Mostrar';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Corrector ortográfico';
$labels['checkspelling'] = 'Revisar ortografía';
$labels['resumeediting'] = 'Continuar edición';
$labels['revertto'] = 'Revertir a';
+$labels['restore'] = 'Restaurar';
+$labels['restoremessage'] = '¿Restaurar el mensaje?';
+$labels['responses'] = 'Respuestas';
+$labels['insertresponse'] = 'Insertar una respuesta';
+$labels['manageresponses'] = 'Gestionar respuestas';
+$labels['savenewresponse'] = 'Guardar nueva respuesta';
+$labels['editresponses'] = 'Editar respuestas';
+$labels['editresponse'] = 'Editar respuesta';
+$labels['responsename'] = 'Nombre';
+$labels['responsetext'] = 'Texto de respuesta';
$labels['attach'] = 'Adjuntar';
$labels['attachments'] = 'Adjuntos';
$labels['upload'] = 'Subir';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Gestionar ventanas emergentes como ventanas están
$labels['forwardmode'] = 'Reenvío de mensajes';
$labels['inline'] = 'en línea';
$labels['asattachment'] = 'como adjunto';
+$labels['replyallmode'] = 'Acción predeterminada del botón [Responder a todos]';
+$labels['replyalldefault'] = 'responder a todos';
+$labels['replyalllist'] = 'responder sólo a la lista de correo (si se encuentra)';
$labels['folder'] = 'Bandeja';
$labels['folders'] = 'Carpetas';
$labels['foldername'] = 'Nombre de bandeja';
diff --git a/program/localization/es_ES/messages.inc b/program/localization/es_ES/messages.inc
index 3a8b5ab31..53a136b0f 100644
--- a/program/localization/es_ES/messages.inc
+++ b/program/localization/es_ES/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = '¡Petición no válida! No se han guardado los da
$messages['invalidhost'] = 'Nombre de servidor inválido.';
$messages['nomessagesfound'] = 'No se han encontrado mensajes en esta casilla.';
$messages['loggedout'] = 'Ha cerrado bien la sesión. ¡Hasta pronto!';
-$messages['mailboxempty'] = 'La casilla está vacía.';
+$messages['mailboxempty'] = 'El buzón está vacío';
+$messages['nomessages'] = 'No hay mensajes';
$messages['refreshing'] = 'Actualizando…';
$messages['loading'] = 'Cargando...';
$messages['uploading'] = 'Subiendo archivo...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Mensaje enviado correctamente.';
$messages['savingmessage'] = 'Guardando mensaje...';
$messages['messagesaved'] = 'Mensaje guardado en borradores.';
$messages['successfullysaved'] = 'Guardado correctamente.';
+$messages['savingresponse'] = 'Guardando texto de respuesta...';
+$messages['deleteresponseconfirm'] = '¿Realmente quieres borrar este texto de respuesta?';
$messages['addedsuccessfully'] = 'Contacto añadido correctamente a la libreta de direcciones.';
$messages['contactexists'] = 'Ya existe un contacto con esta dirección de correo.';
$messages['contactnameexists'] = 'Ya existe un contacto con el mismo nombre.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'El contacto solicitado no existe.';
$messages['contactsearchonly'] = 'Ingrese algún criterio para buscar contactos';
$messages['sendingfailed'] = 'Error al enviar mensaje.';
$messages['senttooquickly'] = 'Por favor, espere $sec segundo(s) antes de mandar este mensaje.';
+$messages['errorsavingsent'] = 'Ha ocurrido un error al guardar el mensaje enviado.';
+$messages['errorsaving'] = 'Ha ocurrido un error al guardar.';
$messages['errormoving'] = 'No se ha podido mover el/los mensaje(s).';
$messages['errorcopying'] = 'No se ha podido copiar el/los mensaje(s).';
$messages['errordeleting'] = 'No se ha podido eliminar el/los mensaje(s).';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Por favor, introduzca al menos un destinatari
$messages['nosubjectwarning'] = 'El campo "Asunto" está vacío. ¿Desea completarlo en este momento?';
$messages['nobodywarning'] = '¿Quiere enviar este mensaje sin texto?';
$messages['notsentwarning'] = 'El mensaje no ha sido enviado. ¿Desea descartar su mensaje?';
+$messages['restoresavedcomposedata'] = 'Se ha encontrado un mensaje redactado previamente y no enviado.\n\nAsunto: $subject\nGuardado: $date\n\n¿Desea restaurar este mensaje?';
$messages['noldapserver'] = 'Por favor, seleccione un servidor LDAP para buscar.';
$messages['nosearchname'] = 'Por favor, introduzca un nombre o la dirección de e-mail.';
$messages['notuploadedwarning'] = 'No se han subido aún todos los adjuntos. Por favor espere o cancele la subida.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'Error SMTP: $msg';
$messages['emailformaterror'] = 'Dirección e-mail incorrecta: $email';
$messages['toomanyrecipients'] = 'Hay demasiados destinatarios. Reduzca el número de destinatarios a $max.';
$messages['maxgroupmembersreached'] = 'El número de miembros del grupo excede el máximo de $max.';
+$messages['internalerror'] = 'Ha ocurrido un error interno. Por favor, inténtelo de nuevo.';
$messages['contactdelerror'] = 'No se ha podido eliminar el/los contacto(s).';
$messages['contactdeleted'] = 'Contacto(s) eliminado(s) correctamente.';
$messages['contactrestoreerror'] = 'No se han podido restaurar los contactos borrados.';
diff --git a/program/localization/eu_ES/labels.inc b/program/localization/eu_ES/labels.inc
index bbfd0c6ac..8bf6e2fef 100644
--- a/program/localization/eu_ES/labels.inc
+++ b/program/localization/eu_ES/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to , guztira $count';
$labels['copy'] = 'Kopia';
$labels['move'] = 'Mugitu';
$labels['moveto'] = 'mugitu hona...';
+$labels['copyto'] = 'Kopiatu hona...';
$labels['download'] = 'deskargatu';
$labels['open'] = 'Ireki';
$labels['showattachment'] = 'Erakutsi';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Ortografia-egiaztatu';
$labels['checkspelling'] = 'Egiaztaketa ortografikoa';
$labels['resumeediting'] = 'Editatzen jarraitu';
$labels['revertto'] = 'Itzuli hona';
+$labels['restore'] = 'Berrezarri';
+$labels['restoremessage'] = 'Leheneratu mezua?';
+$labels['responses'] = 'Erantzunak';
+$labels['insertresponse'] = 'Txertatu erantzun bat';
+$labels['manageresponses'] = 'Kudeatu erantzunak';
+$labels['savenewresponse'] = 'Gorde erantzun berria';
+$labels['editresponses'] = 'Editatu erantzunak';
+$labels['editresponse'] = 'Editatu erantzuna';
+$labels['responsename'] = 'Izena';
+$labels['responsetext'] = 'Erantzun testua';
$labels['attach'] = 'Erantsi';
$labels['attachments'] = 'Eranskinak';
$labels['upload'] = 'Igo';
@@ -316,7 +327,11 @@ $labels['searchdelete'] = 'Ezabatu bilaketa';
$labels['import'] = 'Inportatu';
$labels['importcontacts'] = 'Inportatu kontaktoak';
$labels['importfromfile'] = 'Inportatu fitxategi honetatik:';
+$labels['importtarget'] = 'Gehitu kontaktuak hona:';
$labels['importreplace'] = 'Ordezkatu helbide-liburu osoa';
+$labels['importgroups'] = 'Inportatu talde-esleipenak';
+$labels['importgroupsall'] = 'Dena (sortu taldeak behar izatekotan)';
+$labels['importgroupsexisting'] = 'Existitzen diren taldeentzat soilik';
$labels['importdesc'] = 'Gehitzen ahal duzu kontaktuak dagoen helbide-liburu batetik.<br/>Inportatzeko onartzen diren formatuak: <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> eta CSV (komaz banandutakoak).';
$labels['done'] = 'Egina';
$labels['settingsfor'] = 'Honen ezarpenak:';
@@ -425,6 +440,9 @@ $labels['standardwindows'] = 'Tratatu laster-leihoak leiho estandar bezala';
$labels['forwardmode'] = 'Mezuak birbidaltzen';
$labels['inline'] = 'Konektatua';
$labels['asattachment'] = 'eranskin moduan';
+$labels['replyallmode'] = '[Erantzun denei] botoiaren lehenetsitako ekintza';
+$labels['replyalldefault'] = 'erantzun denei';
+$labels['replyalllist'] = 'erantzun posta zerrendara soilik (aurkitzekotan)';
$labels['folder'] = 'Karpeta';
$labels['folders'] = 'Karpetak';
$labels['foldername'] = 'Karpeta izena';
diff --git a/program/localization/eu_ES/messages.inc b/program/localization/eu_ES/messages.inc
index 7d2025804..2352be1f0 100644
--- a/program/localization/eu_ES/messages.inc
+++ b/program/localization/eu_ES/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,6 @@ $messages['invalidrequest'] = 'Eskaera ez da baliozkoa! Datuak ez dira gorde.';
$messages['invalidhost'] = 'Zerbitzari-izena ez da baliozkoa.';
$messages['nomessagesfound'] = 'Ez da mezurik aurkitu posta kutxa honetan';
$messages['loggedout'] = 'Saioa behar bezala amaitu duzu. Agur!';
-$messages['mailboxempty'] = 'Posta kutxa hutsik dago';
$messages['refreshing'] = 'Freskatzen...';
$messages['loading'] = 'Kargatzen...';
$messages['uploading'] = 'Fitxategia kargatzen...';
@@ -44,6 +43,8 @@ $messages['messagesent'] = 'Mezua behar bezala bidali da';
$messages['savingmessage'] = 'Mezua gordetzen...';
$messages['messagesaved'] = 'Mezua zirriborroetan gordea';
$messages['successfullysaved'] = 'Behar bezala gorde da';
+$messages['savingresponse'] = 'Erantzun-testua gordetzen...';
+$messages['deleteresponseconfirm'] = 'Seguru zaude erantzun-testu hau ezabatu nahi duzula?';
$messages['addedsuccessfully'] = 'Txartela behar bezala gehitu da helbide liburura';
$messages['contactexists'] = 'ePosta honetako txartel bat badago dagoeneko';
$messages['contactnameexists'] = 'Lehendik badago izen hori duen kontaktua.';
@@ -54,6 +55,8 @@ $messages['contactnotfound'] = 'Eskatutako txartela ez da aurkitu';
$messages['contactsearchonly'] = 'Sartu kontaktua aurkitzeko bilaketa daturen bat.';
$messages['sendingfailed'] = 'Huts mezua bidaltzerakoan';
$messages['senttooquickly'] = 'Itxaron $sec segundo mezua bidali aurretik, mesedez.';
+$messages['errorsavingsent'] = 'Errore bat gertatu da bidalitako mezua gordetzean.';
+$messages['errorsaving'] = 'Errore bat gertatu da gordetzean.';
$messages['errormoving'] = 'Ezin da mezua mugitu';
$messages['errorcopying'] = 'Ezin d(ir)a kopiatu mezua(k).';
$messages['errordeleting'] = 'Ezin da mezua ezabatu';
@@ -78,6 +81,7 @@ $messages['norecipientwarning'] = 'Mesedez behintzat hartzaile bat idatzi';
$messages['nosubjectwarning'] = '"Gaia" eremua hutsik dago. Bat idatzi nahi al duzu?';
$messages['nobodywarning'] = 'Testu gabeko mezu hau bidali?';
$messages['notsentwarning'] = 'Mezua ez da bidali. Mezua ezeztatu nahi al duzu?';
+$messages['restoresavedcomposedata'] = 'Lehendik idatzitako baina bidali gabeko mezu bat aurkitu da.\n\nGaia:$subject\nGordeta:$date\n\nBerreskuratu nahi duzu mezu hau?';
$messages['noldapserver'] = 'Mesedez hautatu bilaketa egiteko LDAP zerbitzari bat';
$messages['nosearchname'] = 'Mesedez idatzi kontaktu izen bat edo eposta helbide bat';
$messages['notuploadedwarning'] = 'Oraindik ez dira kargatu eranskin guztiak. Itxaron edo ezeztatu karga.';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'SMTP errorea: $msg';
$messages['emailformaterror'] = 'Helbide elektronikoa ez da baliozkoa: $email';
$messages['toomanyrecipients'] = 'Hartzaile gehiegi. Txikitu hartzaile kopura hona $max.';
$messages['maxgroupmembersreached'] = 'Taldeko partaideen kopurua $max -ko maximoa gainditzen du:';
+$messages['internalerror'] = 'Barne akatsa. Saiatu berriz, mesedez.';
$messages['contactdelerror'] = 'Ezin d(ir)a kontaktua(k) ezabatu.';
$messages['contactdeleted'] = 'Kontaktua(k) ongi ezabatu dira.';
$messages['contactrestoreerror'] = 'Ezin d(ir)a ezabatutako kontaktua(k) leheneratu.';
diff --git a/program/localization/fa_IR/labels.inc b/program/localization/fa_IR/labels.inc
index de23577a0..801e0ec5c 100644
--- a/program/localization/fa_IR/labels.inc
+++ b/program/localization/fa_IR/labels.inc
@@ -18,16 +18,16 @@
$labels['welcome'] = 'به $product خوش آمدید';
$labels['username'] = 'نام کاربری';
$labels['password'] = 'گذرواژه';
-$labels['server'] = 'سرویس‌دهنده';
+$labels['server'] = 'سرور';
$labels['login'] = 'ورود';
-$labels['logout'] = 'برون‌رÙت';
-$labels['mail'] = 'پست';
+$labels['logout'] = 'خروج';
+$labels['mail'] = 'نامه';
$labels['settings'] = 'تنظیمات';
$labels['addressbook'] = 'دÙتر نشانی';
$labels['inbox'] = 'صندوق ورودی';
$labels['drafts'] = 'پیش‌نویس‌ها';
$labels['sent'] = 'Ùرستاده شده';
-$labels['trash'] = 'حذ٠شده‌ها';
+$labels['trash'] = 'زباله‌دان';
$labels['junk'] = 'بنجل';
$labels['show_real_foldernames'] = 'نمایش نام واقعی برای پوشه‌های ویژه';
$labels['subject'] = 'موضوع';
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to از $count';
$labels['copy'] = 'رونوشت';
$labels['move'] = 'انتقال';
$labels['moveto'] = 'انتقال به...';
+$labels['copyto'] = 'رونوشت به...';
$labels['download'] = 'بارگیری';
$labels['open'] = 'باز کردن';
$labels['showattachment'] = 'نمایش';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'املاء';
$labels['checkspelling'] = 'بررسی املایی';
$labels['resumeediting'] = 'ادامه‌ی ویرایش';
$labels['revertto'] = 'برگرداندن به';
+$labels['restore'] = 'بازیابی';
+$labels['restoremessage'] = 'بازیابی پیغام؟';
+$labels['responses'] = 'پاسخ‌ها';
+$labels['insertresponse'] = 'درج پاسخ';
+$labels['manageresponses'] = 'مدیریت پاسخ‌ها';
+$labels['savenewresponse'] = 'ذخیره پاسخ جدید';
+$labels['editresponses'] = 'ویرایش پاسخ‌ها';
+$labels['editresponse'] = 'ویرایش پاسخ';
+$labels['responsename'] = 'نام';
+$labels['responsetext'] = 'متن پاسخ';
$labels['attach'] = 'پیوست کردن';
$labels['attachments'] = 'پیوست‌ها';
$labels['upload'] = 'بارگذاری';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'بکار بردن پاپ‌آپ‌ها به صور
$labels['forwardmode'] = 'بازگردانی پیغام';
$labels['inline'] = 'خطی';
$labels['asattachment'] = 'به عنوان پیوست';
+$labels['replyallmode'] = 'عمل پیش‌Ùرض برای دکمه [پاسخ به همه]';
+$labels['replyalldefault'] = 'پاسخ به همه';
+$labels['replyalllist'] = 'پاسخ به Ùقط لیست پستی (در صورت یاÙتن)';
$labels['folder'] = 'پوشه';
$labels['folders'] = 'پوشه‌ها';
$labels['foldername'] = 'نام پوشه';
diff --git a/program/localization/fa_IR/messages.inc b/program/localization/fa_IR/messages.inc
index 43f5a6c2a..e5d5667cf 100644
--- a/program/localization/fa_IR/messages.inc
+++ b/program/localization/fa_IR/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -22,7 +22,7 @@ $messages['sessionerror'] = 'نشست شما معتبر نیست، یا منقض
$messages['storageerror'] = 'اتصال به سرور مخزن ناموÙÙ‚ بود.';
$messages['servererror'] = 'خطای سرور!';
$messages['servererrormsg'] = 'خطای سرور: $msg';
-$messages['dberror'] = 'خطای پایگاه داده';
+$messages['dberror'] = 'خطای پایگاه داده!';
$messages['requesttimedout'] = 'زمان درخواست تمام شد';
$messages['errorreadonly'] = ' عمل مورد نظر انجام نشد. پوشه Ùقط خواندنی است.';
$messages['errornoperm'] = ' عمل مورد نظر انجام نشد. دسترسی وجود ندارد.';
@@ -32,28 +32,33 @@ $messages['invalidrequest'] = 'درخواست نامعتبر! هیچ داده‌
$messages['invalidhost'] = 'نام سرور غیرمعتبر.';
$messages['nomessagesfound'] = 'هیچ پیغامی در این صندوق‌پستی پیدا نشد.';
$messages['loggedout'] = 'شما با موÙقیت نشست را پایان دادید. خدانگهدار!';
-$messages['mailboxempty'] = 'صندوق‌پستی خالی است.';
+$messages['mailboxempty'] = 'صندوق پستی خالی است';
+$messages['nomessages'] = 'بدون پیغام';
$messages['refreshing'] = 'نوسازی...';
-$messages['loading'] = 'در حال بارگذاری...';
+$messages['loading'] = 'بارگذاری...';
$messages['uploading'] = 'بارگذاری پرونده...';
-$messages['uploadingmany'] = 'بارگذاری پرونده ها...';
-$messages['loadingdata'] = 'در حال بارگذاری داده‌ها...';
-$messages['checkingmail'] = 'بررسی برای پیغام جدید...';
-$messages['sendingmessage'] = 'در حال ارسال پیغام...';
+$messages['uploadingmany'] = 'بارگذاری پرونده‌ها...';
+$messages['loadingdata'] = 'بارگذاری داده‌ها...';
+$messages['checkingmail'] = 'بررسی برای پیغام‌های جدید...';
+$messages['sendingmessage'] = 'ارسال پیغام...';
$messages['messagesent'] = 'پیغام با موÙقیت Ùرستاده شد.';
-$messages['savingmessage'] = 'درحال ذخیره‌ی پیغام...';
-$messages['messagesaved'] = 'پیغام در پیش‌نویس‌ها ذخیره شد';
+$messages['savingmessage'] = 'ذخیره‌ی پیغام...';
+$messages['messagesaved'] = 'پیغام در پیش‌نویس‌ها ذخیره شد.';
$messages['successfullysaved'] = 'با موÙقیت ذخیره شد.';
+$messages['savingresponse'] = 'ذخیره متن پاسخ...';
+$messages['deleteresponseconfirm'] = 'آیا واقعا می‌خواهید این متن پاسخ را حذ٠نمایید؟';
$messages['addedsuccessfully'] = 'مخاطب با موÙقیت به دÙتر نشانی‌ها اضاÙÙ‡ شد.';
-$messages['contactexists'] = 'یک مخاطب با این ایمیل از قبل وجود دارد.';
-$messages['contactnameexists'] = 'یک مخاطب با این نام از قبل وجود دارد.';
-$messages['blockedimages'] = 'برای Ø­Ùاظت از حریم شخصی شما، عکس‌های با آدرس خارجی در این پیغام مسدود شده‌اند.';
-$messages['encryptedmessage'] = '!این یک پیغام رمزنگاری شده است و قابل نمایش نیست. ببخشید';
-$messages['nocontactsfound'] = 'هیج مخاطبی پیدا نشد.';
+$messages['contactexists'] = 'هم اکنون یک مخاطب با ایمیل یکسان وجود دارد.';
+$messages['contactnameexists'] = 'در حال حاضر مخاطبی با نام یکسان وجود دارد.';
+$messages['blockedimages'] = 'برای Ø­Ùاظت از حریم شخصی شما، عکس‌های خارجی در این پیغام مسدود شده‌اند.';
+$messages['encryptedmessage'] = 'این یک پیغام رمزنگاری شده است و قابل نمایش نیست. با عرض پوزش!';
+$messages['nocontactsfound'] = 'مخاطبی پیدا نشد.';
$messages['contactnotfound'] = 'مخاطب درخواست شده پیدا نشد.';
-$messages['contactsearchonly'] = 'برای یاÙتن مخاطب عبارتی را جستجو کنید';
+$messages['contactsearchonly'] = 'برای یاÙتن مخاطب‌ها، عبارت جستجو را وارد کنید';
$messages['sendingfailed'] = 'ارسال پیغام ناموÙÙ‚ بود.';
$messages['senttooquickly'] = 'لطÙا قبل از ارسال این پیغام $sec ثانیه صبر کنید.';
+$messages['errorsavingsent'] = 'خطایی رخ داده است پیام ارسالی ذخیره می گردد.';
+$messages['errorsaving'] = 'خطایی در ذخیره کردن رخ داده است.';
$messages['errormoving'] = 'پیغام(ها) منتقل نشدند.';
$messages['errorcopying'] = 'پیغام(ها) کپی نشدند.';
$messages['errordeleting'] = 'پیغام(ها) حذ٠نشدند.';
@@ -78,6 +83,8 @@ $messages['norecipientwarning'] = 'لطÙاً حداقل یک گیرنده واØ
$messages['nosubjectwarning'] = 'قسمت "موضوع" خالی است. می‌خواهید اکنون وارد کنید؟';
$messages['nobodywarning'] = 'این پیغام بدون متن ارسال شود؟';
$messages['notsentwarning'] = 'پیغام ارسال نشده است. آیا می‌خواهید پیغام را از بین ببرید؟';
+$messages['restoresavedcomposedata'] = 'نامه قبلا نوشته Ùˆ Ù†Ùرستاده یاÙت شد.\n\nموضوع: $subject\n
+ذخیره شده: $date\n\nآیا می‌خواهید این پیغام را بازیابی نمایید؟';
$messages['noldapserver'] = 'لطÙا یک سرور LDAP برای جست‌و‌جو انتخاب کنید.';
$messages['nosearchname'] = 'لطÙا نام یک مخاطب یا یک نشانی ایمیل وارد کنید.';
$messages['notuploadedwarning'] = 'همه پیوست ها هنوز بارگذاری نشده‌اند. لطÙا صبر کرده یا بارگذاری را لغو کنید.';
@@ -140,6 +147,7 @@ $messages['smtperror'] = 'خطای SMTP: $msg';
$messages['emailformaterror'] = 'پست الکترونیکی نامعتبر: $email';
$messages['toomanyrecipients'] = 'گیرنده‌های بیش از اندازه: تعداد گیرنده ها را به $max کاهش دهید.';
$messages['maxgroupmembersreached'] = 'تعداد اعضای گروه بیشتر از $max است.';
+$messages['internalerror'] = 'یک خطای داخلی رخ داده است. لطÙا دوباره سعی کنید.';
$messages['contactdelerror'] = 'حذ٠مخاطب(ها) انجام شد.';
$messages['contactdeleted'] = 'مخاطب(ها) با موÙقیت حذ٠شدند.';
$messages['contactrestoreerror'] = 'مخاطب(های) حذ٠شده بازگردانی نخواهند شد.';
diff --git a/program/localization/fi_FI/labels.inc b/program/localization/fi_FI/labels.inc
index 8a9064028..f9d6e5481 100644
--- a/program/localization/fi_FI/labels.inc
+++ b/program/localization/fi_FI/labels.inc
@@ -29,6 +29,7 @@ $labels['drafts'] = 'Luonnokset';
$labels['sent'] = 'Lähetetyt';
$labels['trash'] = 'Roskakori';
$labels['junk'] = 'Roskaposti';
+$labels['show_real_foldernames'] = 'Näytä erikoiskansioiden oikeat nimet';
$labels['subject'] = 'Aihe';
$labels['from'] = 'Lähettäjä';
$labels['sender'] = 'Lähettäjä';
@@ -51,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to (yhteensä $count)';
$labels['copy'] = 'Kopioi';
$labels['move'] = 'Siirrä';
$labels['moveto'] = 'siirrä kansioon...';
+$labels['copyto'] = 'Kopioi...';
$labels['download'] = 'lataa';
$labels['open'] = 'Avaa';
$labels['showattachment'] = 'Näytä';
@@ -196,6 +198,15 @@ $labels['spellcheck'] = 'Oikeinkirjoitus';
$labels['checkspelling'] = 'Tarkista oikeinkirjoitus';
$labels['resumeediting'] = 'Jatka muokkausta';
$labels['revertto'] = 'Muuta takaisin';
+$labels['restore'] = 'Palauta';
+$labels['restoremessage'] = 'Palautetaanko viesti?';
+$labels['responses'] = 'Vastaukset';
+$labels['manageresponses'] = 'Hallitse vastauksia';
+$labels['savenewresponse'] = 'Tallenna uusi vastaus';
+$labels['editresponses'] = 'Muokkaa vastauksia';
+$labels['editresponse'] = 'Muokkaa vastausta';
+$labels['responsename'] = 'Nimi';
+$labels['responsetext'] = 'Vastausteksti';
$labels['attach'] = 'Liitä';
$labels['attachments'] = 'Liitetiedostot';
$labels['upload'] = 'Lisää';
@@ -207,7 +218,7 @@ $labels['lowest'] = 'Matalin';
$labels['normal'] = 'Normaali';
$labels['high'] = 'Korkea';
$labels['highest'] = 'Korkein';
-$labels['nosubject'] = '(ei otsikkoa)';
+$labels['nosubject'] = '(ei aihetta)';
$labels['showimages'] = 'Näytä kuvat';
$labels['alwaysshow'] = 'Näytä aina lähettäjältä $sender saapuneet kuvat';
$labels['isdraft'] = 'Tämä on luonnosviesti.';
@@ -315,6 +326,7 @@ $labels['import'] = 'Tuo';
$labels['importcontacts'] = 'Tuo yhteystiedot';
$labels['importfromfile'] = 'Tuo tiedostosta:';
$labels['importreplace'] = 'Korvaa koko osoitekirja';
+$labels['importgroupsall'] = 'Kaikki (luo ryhmät tarvittaessa)';
$labels['importdesc'] = 'Voit tuoda yhteystietoja olemassa olevasta osoitekirjasta.<br/>Tuettuja muotoja ovat <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> ja CSV (pilkuin erotetut arvot).';
$labels['done'] = 'Valmis';
$labels['settingsfor'] = 'Asetukset';
@@ -420,6 +432,9 @@ $labels['mailtoprotohandler'] = 'Rekisteröi mailto:-linkkien protokollakäsitte
$labels['standardwindows'] = 'Käsittele popup-ikkunoita tavallisina ikkunoina';
$labels['forwardmode'] = 'Viestin välitys';
$labels['asattachment'] = 'liitteenä';
+$labels['replyallmode'] = 'Oletustoiminto [Vastaa kaikille]-painikkeelle';
+$labels['replyalldefault'] = 'vastaa kaikille';
+$labels['replyalllist'] = 'vastaa pelkälle postituslistalle (jos havaittu)';
$labels['folder'] = 'Kansio';
$labels['folders'] = 'Kansiot';
$labels['foldername'] = 'Kansion nimi';
diff --git a/program/localization/fi_FI/messages.inc b/program/localization/fi_FI/messages.inc
index 1b3c3ea49..77a165860 100644
--- a/program/localization/fi_FI/messages.inc
+++ b/program/localization/fi_FI/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Virheellinen pyyntö! Tietoa ei tallennettu.';
$messages['invalidhost'] = 'Virheellinen palvelinnimi.';
$messages['nomessagesfound'] = 'Kansiossa ei ole sähköpostiviestejä';
$messages['loggedout'] = 'Sinut on kirjattu ulos järjestelmästä.';
-$messages['mailboxempty'] = 'Kansio on tyhjä';
+$messages['mailboxempty'] = 'Postilaatikko on tyhjä';
+$messages['nomessages'] = 'Ei viestejä';
$messages['refreshing'] = 'Päivitetään...';
$messages['loading'] = 'Ladataan...';
$messages['uploading'] = 'Ladataan tiedostoa palvelimelle...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Viesti lähetetty';
$messages['savingmessage'] = 'Tallennetaan viestiä...';
$messages['messagesaved'] = 'Viesti tallennettu "Luonnokset"-kansioon';
$messages['successfullysaved'] = 'Tallennus onnistui';
+$messages['savingresponse'] = 'Tallennetaan vastaustekstiä...';
+$messages['deleteresponseconfirm'] = 'Haluatko varmasti poistaa tämän vastaustekstin?';
$messages['addedsuccessfully'] = 'Yhteystieto lisätty osoitekirjaan';
$messages['contactexists'] = 'Samalla sähköpostiosoitteella on jo olemassa yhteystieto';
$messages['contactnameexists'] = 'Yhteystieto samalla nimellä on jo olemassa';
@@ -77,9 +80,10 @@ $messages['nonamewarning'] = 'Anna nimi';
$messages['nopagesizewarning'] = 'Anna sivukoko';
$messages['nosenderwarning'] = 'Anna lähettäjän sähköpostiosoite';
$messages['norecipientwarning'] = 'Anna ainakin yksi vastaanottaja';
-$messages['nosubjectwarning'] = '"Otsikko"-kenttä on tyhjä. Haluatko kirjoittaa viestillesi otsikon?';
+$messages['nosubjectwarning'] = '"Aihe"-kenttä on tyhjä. Haluatko kirjoittaa viestillesi aiheen?';
$messages['nobodywarning'] = 'Lähetetäänkö viesti ilman tekstiä?';
$messages['notsentwarning'] = 'Viestiä ei lähetetty. Haluatko poistaa viestin?';
+$messages['restoresavedcomposedata'] = 'Löydettiin aiemmin luotu, mutta lähettämätön viesti.\n\nAihe: $subject\nTallennettu: $date\n\nHaluatko palauttaa tämän viestin?';
$messages['noldapserver'] = 'Valitse LDAP-palvelin';
$messages['nosearchname'] = 'Anna yhteystiedon nimi tai sähköpostiosoite';
$messages['notuploadedwarning'] = 'Kaikkia liitteitä ei ole vielä ladattu palvelimelle. Odota tai peruuta lataus.';
diff --git a/program/localization/fo_FO/labels.inc b/program/localization/fo_FO/labels.inc
new file mode 100644
index 000000000..5ac452adb
--- /dev/null
+++ b/program/localization/fo_FO/labels.inc
@@ -0,0 +1,394 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/labels.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
+*/
+$labels['welcome'] = 'Vælkomin til $product';
+$labels['username'] = 'Brúkaranavn';
+$labels['password'] = 'Loyniorð';
+$labels['server'] = 'Ambætari';
+$labels['login'] = 'Rita inn';
+$labels['logout'] = 'Rita út';
+$labels['mail'] = 'Teldupostur';
+$labels['settings'] = 'Stillingar';
+$labels['addressbook'] = 'Búðstaðarsavn';
+$labels['inbox'] = 'Postur';
+$labels['drafts'] = 'Skitsur';
+$labels['sent'] = 'Sent';
+$labels['trash'] = 'Skrell';
+$labels['junk'] = 'Møsn';
+$labels['subject'] = 'Evni';
+$labels['from'] = 'Frá';
+$labels['sender'] = 'Sendari';
+$labels['to'] = 'Til';
+$labels['cc'] = 'Cc';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Svara-til';
+$labels['followupto'] = 'Fylg við-til';
+$labels['date'] = 'Dato';
+$labels['size'] = 'Stødd';
+$labels['priority'] = 'Raðfesting';
+$labels['organization'] = 'Fyritøka';
+$labels['readstatus'] = 'Les støðu';
+$labels['listoptions'] = 'Lýs valmøguleikar...';
+$labels['mailboxlist'] = 'Mappur';
+$labels['messagesfromto'] = 'Boðini frá $from til $to ið eru $count';
+$labels['threadsfromto'] = 'Tráðirnir frá $from til $to ið eru $count';
+$labels['messagenrof'] = 'Boðini ið eru $count';
+$labels['fromtoshort'] = '$from - $to ið eru $count';
+$labels['copy'] = 'Avrita';
+$labels['move'] = 'Flyt';
+$labels['moveto'] = 'Flyt til...';
+$labels['download'] = 'Heinta';
+$labels['showattachment'] = 'Vís';
+$labels['showanyway'] = 'Vís tað avlíkavæl';
+$labels['filename'] = 'Fílu navn';
+$labels['filesize'] = 'Fílu stødd';
+$labels['addtoaddressbook'] = 'Legg aftrat búðstaðar bók';
+$labels['sun'] = 'Sun';
+$labels['mon'] = 'Mán';
+$labels['tue'] = 'Týs';
+$labels['wed'] = 'Mik';
+$labels['thu'] = 'Hós';
+$labels['fri'] = 'Frí';
+$labels['sat'] = 'Ley';
+$labels['sunday'] = 'Sunnudagur';
+$labels['monday'] = 'Mánadagur';
+$labels['tuesday'] = 'Týsdagur';
+$labels['wednesday'] = 'Mikudagur';
+$labels['thursday'] = 'Hósdagur';
+$labels['friday'] = 'Fríggjardagur';
+$labels['saturday'] = 'Leygardagur';
+$labels['jan'] = 'Jan';
+$labels['feb'] = 'Feb';
+$labels['mar'] = 'Mar';
+$labels['apr'] = 'Apr';
+$labels['may'] = 'Maj';
+$labels['jun'] = 'Jun';
+$labels['jul'] = 'Jul';
+$labels['aug'] = 'Aug';
+$labels['sep'] = 'Sep';
+$labels['oct'] = 'Okt';
+$labels['nov'] = 'Nov';
+$labels['dec'] = 'Des';
+$labels['longjan'] = 'Januar';
+$labels['longfeb'] = 'Februar';
+$labels['longmar'] = 'Mars';
+$labels['longapr'] = 'Apríl';
+$labels['longmay'] = 'Maj';
+$labels['longjun'] = 'Juni';
+$labels['longjul'] = 'July';
+$labels['longaug'] = 'August';
+$labels['longsep'] = 'Septembur';
+$labels['longoct'] = 'Oktobur';
+$labels['longnov'] = 'Novembur';
+$labels['longdec'] = 'Desembur';
+$labels['today'] = 'Ã dag';
+$labels['refresh'] = 'Endur innles';
+$labels['checkmail'] = 'Kann fyri nýggj boð.';
+$labels['compose'] = 'Stovna';
+$labels['writenewmessage'] = 'Stovna nýggj boð';
+$labels['reply'] = 'Svara';
+$labels['replytomessage'] = 'Svara til sendara';
+$labels['replytoallmessage'] = 'Svara til listan ella til sendara og allir móttakarir';
+$labels['replyall'] = 'Svara øllum';
+$labels['replylist'] = 'Svara lista';
+$labels['forward'] = 'Send víðari';
+$labels['forwardinline'] = 'Svara víðari, við gomlum teksti';
+$labels['forwardattachment'] = 'Send víðari sum viðhefting';
+$labels['forwardmessage'] = 'Send hesi boð víðari';
+$labels['deletemessage'] = 'Strika boð';
+$labels['movemessagetotrash'] = 'Koyr boð í skrell';
+$labels['printmessage'] = 'Útskriva hesi boð';
+$labels['previousmessage'] = 'Vís seinastu boð';
+$labels['firstmessage'] = 'Vís fyrstu boð';
+$labels['nextmessage'] = 'Vís næstu boð';
+$labels['lastmessage'] = 'Vís seinastu boð';
+$labels['backtolist'] = 'Aftur til boð lista';
+$labels['viewsource'] = 'Vís keldu';
+$labels['mark'] = 'Merk';
+$labels['markmessages'] = 'Merk boð';
+$labels['markread'] = 'Sum lisin';
+$labels['markunread'] = 'Sum ólisin';
+$labels['markflagged'] = 'Sum viðmerkt';
+$labels['markunflagged'] = 'Sum óviðmerkt';
+$labels['moreactions'] = 'Fleiri gerir...';
+$labels['more'] = 'Meira';
+$labels['back'] = 'Aftur';
+$labels['options'] = 'Valmøguleikar';
+$labels['select'] = 'Vel';
+$labels['all'] = 'Alt';
+$labels['none'] = 'Einki';
+$labels['currpage'] = 'Hesa síðu';
+$labels['unread'] = 'Ólisið';
+$labels['flagged'] = 'Viðmerkt';
+$labels['unanswered'] = 'Ikki svara';
+$labels['deleted'] = 'Strika';
+$labels['undeleted'] = 'Ikki strika';
+$labels['invert'] = 'Vend við';
+$labels['filter'] = 'Síla';
+$labels['list'] = 'Listið';
+$labels['threads'] = 'Tráðir';
+$labels['expand-all'] = 'Spreið alt';
+$labels['expand-unread'] = 'Spreið ólisið';
+$labels['collapse-all'] = 'Sett saman alt';
+$labels['threaded'] = 'Tráða';
+$labels['autoexpand_threads'] = 'Spreið boð tráðir';
+$labels['do_expand'] = 'Allir tráðir';
+$labels['expand_only_unread'] = 'einans við ólisin boð';
+$labels['fromto'] = 'Frá/Til';
+$labels['flag'] = 'Viðmerk';
+$labels['attachment'] = 'Viðhefting';
+$labels['nonesort'] = 'Einki';
+$labels['sentdate'] = 'Sent dato';
+$labels['arrival'] = 'Móttikið dato';
+$labels['asc'] = 'hækkandi';
+$labels['desc'] = 'lækkandi';
+$labels['listcolumns'] = 'List teigar';
+$labels['listsorting'] = 'Sorterar teiga';
+$labels['listorder'] = 'Sorterar rekkjufylgju';
+$labels['folderactions'] = 'Mappu gerir...';
+$labels['compact'] = 'Trýst saman';
+$labels['empty'] = 'Tøm';
+$labels['quota'] = 'Disk nýtsla';
+$labels['unknown'] = 'ókent';
+$labels['unlimited'] = 'óavmarka';
+$labels['quicksearch'] = 'Skjót leiting';
+$labels['resetsearch'] = 'Nulstilla leiting';
+$labels['searchmod'] = 'Leiti minkarir';
+$labels['msgtext'] = 'Øll boðini';
+$labels['openinextwin'] = 'Opna í nýggjum vindeyga';
+$labels['emlsave'] = 'Heinta (.eml)';
+$labels['editasnew'] = 'Broyt sum nýtt';
+$labels['send'] = 'Send';
+$labels['sendmessage'] = 'Send boð';
+$labels['savemessage'] = 'Goym sum skitsa';
+$labels['addattachment'] = 'Viðheft fíl';
+$labels['charset'] = 'Stavusett';
+$labels['editortype'] = 'Útgevara slag';
+$labels['returnreceipt'] = 'Lat aftur kvittan';
+$labels['dsn'] = 'Útflýggja støðu kunngerð';
+$labels['mailreplyintro'] = 'Tann $date, skrivaði $sender:';
+$labels['originalmessage'] = 'Uppruna boð';
+$labels['editidents'] = 'Broyt samleikar';
+$labels['spellcheck'] = 'Stava';
+$labels['checkspelling'] = 'Kanna staving';
+$labels['resumeediting'] = 'Taka uppaftur skriving';
+$labels['revertto'] = 'Vend aftur til';
+$labels['attach'] = 'Viðheft';
+$labels['attachments'] = 'Viðheftingar';
+$labels['upload'] = 'Uppsend';
+$labels['uploadprogress'] = '$percent ($currently av $total)';
+$labels['close'] = 'Lat aftur';
+$labels['messageoptions'] = 'Boð valmøguleikar...';
+$labels['low'] = 'Lágt';
+$labels['lowest'] = 'Lágst';
+$labels['normal'] = 'Vanligt';
+$labels['high'] = 'Høgt';
+$labels['highest'] = 'Hagst';
+$labels['nosubject'] = '(einki evni)';
+$labels['showimages'] = 'Vís myndir';
+$labels['alwaysshow'] = 'Vís altíð myndir frá $sender';
+$labels['isdraft'] = 'Hetta er eini skitsu boð.';
+$labels['andnmore'] = '$nr meir...';
+$labels['togglemoreheaders'] = 'Vís meiri boð teksthøvd ';
+$labels['togglefullheaders'] = 'Vel ráðan boð teksthøvd';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Reiður tekstur';
+$labels['savesentmessagein'] = 'Goym boð í ';
+$labels['dontsave'] = 'goym ikki';
+$labels['maxuploadsize'] = 'Stórsta fílu stødd loyvd er $size';
+$labels['addcc'] = 'Legg aftrat Cc';
+$labels['addbcc'] = 'Legg aftrat Bcc';
+$labels['addreplyto'] = 'Legg aftrat Svara-til';
+$labels['addfollowupto'] = 'Legg aftrat Fylg við-til';
+$labels['mdnrequest'] = 'Sendarin av hesi boð biður um at verða kunngjørdur tá ið tú lesur hesið boð. Vilt tú kunngerða sendaran?';
+$labels['receiptread'] = 'Svara móttakara (les)';
+$labels['yourmessage'] = 'Hetta er ein afturvend kvittan av tíni boð';
+$labels['firstname'] = 'Fornavn';
+$labels['surname'] = 'Eftirnavn';
+$labels['middlename'] = 'Millunnavn';
+$labels['nameprefix'] = 'Forskoyti';
+$labels['namesuffix'] = 'Eftirskoyti';
+$labels['nickname'] = 'Eyknevni';
+$labels['jobtitle'] = 'Starvsheiti';
+$labels['department'] = 'Deild';
+$labels['gender'] = 'Kyn';
+$labels['maidenname'] = 'Gentunavn';
+$labels['email'] = 'Teldupostur';
+$labels['phone'] = 'Telefon';
+$labels['address'] = 'Búðstaður';
+$labels['street'] = 'Gøta';
+$labels['locality'] = 'Býur';
+$labels['zipcode'] = 'Post kota';
+$labels['region'] = 'Kommuna';
+$labels['country'] = 'Land';
+$labels['birthday'] = 'Føðingardagur';
+$labels['anniversary'] = 'Ãrsdagur';
+$labels['website'] = 'Heimasíða';
+$labels['instantmessenger'] = 'IM';
+$labels['notes'] = 'Notatir';
+$labels['male'] = 'maður';
+$labels['female'] = 'kona';
+$labels['manager'] = 'Leiðari';
+$labels['assistant'] = 'Hjálparfólk';
+$labels['spouse'] = 'Hjúnafelagi';
+$labels['allfields'] = 'Allir teigar';
+$labels['search'] = 'Leita';
+$labels['advsearch'] = 'Framkomin leiting';
+$labels['advanced'] = 'Framkomin';
+$labels['other'] = 'Annað';
+$labels['typehome'] = 'Heim';
+$labels['typework'] = 'Arbeiði';
+$labels['typeother'] = 'Annað';
+$labels['typemobile'] = 'Fartelefon';
+$labels['typemain'] = 'Høvuðs';
+$labels['typehomefax'] = 'Heima faks';
+$labels['typeworkfax'] = 'Arbeiðis faks';
+$labels['typecar'] = 'Bilur';
+$labels['typepager'] = 'Persónleitari';
+$labels['typevideo'] = 'Sjónband';
+$labels['typeassistant'] = 'Hjálparfólk';
+$labels['typehomepage'] = 'Heimasíða';
+$labels['typeblog'] = 'Bloggur';
+$labels['typeprofile'] = 'Umhvarv ';
+$labels['addfield'] = 'Legg aftrat teiga...';
+$labels['addcontact'] = 'Legg aftrat nýggjan persón';
+$labels['editcontact'] = 'Broyt persón';
+$labels['contacts'] = 'Persónar';
+$labels['contactproperties'] = 'Persóna eginleikar';
+$labels['personalinfo'] = 'Persónligar upplýsingar';
+$labels['edit'] = 'Broyt';
+$labels['cancel'] = 'Ógilda';
+$labels['save'] = 'Goym';
+$labels['delete'] = 'Strika';
+$labels['rename'] = 'Umdoyp';
+$labels['addphoto'] = 'Legg aftrat';
+$labels['replacephoto'] = 'Skift út';
+$labels['uploadphoto'] = 'Uppsend mynd';
+$labels['newcontact'] = 'Ger nýtt persón kort';
+$labels['deletecontact'] = 'Strika valdir persónar';
+$labels['composeto'] = 'Skriva boð til';
+$labels['contactsfromto'] = 'Persónar frá $from til $to ið eru $count';
+$labels['print'] = 'Skriva út';
+$labels['export'] = 'Flyt út';
+$labels['exportvcards'] = 'Út flyt persónar við vCard slagið';
+$labels['newcontactgroup'] = 'Ger nýggja persóns bólk';
+$labels['grouprename'] = 'Umdoyp bólk';
+$labels['groupdelete'] = 'Strika bólk';
+$labels['groupremoveselected'] = 'Strika valdar persónar frá bólki';
+$labels['previouspage'] = 'Vís fyrrverandi síðu';
+$labels['firstpage'] = 'Vís fyrstu síðu';
+$labels['nextpage'] = 'Vís næstu síðu';
+$labels['lastpage'] = 'Vís seinastu síðu';
+$labels['group'] = 'Bólkur';
+$labels['groups'] = 'Bólkar';
+$labels['personaladrbook'] = 'Persónligir búðstaðir';
+$labels['searchsave'] = 'Goym leiting';
+$labels['searchdelete'] = 'Strika leiting';
+$labels['import'] = 'Innflyt';
+$labels['importcontacts'] = 'Innflyt persónar';
+$labels['importfromfile'] = 'Innflyt frá fílu';
+$labels['importreplace'] = 'Skift út alt búðstaðarsavni';
+$labels['importdesc'] = 'Tú kanst uppsenda persónar frá einari aðrari búðstaðar bók.<br/>Vit veita vit møguleika at innflyta búðstaðir frá<a href="http://en.wikipedia.org/wiki/VCard">vCard</a> ella CSV (komma uppdeilt) dáta slag.';
+$labels['done'] = 'Liðugt';
+$labels['settingsfor'] = 'Stillingar til';
+$labels['about'] = 'Um';
+$labels['preferences'] = 'Vælmøguleikar';
+$labels['userpreferences'] = 'Brúkara vælmøguleikar';
+$labels['editpreferences'] = 'Broyt brúkara framíhjárættindi';
+$labels['identities'] = 'Samleikar';
+$labels['manageidentities'] = 'Umsit samleikar fyri hesa kontu';
+$labels['newidentity'] = 'Nýtt samleiki';
+$labels['newitem'] = 'Nýtt ting';
+$labels['edititem'] = 'Broyt ting';
+$labels['preferhtml'] = 'Vís HTML';
+$labels['defaultcharset'] = 'Sjálvset tekin set';
+$labels['htmlmessage'] = 'HTML boð';
+$labels['dateformat'] = 'Dato format';
+$labels['timeformat'] = 'Tíðs format';
+$labels['prettydate'] = 'Pen dato';
+$labels['setdefault'] = 'Set vanligt';
+$labels['autodetect'] = 'Sjálvirki';
+$labels['language'] = 'Mál';
+$labels['timezone'] = 'Tíðarsona';
+$labels['pagesize'] = 'Rekkjur per síðu';
+$labels['signature'] = 'Undirskrift';
+$labels['dstactive'] = 'Summartíð';
+$labels['showinextwin'] = 'Opna boðí nýggjun vindeyga';
+$labels['composeextwin'] = 'Stovna í nýggjum vindeyga';
+$labels['htmleditor'] = 'Stovna HTML boð';
+$labels['htmlonreply'] = 'til svar til HTML boð';
+$labels['htmlonreplyandforward'] = 'til víðari sending ella svar til HTML boð';
+$labels['htmlsignature'] = 'HTML undirskrift';
+$labels['previewpane'] = 'Vís undansýningar rút';
+$labels['skin'] = 'Markamóts skinn';
+$labels['logoutclear'] = 'Strika Skrell tá ið tú út ritar';
+$labels['logoutcompact'] = 'Trýst saman postkassa tá ið tú ritar út';
+$labels['uisettings'] = 'Brúkaraøki';
+$labels['serversettings'] = 'Ambætara stillingar';
+$labels['mailboxview'] = 'Postkassa sjón';
+$labels['mdnrequests'] = 'Bið um kvittan';
+$labels['askuser'] = 'spyr me';
+$labels['autosend'] = 'send kvittan';
+$labels['autosendknown'] = 'send kvittan til mínir persónar, annars spyr me';
+$labels['autosendknownignore'] = 'send kvittan til mínir persónar, annars skúgv til vigs';
+$labels['ignore'] = 'skúgv til vigs';
+$labels['readwhendeleted'] = 'Merk boði sum lisið á striking';
+$labels['flagfordeletion'] = 'Viðmerk boði til strikingar ístaðin fyri at strika';
+$labels['skipdeleted'] = 'Vís ikki strika boð';
+$labels['deletealways'] = 'Um flyting av boðum til Skrell ikki riggar, strika tey so';
+$labels['deletejunk'] = 'Strika boð beinleiðis í Møsn';
+$labels['showremoteimages'] = 'Vís regluligar fjarmyndir';
+$labels['fromknownsenders'] = 'frá ókendum sendarum';
+$labels['always'] = 'altíð';
+$labels['showinlineimages'] = 'Vís viðheftar myndir niðanfyri boðini';
+$labels['autosavedraft'] = 'Goym skitsu sjálvirkandi';
+$labels['everynminutes'] = 'hvønn $n minutt(ir)';
+$labels['refreshinterval'] = 'Endur innles (kannað fyri nýggjum boðum, o.s.fv.)';
+$labels['never'] = 'aldrin';
+$labels['immediately'] = 'í stundini';
+$labels['messagesdisplaying'] = 'Vísir boð';
+$labels['messagescomposition'] = 'Stovnar boð';
+$labels['mimeparamfolding'] = 'Viðheftingar nøvn';
+$labels['2231folding'] = 'Fult RFC 2231 (Thunderbird)';
+$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
+$labels['2047folding'] = 'Fult RFC 2047 (other)';
+$labels['force7bit'] = 'Nýt MIME kodingar til 8-bit tekin';
+$labels['advancedoptions'] = 'Víðkaðir valmøguleikar';
+$labels['focusonnewmessage'] = 'Legg dent á kaga vindeyga tá ið nýtt boð verður stovna';
+$labels['checkallfolders'] = 'Kannað allar mappur fyri nýggj boð';
+$labels['displaynext'] = 'Eftir striking/flyting av boði, vís so næsta boð';
+$labels['defaultfont'] = 'Vanligi stavsnið av HTML boði';
+$labels['mainoptions'] = 'Høvuðs Vælmøguleikar';
+$labels['browseroptions'] = 'Kaga Valmøguleikar';
+$labels['section'] = 'Partur';
+$labels['maintenance'] = 'Umsiting';
+$labels['newmessage'] = 'Nýggj boð';
+$labels['signatureoptions'] = 'Undirskrift vælmøguleikar';
+$labels['whenreplying'] = 'Tá ið skriving verður framd';
+$labels['replyempty'] = 'sitera ikki uppruna boðini';
+$labels['replytopposting'] = 'byrja eini nýggj boð uppiyvir sitatinum';
+$labels['replybottomposting'] = 'byrja eini nýggj boð undir sitatinum';
+$labels['replyremovesignature'] = 'Tá ið svaring verðurframd, strika so uppruna sitati frá boðinum';
+$labels['autoaddsignature'] = 'Legg undirskrift á sjálvirkandi';
+$labels['newmessageonly'] = 'Nýggj boð einans';
+$labels['replyandforwardonly'] = 'svar og víðarsendingar einans';
+$labels['insertsignature'] = 'Innset undirskrift';
+$labels['previewpanemarkread'] = 'Merk undansýnd boð sum lisin';
+$labels['afternseconds'] = 'eftir $n sekund';
+$labels['reqmdn'] = 'Bið altíð um eina kvittan';
+$labels['reqdsn'] = 'Bið altíð um status kunngerð';
+?>
diff --git a/program/localization/fo_FO/messages.inc b/program/localization/fo_FO/messages.inc
new file mode 100644
index 000000000..be54b71d2
--- /dev/null
+++ b/program/localization/fo_FO/messages.inc
@@ -0,0 +1,175 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/messages.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
+*/
+$messages['errortitle'] = 'Ein feilur kom fyri!';
+$messages['loginfailed'] = 'Feilur í innriting.';
+$messages['cookiesdisabled'] = 'Kagi tín noktar cookies.';
+$messages['sessionerror'] = 'Seta tín er ógyldig ella útgingin.';
+$messages['storageerror'] = 'Feilur í samand til goymslu ambatara.';
+$messages['servererror'] = 'Ambatara Feilur!';
+$messages['servererrormsg'] = 'Ambatara Feilur: $msg';
+$messages['dberror'] = 'Dátugrun Feilur';
+$messages['requesttimedout'] = 'Umbøn gekk út';
+$messages['errorreadonly'] = 'Kann ikki fremja ger. Mappan kann einans lesast.';
+$messages['errornoperm'] = 'Kann ikki fremja ger. Atgongd nokta.';
+$messages['erroroverquota'] = 'Kann ikki fremja ger. Einki pláss á diski.';
+$messages['erroroverquotadelete'] = 'Einki pláss á diski. Brúka SHIFT+DEL fyri at strika boð.';
+$messages['invalidrequest'] = 'Ógyldig umbøn! Einki dáta varð goymt.';
+$messages['invalidhost'] = 'Ógyldigt ambatara navn.';
+$messages['nomessagesfound'] = 'Eingi boð í funnin hesum postkassa,';
+$messages['loggedout'] = 'Tú hevur strika tína setu. Farvæl!';
+$messages['refreshing'] = 'Endur-innlesur...';
+$messages['loading'] = 'Innlesur...';
+$messages['uploading'] = 'Leggur fílu út...';
+$messages['uploadingmany'] = 'Leggur fílur út...';
+$messages['loadingdata'] = 'Innlesur dáta...';
+$messages['checkingmail'] = 'Kannar fyri nýggj boð...';
+$messages['sendingmessage'] = 'Sendur boð...';
+$messages['messagesent'] = 'Boðini vóru send.';
+$messages['savingmessage'] = 'Goymur boðini.';
+$messages['messagesaved'] = 'Boðini goymd til Skitsur';
+$messages['successfullysaved'] = 'Goymt.';
+$messages['savingresponse'] = 'Goymur svar tekst...';
+$messages['deleteresponseconfirm'] = 'Vilt tú veruliga strika hendan svar tekst?';
+$messages['addedsuccessfully'] = 'Persónur lagdur aftrat búðstaðar savn.';
+$messages['contactexists'] = 'Ein persónur við sama telduposti er longu til.';
+$messages['contactnameexists'] = 'Ein persónur við sama navn er longu til.';
+$messages['blockedimages'] = 'Fyri at verja tín privatlív so eru fjarmyndir sperraðar í hesum boði.';
+$messages['encryptedmessage'] = 'Hetta er eini brogla boð og kann ikki sýnast. Tíverri!';
+$messages['nocontactsfound'] = 'Eingir persónar funnir.';
+$messages['contactnotfound'] = 'Umbindni persónurin varð ikki funnin.';
+$messages['contactsearchonly'] = 'Skriva onkur leiti orð fyri at finna persónar';
+$messages['sendingfailed'] = 'Riggaði ikki at senda boð.';
+$messages['senttooquickly'] = 'Vinarliga bíða $sec sekund(ir) áðrenn tú sendur hetta boð.';
+$messages['errorsavingsent'] = 'Ein feilur kom fyri tá ið roynt var at goyma send boð.';
+$messages['errorsaving'] = 'Ein feilur kom fyri tá ið goymt var.';
+$messages['errormoving'] = 'Kundi ikki flyta boð(ini).';
+$messages['errorcopying'] = 'Kundi ikki avrita boð(ini).';
+$messages['errordeleting'] = 'Kundi ikki strika boð(ini).';
+$messages['errormarking'] = 'Kundi ikki merkja boð(ini).';
+$messages['deletecontactconfirm'] = 'Ert tú vísur í at tú vilt strika merkt(ar) persónar?';
+$messages['deletegroupconfirm'] = 'Ert tú vísur í at tú vilt strika valda bólk?';
+$messages['deletemessagesconfirm'] = 'Ert tú vísur í at tú vilt strika vald boð()?';
+$messages['deletefolderconfirm'] = 'Ert tú vísur í at tú vilt strika hesa mappu?';
+$messages['purgefolderconfirm'] = 'Ert tú vísur í at tú vilt strika øll boð í hesu mappu?';
+$messages['contactdeleting'] = 'Strikar persón(ar)...';
+$messages['groupdeleting'] = 'Strikar bólk...';
+$messages['folderdeleting'] = 'Strikar mappu...';
+$messages['foldermoving'] = 'Flytur mappu...';
+$messages['foldersubscribing'] = 'Tegnar til mappu...';
+$messages['folderunsubscribing'] = 'Ógyldar tekning til mappu...';
+$messages['formincomplete'] = 'Allir teigirnir vóru ikki fyltir út.';
+$messages['noemailwarning'] = 'Vinarliga skriva ein galdandi teldupost.';
+$messages['nonamewarning'] = 'Vinarliga skriva eitt navn.';
+$messages['nopagesizewarning'] = 'Vinarliga skriva síðu stødd.';
+$messages['nosenderwarning'] = 'Vinarliga skriva sendara teldupost búðstað.';
+$messages['norecipientwarning'] = 'Vinarliga skriva minst ein móttakara.';
+$messages['nosubjectwarning'] = 'Evna teigurin er tómur. Vilt tú skriva nakað í hann?';
+$messages['nobodywarning'] = 'Send hesi boð uttan tekst?';
+$messages['notsentwarning'] = 'Boðini vóru ikki send. Ynskir tú strika hetta boð?';
+$messages['restoresavedcomposedata'] = 'Eitt fyrrverandi skriva boð, men ósent, boð var funni.\n\nEvni: $subject\nGoymt: $date\n\nVilt tú endur stovna hetta boð?';
+$messages['noldapserver'] = 'Vinarliga vel ein ldap ambatara fyri at leita.';
+$messages['nosearchname'] = 'Vinarliga skriva eitt persón navn ella teldupost búðstað,';
+$messages['notuploadedwarning'] = 'Ikki allar viðheftingar eru uppsendar enn. Vinarliga bíða ella angra uppsendingina.';
+$messages['searchsuccessful'] = '$nr boð funnin.';
+$messages['contactsearchsuccessful'] = '$nr persónar funnir.';
+$messages['searchnomatch'] = 'Leiting gav eingin úrslit.';
+$messages['searching'] = 'Leitar...';
+$messages['checking'] = 'Kannar...';
+$messages['nospellerrors'] = 'Eingin stavifeilur funnin.';
+$messages['folderdeleted'] = 'Mappa sletta.';
+$messages['foldersubscribed'] = 'Mappa tekna til.';
+$messages['folderunsubscribed'] = 'Ógylt tekning til mappu.';
+$messages['folderpurged'] = 'Mappan er tómd.';
+$messages['folderexpunged'] = 'Mappan var samantrongd.';
+$messages['deletedsuccessfully'] = 'Strika uftan feilir.';
+$messages['converting'] = 'Tekur burt forsniðing...';
+$messages['messageopenerror'] = 'Kundi ikki lesa inn boð frá servara.';
+$messages['fileuploaderror'] = 'Fíla uppsending riggaði ikk.';
+$messages['filesizeerror'] = 'Uppsendi fílur er stórri enn grensan ið er $size.';
+$messages['copysuccess'] = 'Avrita $nr persónar.';
+$messages['movesuccess'] = 'Flutt $nr persónar.';
+$messages['copyerror'] = 'Kundi ikki avrita persónar.';
+$messages['moveerror'] = 'Kundi ikki flyta persónar.';
+$messages['sourceisreadonly'] = 'Hendan búðstaðar keldan er einans lesandi.';
+$messages['errorsavingcontact'] = 'Kann ikki goyma addressuna hjá persóni.';
+$messages['movingmessage'] = 'Flytur hetta(hesi) boð...';
+$messages['copyingmessage'] = 'Flytur hetta(hesi) boð...';
+$messages['copyingcontact'] = 'Avritar persón(ar)...';
+$messages['movingcontact'] = 'Flytur persón(ar)...';
+$messages['deletingmessage'] = 'Strikar boð(ini)...';
+$messages['markingmessage'] = 'Merkjur boð(ini)...';
+$messages['addingmember'] = 'Leggur persón(ar) aftrat bólk...';
+$messages['removingmember'] = 'Strikar persón(ar) frá bólkið...';
+$messages['receiptsent'] = 'Kvittan er sent.';
+$messages['errorsendingreceipt'] = 'Kundi ikki senda kvittan.';
+$messages['deleteidentityconfirm'] = 'Ert tú vísur í at tú vilt strika hendan samleika?';
+$messages['nodeletelastidentity'] = 'Tú kanst ikki strika hendan samleika, hetta er tann seinasti.';
+$messages['forbiddencharacter'] = 'Mappu navn inniheldur óloyvd tekin.';
+$messages['selectimportfile'] = 'Vinarliga vel eina fílu';
+$messages['addresswriterror'] = 'Valda búðstaðar bók kann ikki skrivast í.';
+$messages['contactaddedtogroup'] = 'Persónar vóru lagdir aftrat bólki.';
+$messages['contactremovedfromgroup'] = 'Persónar vóru strikaðir frá bólki';
+$messages['nogroupassignmentschanged'] = 'Eingin bólka tilluting broytt.';
+$messages['importwait'] = 'Flytur inn, vinarliga bíða...';
+$messages['importformaterror'] = 'Innflyting riggaði ikki! Tann uppsendi fílurin var ikki gyldigur dátu fílur.';
+$messages['importconfirm'] = '<b>$inserted Persónar innfluttir</b>';
+$messages['importconfirmskipped'] = '<b>Leyp um $skipped innsetanir</b>';
+$messages['importmessagesuccess'] = 'Innflutt $nr boð.';
+$messages['importmessageerror'] = 'Innflyting bar ikki til! Tann uppsendi fílurin er ikki gyldigur boð ella postkassa fílur';
+$messages['opnotpermitted'] = 'Ger ikki loyvd!';
+$messages['nofromaddress'] = 'Manglar teldupostur í valda samleika.';
+$messages['editorwarning'] = 'Um tú skiftur til reinan tekst verður øll forsniðing mist. Ynskir tú at halda fram?';
+$messages['httpreceivedencrypterror'] = 'Ein oyðandi samansetings feilur uppstóð. Vinarliga set teg í samband við umsitaran beinanvegin. <b>Tíni boð kundu ikki sendast.</b>';
+$messages['smtpconnerror'] = 'SMTP Feilur ($code): Samband til ambatara riggaði ikki.';
+$messages['smtpautherror'] = 'SMTP Feilur ($code): Atgongd nokta.';
+$messages['smtpfromerror'] = 'SMTP feilur ($code): Til bar ikki at seta sendarin til "$from" ($msg).';
+$messages['smtptoerror'] = 'SMTP feilur ($code): Til bar ikki at nýta móttakarin "$to" ($msg)';
+$messages['smtprecipientserror'] = 'SMTP feilur: Til bar ikki at greina móttakara listan.';
+$messages['smtperror'] = 'SMTP feilur: $msg';
+$messages['emailformaterror'] = 'Ógyldig teldupost búðstaður: $email';
+$messages['toomanyrecipients'] = 'Ov nógvir móttakarir. Minka um móttakarum til $max.';
+$messages['maxgroupmembersreached'] = 'Nummarið av limum í bólkinum gongur framvið hægsta mark ið er $max.';
+$messages['internalerror'] = 'Ein innanhýsis feilur kom fyri. Vinarliga royn aftur.';
+$messages['contactdelerror'] = 'Kann ikki strika persón(ar).';
+$messages['contactdeleted'] = 'Persón(ar) strikaðir.';
+$messages['contactrestoreerror'] = 'Kann ikki endurstovna persón(ar).';
+$messages['contactrestored'] = 'Persónur(ar) endurstovnaðir.';
+$messages['groupdeleted'] = 'Bólkur strikaður.';
+$messages['grouprenamed'] = 'Bólkur umdoyptur.';
+$messages['groupcreated'] = 'Bólkur stovnaður';
+$messages['savedsearchdeleted'] = 'Goymdar leitingar strikaðar';
+$messages['savedsearchdeleteerror'] = 'Kundi ikki strika goymdar leitingar.';
+$messages['savedsearchcreated'] = 'Goymdar leitingar stovnaðar.';
+$messages['savedsearchcreateerror'] = 'Kundi ikki stovna goymdar leitingar.';
+$messages['messagedeleted'] = 'Boð(ini) strika.';
+$messages['messagemoved'] = 'Boð(ini) flutt.';
+$messages['messagecopied'] = 'Boð(ini) avrita.';
+$messages['messagemarked'] = 'Boð(ini) merkt.';
+$messages['autocompletechars'] = 'Skriva minst $min tekin fyri sjálvvirkin útfylling riggar.';
+$messages['autocompletemore'] = 'Fleiri úrslit funnin. Vinarliga skriva fleiri tekin.';
+$messages['namecannotbeempty'] = 'Navn kann ikki verða tómt.';
+$messages['nametoolong'] = 'Navnið er ov langt.';
+$messages['folderupdated'] = 'Mappa dagført.';
+$messages['foldercreated'] = 'Mappa stovna.';
+$messages['invalidimageformat'] = 'Ikki eitt gyldigt mynda slag.';
+$messages['mispellingsfound'] = 'Stavuvillur funnar í tíni boð.';
+$messages['parentnotwritable'] = 'Kann ikki flyta/avrita mappu til valda mappu. Eingin atgongu-rættindi.';
+$messages['messagetoobig'] = 'Boðini eru ov stór til at handfara.';
+$messages['attachmentvalidationerror'] = 'ÃVARING! Hendan viðheftingin er undir illgruna av tí at viðheftingar slagið ikki samsvarar við slagið ið var nevnt í boðunum. Um tú ikki stólar uppá sendaran so burdi tú ikki opna viðheftingina í tínum kaga, tí at tað kann innihalda illviljað tilfar.<br/><br/><em>Væntað: $expected; Fann $detected</em>';
+$messages['noscriptwarning'] = 'Ãvaring: Hendan webmail tænastan krevur Javascript! Um tú vilt nýta hana, so vinarliga tendra Javascript í tínum kaga.';
+?>
diff --git a/program/localization/fr_FR/labels.inc b/program/localization/fr_FR/labels.inc
index dd0acf4f1..023b7f415 100644
--- a/program/localization/fr_FR/labels.inc
+++ b/program/localization/fr_FR/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to de $count';
$labels['copy'] = 'Copier';
$labels['move'] = 'Déplacer';
$labels['moveto'] = 'Déplacer vers...';
+$labels['copyto'] = 'Copier vers...';
$labels['download'] = 'Télécharger';
$labels['open'] = 'Ouvrir';
$labels['showattachment'] = 'Afficher';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Orthographe';
$labels['checkspelling'] = 'Vérifier l\'orthographe';
$labels['resumeediting'] = 'Retourner à l\'édition';
$labels['revertto'] = 'Revenir à';
+$labels['restore'] = 'Restaurer';
+$labels['restoremessage'] = 'Restaurer le message ?';
+$labels['responses'] = 'Réponses';
+$labels['insertresponse'] = 'Insérer une réponse';
+$labels['manageresponses'] = 'Gérer les réponses';
+$labels['savenewresponse'] = 'Sauvegarder une nouvelle réponse';
+$labels['editresponses'] = 'Editer les réponses';
+$labels['editresponse'] = 'Editer la réponse';
+$labels['responsename'] = 'Nom';
+$labels['responsetext'] = 'Texte de la réponse';
$labels['attach'] = 'Joindre';
$labels['attachments'] = 'Fichiers joints';
$labels['upload'] = 'Transférer';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Manipuler les menus surgissants comme des fenêtre
$labels['forwardmode'] = 'Transfert des messages';
$labels['inline'] = 'dans le corps';
$labels['asattachment'] = 'en pièce jointe';
+$labels['replyallmode'] = 'Action par défaut du bouton [Répondre à tous]';
+$labels['replyalldefault'] = 'Répondre à tous';
+$labels['replyalllist'] = 'Répondre uniquement à la liste de diffusion (si trouvée)';
$labels['folder'] = 'Dossier';
$labels['folders'] = 'Dossiers';
$labels['foldername'] = 'Nom du dossier';
diff --git a/program/localization/gl_ES/labels.inc b/program/localization/gl_ES/labels.inc
index 780d47d77..899f35c5e 100644
--- a/program/localization/gl_ES/labels.inc
+++ b/program/localization/gl_ES/labels.inc
@@ -15,29 +15,29 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
*/
-$labels['welcome'] = 'Benvido a $product';
-$labels['username'] = 'Nome de usuario';
+$labels['welcome'] = 'Dámosche a benvida a $product';
+$labels['username'] = 'Nome de utente';
$labels['password'] = 'Contrasinal';
$labels['server'] = 'Servidor';
$labels['login'] = 'Acceder';
$labels['logout'] = 'Saír';
$labels['mail'] = 'Caixa de entrada';
$labels['settings'] = 'Axustes persoais';
-$labels['addressbook'] = 'Caderno de enderezos';
+$labels['addressbook'] = 'Axenda de enderezos';
$labels['inbox'] = 'Caixa de entrada';
$labels['drafts'] = 'Borradores';
$labels['sent'] = 'Enviados';
-$labels['trash'] = 'Cubo do lixo';
+$labels['trash'] = 'Lixo';
$labels['junk'] = 'Correo lixo';
-$labels['show_real_foldernames'] = 'Amosar nomes reáis para cartafois especiáis';
+$labels['show_real_foldernames'] = 'Amosar nomes reais para cartafois especiais';
$labels['subject'] = 'Asunto';
$labels['from'] = 'Remitente';
$labels['sender'] = 'Remitente';
-$labels['to'] = 'Destinatario';
+$labels['to'] = 'Destinatario(a)';
$labels['cc'] = 'Copia (Cc)';
$labels['bcc'] = 'Copia oculta (Cco)';
-$labels['replyto'] = 'Respostar a (Reply-To)';
-$labels['followupto'] = 'Respostar a todos (Followup-To)';
+$labels['replyto'] = 'Responder a';
+$labels['followupto'] = 'Responder a todos';
$labels['date'] = 'Data';
$labels['size'] = 'Tamaño';
$labels['priority'] = 'Prioridade';
@@ -45,20 +45,20 @@ $labels['organization'] = 'Organización';
$labels['readstatus'] = 'Estado da lectura';
$labels['listoptions'] = 'Opcións de lista...';
$labels['mailboxlist'] = 'Cartafoles';
-$labels['messagesfromto'] = 'Mensaxes da $from á $to de $count';
-$labels['threadsfromto'] = 'Fíos do $from ao $to de $count';
+$labels['messagesfromto'] = 'Mensaxes de $from para $to de $count';
+$labels['threadsfromto'] = 'Fíos do $from para $to de $count';
$labels['messagenrof'] = 'Mensaxe $nr de $count';
$labels['fromtoshort'] = '$from - $to de $count';
$labels['copy'] = 'Copiar';
$labels['move'] = 'Mover';
-$labels['moveto'] = 'Mover a...';
+$labels['moveto'] = 'Mover para...';
$labels['download'] = 'Descargar';
$labels['open'] = 'Abrir';
$labels['showattachment'] = 'Amosar';
-$labels['showanyway'] = 'Amosala de tódolos xeitos';
-$labels['filename'] = 'Nome de ficheiro';
-$labels['filesize'] = 'Tamaño de ficheiro';
-$labels['addtoaddressbook'] = 'Engadir ao caderno de enderezos';
+$labels['showanyway'] = 'Amosar de todos os xeitos';
+$labels['filename'] = 'Nome do ficheiro';
+$labels['filesize'] = 'Tamaño do ficheiro';
+$labels['addtoaddressbook'] = 'Engadir á Axenda de enderezos';
$labels['sun'] = 'Dom';
$labels['mon'] = 'Lun';
$labels['tue'] = 'Mar';
@@ -101,18 +101,18 @@ $labels['today'] = 'Hoxe';
$labels['refresh'] = 'Actualizar';
$labels['checkmail'] = 'Procurar novas mensaxes';
$labels['compose'] = 'Redactar unha mensaxe';
-$labels['writenewmessage'] = 'Redactar unha mensaxe nova';
+$labels['writenewmessage'] = 'Redactar unha nova mensaxe';
$labels['reply'] = 'Responder';
-$labels['replytomessage'] = 'Respostar a mensaxe';
-$labels['replytoallmessage'] = 'Respostar á lista ou ao remitente e a tódolos destinatarios';
-$labels['replyall'] = 'Respostar a todos';
-$labels['replylist'] = 'Respostar á lista de correo';
+$labels['replytomessage'] = 'Responder a mensaxe';
+$labels['replytoallmessage'] = 'Responder á persoa remitente e a todas as destinatarias';
+$labels['replyall'] = 'Responder a todos';
+$labels['replylist'] = 'Responder á lista de correo';
$labels['forward'] = 'Reenviar';
-$labels['forwardinline'] = 'Reenviar inserido';
+$labels['forwardinline'] = 'Reenviar en liña';
$labels['forwardattachment'] = 'Reenviar como anexo';
$labels['forwardmessage'] = 'Reenviar a mensaxe';
$labels['deletemessage'] = 'Eliminar a mensaxe';
-$labels['movemessagetotrash'] = 'Mover a mensaxe ao cubo do lixo';
+$labels['movemessagetotrash'] = 'Mover a mensaxe para o lixo';
$labels['printmessage'] = 'Imprimir esta mensaxe';
$labels['previousmessage'] = 'Amosar a mensaxe anterior';
$labels['firstmessage'] = 'Amosar a primeira mensaxe';
@@ -149,9 +149,9 @@ $labels['expand-unread'] = 'Expandir os non lidos';
$labels['collapse-all'] = 'Contraer todos';
$labels['threaded'] = 'Agrupar conversas';
$labels['autoexpand_threads'] = 'Expandir os fíos de mensaxes';
-$labels['do_expand'] = 'tódolos fíos';
+$labels['do_expand'] = 'todos os fíos';
$labels['expand_only_unread'] = 'só con mensaxes non lidas';
-$labels['fromto'] = 'Remitente/Destinatario';
+$labels['fromto'] = 'De/Para';
$labels['flag'] = 'Marca';
$labels['attachment'] = 'Anexo';
$labels['nonesort'] = 'Ningunha';
@@ -160,7 +160,7 @@ $labels['arrival'] = 'Data de chegada';
$labels['asc'] = 'ascendente';
$labels['desc'] = 'descendente';
$labels['listcolumns'] = 'Enumerar columnas';
-$labels['listsorting'] = 'Ordenar pola columna';
+$labels['listsorting'] = 'Ordenar en columnas';
$labels['listorder'] = 'Ordenación';
$labels['listmode'] = 'Modo de vista da lista';
$labels['folderactions'] = 'Accións cos cartafoles';
@@ -171,12 +171,14 @@ $labels['quota'] = 'Uso de disco';
$labels['unknown'] = 'descoñecido';
$labels['unlimited'] = 'ilimitado';
$labels['quicksearch'] = 'Busca rápida';
-$labels['resetsearch'] = 'Restablecer a busca';
-$labels['searchmod'] = 'Modificadores de busca';
-$labels['msgtext'] = 'Mensaxe enteira';
+$labels['resetsearch'] = 'Restabelecer a pesquisa';
+$labels['searchmod'] = 'Modificadores de pesquisa';
+$labels['msgtext'] = 'Toda a mensaxe';
$labels['body'] = 'Corpo';
-$labels['openinextwin'] = 'Abrir nunha nova fiestra';
-$labels['emlsave'] = 'Gardar (.eml)';
+$labels['type'] = 'Tipo';
+$labels['namex'] = 'Nome';
+$labels['openinextwin'] = 'Abrir nunha nova xanela';
+$labels['emlsave'] = 'Descargar (.eml)';
$labels['changeformattext'] = 'Amosar en texto plano';
$labels['changeformathtml'] = 'Amosar en HTML';
$labels['editasnew'] = 'Editar como nova';
@@ -195,6 +197,16 @@ $labels['spellcheck'] = 'Ortografía';
$labels['checkspelling'] = 'Revisar a ortografía';
$labels['resumeediting'] = 'Voltar á edición';
$labels['revertto'] = 'Voltar a';
+$labels['restore'] = 'Restaurar';
+$labels['restoremessage'] = 'Restaurar mensaxe?';
+$labels['responses'] = 'Respostas';
+$labels['insertresponse'] = 'Inserir unha resposta';
+$labels['manageresponses'] = 'Xestionar respostas';
+$labels['savenewresponse'] = 'Gardar a nova resposta';
+$labels['editresponses'] = 'Editar respostas';
+$labels['editresponse'] = 'Editar resposta ';
+$labels['responsename'] = 'Nome';
+$labels['responsetext'] = 'Texto de resposta';
$labels['attach'] = 'Anexar';
$labels['attachments'] = 'Ficheiros anexos';
$labels['upload'] = 'Cargar';
@@ -212,26 +224,26 @@ $labels['alwaysshow'] = 'Amosar sempre as imaxes nas mensaxes de $sender';
$labels['isdraft'] = 'Esta mensaxe é un borrador';
$labels['andnmore'] = '$nr máis...';
$labels['togglemoreheaders'] = 'Amosar máis cabecerias';
-$labels['togglefullheaders'] = 'Conmutar cabeceiras en bruto';
+$labels['togglefullheaders'] = 'Mudar os encabezados das mensaxes';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Só texto';
$labels['savesentmessagein'] = 'Gardar a mensaxe enviada en';
$labels['dontsave'] = 'non gardar';
-$labels['maxuploadsize'] = 'O tamaño máximo permitido por ficheiro é de $size';
-$labels['addcc'] = 'Engadir copia (CC)';
-$labels['addbcc'] = 'Engadir copia oculta (BCC)';
-$labels['addreplyto'] = 'Engadir respostar a (Reply-To)';
-$labels['addfollowupto'] = 'Engadir respostar a todos (Followup-To)';
-$labels['mdnrequest'] = 'O remitente desta mensaxe pediu ser notificado cando vostede a lea. Quere notificar ao remitente?';
+$labels['maxuploadsize'] = 'O tamaño máximo permitido para o ficheiro é de $size';
+$labels['addcc'] = 'Engadir Copia (CC)';
+$labels['addbcc'] = 'Engadir Copia oculta (BCC)';
+$labels['addreplyto'] = 'Engadir Responder a (Reply-To)';
+$labels['addfollowupto'] = 'Engadir Respostar a todos (Followup-To)';
+$labels['mdnrequest'] = 'A persoa remitente pediu ser notificada cando a mensaxe for lida. Queres enviar notificación á persoa remitente?';
$labels['receiptread'] = 'Notificación da entrega da mensaxe (lectura)';
-$labels['yourmessage'] = 'Esta é unha notificación da entrega da súa mensaxe';
-$labels['receiptnote'] = 'Nota: Esta notificación só confirma que a mensaxe se abriu no computador do destinatario. Non asegura que o destinatario a lera ou entendera o seu contido.';
+$labels['yourmessage'] = 'Esta é unha notificación da entrega da túa mensaxe';
+$labels['receiptnote'] = 'Nota: Esta notificación só confirma que a mensaxe se abriu no computador da persoa destinataria. Non asegura que a persoa destinataria a lera ou entendera o seu contido.';
$labels['name'] = 'Nome completo';
$labels['firstname'] = 'Nome';
$labels['surname'] = 'Apelidos';
$labels['middlename'] = 'Segundo nome';
-$labels['nameprefix'] = 'Prefixo';
-$labels['namesuffix'] = 'Sufixo';
+$labels['nameprefix'] = 'Forma de tratamento (Prefixo)';
+$labels['namesuffix'] = 'Forma de tratamento (Sufixo)';
$labels['nickname'] = 'Alcume';
$labels['jobtitle'] = 'Titulación';
$labels['department'] = 'Departamento';
@@ -249,13 +261,13 @@ $labels['birthday'] = 'Aniversario';
$labels['anniversary'] = 'Aniversario';
$labels['website'] = 'Sitio web';
$labels['instantmessenger'] = 'Mensaxería instantánea';
-$labels['notes'] = 'Notes';
+$labels['notes'] = 'Anotacións';
$labels['male'] = 'home';
$labels['female'] = 'muller';
$labels['manager'] = 'Xerente';
$labels['assistant'] = 'Asistente';
-$labels['spouse'] = 'Cónxuxe';
-$labels['allfields'] = 'Tódolos campos';
+$labels['spouse'] = 'Parella';
+$labels['allfields'] = 'Todos os campos';
$labels['search'] = 'Procurar';
$labels['advsearch'] = 'Procura avanzada';
$labels['advanced'] = 'Avanzado';
@@ -268,13 +280,13 @@ $labels['typemain'] = 'Principal';
$labels['typehomefax'] = 'Fax da casa';
$labels['typeworkfax'] = 'Fax do traballo';
$labels['typecar'] = 'Coche';
-$labels['typepager'] = 'Buscapersonas';
+$labels['typepager'] = 'Buscapersoas';
$labels['typevideo'] = 'Vídeo';
$labels['typeassistant'] = 'Asistente';
$labels['typehomepage'] = 'Páxina principal';
$labels['typeblog'] = 'Blogue';
$labels['typeprofile'] = 'Perfil';
-$labels['addfield'] = 'Engadir campo';
+$labels['addfield'] = 'Engadir campo...';
$labels['addcontact'] = 'Engadir novo contacto';
$labels['editcontact'] = 'Modificar este contacto';
$labels['contacts'] = 'Contactos';
@@ -307,20 +319,25 @@ $labels['nextpage'] = 'Amosar o seguinte grupo';
$labels['lastpage'] = 'Amosar o último grupo';
$labels['group'] = 'Grupo';
$labels['groups'] = 'Grupos';
+$labels['listgroup'] = 'Lista de integrantes do grupo';
$labels['personaladrbook'] = 'Enderezos persoais';
$labels['searchsave'] = 'Gardar procura';
$labels['searchdelete'] = 'Eliminar procura';
$labels['import'] = 'Importar';
$labels['importcontacts'] = 'Importar contactos';
$labels['importfromfile'] = 'Importar desde ficheiro:';
-$labels['importreplace'] = 'Substituír completamente o caderno de enderezos';
-$labels['importdesc'] = 'Pode cargar contactos desde un caderno de enderezos preexistente.<br/>Pódense importar enderezos en formato <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> ou CSV (valores separados por comas)';
-$labels['done'] = 'Rematado';
+$labels['importtarget'] = 'Engadir contactos a';
+$labels['importreplace'] = 'Substituír completamente a Axenda de enderezos';
+$labels['importgroups'] = 'Importar atribucións do grupo';
+$labels['importgroupsall'] = 'Todos (crear grupos, se for necesario)';
+$labels['importgroupsexisting'] = 'Só para os grupos existentes';
+$labels['importdesc'] = 'Podes engadir contactos desde unha axenda de enderezos xa existente.<br/>Pódense importar enderezos en formato <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> ou CSV (valores separados por comas)';
+$labels['done'] = 'Feito!';
$labels['settingsfor'] = 'Axustes de';
$labels['about'] = 'Acerca de';
$labels['preferences'] = 'Preferencias';
-$labels['userpreferences'] = 'Preferencias de usuario';
-$labels['editpreferences'] = 'Editar preferencias de usuario';
+$labels['userpreferences'] = 'Preferencias de utente';
+$labels['editpreferences'] = 'Editar preferencias de utente';
$labels['identities'] = 'Identidades';
$labels['manageidentities'] = 'Administrar as identidades desta conta';
$labels['newidentity'] = 'Nova identidade';
@@ -333,14 +350,14 @@ $labels['messagepart'] = 'Parte';
$labels['digitalsig'] = 'Sinatura dixital';
$labels['dateformat'] = 'Formato da data';
$labels['timeformat'] = 'Formato da hora';
-$labels['prettydate'] = 'Data decorada';
+$labels['prettydate'] = 'Data sinalada';
$labels['setdefault'] = 'Usar como predeterminada';
$labels['autodetect'] = 'Detectar automáticamente';
-$labels['language'] = 'Linguaxe';
+$labels['language'] = 'Lingua';
$labels['timezone'] = 'Zona horaria';
$labels['pagesize'] = 'Liñas por páxina';
$labels['signature'] = 'Sinatura';
-$labels['dstactive'] = 'Cambio de hora según horario de verán';
+$labels['dstactive'] = 'Mudar a hora según horario de verán';
$labels['showinextwin'] = 'Abrir a mensaxe nunha nova xanela';
$labels['composeextwin'] = 'Redactar nunha xanela nova';
$labels['htmleditor'] = 'Redactar mensaxes HTML';
@@ -350,24 +367,24 @@ $labels['htmlsignature'] = 'Sinatura HTML';
$labels['showemail'] = 'Amosar enderezo de correo co nome en pantalla';
$labels['previewpane'] = 'Amosar previsualización';
$labels['skin'] = 'Aspecto da interface';
-$labels['logoutclear'] = 'Baleirar o cubo do lixo ao saír';
+$labels['logoutclear'] = 'Baleirar o lixo ao saír';
$labels['logoutcompact'] = 'Compactar a caixa de entrada ao saír';
-$labels['uisettings'] = 'Interface de usuario';
+$labels['uisettings'] = 'Interface de utente';
$labels['serversettings'] = 'Axustes do servidor';
-$labels['mailboxview'] = 'Vista das caixas de correo';
+$labels['mailboxview'] = 'Vista da caixa de correo';
$labels['mdnrequests'] = 'Cando se solicitan notificacións da entrega';
-$labels['askuser'] = 'preguntarme qué facer';
+$labels['askuser'] = 'preguntarme que facer';
$labels['autosend'] = 'enviar automáticamente';
-$labels['autosendknown'] = 'enviar aos meus contactos, noutros casos preguntarme';
+$labels['autosendknown'] = 'enviar aos meus contactos, noutros casos preguntar';
$labels['autosendknownignore'] = 'enviar aos meus contactos, noutros casos ignorar';
$labels['ignore'] = 'ignorar';
$labels['readwhendeleted'] = 'Marcar a mensaxe como lida ao eliminar';
-$labels['flagfordeletion'] = 'Marcar a mensaxe para eliminar no canto de eliminar';
+$labels['flagfordeletion'] = 'Marcar a mensaxe para eliminar en vez de eliminar';
$labels['skipdeleted'] = 'Non amosar as mensaxes marcadas como eliminadas';
-$labels['deletealways'] = 'Eliminar as mensaxes aínda que non se poidan gardar no cubo do lixo';
+$labels['deletealways'] = 'Se falla Mover mensaxes para o lixo, eliminalas';
$labels['deletejunk'] = 'Borrar automáticamente as mensaxes no cartafol "Correo lixo"';
$labels['showremoteimages'] = 'Amosar as imaxes remotas';
-$labels['fromknownsenders'] = 'de remitentes coñecidos';
+$labels['fromknownsenders'] = 'con remite coñecido';
$labels['always'] = 'sempre';
$labels['showinlineimages'] = 'Amosar as imaxes anexas baixo a mensaxe';
$labels['autosavedraft'] = 'Gardar borrador automáticamente';
@@ -383,27 +400,27 @@ $labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Conforme ao RFC 2047 (outros)';
$labels['force7bit'] = 'Usar MIME para codificar caracteres de 8 bits';
$labels['advancedoptions'] = 'Opcións avanzadas';
-$labels['focusonnewmessage'] = 'Enfocar o navegador se hai mensaxes novas';
-$labels['checkallfolders'] = 'Procurar novas mensaxes en tódolos cartafoles';
+$labels['focusonnewmessage'] = 'Centrar a xanela do navegador en novas mensaxes';
+$labels['checkallfolders'] = 'Procurar novas mensaxes en todos os cartafoles';
$labels['displaynext'] = 'Logo de eliminar ou mover unha mensaxe ir á mensaxe seguinte';
$labels['defaultfont'] = 'Fonte por defecto da mensaxe HTML';
$labels['mainoptions'] = 'Opcións principais';
$labels['browseroptions'] = 'Opcións do navegador';
$labels['section'] = 'Sección';
$labels['maintenance'] = 'Mantemento';
-$labels['newmessage'] = 'Mensaxes novas';
+$labels['newmessage'] = 'Nova mensaxe';
$labels['signatureoptions'] = 'Opcións da firma';
-$labels['whenreplying'] = 'Ao respostar';
+$labels['whenreplying'] = 'Ao responder';
$labels['replyempty'] = 'non citar a mensaxe orixinal';
-$labels['replytopposting'] = 'comezar a nova mensaxe enriba da orixinal';
-$labels['replybottomposting'] = 'comezar a nova mensaxe embaixo da orixinal';
-$labels['replyremovesignature'] = 'Eliminar a firma do remitente ao respostar';
+$labels['replytopposting'] = 'comezar a nova mensaxe antes da orixinal';
+$labels['replybottomposting'] = 'comezar a nova mensaxe despois da orixinal';
+$labels['replyremovesignature'] = 'Eliminar a firma do remite ao respostar';
$labels['autoaddsignature'] = 'Engadir firma automáticamente';
$labels['newmessageonly'] = 'só nas mensaxes novas';
$labels['replyandforwardonly'] = 'só nas respostas e reenvíos';
$labels['insertsignature'] = 'Engadir firma';
$labels['previewpanemarkread'] = 'Marcar como lidas as mensaxes previsualizadas';
-$labels['afternseconds'] = 'logo de $n segundos';
+$labels['afternseconds'] = 'despois de $n segundos';
$labels['reqmdn'] = 'Solicitar sempre unha notificación da entrega';
$labels['reqdsn'] = 'Solicitar sempre unha notificación do estado de envío';
$labels['replysamefolder'] = 'Deixar as respostas no cartafol onde está a mensaxe á que se responde';
@@ -421,10 +438,13 @@ $labels['standardwindows'] = 'Manexar avisos emerxentes como xanelas estándar';
$labels['forwardmode'] = 'Reenvio de mensaxes';
$labels['inline'] = 'inserido';
$labels['asattachment'] = 'coma anexo';
+$labels['replyallmode'] = 'Acción dpor defecto do botón [Responder a todos]';
+$labels['replyalldefault'] = 'responder a todos';
+$labels['replyalllist'] = 'responder só para a lista (se for atopada)';
$labels['folder'] = 'Cartafol';
$labels['folders'] = 'Cartafoles';
$labels['foldername'] = 'Nome do cartafol';
-$labels['subscribed'] = 'Subscrito';
+$labels['subscribed'] = 'Subscrito(a)';
$labels['messagecount'] = 'Mensaxes';
$labels['create'] = 'Crear';
$labels['createfolder'] = 'Crear un novo cartafol';
@@ -432,14 +452,14 @@ $labels['managefolders'] = 'Xestionar cartafoles';
$labels['specialfolders'] = 'Cartafoles especiais';
$labels['properties'] = 'Propiedades';
$labels['folderproperties'] = 'Propiedades do cartafol';
-$labels['parentfolder'] = 'Cartafol padre';
+$labels['parentfolder'] = 'Cartafol principal';
$labels['location'] = 'Situación';
$labels['info'] = 'Información';
-$labels['getfoldersize'] = 'Prema para calcular o tamaño do cartafol';
-$labels['changesubscription'] = 'Prema para trocar a subscrición';
+$labels['getfoldersize'] = 'Preme para calcular o tamaño do cartafol';
+$labels['changesubscription'] = 'Preme para mudar a subscrición';
$labels['foldertype'] = 'Tipo do cartafol';
$labels['personalfolder'] = 'Cartafol privado';
-$labels['otherfolder'] = 'Cartafol de outro usuario';
+$labels['otherfolder'] = 'Cartafol de outra persoa usuaria';
$labels['sharedfolder'] = 'Cartafol público';
$labels['sortby'] = 'Ordenar por';
$labels['sortasc'] = 'Orde ascendente';
diff --git a/program/localization/gl_ES/messages.inc b/program/localization/gl_ES/messages.inc
index 599f2ce41..069ff5d42 100644
--- a/program/localization/gl_ES/messages.inc
+++ b/program/localization/gl_ES/messages.inc
@@ -16,23 +16,23 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
$messages['errortitle'] = 'Ocurreu un erro!';
-$messages['loginfailed'] = 'O contrasinal ou o nome de usuario son incorrectos.';
-$messages['cookiesdisabled'] = 'O seu navegador non acepta galletas.';
-$messages['sessionerror'] = 'A súa sesión non é válida ou expirou.';
+$messages['loginfailed'] = 'O contrasinal ou o nome de utente son incorrectos.';
+$messages['cookiesdisabled'] = 'O teu navegador non acepta cookies.';
+$messages['sessionerror'] = 'A tú sesión non é válida ou expirou.';
$messages['storageerror'] = 'Fallou a conexión co servidor IMAP.';
$messages['servererror'] = 'Erro do servidor!';
$messages['servererrormsg'] = 'Erro do servidor: $msg';
$messages['dberror'] = 'Erro na base de datos!';
$messages['requesttimedout'] = 'A petición expirou';
-$messages['errorreadonly'] = 'Non foi posible realizar a operación. O cartafol é de só lectura.';
-$messages['errornoperm'] = 'Non foi posible realizar a operación. Permiso denegado.';
-$messages['erroroverquota'] = 'Non se pode realizar a operación, non hai espacio no disco.';
-$messages['erroroverquotadelete'] = 'Non hai espacio no disco. Utilice Maiúsculas+Supr para borrar unha mensaxe.';
-$messages['invalidrequest'] = 'Petición inválida!. Non se gardou ningún dato.';
+$messages['errorreadonly'] = 'Non foi posíbel realizar a operación. O cartafol é de só lectura.';
+$messages['errornoperm'] = 'Non foi posíbel realizar a operación. Permiso denegado.';
+$messages['erroroverquota'] = 'Non se pode realizar a operación, non hai espazo no disco.';
+$messages['erroroverquotadelete'] = 'Non hai espazo no disco. Usa Maiúsculas+Supr para borrar unha mensaxe.';
+$messages['invalidrequest'] = 'Petición non válida! Non se gardou ningún dato.';
$messages['invalidhost'] = 'O nome do servidor non é válido.';
$messages['nomessagesfound'] = 'Non se atoparon mensaxes nesta caixa de correo.';
-$messages['loggedout'] = 'Rematou correctamente a súa sesión. Ata logo!';
-$messages['mailboxempty'] = 'A caixa de correo está vacía.';
+$messages['loggedout'] = 'Rematou correctamente a tú sesión. Até logo!';
+$messages['mailboxempty'] = 'A caixa de correo está baleira.';
$messages['refreshing'] = 'A refrescar...';
$messages['loading'] = 'Cargando...';
$messages['uploading'] = 'Cargando ficheiro...';
@@ -42,44 +42,49 @@ $messages['checkingmail'] = 'Ã procura de novas mensaxes...';
$messages['sendingmessage'] = 'Enviando mensaxe...';
$messages['messagesent'] = 'A mensaxe enviouse correctamente.';
$messages['savingmessage'] = 'Gardando mensaxe...';
-$messages['messagesaved'] = 'A mensaxe gardouse en "Borradores';
+$messages['messagesaved'] = 'A mensaxe gardouse en "Borradores"';
$messages['successfullysaved'] = 'Gardado correctamente.';
-$messages['addedsuccessfully'] = 'O contacto engadiuse correctamente ao caderno de enderezos.';
+$messages['savingresponse'] = 'Gardar texto de resposta...';
+$messages['deleteresponseconfirm'] = 'Realmente queres borrar este texto de resposta?';
+$messages['addedsuccessfully'] = 'O contacto engadiuse correctamente á Axenda de enderezos.';
$messages['contactexists'] = 'Xa existe un contacto con este enderezo de correo electrónico.';
$messages['contactnameexists'] = 'Xa existe un contacto con este nome.';
-$messages['blockedimages'] = 'Estanse a bloquear as imaxes remotas para protexer a súa privacidade.';
-$messages['encryptedmessage'] = 'Non se pode amosar a mensaxe porque está cifrada.';
+$messages['blockedimages'] = 'Estanse a bloquear as imaxes remotas para protexer a túa privacidade.';
+$messages['encryptedmessage'] = 'Sentímolo! Non se pode amosar a mensaxe porque está cifrada.';
$messages['nocontactsfound'] = 'Non se atoparon contactos.';
$messages['contactnotfound'] = 'Non se atopou o contacto solicitado.';
-$messages['contactsearchonly'] = 'Introduza algún termo para atopar contactos';
+$messages['contactsearchonly'] = 'Introduce algún termo para atopar contactos';
$messages['sendingfailed'] = 'Fallou o envío da mensaxe.';
-$messages['senttooquickly'] = 'Por favor, espere $sec segundos antes de enviar esta mensaxe.';
-$messages['errormoving'] = 'Non foi posible mover a(s) mensaxe(s).';
-$messages['errorcopying'] = 'Non foi posible copiar a(s) mensaxe(s).';
-$messages['errordeleting'] = 'Non foi posible eliminar a(s) mensaxe(s).';
-$messages['errormarking'] = 'Non foi posible marcar a(s) mensaxe(s).';
-$messages['deletecontactconfirm'] = 'Quere eliminar o(s) contacto(s) seleccionado(s)?';
-$messages['deletegroupconfirm'] = 'Quere eliminar o grupo seleccionado?';
-$messages['deletemessagesconfirm'] = 'Quere eliminar a(s) mensaxe(s) seleccionadas?';
-$messages['deletefolderconfirm'] = 'Quere eliminar este cartafol?';
-$messages['purgefolderconfirm'] = 'Quere eliminar tódalas mensaxes neste cartafol?';
+$messages['senttooquickly'] = 'Por favor, espera $sec segundos antes de enviar esta mensaxe.';
+$messages['errorsavingsent'] = 'Houbo un erro ao gardar a mensaxe enviada.';
+$messages['errorsaving'] = 'Houbo un erro ao gardar.';
+$messages['errormoving'] = 'Non foi posíbel mover a(s) mensaxe(s).';
+$messages['errorcopying'] = 'Non foi posíbel copiar a(s) mensaxe(s).';
+$messages['errordeleting'] = 'Non foi posíbel eliminar a(s) mensaxe(s).';
+$messages['errormarking'] = 'Non foi posíbel marcar a(s) mensaxe(s).';
+$messages['deletecontactconfirm'] = 'Queres eliminar o(s) contacto(s) seleccionado(s)?';
+$messages['deletegroupconfirm'] = 'Queres eliminar o grupo seleccionado?';
+$messages['deletemessagesconfirm'] = 'Queres eliminar a(s) mensaxe(s) seleccionadas?';
+$messages['deletefolderconfirm'] = 'Queres eliminar este cartafol?';
+$messages['purgefolderconfirm'] = 'Queres eliminar todas as mensaxes neste cartafol?';
$messages['contactdeleting'] = 'Eliminando o(s) contacto(s)...';
$messages['groupdeleting'] = 'Eliminando o grupo...';
$messages['folderdeleting'] = 'Eliminando o cartafol...';
$messages['foldermoving'] = 'Movendo o cartafol...';
$messages['foldersubscribing'] = 'Subscribindo o cartafol...';
$messages['folderunsubscribing'] = 'Desubscribindo o cartafol...';
-$messages['formincomplete'] = 'Non se cumprimentou completamente o formulario.';
-$messages['noemailwarning'] = 'Por favor, introduza un enderezo de correo electrónico válido.';
-$messages['nonamewarning'] = 'Por favor, introduza un nome.';
-$messages['nopagesizewarning'] = 'Por favor, introduza un tamaño de páxina.';
-$messages['nosenderwarning'] = 'Por favor, introduza o enderezo de correo electrónico do remitente.';
-$messages['norecipientwarning'] = 'Por favor, introduza polo menos un destinatario.';
-$messages['nosubjectwarning'] = 'O campo "Asunto" está baleiro. Desexa completalo?';
-$messages['nobodywarning'] = 'Quere enviar esta mensaxe sen texto?';
-$messages['notsentwarning'] = 'A mensaxe non se enviou. Quere descartala?';
-$messages['noldapserver'] = 'Por favor, elixa un servidor LDAP para buscar.';
-$messages['nosearchname'] = 'Por favor, introduza un nome ou un enderezo de correo electrónico.';
+$messages['formincomplete'] = 'O formulario non foi completamente cuberto.';
+$messages['noemailwarning'] = 'Por favor, engade un enderezo de correo electrónico válido.';
+$messages['nonamewarning'] = 'Por favor, engade un nome.';
+$messages['nopagesizewarning'] = 'Por favor, engade un tamaño de páxina.';
+$messages['nosenderwarning'] = 'Por favor, engade o enderezo de correo electrónico do remite.';
+$messages['norecipientwarning'] = 'Por favor, engade polo menos unha persoa destinataria.';
+$messages['nosubjectwarning'] = 'O campo "Asunto" está baleiro. Queres completalo?';
+$messages['nobodywarning'] = 'Queres enviar esta mensaxe sen texto?';
+$messages['notsentwarning'] = 'A mensaxe non se enviou. Queres descartala?';
+$messages['restoresavedcomposedata'] = 'Foi atopada unha mensaxe que non se enviara.\n\nSubject: $subject\nSaved: $date\n\n¿queres restaurar esta mensaxe?';
+$messages['noldapserver'] = 'Por favor, elixe un servidor LDAP para buscar.';
+$messages['nosearchname'] = 'Por favor, engade un nome ou un enderezo de correo electrónico.';
$messages['notuploadedwarning'] = 'Aínda non se cargaron tódolos ficheiros. Por favor, agarde ou cancele a carga.';
$messages['searchsuccessful'] = 'Atopáronse $nr mensaxes.';
$messages['contactsearchsuccessful'] = 'Atopáronse $nr contactos.';
@@ -87,79 +92,85 @@ $messages['searchnomatch'] = 'A busca non atopou coincidencias.';
$messages['searching'] = 'Buscando...';
$messages['checking'] = 'Comprobando...';
$messages['nospellerrors'] = 'Non hai erros ortográficos.';
-$messages['folderdeleted'] = 'O cartafol eliminouse correctamente.';
-$messages['foldersubscribed'] = 'O cartafol suscribiuse correctamente.';
-$messages['folderunsubscribed'] = 'O cartafol desuscribiuse correctamente.';
+$messages['folderdeleted'] = 'O cartafol foi eliminado correctamente.';
+$messages['foldersubscribed'] = 'O cartafol subscribiuse correctamente.';
+$messages['folderunsubscribed'] = 'O cartafol desubscribiuse correctamente.';
$messages['folderpurged'] = 'O cartafol purgouse correctamente.';
$messages['folderexpunged'] = 'O cartafol baleirouse correctamente.';
$messages['deletedsuccessfully'] = 'Eliminouse correctamente.';
$messages['converting'] = 'Eliminando o formato da mensaxe...';
-$messages['messageopenerror'] = 'Non foi posible cargar a mensaxe desde o servidor.';
+$messages['messageopenerror'] = 'Non foi posíbel cargar a mensaxe desde o servidor.';
$messages['fileuploaderror'] = 'Fallou a carga do ficheiro.';
$messages['filesizeerror'] = 'O ficheiro cargado é máis grande que o tamaño máximo de $size.';
-$messages['sourceisreadonly'] = 'A orixe é de só lectura.';
-$messages['errorsavingcontact'] = 'Non foi posible gardar o contacto.';
+$messages['copysuccess'] = 'Copiáronse correctamente $nr contactos.';
+$messages['movesuccess'] = 'Movidos con suceso $nr contactos.';
+$messages['copyerror'] = 'Non foi posíbel copiar contactos.';
+$messages['moveerror'] = 'Non foi posíbel mover contactos.';
+$messages['sourceisreadonly'] = 'Este enderezo de orixe é de só lectura.';
+$messages['errorsavingcontact'] = 'Non foi posíbel gardar o contacto.';
$messages['movingmessage'] = 'Movendo a(s) mensaxe(s)...';
$messages['copyingmessage'] = 'Copiando a(s) mensaxe(s)...';
$messages['copyingcontact'] = 'Copiando o(s) contacto(s)...';
+$messages['movingcontact'] = 'Movendo contacto(s)...';
$messages['deletingmessage'] = 'Eliminando a(s) mensaxe(s)...';
$messages['markingmessage'] = 'Marcando a(s) mensaxe(s)...';
$messages['addingmember'] = 'Engadindo o(s) contacto(s) ao grupo...';
$messages['removingmember'] = 'Eliminando o(s) contacto(s) do grupo...';
$messages['receiptsent'] = 'A notificación da entrega enviouse correctamente.';
-$messages['errorsendingreceipt'] = 'Non foi posible enviar a notificación da entrega.';
-$messages['deleteidentityconfirm'] = 'Quere eliminar esta identidade?';
-$messages['nodeletelastidentity'] = 'Non pode eliminar esta identidade, é a última.';
-$messages['forbiddencharacter'] = 'O nome do cartafol contén un carácter non válido.';
-$messages['selectimportfile'] = 'Por favor, escolla un ficheiro para cargar.';
-$messages['addresswriterror'] = 'Non se pode escribir no caderno de enderezos que escolleu.';
+$messages['errorsendingreceipt'] = 'Non foi posíbel enviar a notificación da entrega.';
+$messages['deleteidentityconfirm'] = 'Queres eliminar esta identidade?';
+$messages['nodeletelastidentity'] = 'Non podes eliminar esta identidade, é a última.';
+$messages['forbiddencharacter'] = 'O nome do cartafol contén un caracter non válido.';
+$messages['selectimportfile'] = 'Por favor, escolle un ficheiro para cargar.';
+$messages['addresswriterror'] = 'Non se pode escribir na Axenda de enderezos que escolleches.';
$messages['contactaddedtogroup'] = 'Engadiuse correctamente o contacto a este grupo.';
$messages['contactremovedfromgroup'] = 'Suprimiuse correctamente o contacto deste grupo.';
$messages['nogroupassignmentschanged'] = 'Non cambiou ningunha asignación de grupo.';
-$messages['importwait'] = 'A importar. Por favor, agarde...';
+$messages['importwait'] = 'A importar. Por favor, agarda...';
$messages['importformaterror'] = 'Fallou a importación! O ficheiro cargado non contén datos válidos.';
-$messages['importconfirm'] = '<b>Importáronse correctamente $inserted contactos. Ignoráronse $skipped contactos que xa existían</b>:<p><em>$names</em></p>';
+$messages['importconfirm'] = '<b>Importáronse correctamente $inserted contactos</b>';
$messages['importconfirmskipped'] = '<b>Ignoráronse $skipped existing entradas</b>';
-$messages['importmessagesuccess'] = 'Importados $nr mensaxes con éxito';
-$messages['importmessageerror'] = 'Fallou a importación! O arquivo subido non é unha mensaxe válida ou un ficheiro de caixa de correo';
+$messages['importmessagesuccess'] = 'Importadas $nr mensaxes con éxito';
+$messages['importmessageerror'] = 'Fallou a importación! O arquivo subido non é unha mensaxe válida ou un ficheiro de correo';
$messages['opnotpermitted'] = 'Operación non permitida!';
-$messages['nofromaddress'] = 'Falta o enderezo de correo electrónico na identidade que escolleu.';
-$messages['editorwarning'] = 'Se troca neste intre ao editor de texto plano, vai perder todo o formato do texto. Quere continuar?';
-$messages['httpreceivedencrypterror'] = 'Produciuse un erro fatal de configuración. Contacte ao administrador inmediatamente. <b>Non se enviou a súa mensaxe.</b>';
+$messages['nofromaddress'] = 'Falta o enderezo de correo electrónico na identidade que escolleches.';
+$messages['editorwarning'] = 'Se mudas agora ao editor de texto plano, vas perder todo o formato do texto. Queres continuar?';
+$messages['httpreceivedencrypterror'] = 'Produciuse un erro fatal de configuración. Contacta coa persoa administradora inmediatamente. <b>Non se enviou a túa mensaxe.</b>';
$messages['smtpconnerror'] = 'Erro SMTP ($code): Fallou a conexión co servidor.';
$messages['smtpautherror'] = 'Erro SMTP ($code): Fallou a autenticación.';
-$messages['smtpfromerror'] = 'Erro SMTP ($code): Non foi posible establecer o remitente "$from" ($msg).';
-$messages['smtptoerror'] = 'Erro SMTP ($code): Non foi posible engadir o destinatario "$to" ($msg).';
-$messages['smtprecipientserror'] = 'Erro SMTP: Non se pode analizar a lista de destinatarios.';
+$messages['smtpfromerror'] = 'Erro SMTP ($code): Non foi posíbel estabelecer o remite "$from" ($msg).';
+$messages['smtptoerror'] = 'Erro SMTP ($code): Non foi posíbel engadir a persoa destinataria "$to" ($msg).';
+$messages['smtprecipientserror'] = 'Erro SMTP: Non se pode analizar a lista de persoas destinatarias.';
$messages['smtperror'] = 'Erro SMTP: $msg';
$messages['emailformaterror'] = 'O enderezo de correo electrónico é incorrecto: $email.';
-$messages['toomanyrecipients'] = 'Especificou destinatarios de máis. Por favor, redúzaos a un máximo de $max.';
-$messages['maxgroupmembersreached'] = 'O número de membros do grupo excede o máximo de $max.';
-$messages['contactdelerror'] = 'Non foi posible eliminar o(s) contacto(s).';
+$messages['toomanyrecipients'] = 'Especificou persoas destinatarias de máis. Por favor, redúceas a un máximo de $max.';
+$messages['maxgroupmembersreached'] = 'O número de integrantes do grupo excede o máximo de $max.';
+$messages['internalerror'] = 'Produciuse un erro interno. Por favor, téntao de novo.';
+$messages['contactdelerror'] = 'Non foi posíbel eliminar o(s) contacto(s).';
$messages['contactdeleted'] = 'Borráronse correctamente o(s) contacto(s).';
-$messages['contactrestoreerror'] = 'Non foi posible restaurar o(s) contacto(s) borrado(s).';
+$messages['contactrestoreerror'] = 'Non foi posíbel restaurar o(s) contacto(s) borrado(s).';
$messages['contactrestored'] = 'Restauráronse correctamente o(s) contacto(s).';
$messages['groupdeleted'] = 'Borrouse correctamente o grupo.';
$messages['grouprenamed'] = 'Mudouse correctamente o nome do grupo.';
$messages['groupcreated'] = 'Creouse correctamente o grupo.';
-$messages['savedsearchdeleted'] = 'Borrouse correctamente a procura gardada.';
-$messages['savedsearchdeleteerror'] = 'Non foi posible borrar a procura gardada.';
-$messages['savedsearchcreated'] = 'Creouse correctamente a procura gardada.';
-$messages['savedsearchcreateerror'] = 'Non foi posible crear a procura gardada.';
+$messages['savedsearchdeleted'] = 'Borrouse correctamente a busca gardada.';
+$messages['savedsearchdeleteerror'] = 'Non foi posíbel eliminar a busca gardada.';
+$messages['savedsearchcreated'] = 'Creouse correctamente a busca gardada.';
+$messages['savedsearchcreateerror'] = 'Non foi posíbel crear a busca gardada.';
$messages['messagedeleted'] = 'Borráronse correctamente a(s) mensaxe(s).';
$messages['messagemoved'] = 'Movéronse correctamente a(s) mensaxe(s).';
$messages['messagecopied'] = 'Copiáronse correctamente a(s) mensaxe(s).';
$messages['messagemarked'] = 'Marcáronse correctamente a(s) mensaxe(s).';
-$messages['autocompletechars'] = 'Introduza polo menos $min caracteres para autocompletar.';
-$messages['autocompletemore'] = 'Atopáronse máis entradas concidintes. Por favor, introduza máis caracteres.';
+$messages['autocompletechars'] = 'Engade polo menos $min caracteres para autocompletar.';
+$messages['autocompletemore'] = 'Atopáronse máis entradas concidintes. Por favor, engade máis caracteres.';
$messages['namecannotbeempty'] = 'O nome non pode estar baleiro.';
$messages['nametoolong'] = 'O nome é longo de máis.';
$messages['folderupdated'] = 'O cartafol actualizouse correctamente.';
$messages['foldercreated'] = 'O cartafol creouse correctamente.';
$messages['invalidimageformat'] = 'O formato da imaxe non é válido.';
$messages['mispellingsfound'] = 'Atopáronse erros ortográficos na mensaxe.';
-$messages['parentnotwritable'] = 'Non foi posible crear/mover o cartafol no cartafol padre escollido porque non ten permisos.';
+$messages['parentnotwritable'] = 'Non foi posíbel crear/mover o cartafol para o cartafol principal que selecionaches porque non tes permisos.';
$messages['messagetoobig'] = 'A mensaxe é demasiado grande para procesala';
-$messages['attachmentvalidationerror'] = 'ATENCIÓN! Este anexo é sospeitoso porque o seu tipo non coincide o tipo declarado na mensaxe. Se non confía no remitente, non debería abrilo, porque podería conter un virus ou malware.<br/><br/><em>Tipo agardado: $expected; Tipo detectado: $detected</em>';
+$messages['attachmentvalidationerror'] = 'ATENCIÓN! Este anexo é sospeitoso porque o seu tipo non coincide co tipo declarado na mensaxe. Se non confías no remite, non deberías abrilo, porque podería conter un virus ou malware.<br/><br/><em>Tipo agardado: $expected; Tipo detectado: $detected</em>';
$messages['noscriptwarning'] = 'Atención: Este servicio de correo web precisa de Javascript!. Por favor, active javascript nas opción do seu navegador.';
?>
diff --git a/program/localization/he_IL/labels.inc b/program/localization/he_IL/labels.inc
index ad9a91adc..66c4a26b3 100644
--- a/program/localization/he_IL/labels.inc
+++ b/program/localization/he_IL/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to מתוך $count';
$labels['copy'] = 'העתק';
$labels['move'] = 'העבר';
$labels['moveto'] = 'תיוק ב...';
+$labels['copyto'] = 'העתקה ×ל...';
$labels['download'] = 'הורדה';
$labels['open'] = 'לפתוח';
$labels['showattachment'] = 'הצגה';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = '×יות';
$labels['checkspelling'] = 'בדיקת ×יות';
$labels['resumeediting'] = 'המשך עריכה';
$labels['revertto'] = 'חזור למצב קוד×';
+$labels['restore'] = 'שיחזור';
+$labels['restoremessage'] = 'לשחזר הודעה?';
+$labels['responses'] = 'תגובות';
+$labels['insertresponse'] = 'הכנסת תגובה';
+$labels['manageresponses'] = 'ניהול תגובות';
+$labels['savenewresponse'] = 'שמירת תגובה חדשה';
+$labels['editresponses'] = 'עריכת תגובות';
+$labels['editresponse'] = 'עריכת תגובה';
+$labels['responsename'] = 'ש×';
+$labels['responsetext'] = 'גוף התגובה';
$labels['attach'] = 'צירוף';
$labels['attachments'] = 'צרופות';
$labels['upload'] = 'העל××”';
@@ -316,7 +327,11 @@ $labels['searchdelete'] = 'מחיקת החיפוש';
$labels['import'] = 'ייבו×';
$labels['importcontacts'] = '×™×™×‘×•× ×נשי קשר';
$labels['importfromfile'] = '×™×™×‘×•× ×ž×§×•×‘×¥';
+$labels['importtarget'] = 'הוספת ×נשי קשר ×ל ';
$labels['importreplace'] = 'החלפת כל פנקס הכתובות';
+$labels['importgroups'] = '×™×™×‘×•× ×”×’×“×¨×•×ª קבוצה';
+$labels['importgroupsall'] = 'הכל (יש ×œ×”×§×™× ×§×‘×•×¦×•×ª ×× ×¦×¨×™×š)';
+$labels['importgroupsexisting'] = 'רק עבור קבוצות קיימות';
$labels['importdesc'] = 'ניתן לטעון ×נשי קשר מקובץ חיצוני. ×נו ×ª×•×ž×›×™× ×‘×§×‘×¦×™× ×”×¢×¨×•×›×™× ×‘×¦×•×¨×” של
<a href="http://en.wikipedia.org/wiki/VCard">vCard</a> ×ו
CSV המופרד על ידי פסיקי×.';
@@ -426,6 +441,9 @@ $labels['standardwindows'] = 'חלונות ×§×•×¤×¦×™× ×™×˜×•×¤×œ×• כחלונ×
$labels['forwardmode'] = 'הפנית הודעות';
$labels['inline'] = 'חלק מההודעה';
$labels['asattachment'] = 'כצרופה';
+$labels['replyallmode'] = 'ברירת המחדל של כפתור [מענה לכול×]';
+$labels['replyalldefault'] = 'מענה לכול×';
+$labels['replyalllist'] = 'מענה לרשימת תפוצה בלבד (×× ×§×™×™×ž×ª)';
$labels['folder'] = 'תיק';
$labels['folders'] = 'תיקיות';
$labels['foldername'] = '×©× ×ª×™×§';
diff --git a/program/localization/he_IL/messages.inc b/program/localization/he_IL/messages.inc
index b7e7d1ae8..a2af10081 100644
--- a/program/localization/he_IL/messages.inc
+++ b/program/localization/he_IL/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,6 @@ $messages['invalidrequest'] = 'בקשה ×œ× ×—×•×§×™×ª. המידע ×œ× × ×©×ž×
$messages['invalidhost'] = '×©× ×©×¨×ª ×œ× ×—×•×§×™';
$messages['nomessagesfound'] = '×œ× × ×ž×¦×ו הודעות בתיבה זו';
$messages['loggedout'] = 'הקשר הסתיי×. להתר×ות!';
-$messages['mailboxempty'] = 'רשימת ההודעות ריקה';
$messages['refreshing'] = 'מרענן...';
$messages['loading'] = 'טעינה...';
$messages['uploading'] = 'קובץ עולה...';
@@ -44,6 +43,8 @@ $messages['messagesent'] = 'ההודעה נמסרה בהצלחה';
$messages['savingmessage'] = 'שמירת הודעה...';
$messages['messagesaved'] = 'ההודעה נשמרה כטיוטה';
$messages['successfullysaved'] = 'נשמרה בהצלחה';
+$messages['savingresponse'] = 'שמירת תגובה...';
+$messages['deleteresponseconfirm'] = '×”×× ×œ×ž×—×•×§ ×ת התגובה?';
$messages['addedsuccessfully'] = '×יש הקשר נוסף לפנקס בהצלחה';
$messages['contactexists'] = '×§×™×™× ×›×‘×¨ ×יש קשר ×¢× ×›×ª×•×‘×ª דו×"ל זו';
$messages['contactnameexists'] = '×§×™×™× ×›×‘×¨ ×יש קשר בעל ×ותו ש×';
@@ -54,6 +55,8 @@ $messages['contactnotfound'] = '×יש הקשר המבוקש ×œ× × ×ž×¦×';
$messages['contactsearchonly'] = 'יש להקיש מפתחות חיפוש כדי ×œ×ž×¦×•× ×נשי קשר';
$messages['sendingfailed'] = 'שליחת ההודעה נכשלה';
$messages['senttooquickly'] = '× × ×œ×”×ž×ª×™×Ÿ $sec שניות לפני מסירת הודעה זו';
+$messages['errorsavingsent'] = '×ירעה שגי××” בזמן שמירת ההודעה שנשלחה';
+$messages['errorsaving'] = '×ירעה שגי××” בזמן השמירה';
$messages['errormoving'] = '×œ× × ×™×ª×Ÿ לתייק ×ת ההודעה';
$messages['errorcopying'] = 'העתקת ההודעות נכשלה';
$messages['errordeleting'] = '×œ× × ×™×ª×Ÿ למחוק ×ת ההודעה';
@@ -78,6 +81,7 @@ $messages['norecipientwarning'] = '× × ×œ×”×•×¡×™×£ לפחות נמען ×חד'
$messages['nosubjectwarning'] = 'שורת ×”× ×•×©× ×¨×™×§×”. ×”×× ×‘×¨×¦×•× ×š להוסיף × ×•×©× ×›×¢×ª?';
$messages['nobodywarning'] = '×”×× ×œ×©×œ×•×— הודעה ×œ×œ× ×ª×•×›×Ÿ?';
$messages['notsentwarning'] = 'ההודעה ×œ× × ×©×œ×—×”. ×”×× ×œ×‘×˜×œ?';
+$messages['restoresavedcomposedata'] = 'נמצ××” הודעה שנערכה ×ך ×œ× × ×©×œ×—×”. \n\nSubject: $subject\nנשמרה: $date\n\n×”×× ×œ×©×—×–×¨ ×ת ההודעה?';
$messages['noldapserver'] = '× × ×œ×‘×—×•×¨ שרת כתובות לחיפוש';
$messages['nosearchname'] = '× × ×œ×”×•×¡×™×£ ×יש קשר ×ו כתובת דו×"ל';
$messages['notuploadedwarning'] = 'עדיין ×œ× ×”×•×¢×œ×• כל הקבצי×. × × ×œ×—×›×•×ª ×ו לבטל הפעולה.';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'SMTP: $msg';
$messages['emailformaterror'] = '$email כתובת דו×"ל שגויה';
$messages['toomanyrecipients'] = 'יותר מדי נמעני×. יש להקטין ×ž×¡×¤×¨× ×œ - $max';
$messages['maxgroupmembersreached'] = '×ž×¡×¤×¨× ×©×œ חברי הקבוצה ×ינו יכול לעבור $max';
+$messages['internalerror'] = 'שגי×ת מערכת. × × ×œ× ×¡×•×ª שנית.';
$messages['contactdelerror'] = '×œ× × ×™×ª×Ÿ למחוק ×יש קשר';
$messages['contactdeleted'] = '×יש הקשר נמחק';
$messages['contactrestoreerror'] = '×œ× × ×™×ª×Ÿ לשחזר ×יש קשר שנמחק';
diff --git a/program/localization/hr_HR/labels.inc b/program/localization/hr_HR/labels.inc
index 70d1c1316..cfa0ff8dd 100644
--- a/program/localization/hr_HR/labels.inc
+++ b/program/localization/hr_HR/labels.inc
@@ -29,8 +29,10 @@ $labels['drafts'] = 'Predlošci';
$labels['sent'] = 'Poslano';
$labels['trash'] = 'Smeće';
$labels['junk'] = 'Spam';
+$labels['show_real_foldernames'] = 'Prikaži prava imena specijalnih mapa';
$labels['subject'] = 'Naslov';
$labels['from'] = 'Od';
+$labels['sender'] = 'Pošiljatelj';
$labels['to'] = 'Za';
$labels['cc'] = 'Cc';
$labels['bcc'] = 'Bcc';
@@ -41,6 +43,7 @@ $labels['size'] = 'VeliÄina';
$labels['priority'] = 'Prioritet';
$labels['organization'] = 'Organizacija';
$labels['readstatus'] = 'ProÄitano';
+$labels['listoptions'] = 'Opcije lista...';
$labels['mailboxlist'] = 'Mape';
$labels['messagesfromto'] = 'Poruke od $from do $to od ukupno $count';
$labels['threadsfromto'] = 'Teme od $from do $to od ukupno $count';
@@ -50,6 +53,9 @@ $labels['copy'] = 'Kopiraj';
$labels['move'] = 'Premjesti';
$labels['moveto'] = 'Premjesti u...';
$labels['download'] = 'Preuzmi (download)';
+$labels['open'] = 'Otvori';
+$labels['showattachment'] = 'Prikaži';
+$labels['showanyway'] = 'Prikaži svejedno';
$labels['filename'] = 'Ime datoteke';
$labels['filesize'] = 'VeliÄina datoteke';
$labels['addtoaddressbook'] = 'Dodaj u imenik';
@@ -97,14 +103,14 @@ $labels['checkmail'] = 'Provjera novih poruka';
$labels['compose'] = 'Nova poruka';
$labels['writenewmessage'] = 'Stvori novu poruku';
$labels['reply'] = 'Odgovori';
-$labels['replytomessage'] = 'Odgovori na poruku';
-$labels['replytoallmessage'] = 'Odgovori pošiljaocu i svim primateljima';
+$labels['replytomessage'] = 'Odgovori pošiljatelju';
+$labels['replytoallmessage'] = 'Odgovori listi ili pošiljatelju i svim primateljima';
$labels['replyall'] = 'Odgovori svima';
$labels['replylist'] = 'Odgovori listi';
$labels['forward'] = 'Proslijedi';
-$labels['forwardinline'] = 'Proslijedi citirano';
+$labels['forwardinline'] = 'Proslijedi umetnuto';
$labels['forwardattachment'] = 'Proslijedi kao privitak';
-$labels['forwardmessage'] = 'Prosljedi poruku';
+$labels['forwardmessage'] = 'Proslijedi poruku';
$labels['deletemessage'] = 'Obriši poruku';
$labels['movemessagetotrash'] = 'Preseli poruke u smeće';
$labels['printmessage'] = 'Ispiši ovu poruku';
@@ -118,9 +124,9 @@ $labels['mark'] = 'OznaÄi';
$labels['markmessages'] = 'OznaÄi poruke';
$labels['markread'] = 'Kao proÄitano';
$labels['markunread'] = 'Kao neproÄitano';
-$labels['markflagged'] = 'Kao oznaÄenu';
-$labels['markunflagged'] = 'Kao neoznaÄenu';
-$labels['moreactions'] = 'Više akcija';
+$labels['markflagged'] = 'Kao oznaÄeno';
+$labels['markunflagged'] = 'Kao neoznaÄeno';
+$labels['moreactions'] = 'Više akcija...';
$labels['more'] = 'Više';
$labels['back'] = 'Natrag';
$labels['options'] = 'Postavke';
@@ -128,66 +134,85 @@ $labels['select'] = 'Odaberi';
$labels['all'] = 'Sve';
$labels['none'] = 'Ništa';
$labels['currpage'] = 'Trenutna stranica';
-$labels['unread'] = 'NeproÄitane';
-$labels['flagged'] = 'OznaÄene';
-$labels['unanswered'] = 'Neodgovrene';
+$labels['unread'] = 'NeproÄitano';
+$labels['flagged'] = 'OznaÄeno';
+$labels['unanswered'] = 'Neodgovoreno';
+$labels['withattachment'] = 'S privitkom';
$labels['deleted'] = 'Obrisano';
+$labels['undeleted'] = 'Neobrisano';
$labels['invert'] = 'Obrni';
$labels['filter'] = 'Filtriraj';
$labels['list'] = 'Lista';
$labels['threads'] = 'Teme';
$labels['expand-all'] = 'Proširi sve';
-$labels['expand-unread'] = 'ProÅ¡iri neproÄitane';
+$labels['expand-unread'] = 'ProÅ¡iri neproÄitano';
$labels['collapse-all'] = 'Zatvori sve';
$labels['threaded'] = 'Tematski prikaz';
$labels['autoexpand_threads'] = 'Proširi teme poruka';
-$labels['do_expand'] = 'Sve teme';
+$labels['do_expand'] = 'sve teme';
$labels['expand_only_unread'] = 'samo s neproÄitanim porukama';
$labels['fromto'] = 'Pošiljatelj/Primatelj';
$labels['flag'] = 'Oznaka';
$labels['attachment'] = 'Privitak';
$labels['nonesort'] = 'Ništa';
$labels['sentdate'] = 'Datum slanja';
-$labels['arrival'] = 'Datum primanja';
+$labels['arrival'] = 'Datum primitka';
$labels['asc'] = 'uzlazno';
$labels['desc'] = 'silazno';
-$labels['listcolumns'] = 'Kolone';
-$labels['listsorting'] = 'Sortirajuća kolona';
-$labels['listorder'] = 'Sortirajući redoslijed';
+$labels['listcolumns'] = 'Stupci';
+$labels['listsorting'] = 'Sortirajući stupac';
+$labels['listorder'] = 'Redoslijed sortiranja';
$labels['listmode'] = 'Model pregleda listi';
-$labels['folderactions'] = 'Akcije mapa';
-$labels['compact'] = 'Kompresiranje';
+$labels['folderactions'] = 'Akcije mapa...';
+$labels['compact'] = 'Kompresiraj (sažmi)';
$labels['empty'] = 'Isprazni';
-$labels['quota'] = 'Kvota';
+$labels['importmessages'] = 'Uvoz poruka';
+$labels['quota'] = 'Iskorištenost diska';
$labels['unknown'] = 'nepoznato';
-$labels['unlimited'] = 'beskonaÄna';
+$labels['unlimited'] = 'neograniÄeno';
$labels['quicksearch'] = 'Brza pretraga';
-$labels['resetsearch'] = 'Prikaži sve poruke';
+$labels['resetsearch'] = 'Vrati pretragu u poÄetno stanje';
$labels['searchmod'] = 'Postavke pretrage';
$labels['msgtext'] = 'Cijela poruka';
+$labels['body'] = 'Tijelo poruke';
+$labels['type'] = 'Tip';
+$labels['namex'] = 'Ime';
$labels['openinextwin'] = 'Otvori u novom prozoru';
-$labels['emlsave'] = 'Download (.eml)';
+$labels['emlsave'] = 'Preuzmi (.eml)';
+$labels['changeformattext'] = 'Prikaži kao obiÄan tekst';
+$labels['changeformathtml'] = 'Prikaži kao HTML';
$labels['editasnew'] = 'Uredi kao novo';
+$labels['send'] = 'Pošalji';
$labels['sendmessage'] = 'Pošalji poruku';
-$labels['savemessage'] = 'Spremi u \'Predlošci\'';
+$labels['savemessage'] = 'Spremi kao predložak';
$labels['addattachment'] = 'Priloži datoteku';
-$labels['charset'] = 'Charset';
-$labels['editortype'] = 'Tip editora';
+$labels['charset'] = 'Kodna stranica';
+$labels['editortype'] = 'Tip ureÄ‘ivaÄa teksta';
$labels['returnreceipt'] = 'Potvrda o primitku poruke';
-$labels['dsn'] = 'Potvrda o poslanoj poruci';
+$labels['dsn'] = 'Obavijest o statusu isporuke';
$labels['mailreplyintro'] = 'Dana $date, $sender je napisao(la):';
-$labels['originalmessage'] = 'Izvorna Poruka';
-$labels['editidents'] = 'Promijeni identitete';
-$labels['spellcheck'] = 'Piši';
+$labels['originalmessage'] = 'Izvorna poruka';
+$labels['editidents'] = 'Uredi identitete';
+$labels['spellcheck'] = 'Pravopis';
$labels['checkspelling'] = 'Provjera pravopisa';
-$labels['resumeediting'] = 'Povratak u pisanje';
+$labels['resumeediting'] = 'Nastavi uređivanje';
$labels['revertto'] = 'Vrati na';
+$labels['restore'] = 'Povrat';
+$labels['restoremessage'] = 'Povrat poruke?';
+$labels['responses'] = 'Odgovori';
+$labels['insertresponse'] = 'Umetni odgovor';
+$labels['manageresponses'] = 'Upravljanje odgovorima';
+$labels['savenewresponse'] = 'Pohrani novi odgovor';
+$labels['editresponses'] = 'Uredi odgovore';
+$labels['editresponse'] = 'Uredi odgovor';
+$labels['responsename'] = 'Naziv';
+$labels['responsetext'] = 'Tekst odgovora';
$labels['attach'] = 'Priloži';
$labels['attachments'] = 'Privitci (Attachments)';
$labels['upload'] = 'Dodaj';
$labels['uploadprogress'] = '$percent ($current od $total)';
$labels['close'] = 'Zatvori';
-$labels['messageoptions'] = 'Opcije poruka...';
+$labels['messageoptions'] = 'Postavke poruka...';
$labels['low'] = 'Nizak';
$labels['lowest'] = 'Najniži';
$labels['normal'] = 'Srednji';
@@ -196,20 +221,23 @@ $labels['highest'] = 'Najviši';
$labels['nosubject'] = '(bez naslova)';
$labels['showimages'] = 'Prikaži slike';
$labels['alwaysshow'] = 'Uvijek prikaži slike od $sender';
-$labels['isdraft'] = 'Ova poruka je skica (draft)';
+$labels['isdraft'] = 'Ova poruka je predložak.';
+$labels['andnmore'] = '$nr više...';
+$labels['togglemoreheaders'] = 'Prikaži još zaglavlja poruke';
+$labels['togglefullheaders'] = 'Prikaži neuređena zaglavlja poruke';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Samo tekst';
$labels['savesentmessagein'] = 'Spremi poslane poruke u';
$labels['dontsave'] = 'ne spremaj';
-$labels['maxuploadsize'] = 'Maksimalna dozvoljena velicina datoteke je $size';
+$labels['maxuploadsize'] = 'Maksimalna dozvoljena veliÄina datoteke je $size';
$labels['addcc'] = 'Dodaj Cc';
$labels['addbcc'] = 'Dodaj Bcc';
$labels['addreplyto'] = 'Dodaj Odgovori-na';
$labels['addfollowupto'] = 'Dodaj Nastavak-na';
-$labels['mdnrequest'] = 'Pošiljaoc ove poruke je tražio da bude obaviješten o njenom primitku. Želite li obavijestiti pošiljaoca?';
-$labels['receiptread'] = 'Vrati potvrdu (proÄitano)';
-$labels['yourmessage'] = 'Ovo je vraćena potvrda vaše poruke';
-$labels['receiptnote'] = 'Info: Ova poruka samo potvrÄ‘uje da se poruka prikazala na raÄunalu primaoca. Nema garancije da je primaoc proÄitao ili razumio sadržaj poruke.';
+$labels['mdnrequest'] = 'Pošiljatelj ove poruke je tražio da bude obaviješten o njenom primitku. Želite li obavijestiti pošiljatelja?';
+$labels['receiptread'] = 'Potvrda o primitku (proÄitano)';
+$labels['yourmessage'] = 'Ovo je potvrda o primitku vaše poruke';
+$labels['receiptnote'] = 'Info: Ova poruka o primitku samo potvrÄ‘uje da se poruka prikazala na raÄunalu primatelja. Nema garancije da je primatelj proÄitao ili razumio sadržaj poruke.';
$labels['name'] = 'Puno ime';
$labels['firstname'] = 'Ime';
$labels['surname'] = 'Prezime';
@@ -219,18 +247,18 @@ $labels['namesuffix'] = 'Sufiks';
$labels['nickname'] = 'Nadimak';
$labels['jobtitle'] = 'Titula';
$labels['department'] = 'Odjel';
-$labels['gender'] = 'Rod';
-$labels['maidenname'] = 'DjevojaÄko ime';
-$labels['email'] = 'E-Mail';
+$labels['gender'] = 'Spol';
+$labels['maidenname'] = 'DjevojaÄko prezime';
+$labels['email'] = 'E-mail';
$labels['phone'] = 'Telefon';
$labels['address'] = 'Adresa';
$labels['street'] = 'Ulica';
$labels['locality'] = 'Grad';
$labels['zipcode'] = 'Poštanski broj';
$labels['region'] = 'Oblast';
-$labels['country'] = 'Zemlja';
+$labels['country'] = 'Država';
$labels['birthday'] = 'Rođendan';
-$labels['anniversary'] = 'Jubilej';
+$labels['anniversary'] = 'Godišnjica';
$labels['website'] = 'Web stranica';
$labels['instantmessenger'] = 'IM';
$labels['notes'] = 'Bilješke';
@@ -241,14 +269,14 @@ $labels['assistant'] = 'Asistent';
$labels['spouse'] = 'Suprug/a';
$labels['allfields'] = 'Sva polja';
$labels['search'] = 'Pretraga';
-$labels['advsearch'] = 'Napredna Pretraga';
+$labels['advsearch'] = 'Napredna pretraga';
$labels['advanced'] = 'Napredno';
$labels['other'] = 'Ostalo';
-$labels['typehome'] = 'Kućni broj';
-$labels['typework'] = 'Poslovni broj';
+$labels['typehome'] = 'Kuća';
+$labels['typework'] = 'Posao';
$labels['typeother'] = 'Ostalo';
$labels['typemobile'] = 'Mobitel';
-$labels['typemain'] = 'Glavni broj';
+$labels['typemain'] = 'Glavni';
$labels['typehomefax'] = 'Fax kuća';
$labels['typeworkfax'] = 'Fax posao';
$labels['typecar'] = 'Auto';
@@ -260,156 +288,187 @@ $labels['typeblog'] = 'Blog';
$labels['typeprofile'] = 'Profil';
$labels['addfield'] = 'Dodaj polje...';
$labels['addcontact'] = 'Dodaj novi kontakt';
-$labels['editcontact'] = 'Izmjeni kontakt';
+$labels['editcontact'] = 'Uredi kontakt';
$labels['contacts'] = 'Kontakti';
$labels['contactproperties'] = 'Svojstva kontakta';
$labels['personalinfo'] = 'Osobni podaci';
-$labels['edit'] = 'Izmjeni';
+$labels['edit'] = 'Uredi';
$labels['cancel'] = 'Odustani';
$labels['save'] = 'Spremi';
$labels['delete'] = 'Obriši';
$labels['rename'] = 'Preimenuj';
$labels['addphoto'] = 'Dodaj';
-$labels['replacephoto'] = 'Smijeniti';
-$labels['newcontact'] = 'Dodaj novi kontakt';
+$labels['replacephoto'] = 'Zamijeni';
+$labels['uploadphoto'] = 'Postavi fotografiju';
+$labels['newcontact'] = 'Dodaj novu karticu kontakta';
$labels['deletecontact'] = 'Obriši odabrane kontakte';
-$labels['composeto'] = 'Napiši mail...';
+$labels['composeto'] = 'Napiši mail za';
$labels['contactsfromto'] = 'Kontakti od $from do $to od ukupno $count';
-$labels['print'] = 'Print';
-$labels['export'] = 'Export';
+$labels['print'] = 'Ispis';
+$labels['export'] = 'Izvoz';
+$labels['exportall'] = 'Izvezi sve';
+$labels['exportsel'] = 'Izvezi odabrano';
$labels['exportvcards'] = 'Izvezi kontakte u vCard formatu';
-$labels['newcontactgroup'] = 'Napravi novu kontaktnu grupu';
-$labels['grouprename'] = 'Promijeni ime grupe';
-$labels['groupdelete'] = 'Izbriši grupu';
+$labels['newcontactgroup'] = 'Napravi novu grupu kontakata';
+$labels['grouprename'] = 'Preimenuj grupu';
+$labels['groupdelete'] = 'Obriši grupu';
+$labels['groupremoveselected'] = 'Obriši odabrane kontakte iz grupe ';
$labels['previouspage'] = 'Prethodna strana';
$labels['firstpage'] = 'Prva strana';
$labels['nextpage'] = 'Slijedeća strana';
$labels['lastpage'] = 'Zadnja strana';
$labels['group'] = 'Grupa';
$labels['groups'] = 'Grupe';
+$labels['listgroup'] = 'Prikaži Älanove grupe';
$labels['personaladrbook'] = 'Privatna adresa';
-$labels['searchsave'] = 'Pohrani pretragu';
+$labels['searchsave'] = 'Spremi pretragu';
$labels['searchdelete'] = 'Obriši pretragu';
$labels['import'] = 'Uvoz';
$labels['importcontacts'] = 'Uvoz kontakta';
$labels['importfromfile'] = 'Uvezi iz datoteke:';
-$labels['importreplace'] = 'Prepiši cijeli adresar';
+$labels['importtarget'] = 'Dodaj kontakte u';
+$labels['importreplace'] = 'Prepiši cijeli imenik';
+$labels['importgroups'] = 'Uvezi zadatke grupe';
+$labels['importgroupsall'] = 'Sve (stvori grupe ako je potrebno)';
+$labels['importgroupsexisting'] = 'Samo za postojeće grupe';
+$labels['importdesc'] = 'Možete poslati kontakte iz postojećeg imenika.<br/>Trenutno je podržan uvoz adresa iz <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> ili CSV (comma-separated) formata.';
$labels['done'] = 'Završeno';
$labels['settingsfor'] = 'Postavke za';
$labels['about'] = 'O programu';
$labels['preferences'] = 'Postavke';
$labels['userpreferences'] = 'KorisniÄke postavke';
-$labels['editpreferences'] = 'Izmjena postavki';
+$labels['editpreferences'] = 'Uredi korisniÄke postavke';
$labels['identities'] = 'Identiteti';
-$labels['manageidentities'] = 'Podesi identitete za ovaj nalog';
-$labels['newidentity'] = 'Dodaj identitet';
-$labels['newitem'] = 'Novo';
-$labels['edititem'] = 'Uredi';
-$labels['preferhtml'] = 'HTML format u prednosti';
-$labels['defaultcharset'] = 'Zadani skup znakova';
+$labels['manageidentities'] = 'Upravljanje identitetima za ovaj korisniÄki raÄun';
+$labels['newidentity'] = 'Novi identitet';
+$labels['newitem'] = 'Nova stavka';
+$labels['edititem'] = 'Uredi stavku';
+$labels['preferhtml'] = 'Prikaži HTML';
+$labels['defaultcharset'] = 'Zadana kodna stranica';
$labels['htmlmessage'] = 'HTML format poruke';
+$labels['messagepart'] = 'Dio';
+$labels['digitalsig'] = 'Digitalni potpis';
$labels['dateformat'] = 'Format datuma';
$labels['timeformat'] = 'Format vremena';
-$labels['prettydate'] = 'Formatiran datum';
-$labels['setdefault'] = 'Postavi predodređeno';
+$labels['prettydate'] = 'Formatirani datum';
+$labels['setdefault'] = 'Postavi zadano';
$labels['autodetect'] = 'Auto';
$labels['language'] = 'Jezik';
$labels['timezone'] = 'Vremenska zona';
-$labels['pagesize'] = 'Redova po stranici';
+$labels['pagesize'] = 'Redaka po stranici';
$labels['signature'] = 'Potpis';
-$labels['dstactive'] = 'Automatska promjena vremena';
-$labels['htmleditor'] = 'Sastavi HTML poruke';
-$labels['htmlonreply'] = 'odgovor samo na HTML poruke';
+$labels['dstactive'] = 'Ljetno/zimsko raÄunanje vremena';
+$labels['showinextwin'] = 'Otvori poruku u novom prozoru';
+$labels['composeextwin'] = 'Sastavi poruku u novom prozoru';
+$labels['htmleditor'] = 'Sastavi poruke u HTML formatu';
+$labels['htmlonreply'] = 'pri odgovaranju na HTML poruku';
+$labels['htmlonreplyandforward'] = 'pri prosljeđivanju ili odgovaranju na HTML poruku';
$labels['htmlsignature'] = 'HTML potpis';
+$labels['showemail'] = 'Prikaži e-mail adresu s imenom';
$labels['previewpane'] = 'Prikaži podruÄje pregleda';
-$labels['skin'] = 'Tema izgleda';
-$labels['logoutclear'] = 'OÄisti smeće pri izlazu';
-$labels['logoutcompact'] = 'Komprimiraj Inbox pri izlazu';
-$labels['uisettings'] = 'KorisniÄki interfejs';
-$labels['serversettings'] = 'Postavke servera';
-$labels['mailboxview'] = 'Pregled Mailboxa';
-$labels['mdnrequests'] = 'Obavijest pošiljatelja';
-$labels['askuser'] = 'pitaj korisnika';
-$labels['autosend'] = 'Å¡alji automatski';
-$labels['autosendknown'] = 'Dodaj primatelja u moje kontakte, u suprotnom me pitaj';
-$labels['autosendknownignore'] = 'Dodaj primatelja u moje kontakte, u suprotnom zanemari';
+$labels['skin'] = 'Tema suÄelja';
+$labels['logoutclear'] = 'OÄisti smeće pri odjavi';
+$labels['logoutcompact'] = 'Sažmi Inbox pri odjavi';
+$labels['uisettings'] = 'KorisniÄko suÄelje';
+$labels['serversettings'] = 'Postavke poslužitelja';
+$labels['mailboxview'] = 'Pregled sanduÄića';
+$labels['mdnrequests'] = 'na zahtjev za potvrdom primitka';
+$labels['askuser'] = 'pitaj me';
+$labels['autosend'] = 'pošalji potvrdu';
+$labels['autosendknown'] = 'pošalji potvrdu ako je pošiljatelj u mom imeniku, u suprotnom me pitaj';
+$labels['autosendknownignore'] = 'pošalji potvrdu ako je pošiljatelj u mom imeniku, u suprotnom zanemari';
$labels['ignore'] = 'zanemari';
$labels['readwhendeleted'] = 'OznaÄi poruku kao proÄitanu pri brisanju';
$labels['flagfordeletion'] = 'OznaÄi poruku za brisanje umjesto brisanja';
-$labels['skipdeleted'] = 'Ne prikazivaj pobrisane poruke';
-$labels['deletealways'] = 'Ukoliko premještanje poruka u mapu otpad ne uspije, izbrši poruku';
-$labels['showremoteimages'] = 'Prikaži slike s interneta';
+$labels['skipdeleted'] = 'Ne prikazuj obrisane poruke';
+$labels['deletealways'] = 'Ukoliko premještanje poruka u mapu smeće ne uspije, izbriši poruku';
+$labels['deletejunk'] = 'Odmah obriši poruke u mapi Smeće';
+$labels['showremoteimages'] = 'Prikaži umetnute slike s interneta';
$labels['fromknownsenders'] = 'od poznatih pošiljatelja';
$labels['always'] = 'uvijek';
-$labels['showinlineimages'] = 'Prikaži slike ispod poruke';
-$labels['autosavedraft'] = 'Automatski spremi draft';
+$labels['showinlineimages'] = 'Prikaži slike iz privitka ispod poruke';
+$labels['autosavedraft'] = 'Automatski spremi predložak';
$labels['everynminutes'] = 'svakih $n minuta';
-$labels['never'] = 'nikada';
+$labels['refreshinterval'] = 'Osvježi (provjeri nove poruke, itd.)';
+$labels['never'] = 'nikad';
$labels['immediately'] = 'odmah';
-$labels['messagesdisplaying'] = 'Prikazujem poruke';
-$labels['messagescomposition'] = 'Komponiram poruke';
+$labels['messagesdisplaying'] = 'Prikaz poruka';
+$labels['messagescomposition'] = 'Sastavljanje poruka';
$labels['mimeparamfolding'] = 'Nazivi privitaka';
-$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['2231folding'] = 'Prema RFC 2231 (Thunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
-$labels['2047folding'] = 'Full RFC 2047 (ostali)';
-$labels['force7bit'] = 'Koristi MIME postavke za 8-bitne znakove';
+$labels['2047folding'] = 'Prema RFC 2047 (ostali)';
+$labels['force7bit'] = 'Koristi MIME kodiranje za 8-bitne znakove';
$labels['advancedoptions'] = 'Napredne postavke';
-$labels['focusonnewmessage'] = 'Fokusiraj browser pri novoj poruci';
+$labels['focusonnewmessage'] = 'Fokusiraj prozor preglednika pri primitku nove poruke';
$labels['checkallfolders'] = 'Provjeri nove poruke u svim mapama';
$labels['displaynext'] = 'Nakon brisanja/micanja poruke, prikaži slijedeću';
-$labels['defaultfont'] = 'Predodređeni font HTML poruke';
+$labels['defaultfont'] = 'Zadani font HTML poruke';
$labels['mainoptions'] = 'Glavne postavke';
-$labels['section'] = 'Sekcija';
+$labels['browseroptions'] = 'Postavke preglednika';
+$labels['section'] = 'Odjeljak';
$labels['maintenance'] = 'Održavanje';
$labels['newmessage'] = 'Nova poruka';
$labels['signatureoptions'] = 'Postavke potpisa';
$labels['whenreplying'] = 'Prilikom odgovora';
-$labels['replytopposting'] = 'zapoÄni novu poruku iznad originala';
-$labels['replybottomposting'] = 'zapoÄni novu poruku ispod originala';
+$labels['replyempty'] = 'ne citiraj originalnu poruku';
+$labels['replytopposting'] = 'zapoÄni novu poruku iznad originalne';
+$labels['replybottomposting'] = 'zapoÄni novu poruku ispod originalne';
$labels['replyremovesignature'] = 'Kod odgovaranja, makni originalni potpis iz poruke';
$labels['autoaddsignature'] = 'Automatski dodaj potpis';
-$labels['newmessageonly'] = 'samo nova poruka';
-$labels['replyandforwardonly'] = 'samo odgovori i proslijeđivanja';
+$labels['newmessageonly'] = 'samo za nove poruke';
+$labels['replyandforwardonly'] = 'samo pri odgovaranju i proslijeđivanju';
$labels['insertsignature'] = 'Umetni potpis';
$labels['previewpanemarkread'] = 'Obilježi pregledane poruke kao proÄitane';
$labels['afternseconds'] = 'nakon $n sekundi';
-$labels['reqmdn'] = 'Uvijek zatraži potvrdu o primitku poruke';
-$labels['reqdsn'] = 'Uvijek zatraži potvrdu o slanju poruke';
-$labels['replysamefolder'] = 'Spremi odgovore u mapu gdje se nalazi poruka';
+$labels['reqmdn'] = 'Uvijek zatraži potvrdu o primitku';
+$labels['reqdsn'] = 'Uvijek zatraži obavijest o stanju isporuke';
+$labels['replysamefolder'] = 'Spremi odgovore u mapu gdje se nalazi originalna poruka';
+$labels['defaultabook'] = 'Zadani imenik';
$labels['autocompletesingle'] = 'PreskoÄi alternativne email adrese u autocomplete prijedlozima';
+$labels['listnamedisplay'] = 'Prikaži kontakte kao';
$labels['spellcheckbeforesend'] = 'Provjeri pravopis prije slanja poruke';
$labels['spellcheckoptions'] = 'Postavke provjere pravopisa';
-$labels['spellcheckignoresyms'] = 'Ignoriraj rijeÄi koje sadrže simbole';
-$labels['spellcheckignorenums'] = 'Ignoriraj rijeÄi koje sadrže brojeve';
-$labels['spellcheckignorecaps'] = 'Ignoriraj rijeÄi sa sa svim velikim slovima';
+$labels['spellcheckignoresyms'] = 'Zanemari rijeÄi koje sadrže simbole';
+$labels['spellcheckignorenums'] = 'Zanemari rijeÄi koje sadrže brojeve';
+$labels['spellcheckignorecaps'] = 'Zanemari rijeÄi sa svim velikim slovima';
$labels['addtodict'] = 'Dodaj u rjeÄnik';
+$labels['mailtoprotohandler'] = 'Registriraj upravitelj protokola za mailto: linkove';
+$labels['standardwindows'] = 'Tretiraj skoÄne prozore kao standardne';
+$labels['forwardmode'] = 'Prosljeđivanje poruka';
+$labels['inline'] = 'umetnuto';
+$labels['asattachment'] = 'kao privitak';
+$labels['replyallmode'] = 'Zadana akcija [Reply all] gumba';
+$labels['replyalldefault'] = 'odgovori svima';
+$labels['replyalllist'] = 'odgovori samo listi (ako postoji)';
$labels['folder'] = 'Mapa';
$labels['folders'] = 'Mape';
-$labels['foldername'] = 'Ime mape';
-$labels['subscribed'] = 'Pretplata';
+$labels['foldername'] = 'Naziv mape';
+$labels['subscribed'] = 'Pretplaćen';
$labels['messagecount'] = 'Poruke';
-$labels['create'] = 'Napravi';
-$labels['createfolder'] = 'Napravi novu mapu';
-$labels['managefolders'] = 'Podesi mapu';
-$labels['specialfolders'] = 'Specijalna mapa';
+$labels['create'] = 'Stvori';
+$labels['createfolder'] = 'Stvori novu mapu';
+$labels['managefolders'] = 'Upravljanje mapama';
+$labels['specialfolders'] = 'Specijalne mape';
$labels['properties'] = 'Svojstva';
$labels['folderproperties'] = 'Svojstva mape';
-$labels['parentfolder'] = 'Glavna fascikla';
+$labels['parentfolder'] = 'Glavna mapa';
$labels['location'] = 'Lokacija';
-$labels['info'] = 'Informacija';
-$labels['getfoldersize'] = 'Kliknite da biste dobili veliÄinu mape';
-$labels['changesubscription'] = 'Kliknite da biste promjenili pretplatu';
+$labels['info'] = 'Informacije';
+$labels['getfoldersize'] = 'Kliknite za prikaz veliÄine mape';
+$labels['changesubscription'] = 'Kliknite da biste promijenili pretplatu';
$labels['foldertype'] = 'Vrsta mape';
$labels['personalfolder'] = 'Privatna mapa';
-$labels['otherfolder'] = 'Mapa drugih korisnika';
+$labels['otherfolder'] = 'Mapa drugog korisnika';
$labels['sharedfolder'] = 'Javna mapa';
$labels['sortby'] = 'Sortiraj po';
-$labels['sortasc'] = 'Sortiraj rastućim nizom';
-$labels['sortdesc'] = 'Sortiraj opadajućim nizom';
+$labels['sortasc'] = 'Sortiraj uzlaznim nizom';
+$labels['sortdesc'] = 'Sortiraj silaznim nizom';
$labels['undo'] = 'Poništi';
-$labels['plugin'] = 'Plugin';
+$labels['installedplugins'] = 'Instalirani dodaci';
+$labels['plugin'] = 'Dodatak';
$labels['version'] = 'InaÄica';
-$labels['source'] = 'Izvor';
+$labels['source'] = 'Izvorni kod';
$labels['license'] = 'Licenca';
$labels['support'] = 'Podrška';
$labels['B'] = 'B';
@@ -418,16 +477,16 @@ $labels['MB'] = 'MB';
$labels['GB'] = 'GB';
$labels['unicode'] = 'Unicode';
$labels['english'] = 'Engleski';
-$labels['westerneuropean'] = 'Zapadno Evropski';
-$labels['easterneuropean'] = 'IstoÄno Evropski';
-$labels['southeasterneuropean'] = 'Južno-IstoÄni Evropski';
-$labels['baltic'] = 'BalitÄki';
-$labels['cyrillic'] = 'ÄŒirilÄni';
+$labels['westerneuropean'] = 'Zapadnoeuropski';
+$labels['easterneuropean'] = 'IstoÄnoeuropski';
+$labels['southeasterneuropean'] = 'JugoistoÄnoeuropski';
+$labels['baltic'] = 'BaltiÄki';
+$labels['cyrillic'] = 'Čirilićni';
$labels['arabic'] = 'Arapski';
$labels['greek'] = 'GrÄki';
-$labels['hebrew'] = 'Hibru';
+$labels['hebrew'] = 'Hebrejski';
$labels['turkish'] = 'Turski';
-$labels['nordic'] = 'Nordski';
+$labels['nordic'] = 'Nordijski';
$labels['thai'] = 'Tajlandski';
$labels['celtic'] = 'Keltski';
$labels['vietnamese'] = 'Vijetnamski';
diff --git a/program/localization/hr_HR/messages.inc b/program/localization/hr_HR/messages.inc
index 2e51848eb..0baeb2908 100644
--- a/program/localization/hr_HR/messages.inc
+++ b/program/localization/hr_HR/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -15,139 +15,161 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
-$messages['loginfailed'] = 'Prijava neuspješna';
-$messages['cookiesdisabled'] = 'VaÅ¡ Web preglednik ne podržava kolaÄiće (cookies)';
-$messages['sessionerror'] = 'Morate se ponovno ulogirati';
-$messages['storageerror'] = 'Neuspješna veza na IMAP server';
-$messages['servererror'] = 'Greška poslužitelja';
-$messages['servererrormsg'] = 'Greška na serveru: $msg';
+$messages['errortitle'] = 'Dogodila se greška!';
+$messages['loginfailed'] = 'Prijava neuspješna.';
+$messages['cookiesdisabled'] = 'VaÅ¡ preglednik ne prihvaća kolaÄiće.';
+$messages['sessionerror'] = 'Vaša sesija je nevaljala ili istekla.';
+$messages['storageerror'] = 'Neuspješno povezivanje na IMAP poslužitelj.';
+$messages['servererror'] = 'Greška poslužitelja!';
+$messages['servererrormsg'] = 'Greška poslužitelja: $msg';
$messages['dberror'] = 'Greška baze podataka!';
-$messages['errorreadonly'] = 'Nemoguća izvedba operacije. Mapa je samo za Äitanje.';
-$messages['errornoperm'] = 'Nemoguća izvedba operacije. Dozvola odbijena.';
-$messages['invalidrequest'] = 'Nepravilan zahtijev! Podaci nisu spremljeni.';
-$messages['nomessagesfound'] = 'Nema poruka u sanduÄiću';
-$messages['loggedout'] = 'Uspješno ste se odjavili. Zbogom!';
-$messages['mailboxempty'] = 'SanduÄuć je prazan';
+$messages['requesttimedout'] = 'Zahtjev istekao';
+$messages['errorreadonly'] = 'Nemoguće izvrÅ¡iti operaciju. Mapa je samo za Äitanje.';
+$messages['errornoperm'] = 'Nemoguće izvršiti operaciju. Nije dozvoljen pristup.';
+$messages['erroroverquota'] = 'Nemoguće izvršiti operaciju. Nema prostora na disku.';
+$messages['erroroverquotadelete'] = 'Nema prostora na disku. Upotrijebite SHIFT+DEL za brisanje poruka.';
+$messages['invalidrequest'] = 'Neispravan zahtjev! Podaci nisu spremljeni.';
+$messages['invalidhost'] = 'Neispravno ime poslužitelja.';
+$messages['nomessagesfound'] = 'Nema poruka u ovom sanduÄiću.';
+$messages['loggedout'] = 'Uspješno ste se odjavili. Doviđenja!';
+$messages['refreshing'] = 'Osvježavanje...';
$messages['loading'] = 'UÄitavanje...';
-$messages['uploading'] = 'Prenosim datoteku...';
-$messages['uploadingmany'] = 'Prenosim datoteke...';
+$messages['uploading'] = 'Postavljanje datoteke...';
+$messages['uploadingmany'] = 'Postavljanje datoteka...';
$messages['loadingdata'] = 'UÄitavanje podataka...';
$messages['checkingmail'] = 'Provjera novih poruka u tijeku...';
-$messages['sendingmessage'] = 'Poruka se Å¡alje...';
-$messages['messagesent'] = 'Poruka je uspješno poslana';
-$messages['savingmessage'] = 'Poruka se sprema...';
-$messages['messagesaved'] = 'Poruka uspješno spremljena u \'Predlošci\'';
-$messages['successfullysaved'] = 'Spremanje uspješno obavljeno';
-$messages['addedsuccessfully'] = 'Kontakt uspješno dodan u imenik';
-$messages['contactexists'] = 'Kontakt sa ovom e-mail adresom već postoji u imeniku';
-$messages['contactnameexists'] = 'Kontak s istim imenom već postoji.';
-$messages['blockedimages'] = 'Zbog zaštite privatnosti, slike sa udaljenih servera su blokirane.';
-$messages['encryptedmessage'] = 'Ova poruka je zaštićena pa se ne može prikazati';
-$messages['nocontactsfound'] = 'Imenik je prazan';
-$messages['contactnotfound'] = 'Traženi kontakt nije pronađen';
-$messages['contactsearchonly'] = 'Upišite nekoliko pojmova za pretragu imenika';
-$messages['sendingfailed'] = 'Greška pri slanju poruke';
-$messages['senttooquickly'] = 'Molimo saÄekajte $sec sek. prije slanja ove poruke';
-$messages['errormoving'] = 'Greška pri premještanju poruke';
-$messages['errorcopying'] = 'Greška pri kopiranju poruke';
-$messages['errordeleting'] = 'Greška pri brisanju poruke';
-$messages['errormarking'] = 'Nije moguće oznaÄiti poruku';
-$messages['deletecontactconfirm'] = 'Želite li obrisati izabrane kontakte?';
+$messages['sendingmessage'] = 'Slanje poruke...';
+$messages['messagesent'] = 'Poruka uspješno poslana.';
+$messages['savingmessage'] = 'Spremanje poruke...';
+$messages['messagesaved'] = 'Poruka spremljena u mapu Predlošci.';
+$messages['successfullysaved'] = 'Uspješno spremljeno.';
+$messages['savingresponse'] = 'Spremanje teksta odgovora...';
+$messages['deleteresponseconfirm'] = 'Jeste li sigurni da želite obrisati tekst ovog odgovora?';
+$messages['addedsuccessfully'] = 'Kontakt uspješno dodan u imenik.';
+$messages['contactexists'] = 'Kontakt sa istom e-mail adresom već postoji.';
+$messages['contactnameexists'] = 'Kontakt istog imena već postoji.';
+$messages['blockedimages'] = 'Zbog zaštite privatnosti, slike sa interneta su blokirane u ovoj poruci.';
+$messages['encryptedmessage'] = 'Ova poruka je šifrirana i ne može se prikazati.';
+$messages['nocontactsfound'] = 'Imenik je prazan.';
+$messages['contactnotfound'] = 'Traženi kontakt nije pronađen.';
+$messages['contactsearchonly'] = 'Upišite neke pojmove za pretragu imenika';
+$messages['sendingfailed'] = 'Slanje poruke nije uspjelo.';
+$messages['senttooquickly'] = 'Molimo saÄekajte $sec sek. prije slanja ove poruke.';
+$messages['errorsavingsent'] = 'Greška pri spremanju poslane poruke.';
+$messages['errorsaving'] = 'Greška pri spremanju.';
+$messages['errormoving'] = 'Greška pri premještanju poruke(a).';
+$messages['errorcopying'] = 'Greška pri kopiranju poruke(a).';
+$messages['errordeleting'] = 'Greška pri brisanju poruke(a).';
+$messages['errormarking'] = 'GreÅ¡ka pri oznaÄavanju poruke(a).';
+$messages['deletecontactconfirm'] = 'Jeste li sigurni da želite obrisati odabrani kontakt(e)?';
$messages['deletegroupconfirm'] = 'Jeste li sigurni da želite obrisati odabranu grupu?';
-$messages['deletemessagesconfirm'] = 'Sigurno želite obrisati odabrane poruke?';
-$messages['deletefolderconfirm'] = 'Želite li obrisati ovu mapu?';
-$messages['purgefolderconfirm'] = 'Želite li obrisati sve poruke u mapi?';
-$messages['contactdeleting'] = 'Brišem kontakt(e)...';
-$messages['groupdeleting'] = 'Brišem grupu...';
-$messages['folderdeleting'] = 'Brišem mapu...';
-$messages['foldermoving'] = 'Premještam mapu...';
-$messages['foldersubscribing'] = 'Pretplata na mapu...';
+$messages['deletemessagesconfirm'] = 'Jeste li sigurni da želite obrisati odabranu poruku(e)?';
+$messages['deletefolderconfirm'] = 'Jeste li sigurni da želite obrisati mapu?';
+$messages['purgefolderconfirm'] = 'Jeste li sigurni da želite obrisati sve poruke u mapi?';
+$messages['contactdeleting'] = 'Brisanje kontak(a)ta...';
+$messages['groupdeleting'] = 'Brisanje grupe...';
+$messages['folderdeleting'] = 'Brisanje mape...';
+$messages['foldermoving'] = 'Premještanje mape...';
+$messages['foldersubscribing'] = 'Pretplaćivanje na mapu...';
$messages['folderunsubscribing'] = 'Poništavanje pretplate na mapu...';
-$messages['formincomplete'] = 'Obrazac nije u cjelosti popunjen';
-$messages['noemailwarning'] = 'Unesite valjanu e-mail adresu';
-$messages['nonamewarning'] = 'Unesite ime';
-$messages['nopagesizewarning'] = 'Unesite veliÄinu stranice';
-$messages['nosenderwarning'] = 'Unesite e-mail adresu pošiljatelja';
-$messages['norecipientwarning'] = 'Unesite primatelja (ZA)';
+$messages['formincomplete'] = 'Obrazac nije u cjelosti popunjen.';
+$messages['noemailwarning'] = 'Unesite ispravnu e-mail adresu.';
+$messages['nonamewarning'] = 'Unesite ime.';
+$messages['nopagesizewarning'] = 'Unesite veliÄinu stranice.';
+$messages['nosenderwarning'] = 'Unesite e-mail adresu pošiljatelja.';
+$messages['norecipientwarning'] = 'Unesite barem jednog primatelja.';
$messages['nosubjectwarning'] = 'Polje \'Naslov\' je prazno. Želite li unijeti naslov?';
$messages['nobodywarning'] = 'Želite li poslati poruku bez teksta?';
$messages['notsentwarning'] = 'Poruka nije poslana. Želite li odbaciti ovu poruku?';
-$messages['noldapserver'] = 'Unesite LDAP poslužitelj za pretragu';
-$messages['nosearchname'] = 'Unesite ime ili e-mail adresu';
-$messages['notuploadedwarning'] = 'Svi prilozi joÅ¡ nisu presnimljeni na poslužitelj. Molim priÄekajte ili zaustavite prsnimavanje.';
-$messages['searchsuccessful'] = 'Broj pronađenih poruka: $nr';
-$messages['contactsearchsuccessful'] = '$nr kontakata pronađeno.';
-$messages['searchnomatch'] = 'Traženi termin nije pronađen ni u jednoj poruci';
-$messages['searching'] = 'Pretraga u tijeku...';
+$messages['restoresavedcomposedata'] = 'PronaÄ‘ena je zapoÄeta, ali neposlana poruka .\n\nNaslov: $subject\nSnimljeno: $date\n\nŽelite li je prikazati?';
+$messages['noldapserver'] = 'Odaberite LDAP poslužitelj za pretragu.';
+$messages['nosearchname'] = 'Unesite ime ili e-mail adresu.';
+$messages['notuploadedwarning'] = 'Svi privitci joÅ¡ nisu postavljeni na poslužitelj. Molim priÄekajte ili zaustavite postavljanje.';
+$messages['searchsuccessful'] = 'Pronađeno $nr poruka.';
+$messages['contactsearchsuccessful'] = 'Pronađeno $nr kontakata.';
+$messages['searchnomatch'] = 'Pretraga nije vratila nijedan rezultat.';
+$messages['searching'] = 'Pretraživanje u tijeku...';
$messages['checking'] = 'Provjera u tijeku...';
-$messages['nospellerrors'] = 'Nije pronađena niti jedna pravopisna greška';
-$messages['folderdeleted'] = 'Mapa uspješno obrisana';
-$messages['foldersubscribed'] = 'Mapa uspješno pretplaćena';
-$messages['folderunsubscribed'] = 'Pretplata na mapu uspješno poništena';
-$messages['folderpurged'] = 'Mapa uspješno ispražnjena';
-$messages['folderexpunged'] = 'Mapa uspješno zbijena';
-$messages['deletedsuccessfully'] = 'Uspješno obrisano';
-$messages['converting'] = 'Formatiranje poruke';
-$messages['messageopenerror'] = 'UÄitavanje poruke nije uspjelo';
-$messages['fileuploaderror'] = 'Prijenos datoteke nije uspio';
-$messages['filesizeerror'] = 'Datoteka je prevelika. Maksimalna veliÄina je $size';
-$messages['sourceisreadonly'] = 'Ovaj resurs adresa je samo za Äitanje';
-$messages['errorsavingcontact'] = 'Nije uspjelo spremanje adrese kontakta';
-$messages['movingmessage'] = 'Premještanje poruke...';
-$messages['copyingmessage'] = 'Kopiranje poruke...';
-$messages['copyingcontact'] = 'Kopiram kontakt(e)...';
-$messages['deletingmessage'] = 'Brisanje poruke...';
-$messages['markingmessage'] = 'OznaÄavanje poruke...';
-$messages['addingmember'] = 'Dodajem kontakt(e) u grupu...';
-$messages['removingmember'] = 'Izbacujem kontakt(e) iz groupe...';
-$messages['receiptsent'] = 'UspjeÅ¡no poslana potvrda (proÄitano)';
-$messages['errorsendingreceipt'] = 'Ne može poslati potvrdu';
-$messages['deleteidentityconfirm'] = 'Jeste li sigurni da želite obrisati profil?';
-$messages['nodeletelastidentity'] = 'Ne možete izbrisati zadnji identitet.';
-$messages['forbiddencharacter'] = 'Naziv mape sadrži zabranjene znakove';
-$messages['selectimportfile'] = 'Odaberite datoteku za prijenos';
-$messages['addresswriterror'] = 'U odabrani adresar nije moguće zapisivat...';
-$messages['contactaddedtogroup'] = 'Kontakti uspješno dodani ovoj grupi';
-$messages['contactremovedfromgroup'] = 'Kontakti uspješno izbrisani iz ove grupe';
-$messages['importwait'] = 'Uvozim, molimo saÄekajte...';
-$messages['importconfirm'] = '<b>UspjeÅ¡no je uvezeno $inserted kontakt(a), preskoÄeno $skipped već postojećih</b>:<p><em>$names</em></p>';
+$messages['nospellerrors'] = 'Nije pronađena nijedna pravopisna greška.';
+$messages['folderdeleted'] = 'Mapa uspješno obrisana.';
+$messages['foldersubscribed'] = 'Mapa uspješno pretplaćena.';
+$messages['folderunsubscribed'] = 'Pretplata na mapu uspješno poništena.';
+$messages['folderpurged'] = 'Mapa uspješno ispražnjena.';
+$messages['folderexpunged'] = 'Mapa uspješno sažeta.';
+$messages['deletedsuccessfully'] = 'Uspješno obrisano.';
+$messages['converting'] = 'Uklanjanje formatiranja poruke...';
+$messages['messageopenerror'] = 'UÄitavanje poruke s poslužitelja nije uspjelo.';
+$messages['fileuploaderror'] = 'Postavljanje datoteke nije uspjelo.';
+$messages['filesizeerror'] = 'Postavljena datoteka prelazi maksimalna veliÄinu od $size.';
+$messages['copysuccess'] = 'Uspješno kopirano $n kontakata.';
+$messages['movesuccess'] = 'Uspješno premješteno $n kontakata.';
+$messages['copyerror'] = 'Kopiranje kontakata nije uspjelo.';
+$messages['moveerror'] = 'Premještanje kontakata nije uspjelo.';
+$messages['sourceisreadonly'] = 'Ovaj izvor adresa je samo za Äitanje.';
+$messages['errorsavingcontact'] = 'Spremanje adrese kontakta nije uspjelo.';
+$messages['movingmessage'] = 'Premještanje poruke(a)...';
+$messages['copyingmessage'] = 'Kopiranje poruke(a)...';
+$messages['copyingcontact'] = 'Kopiranje kontak(a)ta...';
+$messages['movingcontact'] = 'Premještanje kontakata...';
+$messages['deletingmessage'] = 'Brisanje poruke(a)...';
+$messages['markingmessage'] = 'OznaÄavanje poruke(a)...';
+$messages['addingmember'] = 'Dodavanje kontak(a)ta u grupu...';
+$messages['removingmember'] = 'Brisanje kontak(a)ta iz grupe...';
+$messages['receiptsent'] = 'Potvrda o primitku uspješno poslana.';
+$messages['errorsendingreceipt'] = 'Slanje potvrde o primitku nije uspjelo.';
+$messages['deleteidentityconfirm'] = 'Jeste li sigurni da želite obrisati ovaj identitet?';
+$messages['nodeletelastidentity'] = 'Jedini preostali identitet nije moguće obrisati.';
+$messages['forbiddencharacter'] = 'Naziv mape sadrži zabranjene znakove.';
+$messages['selectimportfile'] = 'Odaberite datoteku za postavljanje.';
+$messages['addresswriterror'] = 'U odabrani imenik nije omogućeno pisanje.';
+$messages['contactaddedtogroup'] = 'Kontakti uspješno dodani u grupu.';
+$messages['contactremovedfromgroup'] = 'Kontakti uspješno obrisani iz grupe.';
+$messages['nogroupassignmentschanged'] = 'Nema promjene u zadacima grupa.';
+$messages['importwait'] = 'Uvoz, molim priÄekajte...';
+$messages['importformaterror'] = 'Uvoz nije uspio! Postavljena datoteka nije ispravnog formata za uvoz.';
+$messages['importconfirm'] = '<b>Uspješno uvezeno $inserted kontakta</b>';
$messages['importconfirmskipped'] = '<b>PreskoÄeno $skipped postojećih unosa</b>';
+$messages['importmessagesuccess'] = 'Uspješno uvezeno $nr poruka';
+$messages['importmessageerror'] = 'Uvoz neuspjeÅ¡an! Datoteka nije u formatu poruke ili sanduÄića';
$messages['opnotpermitted'] = 'Operacija nije dozvoljena!';
-$messages['nofromaddress'] = 'Nije upisana e-mail adresa u odabrani identitet';
-$messages['editorwarning'] = 'Prebacivanje u Äisti tekstualni ureÄ‘ivaÄ Ä‡e prouzrokovati gubljenje formatiranje teksta. Želite li nastaviti?';
-$messages['httpreceivedencrypterror'] = 'Dogodila se fatalna greška u konfiguraciji. Odmah kontaktirajte administratora. <b>Vaša poruka se nemože poslati.</b>';
-$messages['smtpconnerror'] = 'SMTP Greška ($code): Veza na server nije uspjela';
-$messages['smtpautherror'] = 'SMTP Greška ($code): Autentikacija nije uspjela';
-$messages['smtpfromerror'] = 'SMTP Greška ($code): Nije uspjelo postavljanje pošiljatelja "$from" ($msg)';
-$messages['smtptoerror'] = 'SMTP Greška ($code): Nije uspjelo dodavanje primatelja "$to" ($msg)';
-$messages['smtprecipientserror'] = 'SMTP GreÅ¡ka: Nije moguće proÄitati listu primatelja';
-$messages['smtperror'] = 'SMTP Greška: $msg';
-$messages['emailformaterror'] = 'Nepravilna e-mail adresa: $email';
+$messages['nofromaddress'] = 'Nije upisana e-mail adresa u odabrani identitet.';
+$messages['editorwarning'] = 'Prebacivanje u Äisti tekstualni ureÄ‘ivaÄ Ä‡e uzrokovati gubljenje formatiranja teksta. Želite li nastaviti?';
+$messages['httpreceivedencrypterror'] = 'Dogodila se fatalna greška u konfiguraciji. Odmah kontaktirajte administratora. <b>Vaša poruka se ne može poslati.</b>';
+$messages['smtpconnerror'] = 'SMTP greška ($code): Povezivanje na poslužitelj nije uspjelo.';
+$messages['smtpautherror'] = 'SMTP greška ($code): Autentikacija nije uspjela.';
+$messages['smtpfromerror'] = 'SMTP greška ($code): Postavljanje pošiljatelja "$from" ($msg) nije uspjelo.';
+$messages['smtptoerror'] = 'SMTP greška ($code): Dodavanje primatelja "$to" ($msg) nije uspjelo.';
+$messages['smtprecipientserror'] = 'SMTP greÅ¡ka: Nije moguće proÄitati listu primatelja.';
+$messages['smtperror'] = 'SMTP greška: $msg';
+$messages['emailformaterror'] = 'Neispravna e-mail adresa: $email';
$messages['toomanyrecipients'] = 'Previše primatelja. Smanjite broj primatelja na $max.';
-$messages['maxgroupmembersreached'] = 'Broj Älanova grupe prelazi preko maximuma od $max';
+$messages['maxgroupmembersreached'] = 'Broj Älanova grupe prelazi maksimalni broj od $max.';
+$messages['internalerror'] = 'Dogodila se interna greška. Molimo pokušajte ponovno.';
$messages['contactdelerror'] = 'Kontakti ne mogu biti obrisani.';
$messages['contactdeleted'] = 'Kontakti uspješno obrisani.';
$messages['contactrestoreerror'] = 'Ne mogu vratiti obrisan(e) kontakt(e).';
-$messages['contactrestored'] = 'Kontakt(i) uspješno vraćeni .';
+$messages['contactrestored'] = 'Kontakt(i) uspješno vraćeni.';
$messages['groupdeleted'] = 'Grupa uspješno obrisana.';
$messages['grouprenamed'] = 'Grupa uspješno preimenovana.';
-$messages['groupcreated'] = 'Grupa uspješno kreirana.';
+$messages['groupcreated'] = 'Grupa uspješno stvorena.';
$messages['savedsearchdeleted'] = 'Pohranjena pretraga uspješno obrisana.';
-$messages['savedsearchdeleteerror'] = 'Ne mogu obrisati pohranjenu pretragu';
+$messages['savedsearchdeleteerror'] = 'Ne mogu obrisati pohranjenu pretragu.';
$messages['savedsearchcreated'] = 'Pohranjena pretraga uspješno stvorena.';
$messages['savedsearchcreateerror'] = 'Ne mogu stvoriti pohranjenu pretragu.';
$messages['messagedeleted'] = 'Poruke uspješno obrisane.';
-$messages['messagemoved'] = 'Poruke uspješno pomjerene.';
+$messages['messagemoved'] = 'Poruke uspješno premještene.';
$messages['messagecopied'] = 'Poruke uspješno kopirane.';
$messages['messagemarked'] = 'Poruke uspjeÅ¡no oznaÄene.';
$messages['autocompletechars'] = 'Unesite barem $min znakova za auto-dopunjavanje.';
$messages['autocompletemore'] = 'Više podudarajućih zapisa pronađeno. Molim upišite još znakova.';
-$messages['namecannotbeempty'] = 'Polje za ime ne može biti prazno.';
-$messages['nametoolong'] = 'Ime predugo.';
-$messages['folderupdated'] = 'Ažuriranje mape uspješno.';
-$messages['foldercreated'] = 'Kreiranje mape uspješno.';
+$messages['namecannotbeempty'] = 'Ime ne može biti prazno.';
+$messages['nametoolong'] = 'Ime je predugaÄko.';
+$messages['folderupdated'] = 'Mapa uspješno ažurirana.';
+$messages['foldercreated'] = 'Mapa uspješno stvorena.';
$messages['invalidimageformat'] = 'Format slike nije ispravan.';
-$messages['mispellingsfound'] = 'Greške pravopisa su pronađene u poruci.';
-$messages['parentnotwritable'] = 'Nije moguće stvoriti/pomaknuti mapu u odabranu mapu. Nemate prava pristupa.';
-$messages['messagetoobig'] = 'Dio poruke je prevelik za procesiranje.';
+$messages['mispellingsfound'] = 'Poruka sadrži pravopisne greške.';
+$messages['parentnotwritable'] = 'Nije moguće stvoriti/pomaknuti mapu u odabranoj mapi. Nemate pravo pristupa.';
+$messages['messagetoobig'] = 'Dio poruke je prevelik za obradu.';
+$messages['attachmentvalidationerror'] = 'UPOZORENJE! Ovaj privitak je sumnjiv jer vrsta privitka ne odgovara vrsti deklariranoj u poruci. Ako ne vjerujete poÅ¡iljatelju, ne biste trebali otvarati privitak u pregledniku jer može isti može sadržavati zloćudni kod.<br/><br/><em>OÄekivano: $expected; pronaÄ‘eno: $detected</em>';
+$messages['noscriptwarning'] = 'UPOZORENJE: Ovaj webmail servis zahtijeva Javascript! Kako biste ga mogli koristiti, molimo omogućite Javascript u postavkama svog preglednika.';
?>
diff --git a/program/localization/hu_HU/labels.inc b/program/localization/hu_HU/labels.inc
index 648ac759f..fdd43effe 100644
--- a/program/localization/hu_HU/labels.inc
+++ b/program/localization/hu_HU/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to / $count';
$labels['copy'] = 'Másolás';
$labels['move'] = 'Ãthelyezés';
$labels['moveto'] = 'Ãthelyezés...';
+$labels['copyto'] = 'Másold oda..';
$labels['download'] = 'letöltés';
$labels['open'] = 'Megnyítás';
$labels['showattachment'] = 'Megjelenítés';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Helyesírás ellenőrzés';
$labels['checkspelling'] = 'Helyesírás-ellenőrzés';
$labels['resumeediting'] = 'Helyesírás-ellenőrzés vége';
$labels['revertto'] = 'Visszaállítás erre';
+$labels['restore'] = 'Visszaállítás';
+$labels['restoremessage'] = 'Üzenet visszaállítás';
+$labels['responses'] = 'Válaszok';
+$labels['insertresponse'] = 'Egy válasz beillesztése';
+$labels['manageresponses'] = 'Válaszok kezelése';
+$labels['savenewresponse'] = 'Új válasz mentése';
+$labels['editresponses'] = 'Válaszok szerkesztése';
+$labels['editresponse'] = 'Válasz szerkesztése';
+$labels['responsename'] = 'Név';
+$labels['responsetext'] = 'Válasz Szöveg';
$labels['attach'] = 'Csatolás';
$labels['attachments'] = 'Csatolmányok';
$labels['upload'] = 'Feltöltés';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'A felugró ablakok használata szokásos ablakkén
$labels['forwardmode'] = 'Üzenet továbbítás';
$labels['inline'] = 'beágyazott';
$labels['asattachment'] = 'csatolmányként';
+$labels['replyallmode'] = 'Alapértelemezett művelete a [Válasz mindenkinek] gombnak';
+$labels['replyalldefault'] = 'válasz mindenkinek';
+$labels['replyalllist'] = 'válasz a csak a levelező listára(ha levelezőlista)';
$labels['folder'] = 'Mappa';
$labels['folders'] = 'Mappák';
$labels['foldername'] = 'Mappa neve';
diff --git a/program/localization/hu_HU/messages.inc b/program/localization/hu_HU/messages.inc
index 3ca87a52f..f7eaa1394 100644
--- a/program/localization/hu_HU/messages.inc
+++ b/program/localization/hu_HU/messages.inc
@@ -44,6 +44,8 @@ $messages['messagesent'] = 'Az üzenet elküldve';
$messages['savingmessage'] = 'Az üzenet mentése...';
$messages['messagesaved'] = 'Az üzenet elmentve a Piszkozatokhoz';
$messages['successfullysaved'] = 'A mentés sikerült';
+$messages['savingresponse'] = 'A válasz szövegének mentése...';
+$messages['deleteresponseconfirm'] = 'Biztosan törli ezt a válasz szöveget?';
$messages['addedsuccessfully'] = 'A kapcsolat hozzáadása a címjegyzékhez megtörtént';
$messages['contactexists'] = 'Ezzel az e-mail címmel már létezik kapcsolat';
$messages['contactnameexists'] = 'Ezzel a névvel már létezik kapcsolat';
@@ -54,6 +56,8 @@ $messages['contactnotfound'] = 'A kiválasztott kapcsolat nem található';
$messages['contactsearchonly'] = 'Adjon meg keresőkifejezéseket a kapcsolatok közti kereséshez';
$messages['sendingfailed'] = 'Az üzenet elküldése nem sikerült';
$messages['senttooquickly'] = 'Kérem várjon még $sec másodpercet az üzenet elküldése előtt';
+$messages['errorsavingsent'] = 'Hiba történt az elküldött üzenet mentése közben';
+$messages['errorsaving'] = 'A mentés során hiba lépett fel';
$messages['errormoving'] = 'Az üzenet(ek)et nem sikerült áthelyezni';
$messages['errorcopying'] = 'Az üzenet(ek)et nem sikerült másolni';
$messages['errordeleting'] = 'Az üzenet(ek)et nem sikerült törölni';
@@ -78,6 +82,7 @@ $messages['norecipientwarning'] = 'Legalább egy címzettet adjon meg';
$messages['nosubjectwarning'] = 'A Tárgy mező üres. Szeretné most kitölteni?';
$messages['nobodywarning'] = 'Elküldi az üzenetet üresen?';
$messages['notsentwarning'] = 'Az üzenet még nem lett elküldve. Eldobja az üzenetet?';
+$messages['restoresavedcomposedata'] = 'Egy elkezdett de el nem küldött üzenetet talált a program.\n\Tárgy: $subject\nMentve: $date\n\nSzeretnéd visszaállítani és folytatni ez az üzenetet?';
$messages['noldapserver'] = 'Adjon meg egy LDAP szervert a kereséshez';
$messages['nosearchname'] = 'Adja meg a kapcsolat nevét vagy e-mail címét';
$messages['notuploadedwarning'] = 'Még nem került feltöltésre minden csatolmány. Kérem várjon vagy állítsa le a feltöltést!';
@@ -140,6 +145,7 @@ $messages['smtperror'] = 'SMTP hiba ($code): $msg';
$messages['emailformaterror'] = 'Helytelen formátumú e-mail cím: $email';
$messages['toomanyrecipients'] = 'Túl sok a címzett. Csökkentse a címzettek számát maximum $max címre!';
$messages['maxgroupmembersreached'] = 'A csoport létszáma meghaladja a maximum $max főt';
+$messages['internalerror'] = 'Belső hiba történt. Kérjük próbálja újra!';
$messages['contactdelerror'] = 'Hiba a kapcsolat(ok) törlésekor';
$messages['contactdeleted'] = 'Kapcsolat(ok) sikeresen törölve';
$messages['contactrestoreerror'] = 'Nem sikerült a törölt kapcsolat(ok) helyreállítása';
diff --git a/program/localization/hy_AM/labels.inc b/program/localization/hy_AM/labels.inc
index fec95f3cd..fa5a2bec6 100644
--- a/program/localization/hy_AM/labels.inc
+++ b/program/localization/hy_AM/labels.inc
@@ -31,6 +31,7 @@ $labels['trash'] = 'Ô±Õ²Õ¢Õ¡Ö€Õ¯Õ²';
$labels['junk'] = 'Ô¹Õ¡ÖƒÕ¸Õ¶';
$labels['subject'] = 'ÕŽÕ¥Ö€Õ¶Õ¡Õ£Õ«Ö€';
$labels['from'] = 'ÕˆÖ‚Õ²Õ¡Ö€Õ¯Õ¸Õ²';
+$labels['sender'] = 'ÕˆÖ‚Õ²Õ¡Ö€Õ¯Õ¸Õ²';
$labels['to'] = 'ÕÕ¿Õ¡ÖÕ¸Õ²';
$labels['cc'] = 'Cc';
$labels['bcc'] = 'Bcc';
@@ -51,6 +52,9 @@ $labels['copy'] = 'Cc';
$labels['move'] = 'ÕÕ¥Õ²Õ¡ÖƒÕ¸Õ­Õ¥Õ¬';
$labels['moveto'] = 'ÕÕ¥Õ²Õ¡ÖƒÕ¸Õ­Õ¥Õ¬...';
$labels['download'] = 'Õ”Õ¡Õ·Õ¥Õ¬';
+$labels['open'] = 'Ô²Õ¡Ö';
+$labels['showattachment'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬';
+$labels['showanyway'] = 'Ô±Õ´Õ¥Õ¶ Õ¤Õ¥ÕºÖ„Õ¸Ö‚Õ´ ÖÕ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬';
$labels['filename'] = 'Õ–Õ¡ÕµÕ¬Õ« Õ¡Õ¶Õ¸Ö‚Õ¶';
$labels['filesize'] = 'Õ–Õ¡ÕµÕ¬Õ« Õ¹Õ¡Öƒ';
$labels['addtoaddressbook'] = 'Õ€Õ«Õ·Õ¥Õ¬ Õ°Õ¡Õ½ÖÕ¥Õ¶';
@@ -133,6 +137,7 @@ $labels['unread'] = 'Õ‰Õ¯Õ¡Ö€Õ¤Õ¡ÖÕ¡Õ®Õ¨';
$labels['flagged'] = 'Õ†Õ·Õ¾Õ¡Õ®';
$labels['unanswered'] = 'Ô±Õ¶ÕºÕ¡Õ¿Õ¡Õ½Õ­Õ¡Õ¶';
$labels['deleted'] = 'Õ‹Õ¶Õ»Õ¾Õ¡Õ®';
+$labels['undeleted'] = 'Õ‹Õ¶Õ»Õ¾Õ¡Õ® Õ¹Õ§';
$labels['invert'] = 'Õ“Õ¸Õ­Õ¡Õ¿Õ¥Õ²Õ¥Õ¬';
$labels['filter'] = 'Ô¶Õ¿Õ«Õ¹';
$labels['list'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¯';
@@ -166,9 +171,13 @@ $labels['quicksearch'] = 'Ô±Ö€Õ¡Õ£ Õ¸Ö€Õ¸Õ¶Õ¸Ö‚Õ´';
$labels['resetsearch'] = 'ÕŽÕ¥Ö€Õ½Õ¯Õ½Õ¥Õ¬ Õ¸Ö€Õ¸Õ¶Õ¸Ö‚Õ´Õ¨';
$labels['searchmod'] = 'ÕˆÖ€Õ¸Õ¶Õ´Õ¡Õ¶ ÖƒÕ¸ÖƒÕ¸Õ­Õ«Õ¹Õ¶Õ¥Ö€';
$labels['msgtext'] = 'ÕˆÕ²Õ» Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨';
+$labels['body'] = 'Õ„Õ¡Ö€Õ´Õ«Õ¶';
+$labels['type'] = 'ÕÖ‡';
+$labels['namex'] = 'Ô±Õ¶Õ¾Õ¡Õ¶Õ¸Ö‚Õ´';
$labels['openinextwin'] = 'Ô²Õ¡ÖÕ¥Õ¬ Õ¶Õ¸Ö€ ÕºÕ¡Õ¿Õ¸Ö‚Õ°Õ¡Õ¶Õ¸Ö‚Õ´';
$labels['emlsave'] = 'Õ†Õ¥Ö€Õ¢Õ¥Õ¼Õ¶Õ¥Õ¬ (.eml)';
$labels['editasnew'] = 'Ô½Õ´Õ¢Õ¡Õ£Ö€Õ¥Õ¬ Õ¸Ö€ÕºÕ¥Õ½ Õ¶Õ¸Ö€';
+$labels['send'] = 'ÕˆÖ‚Õ²Õ¡Ö€Õ¯Õ¥Õ¬';
$labels['sendmessage'] = 'ÕˆÖ‚Õ²Õ¡Ö€Õ¯Õ¥Õ¬';
$labels['savemessage'] = 'Õ€Õ«Õ·Õ¥Õ¬ Õ¸Ö€ÕºÕ¥Õ½ Õ½Ö‡Õ¡Õ£Õ«Ö€';
$labels['addattachment'] = 'Ô¿ÖÕ¥Õ¬ Ö†Õ¡ÕµÕ¬';
@@ -198,6 +207,9 @@ $labels['nosubject'] = '(Õ¡Õ¼Õ¡Õ¶Ö Õ¾Õ¥Ö€Õ¶Õ¡Õ£Ö€Õ«)';
$labels['showimages'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ Õ¶Õ¯Õ¡Ö€Õ¶Õ¥Ö€Õ¨';
$labels['alwaysshow'] = 'Õ„Õ«Õ·Õ¿ ÖÕ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ ÕºÕ¡Õ¿Õ¯Õ¥Ö€Õ¶Õ¥Ö€Õ¨ $sender–իÖ';
$labels['isdraft'] = 'ÕÕ¡ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¡Õ¶ Õ½Ö‡Õ¡Õ£Õ«Ö€ Õ§';
+$labels['andnmore'] = '$nr Õ¡ÕµÕ¬...';
+$labels['togglemoreheaders'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ Õ¢Õ¸Õ¬Õ¸Ö€ Õ£Õ¬Õ­Õ¡Õ£Ö€Õ¥Ö€Õ¨';
+$labels['togglefullheaders'] = 'Õ“Õ¸Õ­Õ¥Õ¬ Õ£Õ¬Õ­Õ¡Õ£Ö€Õ¥Ö€Õ¨';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'ÕŠÕ¡Ö€Õ¦ Õ¿Õ¥Ö„Õ½Õ¿';
$labels['savesentmessagein'] = 'Ô³Ö€Õ¡Õ¶ÖÕ¥Õ¬ Õ¸Ö‚Õ²Õ¡Ö€Õ¯Õ¾Õ¡Õ® Õ¶Õ¡Õ´Õ¡Õ¯Õ¨';
@@ -279,6 +291,8 @@ $labels['composeto'] = 'Ô³Ö€Õ¥Õ¬ Õ¶Õ¡Õ´Õ¡Õ¯';
$labels['contactsfromto'] = 'Õ€Õ¡Õ½ÖÕ¥Õ¶Õ¥Ö€ $fromâ€“Õ«Ö $to–ը Õ¥Õ²Õ¡Õ® $count–իÖ';
$labels['print'] = 'ÕÕºÕ¥Õ¬';
$labels['export'] = 'Ô±Ö€Õ¿Õ¡Õ°Õ¡Õ¶Õ¥Õ¬';
+$labels['exportall'] = 'Ô±Ö€Õ¿Õ¡Õ°Õ¡Õ¶Õ¥Õ¬ Õ¢Õ¸Õ¬Õ¸Ö€Õ¨';
+$labels['exportsel'] = 'Ô±Ö€Õ¿Õ¡Õ°Õ¡Õ¶Õ¥Õ¬ Õ¶Õ·Õ¾Õ¡Õ®Õ¶Õ¥Ö€Õ¨';
$labels['exportvcards'] = 'Ô±Ö€Õ¿Õ¡Õ°Õ¡Õ¶Õ¥Õ¬ Õ°Õ¡Õ½ÖÕ¥Õ¶Õ¥Ö€Õ¨ vCard Õ¹Õ¡ÖƒÕ¡Õ±Ö‡Õ¸Õ¾';
$labels['newcontactgroup'] = 'ÕÕ¿Õ¥Õ²Õ®Õ¥Õ¬ Õ¯Õ¡ÕºÕ¸Ö€Õ¤Õ¶Õ¥Ö€Õ« Õ¶Õ¸Ö€ Õ­Õ¸Ö‚Õ´Õ¢';
$labels['grouprename'] = 'ÕŽÕ¥Ö€Õ¡Õ¶Õ¾Õ¡Õ¶Õ¥Õ¬ Õ­Õ¸Ö‚Õ´Õ¢Õ¨';
@@ -290,13 +304,16 @@ $labels['nextpage'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ Õ°Õ¡Õ»Õ¸Ö€Õ¤ Õ§Õ»Õ¨';
$labels['lastpage'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ Õ¾Õ¥Ö€Õ»Õ«Õ¶ Õ§Õ»Õ¨';
$labels['group'] = 'Ô½Õ¸Ö‚Õ´Õ¢';
$labels['groups'] = 'Ô½Õ´Õ¢Õ¥Ö€';
+$labels['listgroup'] = 'Ô½Õ´Õ¢Õ« Õ¡Õ¶Õ¤Õ¡Õ´Õ¶Õ¥Ö€Õ« ÖÕ¡Õ¶Õ¯';
$labels['personaladrbook'] = 'Ô±Õ¶Õ±Õ¶Õ¡Õ¯Õ¡Õ¶ Õ°Õ¡Õ½ÖÕ¥Õ¶Õ¥Ö€';
$labels['searchsave'] = 'ÕŠÕ¡Õ°ÕºÕ¡Õ¶Õ¥Õ¬ Õ¸Ö€Õ¸Õ¶Õ¸Ö‚Õ´Õ¨';
$labels['searchdelete'] = 'Õ‹Õ¶Õ»Õ¥Õ¬ Õ¸Ö€Õ¸Õ¶Õ¸Ö‚Õ´Õ¨';
$labels['import'] = 'Õ†Õ¥Ö€Õ¯Ö€Õ¥Õ¬';
$labels['importcontacts'] = 'Õ†Õ¥Ö€Õ¯Ö€Õ¥Õ¬ Õ°Õ¡Õ½ÖÕ¥Õ¶Õ¥Ö€';
$labels['importfromfile'] = 'Õ†Õ¥Ö€Õ¯Ö€Õ¥Õ¬ Ö†Õ¡ÕµÕ¬Õ«Ö';
+$labels['importtarget'] = 'Ô±Õ¾Õ¥Õ¬Õ¡ÖÕ¶Õ¥Õ¬ Õ¯Õ¡ÕºÕ¸Ö€Õ¤Õ¶Õ¥Ö€Õ¨';
$labels['importreplace'] = 'Õ“Õ¸Õ­Õ¥Õ¬ Õ¸Õ²Õ» Õ°Õ¡Õ½ÖÕ¥Õ¡Õ£Õ«Ö€Ö„Õ¨';
+$labels['importdesc'] = 'Ô´Õ¸Ö‚Ö„ Õ¯Õ¡Ö€Õ¸Õ² Õ¥Ö„ Õ¾Õ¥Ö€Õ¢Õ¥Õ¼Õ¶Õ¥Õ¬ Õ¯Õ¡ÕºÕ¸ÖÕ¶Õ¥Ö€Õ¶ Õ¡Ö€Õ¤Õ¥Õ¶ Õ£Õ¸ÕµÕ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶ Õ¸Ö‚Õ¶Õ¥ÖÕ¸Õ² Õ°Õ¡Õ½ÖÕ¥Õ¡Õ£Ö€Ö„Õ«Ö:<br/>Ô±ÕµÕªÕ´ Õ´Õ¥Õ¶Ö„ Ö…Õ£Õ¶Õ¸Ö‚Õ´ Õ¥Õ¶Ö„ Õ¶Õ¥Ö€Õ´Õ¸Ö‚Õ®Õ¥Õ¬ <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> Õ¯Õ¡Õ´ CSV (comma-separated) Õ¿Õ¾ÕµÕ¡Õ¬Õ¶Õ¥Ö€Õ« Õ±Ö‡Õ¡Õ¹Õ¡ÖƒÕ¥Ö€Õ«Ö:';
$labels['done'] = 'Ô±Õ¾Õ¡Ö€Õ¿Õ¾Õ¡Õ® Õ§';
$labels['settingsfor'] = 'Õ†Õ¡Õ­Õ¡Õ½Õ«Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¶Õ¥Ö€';
$labels['about'] = 'Õ†Õ¯Õ¡Ö€Õ¡Õ£Õ«Ö€';
@@ -311,6 +328,8 @@ $labels['edititem'] = 'Ô½Õ´Õ¢Õ¡Õ£Ö€Õ¥Õ¬ Õ«Ö€Õ¨';
$labels['preferhtml'] = 'Ô³Õ¥Ö€Õ¡Õ¤Õ¡Õ½Õ¥Õ¬ HTML';
$labels['defaultcharset'] = 'Ô¼Õ¼Õ¥Õ¬ÕµÕ¡Õ¬ Õ¿Õ¡Õ¼Õ¡Õ·Õ¡Ö€';
$labels['htmlmessage'] = 'HTML Õ¶Õ¡Õ´Õ¡Õ¯';
+$labels['messagepart'] = 'Õ´Õ¡Õ½';
+$labels['digitalsig'] = 'Ô¹Õ¾Õ¡ÕµÕ«Õ¶ Õ½Õ¿Õ¸Ö€Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶';
$labels['dateformat'] = 'Ô±Õ´Õ½Õ¡Õ©Õ¾Õ« Õ±Ö‡Õ¡Õ¹Õ¡Öƒ';
$labels['timeformat'] = 'ÔºÕ¡Õ´Õ¡Õ¶Õ¡Õ¯Õ« Õ±Ö‡Õ¡Õ¹Õ¡Öƒ';
$labels['prettydate'] = 'ÕŠÕ¡Ö€Õ¦ Õ¡Õ´Õ½Õ¡Õ©Õ¾Õ¥Ö€';
@@ -321,8 +340,11 @@ $labels['timezone'] = 'ÔºÕ¡Õ´Õ¡ÕµÕ«Õ¶ Õ£Õ¸Õ¿Õ«';
$labels['pagesize'] = 'ÕÕ¸Õ²Õ¥Ö€ Õ¡Õ¼ Õ§Õ»';
$labels['signature'] = 'ÕÕ¿Õ¸Ö€Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶';
$labels['dstactive'] = 'Ô±Õ´Õ¡Õ¼Õ¡ÕµÕ«Õ¶ ÕªÕ¡Õ´Õ¡Õ¶Õ¡Õ¯';
+$labels['showinextwin'] = 'Ô²Õ¡ÖÕ¥Õ¬ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¶Õ¸Ö€ ÕºÕ¡Õ¿Õ¸Ö‚Õ°Õ¡Õ¶Õ¸Ö‚Õ´';
+$labels['composeextwin'] = 'Ô¿Õ¡Õ¦Õ´Õ¥Õ¬ Õ¶Õ¸Ö€ ÕºÕ¡Õ¿Õ¸Ö‚Õ°Õ¡Õ¶Õ¸Ö‚Õ´';
$labels['htmleditor'] = 'ÕÕ¿Õ¥Õ²Õ®Õ¥Õ¬ HTML Õ¶Õ¡Õ´Õ¡Õ¯Õ¶Õ¥Ö€';
$labels['htmlonreply'] = 'Õ´Õ«Õ¡ÕµÕ¶ HTML Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¡Õ¶Õ¨ ÕºÕ¡Õ¿Õ¡Õ½Õ­Õ¡Õ¶Õ¥Õ¬Õ«Õ½';
+$labels['htmlonreplyandforward'] = 'Õ´Õ«Õ¡ÕµÕ¶ HTML Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¡Õ¶Õ¨ ÕºÕ¡Õ¿Õ¡Õ½Õ­Õ¡Õ¶Õ¥Õ¬Õ«Õ½ Õ¯Õ¡Õ´ Õ¾Õ¥Ö€Õ¡Õ°Õ¡Õ½ÖÕ¥Õ¡Õ¾Õ¸Ö€Õ¥Õ¬Õ«Õ½';
$labels['htmlsignature'] = 'HTML Õ½Õ¿Õ¸Ö€Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶';
$labels['previewpane'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ ÕºÕ¡Õ¿Õ¸Ö‚Õ°Õ¡Õ¶Õ¨';
$labels['skin'] = 'ÕÕ¥Õ½Ö„Õ« Õ¿Õ¡Ö€Õ¢Õ¥Ö€Õ¡Õ¯';
@@ -348,6 +370,7 @@ $labels['always'] = 'Õ´Õ«Õ·Õ¿';
$labels['showinlineimages'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ Õ¯ÖÕ¾Õ¡Õ® ÕºÕ¡Õ¿Õ¯Õ¥Ö€Õ¶Õ¥Ö€Õ¨ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¡Õ¶ Õ¿Õ¡Õ¯';
$labels['autosavedraft'] = 'ÕÖ‡Õ¡Õ£Ö€Õ« Õ¡Õ¾Õ¿Õ¸Õ´Õ¡Õ¿ Õ£Ö€Õ¡Õ¶ÖÕ¸Ö‚Õ´';
$labels['everynminutes'] = 'Õ¡Õ´Õ¥Õ¶ $n Ö€Õ¸ÕºÕ¥Õ¶';
+$labels['refreshinterval'] = 'Ô¹Õ¡Ö€Õ´Õ¡ÖÕ¶Õ¥Õ¬ (Õ½Õ¿Õ¸Ö‚Õ£Õ¥Õ¬ Õ¶Õ¸Ö€ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¶Õ¥Ö€Õ¨ Ö‡ Õ¡ÕµÕ¬Õ¶)';
$labels['never'] = 'Õ¥Ö€Õ¢Õ¥Ö„';
$labels['immediately'] = 'Õ¡Õ¶Õ´Õ«Õ»Õ¡ÕºÕ¥Õ½';
$labels['messagesdisplaying'] = 'Õ¶Õ¡Õ´Õ¡Õ¯Õ¶Õ¥Ö€Õ¨ ÖÕ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬Õ«Õ½';
@@ -369,6 +392,7 @@ $labels['maintenance'] = 'ÕÕºÕ¡Õ½Õ¡Ö€Õ¯Õ¸Ö‚Õ´';
$labels['newmessage'] = 'Õ†Õ¸Ö€ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶';
$labels['signatureoptions'] = 'ÕÕ¿Õ¸Ö€Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¡Õ¶ Õ¨Õ¶Õ¿Ö€Õ¡Õ¶Ö„Õ¶Õ¥Ö€';
$labels['whenreplying'] = 'ÕŠÕ¡Õ¿Õ¡Õ½Õ­Õ¡Õ¶Õ¥Õ¬Õ«Õ½';
+$labels['replyempty'] = 'Õ´Õ« Ö„Õ¡Õ²Õ¾Õ¡Õ®Õ¥Ö„Õ¡Õ¼Õ¡Õ»Õ«Õ¶ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨';
$labels['replytopposting'] = 'Õ½Õ¯Õ½Õ¥Õ¬ Õ¶Õ¸Ö€ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¾Õ¥Ö€Ö‡Õ«Ö';
$labels['replybottomposting'] = 'Õ½Õ¯Õ½Õ¥Õ¬ Õ¶Õ¸Ö€ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¶Õ¥Ö€Ö„Ö‡Õ«Ö';
$labels['replyremovesignature'] = 'ÕŠÕ¡Õ¿Õ¡Õ½Õ­Õ¡Õ¶Õ¥Õ¬Õ«Õ½ Õ°Õ¥Õ¼Õ¡ÖÕ¶Õ¥Õ¬ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ«Ö Õ¶Õ¡Õ­Õ¸Ö€Õ¤ Õ½Õ¿Õ¸Ö€Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨';
@@ -381,6 +405,7 @@ $labels['afternseconds'] = '$n Õ¾Õ¡Ö€Õ¯ÕµÕ¡Õ¶ Õ°Õ¥Õ¿Õ¸';
$labels['reqmdn'] = 'Õ„Õ«Õ·Õ¿ ÕºÕ¡Õ¿Õ¾Õ«Ö€Õ¥Õ¬ Õ½Õ¿Õ¡ÖÕ¡Õ¯Õ¡Õ¶';
$labels['reqdsn'] = 'Õ„Õ«Õ·Õ¿ ÕºÕ¡Õ¿Õ¾Õ«Ö€Õ¥Õ¬ Õ¡Õ¼Õ¡Ö„Õ´Õ¡Õ¶ Õ¯Õ¡Ö€Õ£Õ¡Õ¾Õ«Õ³Õ¡Õ¯Õ« Õ®Õ¡Õ¶Õ¸Ö‚ÖÕ¸Ö‚Õ´';
$labels['replysamefolder'] = 'Õ€Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¡Õ¶ ÕºÕ¡Õ¿Õ¡Õ½Õ­Õ¡Õ¶Õ¶Õ¥Ö€Õ¨ ÕºÕ¡Õ°Õ¥Õ¬ Õ¶Õ¸Ö‚ÕµÕ¶ ÕºÕ¡Õ¶Õ¡Õ¯Õ¸Ö‚Õ´';
+$labels['defaultabook'] = 'Õ€Õ«Õ´Õ¶Õ¡Õ¯Õ¡Õ¶ Õ°Õ¡Õ½ÖÕ¥Õ¡Õ£Õ«Ö€Ö„Õ¨';
$labels['autocompletesingle'] = 'Ô±Õ¾Õ¿Õ¸Õ¬Ö€Õ¡ÖÕ´Õ¡Õ¶ ÕªÕ¡Õ´Õ¡Õ¶Õ¡Õ¯ Õ¢Õ¡ÖÕ¡Õ¼Õ¥Õ¬ Õ¡ÕµÕ¬Õ¨Õ¶Õ¿Ö€Õ¡Õ¶Ö„Õ¡ÕµÕ«Õ¶ Õ§Õ¬ÖƒÕ¸Õ½Õ¿Õ« Õ°Õ¡Õ½ÖÕ¥Õ¶Õ¥Ö€Õ¨';
$labels['listnamedisplay'] = 'Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ Õ¯Õ¡ÕºÕ¸Ö€Õ¤Õ¶Õ¥Ö€Õ¨ Õ¸Ö€ÕºÕ¥Õ½';
$labels['spellcheckbeforesend'] = 'ÕÕ¿Õ¸Ö‚Õ£Õ¥Õ¬ Õ¿Õ¡Õ¼Õ¡Õ½Õ­Õ¡Õ¬Õ¶Õ¥Ö€Õ¨ Õ°Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¸Ö‚Õ²Õ¡Ö€Õ¯Õ¥Õ¬Õ¸Ö‚Ö Õ¡Õ¼Õ¡Õ»';
@@ -390,6 +415,9 @@ $labels['spellcheckignorenums'] = 'Ô±Õ¶Õ¿Õ¥Õ½Õ¥Õ¬ Õ©Õ¾Õ¥Ö€Õ¸Õ¾ Õ¢Õ¡Õ¼Õ¥Ö€Õ¨';
$labels['spellcheckignorecaps'] = 'Ô±Õ¶Õ¿Õ¥Õ½Õ¥Õ¬ Õ¬Ö€Õ«Õ¾ Õ´Õ¥Õ®Õ¡Õ¿Õ¡Õ¼ Õ¢Õ¡Õ¼Õ¥Ö€Õ¨';
$labels['addtodict'] = 'Ô±Õ¾Õ¥Õ¬Õ¡ÖÕ¶Õ¥Õ¬ Õ¢Õ¡Õ¼Õ¡Ö€Õ¡Õ¶Õ¸Ö‚Õ´';
$labels['mailtoprotohandler'] = 'mailto: Õ°Õ²Õ¸Ö‚Õ´Õ¶Õ¥Ö€Õ« Õ½ÕºÕ¡Õ½Õ¡Ö€Õ¯Õ¸Õ²';
+$labels['forwardmode'] = 'Õ€Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¶Õ¥Ö€Õ« Õ¾Õ¥Ö€Õ¡Õ°Õ¡Õ½ÖÕ¥Õ¡Õ¾Õ¸Ö€Õ¸Ö‚Õ´';
+$labels['inline'] = 'Õ´Õ¥Õ»Õ¨';
+$labels['asattachment'] = 'Õ¸Ö€ÕºÕ¥Õ½ Õ¯ÖÕ¸Ö€Õ¤';
$labels['folder'] = 'Ô´Õ¡Ö€Õ¡Õ¯';
$labels['folders'] = 'Ô´Õ¡Ö€Õ¡Õ¯Õ¶Õ¥Ö€';
$labels['foldername'] = 'Ô´Õ¡Ö€Õ¡Õ¯Õ« Õ¡Õ¶Õ¸Ö‚Õ¶';
@@ -414,6 +442,7 @@ $labels['sortby'] = 'Ô´Õ¡Õ½Õ¡Õ¾Õ¸Ö€Õ¥Õ¬';
$labels['sortasc'] = 'Õ¨Õ½Õ¿ Õ¡Õ³Õ´Õ¡Õ¶';
$labels['sortdesc'] = 'Õ¨Õ½Õ¿ Õ¶Õ¾Õ¡Õ¦Õ´Õ¡Õ¶';
$labels['undo'] = 'ÔµÕ¿Õ¡Ö€Õ¯Õ¥Õ¬';
+$labels['installedplugins'] = 'ÕÕ¥Õ²Õ¡Õ¯Õ¡ÕµÕ¾Õ¡Õ® Õ°Õ¡Õ¾Õ¥Õ¬Õ¸Ö‚Õ´Õ¶Õ¥Ö€Õ¨';
$labels['plugin'] = 'Ô½Ö€Õ«Õ¹';
$labels['version'] = 'ÕÕ¡Ö€Õ¢Õ¥Ö€Õ¡Õ¯';
$labels['source'] = 'Ô±Õ²Õ¢ÕµÕ¸Ö‚Ö€';
diff --git a/program/localization/ia/messages.inc b/program/localization/ia/messages.inc
index 50ef68145..32733f21d 100644
--- a/program/localization/ia/messages.inc
+++ b/program/localization/ia/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
diff --git a/program/localization/index.inc b/program/localization/index.inc
index 616999514..38edb7367 100644
--- a/program/localization/index.inc
+++ b/program/localization/index.inc
@@ -5,7 +5,7 @@
| program/localization/index.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -26,7 +26,8 @@
$rcube_languages = array(
'sq_AL' => 'Albanian (Shqip)',
- 'ar_SA' => 'Arabic (العربية)',
+ 'ar' => 'Arabic (العربية)',
+ 'ar_SA' => 'Arabic (Saudi Arabia)',
'hy_AM' => 'Armenian (Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶)',
'ast' => 'Asturiana (Asturianu)',
'az_AZ' => 'Azerbaijani (Azərbaycanca)',
@@ -46,10 +47,12 @@ $rcube_languages = array(
'de_DE' => 'German (Deutsch)',
'de_CH' => 'German (Schweiz)',
'nl_NL' => 'Dutch (Nederlands)',
+ 'en_CA' => 'English (Canada)',
'en_GB' => 'English (GB)',
'en_US' => 'English (US)',
'eo' => 'Esperanto',
'et_EE' => 'Estonian (Eesti)',
+ 'fo_FO' => 'Faroese (Føroyskt)',
'fi_FI' => 'Finnish (Suomi)',
'nl_BE' => 'Flemish (Vlaams)',
'fr_FR' => 'French (Français)',
@@ -66,6 +69,7 @@ $rcube_languages = array(
'it_IT' => 'Italian (Italiano)',
'ja_JP' => 'Japanese (日本語)',
'km_KH' => 'Khmer (ភាសាážáŸ’មែរ)',
+ 'kn_IN' => 'Konkani (कोंकणी)',
'ko_KR' => 'Korean (한국어)',
'ku' => 'Kurdish (Kurmancî)',
'lv_LV' => 'Latvian (Latviešu)',
@@ -91,8 +95,10 @@ $rcube_languages = array(
'sl_SI' => 'Slovenian (SlovenÅ¡Äina)',
'es_AR' => 'Spanish (Argentina)',
'es_ES' => 'Spanish (Español)',
+ 'es_419' => 'Spanish (Latin America)',
'sv_SE' => 'Swedish (Svenska)',
'ta_IN' => 'Tamil (தமிழà¯)',
+ 'ti' => 'Tigrinya (ትáŒáˆ­áŠ›)',
'th_TH' => 'Thai (ไทย)',
'tr_TR' => 'Turkish (Türkçe)',
'uk_UA' => 'Ukrainian (УкраїнÑька)',
@@ -104,7 +110,6 @@ $rcube_languages = array(
$rcube_language_aliases = array(
'am' => 'hy_AM',
- 'ar' => 'ar_SA',
'az' => 'az_AZ',
'bg' => 'bg_BG',
'bs' => 'bs_BA',
@@ -134,6 +139,7 @@ $rcube_language_aliases = array(
'kr' => 'ko_KR',
'kh' => 'km_KH',
'kh_KH' => 'km_KH',
+ 'kn' => 'kn_IN',
'km' => 'km_KH',
'lb' => 'lb_LU',
'ne' => 'ne_NP',
diff --git a/program/localization/it_IT/labels.inc b/program/localization/it_IT/labels.inc
index ac8e2a6d4..f0f660d3d 100644
--- a/program/localization/it_IT/labels.inc
+++ b/program/localization/it_IT/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to di $count';
$labels['copy'] = 'Copia';
$labels['move'] = 'Sposta';
$labels['moveto'] = 'Sposta in...';
+$labels['copyto'] = 'Copia su...';
$labels['download'] = 'Download';
$labels['open'] = 'Apri';
$labels['showattachment'] = 'Visualizza';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Controllo ortografico';
$labels['checkspelling'] = 'Controlla ortografia';
$labels['resumeediting'] = 'Torna al messaggio';
$labels['revertto'] = 'Ripristina';
+$labels['restore'] = 'Ripristina';
+$labels['restoremessage'] = 'Ripristinare il messaggio?';
+$labels['responses'] = 'Risposte';
+$labels['insertresponse'] = 'Inserisci una risposta';
+$labels['manageresponses'] = 'Gestione risposte';
+$labels['savenewresponse'] = 'Salva una nuova risposta';
+$labels['editresponses'] = 'Modifica risposte';
+$labels['editresponse'] = 'Modifica risposta';
+$labels['responsename'] = 'Nome';
+$labels['responsetext'] = 'Testo della Risposta';
$labels['attach'] = 'Allega';
$labels['attachments'] = 'Allegati';
$labels['upload'] = 'Aggiungi';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Gestisci i popup come finestre standard';
$labels['forwardmode'] = 'Inoltro messaggi';
$labels['inline'] = 'In linea';
$labels['asattachment'] = 'come allegato';
+$labels['replyallmode'] = 'Azione di defualt del bottone [Reply all]';
+$labels['replyalldefault'] = 'rispondi a tutti';
+$labels['replyalllist'] = 'rispondi solo alla mailing list (se disponibile)';
$labels['folder'] = 'Cartella';
$labels['folders'] = 'Cartelle';
$labels['foldername'] = 'Nome cartella';
diff --git a/program/localization/it_IT/messages.inc b/program/localization/it_IT/messages.inc
index c5a81044e..5d964697b 100644
--- a/program/localization/it_IT/messages.inc
+++ b/program/localization/it_IT/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Richiesta non valida! Nessun dato salvato.';
$messages['invalidhost'] = 'Nome del server non valido.';
$messages['nomessagesfound'] = 'Nessun messaggio trovato in questa cartella';
$messages['loggedout'] = 'Sessione chiusa correttamente. Arrivederci!';
-$messages['mailboxempty'] = 'La casella è vuota';
+$messages['mailboxempty'] = 'La Mailbox è vuota';
+$messages['nomessages'] = 'Non ci sono messaggi';
$messages['refreshing'] = 'Aggiornamento...';
$messages['loading'] = 'Caricamento...';
$messages['uploading'] = 'Caricamento file...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Messaggio inviato correttamente';
$messages['savingmessage'] = 'Salvataggio messaggio...';
$messages['messagesaved'] = 'Messaggio salvato in bozze';
$messages['successfullysaved'] = 'Salvato correttamente';
+$messages['savingresponse'] = 'Salvataggio della risposta...';
+$messages['deleteresponseconfirm'] = 'Sei sicuro di voler eliminare questa risposta?';
$messages['addedsuccessfully'] = 'Contatto aggiunto alla rubrica';
$messages['contactexists'] = 'Esiste già un contatto con questo indirizzo e-mail';
$messages['contactnameexists'] = 'Esiste già un contatto con questo nome';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'Il contatto richiesto non è stato trovato';
$messages['contactsearchonly'] = 'Inserisci dei termini per cercare i contatti';
$messages['sendingfailed'] = 'Impossibile inviare il messaggio';
$messages['senttooquickly'] = 'Per favore, attendi $sec secondi prima di inviare questo messaggio';
+$messages['errorsavingsent'] = 'Si è verificato un errore nel savare il messaggio inviato.';
+$messages['errorsaving'] = 'Si è verificato un errore nel salvataggio.';
$messages['errormoving'] = 'Impossibile spostare il messaggio';
$messages['errorcopying'] = 'Impossibile copiare il messaggio';
$messages['errordeleting'] = 'Impossibile eliminare il messaggio';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Per favore, immetti almeno un destinatario';
$messages['nosubjectwarning'] = 'L\'oggetto è vuoto. Vuoi inserirlo adesso?';
$messages['nobodywarning'] = 'Inviare il messaggio senza testo?';
$messages['notsentwarning'] = 'Il messaggio non è stato inviato. Vuoi annullare questo messaggio?';
+$messages['restoresavedcomposedata'] = 'E\' stato rilevato un precedente messaggio non inviato.\n\nSoggetto: $subject\nSalvato: $date\n\nVuoi ripristinare il messaggio?';
$messages['noldapserver'] = 'Per favore, scegli un server LDAP in cui ricercare';
$messages['nosearchname'] = 'Per favore, immetti un nome o un indirizzo e-mail';
$messages['notuploadedwarning'] = 'Non tutti gli allegati sono stati ancora caricati. Prego attendere, oppure cancellare il caricamento.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'Errore SMTP: $msg';
$messages['emailformaterror'] = 'Indirizzo e-mail non corretto: $email';
$messages['toomanyrecipients'] = 'Numero eccessivo di destinatari, ridurlo a $max';
$messages['maxgroupmembersreached'] = 'Il numero dei membri del gruppo eccede il massimo di $max';
+$messages['internalerror'] = 'Si è verificato un errore interno. Riprovare più tardi.';
$messages['contactdelerror'] = 'Impossibile eliminare il/i contatto/i';
$messages['contactdeleted'] = 'Contatto/i correttamente eliminato/i';
$messages['contactrestoreerror'] = 'Impossibile ripristinare il/i contatto/i cancellato/i';
diff --git a/program/localization/ja_JP/labels.inc b/program/localization/ja_JP/labels.inc
index aadc8fce0..e58582e73 100644
--- a/program/localization/ja_JP/labels.inc
+++ b/program/localization/ja_JP/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$count通ã®$from通目ã‹ã‚‰$to通目';
$labels['copy'] = 'コピー';
$labels['move'] = '移動';
$labels['moveto'] = 'フォルダーã«ç§»å‹•';
+$labels['copyto'] = 'コピー...';
$labels['download'] = 'ダウンロード';
$labels['open'] = 'é–‹ã';
$labels['showattachment'] = '表示';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'スペル';
$labels['checkspelling'] = 'スペルãƒã‚§ãƒƒã‚¯';
$labels['resumeediting'] = '編集をå†é–‹';
$labels['revertto'] = 'å…ƒã«æˆ»ã™';
+$labels['restore'] = '回復';
+$labels['restoremessage'] = 'メッセージを回復ã—ã¾ã™ã‹?';
+$labels['responses'] = '回答';
+$labels['insertresponse'] = '回答を挿入';
+$labels['manageresponses'] = '回答を管ç†';
+$labels['savenewresponse'] = 'æ–°ã—ã„回答をä¿å­˜';
+$labels['editresponses'] = '回答を編集';
+$labels['editresponse'] = '回答を編集';
+$labels['responsename'] = 'åå‰';
+$labels['responsetext'] = '回答ã®æ–‡ç« ';
$labels['attach'] = '添付';
$labels['attachments'] = '添付ファイル';
$labels['upload'] = 'アップロード';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'ãƒãƒƒãƒ—アップを通常ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã¨ã
$labels['forwardmode'] = 'メッセージã®è»¢é€å½¢å¼';
$labels['inline'] = 'インライン';
$labels['asattachment'] = '添付ファイル';
+$labels['replyallmode'] = '「全員ã«è¿”ä¿¡ã€ãƒœã‚¿ãƒ³ã®æ—¢å®šã®å‹•ä½œ';
+$labels['replyalldefault'] = '全員ã«è¿”ä¿¡';
+$labels['replyalllist'] = 'メーリングリスト(ã¨ã‚ã‹ã‚Œã°)ã ã‘ã«è¿”ä¿¡';
$labels['folder'] = 'フォルダー';
$labels['folders'] = 'フォルダー';
$labels['foldername'] = 'フォルダーå';
diff --git a/program/localization/ja_JP/messages.inc b/program/localization/ja_JP/messages.inc
index fb03bc0f8..1babab7a3 100644
--- a/program/localization/ja_JP/messages.inc
+++ b/program/localization/ja_JP/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -33,6 +33,7 @@ $messages['invalidhost'] = 'æ­£ã—ããªã„サーãƒãƒ¼åã§ã™ã€‚';
$messages['nomessagesfound'] = 'ã“ã®ãƒ•ã‚©ãƒ«ãƒ€ãƒ¼ã«ã¯ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã¯ã‚ã‚Šã¾ã›ã‚“。';
$messages['loggedout'] = 'ログアウトã—ã¾ã—ãŸã€‚ã•ã‚ˆã†ãªã‚‰!';
$messages['mailboxempty'] = 'メールボックスã¯ç©ºã§ã™ã€‚';
+$messages['nomessages'] = 'メッセージãªã—';
$messages['refreshing'] = 'å†è¡¨ç¤ºä¸­...';
$messages['loading'] = '読ã¿è¾¼ã¿ä¸­...';
$messages['uploading'] = 'ファイルをアップロード中...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'メッセージをé€ä¿¡ã—ã¾ã—ãŸã€‚';
$messages['savingmessage'] = 'メッセージをä¿å­˜ä¸­...';
$messages['messagesaved'] = 'メッセージを下書ãã«ä¿å­˜ã—ã¾ã—ãŸã€‚';
$messages['successfullysaved'] = 'ä¿å­˜ã—ã¾ã—ãŸã€‚';
+$messages['savingresponse'] = '回答ã®æ–‡ç« ã‚’ä¿å­˜ä¸­...';
+$messages['deleteresponseconfirm'] = 'ã“ã®å›žç­”ã®æ–‡ç« ã‚’本当ã«å‰Šé™¤ã—ã¾ã™ã‹?';
$messages['addedsuccessfully'] = '連絡先をアドレス帳ã«è¿½åŠ ã—ã¾ã—ãŸã€‚';
$messages['contactexists'] = 'åŒã˜ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã®é€£çµ¡å…ˆãŒæ—¢ã«å­˜åœ¨ã—ã¾ã™ã€‚';
$messages['contactnameexists'] = 'åŒã˜åå‰ã®é€£çµ¡å…ˆãŒæ—¢ã«å­˜åœ¨ã—ã¾ã™ã€‚';
@@ -80,6 +83,7 @@ $messages['norecipientwarning'] = 'å°‘ãªãã¨ã‚‚1ã¤å®›å…ˆã‚’入力ã—ã¦ãã
$messages['nosubjectwarning'] = '件å(Subject)ã®æ¬„ãŒç©ºã§ã™ã€‚今ã€å…¥åŠ›ã—ã¾ã™ã‹?';
$messages['nobodywarning'] = '本文ã®ç„¡ã„メッセージをé€ä¿¡ã—ã¾ã™ã‹?';
$messages['notsentwarning'] = 'メッセージをé€ä¿¡ã—ã¾ã›ã‚“ã§ã—ãŸã€‚ã“ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’破棄ã—ã¾ã™ã‹ã€‚';
+$messages['restoresavedcomposedata'] = '以å‰ã«ä½œæˆã—ã¦æœªé€ä¿¡ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒã‚ã‚Šã¾ã™ã€‚\n\n件å: $subject\nä¿å­˜æ—¥: $date\n\nã“ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’回復ã—ã¾ã™ã‹?';
$messages['noldapserver'] = '検索ã™ã‚‹LDAPサーãƒãƒ¼ã‚’é¸æŠžã—ã¦ãã ã•ã„。';
$messages['nosearchname'] = '連絡先ã®åå‰ã‹é›»å­ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’入力ã—ã¦ãã ã•ã„。';
$messages['notuploadedwarning'] = 'ã™ã¹ã¦ã®æ·»ä»˜ãƒ•ã‚¡ã‚¤ãƒ«ã®ã‚¢ãƒƒãƒ—ロードを完了ã—ã¦ã„ã¾ã›ã‚“。今ã—ã°ã‚‰ãå¾…ã¤ã‹ã€å–り消ã—ã—ã¦ãã ã•ã„。';
diff --git a/program/localization/km_KH/labels.inc b/program/localization/km_KH/labels.inc
index 9a2799922..c94133b5d 100644
--- a/program/localization/km_KH/labels.inc
+++ b/program/localization/km_KH/labels.inc
@@ -31,6 +31,7 @@ $labels['trash'] = 'ធុងសំរាម';
$labels['junk'] = 'សំបុážáŸ’រមិនល្អ';
$labels['subject'] = 'ចំណងជើង';
$labels['from'] = 'អ្នកផ្ញើ';
+$labels['sender'] = 'អ្នក​ផ្ញើ​';
$labels['to'] = 'អ្នកទទួល';
$labels['cc'] = 'Cc';
$labels['bcc'] = 'Bcc';
@@ -41,14 +42,18 @@ $labels['size'] = 'ទំហំ';
$labels['priority'] = 'អទិភាព';
$labels['organization'] = 'អង្គភាព';
$labels['readstatus'] = 'ស្ážáž¶áž“ភាពនៃការអាន';
+$labels['listoptions'] = 'ជម្រើស​បញ្ជី...';
$labels['mailboxlist'] = 'ážážáž‘ាំងអស់';
$labels['messagesfromto'] = 'សំបុážáŸ’រពី $from ទៅដល់ $toក្នុងចំណោម $count សំបុážáŸ’ážš';
$labels['threadsfromto'] = 'បន្ážáž»áŸ†ážŸáŸ†áž”áž»ážáŸ’រពី $from ទៅដល់ $toក្នុងចំណោម $count សំបុážáŸ’ážš';
$labels['messagenrof'] = 'សំបុážáŸ’ážš $nr នៃ $count';
+$labels['fromtoshort'] = '$from – $to នៃ $count';
$labels['copy'] = 'ចំលង';
$labels['move'] = 'ផ្ទáŸážš';
$labels['moveto'] = 'ផ្ទáŸážšáž‘ៅ';
$labels['download'] = 'ទាញយក';
+$labels['showattachment'] = 'បង្ហាញ';
+$labels['showanyway'] = 'បង្ហាញ​វា​យ៉ាង​ណា​កáŸâ€‹áž”ាន';
$labels['filename'] = 'ឈ្មោះឯកសារ';
$labels['filesize'] = 'ទំហំឯកសារ';
$labels['addtoaddressbook'] = 'រក្សាទុកក្នុងសៀវភៅអាសយដ្ឋាន';
@@ -91,43 +96,54 @@ $labels['longoct'] = 'ážáž»áž›áž¶';
$labels['longnov'] = 'វិច្ឆិកា';
$labels['longdec'] = 'ធ្នូ';
$labels['today'] = 'ážáŸ’ងៃនáŸáŸ‡';
+$labels['refresh'] = 'ធ្វើ​ឲ្យ​ស្រស់';
$labels['checkmail'] = 'áž–áž·áž“áž·ážáŸ’យសំបុážáŸ’ážšážáŸ’មី';
$labels['compose'] = 'សរសáŸážšážŸáŸ†áž”áž»ážáŸ’ážšážáŸ’មី';
$labels['writenewmessage'] = 'សរសáŸážšážŸáŸ†áž”áž»ážáŸ’ážšážáŸ’មី';
+$labels['reply'] = 'ឆ្លើយ';
$labels['replytomessage'] = 'ឆ្លើយážáž”ទៅអ្នកផ្ញើ';
$labels['replytoallmessage'] = 'ឆ្លើយážáž”ទៅ អ្នកទទួលទាំងអស់និង ក្រុម ឬ អ្នកផ្ញើ';
$labels['replyall'] = 'ឆ្លើយážáž”ទៅទាំងអស់គ្នា';
-$labels['replylist'] = 'ឆ្លើយážáž”ទៅក្រុម';
-$labels['forwardmessage'] = 'ផ្ញើសំបុážáŸ’របន្ážážš';
-$labels['deletemessage'] = 'លុបសំបុážáŸ’រចោល';
-$labels['movemessagetotrash'] = 'ផ្ទáŸážšážŸáŸ†áž”áž»ážáŸ’រទៅក្នុងធុងសំរាម';
-$labels['printmessage'] = 'បោះពុម្ភសំបុážáŸ’ážš';
-$labels['previousmessage'] = 'បង្ហាញសំបុážáŸ’រចាស់';
-$labels['firstmessage'] = 'បង្ហាញសំបុážáŸ’រដំបូង';
-$labels['nextmessage'] = 'បង្ហាញសំបុážáŸ’របន្ទាប់';
-$labels['lastmessage'] = 'បង្ហាញសំបុážáŸ’រចុងក្រោយ';
-$labels['backtolist'] = 'ážáŸ’រលប់ទៅកាន់ក្រុមសំបុážáŸ’ážš';
-$labels['viewsource'] = 'បង្ហាញ Source របស់សំបុážáŸ’ážš';
-$labels['markmessages'] = 'កំណážáŸ‹ážŸáŸ†áž‚ាល់សំបុážáŸ’ážš';
-$labels['markread'] = 'កំណážáŸ‹ážáž¶áž”ានអានរួច';
-$labels['markunread'] = 'កំណážáŸ‹ážáž¶áž˜áž·áž“ទាន់បានអាន';
-$labels['markflagged'] = 'កំណážáŸ‹ážŸáŸ†áž‚ាល់ដោយផ្កាយ';
-$labels['markunflagged'] = 'លុបកំណážáŸ‹ážŸáŸ†áž‚ាល់ដោយផ្កាយ';
+$labels['replylist'] = 'បញ្ជី​ឆ្លើយážáž”';
+$labels['forward'] = 'បញ្ជូន​បន្áž';
+$labels['forwardinline'] = 'បញ្ចូល​បន្ážâ€‹áž€áŸ’នុង​បន្ទាážáŸ‹';
+$labels['forwardattachment'] = 'បញ្ជូន​បន្ážâ€‹áž‡áž¶â€‹áž¯áž€ážŸáž¶ážšâ€‹áž—្ជាប់';
+$labels['forwardmessage'] = 'បញ្ជូន​បន្ážâ€‹ážŸáž¶ážš';
+$labels['deletemessage'] = 'លុប​សារ';
+$labels['movemessagetotrash'] = 'ផ្លាស់ទី​សារ​ទៅ​ធុង​សំរាម';
+$labels['printmessage'] = 'បោះពុម្ព​សារ​នáŸáŸ‡';
+$labels['previousmessage'] = 'បង្ហាញ​សារ​មុន';
+$labels['firstmessage'] = 'បង្ហាញ​សារ​ដំបូង';
+$labels['nextmessage'] = 'បង្ហាញ​សារ​បន្ទាប់';
+$labels['lastmessage'] = 'បង្ហាញ​សារ​ចុងក្រោយ';
+$labels['backtolist'] = 'ážáŸ’រឡប់​ទៅ​កាន់​បញ្ជី​សារ';
+$labels['viewsource'] = 'បង្ហាញ​ប្រភព';
+$labels['mark'] = 'សម្គាល់';
+$labels['markmessages'] = 'សម្គាល់​សារ';
+$labels['markread'] = 'អាន​រួច';
+$labels['markunread'] = 'មិន​ទាន់​អាន';
+$labels['markflagged'] = 'ដាក់​ទង់';
+$labels['markunflagged'] = 'ដោះ​ទង់';
+$labels['moreactions'] = 'សកម្មភាព​ច្រើន​ទៀáž...';
+$labels['more'] = 'ច្រើន​ទៀáž';
+$labels['back'] = 'ážáŸ’រឡប់​ក្រោយ';
+$labels['options'] = 'ជម្រើស';
$labels['select'] = 'ជ្រើសរើស';
$labels['all'] = 'ទាំងអស់';
$labels['none'] = 'មិនážáŸ†ážšáŸ€áž”';
-$labels['currpage'] = 'ទំពáŸážšáž“áŸáŸ‡';
-$labels['unread'] = 'មិនទាន់អាន';
+$labels['currpage'] = 'ទំពáŸážšâ€‹áž”ច្ចុប្បន្ន';
+$labels['unread'] = 'មិន​ទាន់​អាន';
$labels['flagged'] = 'មានកំណážáŸ‹ážŸáŸ†áž‚ាល់ដោយផ្កាយ';
$labels['unanswered'] = 'មិនទាន់ឆ្លើយážáž”';
-$labels['deleted'] = 'បានលុបរួច';
+$labels['deleted'] = 'បាន​លុប';
+$labels['undeleted'] = 'មិន​ទាន់​លុប';
$labels['invert'] = 'បញ្ច្រស់';
$labels['filter'] = 'លក្ážážáŸážŽáŸ’ឌ';
-$labels['list'] = 'ážáž¶ážšáž¶áž„';
+$labels['list'] = 'បញ្ជី';
$labels['threads'] = 'បណ្ážáž»áŸ†ážŸáŸ†áž”áž»ážáŸ’ážš';
-$labels['expand-all'] = 'បង្ហាញសំបុážáŸ’រទាំងអស់';
+$labels['expand-all'] = 'បង្ហាញ​ទាំងអស់';
$labels['expand-unread'] = 'បង្ហាញសំបុážáŸ’រមិនទាន់អាន';
-$labels['collapse-all'] = 'បិទសំបុážáŸ’រទាំងអស់';
+$labels['collapse-all'] = 'បង្រួញ​ទាំងអស់';
$labels['threaded'] = 'បានបែកចែកជាក្រុមរួច';
$labels['autoexpand_threads'] = 'បង្ហាញបណ្ážáž»áŸ†ážŸáŸ†áž”áž»ážáŸ’ážš';
$labels['do_expand'] = 'បណ្ážáž»áŸ†áž‘ាំងអស់';
@@ -157,6 +173,7 @@ $labels['msgtext'] = 'សំបុážáŸ’រទាំងមូល';
$labels['openinextwin'] = 'បើកក្នុងវីនដូវážáŸ’មី';
$labels['emlsave'] = 'រក្សាទុកទិន្ននáŸáž™áž‡áž¶áž¯áž€ážŸáž¶ážšáž”្រភáŸáž‘(.eml)';
$labels['editasnew'] = 'កែហើយរក្សាទុកដូចជាសំបុážáŸ’ážšážáŸ’មី';
+$labels['send'] = 'ផ្ញើ';
$labels['sendmessage'] = 'ផ្ញើសំបុážáŸ’ážšáž“áŸáŸ‡';
$labels['savemessage'] = 'រក្សាទុកសំបុážáŸ’រពង្រៀង';
$labels['addattachment'] = 'ឯកសារភ្ជាប់';
@@ -164,12 +181,17 @@ $labels['charset'] = 'ប្រភáŸáž‘អក្សរ';
$labels['editortype'] = 'ប្រភáŸáž‘ Editor';
$labels['returnreceipt'] = 'អážáŸ’ážáž”ទបញ្ជាក់ពីការážáŸ’រឡប់';
$labels['dsn'] = 'ប្រាប់អំពីស្ážáž¶áž“ភាពផ្ញើ';
+$labels['mailreplyintro'] = 'កាលពី​ážáŸ’ងៃ $date, $sender បាន​សរសáŸážšáŸ–';
+$labels['originalmessage'] = 'សារ​ដើម';
$labels['editidents'] = 'ផ្លាស់ប្ážáž¼ážšáž¢ážáŸ’ážážŸáž‰áŸ’ញាណ';
+$labels['spellcheck'] = 'អក្ážážšáž¶ážœáž·ážšáž»áž‘្ធ';
$labels['checkspelling'] = 'áž–áž·áž“áž·ážáŸ’យអក្ážážšáž¶ážœáž·ážšáž»áž‘្ធ';
$labels['resumeediting'] = 'បន្ážážšáž€áž¶ážšáž€áŸ‚ážáŸ†ážšáž¼ážœ';
$labels['revertto'] = 'ážáŸ’រលប់ទៅ';
+$labels['attach'] = 'ភ្ជាប់';
$labels['attachments'] = 'ឯកសារភ្ជាប់';
$labels['upload'] = 'ភ្ជាប់ឯកសារ';
+$labels['uploadprogress'] = '$percent ($current ពី $total)';
$labels['close'] = 'បិទ';
$labels['messageoptions'] = 'កំណážáŸ‹áž‡áŸ†ážšáž¾ážŸážšáž”ស់សំបុážáŸ’ážš';
$labels['low'] = 'ទាប';
@@ -180,6 +202,10 @@ $labels['highest'] = 'ážáŸ’ពស់បំផុáž';
$labels['nosubject'] = '(គ្មានចំណងជើង)';
$labels['showimages'] = 'បង្ហាញរូបភាព';
$labels['alwaysshow'] = 'បង្ហាញជានិច្ចរាល់រូបភាពបញ្ជូនពី$sender';
+$labels['isdraft'] = 'áž“áŸáŸ‡â€‹áž‡áž¶â€‹ážŸáž¶ážšâ€‹áž–្រាង។';
+$labels['andnmore'] = '$nr ច្រើន​ទៀáž...';
+$labels['togglemoreheaders'] = 'បង្ហាញ​បឋមកážáž¶â€‹ážŸáž¶ážšâ€‹áž…្រើន​ទៀáž';
+$labels['togglefullheaders'] = 'បិទ/បើក​បឋមកážáž¶â€‹ážŸáž¶ážšâ€‹â€‹ážŠáž¾áž˜';
$labels['htmltoggle'] = 'អážáŸ’ážáž”áž‘ HTML';
$labels['plaintoggle'] = 'អážáŸ’ážáž”ទធម្មážáž¶';
$labels['savesentmessagein'] = 'រក្សាសំបុážáŸ’រដែលបានផ្ញើក្នុង';
diff --git a/program/localization/km_KH/messages.inc b/program/localization/km_KH/messages.inc
index a2c4bab20..682c733fd 100644
--- a/program/localization/km_KH/messages.inc
+++ b/program/localization/km_KH/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -15,20 +15,25 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
-$messages['loginfailed'] = 'ការពិនិážáŸ’យចូលមិនបានសំរáŸáž…ព្រោះមានបញ្ហាកើážáž¡áž¾áž„';
-$messages['cookiesdisabled'] = 'កម្មវិធីមើលគáŸáž áž‘ំពáŸážšáž“áŸáŸ‡áž˜áž·áž“ទទួលយកCookies';
-$messages['sessionerror'] = 'Session មិនážáŸ’រឹមážáŸ’រូវ ឬហួសកំណážáŸ‹';
-$messages['storageerror'] = 'មិនអាចភ្ជាប់ទៅកាន់ម៉ាស៊ីនIMAP';
-$messages['servererror'] = 'មានបញ្ហានៅម៉ាស៊ីនមáŸ';
+$messages['errortitle'] = 'មាន​បញ្ហា​បាន​កើážâ€‹áž¡áž¾áž„!';
+$messages['loginfailed'] = 'បាន​បរាជáŸáž™â€‹áž€áŸ’នុង​ការ​ចូល។';
+$messages['cookiesdisabled'] = 'កម្មវិធី​អ៊ីនធឺណិážâ€‹ážšáž”ស់​អ្នក​មិន​ទទួល​ážáž¼áž‚ី​ទáŸáŸ”';
+$messages['sessionerror'] = 'សមáŸáž™â€‹ážšáž”ស់​អ្នក​មិន​ážáŸ’រឹម​ážáŸ’រូវ ឬ​ផុážâ€‹áž€áŸ†ážŽážáŸ‹áŸ”';
+$messages['storageerror'] = 'មិន​អាច​ážáž—្ជាប់​ទៅ​ម៉ាស៊ីន​ឃ្លាំង​ផ្ទុក។';
+$messages['servererror'] = 'ម៉ាស៊ីន​មáŸâ€‹áž˜áž¶áž“​បញ្ហា!';
$messages['servererrormsg'] = 'បញ្ហា: $msg';
+$messages['dberror'] = 'កំហុស​មូលដ្ឋាន​ទិន្ននáŸáž™!';
+$messages['requesttimedout'] = 'សំណើ​អស់​ពáŸáž›';
$messages['errorreadonly'] = 'មិនអាចប្រážáž·áž”ážáŸ’ážáž·áž”ានពីព្រោះážážáž“áŸáŸ‡ážáŸ’រូវបានគáŸáž€áŸ†ážŽážáŸ‹ážŸáŸ†ážšáž¶áž”់ážáŸ‚មើល';
$messages['errornoperm'] = 'មិនអាចប្រážáž·áž”ážáŸ’ážáž·áž”ានពីព្រោះមិនមានសិទ្ទគ្រប់គ្រាន់';
$messages['invalidrequest'] = 'មិនអាចរក្សាទុកទិន្ននáŸáž™áž”ានពីព្រោះមានបញ្ហានៅពáŸáž›áž”ញ្ជូនទិន្ននáŸáž™';
+$messages['invalidhost'] = 'ឈ្មោះ​ម៉ាស៊ីន​មáŸâ€‹áž˜áž·áž“​ážáŸ’រឹមážáŸ’រូវ។';
$messages['nomessagesfound'] = 'ពុំមានសំបុážáŸ’រក្នុងប្រអប់សំបុážáŸ’ážšáž“áŸáŸ‡áž‘áŸ';
$messages['loggedout'] = 'អ្នកបានពិនិážáŸ’យចáŸáž‰ážŠáŸ„យជោគជáŸáž™áŸ”';
-$messages['mailboxempty'] = 'ប្រអប់សំបុážáŸ’ážšáž‘áž‘áŸ';
+$messages['refreshing'] = 'កំពុង​ផ្ទុកឡើងវិញ...';
$messages['loading'] = 'កំពុងដំណើរការ...';
$messages['uploading'] = 'កំពុងបញ្ជូនឯកសារ...';
+$messages['uploadingmany'] = 'កំពុង​ផ្ទុកឯកសារ​ឡើង...';
$messages['loadingdata'] = 'កំពុងបើកឯកសារ...';
$messages['checkingmail'] = 'កំពុងស្វែងរកមើលសំបុážáŸ’ážšážáŸ’មីáŸ...';
$messages['sendingmessage'] = 'កំពុងផ្ញើសំបុážáŸ’ážš...';
@@ -38,10 +43,12 @@ $messages['messagesaved'] = 'សំបុážáŸ’ážšážáŸ’រូវបានរក
$messages['successfullysaved'] = 'រក្សាទុកដោយជោគជáŸáž™';
$messages['addedsuccessfully'] = 'អាសយដ្ឋានážáŸ’រូវបានរក្សាទុកដោយជោគជáŸáž™';
$messages['contactexists'] = 'áž–áŸážáŸŒáž˜áž¶áž“ទាក់ទងដែលមានអ៊ីមែលនáŸáŸ‡áž˜áž¶áž“ក្នុងសៀវភៅអាសយដ្ឋានរួចហើយ';
+$messages['contactnameexists'] = 'មាន​ទំនាក់ទំនង​ដែលមាន​ឈ្មោះ​ដូច​គ្នា​នáŸáŸ‡â€‹ážšáž½áž…​ហើយ។';
$messages['blockedimages'] = 'រូបភាពដែលមានក្នុងសំបុážáŸ’ážšáž“áŸáŸ‡ážáŸ’រូវបានបិទដើម្បីរក្សាសុវážáŸ’ážáž—ាព';
$messages['encryptedmessage'] = 'លោកអ្នកមិនអាចមើលសំបុážáŸ’ážšáž“áŸáŸ‡áž”ានទáŸáž–ីព្រោះសំបុážáŸ’ážšáž“áŸáŸ‡áž‡áž¶ážŸáŸ†áž”áž»ážáŸ’រសំងាážáŸ‹';
$messages['nocontactsfound'] = 'ពុំមានអាសយដ្ឋានទាក់ទងទáŸ';
$messages['contactnotfound'] = 'អាសយដ្ឋានទាក់ទងដែលលោកអ្នកចង់រកពុំមានឡើយ';
+$messages['contactsearchonly'] = 'បញ្ចូល​ពាក្យ​ស្វែងរក​មួយ​ចំនួន ដើម្បី​រក​ទំនាក់ទំនង';
$messages['sendingfailed'] = 'មិនអាចផ្ញើសំបុážáŸ’របាន';
$messages['senttooquickly'] = 'សូមរងចាំ $sec វិនាទីមុននឹងផ្ញើសំបុážáŸ’ážšáž“áŸáŸ‡';
$messages['errormoving'] = 'មិនអាចផ្ទáŸážšážŸáŸ†áž”áž»ážáŸ’របាន';
@@ -49,9 +56,12 @@ $messages['errorcopying'] = 'មិនអាចចំលងសំបុážáŸ’ážš
$messages['errordeleting'] = 'មិនអាចលុបសំបុážáŸ’រចោលបាន';
$messages['errormarking'] = 'មិនអាចកំណážáŸ‹áž…ំណាំលើសំបុážáŸ’របាន';
$messages['deletecontactconfirm'] = 'ážáž¾áž›áŸ„កអ្នកពិážáž‡áž¶áž…ង់លុបពáŸážáŸŒáž˜áž¶áž“ទំនាក់ទំនងនáŸáŸ‡áž˜áŸ‚áž“áž‘áŸ?';
+$messages['deletegroupconfirm'] = 'ážáž¾áž¢áŸ’នកពិážâ€‹áž‡áž¶â€‹áž…ង់លុប​ក្រុម​បានជ្រើស?';
$messages['deletemessagesconfirm'] = 'ážáž¾áž›áŸ„កអ្នកពិážáž‡áž¶áž…ង់លុបសំបុážáŸ’ážšáž“áŸáŸ‡áž˜áŸ‚áž“áž‘áŸ?';
$messages['deletefolderconfirm'] = 'ážáž¾áž›áŸ„កអ្នកពិážáž‡áž¶áž…ង់លុបážážáž“áŸáŸ‡áž˜áŸ‚áž“áž‘áŸ?';
$messages['purgefolderconfirm'] = 'ážáž¾áž›áŸ„កអ្នកពិážáž‡áž¶áž…ង់លុបសំបុážáŸ’រទាំងអស់នៅក្នុងážážáž“áŸáŸ‡áž˜áŸ‚áž“áž‘áŸ?';
+$messages['contactdeleting'] = 'កំពុង​លុប​ទំនាក់ទំនង...';
+$messages['groupdeleting'] = 'កំពុង​លុប​ក្រុម...';
$messages['folderdeleting'] = 'កំពុងលុបážážážŸáŸ†ážšáž¶áž”់ទុកឯកសារ...';
$messages['foldermoving'] = 'កំពុងផ្ទáŸážšážážážŸáŸ†ážšáž¶áž”់ទុកឯកសារ...';
$messages['foldersubscribing'] = 'កំពុងកំណážáŸ‹áž”្រើážážážŸáŸ†ážšáž¶áž”់ទុកឯកសារ...';
@@ -67,7 +77,9 @@ $messages['nobodywarning'] = 'ážáž¾áž›áŸ„កអ្នកចង់ផ្ញើáž
$messages['notsentwarning'] = 'សំបុážáŸ’ážšáž“áŸáŸ‡áž˜áž·áž“ទាន់បានផ្ញើទáŸáŸ” ážáž¾áž›áŸ„កអ្នកចង់លុបចោលទáŸ?';
$messages['noldapserver'] = 'សូមកំណážáŸ‹áž˜áŸ‰áž¶ážŸáŸŠáž¸áž“ LDAPដើម្បីស្វែងរក';
$messages['nosearchname'] = 'សូមបំពáŸáž‰ážˆáŸ’មោះទំនាក់ទំនង ឬអាសយដ្ឋានអ៊ីមែល';
+$messages['notuploadedwarning'] = 'ឯកសារ​ភ្ជាប់​ទាំង​អស់​មិន​ážáŸ’រូវ​បាន​ផ្ទុក​ឡើង​នៅឡើយ​ទáŸáŸ” សូម​រង់ចាំ​ ឬ​បោះបង់​ការ​​ផ្ទុក​ឡើង។';
$messages['searchsuccessful'] = 'រកឃើញសំបុážáŸ’រចំនួន $nr';
+$messages['contactsearchsuccessful'] = 'រក​ឃើញ​ទំនាក់ទំនង $nr ។';
$messages['searchnomatch'] = 'រកមិនឃើញអ្វីទាំងអស់';
$messages['searching'] = 'កំពុងស្វែងរក...';
$messages['checking'] = 'កំពុងពិនិážáŸ’យរក...';
@@ -86,16 +98,21 @@ $messages['sourceisreadonly'] = 'លោកអ្នកមានសិទ្ធáž
$messages['errorsavingcontact'] = 'មិនអាចរក្សាអាសយដ្ឋានបានទáŸ';
$messages['movingmessage'] = 'កំពុកផ្ážáŸážšážŸáŸ†áž”áž»ážáŸ’ážš...';
$messages['copyingmessage'] = 'កំពុងចំលងសំបុážáŸ’ážš...';
+$messages['copyingcontact'] = 'កំពុង​ចម្លង​ទំនាក់ទំនង...';
$messages['deletingmessage'] = 'កំពុងលុបសំបុážáŸ’ážš...';
$messages['markingmessage'] = 'កំពុងកំណážáŸ‹ážŸáŸ†áž‚ាល់សំបុážáŸ’ážš...';
+$messages['addingmember'] = 'កំពុង​បន្ážáŸ‚ម​ទំនាក់ទំនង​ទៅ​ក្រុម...';
+$messages['removingmember'] = 'កំពុង​លុបទំនាក់ទំនង​ពី​ក្រុម...';
$messages['receiptsent'] = 'បានបញ្ជូនអážáŸ’ážáž”ទបញ្ជាក់ážáž¶áž”ានអានបានសំរáŸáž…';
$messages['errorsendingreceipt'] = 'មិនអាចបញ្ជូនអážáŸ’ážáž”ទបញ្ជាក់ážáž¶áž”ានអាន áž‘áŸ';
+$messages['deleteidentityconfirm'] = 'ážáž¾áž¢áŸ’នក​ពិážâ€‹áž‡áž¶â€‹áž…ង់​លុប​អážáŸ’ážážŸáž‰áŸ’ញាណ​នáŸáŸ‡?';
$messages['nodeletelastidentity'] = 'លោកអ្នកមិនអាចលុបអážáŸ’ážážŸáž‰áŸ’ញាណនáŸáŸ‡áž‘áŸáž–្រោះវានៅសល់ចុងក្រោយគáŸ';
$messages['forbiddencharacter'] = 'ឈ្មោះážážáž“áŸáŸ‡áž˜áž¶áž“អក្សរដែលážáŸ’រូវហាមឃាážáŸ‹';
$messages['selectimportfile'] = 'សូមជ្រើសរើសឯកសារដើម្បីបញ្ជូនភ្ជាប់';
$messages['addresswriterror'] = 'សៀវភៅអាសយដ្ឋាននោះមិនអាចសរសáŸážšáž…ូលបានទáŸ';
$messages['contactaddedtogroup'] = 'បានដាក់ពážáŸŒáž˜áž¶áž“ទំនាក់ទំនងចូលក្នុងក្រុមនáŸáŸ‡ážŠáŸ„យជោគជáŸáž™';
$messages['contactremovedfromgroup'] = 'បានលុបពážáŸŒáž˜áž¶áž“ទំនាក់ទំនងចáŸáž‰áž–ីក្រុមនáŸáŸ‡ážŠáŸ„យជោគជáŸáž™';
+$messages['nogroupassignmentschanged'] = 'គ្មាន​ការ​ផ្ដល់​ក្រុម​បាន​ប្ដូរ។';
$messages['importwait'] = 'សូមមáŸážáŸ’ážáž¶ážšáž„់ចាំកំពុងទាញទិន្ននáŸáž™áž…ូល ...';
$messages['importconfirm'] = '<b>áž–áŸážáŸŒáž˜áž¶áž“ទំនាក់ទំនង $insertedបានបញ្ចូលដោយជោគជáŸáž™,ហើយបានរំលងចោលពážáŸŒáž˜áž¶áž“ដែលមានស្រាប់$skipped </b>:<p><em>$names</em></p>';
$messages['opnotpermitted'] = 'ប្រážáž·áŸ’ážáž”ážáŸ’ážáž·áž€áž¶ážšážáŸ’រូវបានគáŸáž áž¶áž˜ážƒáž¶ážáŸ‹!';
diff --git a/program/localization/kn_IN/labels.inc b/program/localization/kn_IN/labels.inc
new file mode 100644
index 000000000..bff989285
--- /dev/null
+++ b/program/localization/kn_IN/labels.inc
@@ -0,0 +1,166 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/labels.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
+*/
+$labels['welcome'] = '$product ಗೆ ಸà³à²µà²¾à²—ತ ';
+$labels['password'] = 'ರಹಸà³à²¯ ಪದ';
+$labels['addressbook'] = 'ವಿಳಾಸ ಪà³à²¸à³à²¤à²•';
+$labels['subject'] = 'ವಿಷಯ';
+$labels['from'] = 'ಇಂದ';
+$labels['to'] = 'ಗೆ';
+$labels['date'] = 'ದಿನಾಂಕ ';
+$labels['size'] = 'ಗಾತà³à²°';
+$labels['priority'] = 'ಆದà³à²¯à²¤à³†';
+$labels['organization'] = 'ಸಂಘಟನೆ';
+$labels['showattachment'] = 'ತೋರಿಸà³';
+$labels['filename'] = 'ಫೈಲೠಹೆಸರà³';
+$labels['filesize'] = 'ಫೈಲೠಗಾತà³à²°';
+$labels['addtoaddressbook'] = 'ಪà³à²¸à³à²¤à²• ವಿಳಾಸ ಸೇರಿಸೠ';
+$labels['sun'] = 'ಭಾನೠ';
+$labels['mon'] = 'ಸೋಮ';
+$labels['tue'] = 'ಮಂಗಳ';
+$labels['wed'] = 'ಬà³à²§';
+$labels['thu'] = 'ಗà³à²°à³';
+$labels['fri'] = 'ಶà³à²•à³à²°';
+$labels['sat'] = 'ಶನಿ';
+$labels['sunday'] = 'ಭಾನà³à²µà²¾à²°';
+$labels['monday'] = 'ಸೋಮವಾರ';
+$labels['tuesday'] = 'ಮಂಗಳವಾರ';
+$labels['wednesday'] = 'ಬà³à²§à²µà²¾à²°';
+$labels['thursday'] = 'ಗà³à²°à³à²µà²¾à²°';
+$labels['friday'] = 'ಶà³à²•à³à²°à²µà²¾à²°';
+$labels['saturday'] = 'ಶನಿವಾರ';
+$labels['longjan'] = 'ಜನವರಿ';
+$labels['longfeb'] = 'ಫೆಬà³à²°à³à²µà²°à²¿';
+$labels['longmar'] = 'ಮಾರà³à²šà³';
+$labels['longapr'] = 'à²à²ªà³à²°à²¿à²²à³';
+$labels['longmay'] = 'ಮೇ';
+$labels['longjun'] = 'ಜೂನà³';
+$labels['longjul'] = 'ಜೂಲೈ';
+$labels['longaug'] = 'ಆಗಸà³à²Ÿà³ ';
+$labels['longsep'] = 'ಸೆಪà³à²Ÿà³†à²‚ಬರ';
+$labels['longoct'] = 'ಅಕà³à²Ÿà³‹à²¬à²°';
+$labels['longnov'] = 'ನವೆಂಬರ';
+$labels['longdec'] = 'ಡಿಸೆಂಬರ';
+$labels['today'] = 'ಇಂದà³';
+$labels['checkmail'] = 'ಹೊಸ ಸಂದೇಶಗಳಿಗಾಗಿ ಪರಿಶೀಲಿಸà³';
+$labels['writenewmessage'] = 'ಒಂದೠಹೊಸ ಸಂದೇಶವನà³à²¨à³ ರಚಿಸà³';
+$labels['reply'] = 'ಉತà³à²¤à²°à²•à³†à³‚ಡà³';
+$labels['deletemessage'] = 'ಸಂದೇಶ ಅಳಿಸà³';
+$labels['printmessage'] = 'ಈ ಸಂದೇಶವನà³à²¨à³ ಮà³à²¦à³à²°à²¿à²¸à³';
+$labels['previousmessage'] = 'ಹಿಂದಿನ ಸಂದೇಶವನà³à²¨à³ ತೋರಿಸà³';
+$labels['firstmessage'] = 'ಮೊದಲ ಸಂದೇಶವನà³à²¨à³ ತೋರಿಸà³';
+$labels['nextmessage'] = 'ಮà³à²‚ದಿನ ಸಂದೇಶವನà³à²¨à³ ತೋರಿಸà³';
+$labels['lastmessage'] = 'ಕೊನೆಯ ಸಂದೇಶವನà³à²¨à³ ತೋರಿಸà³';
+$labels['unlimited'] = 'ಅನಿಯಮಿತ';
+$labels['namex'] = 'ಹೆಸರà³';
+$labels['send'] = 'ಕಳà³à²¹à²¿à²¸à³';
+$labels['sendmessage'] = 'ಸಂದೇಶ ಕಳà³à²¹à²¿à²¸à³';
+$labels['savemessage'] = 'ಡà³à²°à²¾à²«à³à²Ÿà³ ಆಗಿ ಉಳಿಸಿ';
+$labels['originalmessage'] = 'ಮೂಲ ಸಂದೇಶ';
+$labels['responsename'] = 'ಹೆಸರà³';
+$labels['close'] = 'ಮà³à²šà³à²šà³';
+$labels['messageoptions'] = 'ಸಂದೇಶ ಆಯà³à²•à³†à²—ಳà³';
+$labels['low'] = 'ಕಡಿಮೆ';
+$labels['lowest'] = 'ಅತಿ ಕಡಿಮೆ';
+$labels['normal'] = 'ಸಾಧಾರಣ';
+$labels['high'] = 'ಜಾಸà³à²¤à²¿';
+$labels['highest'] = 'ಅತಿ ಜಾಸà³à²¤à²¿ ';
+$labels['nosubject'] = '(ವಿಷಯ ಇಲà³à²²)';
+$labels['showimages'] = 'ಚಿತà³à²°à²—ಳನà³à²¨à³ ತೋರಿಸà³';
+$labels['alwaysshow'] = '$sender ಇಂದ ಯಾವಾಗಲೂ ಚಿತà³à²°à²—ಳನà³à²¨à³ ತೋರಿಸà³';
+$labels['htmltoggle'] = 'HTML';
+$labels['dontsave'] = 'ಉಳಿಸಬೇಡ';
+$labels['department'] = 'ವಿಭಾಗ';
+$labels['gender'] = 'ಲಿಂಗ';
+$labels['email'] = 'ಇಮೇಲà³';
+$labels['phone'] = 'ದೂರವಾಣಿ';
+$labels['address'] = 'ವಿಳಾಸ';
+$labels['street'] = 'ರಸà³à²¤à³†';
+$labels['locality'] = 'ನಗರ';
+$labels['country'] = 'ದೇಶ';
+$labels['birthday'] = 'ಜನà³à²®à²¦à²¿à²¨';
+$labels['manager'] = 'ವà³à²¯à²µà²¸à³à²¥à²¾à²ªà²•';
+$labels['assistant'] = 'ಸಹಾಯಕ';
+$labels['search'] = 'ಹà³à²¡à³à²•à³';
+$labels['typehome'] = 'ಮನೆ';
+$labels['typework'] = 'ಕೆಲಸ';
+$labels['typecar'] = 'ಕಾರà³';
+$labels['addcontact'] = 'ಹೊಸ ಸಂಪರà³à²• ಸೇರಿಸಿ';
+$labels['editcontact'] = 'ಸಂಪರà³à²• ತಿದà³à²¦à³';
+$labels['contacts'] = 'ಸಂಪರà³à²•à²—ಳà³';
+$labels['edit'] = 'ತಿದà³à²¦à³';
+$labels['addphoto'] = 'ಸೇರಿಸà³';
+$labels['replacephoto'] = 'ಬದಲಾಯಿಸà³';
+$labels['uploadphoto'] = 'ಫೋಟೋ ಅಪà³à²²à³†à³‚ೕಡೠಮಾಡà³';
+$labels['deletecontact'] = 'ಆಯà³à²•à³†à²®à²¾à²¡à²¿à²¦ ಸಂಪರà³à²•à²—ಳನà³à²¨à³ ಅಳಿಸà³';
+$labels['print'] = 'ಮà³à²¦à³à²°à²¿à²¸à³';
+$labels['previouspage'] = 'ಹಿಂದಿನ ಪà³à²Ÿà²µà²¨à³à²¨à³ ತೋರಿಸà³';
+$labels['firstpage'] = 'ಮೊದಲ ಪà³à²Ÿ ತೋರಿಸà³';
+$labels['nextpage'] = 'ಮà³à²‚ದಿನ ಪà³à²Ÿ ತೋರಿಸà³';
+$labels['lastpage'] = 'ಕೊನೆಯ ಪà³à²Ÿ ತೋರಿಸà³';
+$labels['group'] = 'ಗà³à²‚ಪà³';
+$labels['groups'] = 'ಗà³à²‚ಪà³à²—ಳà³';
+$labels['preferences'] = 'ಆಯà³à²•à³†à²—ಳà³';
+$labels['userpreferences'] = 'ಬಳಕೆದಾರ ಆಯà³à²•à³†à²—ಳà³';
+$labels['editpreferences'] = 'ಬಳಕೆದಾರನ ಆಯà³à²•à³†à²—ಳನನà³à²¨à³ ತಿದà³à²¦à²¿';
+$labels['preferhtml'] = 'HTML ತೋರಿಸà³';
+$labels['htmlmessage'] = 'HTML ಸಂದೇಶ';
+$labels['digitalsig'] = 'ಡಿಜಿಟಲೠಸಹಿ';
+$labels['dateformat'] = 'ದಿನಾಂಕ ಸà³à²µà²°à³‚ಪ';
+$labels['timeformat'] = 'ಸಮಯ ಸà³à²µà²°à³‚ಪ';
+$labels['language'] = 'ಭಾಷೆ';
+$labels['timezone'] = 'ಸಮಯ ವಲಯ';
+$labels['pagesize'] = 'ಪà³à²°à²¤à²¿ ಪà³à²Ÿà²•à³à²•à³† ಸಾಲà³à²—ಳà³';
+$labels['signature'] = 'ಸಹಿ';
+$labels['showinextwin'] = 'ಹೊಸ ವಿಂಡೋದಲà³à²²à²¿ ಸಂದೇಶ ತೆರೆಯಿರಿ';
+$labels['composeextwin'] = 'ಹೊಸ ವಿಂಡೋದಲà³à²²à²¿ ರಚಿಸà³';
+$labels['htmleditor'] = 'HTML ಸಂದೇಶಗಳನà³à²¨à³ ರಚಿಸà³';
+$labels['htmlsignature'] = 'HTML ಸಹಿ';
+$labels['showemail'] = ' ಇಮೇಲೠವಿಳಾಸವನà³à²¨à³ ಹೆಸರಿನೊಂದಿಗೆ ತೋರಿಸà³';
+$labels['askuser'] = 'ನನನà³à²¨à³ ಕೇಳà³';
+$labels['autosend'] = 'ರಸಿಟನà³à²¨à³ ಕಳಿಸà³';
+$labels['ignore'] = 'ನಿರà³à²²à²•à³à²·à²¿à²¸à³';
+$labels['skipdeleted'] = 'ಅಳಿಸಲಾಗಿರà³à²µ ಸಂದೇಶಗಳನà³à²¨à³ ತೋರಿಸಬೇಡ';
+$labels['always'] = 'ಯಾವಾಗಲೂ';
+$labels['everynminutes'] = 'ಪà³à²°à²¤à²¿ $n ನಿಮಿಷ (ಗಳà³)';
+$labels['refreshinterval'] = 'ರಿಫà³à²°à³†à²¶à³ (ಹೊಸ ಸಂದೇಶಗಳನà³à²¨à³, ಇತà³à²¯à²¾à²¦à²¿à²—ಳನà³à²¨à³ ಪರಿಶೀಲಿಸà³)';
+$labels['immediately'] = 'ತತà³à²•à³à²·à²£ ';
+$labels['mainoptions'] = 'ಮà³à²–à³à²¯ ಆಯà³à²•à³†à²—ಳà³';
+$labels['section'] = 'ವಿಭಾಗ';
+$labels['newmessage'] = 'ಹೊಸ ಸಂದೇಶ';
+$labels['signatureoptions'] = 'ಸಹಿ ಆಯà³à²•à³†à²—ಳà³';
+$labels['whenreplying'] = 'ಪà³à²°à²¤à³à²¯à³à²¤à³à²¤à²° ನೀಡà³à²µà²¾à²—';
+$labels['replyempty'] = 'ಮೂಲ ಸಂದೇಶವನà³à²¨à³ ಉಲà³à²²à³†à³•à²–ಿಸಬೇಡ';
+$labels['replyremovesignature'] = ' ಪà³à²°à²¤à³à²¯à³à²¤à³à²¤à²° ನೀಡà³à²µà²¾à²— ಸಂದೇಶದಿಂದ ಮೂಲಸಹಿಯನà³à²¨à³ ತೆಗೆದೠಹಾಕà³';
+$labels['newmessageonly'] = 'ಹೊಸ ಸಂದೇಶ ಮಾತà³à²° ';
+$labels['insertsignature'] = 'ಸಹಿ ಸೇರಿಸà³';
+$labels['afternseconds'] = '$n ಸೆಕೆಂಡà³à²—ಳ ನಂತರ';
+$labels['addtodict'] = 'ನಿಘಂಟಿಗೆ ಸೇರಿಸà³';
+$labels['messagecount'] = 'ಸಂದೇಶಗಳà³';
+$labels['create'] = 'ರಚಿಸà³';
+$labels['properties'] = 'ಗà³à²£à²²à²•à³à²·à²£à²—ಳà³';
+$labels['location'] = 'ಸà³à²¥à²³';
+$labels['info'] = 'ಮಾಹಿತಿ';
+$labels['source'] = 'ಮೂಲ';
+$labels['B'] = 'B';
+$labels['KB'] = 'KB';
+$labels['MB'] = 'MB';
+$labels['GB'] = 'GB';
+$labels['english'] = 'ಇಂಗà³à²²à²¿à³•à²·à³';
+$labels['westerneuropean'] = 'ಪಾಶà³à²šà²¾à²¤à³à²¯ ಯà³à²°à³†à³‚ೕಪಿಯನà³';
+$labels['easterneuropean'] = 'ಪೂರà³à²µ ಯà³à²°à³†à³‚ೕಪಿಯನà³';
+?>
diff --git a/program/localization/kn_IN/messages.inc b/program/localization/kn_IN/messages.inc
new file mode 100644
index 000000000..7f4edf2fa
--- /dev/null
+++ b/program/localization/kn_IN/messages.inc
@@ -0,0 +1,54 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/messages.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
+*/
+$messages['requesttimedout'] = 'ವಿನಂತಿ ಸಮಯ ಮೀರಿತà³';
+$messages['checkingmail'] = 'ಹೊಸ ಸಂದೇಶಗಳನà³à²¨à³ ಪರಿಶೀಲಿಸಲಾಗà³à²¤à³à²¤à²¿à²¦à³†...';
+$messages['sendingmessage'] = 'ಸಂದೇಶ ಕಳà³à²¹à²¿à²¸à²²à²¾à²—à³à²¤à³à²¤à²¿à²¦à³†...';
+$messages['messagesent'] = 'ಸಂದೇಶ ಯಶಸà³à²µà²¿à²¯à²¾à²—ಿ ಕಳà³à²¹à²¿à²¸à²²à²¾à²—ಿದೆ.';
+$messages['savingmessage'] = 'ಸಂದೇಶ ಉಳಿಸಲಾಗà³à²¤à³à²¤à²¿à²¦à³†...';
+$messages['successfullysaved'] = 'ಯಶಸà³à²µà²¿à²¯à²¾à²—ಿ ಉಳಿಸಲಾಗಿದೆ.';
+$messages['contactexists'] = 'ಅದೇ ಇಮೇಲೠವಿಳಾಸದೊಂದಿಗೆ ಸಂಪರà³à²• ಈಗಾಗಲೇ ಅಸà³à²¤à²¿à²¤à³à²µà²¦à²²à³à²²à²¿à²¦à³†.';
+$messages['contactnameexists'] = 'ಅದೇ ಹೆಸರಿನ ಸಂಪರà³à²• ಈಗಾಗಲೇ ಅಸà³à²¤à²¿à²¤à³à²µà²¦à²²à³à²²à²¿à²¦à³†.';
+$messages['nocontactsfound'] = 'ಯಾವà³à²¦à³†à³• ಸಂಪರà³à²•à²—ಳೠಕಂಡà³à²¬à²‚ದಿಲà³à²².';
+$messages['contactnotfound'] = 'ವಿನಂತಿಸಿದ ಸಂಪರà³à²• ಕಂಡà³à²¬à²‚ದಿಲà³à²².';
+$messages['contactsearchonly'] = 'ಸಂಪರà³à²•à²—ಳನà³à²¨à³ ಹà³à²¡à³à²•à²²à³ ಕೆಲವೠಹà³à²¡à³à²•à²¾à²Ÿ ಪದಗಳನà³à²¨à³ ನಮೂದಿಸಿ';
+$messages['sendingfailed'] = 'ಸಂದೇಶವನà³à²¨à³ ಕಳà³à²¹à²¿à²¸à²²à³ ವಿಫಲವಾಗಿದೆ.';
+$messages['senttooquickly'] = 'ಈ ಸಂದೇಶವನà³à²¨à³ ಕಳà³à²¹à²¿à²¸à³à²µ ಮೊದಲà³, $sec ಸೆಕೆಂಡೠ(ಗಳà³) ನಿರೀಕà³à²·à²¿à²¸à²¿';
+$messages['deletecontactconfirm'] = 'ನೀವೠನಿಜವಾಗಿಯೂ ಆಯà³à²•à³† ಸಂಪರà³à²• (ಗಳನà³à²¨à³) ಅಳಿಸಲೠಬಯಸà³à²¤à³à²¤à²¿à³•à²°à²¾?';
+$messages['deletegroupconfirm'] = 'ನೀವೠನಿಜವಾಗಿಯೂ ಆಯà³à²•à³† ಗà³à²‚ಪೠಅಳಿಸಲೠಬಯಸà³à²¤à³à²¤à²¿à³•à²°à²¾?';
+$messages['deletemessagesconfirm'] = 'ನೀವೠನಿಜವಾಗಿಯೂ ಆಯà³à²¦ ಸಂದೇಶ (ಗಳೠ) ಅಳಿಸಲೠಬಯಸà³à²¤à³à²¤à²¿à³•à²°à²¾?';
+$messages['contactdeleting'] = 'ಸಂಪರà³à²•(ಗಳೠ) ಅಳಿಸಲಾಗà³à²¤à³à²¤à²¿à²¦à³† ...';
+$messages['nonamewarning'] = 'ದಯವಿಟà³à²Ÿà³ ಒಂದೠಹೆಸರನà³à²¨à³ ನಮೂದಿಸಿ.';
+$messages['nopagesizewarning'] = 'ದಯವಿಟà³à²Ÿà³ ಒಂದೠಪà³à²Ÿà²¦ ಗಾತà³à²° ನಮೂದಿಸಿ.';
+$messages['norecipientwarning'] = 'ದಯವಿಟà³à²Ÿà³ ಕನಿಷà³à²  ಒಬà³à²¬ ಸà³à²µà²¿à³•à²•à²°à²¿à²¸à³à²µà²µà²°à²¨à³à²¨à³ ನಮೂದಿಸಿ.';
+$messages['nosubjectwarning'] = '"ವಿಷಯ" ಕà³à²·à³†à³•à²¤à³à²° ಖಾಲಿಯಾಗಿದೆ. ನೀವೠಈಗ ಒಂದೠದಾಖಲಿಸಲೠಇಚà³à²›à²¿à²¸à³à²µà²¿à²°?';
+$messages['nosearchname'] = 'ದಯವಿಟà³à²Ÿà³ ಸಂಪರà³à²• ಹೆಸರೠಅಥವಾ ಇಮೇಲೠವಿಳಾಸವನà³à²¨à³ ನಮೂದಿಸಿ.';
+$messages['contactsearchsuccessful'] = '$nr ಸಂಪರà³à²•à²—ಳೠಸಿಕà³à²•à²¿à²µà³†.';
+$messages['searching'] = 'ಹà³à²¡à³à²•à²²à²¾à²—à³à²¤à³à²¤à²¿à²¦à³†...';
+$messages['checking'] = 'ಪರಿಶೀಲಿಸಲಾಗà³à²¤à³à²¤à²¿à²¦à³†...';
+$messages['nospellerrors'] = 'ಕಾಗà³à²£à²¿à²¤ ದೋಷಗಳನà³à²¨à³ ಕಂಡà³à²¬à²‚ದಿಲà³à²².';
+$messages['deletedsuccessfully'] = 'ಯಶಸà³à²µà²¿à²¯à²¾à²—ಿ ಅಳಿಸಲಾಗಿದೆ.';
+$messages['fileuploaderror'] = 'ಫೈಲೠಅಪà³à²²à³†à³‚ೕಡೠವಿಫಲವಾಗಿದೆ.';
+$messages['filesizeerror'] = 'ಅಪà³à²²à³†à³‚ೕಡೠಮಾಡಿದ ಫೈಲೠ$size ಗರಿಷà³à²  ಗಾತà³à²°à²µà²¨à³à²¨à³ ಮೀರಿದೆ';
+$messages['errorsavingcontact'] = 'ಸಂಪರà³à²• ವಿಳಾಸ ಉಳಿಸಲಾಗಲಿಲà³à²².';
+$messages['selectimportfile'] = 'ಅಪà³à²²à³†à³‚ೕಡೠಮಾಡಲೠಫೈಲೠಆಯà³à²•à³† ಮಾಡಿ.';
+$messages['emailformaterror'] = 'ಅಮಾನà³à²¯à²µà²¾à²¦ ಇಮೇಲೠವಿಳಾಸ: $email';
+$messages['autocompletechars'] = 'ಸà³à²µà²¯à²‚ಪೂರà³à²£à²—ೊಳಿಸà³à²µà²¿à²•à³† ಕನಿಷà³à²  $min ಅಕà³à²·à²°à²—ಳನà³à²¨à³ ನಮೂದಿಸಿ.';
+$messages['namecannotbeempty'] = 'ಹೆಸರೠಖಾಲಿ ಇರà³à²µà²‚ತಿಲà³à²².';
+$messages['nametoolong'] = 'ಹೆಸರೠತà³à²‚ಬಾ ಉದà³à²¦à²µà²¾à²—ಿದೆ.';
+$messages['mispellingsfound'] = 'ಸಂದೇಶದಲà³à²²à²¿ ಕಾಗà³à²£à²¿à²¤ ದೋಷಗಳೠಪತà³à²¤à³†à²¯à²¾à²—ಿವೆ.';
+?>
diff --git a/program/localization/lb_LU/labels.inc b/program/localization/lb_LU/labels.inc
index d32a263a1..edfa6e5d1 100644
--- a/program/localization/lb_LU/labels.inc
+++ b/program/localization/lb_LU/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from bis $to vun $count';
$labels['copy'] = 'Kopéieren';
$labels['move'] = 'Réckelen';
$labels['moveto'] = 'Réckelen an...';
+$labels['copyto'] = 'Kopéieren op...';
$labels['download'] = 'Eroflueden';
$labels['open'] = 'Opmaachen';
$labels['showattachment'] = 'Weisen';
@@ -62,10 +63,10 @@ $labels['addtoaddressbook'] = 'An d\'Adressbuch setzen';
$labels['sun'] = 'Son';
$labels['mon'] = 'Méi';
$labels['tue'] = 'Dën';
-$labels['wed'] = 'Don';
-$labels['thu'] = 'Fre';
-$labels['fri'] = 'Sam';
-$labels['sat'] = 'Son';
+$labels['wed'] = 'Mët';
+$labels['thu'] = 'Don';
+$labels['fri'] = 'Fre';
+$labels['sat'] = 'Sam';
$labels['sunday'] = 'Sonndeg';
$labels['monday'] = 'Méindeg';
$labels['tuesday'] = 'Dënschdeg';
@@ -165,7 +166,7 @@ $labels['listorder'] = 'Sortéier-Reiefolleg';
$labels['listmode'] = 'Oplëschtungs-Modus';
$labels['folderactions'] = 'Dossiers-Aktiounen...';
$labels['compact'] = 'Kompaktéieren';
-$labels['empty'] = 'Eidel';
+$labels['empty'] = 'Eidel maachen';
$labels['importmessages'] = 'Messagen importéieren';
$labels['quota'] = 'Plazverbrauch';
$labels['unknown'] = 'onbekannt';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Orthographie';
$labels['checkspelling'] = 'Orthographie kontrolléieren';
$labels['resumeediting'] = 'Weider editéieren';
$labels['revertto'] = 'Zréck bei';
+$labels['restore'] = 'Erëmhirstellen';
+$labels['restoremessage'] = 'Message erëmhirstellen';
+$labels['responses'] = 'Äntwerten';
+$labels['insertresponse'] = 'Äntwert afügen';
+$labels['manageresponses'] = 'Äntwerte geréieren';
+$labels['savenewresponse'] = 'Nei Äntwert späicheren';
+$labels['editresponses'] = 'Äntwerten Editéieren';
+$labels['editresponse'] = 'Äntwert editéieren';
+$labels['responsename'] = 'Numm';
+$labels['responsetext'] = 'Äntwert-Text';
$labels['attach'] = 'Drunhänken';
$labels['attachments'] = 'Unhäng';
$labels['upload'] = 'Eroplueden';
@@ -316,7 +327,11 @@ $labels['searchdelete'] = 'Sich läschen';
$labels['import'] = 'Importéieren';
$labels['importcontacts'] = 'Kontakter importéieren';
$labels['importfromfile'] = 'Aus Fichier importéieren:';
+$labels['importtarget'] = 'Kontakter dobäisetze bei';
$labels['importreplace'] = 'Dat ganzt Adressbuch ersetzen';
+$labels['importgroups'] = 'Gruppen-Zouweisung importéieren';
+$labels['importgroupsall'] = 'All (nei Gruppen uleeën falls néideg)';
+$labels['importgroupsexisting'] = 'Just fir Gruppen déi schon existéieren';
$labels['importdesc'] = 'Du kanns Kontakter aus engem existéierenden Adressbuch eroplueden.<br/>Mir ënnerstëtze momentan en Adress-Import vum <a href="http://en.wikipedia.org/wiki/VCard">vCard</a>- oder CSV (mat Komma getrennt)-Date-Format.';
$labels['done'] = 'Erleedegt';
$labels['settingsfor'] = 'Astellunge fir';
@@ -424,6 +439,9 @@ $labels['standardwindows'] = 'Popup-Fënstere wéi normal Fënstere behandelen';
$labels['forwardmode'] = 'Messagë-Weiderleedung';
$labels['inline'] = 'am Message';
$labels['asattachment'] = 'als Unhank';
+$labels['replyallmode'] = 'Standard-Aktioun vum [U jiddwereen äntweren]-Knäppchen';
+$labels['replyalldefault'] = 'u jiddwereen äntweren';
+$labels['replyalllist'] = 'just der Mailinglëscht äntweren (wann eng fonnt gëtt) ';
$labels['folder'] = 'Dossier';
$labels['folders'] = 'Dossieren';
$labels['foldername'] = 'Dossiersnumm';
diff --git a/program/localization/lb_LU/messages.inc b/program/localization/lb_LU/messages.inc
index 8ef0b2f6c..41dada829 100644
--- a/program/localization/lb_LU/messages.inc
+++ b/program/localization/lb_LU/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Ongëlteg Ufro! Et goufe keng Date gespäichert.'
$messages['invalidhost'] = 'Ongëltege Server-Numm.';
$messages['nomessagesfound'] = 'Keng Messagen an der Mailbox fonnt.';
$messages['loggedout'] = 'Du hues dech erfollegräich ofgemellt. Äddi!';
-$messages['mailboxempty'] = 'D\'Mailbox ass eidel.';
+$messages['mailboxempty'] = 'D\'Mailbox ass eidel';
+$messages['nomessages'] = 'Keng Messagen';
$messages['refreshing'] = 'Lueden nei...';
$messages['loading'] = 'Lueden...';
$messages['uploading'] = 'Fichier gëtt eropgelueden...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Message erfollegräich verschéckt.';
$messages['savingmessage'] = 'Message gëtt gespäichert...';
$messages['messagesaved'] = 'Message als Brouillon gespäichert.';
$messages['successfullysaved'] = 'Erfollegräich gespäichert.';
+$messages['savingresponse'] = 'Äntwert-Text gëtt gespäichert...';
+$messages['deleteresponseconfirm'] = 'Wëlls du dësen Äntwert-Text wierklech läschen?';
$messages['addedsuccessfully'] = 'Kontakt erfollegräich an d\'Adressbuch gesat.';
$messages['contactexists'] = 'Et existéiert schon e Kontakt mat der selweschter E-Mail-Adress.';
$messages['contactnameexists'] = 'Et existéiert schon e Kontakt mam selweschten Numm.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'Den ugefrotene Kontakt gouf net fonnt.';
$messages['contactsearchonly'] = 'Gëff e puer Sichbegrëffer a fir Kontakter ze fannen';
$messages['sendingfailed'] = 'De Message konnt net verschéckt ginn.';
$messages['senttooquickly'] = 'Waart wann ech gelift $sec Sekonn(en) bevir s du de Message verschécks. ';
+$messages['errorsavingsent'] = 'Beim Späichere vum geschéckte Message ass e Feeler opgetruden.';
+$messages['errorsaving'] = 'Beim Späicheren ass e Feeler opgetrueden.';
$messages['errormoving'] = 'D\'Messagë konnten net verréckelt ginn.';
$messages['errorcopying'] = 'D\'Messagë konnten net kopéiert ginn.';
$messages['errordeleting'] = 'D\'Messagë konnten net geläscht ginn.';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Gëff w.e.gl op mannst een Empfänger an.';
$messages['nosubjectwarning'] = 'D\'Feld "Sujet" ass eidel. Wëlls du elo eent uginn?';
$messages['nobodywarning'] = 'Soll dëse Message ouni Text verschéckt ginn?';
$messages['notsentwarning'] = 'De Message gouf net verschéckt. Wëlls du e verwerfen?';
+$messages['restoresavedcomposedata'] = 'Et gouf e Message fonnt dee scho geschriwwen awer nach net verschéckt ginn ass.\n\nSujet: $subject\nGespäichert: $date\n\nSoll de Message recuperéiert ginn?';
$messages['noldapserver'] = 'Wiel w.e.gl en LDAP-Server fir d\'Sich aus.';
$messages['nosearchname'] = 'Gëff w.e.gl en Numm oder eng E-Mail-Adress fir de Kontakt an.';
$messages['notuploadedwarning'] = 'Net all d\'Unhäng goufen eropgelueden. Waart w.e.gl e Moment oder briech den Upload of.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'SMTP-Feeler: $msg';
$messages['emailformaterror'] = 'Ongëlteg E-Mail-Adress: $email';
$messages['toomanyrecipients'] = 'Zevill Empfänger. Reduzéier d\'Zuel vun den Empfänger op $max.';
$messages['maxgroupmembersreached'] = 'D\'Unzuel vu Gruppememberen iwwersteigt de Maximum vun $max.';
+$messages['internalerror'] = 'En interne Feeler ass opgetrueden. Probéier w.e.gl nach eng Kéier.';
$messages['contactdelerror'] = 'Kontakter konnten net geläscht ginn.';
$messages['contactdeleted'] = 'Kontakter erfollegräich geläscht.';
$messages['contactrestoreerror'] = 'Déi geläschte Kontakter konnten net recuperéiert ginn.';
diff --git a/program/localization/lt_LT/labels.inc b/program/localization/lt_LT/labels.inc
index 129b0de47..63194f275 100644
--- a/program/localization/lt_LT/labels.inc
+++ b/program/localization/lt_LT/labels.inc
@@ -197,6 +197,14 @@ $labels['spellcheck'] = 'Tikrinti rašybą';
$labels['checkspelling'] = 'Tikrinti rašybą';
$labels['resumeediting'] = 'Tęsti redagavimą';
$labels['revertto'] = 'Atstatyti į';
+$labels['responses'] = 'Atsakymai';
+$labels['insertresponse'] = 'Įterpti atsakymą';
+$labels['manageresponses'] = 'Tvarkyti atsakymus';
+$labels['savenewresponse'] = 'Įrašyti naują atsakymą';
+$labels['editresponses'] = 'Taisyti atsakymus';
+$labels['editresponse'] = 'Taisyti atsakymÄ…';
+$labels['responsename'] = 'Pavadinimas';
+$labels['responsetext'] = 'Atsakymo tekstas';
$labels['attach'] = 'PridÄ—ti failÄ…';
$labels['attachments'] = 'PridÄ—ti failai';
$labels['upload'] = 'Įkelti';
@@ -316,7 +324,11 @@ $labels['searchdelete'] = 'Pašalinti radinių aplanką';
$labels['import'] = 'Importuoti';
$labels['importcontacts'] = 'Importuoti adresatus';
$labels['importfromfile'] = 'Importuoti iš failo:';
+$labels['importtarget'] = 'Pridėti adresatus į';
$labels['importreplace'] = 'Perrašyti visą adresų knygą';
+$labels['importgroups'] = 'Importuoti priskyrimus grupÄ—ms';
+$labels['importgroupsall'] = 'Visus (sukurti trūkstamas grupes)';
+$labels['importgroupsexisting'] = 'Tik esamoms grupÄ—ms';
$labels['importdesc'] = 'Galite įkelti kontaktus iš jau turimos adresų knygos. <br/>Šiuo metu galima importuoti kontaktus iš <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> arba CSV (comma-separated) duomenų formatų.';
$labels['done'] = 'Baigta';
$labels['settingsfor'] = 'Nuostatos';
@@ -424,6 +436,9 @@ $labels['standardwindows'] = 'IÅ¡kylanÄiuosius langus traktuoti kaip įprastus'
$labels['forwardmode'] = 'Laiškų persiuntimo būdas';
$labels['inline'] = 'kaip citatÄ…';
$labels['asattachment'] = 'kaip priedas';
+$labels['replyallmode'] = 'Numatytasis mygtuko „Atsakyti visiems“ veiksmas';
+$labels['replyalldefault'] = 'atsakyti visiems';
+$labels['replyalllist'] = 'atsakyti el. pašto grupei (jei aptikta)';
$labels['folder'] = 'Aplankas';
$labels['folders'] = 'Aplankai';
$labels['foldername'] = 'Aplanko vardas';
diff --git a/program/localization/lt_LT/messages.inc b/program/localization/lt_LT/messages.inc
index f3feedd47..d9c83f873 100644
--- a/program/localization/lt_LT/messages.inc
+++ b/program/localization/lt_LT/messages.inc
@@ -44,6 +44,8 @@ $messages['messagesent'] = 'Laiškas sėkmingai nusiųstas.';
$messages['savingmessage'] = 'Laiškas įrašomas…';
$messages['messagesaved'] = 'LaiÅ¡kas įraÅ¡ytas į JuodraÅ¡Äių aplankÄ….';
$messages['successfullysaved'] = 'Sėkmingai įrašyta.';
+$messages['savingresponse'] = 'Įrašomas atsakymo tekstas…';
+$messages['deleteresponseconfirm'] = 'Ar tikrai norite pašalinti šį atsakymo tekstą?';
$messages['addedsuccessfully'] = 'Asmuo įtrauktas į adresų knygą.';
$messages['contactexists'] = 'Adresatas, turintis šį el. pašto adresą, jau egzistuoja.';
$messages['contactnameexists'] = 'Adresatas tokiu vardu jau egzistuoja.';
@@ -54,6 +56,8 @@ $messages['contactnotfound'] = 'Ieškotas adresatas nerastas.';
$messages['contactsearchonly'] = 'Įveskite reikšminius žodžius adresatų paieškai';
$messages['sendingfailed'] = 'Laiško išsiųsti nepavyko.';
$messages['senttooquickly'] = 'Turite luktelėti $sec sek., kad galėtumėte išsiųsti laišką.';
+$messages['errorsavingsent'] = 'Įrašant išsiųstą laišką, įvyko klaida.';
+$messages['errorsaving'] = 'Įvyko klaida įrašant.';
$messages['errormoving'] = 'Laiško(-ų) perkelti nepavyko.';
$messages['errorcopying'] = 'Laiško(-ų) nukopijuoti nepavyko.';
$messages['errordeleting'] = 'Laiško(-ų) pašalinti nepavyko.';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'SMTP klaida: $msg';
$messages['emailformaterror'] = 'Netinkamas el. pašto adresas: $email';
$messages['toomanyrecipients'] = 'Per daug gavėjų. Sumažinkite jų bent iki $max.';
$messages['maxgroupmembersreached'] = 'GrupÄ—s narių skaiÄius virÅ¡ijo maksimalų leistinÄ… ($max).';
+$messages['internalerror'] = 'Įvyko klaida. Prašom bandyti iš naujo.';
$messages['contactdelerror'] = 'Nepavyko pašalinti adresato(-ų).';
$messages['contactdeleted'] = 'Adresatas(-ai) sėkmingai pašalintas(-i).';
$messages['contactrestoreerror'] = 'Nepavyko atkurti pašalinto(-ų) adresato(-ų).';
diff --git a/program/localization/lv_LV/labels.inc b/program/localization/lv_LV/labels.inc
index 95afc4c49..185d75180 100644
--- a/program/localization/lv_LV/labels.inc
+++ b/program/localization/lv_LV/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to no $count';
$labels['copy'] = 'Kopēt';
$labels['move'] = 'PÄrvietot';
$labels['moveto'] = 'PÄrvietot uz...';
+$labels['copyto'] = 'Kopēt uz ...';
$labels['download'] = 'lejupielÄdÄ“t';
$labels['open'] = 'Atvērt';
$labels['showattachment'] = 'RÄdÄ«t';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'IzrunÄt';
$labels['checkspelling'] = 'PÄrbaudÄ«t pareizrakstÄ«bu';
$labels['resumeediting'] = 'TurpinÄt rediģēšanu';
$labels['revertto'] = 'Atgriezt uz';
+$labels['restore'] = 'Atjaunot';
+$labels['restoremessage'] = 'Atjaunot vēstuli?';
+$labels['responses'] = 'Atbildes';
+$labels['insertresponse'] = 'Ievietot atbildi';
+$labels['manageresponses'] = 'PÄrvaldÄ«t atbildes';
+$labels['savenewresponse'] = 'SaglabÄt jauno atbildi';
+$labels['editresponses'] = 'Rediģēt atbildes';
+$labels['editresponse'] = 'Rediģēt atbildi';
+$labels['responsename'] = 'VÄrds';
+$labels['responsetext'] = 'Atbildes teksts';
$labels['attach'] = 'Pievienot';
$labels['attachments'] = 'Pielikumi';
$labels['upload'] = 'AugÅ¡upielÄdÄ“t';
@@ -318,6 +329,7 @@ $labels['importcontacts'] = 'Importēt kontaktus';
$labels['importfromfile'] = 'Importēt no faila:';
$labels['importtarget'] = 'Kontaktus pievienot';
$labels['importreplace'] = 'Aizvietot visu adreÅ¡u grÄmatu';
+$labels['importgroups'] = 'Importēt grupu piesaistes';
$labels['importgroupsall'] = 'Visus (ja nepieciešams, izveidojiet grupas)';
$labels['importgroupsexisting'] = 'Tikai esoÅ¡Äm grupÄm';
$labels['importdesc'] = 'JÅ«s varat ieimportÄ“t kontaktus no jau esoÅ¡as adreÅ¡u grÄmatas.<br/>Uz doto brÄ«di tiek atbalstÄ«ti <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> vai CSV (ar komatu atdalÄ«tie) datu formÄti.';
@@ -427,6 +439,9 @@ $labels['standardwindows'] = 'IzlÄ“coÅ¡ie logi kÄ parasti logi';
$labels['forwardmode'] = 'VÄ“stuļu pÄrsÅ«tÄ«Å¡ana';
$labels['inline'] = 'iekļaujot';
$labels['asattachment'] = 'kÄ pielikumu';
+$labels['replyallmode'] = '[AtbildÄ“t visiem] pogas noklusÄ“tÄ darbÄ«ba';
+$labels['replyalldefault'] = 'atbildēt visiem';
+$labels['replyalllist'] = 'atbildÄ“t tikai sarakstei (ja tÄda tiek atrasta)';
$labels['folder'] = 'Mapi';
$labels['folders'] = 'Mapes';
$labels['foldername'] = 'Mapes nosaukums';
diff --git a/program/localization/lv_LV/messages.inc b/program/localization/lv_LV/messages.inc
index f27b01b84..6f1622c16 100644
--- a/program/localization/lv_LV/messages.inc
+++ b/program/localization/lv_LV/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,6 @@ $messages['invalidrequest'] = 'NederÄ«gs pieprasÄ«jums! Dati netika saglabÄti .
$messages['invalidhost'] = 'Nederīgs servera nosaukums';
$messages['nomessagesfound'] = 'Å ajÄ pastkastÄ“ nav vÄ“stuļu';
$messages['loggedout'] = 'Jūs esat veiksmīgi atslēdzies no sistēmas. Uz redzēšanos!';
-$messages['mailboxempty'] = 'Pastkaste ir tukša';
$messages['refreshing'] = 'Atjauno...';
$messages['loading'] = 'Notiek ielÄde...';
$messages['uploading'] = 'AugÅ¡upielÄde failu...';
@@ -44,6 +43,8 @@ $messages['messagesent'] = 'Vēstule nosūtīta veiksmīgi';
$messages['savingmessage'] = 'VÄ“stule tiek saglabÄta ...';
$messages['messagesaved'] = 'VÄ“stule saglabÄta Uzmetumos';
$messages['successfullysaved'] = 'VeiksmÄ«gi saglabÄts.';
+$messages['savingresponse'] = 'Tiek saglabÄts atbildes teksts ...';
+$messages['deleteresponseconfirm'] = 'Vai JÅ«s tieÅ¡Äm gribat dzÄ“st Å¡o atbildes tekstu?';
$messages['addedsuccessfully'] = 'Kontakts veiksmÄ«gi pievienots adreÅ¡u grÄmatai';
$messages['contactexists'] = 'Kontakts ar Å¡Ädu e-pasta adresi jau eksistÄ“';
$messages['contactnameexists'] = 'Kontakts ar Å¡Ädu vÄrdu jau eksistÄ“.';
@@ -54,6 +55,8 @@ $messages['contactnotfound'] = 'Pieprasītais kontakts nav atrasts';
$messages['contactsearchonly'] = 'Lai atrastu kontaktus, ievadiet meklēšanas kritērijus';
$messages['sendingfailed'] = 'Vēstule netika nosūtīta';
$messages['senttooquickly'] = 'Lūdzu uzgaidiet $sec sekundi(-es) pirms sūtiet šo vēstuli';
+$messages['errorsavingsent'] = 'SaglabÄjot nosÅ«tÄ«to vÄ“stuli notika kļūda - vÄ“stule netika saglabÄta';
+$messages['errorsaving'] = 'SaglabÄjot vÄ“stuli notika kļūda - vÄ“stule netika saglabÄta';
$messages['errormoving'] = 'VÄ“stule(s) netika pÄrvietota(s)';
$messages['errorcopying'] = 'VÄ“stules pÄrkopÄ“t neizdevÄs';
$messages['errordeleting'] = 'VÄ“stules izdzÄ“st neizdevÄs';
@@ -78,6 +81,7 @@ $messages['norecipientwarning'] = 'Lūdzu ievadiet vismaz vienu saņēmēju';
$messages['nosubjectwarning'] = 'Lauks "temats" ir tukšs. Vai vēlaties to aizpildīt tagad?';
$messages['nobodywarning'] = 'Sūtīt vēstuli bez teksta?';
$messages['notsentwarning'] = 'VÄ“stule netika nosÅ«tÄ«ta. Vai tieÅ¡Äm vÄ“laties atcelt vÄ“stules rakstÄ«Å¡anu?';
+$messages['restoresavedcomposedata'] = 'Ir atrasta pirms kÄda laika uzrakstÄ«ta, bet nenosÅ«tÄ«ta vÄ“stule.\n\nTÄ“ma: $subject\nSaglabÄta:$date\n\nVai atjaunot Å¡o vÄ“stuli?';
$messages['noldapserver'] = 'Lai meklētu, lūdzu izvēlaties LDAP serveri';
$messages['nosearchname'] = 'LÅ«dzu ievadiet kontaktpersonas vÄrdu vai e-pasta adresi';
$messages['notuploadedwarning'] = 'Visi pielikumi vÄ“l nav augÅ¡upielÄdÄ“ti - lÅ«dzu uzgaidiet vai atceļiet augÅ¡upielÄdi';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'SMTP kļūda: $msg';
$messages['emailformaterror'] = 'Nepareiza e-pasta adrese: $email';
$messages['toomanyrecipients'] = 'PÄrÄk daudz saņēmÄ“ju. Samaziniet skaitu lÄ«dz $max.';
$messages['maxgroupmembersreached'] = 'Grupas dalÄ«bnieku skaits pÄrsniedz limitu $max.';
+$messages['internalerror'] = 'AtgadÄ«jÄs servera iekÅ¡Ä“jÄ kļūda. LÅ«dzu mÄ“Ä£iniet vÄ“lreiz.';
$messages['contactdelerror'] = 'Kontaktus izdzÄ“st neizdevÄs.';
$messages['contactdeleted'] = 'Kontakti izdzēsti veiksmīgi.';
$messages['contactrestoreerror'] = 'IzdzÄ“stos kontaktus atjaunot neizdevÄs.';
diff --git a/program/localization/ml_IN/messages.inc b/program/localization/ml_IN/messages.inc
index 9abaeda99..5d6d9f011 100644
--- a/program/localization/ml_IN/messages.inc
+++ b/program/localization/ml_IN/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
diff --git a/program/localization/nl_NL/labels.inc b/program/localization/nl_NL/labels.inc
index f0e4a74b4..e4f4794b6 100644
--- a/program/localization/nl_NL/labels.inc
+++ b/program/localization/nl_NL/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to van $count';
$labels['copy'] = 'Kopiëren';
$labels['move'] = 'Verplaats';
$labels['moveto'] = 'Verplaats naar...';
+$labels['copyto'] = 'Kopiëren naar...';
$labels['download'] = 'Download';
$labels['open'] = 'Openen';
$labels['showattachment'] = 'Toon';
@@ -105,7 +106,7 @@ $labels['writenewmessage'] = 'Maak een nieuw bericht';
$labels['reply'] = 'Beantwoorden';
$labels['replytomessage'] = 'Beantwoord het bericht';
$labels['replytoallmessage'] = 'Beantwoord lijst of afzender en alle ontvangers';
-$labels['replyall'] = 'Beantwoord alle ontvangers';
+$labels['replyall'] = 'Beantwoord iedereen';
$labels['replylist'] = 'Beantwoord lijst';
$labels['forward'] = 'Doorsturen';
$labels['forwardinline'] = 'Doorsturen in bericht';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Spelling';
$labels['checkspelling'] = 'Controleer spelling';
$labels['resumeediting'] = 'Doorgaan met opstellen';
$labels['revertto'] = 'Terugwijzigen in';
+$labels['restore'] = 'Herstellen';
+$labels['restoremessage'] = 'Bericht herstellen?';
+$labels['responses'] = 'Reacties';
+$labels['insertresponse'] = 'Reactie invoegen';
+$labels['manageresponses'] = 'Reacties beheren';
+$labels['savenewresponse'] = 'Nieuwe reactie opslaan';
+$labels['editresponses'] = 'Bewerk reactie';
+$labels['editresponse'] = 'Bewerk reactie';
+$labels['responsename'] = 'Naam';
+$labels['responsetext'] = 'Reactie';
$labels['attach'] = 'Bijvoegen';
$labels['attachments'] = 'Bijlagen';
$labels['upload'] = 'Toevoegen';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Behandel pop-ups als normale vensters';
$labels['forwardmode'] = 'Berichten doorsturen';
$labels['inline'] = 'invoegen';
$labels['asattachment'] = 'als bijlage';
+$labels['replyallmode'] = 'Standaardactie van [Beantwoord iedereen]-knop';
+$labels['replyalldefault'] = 'iedereen beantwoorden';
+$labels['replyalllist'] = 'alleen maillijst beantwoorden (indien gevonden)';
$labels['folder'] = 'Map';
$labels['folders'] = 'Mappen';
$labels['foldername'] = 'Mapnaam';
diff --git a/program/localization/nl_NL/messages.inc b/program/localization/nl_NL/messages.inc
index 22f9e0f6b..2595c2259 100644
--- a/program/localization/nl_NL/messages.inc
+++ b/program/localization/nl_NL/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Ongeldige aanvraag! Er zijn geen gegevens opgesla
$messages['invalidhost'] = 'Ongeldige servernaam.';
$messages['nomessagesfound'] = 'Geen berichten gevonden in deze mailbox.';
$messages['loggedout'] = 'Succesvol uitgelogd. Tot ziens!';
-$messages['mailboxempty'] = 'Mailbox is leeg.';
+$messages['mailboxempty'] = 'Mailbox is leeg';
+$messages['nomessages'] = 'Geen berichten';
$messages['refreshing'] = 'Vernieuwen...';
$messages['loading'] = 'Laden...';
$messages['uploading'] = 'Bestand wordt geüpload...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Bericht succesvol verstuurd.';
$messages['savingmessage'] = 'Bericht wordt opgeslagen...';
$messages['messagesaved'] = 'Bericht opgeslagen in Concepten.';
$messages['successfullysaved'] = 'Succesvol opgeslagen.';
+$messages['savingresponse'] = 'Reactie wordt opgeslagen...';
+$messages['deleteresponseconfirm'] = 'Weet u zeker dat u deze reactie wilt verwijderen?';
$messages['addedsuccessfully'] = 'Contactpersoon succesvol toegevoegd aan het adresboek.';
$messages['contactexists'] = 'Er bestaat al een contactpersoon met dit e-mailadres.';
$messages['contactnameexists'] = 'Er bestaat al een contactpersoon met deze naam.';
@@ -80,6 +83,7 @@ $messages['norecipientwarning'] = 'Geef tenminste één ontvanger op.';
$messages['nosubjectwarning'] = 'U heeft geen onderwerp ingevoerd. Wilt u nu een onderwerp opgeven?';
$messages['nobodywarning'] = 'Dit bericht zonder inhoud versturen?';
$messages['notsentwarning'] = 'Het bericht is niet verstuurd. Wilt u uw bericht weggooien?';
+$messages['restoresavedcomposedata'] = 'Eerder opgesteld, maar niet-verzonden bericht gevonden.\n\nOnderwerp: $subject\nOpgeslagen: $date\n\nWilt u dit bericht herstellen?';
$messages['noldapserver'] = 'Selecteer een LDAP-server om te zoeken.';
$messages['nosearchname'] = 'Vul de naam of e-mailadres in van een contactpersoon.';
$messages['notuploadedwarning'] = 'Nog niet alle bijlagen zijn geüpload. Wacht even of annuleer de upload.';
diff --git a/program/localization/pl_PL/labels.inc b/program/localization/pl_PL/labels.inc
index 4c13fb7c6..741306b5c 100644
--- a/program/localization/pl_PL/labels.inc
+++ b/program/localization/pl_PL/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to z $count';
$labels['copy'] = 'Kopiuj';
$labels['move'] = 'PrzenieÅ›';
$labels['moveto'] = 'PrzenieÅ› do...';
+$labels['copyto'] = 'Kopiuj do...';
$labels['download'] = 'Pobierz';
$labels['open'] = 'Otwórz';
$labels['showattachment'] = 'Pokaż';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Pisownia';
$labels['checkspelling'] = 'Sprawdź pisownię';
$labels['resumeediting'] = 'Zakończ sprawdzanie pisowni';
$labels['revertto'] = 'Powróć do';
+$labels['restore'] = 'Przywróć';
+$labels['restoremessage'] = 'Przyrócić wiadomość?';
+$labels['responses'] = 'Odpowiedzi';
+$labels['insertresponse'] = 'Wstaw odpowiedź';
+$labels['manageresponses'] = 'ZarzÄ…dzaj odpowiedziami';
+$labels['savenewresponse'] = 'Zapisz nową odpowiedź';
+$labels['editresponses'] = 'Edytuj odpowiedzi';
+$labels['editresponse'] = 'Edytuj odpowiedź';
+$labels['responsename'] = 'Nazwa';
+$labels['responsetext'] = 'Tekst odpowiedzi';
$labels['attach'] = 'Załącz';
$labels['attachments'] = 'Załączniki';
$labels['upload'] = 'Prześlij';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Traktuj okna wyskakujÄ…ce jako standardowe okna';
$labels['forwardmode'] = 'Przekazywanie wiadomości';
$labels['inline'] = 'w treści';
$labels['asattachment'] = 'jako załącznik';
+$labels['replyallmode'] = 'Domyśla akcja przycisku [Odpowiedz wszystkim]';
+$labels['replyalldefault'] = 'odpowiedz wszystkim';
+$labels['replyalllist'] = 'odpowiedz tylko do listy mailingowej (jeśli wykryto)';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Foldery';
$labels['foldername'] = 'Nazwa folderu';
diff --git a/program/localization/pl_PL/messages.inc b/program/localization/pl_PL/messages.inc
index 0ad357b69..fd4583c83 100644
--- a/program/localization/pl_PL/messages.inc
+++ b/program/localization/pl_PL/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Błędne żądanie! Nie zapisano danych.';
$messages['invalidhost'] = 'Błędna nazwa serwera.';
$messages['nomessagesfound'] = 'Brak wiadomości w skrzynce.';
$messages['loggedout'] = 'Użytkownik wylogował się poprawnie.';
-$messages['mailboxempty'] = 'Skrzynka jest pusta!';
+$messages['mailboxempty'] = 'Folder jest pusty';
+$messages['nomessages'] = 'Brak wiadomości';
$messages['refreshing'] = 'Odświeżanie...';
$messages['loading'] = 'Åadowanie...';
$messages['uploading'] = 'Zapisywanie pliku...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Wiadomość została wysłana.';
$messages['savingmessage'] = 'Zapisywanie wiadomości...';
$messages['messagesaved'] = 'Wiadomość została zapisana w folderze Kopie robocze.';
$messages['successfullysaved'] = 'Zapisano pomyślnie.';
+$messages['savingresponse'] = 'Zapisywanie tekstu odpowiedzi...';
+$messages['deleteresponseconfirm'] = 'Czy na pewno chcesz usunąć tą odpowiedź?';
$messages['addedsuccessfully'] = 'Kontakt został dodany.';
$messages['contactexists'] = 'Kontakt o podanym adresie e-mail już istnieje!';
$messages['contactnameexists'] = 'Kontakt z podaną nazwą już istnieje!';
@@ -80,6 +83,7 @@ $messages['norecipientwarning'] = 'Podaj co najmniej jednego odbiorcÄ™!';
$messages['nosubjectwarning'] = 'Nie podano tematu wiadomości. Czy chcesz go teraz uzupełnić?';
$messages['nobodywarning'] = 'Ta wiadomość jest pusta, czy mimo to chcesz ją wysłać?';
$messages['notsentwarning'] = 'Wiadomość nie została wysłana. Czy chcesz usunąć tę wiadomość?';
+$messages['restoresavedcomposedata'] = 'Wykryto poprzednio tworzoną ale nie wysłaną wiadomość.\n\nTemat: $subject\nZapisano: $date\n\nCzy przywrócić tą wiadomość?';
$messages['noldapserver'] = 'Wybierz serwer LDAP!';
$messages['nosearchname'] = 'Podaj nazwÄ™ kontaktu lub jego adres e-mail.';
$messages['notuploadedwarning'] = 'Nie wszystkie załączniki zostały pobrane. Poczekaj lub anuluj pobieranie.';
diff --git a/program/localization/pt_BR/labels.inc b/program/localization/pt_BR/labels.inc
index 13db63e99..e5aececc9 100644
--- a/program/localization/pt_BR/labels.inc
+++ b/program/localization/pt_BR/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to de $count';
$labels['copy'] = 'Copiar';
$labels['move'] = 'Mover';
$labels['moveto'] = 'Mover para...';
+$labels['copyto'] = 'Copiar para...';
$labels['download'] = 'Baixar';
$labels['open'] = 'Abrir';
$labels['showattachment'] = 'Exibir';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Revisar';
$labels['checkspelling'] = 'Verificar ortografia';
$labels['resumeediting'] = 'Continuar a edição';
$labels['revertto'] = 'Reverter para';
+$labels['restore'] = 'Restaurar';
+$labels['restoremessage'] = 'Restaurar mensagem?';
+$labels['responses'] = 'Respostas';
+$labels['insertresponse'] = 'Inserir uma resposta';
+$labels['manageresponses'] = 'Gerenciar respostas';
+$labels['savenewresponse'] = 'Salvar nova resposta';
+$labels['editresponses'] = 'Editar respostas';
+$labels['editresponse'] = 'Editar resposta';
+$labels['responsename'] = 'Nome';
+$labels['responsetext'] = 'Texto da resposta';
$labels['attach'] = 'Anexar';
$labels['attachments'] = 'Anexos';
$labels['upload'] = 'Enviar arquivo';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Usar popups como janelas do navegador';
$labels['forwardmode'] = 'Encaminhamento de mensagens';
$labels['inline'] = 'Em linha (no corpo da mensagem)';
$labels['asattachment'] = 'como anexo';
+$labels['replyallmode'] = 'Ação padrão do botão [Responder a todos]';
+$labels['replyalldefault'] = 'responder a todos';
+$labels['replyalllist'] = 'responder somente à lista de discussão (se identificada)';
$labels['folder'] = 'Pasta';
$labels['folders'] = 'Pastas';
$labels['foldername'] = 'Nome da pasta';
diff --git a/program/localization/pt_BR/messages.inc b/program/localization/pt_BR/messages.inc
index 2f5782373..0fcb27ff7 100644
--- a/program/localization/pt_BR/messages.inc
+++ b/program/localization/pt_BR/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -33,6 +33,7 @@ $messages['invalidhost'] = 'Endereço de servidor inválido.';
$messages['nomessagesfound'] = 'Nenhuma mensagem encontrada nessa caixa de mensagens';
$messages['loggedout'] = 'Sua sessão foi finalizada com sucesso. Até logo!';
$messages['mailboxempty'] = 'A caixa de mensagens está vazia';
+$messages['nomessages'] = 'Sem mensagens';
$messages['refreshing'] = 'Atualizando...';
$messages['loading'] = 'Carregando...';
$messages['uploading'] = 'Enviando arquivo...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Mensagem enviada com sucesso';
$messages['savingmessage'] = 'Salvando Mensagem...';
$messages['messagesaved'] = 'Mensagem salva em Rascunhos';
$messages['successfullysaved'] = 'Salvo com sucesso';
+$messages['savingresponse'] = 'Salvando texto de resposta...';
+$messages['deleteresponseconfirm'] = 'Você realmente deseja apagar este texto de resposta?';
$messages['addedsuccessfully'] = 'Contato incluído com sucesso no catálogo de endereços.';
$messages['contactexists'] = 'Já existe um contato com esse mesmo e-mail.';
$messages['contactnameexists'] = 'Já existe um contato com o mesmo nome.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'O contato solicitado não foi encontrado.';
$messages['contactsearchonly'] = 'Informe os termos de pesquisa para localizar os contatos';
$messages['sendingfailed'] = 'Falha no envio da mensagem.';
$messages['senttooquickly'] = 'Aguarde $sec s para enviar a mensagem.';
+$messages['errorsavingsent'] = 'Ocorreu um erro ao salvar a mensagem enviada.';
+$messages['errorsaving'] = 'Ocorreu um erro ao salvar.';
$messages['errormoving'] = 'Não foi possível mover a(s) mensagem(ns).';
$messages['errorcopying'] = 'Não foi possível copiar a(s) mensagem(ns).';
$messages['errordeleting'] = 'Não foi possível apagar a(s) mensagem(ns).';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Por favor, informe pelo menos um destinatári
$messages['nosubjectwarning'] = 'O campo "Assunto" está vazio. Deseja incluí-lo agora?';
$messages['nobodywarning'] = 'Enviar a mensagem sem texto?';
$messages['notsentwarning'] = 'A mensagem não foi enviada. Deseja descartar sua mensagem?';
+$messages['restoresavedcomposedata'] = 'Uma mensagem criada anteriormente, mas não enviada, foi localizada.\n\nTítulo: $subject\nSalva em: $date\n\nDeseja restaurar esta mensagem?';
$messages['noldapserver'] = 'Por favor, selecione um servidor LDAP para a pesquisa';
$messages['nosearchname'] = 'Por favor, informe o nome do contato ou seu endereço de e-mail.';
$messages['notuploadedwarning'] = 'Há anexos ainda não enviados. Aguarde ou cancele o envio.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'Erro SMTP: $msg';
$messages['emailformaterror'] = 'Endereço de e-mail inválido: $email';
$messages['toomanyrecipients'] = 'Há muitos destinatários. Reduza o número de destinatários para $max.';
$messages['maxgroupmembersreached'] = 'O número de membros do grupo excede o máximo de $max';
+$messages['internalerror'] = 'Ocorreu um erro interno. Por favor tente novamente.';
$messages['contactdelerror'] = 'Não foi possível excluir o(s) contato(s).';
$messages['contactdeleted'] = 'Contato(s) excluído(s) com sucesso.';
$messages['contactrestoreerror'] = 'Não foi possivel recuperar o(s) contato(s) excluído(s).';
diff --git a/program/localization/pt_PT/labels.inc b/program/localization/pt_PT/labels.inc
index b12830031..457a308f2 100644
--- a/program/localization/pt_PT/labels.inc
+++ b/program/localization/pt_PT/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to de $count';
$labels['copy'] = 'Copiar';
$labels['move'] = 'Mover';
$labels['moveto'] = 'mover para...';
+$labels['copyto'] = 'Copiar para...';
$labels['download'] = 'descarregar';
$labels['open'] = 'Abrir';
$labels['showattachment'] = 'Mostrar';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Corrector Ortográfico';
$labels['checkspelling'] = 'Verificar ortografia';
$labels['resumeediting'] = 'Continuar a edição';
$labels['revertto'] = 'Reverter para';
+$labels['restore'] = 'Restaurar';
+$labels['restoremessage'] = 'Restaurar mensagem?';
+$labels['responses'] = 'Respostas';
+$labels['insertresponse'] = 'Insira uma resposta';
+$labels['manageresponses'] = 'Gerir respostas';
+$labels['savenewresponse'] = 'Gravar nova resposta';
+$labels['editresponses'] = 'Editar respostas';
+$labels['editresponse'] = 'Editar resposta';
+$labels['responsename'] = 'Nome';
+$labels['responsetext'] = 'Texto da resposta';
$labels['attach'] = 'Anexar';
$labels['attachments'] = 'Anexos';
$labels['upload'] = 'Carregar';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Lidar com popups como janelas padrão';
$labels['forwardmode'] = 'Reencaminhamento de mensagens';
$labels['inline'] = 'em linha';
$labels['asattachment'] = 'como anexo';
+$labels['replyallmode'] = 'Ação predefinida do botão [Responder a todos]';
+$labels['replyalldefault'] = 'responder a todos';
+$labels['replyalllist'] = 'responder só à lista de discussão (se identificada)';
$labels['folder'] = 'Pasta';
$labels['folders'] = 'Pastas';
$labels['foldername'] = 'Nome da pasta';
diff --git a/program/localization/pt_PT/messages.inc b/program/localization/pt_PT/messages.inc
index 06e78198d..a6618d33e 100644
--- a/program/localization/pt_PT/messages.inc
+++ b/program/localization/pt_PT/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -33,6 +33,7 @@ $messages['invalidhost'] = 'Nome do servidor inválido.';
$messages['nomessagesfound'] = 'Não existem mensagens nesta pasta.';
$messages['loggedout'] = 'A sua sessão foi encerrada com sucesso. Até breve!';
$messages['mailboxempty'] = 'A caixa de entrada está vazia';
+$messages['nomessages'] = 'Não existem mensagens';
$messages['refreshing'] = 'A actualizar...';
$messages['loading'] = 'A carregar...';
$messages['uploading'] = 'A enviar ficheiro...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Mensagem enviada com sucesso';
$messages['savingmessage'] = 'A guardar mensagem...';
$messages['messagesaved'] = 'Mensagem guardada como rascunho';
$messages['successfullysaved'] = 'Guardado com sucesso';
+$messages['savingresponse'] = 'A guardar texto de resposta...';
+$messages['deleteresponseconfirm'] = 'Deseja realmente apagar este texto de resposta?';
$messages['addedsuccessfully'] = 'Contacto adicionado com sucesso';
$messages['contactexists'] = 'Já existe um contacto com este e-mail';
$messages['contactnameexists'] = 'Já existe um contacto com este nome.';
@@ -80,6 +83,7 @@ $messages['norecipientwarning'] = 'Por favor, insira pelo menos um destinatário
$messages['nosubjectwarning'] = 'O campo "Assunto" não foi preenchido. Deseja incluí-lo agora?';
$messages['nobodywarning'] = 'Enviar a mensagem sem texto?';
$messages['notsentwarning'] = 'A mensagem não foi enviada, deseja apagá-la?';
+$messages['restoresavedcomposedata'] = 'Uma mensagem, anteriormente, composta mas não enviada foi encontrado.\n\nAssunto: $subject\nGuardada: $date\n\nDeseja restaurar esta mensagem?';
$messages['noldapserver'] = 'Seleccione um servidor LDAP para efectuar a pesquisa';
$messages['nosearchname'] = 'Por favor, insira o nome do contacto ou endereço de e-mail';
$messages['notuploadedwarning'] = 'Nem todos os anexos foram ainda enviados. Por favor aguarde ou cancele o envio.';
diff --git a/program/localization/ro_RO/messages.inc b/program/localization/ro_RO/messages.inc
index c3e74597f..fb555ad47 100644
--- a/program/localization/ro_RO/messages.inc
+++ b/program/localization/ro_RO/messages.inc
@@ -44,6 +44,8 @@ $messages['messagesent'] = 'Mesajul a fost trimis cu succes!';
$messages['savingmessage'] = 'Salvare mesaj...';
$messages['messagesaved'] = 'Mesajul a fost salvat în Ciorne';
$messages['successfullysaved'] = 'Salvat cu succes.';
+$messages['savingresponse'] = 'Se salvează textul pentru răspuns...';
+$messages['deleteresponseconfirm'] = 'Chiar vrei să ștergi acest text pentru răspuns?';
$messages['addedsuccessfully'] = 'Contactul a fost adăugat cu succes în agendă';
$messages['contactexists'] = 'Un contact cu această adresă de e-mail există deja.';
$messages['contactnameexists'] = 'Există deja un contact cu acelaşi nume.';
@@ -54,6 +56,8 @@ $messages['contactnotfound'] = 'Contactul solicitat nu a fost găsit.';
$messages['contactsearchonly'] = 'Introdu nişte termeni de căutare pentru a găsi contactele';
$messages['sendingfailed'] = 'Nu s-a reuÅŸit trimiterea mesajului';
$messages['senttooquickly'] = 'Vă rugăm aşteptaţi $sec sec. înainte de a trimite acest mesaj';
+$messages['errorsavingsent'] = 'A intervenit o eroare în timp ce se efectua salvarea mesajului trimis.';
+$messages['errorsaving'] = 'A intervenit o eroare în timp ce se efectua salvarea.';
$messages['errormoving'] = 'Nu am putut muta mesajul (mesajele).';
$messages['errorcopying'] = 'Nu am putut copia mesajul (mesajele).';
$messages['errordeleting'] = 'Nu am putut ÅŸterge mesajul (mesajele).';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'Eroare SMTP: $msg';
$messages['emailformaterror'] = 'Adresă de e-mail incorectă: $email';
$messages['toomanyrecipients'] = 'Prea mulţi destinatari. Reduceţi numărul de destinatari la $max.';
$messages['maxgroupmembersreached'] = 'Numărul de membri ai grupului depăşeşte maximul de $max.';
+$messages['internalerror'] = 'A avut loc o eroare internă. Te rog încearcă din nou.';
$messages['contactdelerror'] = 'Nu am putut ÅŸterge contact(ele).';
$messages['contactdeleted'] = 'Contact(ele) au fost ÅŸterse cu succes.';
$messages['contactrestoreerror'] = 'Nu am putut restaura contact(ele) ÅŸterse.';
diff --git a/program/localization/ru_RU/labels.inc b/program/localization/ru_RU/labels.inc
index 109793666..6df06a56b 100644
--- a/program/localization/ru_RU/labels.inc
+++ b/program/localization/ru_RU/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to из $count';
$labels['copy'] = 'Копировать';
$labels['move'] = 'ПеремеÑтить';
$labels['moveto'] = 'ПеремеÑтить в...';
+$labels['copyto'] = 'Копировать в...';
$labels['download'] = 'Загрузить';
$labels['open'] = 'Открыть';
$labels['showattachment'] = 'Показать';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'ОрфографиÑ';
$labels['checkspelling'] = 'Проверить орфографию';
$labels['resumeediting'] = 'Продолжить редактирование';
$labels['revertto'] = 'Отменить правки';
+$labels['restore'] = 'ВоÑÑтановить';
+$labels['restoremessage'] = 'ВоÑÑтановить Ñообщение?';
+$labels['responses'] = 'Ответы';
+$labels['insertresponse'] = 'Ð’Ñтавить ответ';
+$labels['manageresponses'] = 'Управление ответами';
+$labels['savenewresponse'] = 'Сохранить новый ответ';
+$labels['editresponses'] = 'Редактировать ответы';
+$labels['editresponse'] = 'Редактировать ответ';
+$labels['responsename'] = 'Ðазвание';
+$labels['responsetext'] = 'ТекÑта ответа';
$labels['attach'] = 'Вложить';
$labels['attachments'] = 'ВложениÑ';
$labels['upload'] = 'Загрузить';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Обрабатывать вÑплывающие о
$labels['forwardmode'] = 'ПереÑылка Ñообщений';
$labels['inline'] = 'в текÑте';
$labels['asattachment'] = 'как вложение';
+$labels['replyallmode'] = 'ДейÑтвие по умолчанию кнопки [Ответить вÑем]';
+$labels['replyalldefault'] = 'ответить вÑем';
+$labels['replyalllist'] = 'ответить только в ÑпиÑок раÑÑылки (еÑли найден)';
$labels['folder'] = 'Папка';
$labels['folders'] = 'Папки';
$labels['foldername'] = 'Ð˜Ð¼Ñ Ð¿Ð°Ð¿ÐºÐ¸';
diff --git a/program/localization/ru_RU/messages.inc b/program/localization/ru_RU/messages.inc
index d8da5ee5c..8dfbe3df8 100644
--- a/program/localization/ru_RU/messages.inc
+++ b/program/localization/ru_RU/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,8 @@ $messages['invalidrequest'] = 'Ðеверный запроÑ! Информаци
$messages['invalidhost'] = 'Ðеверное Ð¸Ð¼Ñ Ñервера.';
$messages['nomessagesfound'] = 'Сообщений не найдено';
$messages['loggedout'] = 'Ваша ÑеÑÑÐ¸Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð°. Ð’Ñего доброго!';
-$messages['mailboxempty'] = 'Почтовый Ñщик пуÑÑ‚.';
+$messages['mailboxempty'] = 'Почтовый Ñщик пуÑÑ‚';
+$messages['nomessages'] = 'Ð¡Ð¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ñ‚ÑутÑтвуют';
$messages['refreshing'] = 'Обновление...';
$messages['loading'] = 'Загрузка...';
$messages['uploading'] = 'Файл загружаетÑÑ…';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Сообщение отправлено.';
$messages['savingmessage'] = 'Сохранение ÑообщениÑ...';
$messages['messagesaved'] = 'Сохранено в Черновиках.';
$messages['successfullysaved'] = 'Сохранено.';
+$messages['savingresponse'] = 'Сохранение текÑта ответа...';
+$messages['deleteresponseconfirm'] = 'Ð’Ñ‹ дейÑтвительно хотите удалить Ñтот текÑÑ‚ ответа?';
$messages['addedsuccessfully'] = 'Контакт добавлен в адреÑную книгу.';
$messages['contactexists'] = 'Контакт Ñ Ñтим адреÑом e-mail уже ÑущеÑтвует.';
$messages['contactnameexists'] = 'Контакт Ñ Ñ‚Ð°ÐºÐ¸Ð¼ именем уже ÑущеÑтвует.';
@@ -80,6 +83,7 @@ $messages['norecipientwarning'] = 'ПожалуйÑта, введите хотÑ
$messages['nosubjectwarning'] = 'Поле Тема не заполнено. Хотите заполнить его ÑейчаÑ?';
$messages['nobodywarning'] = 'Отправить Ñообщение без текÑта?';
$messages['notsentwarning'] = 'Сообщение не было отправлено. Ð’Ñ‹ хотите отказатьÑÑ Ð¾Ñ‚ отправки?';
+$messages['restoresavedcomposedata'] = 'Ðайдено ранее ÑоÑтавленное, но неотправленное Ñообщение.\n\nТема: $subject\nСохранено: $date\n\nХотите воÑÑтановить Ñто Ñообщение?';
$messages['noldapserver'] = 'ПожалуйÑта, выберите LDAP Ñервер Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка.';
$messages['nosearchname'] = 'ПожалуйÑта, введите Ð¸Ð¼Ñ Ð¸Ð»Ð¸ Ð°Ð´Ñ€ÐµÑ E-Mail';
$messages['notuploadedwarning'] = 'Ð’Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð·Ð°Ð³Ñ€ÑƒÐ¶ÐµÐ½Ñ‹ не полноÑтью. Подождите или отмените загрузку.';
diff --git a/program/localization/sk_SK/csv2vcard.inc b/program/localization/sk_SK/csv2vcard.inc
new file mode 100644
index 000000000..c53273af5
--- /dev/null
+++ b/program/localization/sk_SK/csv2vcard.inc
@@ -0,0 +1,84 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/csv2vcard.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Marek MeÄiar <mmmeciar@gmail.com> |
+ +-----------------------------------------------------------------------+
+*/
+$map = array();
+$map['anniversary'] = "VýroÄie";
+$map['assistants_name'] = "Meno asistenta";
+$map['assistants_phone'] = "Telefón asistenta";
+$map['birthday'] = "Narodeniny";
+$map['business_city'] = "Mesto (práca)";
+$map['business_countryregion'] = "Krajina/oblasť (práca)";
+$map['business_fax'] = "Fax do práce";
+$map['business_phone'] = "Telefón do práce";
+$map['business_phone_2'] = "Telefón do práce 2";
+$map['business_postal_code'] = "PSČ (práca)";
+$map['business_state'] = "Okres (práca)";
+$map['business_street'] = "Ulica (práca)";
+$map['car_phone'] = "Autotelefón";
+$map['categories'] = "Kategórie";
+$map['company'] = "SpoloÄnosÅ¥";
+$map['department'] = "Oddelenie";
+$map['email_address'] = "E-mailová adresa";
+$map['first_name'] = "Krstné meno";
+$map['gender'] = "Pohlavie";
+$map['home_city'] = "Mesto (domov)";
+$map['home_countryregion'] = "Krajina/oblasť (domov)";
+$map['home_fax'] = "Fax domov";
+$map['home_phone'] = "Telefón domov";
+$map['home_phone_2'] = "Telefón domov 2";
+$map['home_postal_code'] = "PSČ (domov)";
+$map['home_state'] = "Okres (domov)";
+$map['home_street'] = "Ulica (domov)";
+$map['job_title'] = "Funkcia";
+$map['last_name'] = "Priezvisko";
+$map['managers_name'] = "Meno manažéra";
+$map['middle_name'] = "Ďalšie meno";
+$map['mobile_phone'] = "Mobilný telefón";
+$map['notes'] = "Poznámky";
+$map['other_city'] = "Iné mesto";
+$map['other_countryregion'] = "Krajina/oblasť (iné)";
+$map['other_fax'] = "Iný fax";
+$map['other_phone'] = "Iný telefón";
+$map['other_postal_code'] = "Iné PSČ";
+$map['other_state'] = "Krajina/oblasť (iné)";
+$map['other_street'] = "Iná ulica";
+$map['pager'] = "Operátor";
+$map['primary_phone'] = "Primárny telefón";
+$map['spouse'] = "Manžel(ka)";
+$map['suffix'] = "Prípona";
+$map['title'] = "Titul";
+$map['web_page'] = "Webová stránka";
+$map['birth_day'] = "Deň narodenia";
+$map['birth_month'] = "Mesiac narodenia";
+$map['birth_year'] = "Rok narodenia";
+$map['display_name'] = "Zobrazované meno";
+$map['fax_number'] = "Fax";
+$map['home_address'] = "Adresa domov";
+$map['home_country'] = "Štát domov";
+$map['home_zipcode'] = "PSČ domov";
+$map['mobile_number'] = "Mobil";
+$map['nickname'] = "Prezývka";
+$map['organization'] = "Organizácia";
+$map['pager_number'] = "Pager";
+$map['primary_email'] = "E-mailová adresa";
+$map['secondary_email'] = "Ďalšia e-mailová adresa";
+$map['web_page_1'] = "Webová stránka 1";
+$map['web_page_2'] = "Webová stránka 2";
+$map['work_phone'] = "Telefón do zamestnania";
+$map['work_address'] = "Pracovná adresa";
+$map['work_country'] = "Štát zamestnania";
+$map['work_zipcode'] = "PSČ zamestnania";
diff --git a/program/localization/sk_SK/labels.inc b/program/localization/sk_SK/labels.inc
index 36d9850a0..630869bea 100644
--- a/program/localization/sk_SK/labels.inc
+++ b/program/localization/sk_SK/labels.inc
@@ -29,34 +29,35 @@ $labels['drafts'] = 'Koncepty';
$labels['sent'] = 'Odoslané';
$labels['trash'] = 'Kôš';
$labels['junk'] = 'Nevyžiadaná pošta';
-$labels['show_real_foldernames'] = 'Pri osobitných prieÄinkoch zobrazovaÅ¥ reálne názvy';
+$labels['show_real_foldernames'] = 'Pri osobitných prieÄinkoch zobrazovaÅ¥ skutoÄné názvy';
$labels['subject'] = 'Predmet';
-$labels['from'] = 'Odosielateľ';
+$labels['from'] = 'Od';
$labels['sender'] = 'Odosielateľ';
-$labels['to'] = 'Adresát';
+$labels['to'] = 'Komu';
$labels['cc'] = 'Kópia';
-$labels['bcc'] = 'Tajná kópia';
+$labels['bcc'] = 'Skrytá kópia';
$labels['replyto'] = 'Odpovedať na';
-$labels['followupto'] = 'PokraÄovaÅ¥ na';
+$labels['followupto'] = 'Preposlať na';
$labels['date'] = 'Dátum';
$labels['size'] = 'Veľkosť';
$labels['priority'] = 'Priorita';
$labels['organization'] = 'Organizácia';
-$labels['readstatus'] = 'Čítať stav';
+$labels['readstatus'] = 'PreÄítaÅ¥ stav';
$labels['listoptions'] = 'Nastavenia zoznamu...';
$labels['mailboxlist'] = 'PrieÄinky';
-$labels['messagesfromto'] = 'Správy od $from do $to z $count';
-$labels['threadsfromto'] = 'Konverzácie od $from do $to z $count';
-$labels['messagenrof'] = 'Správa $nr z $count';
+$labels['messagesfromto'] = 'Správy: $from – $to, z $count';
+$labels['threadsfromto'] = 'Konverzácie: $from – $to, z $count';
+$labels['messagenrof'] = 'Správa Ä. $nr z $count';
$labels['fromtoshort'] = '$from – $to z $count';
$labels['copy'] = 'Kopírovať';
$labels['move'] = 'Presunúť';
-$labels['moveto'] = 'presunúť do...';
-$labels['download'] = 'stiahnuť';
+$labels['moveto'] = 'Presunúť do...';
+$labels['copyto'] = 'Kopírovať do...';
+$labels['download'] = 'Stiahnuť';
$labels['open'] = 'Otvoriť';
$labels['showattachment'] = 'Zobraziť';
$labels['showanyway'] = 'Zobraziť aj napriek tomu';
-$labels['filename'] = 'Meno súboru';
+$labels['filename'] = 'Názov súboru';
$labels['filesize'] = 'Veľkosť súboru';
$labels['addtoaddressbook'] = 'Pridať do adresára';
$labels['sun'] = 'Ne';
@@ -103,100 +104,110 @@ $labels['checkmail'] = 'Skontrolovať nové správy';
$labels['compose'] = 'Vytvoriť správu';
$labels['writenewmessage'] = 'Vytvoriť novú správu';
$labels['reply'] = 'Odpovedať';
-$labels['replytomessage'] = 'Odpovedať';
-$labels['replytoallmessage'] = 'Odpovedať všetkým';
+$labels['replytomessage'] = 'Odpovedať na správu';
+$labels['replytoallmessage'] = 'Odpovedať do zoznamu alebo odosielateľovi a všetkým príjemcom';
$labels['replyall'] = 'Odpovedať všetkým';
-$labels['replylist'] = 'Zoznam odpovedí';
-$labels['forward'] = 'Dopredu';
-$labels['forwardinline'] = 'PoslaÅ¥ Äalej';
+$labels['replylist'] = 'Zoznam pre odpovedanie';
+$labels['forward'] = 'PoslaÅ¥ Äalej';
+$labels['forwardinline'] = 'PoslaÅ¥ Äalej v správe';
$labels['forwardattachment'] = 'PoslaÅ¥ Äalej ako prílohu';
-$labels['forwardmessage'] = 'PoslaÅ¥ Äalej';
-$labels['deletemessage'] = 'Zmazať správu';
+$labels['forwardmessage'] = 'PoslaÅ¥ správu Äalej';
+$labels['deletemessage'] = 'Vymazať správu';
$labels['movemessagetotrash'] = 'Presunúť správu do koša';
-$labels['printmessage'] = 'VytlaÄiÅ¥ správu';
+$labels['printmessage'] = 'VytlaÄiÅ¥ túto správu';
$labels['previousmessage'] = 'Zobraziť predchádzajúcu správu';
$labels['firstmessage'] = 'Zobraziť prvú správu';
$labels['nextmessage'] = 'ZobraziÅ¥ ÄalÅ¡iu správu';
$labels['lastmessage'] = 'Zobraziť poslednú správu';
-$labels['backtolist'] = 'Späť na zoznam správ';
-$labels['viewsource'] = 'Ukázať zdroj správy';
+$labels['backtolist'] = 'Naspäť na zoznam správ';
+$labels['viewsource'] = 'Zobraziť zdrojový text';
$labels['mark'] = 'OznaÄiÅ¥';
$labels['markmessages'] = 'OznaÄiÅ¥ správy';
$labels['markread'] = 'Ako preÄítané';
$labels['markunread'] = 'Ako nepreÄítané';
-$labels['markflagged'] = 'Ako oznaÄené';
-$labels['markunflagged'] = 'Ako neoznaÄené';
-$labels['moreactions'] = 'Ďalšie akcie...';
-$labels['more'] = 'Ďalšie';
+$labels['markflagged'] = 'Ako oznaÄené znaÄkou';
+$labels['markunflagged'] = 'Ako neoznaÄené znaÄkou';
+$labels['moreactions'] = 'Viac akcií...';
+$labels['more'] = 'Viac';
$labels['back'] = 'Dozadu';
$labels['options'] = 'Možnosti';
$labels['select'] = 'Výber';
-$labels['all'] = 'VÅ¡etky';
+$labels['all'] = 'VÅ¡etko';
$labels['none'] = 'NiÄ';
$labels['currpage'] = 'Aktuálna stránka';
$labels['unread'] = 'NepreÄítané';
-$labels['flagged'] = 'OznaÄené';
-$labels['unanswered'] = 'NeoznaÄené';
+$labels['flagged'] = 'OznaÄené znaÄkou';
+$labels['unanswered'] = 'Bez odpovede';
$labels['withattachment'] = 'S prílohou';
-$labels['deleted'] = 'Zmazané';
+$labels['deleted'] = 'Vymazané';
$labels['undeleted'] = 'Nevymazané';
-$labels['invert'] = 'Prevrátiť';
+$labels['invert'] = 'Obrátiť';
$labels['filter'] = 'Filter';
$labels['list'] = 'Zoznam';
$labels['threads'] = 'Konverzácie';
$labels['expand-all'] = 'Rozbaliť všetko';
$labels['expand-unread'] = 'RozbaliÅ¥ nepreÄítané';
$labels['collapse-all'] = 'Zbaliť všetko';
-$labels['threaded'] = 'Spájať do konverzácií';
+$labels['threaded'] = 'Spojené do konverzácií';
$labels['autoexpand_threads'] = 'Rozbaliť konverzácie';
-$labels['do_expand'] = 'všetky konverzácie';
+$labels['do_expand'] = 'všetky';
$labels['expand_only_unread'] = 'len s nepreÄítanými správami';
-$labels['fromto'] = 'Odosielateľ/Príjemca';
-$labels['flag'] = 'Vlajka';
+$labels['fromto'] = 'Od/Komu';
+$labels['flag'] = 'ZnaÄka';
$labels['attachment'] = 'Príloha';
-$labels['nonesort'] = 'NiÄ';
+$labels['nonesort'] = 'Žiadne';
$labels['sentdate'] = 'Dátum odoslania';
$labels['arrival'] = 'Dátum prijatia';
$labels['asc'] = 'vzostupne';
$labels['desc'] = 'zostupne';
-$labels['listcolumns'] = 'Zoznam stĺpcov';
-$labels['listsorting'] = 'Triedenie stĺpcov';
-$labels['listorder'] = 'Usporiadanie';
+$labels['listcolumns'] = 'Stĺpce';
+$labels['listsorting'] = 'ZoraÄovanie';
+$labels['listorder'] = 'Systém zoraÄovania';
$labels['listmode'] = 'Režim zobrazenia zoznamu';
-$labels['folderactions'] = 'Akcie so zložkou...';
-$labels['compact'] = 'ZhustiÅ¥ prieÄinok';
+$labels['folderactions'] = 'Akcie pre prieÄinky...';
+$labels['compact'] = 'Zhustiť';
$labels['empty'] = 'Vyprázdniť';
$labels['importmessages'] = 'Importovať správy';
-$labels['quota'] = 'Zaplnenie schránky';
+$labels['quota'] = 'Úložné miesto';
$labels['unknown'] = 'neznáme';
$labels['unlimited'] = 'neobmedzené';
$labels['quicksearch'] = 'Rýchle vyhľadávanie';
-$labels['resetsearch'] = 'VyÄistiÅ¥ vyhľadávanie';
-$labels['searchmod'] = 'Parametre hľadanie';
+$labels['resetsearch'] = 'Reset vyhľadávania';
+$labels['searchmod'] = 'Zmeniť kritériá vyhľadávania';
$labels['msgtext'] = 'Celá správa';
-$labels['body'] = 'Telo';
+$labels['body'] = 'Telo (obsah)';
$labels['type'] = 'Typ';
$labels['namex'] = 'Meno';
$labels['openinextwin'] = 'Otvoriť v novom okne';
-$labels['emlsave'] = 'Stiahnuť';
+$labels['emlsave'] = 'Stiahnuť (.eml)';
$labels['changeformattext'] = 'ZobraziÅ¥ vo formáte Äistého textu';
$labels['changeformathtml'] = 'Zobraziť vo formáte HTML';
-$labels['editasnew'] = 'Upraviť ako novú';
+$labels['editasnew'] = 'Upraviť ako novú správu';
$labels['send'] = 'Odoslať';
$labels['sendmessage'] = 'Odoslať správu';
-$labels['savemessage'] = 'Uložiť do rozpísaných';
-$labels['addattachment'] = 'Pridať prílohu';
+$labels['savemessage'] = 'Uložiť správu ako koncept';
+$labels['addattachment'] = 'Priložiť súbor';
$labels['charset'] = 'Znaková sada';
$labels['editortype'] = 'Typ editora';
$labels['returnreceipt'] = 'Potvrdenie o doruÄení';
-$labels['dsn'] = 'DoruÄenie oznámenia o stave';
-$labels['mailreplyintro'] = '$date odosielateľ napísal:';
+$labels['dsn'] = 'Oznámenie o stave doruÄenia';
+$labels['mailreplyintro'] = 'Dňa $date $sender napísal(a):';
$labels['originalmessage'] = 'Pôvodná správa';
-$labels['editidents'] = 'Editovať identity';
+$labels['editidents'] = 'Upraviť identitu odosielateľa';
$labels['spellcheck'] = 'Pravopis';
$labels['checkspelling'] = 'Skontrolovať pravopis';
$labels['resumeediting'] = 'PokraÄovaÅ¥ v úpravách';
$labels['revertto'] = 'Vrátiť sa na';
+$labels['restore'] = 'Obnoviť';
+$labels['restoremessage'] = 'Obnoviť správu?';
+$labels['responses'] = 'Odpovede';
+$labels['insertresponse'] = 'VložiÅ¥ odpoveÄ';
+$labels['manageresponses'] = 'Spravovať odpovede';
+$labels['savenewresponse'] = 'UložiÅ¥ novú odpoveÄ';
+$labels['editresponses'] = 'Upraviť odpovede';
+$labels['editresponse'] = 'UpraviÅ¥ odpoveÄ';
+$labels['responsename'] = 'Meno';
+$labels['responsetext'] = 'Text odpovede';
$labels['attach'] = 'Priložiť';
$labels['attachments'] = 'Prílohy';
$labels['upload'] = 'Nahrať';
@@ -209,54 +220,54 @@ $labels['normal'] = 'Normálna';
$labels['high'] = 'Vysoká';
$labels['highest'] = 'Najvyššia';
$labels['nosubject'] = '(bez predmetu)';
-$labels['showimages'] = 'Ukázať obrázky';
-$labels['alwaysshow'] = 'Vždy zobraziť obrázky od $sender';
-$labels['isdraft'] = 'Toto je rozpísaná správa';
-$labels['andnmore'] = '$nr viac...';
-$labels['togglemoreheaders'] = 'Zobraziť viac záhlaví správ';
-$labels['togglefullheaders'] = 'Prepnúť zobrazenie nespracovaných záhlaví správ';
+$labels['showimages'] = 'Zobraziť obrázky';
+$labels['alwaysshow'] = 'Vždy zobraziť obrázky od odosielateľa $sender';
+$labels['isdraft'] = 'Toto je koncept';
+$labels['andnmore'] = 'PoÄet Äalších: $nr...';
+$labels['togglemoreheaders'] = 'ZobraziÅ¥ viac hlaviÄiek správ';
+$labels['togglefullheaders'] = 'Prepnúť zobrazenie úplných hlaviÄiek správ';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Čistý text';
-$labels['savesentmessagein'] = 'Ukladať odoslané správy do';
-$labels['dontsave'] = 'Neukladať';
+$labels['savesentmessagein'] = 'Uložiť odoslanú správu do';
+$labels['dontsave'] = 'neukladať';
$labels['maxuploadsize'] = 'Maximálna povolená veľkosť súboru je $size';
$labels['addcc'] = 'Pridať kópiu';
$labels['addbcc'] = 'Pridať skrytú kopiu';
-$labels['addreplyto'] = 'PridaÅ¥ odpoveÄ';
-$labels['addfollowupto'] = 'PridaÅ¥ pokraÄovaÅ¥ na';
-$labels['mdnrequest'] = 'Odosielateľ tejto správy chce byť upozornený na to, že ste správu obdržali. Chcete potvrdiť prijatie správy?';
-$labels['receiptread'] = 'Potvrdenie o prijatí správy';
-$labels['yourmessage'] = 'Toto je potvrdenie o prijatí Vašej správy';
-$labels['receiptnote'] = 'Poznámka: Toto potvrdenie negarantuje, že správa bola príjemcom preÄítaná a porozumel jej obsahu.';
-$labels['name'] = 'Názov';
+$labels['addreplyto'] = 'Pridať pole Odpovedať na';
+$labels['addfollowupto'] = 'Pridať pole Preposlať na';
+$labels['mdnrequest'] = 'Odosielateľ tejto správy chce byÅ¥ informovaný o tom, že ste túto správu Äítali. Chcete mu potvrdiÅ¥ prijatie správy?';
+$labels['receiptread'] = 'Potvrdenie o doruÄení (a preÄítaní) správy';
+$labels['yourmessage'] = 'Toto je potvrdenie o doruÄení vaÅ¡ej správy';
+$labels['receiptnote'] = 'Poznámka: Toto potvrdenie znamená len to, že správa sa zobrazila na poÄítaÄi príjemcu. Nie je vÅ¡ak zaruÄené, že príjemca správu Äítal a porozumel jej obsahu.';
+$labels['name'] = 'Zobrazované meno';
$labels['firstname'] = 'Meno';
$labels['surname'] = 'Priezvisko';
-$labels['middlename'] = 'Stredné meno';
+$labels['middlename'] = 'Stredná ÄasÅ¥ mena';
$labels['nameprefix'] = 'Titul';
-$labels['namesuffix'] = 'Prípona';
+$labels['namesuffix'] = 'Dodatok za menom';
$labels['nickname'] = 'Prezývka';
-$labels['jobtitle'] = 'Názov práce';
-$labels['department'] = 'Oddelenie';
+$labels['jobtitle'] = 'OznaÄenie povolania';
+$labels['department'] = 'Oddelenie/firma/zastúpenie';
$labels['gender'] = 'Pohlavie';
-$labels['maidenname'] = 'DievÄenské meno';
-$labels['email'] = 'E-Mail';
+$labels['maidenname'] = 'Rodné priezvisko';
+$labels['email'] = 'E-mail';
$labels['phone'] = 'Telefón';
$labels['address'] = 'Adresa';
$labels['street'] = 'Ulica';
$labels['locality'] = 'Mesto';
-$labels['zipcode'] = 'Smerovacie Äéslo';
-$labels['region'] = 'Kraj';
+$labels['zipcode'] = 'PSČ';
+$labels['region'] = 'Región';
$labels['country'] = 'Krajina';
-$labels['birthday'] = 'Dátum narodenia';
+$labels['birthday'] = 'Narodeniny';
$labels['anniversary'] = 'VýroÄie';
-$labels['website'] = 'Web stránka';
+$labels['website'] = 'Internetová stránka';
$labels['instantmessenger'] = 'IM';
$labels['notes'] = 'Poznámky';
$labels['male'] = 'muž';
$labels['female'] = 'žena';
$labels['manager'] = 'Manažér';
$labels['assistant'] = 'Asistent';
-$labels['spouse'] = 'Partner';
+$labels['spouse'] = 'Partner/ka';
$labels['allfields'] = 'VÅ¡etky polia';
$labels['search'] = 'Hľadať';
$labels['advsearch'] = 'Rozšírené vyhľadávanie';
@@ -264,10 +275,10 @@ $labels['advanced'] = 'Rozšírené';
$labels['other'] = 'Ostatné';
$labels['typehome'] = 'Domov';
$labels['typework'] = 'Práca';
-$labels['typeother'] = 'Ostatné';
-$labels['typemobile'] = 'Mobil';
-$labels['typemain'] = 'Hlavný';
-$labels['typehomefax'] = 'Domáci fax';
+$labels['typeother'] = 'Iné';
+$labels['typemobile'] = 'Mobilný telefón';
+$labels['typemain'] = 'Hlavné Äíslo';
+$labels['typehomefax'] = 'Fax - domov';
$labels['typeworkfax'] = 'Fax - práca';
$labels['typecar'] = 'Auto';
$labels['typepager'] = 'Pager';
@@ -276,7 +287,7 @@ $labels['typeassistant'] = 'Asistent';
$labels['typehomepage'] = 'Domovská stránka';
$labels['typeblog'] = 'Blog';
$labels['typeprofile'] = 'Profil';
-$labels['addfield'] = 'Pridať položku...';
+$labels['addfield'] = 'Pridať pole...';
$labels['addcontact'] = 'Pridať nový kontakt';
$labels['editcontact'] = 'Upraviť kontakt';
$labels['contacts'] = 'Kontakty';
@@ -285,199 +296,202 @@ $labels['personalinfo'] = 'Osobné informácie';
$labels['edit'] = 'Upraviť';
$labels['cancel'] = 'Zrušiť';
$labels['save'] = 'Uložiť';
-$labels['delete'] = 'Zmazať';
+$labels['delete'] = 'Vymazať';
$labels['rename'] = 'Premenovať';
-$labels['addphoto'] = 'Pridať';
-$labels['replacephoto'] = 'Nahradiť';
-$labels['uploadphoto'] = 'Nahrať fotku';
+$labels['addphoto'] = 'Pridať fotografiu';
+$labels['replacephoto'] = 'Nahradiť fotografiu';
+$labels['uploadphoto'] = 'Nahrať fotografiu';
$labels['newcontact'] = 'Vytvoriť nový kontakt';
-$labels['deletecontact'] = 'Zmazať zvolené kontakty';
+$labels['deletecontact'] = 'Vymazať vybrané kontakty';
$labels['composeto'] = 'Vytvoriť správu pre';
-$labels['contactsfromto'] = 'Kontakty od $from do $to z $count';
+$labels['contactsfromto'] = 'Kontakty: $from – $to, z $count';
$labels['print'] = 'TlaÄ';
-$labels['export'] = 'Export';
+$labels['export'] = 'Exportovať';
$labels['exportall'] = 'Exportovať všetko';
$labels['exportsel'] = 'Exportovať vybrané';
$labels['exportvcards'] = 'Exportovať kontakty vo formáte vCard';
$labels['newcontactgroup'] = 'Vytvoriť novú skupinu kontaktov';
$labels['grouprename'] = 'Premenovať skupinu';
-$labels['groupdelete'] = 'Zmazať skupinu';
+$labels['groupdelete'] = 'Vymazať skupinu';
$labels['groupremoveselected'] = 'Odstrániť vybrané kontakty zo skupiny';
-$labels['previouspage'] = 'Predchádzajúca stránka';
-$labels['firstpage'] = 'Prvá stránka';
-$labels['nextpage'] = 'Nasledujúca stránka';
-$labels['lastpage'] = 'Posledná stránka';
+$labels['previouspage'] = 'Zobraziť predchádzajúcu stranu';
+$labels['firstpage'] = 'Zobraziť prvú stranu';
+$labels['nextpage'] = 'Zobraziť nasledujúcu stranu';
+$labels['lastpage'] = 'Zobraziť poslednú stranu';
$labels['group'] = 'Skupina';
$labels['groups'] = 'Skupiny';
$labels['listgroup'] = 'Zoznam Älenov skupiny';
$labels['personaladrbook'] = 'Osobné adresy';
-$labels['searchsave'] = 'Uložiť vyhľadávanie';
-$labels['searchdelete'] = 'Zmazať vyhľadávanie';
+$labels['searchsave'] = 'Uložiť výsledky vyhľadávania';
+$labels['searchdelete'] = 'Vymazať výsledky vyhľadávania';
$labels['import'] = 'Import';
$labels['importcontacts'] = 'Importovať kontakty';
$labels['importfromfile'] = 'Importovať zo súboru:';
$labels['importtarget'] = 'Pridať kontakty do';
-$labels['importreplace'] = 'Nahradiť celý zoznam kontaktov';
+$labels['importreplace'] = 'Nahradiť celý adresár kontaktov';
$labels['importgroups'] = 'Importovať priradenia do skupín';
-$labels['importgroupsall'] = 'Všetky (vytvoriť skupiny, ak je to potrebné)';
+$labels['importgroupsall'] = 'Všetky (vytvoriť skupiny ak je to potrebné)';
$labels['importgroupsexisting'] = 'Len pre existujúce skupiny';
$labels['importdesc'] = 'Môžete vložiÅ¥ kontakty zo svojho existujúceho adresára.<br/>Momentálne je možné importovanie adries z formátu <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> alebo CSV (údaje oddeľované Äiarkou).';
$labels['done'] = 'Hotovo';
$labels['settingsfor'] = 'Nastavenia pre';
-$labels['about'] = 'O programe';
-$labels['preferences'] = 'Vlastnosti';
+$labels['about'] = 'O systéme';
+$labels['preferences'] = 'Nastavenia';
$labels['userpreferences'] = 'Používateľské nastavenia';
$labels['editpreferences'] = 'Upraviť používateľské nastavenia';
-$labels['identities'] = 'Profily';
-$labels['manageidentities'] = 'SpravovaÅ¥ profily pre tento úÄet';
-$labels['newidentity'] = 'Nový profil';
+$labels['identities'] = 'Identity';
+$labels['manageidentities'] = 'SpravovaÅ¥ identity pre tento úÄet';
+$labels['newidentity'] = 'Nová identita';
$labels['newitem'] = 'Nová položka';
$labels['edititem'] = 'Upraviť položku';
-$labels['preferhtml'] = 'Uprednostniť HTML zobrazenie';
+$labels['preferhtml'] = 'Zobraziť HTML';
$labels['defaultcharset'] = 'Predvolené kódovanie';
$labels['htmlmessage'] = 'HTML správa';
$labels['messagepart'] = 'Časť';
$labels['digitalsig'] = 'Digitálny podpis';
$labels['dateformat'] = 'Formát dátumu';
$labels['timeformat'] = 'Formát Äasu';
-$labels['prettydate'] = 'Krajší dátum';
-$labels['setdefault'] = 'Obnoviť pôvodné';
+$labels['prettydate'] = 'Krátke formáty dátumov';
+$labels['setdefault'] = 'Nastaviť ako štandardné';
$labels['autodetect'] = 'Automaticky';
$labels['language'] = 'Jazyk';
$labels['timezone'] = 'Časová zóna';
-$labels['pagesize'] = 'Riadky na stránku';
+$labels['pagesize'] = 'PoÄet záznamov na stránku';
$labels['signature'] = 'Podpis';
$labels['dstactive'] = 'Letný Äas';
$labels['showinextwin'] = 'Otvoriť správu v novom okne';
$labels['composeextwin'] = 'Písať v novom okne';
-$labels['htmleditor'] = 'Vytvoriť HTML správu';
-$labels['htmlonreply'] = 'len v odpovedi na HTML správy';
-$labels['htmlonreplyandforward'] = 'pri preposielaní alebo odpovedi na HTML správu';
+$labels['htmleditor'] = 'Vytvárať HTML správy';
+$labels['htmlonreply'] = 'len v odpovedi na HTML správu';
+$labels['htmlonreplyandforward'] = 'pri odosielaní Äalej alebo pri odpovedi na HTML správu';
$labels['htmlsignature'] = 'HTML podpis';
-$labels['showemail'] = 'Zobrazovať e-mailovú adresu so zobrazeným menom';
-$labels['previewpane'] = 'Ukázať náhľad';
-$labels['skin'] = 'Vzhľad';
+$labels['showemail'] = 'Zobrazovať e-mailovú adresu so zobrazovaným menom';
+$labels['previewpane'] = 'Zobraziť panel s náhľadom na správu';
+$labels['skin'] = 'Vzhľad rozhrania';
$labels['logoutclear'] = 'Vyprázdniť kôš pri odhlásení';
$labels['logoutcompact'] = 'ZhustiÅ¥ prieÄinok DoruÄená poÅ¡ta pri odhlásení';
$labels['uisettings'] = 'Používateľské rozhranie';
$labels['serversettings'] = 'Nastavenia servera';
-$labels['mailboxview'] = 'Pohľad na schránku';
-$labels['mdnrequests'] = 'Upozornenia odosielateľovi';
-$labels['askuser'] = 'spýtať sa používateľa';
-$labels['autosend'] = 'poslať potvrdenie automaticky';
-$labels['autosendknown'] = 'poslať potvrdenie iba mojím kontaktom';
-$labels['autosendknownignore'] = 'poslať potvrdenie mojím kontaktom, inak ignorovať';
+$labels['mailboxview'] = 'Zobrazenie schránky';
+$labels['mdnrequests'] = 'Pri žiadosti o potvrdenie o doruÄení';
+$labels['askuser'] = 'opýtať sa používateľa';
+$labels['autosend'] = 'odoslať potvrdenie';
+$labels['autosendknown'] = 'odoslať potvrdenie iba mojim kontaktom';
+$labels['autosendknownignore'] = 'odoslať potvrdenie známym odosielateľom, inak ignorovať';
$labels['ignore'] = 'ignorovať';
-$labels['readwhendeleted'] = 'OznaÄiÅ¥ správu';
-$labels['flagfordeletion'] = 'Pri odstránení správy iba oznaÄiÅ¥ správu ako odstránenú';
-$labels['skipdeleted'] = 'Nezobrazovať zmazané správy';
-$labels['deletealways'] = 'Odstrániť správy, ak zlyhá ich presun do koša';
-$labels['deletejunk'] = 'HneÄ mazaÅ¥ správy v Spame';
-$labels['showremoteimages'] = 'Zobrazovať obrázky uložené mimo mail';
-$labels['fromknownsenders'] = 'od známych užívateľov';
+$labels['readwhendeleted'] = 'OznaÄiÅ¥ správu ako preÄítanú pri jej vymazávaní';
+$labels['flagfordeletion'] = 'Namiesto vymazania správy ju iba oznaÄiÅ¥ ako vymazanú';
+$labels['skipdeleted'] = 'Nezobrazovať vymazané správy';
+$labels['deletealways'] = 'Vymazať správy, ak zlyhá ich presun do koša';
+$labels['deletejunk'] = 'HneÄ vymazávaÅ¥ správy v prieÄinku Nevyžiadaná poÅ¡ta (spam)';
+$labels['showremoteimages'] = 'Zobrazovať obrázky uložené mimo správy';
+$labels['fromknownsenders'] = 'pri známych odosielateľoch';
$labels['always'] = 'vždy';
-$labels['showinlineimages'] = 'Zobraziť pripojené obrázky pod správou';
+$labels['showinlineimages'] = 'Zobrazovať priložené obrázky pod správou';
$labels['autosavedraft'] = 'Automaticky uložiť koncept';
$labels['everynminutes'] = 'každých $n minút';
-$labels['refreshinterval'] = 'Obnoviť (skontrolovať nové správy a podobne)';
+$labels['refreshinterval'] = 'ObnoviÅ¥ (skontrolovaÅ¥ nové správy atÄ.)';
$labels['never'] = 'nikdy';
$labels['immediately'] = 'ihneÄ';
$labels['messagesdisplaying'] = 'Zobrazovanie správ';
$labels['messagescomposition'] = 'Vytváranie správ';
$labels['mimeparamfolding'] = 'Názvy príloh';
-$labels['2231folding'] = 'Full RFC 2231 (Thunderbird)';
+$labels['2231folding'] = 'Úplné RFC 2231 (Thunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
-$labels['2047folding'] = 'Full RFC 2047 (other)';
+$labels['2047folding'] = 'Úplné RFC 2047 (iné)';
$labels['force7bit'] = 'Použiť kódovanie MIME pre 8-bitové znaky';
$labels['advancedoptions'] = 'Rozšírené nastavenia';
-$labels['focusonnewmessage'] = 'AktivovaÅ¥ okno prehliadaÄa pri príchozí správe';
-$labels['checkallfolders'] = 'Kontrolovať nové správy vo všetkých zložkách';
-$labels['displaynext'] = 'ZobraziÅ¥ ÄalÅ¡iu správu po zmazanie / prenosu správy';
-$labels['defaultfont'] = 'Prednastavený font HTML správ';
+$labels['focusonnewmessage'] = 'AktivovaÅ¥ okno prehliadaÄa pri novej správe';
+$labels['checkallfolders'] = 'KontrolovaÅ¥ nové správy vo vÅ¡etkých prieÄinkoch';
+$labels['displaynext'] = 'ZobraziÅ¥ ÄalÅ¡iu správu po vymazaní/presunutí správy';
+$labels['defaultfont'] = 'Predvolené písmo pre HTML správu';
$labels['mainoptions'] = 'Hlavné nastavenia';
$labels['browseroptions'] = 'Nastavenia prehliadania';
$labels['section'] = 'Sekcia';
$labels['maintenance'] = 'Údržba';
$labels['newmessage'] = 'Nová správa';
$labels['signatureoptions'] = 'Nastavenia podpísania';
-$labels['whenreplying'] = 'Pri odpovedaní';
+$labels['whenreplying'] = 'Pri odpovedi';
$labels['replyempty'] = 'necitovať pôvodnú správu';
-$labels['replytopposting'] = 'zaÄaÅ¥ novú správu nad pôvodňou';
-$labels['replybottomposting'] = 'zaÄaÅ¥ novú správu pod pôvodňou';
+$labels['replytopposting'] = 'zaÄaÅ¥ odpoveÄ nad citovanou správou';
+$labels['replybottomposting'] = 'zaÄaÅ¥ odpoveÄ pod citovanou správou';
$labels['replyremovesignature'] = 'Pri odpovedaní odstrániť zo správy pôvodný podpis';
$labels['autoaddsignature'] = 'Automaticky pridať podpis';
$labels['newmessageonly'] = 'iba k novým správam';
-$labels['replyandforwardonly'] = 'len k odpovede a preposílanej správe';
-$labels['insertsignature'] = 'Vložit podpis';
-$labels['previewpanemarkread'] = 'OznaÄiÅ¥ zobrazenej správy ako preÄítané';
+$labels['replyandforwardonly'] = 'iba k odpovediam a preposielaným správam';
+$labels['insertsignature'] = 'Vložiť podpis';
+$labels['previewpanemarkread'] = 'OznaÄiÅ¥ správu v náhľade ako preÄítanú';
$labels['afternseconds'] = 'po $n sekundách';
-$labels['reqmdn'] = 'Vždy požadovaÅ¥ doruÄenku';
-$labels['reqdsn'] = 'Vždy vyžadovaÅ¥ potvrdenie o doruÄení správy';
-$labels['replysamefolder'] = 'UmietniÅ¥ odpoveÄ do adresára, kde je umiestnená správa, na ktorú sa odpovedalo';
-$labels['defaultabook'] = 'Predvolený adresár';
-$labels['autocompletesingle'] = 'Vynechať alternatívnu emailovú adresu pri automatickom dopĺňaní';
-$labels['listnamedisplay'] = 'Zobraziť kontakt ako';
+$labels['reqmdn'] = 'Vždy vyžadovaÅ¥ potvrdenie o doruÄení';
+$labels['reqdsn'] = 'Vždy vyžadovaÅ¥ oznámenie o stave doruÄenia';
+$labels['replysamefolder'] = 'UmiestňovaÅ¥ odpovede do rovnakého prieÄinka ako pôvodnú správu';
+$labels['defaultabook'] = 'Predvolený adresár kontaktov';
+$labels['autocompletesingle'] = 'Vynechať alternatívne e-mailové adresy pri automatickom dopĺňaní';
+$labels['listnamedisplay'] = 'Zobraziť kontakty ako';
$labels['spellcheckbeforesend'] = 'Skontrolovať pravopis pred odoslaním správy';
-$labels['spellcheckoptions'] = 'Voľby kontroly pravopisu';
+$labels['spellcheckoptions'] = 'Nastavenia kontroly pravopisu';
$labels['spellcheckignoresyms'] = 'Ignorovať slová so symbolmi';
$labels['spellcheckignorenums'] = 'IgnorovaÅ¥ slová s Äíslami';
-$labels['spellcheckignorecaps'] = 'Ignorovať slová písané veľkými písmenami';
+$labels['spellcheckignorecaps'] = 'Ignorovať slová písané iba veľkými písmenami';
$labels['addtodict'] = 'Pridať do slovníka';
-$labels['mailtoprotohandler'] = 'Zaregistrovať handler pre odkazy „mailto:“';
+$labels['mailtoprotohandler'] = 'Zaregistrovať priradenie pre odkazy typu „mailto:“';
$labels['standardwindows'] = 'S vyskakovacími oknami pracovať ako so štandardnými oknami';
-$labels['forwardmode'] = 'Preposielanie správ';
-$labels['inline'] = 'v tele spávy';
+$labels['forwardmode'] = 'Odosielanie správ Äalej';
+$labels['inline'] = 'vo vnútri správy';
$labels['asattachment'] = 'ako príloha';
+$labels['replyallmode'] = 'Predvolená akcia pre tlaÄidlo [OdpovedaÅ¥ vÅ¡etkým]';
+$labels['replyalldefault'] = 'odpovedať všetkým';
+$labels['replyalllist'] = 'odpovedať len do mailing-listu (ak bol nájdený)';
$labels['folder'] = 'PrieÄinok';
$labels['folders'] = 'PrieÄinky';
-$labels['foldername'] = 'Názov prieÄinku';
-$labels['subscribed'] = 'Prihlásený k odberu';
-$labels['messagecount'] = 'PoÄet správ';
+$labels['foldername'] = 'Názov prieÄinka';
+$labels['subscribed'] = 'Odber aktívny';
+$labels['messagecount'] = 'Správy';
$labels['create'] = 'Vytvoriť';
-$labels['createfolder'] = 'Vytvor nový prieÄinok';
+$labels['createfolder'] = 'VytvoriÅ¥ nový prieÄinok';
$labels['managefolders'] = 'SpravovaÅ¥ prieÄinky';
$labels['specialfolders'] = 'Å peciálne prieÄinky';
$labels['properties'] = 'Vlastnosti';
-$labels['folderproperties'] = 'Vlastnosti adresára';
-$labels['parentfolder'] = 'RodiÄovský adresár';
+$labels['folderproperties'] = 'Vlastnosti prieÄinka';
+$labels['parentfolder'] = 'RodiÄovský prieÄinok';
$labels['location'] = 'Umiestnenie';
$labels['info'] = 'Informácia';
-$labels['getfoldersize'] = 'Kliknúť pre získanie leľkosti adresára';
-$labels['changesubscription'] = 'Kliknúť pre zmenu prihlásenia odberu';
+$labels['getfoldersize'] = 'Na zistenie veľkosti prieÄinka kliknite sem';
+$labels['changesubscription'] = 'Na zmenu odberu kliknite sem';
$labels['foldertype'] = 'Typ prieÄinka';
$labels['personalfolder'] = 'Súkromný prieÄinok';
-$labels['otherfolder'] = 'Iné užívateľove adresáre';
-$labels['sharedfolder'] = 'Verejný adresár';
-$labels['sortby'] = 'Triediť podľa';
-$labels['sortasc'] = 'Triediť vzostupne';
-$labels['sortdesc'] = 'Triediť zostupne';
-$labels['undo'] = 'Vrátiť';
-$labels['installedplugins'] = 'Nainštalované zásuvné moduly';
+$labels['otherfolder'] = 'Iné prieÄinky používateľa';
+$labels['sharedfolder'] = 'Verejný prieÄinok';
+$labels['sortby'] = 'Zoradiť podľa';
+$labels['sortasc'] = 'Zoradiť vzostupne';
+$labels['sortdesc'] = 'Zoradiť zostupne';
+$labels['undo'] = 'Späť';
+$labels['installedplugins'] = 'Nainštalované prídavné moduly';
$labels['plugin'] = 'Zásuvný modul';
$labels['version'] = 'Verzia';
-$labels['source'] = 'Zdroj';
+$labels['source'] = 'Zdrojový kód';
$labels['license'] = 'Licencia';
-$labels['support'] = 'Získať podporu';
+$labels['support'] = 'Podpora';
$labels['B'] = 'B';
$labels['KB'] = 'KB';
$labels['MB'] = 'MB';
$labels['GB'] = 'GB';
$labels['unicode'] = 'Unicode';
$labels['english'] = 'AngliÄtina';
-$labels['westerneuropean'] = 'Západná Európa';
-$labels['easterneuropean'] = 'Východná Európa';
+$labels['westerneuropean'] = 'Západoeurópske';
+$labels['easterneuropean'] = 'Východoeurópske';
$labels['southeasterneuropean'] = 'Juho-východná Európa';
$labels['baltic'] = 'Baltština';
-$labels['cyrillic'] = 'Cyriliky';
-$labels['arabic'] = 'ArabÄina';
-$labels['greek'] = 'GréÄtina';
-$labels['hebrew'] = 'HebrejÄina';
-$labels['turkish'] = 'Nordština';
-$labels['nordic'] = 'TureÄtina';
-$labels['thai'] = 'Tajština';
+$labels['cyrillic'] = 'Cyrilika';
+$labels['arabic'] = 'Arabsky';
+$labels['greek'] = 'Grécky';
+$labels['hebrew'] = 'Hebrejsky';
+$labels['turkish'] = 'Turecky';
+$labels['nordic'] = 'Nórsky';
+$labels['thai'] = 'Thajsky';
$labels['celtic'] = 'Keltština';
$labels['vietnamese'] = 'VietnamÄina';
-$labels['japanese'] = 'JaponÄina';
-$labels['korean'] = 'KorejÄina';
-$labels['chinese'] = 'Čínština';
+$labels['japanese'] = 'Japonsky';
+$labels['korean'] = 'Kórejsky';
+$labels['chinese'] = 'Čínsky';
?>
diff --git a/program/localization/sk_SK/messages.inc b/program/localization/sk_SK/messages.inc
index db830c2a7..d5cf323db 100644
--- a/program/localization/sk_SK/messages.inc
+++ b/program/localization/sk_SK/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -16,154 +16,161 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
$messages['errortitle'] = 'Vyskytla sa chyba!';
-$messages['loginfailed'] = 'Chybné prihlásenie';
-$messages['cookiesdisabled'] = 'Váš internetový prehliadaÄ nepodporuje cookies, ktoré sú potrebné pre prihlásenie';
-$messages['sessionerror'] = 'Vaše prihlásenie je neplatné alebo vypršala jeho platnosť';
-$messages['storageerror'] = 'Nepodarilo sa spojiť s IMAP serverom';
+$messages['loginfailed'] = 'Prihlasovanie bolo neúspešné.';
+$messages['cookiesdisabled'] = 'Váš internetový prehliadaÄ nepodporuje cookies, ktoré sú potrebné na prihlásenie.';
+$messages['sessionerror'] = 'Vaša relácia nie je platná alebo vypršala jej platnosť.';
+$messages['storageerror'] = 'Nepodarilo sa spojiť s úložným serverom.';
$messages['servererror'] = 'Chyba servera!';
$messages['servererrormsg'] = 'Chyba servera: $msg';
-$messages['dberror'] = 'Databázová chyba!';
-$messages['requesttimedout'] = 'Čas požiadavky vypršal';
-$messages['errorreadonly'] = 'Nemožno vykonaÅ¥ operáciu. Adresár je len na Äítanie';
-$messages['errornoperm'] = 'Nemožno vykonať operáciu. Prístup odmietnutý';
-$messages['erroroverquota'] = 'Nemožno vykonať operáciu. Na disku nie je dostatok voľného miesta.';
-$messages['erroroverquotadelete'] = 'Na disku nie je dostatok voľného miesta. Vymažte nejakú správu pomocou klávesov SHIFT+DEL.';
-$messages['invalidrequest'] = 'Chybný požiadavek. Žiadne údaje neboli uložené.';
-$messages['invalidhost'] = 'Neplatný názov servera';
-$messages['nomessagesfound'] = 'Vo Vašej schránke nie je žiadna správa';
+$messages['dberror'] = 'Chyba databázy!';
+$messages['requesttimedout'] = 'Čas na vykonanie požiadavky uplynul';
+$messages['errorreadonly'] = 'Akciu nemožno vykonaÅ¥. PrieÄinok je urÄený len na Äítanie.';
+$messages['errornoperm'] = 'Akciu nemožno vykonať. Prístup bol odmietnutý.';
+$messages['erroroverquota'] = 'Akciu nemožno vykonať. Nie je dostatok voľného miesta.';
+$messages['erroroverquotadelete'] = 'Nie je dostatok voľného miesta. Vymažte nejakú správu pomocou klávesov SHIFT+DEL.';
+$messages['invalidrequest'] = 'Neplatná požiadavka! Neuložili sa žiadne údaje.';
+$messages['invalidhost'] = 'Neplatný názov servera.';
+$messages['nomessagesfound'] = 'V tomto prieÄinku nie je žiadna správa.';
$messages['loggedout'] = 'Odhlásenie prebehlo úspešne. Dovidenia.';
$messages['mailboxempty'] = 'Schránka je prázdna';
+$messages['nomessages'] = 'Žiadne správy';
$messages['refreshing'] = 'Obnovuje sa...';
$messages['loading'] = 'NaÄítava sa...';
-$messages['uploading'] = 'Nahrávám súbor...';
-$messages['uploadingmany'] = 'Nahrávam súbory...';
+$messages['uploading'] = 'Nahráva sa súbor...';
+$messages['uploadingmany'] = 'Nahrávajú sa súbory...';
$messages['loadingdata'] = 'NaÄítavajú sa údaje...';
$messages['checkingmail'] = 'Kontrolujú sa nové správy...';
$messages['sendingmessage'] = 'Správa sa odosiela...';
-$messages['messagesent'] = 'Správa bola úspešne odoslaná';
+$messages['messagesent'] = 'Správa bola úspešne odoslaná.';
$messages['savingmessage'] = 'Správa sa ukladá...';
-$messages['messagesaved'] = 'Správa bola uložená medzi Rozpísané správy';
-$messages['successfullysaved'] = 'Úspešne uložená';
-$messages['addedsuccessfully'] = 'Kontakt bol pridaný do adresára';
-$messages['contactexists'] = 'Kontakt s touto e-mailovou adresou už existuje';
-$messages['contactnameexists'] = 'Kontakt s rovnakým menom už existuje.';
-$messages['blockedimages'] = 'Z bezpeÄnostných dôvodov sú v správe zablokované obrázky.';
-$messages['encryptedmessage'] = 'Táto správa je zašifrovaná, a nie je možné ju zobraziť!';
-$messages['nocontactsfound'] = 'Nemáte žiadne kontakty';
-$messages['contactnotfound'] = 'Požadovaný kontakt nebol nájdený';
-$messages['contactsearchonly'] = 'Zadaj nejaký vyhľadávací výraz pre hľadanie kontaktov.';
-$messages['sendingfailed'] = 'Odosielanie správy zlyhalo';
-$messages['senttooquickly'] = 'PoÄkajte $sec sekúnd pred odoslaním tejto správy';
-$messages['errormoving'] = 'Správa sa nedá presunúť';
-$messages['errorcopying'] = 'Správa sa nedá skopírovať';
-$messages['errordeleting'] = 'Správa sa nedá zmazať';
-$messages['errormarking'] = 'Správa sa nedá oznaÄiÅ¥';
-$messages['deletecontactconfirm'] = 'Ste si istý, že chcete zmazať zvolený(é) kontakt(y)?';
-$messages['deletegroupconfirm'] = 'SkutoÄne chceÅ¡ zmazaÅ¥ vybranú skupinu?';
-$messages['deletemessagesconfirm'] = 'Ste si istý, že chcete zmazať zvolenú(é) správu(y)?';
-$messages['deletefolderconfirm'] = 'Ste si istý, že chcete zmazaÅ¥ tento prieÄinok?';
-$messages['purgefolderconfirm'] = 'Ste si istý, že chcete zmazaÅ¥ vÅ¡etky správy v tomto prieÄinku?';
-$messages['contactdeleting'] = 'Mažem kontakt(y)...';
-$messages['groupdeleting'] = 'Mažem skupinu...';
-$messages['folderdeleting'] = 'Odstraňuje sa prieÄinok ...';
-$messages['foldermoving'] = 'PreÄinok sa presúva ...';
-$messages['foldersubscribing'] = 'Prihlasujem sa k adresáru...';
-$messages['folderunsubscribing'] = 'Odhlasujem sa z adresára...';
-$messages['formincomplete'] = 'Formulár nie je kompletne vyplnený';
-$messages['noemailwarning'] = 'Prosím, vložte platnú emailovú adresu';
-$messages['nonamewarning'] = 'Prosím, zadajte meno';
-$messages['nopagesizewarning'] = 'Prosím, zadajte veľkosť strany';
-$messages['nosenderwarning'] = 'Prosím, zadajte adresu odosielateľa';
-$messages['norecipientwarning'] = 'Prosím, vložte aspoň jedného príjemcu';
-$messages['nosubjectwarning'] = 'Predmet správy je prázdny. Chcete ho teraz zadať?';
+$messages['messagesaved'] = 'Správa bola uložená ako koncept.';
+$messages['successfullysaved'] = 'Ukladanie bolo úspeÅ¡ne dokonÄené.';
+$messages['savingresponse'] = 'Ukladanie textu odpovede...';
+$messages['deleteresponseconfirm'] = 'Naozaj chcete vymazať text odpovede?';
+$messages['addedsuccessfully'] = 'Kontakt bol pridaný do adresára.';
+$messages['contactexists'] = 'Kontakt s touto e-mailovou adresou už existuje.';
+$messages['contactnameexists'] = 'Kontakt s takýmto menom už existuje.';
+$messages['blockedimages'] = 'Kvôli ochrane vášho súkromia boli v tejto správe zablokované vzdialené obrázky.';
+$messages['encryptedmessage'] = 'Táto správa je zaÅ¡ifrovaná, a nie je možné ju zobraziÅ¥. PrepáÄte!';
+$messages['nocontactsfound'] = 'Nenašli sa žiadne kontakty.';
+$messages['contactnotfound'] = 'Požadovaný kontakt sa nenašiel.';
+$messages['contactsearchonly'] = 'Zadajte nejaký výraz pre vyhľadanie kontaktov';
+$messages['sendingfailed'] = 'Nepodarilo sa odoslať správu.';
+$messages['senttooquickly'] = 'PoÄkajte $sec sekúnd pred odoslaním tejto správy.';
+$messages['errorsavingsent'] = 'PoÄas ukladania odoslanej správy sa vyskytla chyba.';
+$messages['errorsaving'] = 'PoÄas ukladania sa vyskytla chyba.';
+$messages['errormoving'] = 'Správu/správy nemožno presunúť.';
+$messages['errorcopying'] = 'Správu/správy nemožno skopírovať,';
+$messages['errordeleting'] = 'Správu/správy nemožno vymazať.';
+$messages['errormarking'] = 'Nemožno oznaÄiÅ¥ správu/správy.';
+$messages['deletecontactconfirm'] = 'Naozaj chcete vymazať vybrané kontakty?';
+$messages['deletegroupconfirm'] = 'Naozaj chcete vymazať vybranú skupinu?';
+$messages['deletemessagesconfirm'] = 'Naozaj chcete vymazať vybrané správy?';
+$messages['deletefolderconfirm'] = 'Naozaj chcete vymazaÅ¥ tento prieÄinok?';
+$messages['purgefolderconfirm'] = 'Naozaj chcete vyprázdniÅ¥ tento prieÄinok?';
+$messages['contactdeleting'] = 'Vymazávajú sa kontakty...';
+$messages['groupdeleting'] = 'Vymazáva sa skupina...';
+$messages['folderdeleting'] = 'Vymazáva sa prieÄinok ...';
+$messages['foldermoving'] = 'Presúva sa prieÄinok...';
+$messages['foldersubscribing'] = 'Prebieha prihlasovanie k prieÄinku...';
+$messages['folderunsubscribing'] = 'Prebieha odhlasovanie z prieÄinka...';
+$messages['formincomplete'] = 'Formulár nie je kompletne vyplnený.';
+$messages['noemailwarning'] = 'Prosím zadajte platnú e-mailovú adresu.';
+$messages['nonamewarning'] = 'Prosím zadajte meno.';
+$messages['nopagesizewarning'] = 'Prosím zadajte poÄet záznamov na stranu.';
+$messages['nosenderwarning'] = 'Prosím zadajte adresu odosielateľa.';
+$messages['norecipientwarning'] = 'Prosím zadajte aspoň jedného príjemcu.';
+$messages['nosubjectwarning'] = '"Predmet" správy je prázdny. Chcete ho teraz zadať?';
$messages['nobodywarning'] = 'Chcete odoslať správu bez textu?';
$messages['notsentwarning'] = 'Správa nebola odoslaná, chcete ju zrušiť?';
-$messages['noldapserver'] = 'Prosím, zvoľte LDAP server na vyhľadávanie';
-$messages['nosearchname'] = 'Prosím vložte meno alebo emailovú adresu';
-$messages['notuploadedwarning'] = 'EÅ¡te neboli nahrané vÅ¡etky prílohy. PoÄkajte prosím alebo nahrávanie zruÅ¡te.';
-$messages['searchsuccessful'] = 'nájdených $nr správ';
-$messages['contactsearchsuccessful'] = 'Bolo nájdených $nr kontaktov.';
-$messages['searchnomatch'] = 'Hľadaný výraz nebol nájdený';
+$messages['restoresavedcomposedata'] = 'Našla sa staršia správa, ktorú ste napísali ale neodoslali.\n\nPredmet: $subject\nUložené: $date\n\nChcete túto správu obnoviť?';
+$messages['noldapserver'] = 'Prosím vyberte server LDAP pre vyhľadávanie.';
+$messages['nosearchname'] = 'Prosím zadajte meno alebo e-mailovú adresu kontaktu.';
+$messages['notuploadedwarning'] = 'EÅ¡te neboli nahrané vÅ¡etky súbory. Prosím Äakajte alebo nahrávanie zruÅ¡te.';
+$messages['searchsuccessful'] = 'Nájdené správy: $nr.';
+$messages['contactsearchsuccessful'] = 'Nájdené kontakty: $nr.';
+$messages['searchnomatch'] = 'Hľadaný výraz sa nenašiel.';
$messages['searching'] = 'Vyhľadáva sa...';
$messages['checking'] = 'Kontroluje sa...';
-$messages['nospellerrors'] = 'Pri kontrole pravopisu neboli nájdené chyby';
-$messages['folderdeleted'] = 'PrieÄinok bol zmazaný';
-$messages['foldersubscribed'] = 'Úspešne prihlásený k adresáru';
-$messages['folderunsubscribed'] = 'Úspešne odhlásený z adresára';
-$messages['folderpurged'] = 'Adresár bol vyprázdnený';
-$messages['folderexpunged'] = 'Adresár bol zhustený';
-$messages['deletedsuccessfully'] = 'Úspešne zmazané';
-$messages['converting'] = 'Odstraňuje sa formátovanie správy...';
-$messages['messageopenerror'] = 'Nedá sa naÄítaÅ¥ správa zo servera';
-$messages['fileuploaderror'] = 'NaÄítanie súboru nebolo úspeÅ¡né';
-$messages['filesizeerror'] = 'NaÄítavaný súbor prekroÄil maximálnu veľkosÅ¥ $size';
+$messages['nospellerrors'] = 'Pri kontrole pravopisu neboli nájdené chyby.';
+$messages['folderdeleted'] = 'PrieÄinok bol úspeÅ¡ne vymazaný.';
+$messages['foldersubscribed'] = 'Prihlásenie k prieÄinku bolo úspeÅ¡né.';
+$messages['folderunsubscribed'] = 'Odhlásenie z prieÄinka bolo úspeÅ¡né.';
+$messages['folderpurged'] = 'PrieÄinok bol úspeÅ¡ne vyprázdnený.';
+$messages['folderexpunged'] = 'Komprimovanie obsahu prieÄinka bolo úspeÅ¡né.';
+$messages['deletedsuccessfully'] = 'Vymazanie bolo úspešné.';
+$messages['converting'] = 'Odstraňuje sa formátovanie...';
+$messages['messageopenerror'] = 'Správu nemožno naÄítaÅ¥ zo servera.';
+$messages['fileuploaderror'] = 'Nahrávanie súboru bolo neúspešné.';
+$messages['filesizeerror'] = 'Nahraný súbor prekroÄil maximálnu veľkosÅ¥ $size.';
$messages['copysuccess'] = 'PoÄet úspeÅ¡ne skopírovaných kontaktov: $nr.';
$messages['movesuccess'] = 'PoÄet úspeÅ¡ne presunutých kontaktov: $nr.';
-$messages['copyerror'] = 'Kontakty nie je možné kopírovať.';
+$messages['copyerror'] = 'Kontakty nemožno kopírovať.';
$messages['moveerror'] = 'Kontakty nemožno presúvať.';
-$messages['sourceisreadonly'] = 'Tento zdroj adries je len na Äítanie';
-$messages['errorsavingcontact'] = 'Nedá sa uložiť adresa kontaktu';
-$messages['movingmessage'] = 'Správa sa presúva...';
-$messages['copyingmessage'] = 'Správa sa kopíruje...';
-$messages['copyingcontact'] = 'Kopírujem kontakt(y)';
-$messages['movingcontact'] = 'Presúvanie kontaktu (kontaktov)...';
-$messages['deletingmessage'] = 'Mažem správu(y)...';
-$messages['markingmessage'] = 'OznaÄujem správu(y)...';
-$messages['addingmember'] = 'Pridávam kontakt(y) do skupiny...';
-$messages['removingmember'] = 'Odoberám kontakt(y) zo skupiny';
-$messages['receiptsent'] = 'Potvrdenie o prijatí správy bolo odoslané';
-$messages['errorsendingreceipt'] = 'Potvrdenie o prijatí správy sa nedalo odoslať';
-$messages['deleteidentityconfirm'] = 'SkutoÄne chcete zmazaÅ¥ túto identitu?';
-$messages['nodeletelastidentity'] = 'Identita sa nedá odstrániť, je posledná a musí zostať.';
-$messages['forbiddencharacter'] = 'Názov prieÄinka obsahuje nepovolený znak';
-$messages['selectimportfile'] = 'Zvoľte súbor, ktorý chcete naÄítaÅ¥';
-$messages['addresswriterror'] = 'Zvolený adresár kontaktov je iba na Äítanie';
-$messages['contactaddedtogroup'] = 'Kontakty boli úspešne presunuty do tejto skupiny';
-$messages['contactremovedfromgroup'] = 'Kontakty boli úspešne odstráneny z tejto skupiny';
-$messages['nogroupassignmentschanged'] = 'Priradenia do skupín neboli zmenené.';
-$messages['importwait'] = 'Prebieha import, poÄkajte ...';
-$messages['importformaterror'] = 'Import nebol úspešný! Odoslaný súbor nie je platným súborom, z ktorého je možné vykonať import údajov.';
-$messages['importconfirm'] = '<b>ÚspeÅ¡ne sa naÄítalo $inserted kontaktov, preskoÄilo sa $skipped existujúcich záznamov</b>:<p><em>$names</em></p>';
-$messages['importconfirmskipped'] = '<b>PreskoÄených $skipped existujúcich záznamov</b>';
+$messages['sourceisreadonly'] = 'Tento zdroj adries je urÄený len na Äítanie.';
+$messages['errorsavingcontact'] = 'Zmeny nebolo možné uložiť.';
+$messages['movingmessage'] = 'Prebieha presúvanie správ(y)...';
+$messages['copyingmessage'] = 'Prebieha kopírovanie správ(y)...';
+$messages['copyingcontact'] = 'Prebieha kopírovanie kontaktov...';
+$messages['movingcontact'] = 'Presúvanie kontaktov...';
+$messages['deletingmessage'] = 'Prebieha vymazávanie správ(y)...';
+$messages['markingmessage'] = 'Prebieha oznaÄovanie správ(y)...';
+$messages['addingmember'] = 'Prebieha pridávanie kontaktov do skupiny...';
+$messages['removingmember'] = 'Prebieha odstraňovanie kontaktov zo skupiny...';
+$messages['receiptsent'] = 'Potvrdenie o preÄítaní bolo odoslané.';
+$messages['errorsendingreceipt'] = 'Potvrdenie nemožno odoslať.';
+$messages['deleteidentityconfirm'] = 'Naozaj chcete vymazať túto identitu?';
+$messages['nodeletelastidentity'] = 'Túto identitu nemožno vymazať, pretože je posledná.';
+$messages['forbiddencharacter'] = 'Názov prieÄinka obsahuje nepovolený znak.';
+$messages['selectimportfile'] = 'Zvoľte súbor, ktorý chcete importovať na server.';
+$messages['addresswriterror'] = 'Do vybraného adresára nie je možné zapisovať údaje.';
+$messages['contactaddedtogroup'] = 'Kontakty boli úspešne pridané do tejto skupiny.';
+$messages['contactremovedfromgroup'] = 'Kontakty boli úspešne odstránené z tejto skupiny.';
+$messages['nogroupassignmentschanged'] = 'Priradenia do skupín sa nezmenili.';
+$messages['importwait'] = 'Prebieha importovanie, prosím Äakajte...';
+$messages['importformaterror'] = 'Importovanie nebolo úspešné! Nahraný súbor nie je platným súborom údajov pre importovanie.';
+$messages['importconfirm'] = '<b>PoÄet úspeÅ¡ne naimportovaných kontaktov: $inserted</b>';
+$messages['importconfirmskipped'] = '<b>PoÄet preskoÄených existujúcich záznamov: $skipped</b>';
$messages['importmessagesuccess'] = 'PoÄet úspeÅ¡ne naimportovaných správ: $nr';
-$messages['importmessageerror'] = 'Importovanie bolo neúspeÅ¡né! Odoslaný súbor nie je platným súborom pre správu alebo poÅ¡tový prieÄinok';
-$messages['opnotpermitted'] = 'Operácia nie je povolená!';
-$messages['nofromaddress'] = 'Zvolená identita neobsahuje e-mailovú adresu';
-$messages['editorwarning'] = 'Prepnutie na editor obyÄajného textu spôsobí stratu formátovania. Chcete napriek tomu pokraÄovaÅ¥?';
-$messages['httpreceivedencrypterror'] = 'Vyskytla sa vážna chyba v konfigurácii. Kontaktujte bezodkladne administrátora. <b>Vaša správa nemohla byť odoslaná.</b>';
-$messages['smtpconnerror'] = 'Chyba SMTP: Pripojenie na server zlyhalo';
-$messages['smtpautherror'] = 'Chyba SMTP: Autorizácie zlyhala';
-$messages['smtpfromerror'] = 'Chyba SMTP: Nemožno nastaviť odosielateľa ($msg)';
-$messages['smtptoerror'] = 'Chyba SMTP: Nemožno pridať príjemca ($msg)';
-$messages['smtprecipientserror'] = 'Chyba SMTP: Nemožno spracovať zoznam príjemcov';
+$messages['importmessageerror'] = 'Importovanie bolo neúspešné! Odoslaný súbor nie je platným súborom pre importovanie';
+$messages['opnotpermitted'] = 'Táto operácia nie je povolená!';
+$messages['nofromaddress'] = 'Pri vybranej identite chýba e-mailová adresa.';
+$messages['editorwarning'] = 'Prepnutie na editor Äistého textu spôsobí stratu formátovania. Naozaj chcete pokraÄovaÅ¥?';
+$messages['httpreceivedencrypterror'] = 'Vyskytla sa vážna chyba v konfigurácii. IhneÄ kontaktujte administrátora. <b>VaÅ¡u správu nemožno odoslaÅ¥.</b>';
+$messages['smtpconnerror'] = 'Chyba SMTP ($code): Neúspešné pripojenie k serveru.';
+$messages['smtpautherror'] = 'Chyba SMTP ($code): Neúspešná autentifikácia.';
+$messages['smtpfromerror'] = 'Chyba SMTP ($code): Nemožno nastaviť odosielateľa "$from" ($msg).';
+$messages['smtptoerror'] = 'Chyba SMTP ($code): Nemožno pridať príjemcu "$to" ($msg).';
+$messages['smtprecipientserror'] = 'Chyba SMTP: Nemožno spracovať zoznam príjemcov.';
$messages['smtperror'] = 'Chyba SMTP: $msg';
$messages['emailformaterror'] = 'Neplatná e-mailová adresa: $email';
-$messages['toomanyrecipients'] = 'PríliÅ¡ veľa príjemcov. ZmenÅ¡ite poÄet príjemcov na $max.';
-$messages['maxgroupmembersreached'] = 'PoÄet Älenov skupiny dosiahol maxima z $max';
-$messages['contactdelerror'] = 'Nemôžem vymazať kontakt(y)';
-$messages['contactdeleted'] = 'Kontakt(y) bol vymazaný';
-$messages['contactrestoreerror'] = 'Nemôžem obnoviť zmazané kontakty';
-$messages['contactrestored'] = 'Kontakty boli úspešne obnovené';
-$messages['groupdeleted'] = 'Skupina bola vymazaná';
-$messages['grouprenamed'] = 'Skupina bola premenovaná';
-$messages['groupcreated'] = 'Skupina bola vytvorená';
-$messages['savedsearchdeleted'] = 'Uložené vyhľadávanie bolo vymazané.';
-$messages['savedsearchdeleteerror'] = 'Nemôžem zmazať uložené vyhľadávanie.';
-$messages['savedsearchcreated'] = 'Uložené vyhľadávanie bolo vytvorené.';
-$messages['savedsearchcreateerror'] = 'Nemôžem vytvoriť uložené vyhľadávanie';
-$messages['messagedeleted'] = 'Správa(y) bola vymazaná';
-$messages['messagemoved'] = 'Správa(y) bola presunutá';
-$messages['messagecopied'] = 'Správa(y) bola skopírovaná';
-$messages['messagemarked'] = 'Správa(y) bola oznaÄená';
-$messages['autocompletechars'] = 'Zadajte najmenej $min znamkov pre automatické dopĺňanie';
-$messages['autocompletemore'] = 'Bolo nájdených viac záznamov. Napíšte prosím viac znakov.';
-$messages['namecannotbeempty'] = 'Meno nemôže byť prázdne';
-$messages['nametoolong'] = 'Meno je príliš dlhé';
-$messages['folderupdated'] = 'Adresár bol aktualizovaný';
-$messages['foldercreated'] = 'Adresár bol vytvorený';
-$messages['invalidimageformat'] = 'Zlý formát obrázku';
-$messages['mispellingsfound'] = 'V správe boli nájdené pravopisné chyby';
-$messages['parentnotwritable'] = 'Nemôžem vytvoriť/presunúť adresár do zvoleného nadradeného adresára. Nemáte oprávnenia na zmenu.';
+$messages['toomanyrecipients'] = 'PríliÅ¡ veľa príjemcov. Zredukujte poÄet príjemcov na $max.';
+$messages['maxgroupmembersreached'] = 'PoÄet Älenov skupiny prekraÄuje maximum: $max';
+$messages['internalerror'] = 'Došlo k internej chybe systému. Prosím skúste to ešte raz.';
+$messages['contactdelerror'] = 'Nemožno vymazať kontakt(y).';
+$messages['contactdeleted'] = 'Kontakty boli úspešne vymazané.';
+$messages['contactrestoreerror'] = 'Nemožno obnoviť vymazané kontakty.';
+$messages['contactrestored'] = 'Kontakty boli úspešne obnovené.';
+$messages['groupdeleted'] = 'Skupina bola úspešne vymazaná.';
+$messages['grouprenamed'] = 'Skupina bola úspešne premenovaná.';
+$messages['groupcreated'] = 'Skupina bola úspešne vytvorená.';
+$messages['savedsearchdeleted'] = 'Uložené výsledky vyhľadávania boli úspešne vymazané.';
+$messages['savedsearchdeleteerror'] = 'Nemožno vymazať uložené výsledky vyhľadávania.';
+$messages['savedsearchcreated'] = 'Uložené výsledky vyhľadávania boli úspešne vytvorené.';
+$messages['savedsearchcreateerror'] = 'Nemožno vytvoriť uložené výsledky vyhľadávania.';
+$messages['messagedeleted'] = 'Vymazanie správ(y) bolo úspešné.';
+$messages['messagemoved'] = 'Presunutie správ(y) bolo úspešné.';
+$messages['messagecopied'] = 'Kopírovanie správ(y) bolo úspešné.';
+$messages['messagemarked'] = 'OznaÄovanie správ(y) bolo úspeÅ¡né.';
+$messages['autocompletechars'] = 'Zadajte najmenej $min znakov pre automatické dopĺňanie.';
+$messages['autocompletemore'] = 'Našlo sa viacero záznamov. Zadajte prosím viac znakov.';
+$messages['namecannotbeempty'] = 'Meno nemôže byť prázdne.';
+$messages['nametoolong'] = 'Meno je príliš dlhé.';
+$messages['folderupdated'] = 'PrieÄinok bol úspeÅ¡ne aktualizovaný.';
+$messages['foldercreated'] = 'PrieÄinok bol úspeÅ¡ne vytvorený.';
+$messages['invalidimageformat'] = 'Neplatný formát obrázka';
+$messages['mispellingsfound'] = 'V správe boli nájdené pravopisné chyby.';
+$messages['parentnotwritable'] = 'Nemožno vytvoriÅ¥/presunúť prieÄinok do vybraného rodiÄovského prieÄinka. Nemáte prístupové oprávnenia.';
$messages['messagetoobig'] = 'Časť správy je príliš veľká na spracovanie.';
$messages['attachmentvalidationerror'] = 'UPOZORNENIE! Táto príloha je podozrivá, pretože jej typ sa nezhoduje s typom uvedeným v správe. Ak odosielateľovi prílohy nedôverujete, nemali by ste prílohu otváraÅ¥. Môže totiž obsahovaÅ¥ Å¡kodlivý obsah.<br/><br/><em>OÄakávaná hodnota: $expected; nájdená hodnota: $detected</em>';
$messages['noscriptwarning'] = 'Upozornenie: Táto webmailová služba vyžaduje Javascript! Ak ju chcete používaÅ¥, prosím aktivujte Javascript v nastaveniach svojho prehliadaÄa.';
diff --git a/program/localization/sl_SI/labels.inc b/program/localization/sl_SI/labels.inc
index f93684d69..cdba04170 100644
--- a/program/localization/sl_SI/labels.inc
+++ b/program/localization/sl_SI/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from – $to od $count';
$labels['copy'] = 'Kopiraj';
$labels['move'] = 'Premakni';
$labels['moveto'] = 'Premakni v...';
+$labels['copyto'] = 'Kopiraj v...';
$labels['download'] = 'Prenesi';
$labels['open'] = 'Odpri';
$labels['showattachment'] = 'Prikaži';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'ÄŒrkovanje';
$labels['checkspelling'] = 'Preglej pravopis';
$labels['resumeediting'] = 'Nadaljuj z urejanjem';
$labels['revertto'] = 'Razveljavi';
+$labels['restore'] = 'Obnovi';
+$labels['restoremessage'] = 'Obnovi sporoÄilo';
+$labels['responses'] = 'Odgovori';
+$labels['insertresponse'] = 'Vnesi odgovor';
+$labels['manageresponses'] = 'Uredi odgovore';
+$labels['savenewresponse'] = 'Shrani nove odgovore';
+$labels['editresponses'] = 'Uredi odgovore';
+$labels['editresponse'] = 'Uredi odgovor';
+$labels['responsename'] = 'Ime';
+$labels['responsetext'] = 'Tekst za odgovor';
$labels['attach'] = 'Pripni';
$labels['attachments'] = 'Priponke';
$labels['upload'] = 'Naloži';
@@ -316,7 +327,11 @@ $labels['searchdelete'] = 'Izbriši iskanje';
$labels['import'] = 'Uvozi';
$labels['importcontacts'] = 'Uvozi stike';
$labels['importfromfile'] = 'Uvozi iz datoteke:';
+$labels['importtarget'] = 'Dodaj stike v';
$labels['importreplace'] = 'Zamenjaj celoten imenik';
+$labels['importgroups'] = 'Vnesi skupinske zadolžitve';
+$labels['importgroupsall'] = 'Vse (ustvari skupine, Äe je potrebno)';
+$labels['importgroupsexisting'] = 'Samo za obstojeÄe skupine';
$labels['importdesc'] = 'Stike lahko naložite iz obstojeÄega imenika. <br/>Trenutno je podprt uvoz stikov v zapisu <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> ali v CSV (z vejico loÄene vrednosti) zapisu.';
$labels['done'] = 'DokonÄano';
$labels['settingsfor'] = 'Nastavitve za';
@@ -424,6 +439,9 @@ $labels['standardwindows'] = 'Prikaži pojavna okna kot obiÄajna';
$labels['forwardmode'] = 'Posredovanje sporoÄil';
$labels['inline'] = 'medvrstiÄno';
$labels['asattachment'] = 'Kot priponka';
+$labels['replyallmode'] = 'Privzete možnosti gumba [Odgovori vsem]';
+$labels['replyalldefault'] = 'odgovori vsem';
+$labels['replyalllist'] = 'odgovori na dopisni seznam (v kolikor ta obstaja)';
$labels['folder'] = 'Mapa';
$labels['folders'] = 'Mape';
$labels['foldername'] = 'Ime mape';
diff --git a/program/localization/sl_SI/messages.inc b/program/localization/sl_SI/messages.inc
index f1beffc0f..9b4370922 100644
--- a/program/localization/sl_SI/messages.inc
+++ b/program/localization/sl_SI/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -33,6 +33,7 @@ $messages['invalidhost'] = 'Nepravilno ime strežnika';
$messages['nomessagesfound'] = 'V poÅ¡tnem predalu ni sporoÄil.';
$messages['loggedout'] = 'Odjava je bila uspešna.';
$messages['mailboxempty'] = 'Poštni predal je prazen.';
+$messages['nomessages'] = 'Ni sporoÄil';
$messages['refreshing'] = 'Osvežujem...';
$messages['loading'] = 'Nalaganje...';
$messages['uploading'] = 'Prenos dokumenta na strežnik...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'SporoÄilo je bilo uspeÅ¡no poslano.';
$messages['savingmessage'] = 'Shranjevanje sporoÄila...';
$messages['messagesaved'] = 'SporoÄilo je bilo shranjeno v Osnutke';
$messages['successfullysaved'] = 'Uspešno shranjeno.';
+$messages['savingresponse'] = 'Shranjevanje odgovora...';
+$messages['deleteresponseconfirm'] = 'Ste prepriÄani, da želite izbrisati ta odgovor?';
$messages['addedsuccessfully'] = 'Stik je bil uspešno dodan v imenik.';
$messages['contactexists'] = 'Stik s tem elektronskim naslovom že obstaja.';
$messages['contactnameexists'] = 'Stik s tem imenom že obstaja';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'Iskanega stika ni bilo mogoÄe najti.';
$messages['contactsearchonly'] = 'Vpišite iskalni parameter za iskanje stika';
$messages['sendingfailed'] = 'SporoÄila ni bilo mogoÄe poslati.';
$messages['senttooquickly'] = 'PoÄakajte $sec sekund in nato znova poskusite s poÅ¡iljanjem sporoÄila.';
+$messages['errorsavingsent'] = 'Pri shranjevanju poslanega sporoÄila je priÅ¡lo do napake.';
+$messages['errorsaving'] = 'Pri shranjevanju je prišlo do napake.';
$messages['errormoving'] = 'SporoÄila ni bilo mogoÄe premakniti.';
$messages['errorcopying'] = 'SporoÄila ni bilo mogoÄe kopirati.';
$messages['errordeleting'] = 'SporoÄila ni bilo mogoÄe izbrisati.';
@@ -78,6 +83,7 @@ $messages['norecipientwarning'] = 'Vnesite vsaj enega prejemnika sporoÄila';
$messages['nosubjectwarning'] = 'Polje "Zadeva" je prazno. Želite dodati tekst v to polje?';
$messages['nobodywarning'] = 'Želite poslati sporoÄilo brez vsebine?';
$messages['notsentwarning'] = 'SporoÄilo ni bilo poslano. Želite zavreÄi to sporoÄilo?';
+$messages['restoresavedcomposedata'] = 'Ali želite nadaljevati z urejanjem še neodposlanega osnutka:\n\nZadeva: $subject\nShranjeno dne: $date\n\n ';
$messages['noldapserver'] = 'Izberite LDAP strežnik, v katerem želite iskati?';
$messages['nosearchname'] = 'Vnesite ime ali elektronski naslov stika';
$messages['notuploadedwarning'] = 'Priponke se Å¡e nalagajo na strežnik. PoÄakajte ali prekinite prenos.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'Napaka pri pošiljanju:$msg';
$messages['emailformaterror'] = 'Nepravilen elektronski naslov: $email';
$messages['toomanyrecipients'] = 'Navedli ste preveÄ prejemnikov. ZmanjÅ¡ajte Å¡tevilo prejemnikov na $max';
$messages['maxgroupmembersreached'] = 'Å tevilo Älanov skupine presega najveÄje dovoljeno Å¡tevilo $max.';
+$messages['internalerror'] = 'Prišlo je do napake. Poskusite znova.';
$messages['contactdelerror'] = 'Stika/ov ni bilo mogoÄe izbrisati';
$messages['contactdeleted'] = 'Stik/i so bili uspešno izbrisani';
$messages['contactrestoreerror'] = 'Ni bilo mogoÄe obnoviti izbrisanih stikov.';
diff --git a/program/localization/sv_SE/labels.inc b/program/localization/sv_SE/labels.inc
index 48f71ab57..6b7765269 100644
--- a/program/localization/sv_SE/labels.inc
+++ b/program/localization/sv_SE/labels.inc
@@ -51,7 +51,8 @@ $labels['messagenrof'] = 'Meddelande $nr av $count';
$labels['fromtoshort'] = '$from – $to av $count';
$labels['copy'] = 'Kopiera';
$labels['move'] = 'Flytta';
-$labels['moveto'] = 'Flytta till:';
+$labels['moveto'] = 'Flytta till...';
+$labels['copyto'] = 'Kopiera till...';
$labels['download'] = 'Ladda ner';
$labels['open'] = 'Öppna';
$labels['showattachment'] = 'Visa';
@@ -100,8 +101,8 @@ $labels['longdec'] = 'december';
$labels['today'] = 'idag';
$labels['refresh'] = 'Uppdatera';
$labels['checkmail'] = 'Hämta nya meddelanden';
-$labels['compose'] = 'Nytt meddelande';
-$labels['writenewmessage'] = 'Nytt meddelande';
+$labels['compose'] = 'Meddelande';
+$labels['writenewmessage'] = 'Skriv nytt meddelande';
$labels['reply'] = 'Svara';
$labels['replytomessage'] = 'Svara avsändaren';
$labels['replytoallmessage'] = 'Svara avsändaren och alla mottagare';
@@ -112,7 +113,7 @@ $labels['forwardinline'] = 'Vidarebefordra infogat';
$labels['forwardattachment'] = 'Vidarebefordra som bilaga';
$labels['forwardmessage'] = 'Vidarebefordra meddelande';
$labels['deletemessage'] = 'Ta bort meddelande';
-$labels['movemessagetotrash'] = 'Flytta meddelande till papperskorgen';
+$labels['movemessagetotrash'] = 'Flytta meddelande till Papperskorg';
$labels['printmessage'] = 'Skriv ut';
$labels['previousmessage'] = 'Visa föregående meddelande';
$labels['firstmessage'] = 'Visa första meddelandet';
@@ -126,7 +127,7 @@ $labels['markread'] = 'Läst';
$labels['markunread'] = 'Oläst';
$labels['markflagged'] = 'Flaggat';
$labels['markunflagged'] = 'Oflaggat';
-$labels['moreactions'] = 'Fler åtgärder';
+$labels['moreactions'] = 'Fler åtgärder...';
$labels['more'] = 'Fler';
$labels['back'] = 'Tillbaka';
$labels['options'] = 'Alternativ';
@@ -139,7 +140,7 @@ $labels['flagged'] = 'Flaggade';
$labels['unanswered'] = 'Obesvarade';
$labels['withattachment'] = 'Med bilaga';
$labels['deleted'] = 'Borttagna';
-$labels['undeleted'] = 'Inte borttaget';
+$labels['undeleted'] = 'Inte borttagna';
$labels['invert'] = 'Invertera';
$labels['filter'] = 'Filter';
$labels['list'] = 'Lista';
@@ -163,7 +164,7 @@ $labels['listcolumns'] = 'Kolumner';
$labels['listsorting'] = 'Sortering';
$labels['listorder'] = 'Ordning';
$labels['listmode'] = 'Visningsläge';
-$labels['folderactions'] = 'Hantera kataloger';
+$labels['folderactions'] = 'Hantera kataloger...';
$labels['compact'] = 'Packa';
$labels['empty'] = 'Töm';
$labels['importmessages'] = 'Importera meddelanden';
@@ -197,12 +198,22 @@ $labels['spellcheck'] = 'Rättstava';
$labels['checkspelling'] = 'Kontrollera stavning';
$labels['resumeediting'] = 'Ã…teruppta redigering';
$labels['revertto'] = 'Återgå till';
+$labels['restore'] = 'Ã…terskapa';
+$labels['restoremessage'] = 'Ã…terskapa meddelande?';
+$labels['responses'] = 'Responser';
+$labels['insertresponse'] = 'Infoga respons';
+$labels['manageresponses'] = 'Hantera responser';
+$labels['savenewresponse'] = 'Spara ny respons';
+$labels['editresponses'] = 'Ändra responser';
+$labels['editresponse'] = 'Ändra respons';
+$labels['responsename'] = 'Namn';
+$labels['responsetext'] = 'Responstext';
$labels['attach'] = 'Bifoga';
$labels['attachments'] = 'Bilagor';
$labels['upload'] = 'Bifoga';
$labels['uploadprogress'] = '$percent ($current av $total)';
$labels['close'] = 'Stäng';
-$labels['messageoptions'] = 'Meddelandealternativ';
+$labels['messageoptions'] = 'Meddelandealternativ...';
$labels['low'] = 'LÃ¥g';
$labels['lowest'] = 'Lägst';
$labels['normal'] = 'Normal';
@@ -213,8 +224,8 @@ $labels['showimages'] = 'Visa bilder';
$labels['alwaysshow'] = 'Visa alltid bilder från $sender';
$labels['isdraft'] = 'Detta meddelande är ett utkast.';
$labels['andnmore'] = '$nr fler...';
-$labels['togglemoreheaders'] = 'Visa fler meddelandehuvuden';
-$labels['togglefullheaders'] = 'Växla meddelandehuvuden';
+$labels['togglemoreheaders'] = 'Växla ytterligare meddelandeinformation';
+$labels['togglefullheaders'] = 'Växla teknisk meddelandeinformation';
$labels['htmltoggle'] = 'HTML';
$labels['plaintoggle'] = 'Text';
$labels['savesentmessagein'] = 'Spara kopia i';
@@ -239,9 +250,9 @@ $labels['jobtitle'] = 'Titel';
$labels['department'] = 'Avdelning';
$labels['gender'] = 'Kön';
$labels['maidenname'] = 'Flicknamn';
-$labels['email'] = 'E-post';
+$labels['email'] = 'Mailadress';
$labels['phone'] = 'Telefon';
-$labels['address'] = 'Adress';
+$labels['address'] = 'Postadress';
$labels['street'] = 'Gata';
$labels['locality'] = 'Ort';
$labels['zipcode'] = 'Postnummer';
@@ -311,7 +322,7 @@ $labels['group'] = 'Grupp';
$labels['groups'] = 'Kontaktgrupper';
$labels['listgroup'] = 'Visa gruppmedlemmar';
$labels['personaladrbook'] = 'Personliga adresser';
-$labels['searchsave'] = 'Lägg till sökning';
+$labels['searchsave'] = 'Spara sökning';
$labels['searchdelete'] = 'Ta bort sökning';
$labels['import'] = 'Importera';
$labels['importcontacts'] = 'Importera kontakter';
@@ -357,8 +368,8 @@ $labels['htmlsignature'] = 'HTML-signatur';
$labels['showemail'] = 'Visa namn och adress';
$labels['previewpane'] = 'Visa meddelandefältet';
$labels['skin'] = 'Stilmall för användargränssnitt';
-$labels['logoutclear'] = 'Töm papperskorgen vid utloggning';
-$labels['logoutcompact'] = 'Packa inkorgen vid utloggning';
+$labels['logoutclear'] = 'Töm Papperskorg vid utloggning';
+$labels['logoutcompact'] = 'Packa Inkorg vid utloggning';
$labels['uisettings'] = 'Användargränssnitt';
$labels['serversettings'] = 'Serverinställningar';
$labels['mailboxview'] = 'Hantering av meddelanden';
@@ -400,10 +411,10 @@ $labels['section'] = 'Avdelning';
$labels['maintenance'] = 'Underhåll';
$labels['newmessage'] = 'Nytt meddelande';
$labels['signatureoptions'] = 'Signaturalternativ';
-$labels['whenreplying'] = 'Vid svar fortsätt skriv';
+$labels['whenreplying'] = 'Vid svar';
$labels['replyempty'] = 'Inkludera inte ursprungligt meddelande';
-$labels['replytopposting'] = 'Ovanför befintligt meddelande';
-$labels['replybottomposting'] = 'Nedanför befintligt meddelande';
+$labels['replytopposting'] = 'Skriv nytt meddelande ovanför befintligt';
+$labels['replybottomposting'] = 'Skriv nytt meddelande nedanför befintligt';
$labels['replyremovesignature'] = 'Ta bort befintlig signatur från meddelandet vid svar';
$labels['autoaddsignature'] = 'Infoga signatur automatiskt';
$labels['newmessageonly'] = 'Vid nytt meddelande';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Hantera popup-rutor som standardfönster';
$labels['forwardmode'] = 'Vidarebefordra meddelande';
$labels['inline'] = 'Infogat';
$labels['asattachment'] = 'Bilaga';
+$labels['replyallmode'] = 'Standardfunktion för knappen Svara alla';
+$labels['replyalldefault'] = 'Svara alla';
+$labels['replyalllist'] = 'Svara endast lista (i förekommande fall)';
$labels['folder'] = 'Katalog';
$labels['folders'] = 'Kataloger';
$labels['foldername'] = 'Katalognamn';
diff --git a/program/localization/sv_SE/messages.inc b/program/localization/sv_SE/messages.inc
index 2773ae4c7..546147606 100644
--- a/program/localization/sv_SE/messages.inc
+++ b/program/localization/sv_SE/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -24,15 +24,14 @@ $messages['servererror'] = 'Serverfel!';
$messages['servererrormsg'] = 'Serverfel: $msg';
$messages['dberror'] = 'Databasfel!';
$messages['requesttimedout'] = 'Begäran tog för lång tid';
-$messages['errorreadonly'] = 'Åtgärden kunde inte utföras. Katalogen är skrivskyddad';
-$messages['errornoperm'] = 'Åtgärden kunde inte utföras. Otillräcklig befogenhet';
+$messages['errorreadonly'] = 'Åtgärden kunde inte utföras. Katalogen är skrivskyddad.';
+$messages['errornoperm'] = 'Åtgärden kunde inte utföras. Otillräcklig befogenhet.';
$messages['erroroverquota'] = 'Åtgärden kunde inte utföras. Otillräckligt lagringsutrymme.';
$messages['erroroverquotadelete'] = 'Otillräckligt lagringsutrymme. Tryck på SHIFT och DEL för att ta bort ett meddelande.';
$messages['invalidrequest'] = 'Ogiltig begäran! Informationen sparades inte.';
$messages['invalidhost'] = 'Ogiltigt servernamn.';
-$messages['nomessagesfound'] = 'Inga meddelanden';
+$messages['nomessagesfound'] = 'Inga meddelanden.';
$messages['loggedout'] = 'Du är utloggad. Välkommen åter!';
-$messages['mailboxempty'] = 'Katalogen är tom';
$messages['refreshing'] = 'Uppdaterar...';
$messages['loading'] = 'Laddar...';
$messages['uploading'] = 'Överför fil...';
@@ -43,21 +42,25 @@ $messages['sendingmessage'] = 'Skickar meddelande...';
$messages['messagesent'] = 'Meddelandet har skickats.';
$messages['savingmessage'] = 'Sparar meddelande...';
$messages['messagesaved'] = 'Meddelandet har sparats i Utkast';
-$messages['successfullysaved'] = 'Informationen har sparats.';
+$messages['successfullysaved'] = 'Sparat.';
+$messages['savingresponse'] = 'Sparar responstext...';
+$messages['deleteresponseconfirm'] = 'Vill du verkligen ta bort denna responstext?';
$messages['addedsuccessfully'] = 'Kontakten har lagts till i adressboken.';
-$messages['contactexists'] = 'En kontakt med den här adressen finns redan';
-$messages['contactnameexists'] = 'En kontakt med det här namnet finns redan';
+$messages['contactexists'] = 'En kontakt med den här adressen finns redan.';
+$messages['contactnameexists'] = 'En kontakt med det här namnet finns redan.';
$messages['blockedimages'] = 'Externt länkade bilder i meddelandet har blockerats.';
$messages['encryptedmessage'] = 'Meddelandet är krypterat och kan tyvärr inte visas.';
-$messages['nocontactsfound'] = 'Inga kontakter hittades';
-$messages['contactnotfound'] = 'Efterfrågad kontakt hittades inte';
+$messages['nocontactsfound'] = 'Inga kontakter hittades.';
+$messages['contactnotfound'] = 'Efterfrågad kontakt hittades inte.';
$messages['contactsearchonly'] = 'Ange sökord för att hitta kontakter';
-$messages['sendingfailed'] = 'Meddelandet kunde inte skickas';
-$messages['senttooquickly'] = 'Vänta ytterligare $sec sekunder med att skicka meddelandet';
-$messages['errormoving'] = 'Meddelandet kunde inte flyttas';
-$messages['errorcopying'] = 'Meddelandet kunde inte kopieras';
-$messages['errordeleting'] = 'Meddelandet kunde inte tas bort';
-$messages['errormarking'] = 'Meddelandet kunde inte markeras';
+$messages['sendingfailed'] = 'Meddelandet kunde inte skickas.';
+$messages['senttooquickly'] = 'Vänta ytterligare $sec sekunder med att skicka meddelandet.';
+$messages['errorsavingsent'] = 'Det skickade meddelandet kunde inte sparas.';
+$messages['errorsaving'] = 'Meddelandet kunde inte sparas.';
+$messages['errormoving'] = 'Meddelandet kunde inte flyttas.';
+$messages['errorcopying'] = 'Meddelandet kunde inte kopieras.';
+$messages['errordeleting'] = 'Meddelandet kunde inte tas bort.';
+$messages['errormarking'] = 'Meddelandet kunde inte markeras.';
$messages['deletecontactconfirm'] = 'Vill du verkligen ta bort valda kontakter?';
$messages['deletegroupconfirm'] = 'Vill du verkligen ta bort den valda gruppen?';
$messages['deletemessagesconfirm'] = 'Vill du verkligen ta bort valda meddelanden?';
@@ -69,40 +72,41 @@ $messages['folderdeleting'] = 'Tar bort katalog...';
$messages['foldermoving'] = 'Flyttar katalog...';
$messages['foldersubscribing'] = 'Startar prenumeration på katalog...';
$messages['folderunsubscribing'] = 'Avslutar prenumeration på katalog...';
-$messages['formincomplete'] = 'Formuläret var inte komplett ifyllt';
-$messages['noemailwarning'] = 'Ange en giltig adress';
-$messages['nonamewarning'] = 'Ange ett namn';
-$messages['nopagesizewarning'] = 'Ange en sidstorlek';
-$messages['nosenderwarning'] = 'Ange en avsändaradress';
-$messages['norecipientwarning'] = 'Ange minst en mottagare';
-$messages['nosubjectwarning'] = 'Ämnesraden är tom. Vill du ange ämne nu?';
+$messages['formincomplete'] = 'Formuläret var inte komplett ifyllt.';
+$messages['noemailwarning'] = 'Ange en giltig adress.';
+$messages['nonamewarning'] = 'Ange ett namn.';
+$messages['nopagesizewarning'] = 'Ange en sidstorlek.';
+$messages['nosenderwarning'] = 'Ange en avsändaradress.';
+$messages['norecipientwarning'] = 'Ange minst en mottagare.';
+$messages['nosubjectwarning'] = 'Ämnesraden är tom. Vill du ange ett ämne nu?';
$messages['nobodywarning'] = 'Skicka det här meddelandet utan text?';
$messages['notsentwarning'] = 'Meddelandet har inte skickats. Vill du avbryta meddelandet?';
-$messages['noldapserver'] = 'Ange en LDAP-server för att söka';
-$messages['nosearchname'] = 'Ange ett kontaktnamn eller en adress';
+$messages['restoresavedcomposedata'] = 'Ett tidigare skrivet men inte skickat meddelande upptäcktes.\n\nÄmne: $subject\nSparat: $date\n\nVill du återskapa meddelandet?';
+$messages['noldapserver'] = 'Ange en LDAP-server för att söka.';
+$messages['nosearchname'] = 'Ange ett kontaktnamn eller en adress.';
$messages['notuploadedwarning'] = 'Alla bilagor har inte överförts ännu. Vänta eller avbryt överföringen.';
$messages['searchsuccessful'] = '$nr meddelanden hittades.';
$messages['contactsearchsuccessful'] = '$nr kontakter hittades.';
-$messages['searchnomatch'] = 'Sökningen gav inget resultat';
+$messages['searchnomatch'] = 'Sökningen gav inget resultat.';
$messages['searching'] = 'Söker...';
$messages['checking'] = 'Kontrollerar...';
-$messages['nospellerrors'] = 'Inget stavfel hittades';
+$messages['nospellerrors'] = 'Inget stavfel hittades.';
$messages['folderdeleted'] = 'Katalogen togs bort.';
$messages['foldersubscribed'] = 'Prenumeration på katalog startad.';
$messages['folderunsubscribed'] = 'Prenumeration på katalog avslutad.';
-$messages['folderpurged'] = 'Katalog rensad.';
-$messages['folderexpunged'] = 'Katalog tömd.';
-$messages['deletedsuccessfully'] = 'Lyckad borttagning.';
-$messages['converting'] = 'Tar bort formatering från meddelande...';
-$messages['messageopenerror'] = 'Meddelandet kunde inte hämtas från servern';
-$messages['fileuploaderror'] = 'Filuppladdning misslyckades';
-$messages['filesizeerror'] = 'Den uppladdade filens storlek överstiger högsta tillåtna $size';
+$messages['folderpurged'] = 'Katalog tömd.';
+$messages['folderexpunged'] = 'Katalog rensad.';
+$messages['deletedsuccessfully'] = 'Borttaget.';
+$messages['converting'] = 'Tar bort formatering...';
+$messages['messageopenerror'] = 'Meddelandet kunde inte hämtas från servern.';
+$messages['fileuploaderror'] = 'Filuppladdning misslyckades.';
+$messages['filesizeerror'] = 'Den uppladdade filens storlek överstiger högsta tillåtna $size.';
$messages['copysuccess'] = '$nr kontakter har kopierats.';
$messages['movesuccess'] = '$nr kontakter har flyttats.';
$messages['copyerror'] = 'NÃ¥gra kontakter kunde inte kopieras.';
$messages['moveerror'] = 'NÃ¥gra kontakter kunde inte flyttas.';
-$messages['sourceisreadonly'] = 'Denna adresskälla är skrivskyddad';
-$messages['errorsavingcontact'] = 'Kontaktadressen kunde inte sparas';
+$messages['sourceisreadonly'] = 'Denna adresskälla är skrivskyddad.';
+$messages['errorsavingcontact'] = 'Kontaktadressen kunde inte sparas.';
$messages['movingmessage'] = 'Flyttar meddelande...';
$messages['copyingmessage'] = 'Kopierar meddelande...';
$messages['copyingcontact'] = 'Kopierar kontakter...';
@@ -112,12 +116,12 @@ $messages['markingmessage'] = 'Markerar meddelande...';
$messages['addingmember'] = 'Lägger till kontakter i gruppen...';
$messages['removingmember'] = 'Tar bort kontakter från gruppen...';
$messages['receiptsent'] = 'Mottagarkvitto har skickats.';
-$messages['errorsendingreceipt'] = 'Mottagarkvitto kunde inte skickas';
+$messages['errorsendingreceipt'] = 'Mottagarkvitto kunde inte skickas.';
$messages['deleteidentityconfirm'] = 'Vill du verkligen ta bort denna identitet?';
$messages['nodeletelastidentity'] = 'Du kan inte ta bort identiteten, den är din sista.';
-$messages['forbiddencharacter'] = 'Katalognamnet innehåller otillåtna tecken';
-$messages['selectimportfile'] = 'Välj en fil att ladda upp';
-$messages['addresswriterror'] = 'Angiven adressbok är skrivskyddad';
+$messages['forbiddencharacter'] = 'Katalognamnet innehåller otillåtna tecken.';
+$messages['selectimportfile'] = 'Välj en fil att ladda upp.';
+$messages['addresswriterror'] = 'Markerad adressbok är skrivskyddad.';
$messages['contactaddedtogroup'] = 'Kontakterna har lagts till i gruppen.';
$messages['contactremovedfromgroup'] = 'Kontakterna har tagits bort från gruppen.';
$messages['nogroupassignmentschanged'] = 'Ingen grupptillhörighet ändrades.';
@@ -125,46 +129,47 @@ $messages['importwait'] = 'Importerar, var god vänta...';
$messages['importformaterror'] = 'Importen misslyckades! Filen har inte korrekt dataformat.';
$messages['importconfirm'] = '<b>Lyckad import av $inserted kontakter</b>';
$messages['importconfirmskipped'] = '<b>Hoppade över $skipped befintliga poster</b>';
-$messages['importmessagesuccess'] = '$nr meddelanden har importerats.';
-$messages['importmessageerror'] = 'Importen misslyckades! Filen innehåller inte något meddelande eller någon brevlåda';
+$messages['importmessagesuccess'] = '$nr meddelanden har importerats';
+$messages['importmessageerror'] = 'Importen misslyckades! Filen är inte ett giltigt meddelande eller en brevlåda';
$messages['opnotpermitted'] = 'Otillåten operation!';
-$messages['nofromaddress'] = 'Adress saknas i den valda identiteten';
+$messages['nofromaddress'] = 'Adress saknas i den valda identiteten.';
$messages['editorwarning'] = 'Genom att växla till text-läge går formateringen förlorad. Vill du fortsätta?';
$messages['httpreceivedencrypterror'] = 'Ett irreparabelt fel har uppstått. Kontakta administratören omgående. <b>Meddelandet kan inte skickas.</b>';
-$messages['smtpconnerror'] = 'SMTP-fel ($code): Anslutning till servern misslyckades';
-$messages['smtpautherror'] = 'SMTP-fel ($code): Inloggningen misslyckades';
-$messages['smtpfromerror'] = 'SMTP-fel ($code): Kan inte sätta avsändaradress till "$from" ($msg)';
-$messages['smtptoerror'] = 'SMTP-fel ($code): Kan inte lägga till mottagaradress "$to" ($msg)';
-$messages['smtprecipientserror'] = 'SMTP-fel: Felaktigt formaterad lista med mottagaradresser';
+$messages['smtpconnerror'] = 'SMTP-fel ($code): Anslutning till servern misslyckades.';
+$messages['smtpautherror'] = 'SMTP-fel ($code): Inloggningen misslyckades.';
+$messages['smtpfromerror'] = 'SMTP-fel ($code): Kan inte sätta avsändaradress till "$from" ($msg).';
+$messages['smtptoerror'] = 'SMTP-fel ($code): Kan inte lägga till mottagaradress "$to" ($msg).';
+$messages['smtprecipientserror'] = 'SMTP-fel: Felaktigt formaterad lista med mottagaradresser.';
$messages['smtperror'] = 'SMTP-fel: $msg';
$messages['emailformaterror'] = 'Felaktig adress: $email';
-$messages['toomanyrecipients'] = 'Förmånga mottagare. Minska antalet till högst $max';
-$messages['maxgroupmembersreached'] = 'Antalet gruppmedlemmar får inte överstiga $max';
-$messages['contactdelerror'] = 'Kontakt kunde inte tas bort';
+$messages['toomanyrecipients'] = 'Förmånga mottagare. Minska antalet till högst $max.';
+$messages['maxgroupmembersreached'] = 'Antalet gruppmedlemmar får inte överstiga $max.';
+$messages['internalerror'] = 'Ett internt fel uppstod. Försök igen.';
+$messages['contactdelerror'] = 'Kontakt kunde inte tas bort.';
$messages['contactdeleted'] = 'Kontakt borttagen.';
-$messages['contactrestoreerror'] = 'Borttagna kontakter kunde inte återskapas';
+$messages['contactrestoreerror'] = 'Borttagna kontakter kunde inte återskapas.';
$messages['contactrestored'] = 'Kontakter återskapade.';
$messages['groupdeleted'] = 'Grupp borttagen.';
$messages['grouprenamed'] = 'Gruppnamn ändrat.';
$messages['groupcreated'] = 'Grupp skapad.';
$messages['savedsearchdeleted'] = 'Sparad sökning borttagen.';
-$messages['savedsearchdeleteerror'] = 'Kunde inte ta bort sparad sökning';
+$messages['savedsearchdeleteerror'] = 'Kunde inte ta bort sparad sökning.';
$messages['savedsearchcreated'] = 'Sparad sökning tillagd.';
-$messages['savedsearchcreateerror'] = 'Kunde inte lägga till sparad sökning';
+$messages['savedsearchcreateerror'] = 'Kunde inte lägga till sparad sökning.';
$messages['messagedeleted'] = 'Meddelande borttaget.';
$messages['messagemoved'] = 'Meddelande flyttat.';
$messages['messagecopied'] = 'Meddelande kopierat.';
$messages['messagemarked'] = 'Meddelande markerat.';
-$messages['autocompletechars'] = 'Ange minst $min tecken för automatisk komplettering';
-$messages['autocompletemore'] = 'Flera passande informationsposter funna. Skriv fler tecken.';
-$messages['namecannotbeempty'] = 'Namnet får inte vara tomt';
-$messages['nametoolong'] = 'Namnet är för långt';
+$messages['autocompletechars'] = 'Ange minst $min tecken för automatisk komplettering.';
+$messages['autocompletemore'] = 'Ytterligare passande poster funna. Skriv fler tecken.';
+$messages['namecannotbeempty'] = 'Namnet får inte vara tomt.';
+$messages['nametoolong'] = 'Namnet är för långt.';
$messages['folderupdated'] = 'Katalog uppdaterad.';
$messages['foldercreated'] = 'Katalog skapad.';
-$messages['invalidimageformat'] = 'Ogiltigt bildfilsformat';
-$messages['mispellingsfound'] = 'Stavfel hittades i meddelandet';
+$messages['invalidimageformat'] = 'Ogiltigt bildfilsformat.';
+$messages['mispellingsfound'] = 'Stavfel hittades i meddelandet.';
$messages['parentnotwritable'] = 'Katalogen kunde inte skapas eller flyttas. Åtkomsträttighet saknas.';
-$messages['messagetoobig'] = 'Denna del av meddelandet är alltför stor för att hantera.';
+$messages['messagetoobig'] = 'Meddelandet är alltför stort att behandla.';
$messages['attachmentvalidationerror'] = 'VARNING! Bilagan misstänks vara av annan typ än vad som anges i meddelandet. Om du inte litar på avsändaren ska du inte öppna bilagan.<br/><br/><em>Angiven typ: $expected; funnen typ: $detected</em>';
$messages['noscriptwarning'] = 'Varning: Denna webbmailtjänst fungerar inte utan Javascript! Aktivera Javascript i webbläsarens inställningar.';
?>
diff --git a/program/localization/ti/labels.inc b/program/localization/ti/labels.inc
new file mode 100644
index 000000000..2919f47c0
--- /dev/null
+++ b/program/localization/ti/labels.inc
@@ -0,0 +1,62 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/<lang>/labels.inc |
+ | |
+ | Localization file of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ +-----------------------------------------------------------------------+
+
+ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
+*/
+$labels['welcome'] = 'ሰናይ áˆáˆáŒ»áŠ¥ ናብ $product';
+$labels['username'] = 'ሽáˆá‹“ሙና';
+$labels['password'] = 'መáˆáˆˆáŠ ቃáˆ';
+$labels['server'] = 'á‹áˆƒá‰¢ áŒáˆáŒ‹áˆŽá‰µ';
+$labels['login'] = 'ክኣቱ';
+$labels['logout'] = 'ክá‹áŒ½áŠ¥';
+$labels['mail'] = 'ደብዳበ';
+$labels['settings'] = 'ከመንታይ';
+$labels['addressbook'] = 'መጽሓá አድራሻ';
+$labels['inbox'] = 'ሳጹን አታዊ';
+$labels['drafts'] = 'ወጡን ጽሑá';
+$labels['sent'] = 'á‹á‰°áˆˆáŠ£áŠ¸';
+$labels['trash'] = 'እንዳጉሓá';
+$labels['junk'] = 'እንዳቅንጠመንጢ';
+$labels['subject'] = 'ዋኒን';
+$labels['from'] = 'ካብ';
+$labels['sender'] = 'áˆáŠ£áŠº(ት)';
+$labels['to'] = 'ናብ';
+$labels['cc'] = 'ካኮ';
+$labels['bcc'] = 'ሕካኮ';
+$labels['replyto'] = 'ተመላሲ ናብ';
+$labels['followupto'] = 'ናብ...á‹áˆµá‹“በ';
+$labels['date'] = 'ዕለት';
+$labels['size'] = 'መጠን';
+$labels['priority'] = 'ህጹጽáŠá‰µ';
+$labels['organization'] = 'á‹á‹µá‰¥';
+$labels['readstatus'] = 'áˆáŠ•á‰£á‰¡';
+$labels['listoptions'] = 'መማርጽታት á‹áˆ­á‹áˆ­';
+$labels['mailboxlist'] = 'ማህዸራት';
+$labels['messagesfromto'] = '$countá‹­ መáˆáŠ¥áŠ½á‰² ካብ $from ናብ $to ';
+$labels['sun'] = 'ሰንበ';
+$labels['mon'] = 'ሰኑይ';
+$labels['tue'] = 'ሰሉስ';
+$labels['wed'] = 'ረቡዕ';
+$labels['thu'] = 'ሓሙስ';
+$labels['fri'] = 'ዓርቢ';
+$labels['sat'] = 'ቀዳáˆ';
+$labels['sunday'] = 'ሰንበት';
+$labels['monday'] = 'ሰኑይ';
+$labels['tuesday'] = 'ሰሉስ';
+$labels['wednesday'] = 'ረቡዕ';
+$labels['thursday'] = 'ሓሙስ';
+$labels['friday'] = 'ዓርቢ ';
+$labels['saturday'] = 'ቀዳáˆ';
+?>
diff --git a/program/localization/ur_PK/messages.inc b/program/localization/ti/messages.inc
index da4e39679..278a0897a 100644
--- a/program/localization/ur_PK/messages.inc
+++ b/program/localization/ti/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -15,4 +15,10 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
+$messages['errortitle'] = 'ተጓንᎠጋዶ';
+$messages['loginfailed'] = 'ከይዲ áˆáŠ¥á‰³á‹Ž áˆáˆºáˆ‰';
+$messages['cookiesdisabled'] = 'ጎስጓሲ ኢንተርኔት ዛላማላ አይቕበáˆáŠ•';
+$messages['sessionerror'] = 'እዋኑ á‹áˆ“ለᎠወይ ዋጋ ዘይብሉ ካርአáˆáŒ¥á‰ƒáˆ ክáˆáŠ­áˆ እዩ::';
+$messages['storageerror'] = 'ናብ á‹áˆƒá‰¢ áŒáˆáŒ‹áˆ‰á‰µ ቆᎠረኽቢ አይተኻለን::';
+$messages['servererror'] = 'ጋዶ á‹áˆƒá‰¢á‰µ áŒáˆáŒ‹áˆ‰á‰µ';
?>
diff --git a/program/localization/tr_TR/labels.inc b/program/localization/tr_TR/labels.inc
index bcecd51f7..99122ccad 100644
--- a/program/localization/tr_TR/labels.inc
+++ b/program/localization/tr_TR/labels.inc
@@ -52,6 +52,7 @@ $labels['fromtoshort'] = '$from - $to , Toplam: $count';
$labels['copy'] = 'Kopyala';
$labels['move'] = 'Taşı';
$labels['moveto'] = 'Şuraya taşı...';
+$labels['copyto'] = 'Åžuraya kopyala...';
$labels['download'] = 'Ä°ndir';
$labels['open'] = 'Aç';
$labels['showattachment'] = 'Göster';
@@ -197,6 +198,16 @@ $labels['spellcheck'] = 'Yazım denetimi';
$labels['checkspelling'] = 'Yazım denetimi yap';
$labels['resumeediting'] = 'Düzenlemeye devam et';
$labels['revertto'] = 'Geri çevir:';
+$labels['restore'] = 'Geri yükle';
+$labels['restoremessage'] = 'Mesajı geri yükle?';
+$labels['responses'] = 'Yanıtlar';
+$labels['insertresponse'] = 'Yanıt ekle';
+$labels['manageresponses'] = 'Yanıtları yönet';
+$labels['savenewresponse'] = 'Yeni yanıt kaydet';
+$labels['editresponses'] = 'Yanıtları düzenle';
+$labels['editresponse'] = 'Yanıtı düzenle';
+$labels['responsename'] = 'Ad';
+$labels['responsetext'] = 'Yanıt metni';
$labels['attach'] = 'Ekle';
$labels['attachments'] = 'Ekler';
$labels['upload'] = 'Yükle';
@@ -428,6 +439,9 @@ $labels['standardwindows'] = 'Popup pencerelerini standart pencere olarak yönet
$labels['forwardmode'] = 'Posta yönlendirme';
$labels['inline'] = 'postanın içinde';
$labels['asattachment'] = 'ek olarak';
+$labels['replyallmode'] = '[Tümünü yanıtla] düğmesinin varsayılan eylemi';
+$labels['replyalldefault'] = 'Hepsini yanıtla';
+$labels['replyalllist'] = 'Sadece postalama listesindekileri yanıtla (eğer varsa)';
$labels['folder'] = 'Klasör';
$labels['folders'] = 'Klasörler';
$labels['foldername'] = 'Klasör Adı';
diff --git a/program/localization/tr_TR/messages.inc b/program/localization/tr_TR/messages.inc
index 0b2ac1e46..cf3607498 100644
--- a/program/localization/tr_TR/messages.inc
+++ b/program/localization/tr_TR/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -30,9 +30,10 @@ $messages['erroroverquota'] = 'İşlem gerçekleştirilemedi. Boş alan yok.';
$messages['erroroverquotadelete'] = 'Boş alan yok. SHIFT+DEL tuş kombinasyonunu kullanarak mesajı silin.';
$messages['invalidrequest'] = 'Geçersiz İstek! Veri kaydedilmedi';
$messages['invalidhost'] = 'Geçersiz sunucu adı.';
-$messages['nomessagesfound'] = 'Posta kutusunda ileti bulunamadı';
+$messages['nomessagesfound'] = 'Posta kutusunda ileti bulunamadı.';
$messages['loggedout'] = 'Oturumu başarılı bir şekilde kapattınız. Güle güle!';
$messages['mailboxempty'] = 'Posta kutusu boÅŸ';
+$messages['nomessages'] = 'Mesaj yok';
$messages['refreshing'] = 'Yenileniyor...';
$messages['loading'] = 'Yükleniyor...';
$messages['uploading'] = 'Dosya yükleniyor...';
@@ -44,6 +45,8 @@ $messages['messagesent'] = 'Posta gönderildi';
$messages['savingmessage'] = 'Posta kaydediliyor...';
$messages['messagesaved'] = 'Posta taslaklara kaydedildi';
$messages['successfullysaved'] = 'Kaydedildi';
+$messages['savingresponse'] = 'Yanıt metni kaydediliyor...';
+$messages['deleteresponseconfirm'] = 'Yanıt metnini gerçekten silmek istiyor musunuz?';
$messages['addedsuccessfully'] = 'KiÅŸi adres defterine eklendi';
$messages['contactexists'] = 'Rehberde bu e-posta adresine sahip biri zaten var';
$messages['contactnameexists'] = 'Rehberde bu ada sahip biri zaten var.';
@@ -54,6 +57,8 @@ $messages['contactnotfound'] = 'İstenen kişi bulunamadı';
$messages['contactsearchonly'] = 'Kişi aramak için arama terimleri giriniz';
$messages['sendingfailed'] = 'Posta gönderilemedi';
$messages['senttooquickly'] = 'Lütfen bu postayı göndermeden önce $sec saniye bekleyin';
+$messages['errorsavingsent'] = 'Gönderilen postayı kaydederken hata oluştu.';
+$messages['errorsaving'] = 'Kaydederken bir hata oluÅŸtu.';
$messages['errormoving'] = 'Posta taşınamadı';
$messages['errorcopying'] = 'Posta kopyalanamadı';
$messages['errordeleting'] = 'Posta silinemedi';
@@ -63,7 +68,7 @@ $messages['deletegroupconfirm'] = 'Seçili grupları silmek istediğinizden emi
$messages['deletemessagesconfirm'] = 'Seçili postaları silmek istediğinizden emin misiniz?';
$messages['deletefolderconfirm'] = 'Bu klasörü silmek istediğinizden emin misiniz?';
$messages['purgefolderconfirm'] = 'Bu klasördeki tüm postaları silmek istediğinizden emin misiniz?';
-$messages['contactdeleting'] = 'KiÅŸi(er) siliniyor...';
+$messages['contactdeleting'] = 'KiÅŸi(ler) siliniyor...';
$messages['groupdeleting'] = 'Grup siliniyor...';
$messages['folderdeleting'] = 'Klasör siliniyor...';
$messages['foldermoving'] = 'Klasör taşınıyor...';
@@ -78,31 +83,32 @@ $messages['norecipientwarning'] = 'Lütfen en az bir alıcı belirtin';
$messages['nosubjectwarning'] = '"Konu" kutusu boş bırakılmış. Şimdi bir konu belirtmek ister misiniz?';
$messages['nobodywarning'] = 'Postayı boş olarak gönder?';
$messages['notsentwarning'] = 'Posta gönderilmedi. Postanızı iptal etmek istiyor musunuz?';
+$messages['restoresavedcomposedata'] = 'Daha önce oluşturulmuş fakat gönderilmemiş mesaj bulundu.\n\nKonu: $subject\Kaydetme zamanı: $date\n\nBu mesajı geri yüklemek istiyor musunuz?';
$messages['noldapserver'] = 'Lütfen arama için bir LDAP sunucu seçin';
$messages['nosearchname'] = 'Lütfen bir kişi ismi veya e-posta adresi girin';
$messages['notuploadedwarning'] = 'Henüz tüm ekli dosyalar yüklenmedi. Lütfen bekleyin ya da yüklemeyi iptal edin.';
$messages['searchsuccessful'] = '$nr posta bulundu';
-$messages['contactsearchsuccessful'] = '$nr kiÅŸi bulundu';
-$messages['searchnomatch'] = 'Aramanıza uygun hiçbir sonuç bulunamadı';
+$messages['contactsearchsuccessful'] = '$nr kiÅŸi bulundu.';
+$messages['searchnomatch'] = 'Aramanıza uygun hiçbir sonuç bulunamadı.';
$messages['searching'] = 'Aranıyor...';
$messages['checking'] = 'Denetleniyor...';
-$messages['nospellerrors'] = 'Yazım hatası bulunamadı';
-$messages['folderdeleted'] = 'Klasör silindi';
-$messages['foldersubscribed'] = 'Klasöre abone olundu';
-$messages['folderunsubscribed'] = 'Klasör aboneliği kaldırıldı';
-$messages['folderpurged'] = 'Klasör sıklaştırıldı';
-$messages['folderexpunged'] = 'Klasör boşaltıldı';
-$messages['deletedsuccessfully'] = 'Silindi';
+$messages['nospellerrors'] = 'Yazım hatası bulunamadı.';
+$messages['folderdeleted'] = 'Klasör başarıyla silindi.';
+$messages['foldersubscribed'] = 'Klasöre başarıyla abone olundu.';
+$messages['folderunsubscribed'] = 'Klasör aboneliği başarıyla kaldırıldı.';
+$messages['folderpurged'] = 'Klasör başarıyla sıklaştırıldı.';
+$messages['folderexpunged'] = 'Klasör başarıyla boşaltıldı.';
+$messages['deletedsuccessfully'] = 'Başarıyla silindi.';
$messages['converting'] = 'Postanın biçimlendirmesi kaldırılıyor...';
-$messages['messageopenerror'] = 'Sunucudan posta yüklenemedi';
-$messages['fileuploaderror'] = 'Dosya yükleme başarısız';
-$messages['filesizeerror'] = 'Yüklenen dosya en büyük dosya boyunu ($size) aşıyor';
+$messages['messageopenerror'] = 'Sunucudan posta yüklenemedi.';
+$messages['fileuploaderror'] = 'Dosya yükleme başarısız.';
+$messages['filesizeerror'] = 'Yüklenen dosya en büyük dosya boyunu ($size) aşıyor.';
$messages['copysuccess'] = '$nr adet kişi başarıyla kopyalandı.';
$messages['movesuccess'] = '$nr adet kişi başarıyla taşındı.';
$messages['copyerror'] = 'Kişiler kopyalanamadı.';
$messages['moveerror'] = 'Kişiler taşınamadı.';
-$messages['sourceisreadonly'] = 'Adres kaynağı salt okunur durumda';
-$messages['errorsavingcontact'] = 'KiÅŸinin adresi kaydedilemedi';
+$messages['sourceisreadonly'] = 'Adres kaynağı salt okunur durumda.';
+$messages['errorsavingcontact'] = 'KiÅŸi adresi kaydedilemedi.';
$messages['movingmessage'] = 'Posta(lar) taşınıyor...';
$messages['copyingmessage'] = 'Posta(lar) kopyalanıyor...';
$messages['copyingcontact'] = 'Kişile(ler) kopyalanıyor...';
@@ -111,19 +117,19 @@ $messages['deletingmessage'] = 'Posta(lar) siliniyor...';
$messages['markingmessage'] = 'Posta(lar) iÅŸaretleniyor...';
$messages['addingmember'] = 'Gruba kiÅŸi(ler) ekleniyor...';
$messages['removingmember'] = 'Gruptan kiÅŸi(ler) siliniyor...';
-$messages['receiptsent'] = 'Okundu onayı gönderildi';
-$messages['errorsendingreceipt'] = 'Okundu onayı gönderilemedi';
+$messages['receiptsent'] = 'Okundu onayı başarıyla gönderildi.';
+$messages['errorsendingreceipt'] = 'Okundu onayı gönderilemedi.';
$messages['deleteidentityconfirm'] = 'Bu kimliÄŸi silmek istediÄŸinizden emin misiniz?';
-$messages['nodeletelastidentity'] = 'Son kimliğiniz olduğu için bu kimliği silemezsiniz';
-$messages['forbiddencharacter'] = 'Klasör ismi yasaklanmış bir karakter içeriyor';
-$messages['selectimportfile'] = 'Lütfen yüklenecek dosyayı seçin';
-$messages['addresswriterror'] = 'Seçili adres defterine yazılamaz';
-$messages['contactaddedtogroup'] = 'KiÅŸiler bu gruba eklendi';
+$messages['nodeletelastidentity'] = 'Son kimliğiniz olduğu için bu kimliği silemezsiniz.';
+$messages['forbiddencharacter'] = 'Klasör ismi yasaklanmış bir karakter içeriyor.';
+$messages['selectimportfile'] = 'Lütfen yüklenecek dosyayı seçin.';
+$messages['addresswriterror'] = 'Seçili adres defteri yazılabilir durumda değil.';
+$messages['contactaddedtogroup'] = 'Kişiler bu başarıyla gruba eklendi.';
$messages['contactremovedfromgroup'] = 'Kişiler bu gruptan çıkarıldı';
$messages['nogroupassignmentschanged'] = 'Grup atamalarında bir değişiklik yapılmadı';
$messages['importwait'] = 'Aktarılıyor, lütfen bekleyin...';
$messages['importformaterror'] = 'İçe aktarım başarısız. Yüklenen dosya geçerli bir içe aktarım dosyası değil.';
-$messages['importconfirm'] = '<b>$inserted kişi başarıyla aktarıldı</b>';
+$messages['importconfirm'] = '<b>$inserted kişiler başarıyla aktarıldı</b>';
$messages['importconfirmskipped'] = '<b>Var olan $skipped girdi atlandı</b>';
$messages['importmessagesuccess'] = '$nr adet mesaj başarıyla içe aktarıldı';
$messages['importmessageerror'] = 'İçe aktarım başarısız. Yüklenen dosya geçerli bir içe aktarım dosyası değil.';
@@ -140,6 +146,7 @@ $messages['smtperror'] = 'SMTP Hatası: $msg';
$messages['emailformaterror'] = 'Hatalı e-posta adresi: $email';
$messages['toomanyrecipients'] = 'Çok fazla alıcı. En fazla $max alıcı girebilirsiniz.';
$messages['maxgroupmembersreached'] = 'Grup üyelerinin sayısı $max sınırını aşıyor.';
+$messages['internalerror'] = 'Dahili bir hata oluştu. Lütfen tekrar deneyin.';
$messages['contactdelerror'] = 'KiÅŸi(ler) silinemedi';
$messages['contactdeleted'] = 'KiÅŸi(ler) silindi';
$messages['contactrestoreerror'] = 'Silinen kiÅŸi(ler) geri getirilemiyor.';
diff --git a/program/localization/uk_UA/labels.inc b/program/localization/uk_UA/labels.inc
index f530c212e..8603dd10c 100644
--- a/program/localization/uk_UA/labels.inc
+++ b/program/localization/uk_UA/labels.inc
@@ -136,6 +136,7 @@ $labels['currpage'] = 'Поточна Ñторінка';
$labels['unread'] = 'Ðепрочитані';
$labels['flagged'] = 'Із зірочкою';
$labels['unanswered'] = 'Без відповіді';
+$labels['withattachment'] = 'З вкладеннÑм';
$labels['deleted'] = 'Видалені';
$labels['undeleted'] = 'Ðе видалено';
$labels['invert'] = 'Інвертувати виділеннÑ';
@@ -173,13 +174,14 @@ $labels['resetsearch'] = 'ОчиÑтити пошук';
$labels['searchmod'] = 'Де шукати';
$labels['msgtext'] = 'Ð’ уÑьому лиÑÑ‚Ñ–';
$labels['body'] = 'Тіло повідомленнÑ';
+$labels['type'] = 'Тип';
$labels['namex'] = 'Ім\'Ñ';
$labels['openinextwin'] = 'Відкрити в новому вікні';
$labels['emlsave'] = 'Зберегти (.eml)';
$labels['changeformattext'] = 'Ð’Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð² текÑтовому форматі';
$labels['changeformathtml'] = 'Ð’Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ñƒ форматі HTML';
$labels['editasnew'] = 'Редагувати Ñк новий';
-$labels['send'] = 'Відправлено';
+$labels['send'] = 'Відправити';
$labels['sendmessage'] = 'ÐадіÑлати зараз';
$labels['savemessage'] = 'Зберегти чернетку';
$labels['addattachment'] = 'ВклаÑти файл';
@@ -194,6 +196,9 @@ $labels['spellcheck'] = 'ОрфографіÑ';
$labels['checkspelling'] = 'Перевірити орфографію';
$labels['resumeediting'] = 'Продовжити редагуваннÑ';
$labels['revertto'] = 'Відмінити редагуваннÑ';
+$labels['restore'] = 'Відновити';
+$labels['restoremessage'] = 'ВІдновити повідомленнÑ?';
+$labels['responsename'] = 'Ім’Ñ';
$labels['attach'] = 'ВклаÑти';
$labels['attachments'] = 'Вкладені файли';
$labels['upload'] = 'ВклаÑти';
@@ -312,6 +317,7 @@ $labels['searchdelete'] = 'Видалити пошук';
$labels['import'] = 'Імпорт';
$labels['importcontacts'] = 'Імпортувати контакти';
$labels['importfromfile'] = 'Імпортувати з файлу:';
+$labels['importtarget'] = 'Додати контакт до';
$labels['importreplace'] = 'Замінити вÑÑŽ адреÑну книгу';
$labels['importgroupsexisting'] = 'Лише Ð´Ð»Ñ Ñ–Ñнуючих груп';
$labels['importdesc'] = 'Ви можете завантажити контакти з Ñ–Ñнуючої адреÑної книги.<br/>Ð’ даний Ñ‡Ð°Ñ Ð¼Ð¸ підтримуємо імпорт Ð°Ð´Ñ€ÐµÑ Ð² форматі візитної картки <a href="http://en.wikipedia.org/wiki/VCard"> vCard</ a> або CSV (дані розділені комами).';
@@ -419,6 +425,8 @@ $labels['mailtoprotohandler'] = 'ЗареєÑтрувати обробник дÐ
$labels['forwardmode'] = 'ПереÑÐ¸Ð»Ð°Ð½Ð½Ñ Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½ÑŒ';
$labels['inline'] = 'у текÑÑ‚Ñ–';
$labels['asattachment'] = 'Ñк вкладеннÑ';
+$labels['replyallmode'] = 'Типова Ð´Ñ–Ñ Ð´Ð»Ñ ÐºÐ½Ð¾Ð¿ÐºÐ¸ [ВідповіÑти вÑім]';
+$labels['replyalldefault'] = 'відповіÑти уÑім';
$labels['folder'] = 'Папка';
$labels['folders'] = 'Папки';
$labels['foldername'] = 'Ðазва папки';
diff --git a/program/localization/uk_UA/messages.inc b/program/localization/uk_UA/messages.inc
index 669190c2e..5e4e6c631 100644
--- a/program/localization/uk_UA/messages.inc
+++ b/program/localization/uk_UA/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -27,11 +27,11 @@ $messages['requesttimedout'] = 'Тайм-аут запиту';
$messages['errorreadonly'] = 'Ðеможливо виконати операцію. Папка доÑтупна тільки Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ.';
$messages['errornoperm'] = 'Ðеможливо виконати операцію. ДоÑтуп заборонено';
$messages['erroroverquota'] = 'Ðеможливо виконати операцію. Ðемає вільного міÑÑ†Ñ Ð½Ð° диÑку.';
+$messages['erroroverquotadelete'] = 'ÐедоÑтатньо вільного міÑÑ†Ñ Ð½Ð° диÑку. СкориÑтайтеÑÑŒ SHIFT+DEL Ð´Ð»Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ.';
$messages['invalidrequest'] = 'Ðевірний запит! Дані не збережено.';
$messages['invalidhost'] = 'Ðевірне ім\'Ñ Ñерверу.';
$messages['nomessagesfound'] = 'ЛиÑтів не знайдено';
$messages['loggedout'] = 'Вашу ÑеÑÑ–ÑŽ завершено. Ð’Ñього найкращого!';
-$messages['mailboxempty'] = 'Поштова Ñкринька порожнÑ';
$messages['refreshing'] = 'ОновленнÑ...';
$messages['loading'] = 'ЗавантаженнÑ...';
$messages['uploading'] = 'Файл відправлÑєтьÑÑ...';
@@ -43,6 +43,8 @@ $messages['messagesent'] = 'ЛиÑÑ‚ уÑпішно відправлено';
$messages['savingmessage'] = 'Ð—Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð»Ð¸Ñта...';
$messages['messagesaved'] = 'Збережено в Чернетках';
$messages['successfullysaved'] = 'Збережено';
+$messages['savingresponse'] = 'Ð—Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ñ‚ÐµÐºÑту відповіді...';
+$messages['deleteresponseconfirm'] = 'Справді бажаєте видалити цей текÑÑ‚ відповіді?';
$messages['addedsuccessfully'] = 'Контакт уÑпішно доданий до ÑпиÑку контактів';
$messages['contactexists'] = 'Контакт з такою електронною адреÑою вже Ñ–Ñнує';
$messages['contactnameexists'] = 'Контакт з таким Ñамим іменем вже Ñ–Ñнує.';
@@ -53,6 +55,8 @@ $messages['contactnotfound'] = 'Запитаний контакт не знайÐ
$messages['contactsearchonly'] = 'Введіть деÑкі критерії пошуку, щоб знайти контакти';
$messages['sendingfailed'] = 'Ðе вдалоÑÑ Ð²Ñ–Ð´Ð¿Ñ€Ð°Ð²Ð¸Ñ‚Ð¸ лиÑта';
$messages['senttooquickly'] = 'Будь лаÑка, зачекайте $sec Ñекунд Ð´Ð»Ñ Ð²Ñ–Ð´Ð¿Ñ€Ð°Ð²ÐºÐ¸ лиÑта';
+$messages['errorsavingsent'] = 'Помилка при збереженні відправленого повідомленнÑ.';
+$messages['errorsaving'] = 'Помилка при збереженні.';
$messages['errormoving'] = 'Ðе вдалоÑÑ Ð¿ÐµÑ€ÐµÐ¼Ñ–Ñтити лиÑти';
$messages['errorcopying'] = 'Ðе вдалоÑÑ Ð·ÐºÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ñ‚Ð¸ лиÑти';
$messages['errordeleting'] = 'Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñ‚Ð¸ лиÑти';
@@ -96,11 +100,16 @@ $messages['converting'] = 'Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ...';
$messages['messageopenerror'] = 'Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð· Ñервера';
$messages['fileuploaderror'] = 'Ðе вдалоÑÑ Ð²ÐºÐ»Ð°Ñти файл';
$messages['filesizeerror'] = 'Розмір вибраного файлу перевищує макÑимально дозволений ($size)';
+$messages['copysuccess'] = 'УÑпішно Ñкопійовано $nr контактів';
+$messages['movesuccess'] = 'УÑпішно переміщено $nr контактів';
+$messages['copyerror'] = 'Ðе вдалоÑÑ Ñкопіювати жодного контакту.';
+$messages['moveerror'] = 'ÐевдалоÑÑŒ переміÑтити контакти.';
$messages['sourceisreadonly'] = 'Дане джерело Ð°Ð´Ñ€ÐµÑ Ð´Ð¾Ñтупне лише Ð´Ð»Ñ Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ';
$messages['errorsavingcontact'] = 'Ðеможливо зберегти адреÑу контакту';
$messages['movingmessage'] = 'ÐŸÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ Ð»Ð¸Ñта...';
$messages['copyingmessage'] = 'ÐšÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ Ð»Ð¸Ñта...';
$messages['copyingcontact'] = 'ÐšÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ ÐºÐ¾Ð½Ñ‚Ð°ÐºÑ‚Ñƒ(ів)...';
+$messages['movingcontact'] = 'ПеренеÑÐµÐ½Ð½Ñ ÐºÐ¾Ð½Ñ‚Ð°ÐºÑ‚Ñƒ(ів)...';
$messages['deletingmessage'] = 'Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð»Ð¸Ñта (ів)';
$messages['markingmessage'] = 'ÐŸÐ¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð»Ð¸Ñта (ів)';
$messages['addingmember'] = 'Ð”Ð¾Ð´Ð°Ð½Ð½Ñ ÐºÐ¾Ð½Ñ‚Ð°ÐºÑ‚Ñƒ(ів) до групи...';
@@ -119,6 +128,7 @@ $messages['importwait'] = 'ІмпортуваннÑ, будь лаÑка, зач
$messages['importformaterror'] = 'Помилка імпорту! Завантажений файл має невідомий формат даних.';
$messages['importconfirm'] = '<b>УÑпішно імпортовано $inserted контактів, пропущено $skipped Ñ–Ñнуючих</b>:<p><em>$names</em></p>';
$messages['importconfirmskipped'] = '<b>Пропущені $skipped наÑвні запиÑи</b>';
+$messages['importmessagesuccess'] = 'УÑпішно імпортовано $nr повідомлень';
$messages['importmessageerror'] = 'Імпорт не вдавÑÑ! Завантажений файл не Ñ” припуÑтимим Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð°Ð±Ð¾ файлом поштової Ñкриньки';
$messages['opnotpermitted'] = 'Ð”Ñ–Ñ Ð·Ð°Ð±Ð¾Ñ€Ð¾Ð½ÐµÐ½Ð°!';
$messages['nofromaddress'] = 'Ð’ обраному профілі не виÑтачає адреÑи електронної пошти';
@@ -133,6 +143,7 @@ $messages['smtperror'] = 'Помилка SMTP: $msg';
$messages['emailformaterror'] = 'Ðевірна електронна адреÑа: $email';
$messages['toomanyrecipients'] = 'Занадто багато отримувачів. Зменшіть Ñ—Ñ… чиÑло до $max.';
$messages['maxgroupmembersreached'] = 'ЧиÑло Ð°Ð´Ñ€ÐµÑ Ñƒ групі перевищило макÑимум у $max.';
+$messages['internalerror'] = 'Виникла Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°. Будь лаÑка, Ñпробуйте ще раз.';
$messages['contactdelerror'] = 'Ðеможливо видалити контакт(и)';
$messages['contactdeleted'] = 'Контакт(и) видалено уÑпішно';
$messages['contactrestoreerror'] = 'Ðеможливо відновити видалений(Ñ–) контакт(и).';
diff --git a/program/localization/vi_VN/labels.inc b/program/localization/vi_VN/labels.inc
index 6bd6d4402..d0a63ead2 100644
--- a/program/localization/vi_VN/labels.inc
+++ b/program/localization/vi_VN/labels.inc
@@ -15,26 +15,27 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/labels/
*/
-$labels['welcome'] = 'Chào bạn đã đến với $product';
+$labels['welcome'] = 'Chào mừng bạn đã sử dụng $product';
$labels['username'] = 'Tên đăng nhập';
$labels['password'] = 'Mật khẩu';
$labels['server'] = 'Máy chủ';
$labels['login'] = 'Äăng nhập';
$labels['logout'] = 'Thoát';
$labels['mail'] = 'ThÆ°';
-$labels['settings'] = 'Tùy chá»n';
+$labels['settings'] = 'Thiết lập cấu hình';
$labels['addressbook'] = 'Sổ địa chỉ';
$labels['inbox'] = 'Há»™p thÆ°';
$labels['drafts'] = 'Thư nháp';
$labels['sent'] = 'Äã gá»­i';
-$labels['trash'] = 'Sá»t rác';
+$labels['trash'] = 'Thùng rác';
$labels['junk'] = 'Thư rác';
+$labels['show_real_foldernames'] = 'Hiển thị tên thật cho các thư mục đặc biệt';
$labels['subject'] = 'Tiêu Ä‘á»';
-$labels['from'] = 'NgÆ°á»i gá»­i';
+$labels['from'] = 'Gửi từ';
$labels['sender'] = 'NgÆ°á»i gá»­i';
$labels['to'] = 'NgÆ°á»i nhận';
$labels['cc'] = 'Äồng kính gá»­i';
-$labels['bcc'] = 'NgÆ°á»i đồng nhận (ngừoi nhận không thấy email của ngÆ°á»i khác cùng được nhận thÆ°)';
+$labels['bcc'] = 'NgÆ°á»i đồng nhận (ngÆ°á»i nhận không thấy email của ngÆ°á»i khác cùng được nhận thÆ°)';
$labels['replyto'] = 'Trả lá»i cho';
$labels['followupto'] = 'Äánh dấu thÆ° cần theo dõi';
$labels['date'] = 'Ngày';
@@ -51,7 +52,9 @@ $labels['fromtoshort'] = '$from - $to của $count';
$labels['copy'] = 'Sao chép';
$labels['move'] = 'Di Chuyển';
$labels['moveto'] = 'Di chuyển tới...';
+$labels['copyto'] = 'Sao dữ liệu đến...';
$labels['download'] = 'Tải vá»';
+$labels['open'] = 'Mở';
$labels['showattachment'] = 'Hiển thị';
$labels['showanyway'] = 'Tiếp tục hiển thị';
$labels['filename'] = 'Tên tập tin';
@@ -164,6 +167,7 @@ $labels['listmode'] = 'Xem dạng danh sách';
$labels['folderactions'] = 'Thao tác với thư mục';
$labels['compact'] = 'Nén';
$labels['empty'] = 'Trống';
+$labels['importmessages'] = 'Nhập thư';
$labels['quota'] = 'Lượng đĩa sử dụng';
$labels['unknown'] = 'Không rõ';
$labels['unlimited'] = 'không giới hạn';
@@ -194,6 +198,16 @@ $labels['spellcheck'] = 'Äánh vần';
$labels['checkspelling'] = 'Kiểm tra chính tả';
$labels['resumeediting'] = 'Tiếp tục soạn thảo';
$labels['revertto'] = 'Trở lại với';
+$labels['restore'] = 'Khôi phục';
+$labels['restoremessage'] = 'Khôi phục thư?';
+$labels['responses'] = 'Các phản hồi';
+$labels['insertresponse'] = 'Thêm một phản hồi';
+$labels['manageresponses'] = 'Quản lý các phản hồi';
+$labels['savenewresponse'] = 'Lưu một phản hồi mới';
+$labels['editresponses'] = 'Sửa các phản hồi';
+$labels['editresponse'] = 'Sửa phản hồi';
+$labels['responsename'] = 'Tên';
+$labels['responsetext'] = 'Thông tin phản hồi';
$labels['attach'] = 'Äính kèm';
$labels['attachments'] = 'Các đính kèm';
$labels['upload'] = 'Tải lên';
@@ -313,7 +327,11 @@ $labels['searchdelete'] = 'Xóa tìm kiếm';
$labels['import'] = 'Nhập';
$labels['importcontacts'] = 'Nhập liên lạc';
$labels['importfromfile'] = 'Nhập từ tập tin:';
+$labels['importtarget'] = 'Thêm các địa chỉ liên hệ vào';
$labels['importreplace'] = 'Thay thế toàn bộ sổ địa chỉ';
+$labels['importgroups'] = 'Nhập nhóm';
+$labels['importgroupsall'] = 'Tất cả (tạo nhóm nếu cần thiết)';
+$labels['importgroupsexisting'] = 'Chỉ dành cho các nhóm đang tồn tại';
$labels['importdesc'] = 'Bạn có thể cập nhật các liên hệ từ một sổ địa chỉ có sẵn.<br />Hiện tại, chúng tôi hỗ trợ nhập địa chỉ từ dạng dữ liệu <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> hoặc CSV (dạng thức dữ liệu ngăn cách bằng dấu phẩy)';
$labels['done'] = 'Hoàn tất';
$labels['settingsfor'] = 'Thiết lập cho';
@@ -347,6 +365,7 @@ $labels['htmleditor'] = 'Soạn thư dạng HTML';
$labels['htmlonreply'] = 'Chỉ trả lá»i lại bằng thÆ° HTML';
$labels['htmlonreplyandforward'] = 'Khi chuyển tiếp hoặc trả lá»i thÆ° theo định dạng HTML';
$labels['htmlsignature'] = 'Chữ ký HTML';
+$labels['showemail'] = 'Hiển thị địa chỉ email kèm theo tên ';
$labels['previewpane'] = 'Hiển thị ô Xem thử';
$labels['skin'] = 'BỠmặt giao diện';
$labels['logoutclear'] = 'Xóa sạch rác khi thoát';
@@ -416,9 +435,13 @@ $labels['spellcheckignorenums'] = 'BỠqua các từ kèm số';
$labels['spellcheckignorecaps'] = 'BỠqua các từ được viết hoa';
$labels['addtodict'] = 'Thêm vào từ điển';
$labels['mailtoprotohandler'] = 'Xác định cách xử lý giao thức mailto: liên kết';
+$labels['standardwindows'] = 'Mở các popup nhÆ° là các cá»­a sổ thông thÆ°á»ng';
$labels['forwardmode'] = 'Chuyển tiếp thư';
$labels['inline'] = 'nội tuyến';
$labels['asattachment'] = 'dạng gửi kèm';
+$labels['replyallmode'] = 'Thao tác mặc định cho nút [Trả lá»i tất cả]';
+$labels['replyalldefault'] = 'Trả lá»i tất cả';
+$labels['replyalllist'] = 'Chỉ gá»­i trả lá»i đến danh sách thÆ° (nếu có tồn tại)';
$labels['folder'] = 'Thư mục';
$labels['folders'] = 'Các thư mục';
$labels['foldername'] = 'Tên thư mục';
diff --git a/program/localization/vi_VN/messages.inc b/program/localization/vi_VN/messages.inc
index b2d7c71ff..5c9983e33 100644
--- a/program/localization/vi_VN/messages.inc
+++ b/program/localization/vi_VN/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -15,7 +15,7 @@
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/messages/
*/
-$messages['errortitle'] = 'Xuất hiện 1 lỗi';
+$messages['errortitle'] = 'Có lỗi xảy ra.';
$messages['loginfailed'] = 'Không đăng nhập được';
$messages['cookiesdisabled'] = 'Trình duyệt không hỗ trợ cookies';
$messages['sessionerror'] = 'Phiên làm việc không hợp lệ hoặc đã hết hạn';
@@ -26,11 +26,12 @@ $messages['dberror'] = 'Lỗi cơ sở dữ liệu';
$messages['requesttimedout'] = 'Yêu cầu hết hạn';
$messages['errorreadonly'] = 'Không thể thá»±c hiện thao tác. ThÆ° mục chỉ cho phép Ä‘á»c.';
$messages['errornoperm'] = 'Bạn không đủ quyá»n hạn để thá»±c hiện thao tác này.';
+$messages['erroroverquota'] = 'Không thể thực hiện thao tác do không còn đủ chỗ trống trên ổ đĩa.';
+$messages['erroroverquotadelete'] = 'Không còn dư chỗ trống trên ổ đĩa. Sử dụng tổ hợp phím SHIFT+DEL để xoá thư.';
$messages['invalidrequest'] = 'Yêu cầu không hợp lệ! Không có dữ liệu nào được lưu.';
$messages['invalidhost'] = 'Sai thông tin máy chủ';
$messages['nomessagesfound'] = 'Không thấy có thư nào trong hộp thư này.';
$messages['loggedout'] = 'Phiên làm việc đã kết thúc thành công. Hẹn gặp lại!';
-$messages['mailboxempty'] = 'Há»™p thÆ° rá»—ng';
$messages['refreshing'] = 'Äang tải xuống bản cập nhật má»›i...';
$messages['loading'] = 'Äang tải...';
$messages['uploading'] = 'Äang tải lên tập tin...';
@@ -42,6 +43,8 @@ $messages['messagesent'] = 'Thư đã được gửi thành công.';
$messages['savingmessage'] = 'Äang lÆ°u thÆ°...';
$messages['messagesaved'] = 'Thư đã được lưu lại vào hộp thư Nháp.';
$messages['successfullysaved'] = 'Äã lÆ°u thành công';
+$messages['savingresponse'] = 'Äang lÆ°u thông tin...';
+$messages['deleteresponseconfirm'] = 'Bạn có thực sự muốn xoá thông tin này?';
$messages['addedsuccessfully'] = 'Liên hệ đã được thêm vào sổ địa chỉ thành công.';
$messages['contactexists'] = 'Liên hệ trùng địa chỉ email đã tồn tại';
$messages['contactnameexists'] = 'Liên hệ trùng tên đã tồn tại.';
@@ -52,6 +55,8 @@ $messages['contactnotfound'] = 'Không tìm thấy liên lạc được yêu cáº
$messages['contactsearchonly'] = 'Gõ một vài từ tìm kiếm để tìm liên hệ';
$messages['sendingfailed'] = 'Không gửi được thư';
$messages['senttooquickly'] = 'Xin đợi vài giây trước khi gửi thư này';
+$messages['errorsavingsent'] = 'Có lỗi xảy ra khi lưu lại thư đã gửi.';
+$messages['errorsaving'] = 'Lỗi trong quá trình lưu.';
$messages['errormoving'] = 'Không thể chuyển được thư';
$messages['errorcopying'] = 'Không thể sao chép thư';
$messages['errordeleting'] = 'Không thể xóa được thư';
@@ -76,6 +81,7 @@ $messages['norecipientwarning'] = 'Xin nhập it nhất 1 ngÆ°á»i nhận.';
$messages['nosubjectwarning'] = 'Mục "Tiêu Ä‘á»" vẫn còn trống. Bạn có muốn nhập tiêu Ä‘á» bây giá» không?';
$messages['nobodywarning'] = 'Gửi thư không có nội dung?';
$messages['notsentwarning'] = 'Thư chưa được gửi. BỠqua thư đang soạn?';
+$messages['restoresavedcomposedata'] = 'Tìm thấy má»™t thÆ° đã được soạn trÆ°á»›c nhÆ°ng chÆ°a gá»­i.\n\nTiêu Ä‘á»: $subject\nLÆ°u ngày: $date\n\nBạn có muốn khôi phục lại thÆ° này?';
$messages['noldapserver'] = 'Chá»n máy chủ ldap server để tìm';
$messages['nosearchname'] = 'Nhập liên hệ hoặc địa chỉ email.';
$messages['notuploadedwarning'] = 'Tất cả các đính kèm vẫn chưa được tải lên hết. Xin đợi hoặc hủy việc tải lên.';
@@ -95,11 +101,16 @@ $messages['converting'] = 'Loại bỠđịnh dạng...';
$messages['messageopenerror'] = 'Không thể tải thư từ máy chủ';
$messages['fileuploaderror'] = 'Tải tập tin lên thất bại';
$messages['filesizeerror'] = 'Tập tin được tải lên vượt quá dung lượng tối đa....';
+$messages['copysuccess'] = 'Sao chép thành công $nr địa chỉ.';
+$messages['movesuccess'] = 'Äã chuyển thành công $nr địa chỉ liên hệ.';
+$messages['copyerror'] = 'Không thể sao chép địa chỉ liên hệ nào.';
+$messages['moveerror'] = 'Không thể chuyển địa chỉ liên hệ nào.';
$messages['sourceisreadonly'] = 'Nguồn địa chỉ này chỉ cho Ä‘á»c';
$messages['errorsavingcontact'] = 'Không thể lưu địa chỉ liên lạc';
$messages['movingmessage'] = 'Äang chuyển thÆ°...';
$messages['copyingmessage'] = 'Äang sao chép thÆ°...';
$messages['copyingcontact'] = 'Äang sao chép liên lạc...';
+$messages['movingcontact'] = 'Äang chuyển (các) địa chỉ liên hệ...';
$messages['deletingmessage'] = 'Äang xóa thÆ°...';
$messages['markingmessage'] = 'Äánh dấu thÆ°...';
$messages['addingmember'] = 'Äang thêm liên lạc vào nhóm...';
@@ -118,6 +129,8 @@ $messages['importwait'] = 'Äang nhập, xin chá»...';
$messages['importformaterror'] = 'Nhập dữ liệu lỗi. Tệp tin vừa tải lên không phải tệp dữ liệu chính xác.';
$messages['importconfirm'] = 'Äã nhập $inserted liên hệ đã chèn vào thành công.';
$messages['importconfirmskipped'] = 'Äã bá» qua được $skipped mục tồn tại.';
+$messages['importmessagesuccess'] = 'Äã nhập thành công $nr thÆ°.';
+$messages['importmessageerror'] = 'Nhập dữ liệu bị lỗi. Tệp tin vừa tải lên không có định dạng chính xác của tệp cấu hình hòm thư hoặc một thư đơn lẻ.';
$messages['opnotpermitted'] = 'Thao tác không được cho phép!';
$messages['nofromaddress'] = 'Äịa chỉ email mất ở trong nhận dạng đã chá»n';
$messages['editorwarning'] = 'Việc chuyển soạn thảo text gốc sẽ gây ra toàn bộ định dạng text đã có bị mất. Bạn có muốn tiếp tục không?';
@@ -131,6 +144,7 @@ $messages['smtperror'] = 'Lá»—i SMTP: $msg';
$messages['emailformaterror'] = 'Äịa chỉ email không hợp lệ';
$messages['toomanyrecipients'] = 'Quá nhiá»u ngÆ°á»i nhận. Hãy giảm số lượng ngÆ°á»i nhận xuống tối Ä‘a là $max.';
$messages['maxgroupmembersreached'] = 'Số lượng thành viên trong nhóm vượt quá mức tối đa là $max.';
+$messages['internalerror'] = 'Xuất hiện một lỗi nội bộ. Xin hãy thử lại';
$messages['contactdelerror'] = 'Không thể xóa liên lạc';
$messages['contactdeleted'] = 'Liên lạc được xóa thành công';
$messages['contactrestoreerror'] = 'Không thể khôi phục liên lạc đã xóa';
diff --git a/program/localization/zh_CN/labels.inc b/program/localization/zh_CN/labels.inc
index 1d9c04733..c3b14396c 100644
--- a/program/localization/zh_CN/labels.inc
+++ b/program/localization/zh_CN/labels.inc
@@ -29,6 +29,7 @@ $labels['drafts'] = 'è‰ç¨¿ç®±';
$labels['sent'] = 'å·²å‘é€é‚®ä»¶';
$labels['trash'] = '已删除邮件';
$labels['junk'] = '垃圾邮件';
+$labels['show_real_foldernames'] = '显示特殊文件夹的åå­—';
$labels['subject'] = '主题';
$labels['from'] = 'å‘件人';
$labels['sender'] = 'å‘件人';
@@ -165,6 +166,7 @@ $labels['listmode'] = '列表视图样å¼';
$labels['folderactions'] = '文件夹æ“作...';
$labels['compact'] = '压缩';
$labels['empty'] = '清空';
+$labels['importmessages'] = '导入邮件';
$labels['quota'] = '邮箱容é‡';
$labels['unknown'] = '未知';
$labels['unlimited'] = 'æ— é™åˆ¶';
@@ -173,6 +175,8 @@ $labels['resetsearch'] = '清空';
$labels['searchmod'] = '修改æœç´¢';
$labels['msgtext'] = 'æ•´å°é‚®ä»¶';
$labels['body'] = '正文';
+$labels['type'] = '类型:';
+$labels['namex'] = '姓å';
$labels['openinextwin'] = '在新窗å£ä¸­æ‰“å¼€';
$labels['emlsave'] = '下载(.eml)';
$labels['changeformattext'] = '以文本格å¼æ˜¾ç¤º';
@@ -193,6 +197,16 @@ $labels['spellcheck'] = '拼写';
$labels['checkspelling'] = '拼写检查';
$labels['resumeediting'] = '继续编辑';
$labels['revertto'] = 'æ¢å¤è‡³';
+$labels['restore'] = 'æ¢å¤ä¿¡æ¯';
+$labels['restoremessage'] = '是å¦æ¢å¤ä¿¡æ¯ï¼Ÿ';
+$labels['responses'] = '回å¤';
+$labels['insertresponse'] = 'æ’入回å¤';
+$labels['manageresponses'] = '管ç†å›žå¤';
+$labels['savenewresponse'] = 'ä¿å­˜æ–°å›žå¤';
+$labels['editresponses'] = '编辑回å¤';
+$labels['editresponse'] = '编辑回å¤';
+$labels['responsename'] = '姓å';
+$labels['responsetext'] = '以文本形å¼å›žå¤';
$labels['attach'] = '附加';
$labels['attachments'] = '附件';
$labels['upload'] = '上传';
@@ -305,13 +319,18 @@ $labels['nextpage'] = '下一页';
$labels['lastpage'] = '末页';
$labels['group'] = '分组';
$labels['groups'] = '分组';
+$labels['listgroup'] = '列出è”系人åå•';
$labels['personaladrbook'] = '个人通讯录';
$labels['searchsave'] = 'ä¿å­˜æœç´¢';
$labels['searchdelete'] = '删除æœç´¢';
$labels['import'] = '导入';
$labels['importcontacts'] = '导入通讯录';
$labels['importfromfile'] = '从文件导入';
+$labels['importtarget'] = '添加è”系人至';
$labels['importreplace'] = '替æ¢å…¨éƒ¨é€šè®¯å½•';
+$labels['importgroups'] = '导入群组任务';
+$labels['importgroupsall'] = '全部(如果需è¦åˆ™åˆ›å»ºæ–°çš„群组)';
+$labels['importgroupsexisting'] = 'ä»…é™äºŽå·²æœ‰ç¾¤ç»„';
$labels['importdesc'] = '您å¯ä»¥ä»Žé€šè®¯å½•æ–‡ä»¶ä¸Šä¼ è”系人,目å‰å·²æ”¯æŒ <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> å’Œ CSV(逗å·åˆ†éš”)æ ¼å¼';
$labels['done'] = '完æˆ';
$labels['settingsfor'] = '设置';
@@ -415,9 +434,13 @@ $labels['spellcheckignorenums'] = '忽略带数字的å•è¯';
$labels['spellcheckignorecaps'] = '忽略所有大写字æ¯çš„å•è¯';
$labels['addtodict'] = '添加到字典中';
$labels['mailtoprotohandler'] = 'æ³¨å†Œä¸ºå¤„ç† mailto 链接的程åº';
+$labels['standardwindows'] = '以标准窗å£çš„å½¢å¼å¼¹å‡ºçª—å£';
$labels['forwardmode'] = '邮件转å‘æ–¹å¼';
$labels['inline'] = '内嵌';
$labels['asattachment'] = '作为附件';
+$labels['replyallmode'] = '[回å¤æ‰€æœ‰]按钮的默认动作';
+$labels['replyalldefault'] = '回å¤å…¨éƒ¨';
+$labels['replyalllist'] = 'åªå›žå¤é‚®ä»¶åˆ—表中的è”系人(找到的)';
$labels['folder'] = '文件夹管ç†';
$labels['folders'] = '文件夹管ç†';
$labels['foldername'] = '邮件夹å称';
diff --git a/program/localization/zh_CN/messages.inc b/program/localization/zh_CN/messages.inc
index bf6e8cf2f..4adebcc74 100644
--- a/program/localization/zh_CN/messages.inc
+++ b/program/localization/zh_CN/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,6 @@ $messages['invalidrequest'] = '请求无效ï¼æœªä¿å­˜æ•°æ®ã€‚';
$messages['invalidhost'] = '无效的主机å。';
$messages['nomessagesfound'] = '此邮件夹内无邮件。';
$messages['loggedout'] = '您已æˆåŠŸæ³¨é”€ï¼Œå†è§ï¼';
-$messages['mailboxempty'] = '邮件夹为空。';
$messages['refreshing'] = '正在刷新...';
$messages['loading'] = '正在载入...';
$messages['uploading'] = '正在上传文件...';
@@ -44,6 +43,8 @@ $messages['messagesent'] = '邮件已å‘é€ã€‚';
$messages['savingmessage'] = '正在ä¿å­˜é‚®ä»¶...';
$messages['messagesaved'] = '邮件已暂存至è‰ç¨¿ç®±ã€‚';
$messages['successfullysaved'] = 'ä¿å­˜æˆåŠŸã€‚';
+$messages['savingresponse'] = '正在ä¿å­˜å“应文本...';
+$messages['deleteresponseconfirm'] = '是å¦ç¡®è®¤åˆ é™¤å“应文本?';
$messages['addedsuccessfully'] = 'è”系人已添加。';
$messages['contactexists'] = '当å‰è”系人的电å­é‚®ä»¶åœ°å€å·²å­˜åœ¨ã€‚';
$messages['contactnameexists'] = '已存在åŒåè”系人。';
@@ -54,6 +55,8 @@ $messages['contactnotfound'] = '未找到指定的è”系人。';
$messages['contactsearchonly'] = '请输入è”系人的æœç´¢æ¡ä»¶';
$messages['sendingfailed'] = 'å‘é€å¤±è´¥ã€‚';
$messages['senttooquickly'] = '您需è¦ç­‰å¾…$sec秒æ‰èƒ½å‘é€é‚®ä»¶ã€‚';
+$messages['errorsavingsent'] = 'ä¿å­˜å·²å‘é€é‚®ä»¶æ—¶å‘生错误。';
+$messages['errorsaving'] = 'ä¿å­˜æ—¶å‘生错误。';
$messages['errormoving'] = '无法移动邮件。';
$messages['errorcopying'] = '无法å¤åˆ¶é‚®ä»¶ã€‚';
$messages['errordeleting'] = '无法删除邮件。';
@@ -78,6 +81,7 @@ $messages['norecipientwarning'] = '至少输入一个收件人。';
$messages['nosubjectwarning'] = '主题为空。您è¦è¾“入一个主题å—?';
$messages['nobodywarning'] = 'è¦å‘é€æ²¡æœ‰æ­£æ–‡çš„邮件å—?';
$messages['notsentwarning'] = '邮件未å‘é€ã€‚您确定è¦ç¦»å¼€å¹¶èˆå¼ƒå½“å‰é‚®ä»¶å—?';
+$messages['restoresavedcomposedata'] = '您有一å°é‚®ä»¶å°šæœªå‘é€.\n\nSubject: $subject\nSaved: $date\n\n您是å¦è¦æ¢å¤è¿™å°é‚®ä»¶ï¼Ÿ';
$messages['noldapserver'] = '请选择一个用æ¥æŸ¥æ‰¾çš„ LDAP æœåŠ¡å™¨ã€‚';
$messages['nosearchname'] = '请输入è”系人姓å或电å­é‚®ä»¶åœ°å€ã€‚';
$messages['notuploadedwarning'] = '附件尚未全部上传,请è€å¿ƒç­‰å¾…或者å–消上传。';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'SMTP 错误: $msg';
$messages['emailformaterror'] = '无效的邮件地å€ï¼š$email';
$messages['toomanyrecipients'] = '收件人太多,请å‡å°‘人数至 $max。';
$messages['maxgroupmembersreached'] = '组员数é‡è¶…过最大值 $max。';
+$messages['internalerror'] = 'é‡åˆ°ä¸€ä¸ªå†…部错误,请é‡è¯•ã€‚';
$messages['contactdelerror'] = '无法删除è”系人。';
$messages['contactdeleted'] = '删除è”系人æˆåŠŸã€‚';
$messages['contactrestoreerror'] = '无法æ¢å¤å·²åˆ é™¤çš„è”系人。';
diff --git a/program/localization/zh_TW/labels.inc b/program/localization/zh_TW/labels.inc
index 4250e5137..e913f7117 100644
--- a/program/localization/zh_TW/labels.inc
+++ b/program/localization/zh_TW/labels.inc
@@ -37,7 +37,7 @@ $labels['to'] = '收件者';
$labels['cc'] = '副本';
$labels['bcc'] = '密件副本';
$labels['replyto'] = '回覆至';
-$labels['followupto'] = '信件跟隨至';
+$labels['followupto'] = '郵件列表回覆地å€';
$labels['date'] = '日期';
$labels['size'] = '大å°';
$labels['priority'] = '優先順åº';
@@ -45,13 +45,14 @@ $labels['organization'] = '組織';
$labels['readstatus'] = '讀信狀態';
$labels['listoptions'] = '列表é¸é …...';
$labels['mailboxlist'] = '資料夾';
-$labels['messagesfromto'] = '郵件 $from 至 $to,共有 $count å°éƒµä»¶';
-$labels['threadsfromto'] = '郵件串 $from 至 $to,共有 $count 個';
+$labels['messagesfromto'] = '郵件 $from 至 $to,共 $count å°';
+$labels['threadsfromto'] = '郵件串 $from 至 $to,共 $count 個';
$labels['messagenrof'] = '第 $nr å°éƒµä»¶ï¼Œå…±æœ‰ $count å°';
-$labels['fromtoshort'] = '自 $from – $to 統計 $count';
+$labels['fromtoshort'] = '$from – $to 共 $count 個';
$labels['copy'] = '複製';
$labels['move'] = '移動';
$labels['moveto'] = '移至...';
+$labels['copyto'] = '複製到...';
$labels['download'] = '下載';
$labels['open'] = 'é–‹å•Ÿ';
$labels['showattachment'] = '顯示';
@@ -148,7 +149,7 @@ $labels['expand-all'] = '全部展開';
$labels['expand-unread'] = '展開未讀å–';
$labels['collapse-all'] = '全部收起';
$labels['threaded'] = '郵件串';
-$labels['autoexpand_threads'] = 'åªå±•é–‹éƒµä»¶ä¸²';
+$labels['autoexpand_threads'] = '展開郵件串';
$labels['do_expand'] = '所有郵件串';
$labels['expand_only_unread'] = 'åªå±•é–‹æœªè®€è¨Šæ¯';
$labels['fromto'] = '寄件者/收件者';
@@ -175,6 +176,7 @@ $labels['resetsearch'] = 'é‡è¨­æœå°‹';
$labels['searchmod'] = '修改æœå°‹';
$labels['msgtext'] = 'æ•´å°éƒµä»¶';
$labels['body'] = '內文';
+$labels['type'] = 'é¡žåž‹';
$labels['namex'] = 'å稱';
$labels['openinextwin'] = '在新視窗開啟';
$labels['emlsave'] = '下載(.eml)';
@@ -184,7 +186,7 @@ $labels['editasnew'] = '以新郵件編輯';
$labels['send'] = '寄出';
$labels['sendmessage'] = 'ç«‹å³å¯„出';
$labels['savemessage'] = '儲存æˆè‰ç¨¿';
-$labels['addattachment'] = '增加附件檔案';
+$labels['addattachment'] = '加入附件檔案';
$labels['charset'] = '郵件編碼';
$labels['editortype'] = '編輯器類型';
$labels['returnreceipt'] = 'è¦æ±‚讀å–回æ¢';
@@ -196,6 +198,16 @@ $labels['spellcheck'] = '拼字';
$labels['checkspelling'] = '拼字檢查';
$labels['resumeediting'] = '繼續編輯';
$labels['revertto'] = 'æ¢å¾©è‡³';
+$labels['restore'] = '回復';
+$labels['restoremessage'] = '回復郵件?';
+$labels['responses'] = 'é è¨­å›žæ‡‰';
+$labels['insertresponse'] = 'æ’å…¥é è¨­å›žæ‡‰';
+$labels['manageresponses'] = '管ç†é è¨­å›žæ‡‰';
+$labels['savenewresponse'] = '新增é è¨­å›žæ‡‰';
+$labels['editresponses'] = '編輯é è¨­å›žæ‡‰';
+$labels['editresponse'] = 'é è¨­å›žæ‡‰';
+$labels['responsename'] = 'å稱';
+$labels['responsetext'] = 'é è¨­å›žæ‡‰å…§å®¹';
$labels['attach'] = '附件';
$labels['attachments'] = '附加檔案';
$labels['upload'] = '上傳';
@@ -222,7 +234,7 @@ $labels['maxuploadsize'] = '上傳檔案大å°é™åˆ¶ç‚º $size';
$labels['addcc'] = '新增副本';
$labels['addbcc'] = '新增密件副本';
$labels['addreplyto'] = '新增回覆地å€';
-$labels['addfollowupto'] = '新增 信件跟隨至';
+$labels['addfollowupto'] = '新增郵件列表回覆地å€';
$labels['mdnrequest'] = '此郵件的寄件者希望在你閱讀此郵件時å—到通知。你想è¦é€šçŸ¥å¯„件者嗎?';
$labels['receiptread'] = '郵件回æ¢ï¼ˆå·²é–±è®€ï¼‰';
$labels['yourmessage'] = '這是你郵件的郵件回æ¢';
@@ -259,7 +271,7 @@ $labels['spouse'] = 'é…å¶';
$labels['allfields'] = '所有欄ä½';
$labels['search'] = 'æœå°‹';
$labels['advsearch'] = '進階æœå°‹';
-$labels['advanced'] = '進階設定';
+$labels['advanced'] = '進階';
$labels['other'] = '其他';
$labels['typehome'] = 'ä½å®¶';
$labels['typework'] = '工作';
@@ -292,7 +304,7 @@ $labels['uploadphoto'] = '上傳相片';
$labels['newcontact'] = '建立新è¯çµ¡äººè³‡æ–™';
$labels['deletecontact'] = '刪除所é¸æ“‡çš„è¯çµ¡äºº';
$labels['composeto'] = '寄信至所é¸æ“‡çš„è¯çµ¡äºº';
-$labels['contactsfromto'] = 'è¯çµ¡äºº $from 至 $to,共有 $count 人';
+$labels['contactsfromto'] = 'è¯çµ¡äºº $from 至 $to,共 $count 人';
$labels['print'] = '列å°';
$labels['export'] = '匯出通訊錄';
$labels['exportall'] = '匯出全部';
@@ -308,16 +320,19 @@ $labels['nextpage'] = '顯示下一é ';
$labels['lastpage'] = '顯示最後一é ';
$labels['group'] = '群組';
$labels['groups'] = '群組';
+$labels['listgroup'] = '列出群組æˆå“¡';
$labels['personaladrbook'] = '個人通訊錄';
$labels['searchsave'] = '儲存æœå°‹çµæžœ';
$labels['searchdelete'] = '刪除æœå°‹çµæžœ';
$labels['import'] = '匯入通訊錄';
-$labels['importcontacts'] = '由檔案匯入通訊錄';
+$labels['importcontacts'] = '匯入通訊錄';
$labels['importfromfile'] = 'é¸æ“‡ä½ è¦åŒ¯å…¥çš„檔案:';
-$labels['importreplace'] = '以匯入的資料å–代已存在的é‡è¤‡è³‡æ–™';
-$labels['importgroupsall'] = '全部(如有必è¦,新增群組)';
+$labels['importtarget'] = '新增è¯çµ¡äººåˆ°';
+$labels['importreplace'] = 'å–代整個';
+$labels['importgroups'] = '匯入群組';
+$labels['importgroupsall'] = '全部(å¿…è¦æ™‚新增群組)';
$labels['importgroupsexisting'] = '僅é™æ–¼æ—¢æœ‰ç¾¤çµ„';
-$labels['importdesc'] = '您å¯ä»¥å°‡å·²å­˜åœ¨çš„資料匯入通訊錄,目å‰æ”¯æ´åŒ¯å…¥ <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> 與 CSV (逗點分隔)æ ¼å¼è³‡æ–™';
+$labels['importdesc'] = '您å¯ä»¥å°‡ç¾æœ‰çš„è¯çµ¡äººåŒ¯å…¥é€šè¨ŠéŒ„。<br/>ç›®å‰æ”¯æ´åŒ¯å…¥ <a href="http://en.wikipedia.org/wiki/VCard">vCard</a> 與 CSV (逗點分隔)æ ¼å¼ã€‚';
$labels['done'] = '完æˆ';
$labels['settingsfor'] = '設定';
$labels['about'] = '關於';
@@ -341,7 +356,7 @@ $labels['setdefault'] = '設æˆé è¨­å€¼';
$labels['autodetect'] = '自動é¸æ“‡';
$labels['language'] = '語言';
$labels['timezone'] = '時å€';
-$labels['pagesize'] = 'æ¯é éƒµä»¶æ•¸';
+$labels['pagesize'] = 'æ¯é é¡¯ç¤ºåˆ—數';
$labels['signature'] = 'ç°½å檔';
$labels['dstactive'] = '日光節約時間';
$labels['showinextwin'] = '在新視窗中顯示郵件';
@@ -359,23 +374,23 @@ $labels['uisettings'] = '使用者介é¢';
$labels['serversettings'] = '伺æœå™¨è¨­å®š';
$labels['mailboxview'] = '信箱顯示';
$labels['mdnrequests'] = '讀å–回æ¢å›žæ‡‰';
-$labels['askuser'] = 'è©¢å•ä½¿ç”¨è€…';
+$labels['askuser'] = 'è©¢å•æˆ‘';
$labels['autosend'] = '自動é€å‡º';
-$labels['autosendknown'] = 'åªå°æˆ‘çš„è¯çµ¡äººå‚³é€å›žæ¢ï¼Œå…¶ä»–è©¢å•ä½¿ç”¨è€…';
-$labels['autosendknownignore'] = 'åªå°æˆ‘çš„è¯çµ¡äººå‚³é€å›žæ¢ï¼Œå…¶ä»–忽略';
+$labels['autosendknown'] = '傳é€å›žæ¢çµ¦æˆ‘çš„è¯çµ¡äººï¼Œå…¶ä»–則詢å•æˆ‘';
+$labels['autosendknownignore'] = '傳é€å›žæ¢çµ¦æˆ‘çš„è¯çµ¡äººï¼Œå…¶ä»–則忽略';
$labels['ignore'] = '完全忽略';
$labels['readwhendeleted'] = '將刪除的郵件標示為已讀å–';
-$labels['flagfordeletion'] = '刪除郵件時將原始郵件標示為已刪除';
+$labels['flagfordeletion'] = '刪除郵件時åªå°‡éƒµä»¶æ¨™ç¤ºç‚ºå·²åˆªé™¤';
$labels['skipdeleted'] = 'ä¸è¦é¡¯ç¤ºå·²åˆªé™¤çš„郵件';
-$labels['deletealways'] = '如果移到垃圾桶失敗,就直接刪除';
-$labels['deletejunk'] = '直接從垃圾郵件刪除';
+$labels['deletealways'] = '如果移動郵件到垃圾桶失敗,就直接刪除';
+$labels['deletejunk'] = '直接刪除垃圾郵件中的郵件';
$labels['showremoteimages'] = '顯示é ç«¯éƒµä»¶å…§æ–‡ä¸­çš„圖片';
$labels['fromknownsenders'] = '從已知的寄件者';
$labels['always'] = '是';
$labels['showinlineimages'] = '將附加檔案的圖片顯示於郵件最後';
$labels['autosavedraft'] = '自動儲存è‰ç¨¿';
$labels['everynminutes'] = 'æ¯ $n 分é˜';
-$labels['refreshinterval'] = 'é‡æ–°æ•´ç† (確èªæ˜¯å¦æ–°éƒµä»¶)';
+$labels['refreshinterval'] = 'é‡æ–°æ•´ç† (檢查新郵件等)';
$labels['never'] = 'æ°¸ä¸';
$labels['immediately'] = '馬上';
$labels['messagesdisplaying'] = '郵件顯示';
@@ -385,10 +400,10 @@ $labels['2231folding'] = '完全 RFC 2231 模å¼ï¼ˆThunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 æ··åˆæ¨¡å¼ï¼ˆMS Outlook)';
$labels['2047folding'] = '完全 RFC 2047 模å¼ï¼ˆå…¶ä»–)';
$labels['force7bit'] = 'å° 8 ä½å…ƒå­—元使用 MIME 編碼';
-$labels['advancedoptions'] = '顯示進階設定é¸é …';
+$labels['advancedoptions'] = '進階é¸é …';
$labels['focusonnewmessage'] = '收到新郵件時使ç€è¦½å™¨ç²å¾—焦點';
$labels['checkallfolders'] = '檢查所有資料夾中的新郵件';
-$labels['displaynext'] = '郵件刪除ï¼ç§»å‹•æ™‚顯示下一個郵件';
+$labels['displaynext'] = '郵件刪除/移動時顯示下一å°éƒµä»¶';
$labels['defaultfont'] = 'HTMLæ ¼å¼é è¨­å­—åž‹';
$labels['mainoptions'] = '主è¦é¸é …';
$labels['browseroptions'] = 'ç€è¦½é¸é …';
@@ -398,8 +413,8 @@ $labels['newmessage'] = '新郵件';
$labels['signatureoptions'] = 'ç°½å檔é¸é …';
$labels['whenreplying'] = '回覆時';
$labels['replyempty'] = 'ä¸è¦åŒ…å«åŽŸä¾†çš„信件內容';
-$labels['replytopposting'] = '在原來的上方開始新訊æ¯';
-$labels['replybottomposting'] = '在原來的下方開始新訊æ¯';
+$labels['replytopposting'] = '在原文的上方開始新訊æ¯';
+$labels['replybottomposting'] = '在原文的下方開始新訊æ¯';
$labels['replyremovesignature'] = '回覆時移除原有簽å檔';
$labels['autoaddsignature'] = '自動附加簽å';
$labels['newmessageonly'] = 'åªæœ‰æ–°è¨Šæ¯';
@@ -411,18 +426,22 @@ $labels['reqmdn'] = 'æ°¸é ç´¢å–讀å–回æ¢';
$labels['reqdsn'] = '總是è¦æ±‚傳é€ç‹€æ…‹é€šçŸ¥';
$labels['replysamefolder'] = '將回信放在與原信件相åŒçš„資料夾';
$labels['defaultabook'] = 'é è¨­é€šè¨ŠéŒ„';
-$labels['autocompletesingle'] = '在自動完æˆä¸­ç•¥éŽå¦ä¸€å€‹email';
-$labels['listnamedisplay'] = '標記è¯çµ¡äººç‚º';
+$labels['autocompletesingle'] = '在自動完æˆæ™‚ç•¥éŽå…¶ä»–電郵地å€';
+$labels['listnamedisplay'] = 'è¯çµ¡äººé¡¯ç¤ºæ–¹å¼';
$labels['spellcheckbeforesend'] = '寄é€å‰åŸ·è¡Œæ‹¼å­—檢查';
$labels['spellcheckoptions'] = '拼字檢查é¸é …';
$labels['spellcheckignoresyms'] = '忽略符號';
$labels['spellcheckignorenums'] = '忽略數字';
$labels['spellcheckignorecaps'] = '忽略大寫字æ¯';
$labels['addtodict'] = '加入詞典';
-$labels['mailtoprotohandler'] = '註冊mailto:å”定處ç†ç¨‹å¼';
+$labels['mailtoprotohandler'] = '註冊為 mailto: 連çµçš„é è¨­è™•ç†å¸¸å¼';
+$labels['standardwindows'] = '以新視窗顯示彈出å¼å°è©±æ¡†';
$labels['forwardmode'] = '郵件轉寄方å¼';
$labels['inline'] = '放入內文';
$labels['asattachment'] = '當æˆé™„件';
+$labels['replyallmode'] = '「全部回覆ã€æŒ‰éˆ•çš„é è¨­å‹•ä½œ';
+$labels['replyalldefault'] = '全部回覆';
+$labels['replyalllist'] = 'åªå›žè¦†éƒµä»¶åˆ—表 (如有)';
$labels['folder'] = '資料夾';
$labels['folders'] = '資料夾';
$labels['foldername'] = '資料夾å稱';
diff --git a/program/localization/zh_TW/messages.inc b/program/localization/zh_TW/messages.inc
index c52116a55..430ad16d1 100644
--- a/program/localization/zh_TW/messages.inc
+++ b/program/localization/zh_TW/messages.inc
@@ -5,7 +5,7 @@
| localization/<lang>/messages.inc |
| |
| Localization file of the Roundcube Webmail client |
- | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -32,7 +32,6 @@ $messages['invalidrequest'] = 'è¦æ±‚無效ï¼æœªå„²å­˜ä»»ä½•è³‡æ–™ã€‚';
$messages['invalidhost'] = '無效的伺æœå™¨å稱';
$messages['nomessagesfound'] = '此郵件匣沒有任何郵件';
$messages['loggedout'] = 'ä½ å·²æˆåŠŸåœ°ç™»å‡ºä¸¦çµæŸå·¥ä½œéšŽæ®µäº†ã€‚å†è¦‹ï¼';
-$messages['mailboxempty'] = '郵件匣是空的';
$messages['refreshing'] = 'é‡æ–°æ•´ç†ä¸­...';
$messages['loading'] = '載入中...';
$messages['uploading'] = '上傳檔案中...';
@@ -44,6 +43,8 @@ $messages['messagesent'] = '郵件寄出æˆåŠŸ';
$messages['savingmessage'] = '儲存郵件中...';
$messages['messagesaved'] = '郵件已經儲存至è‰ç¨¿åŒ£';
$messages['successfullysaved'] = '儲存æˆåŠŸ';
+$messages['savingresponse'] = '儲存é è¨­å›žæ‡‰ä¸­...';
+$messages['deleteresponseconfirm'] = '你確定è¦åˆªé™¤é€™å€‹é è¨­å›žæ‡‰å—Žï¼Ÿ';
$messages['addedsuccessfully'] = 'è¯çµ¡äººå·²ç¶“æˆåŠŸåœ°æ–°å¢žè‡³é€šè¨ŠéŒ„';
$messages['contactexists'] = 'æ­¤è¯çµ¡äººçš„é›»å­éƒµä»¶ä½å€å·²å­˜åœ¨';
$messages['contactnameexists'] = '已存在相åŒå稱的連絡人';
@@ -54,6 +55,8 @@ $messages['contactnotfound'] = '找ä¸åˆ°è¦æ±‚çš„è¯çµ¡äºº';
$messages['contactsearchonly'] = '輸入關éµå­—找尋連絡人';
$messages['sendingfailed'] = '郵件寄出失敗';
$messages['senttooquickly'] = '你寄出的郵件太éŽæ–¼é »ç¹ï¼Œè«‹ç¨å€™ $sec 秒後å†è©¦ä¸€æ¬¡ã€‚';
+$messages['errorsavingsent'] = '儲存郵件到寄件備份時發生錯誤。';
+$messages['errorsaving'] = '儲存時發生錯誤。';
$messages['errormoving'] = '無法移動此郵件';
$messages['errorcopying'] = '無法訊æ¯';
$messages['errordeleting'] = '無法刪除此郵件';
@@ -78,6 +81,7 @@ $messages['norecipientwarning'] = '請輸入至少一ä½æ”¶ä¿¡è€…';
$messages['nosubjectwarning'] = '「主旨ã€æ¬„是空的。你è¦è¼¸å…¥ä¸€å€‹ä¸»æ—¨å—Žï¼Ÿ';
$messages['nobodywarning'] = 'è¦å‚³é€æ²’有內文的郵件嗎?';
$messages['notsentwarning'] = '郵件尚未寄出。你確定è¦é›¢é–‹ä¸¦ä¸”æ¨æ£„此郵件?';
+$messages['restoresavedcomposedata'] = '發ç¾ä¸€å°ä¸Šæ¬¡ç·¨å¯«ä½†å°šæœªå¯„出的郵件。\n\n主旨: $subject\n日期: $date\n\nä½ è¦å›žå¾©é€™å°éƒµä»¶å—Žï¼Ÿ';
$messages['noldapserver'] = 'è«‹é¸æ“‡ä¸€å€‹ LDAP 伺æœå™¨é€²è¡Œæœå°‹';
$messages['nosearchname'] = '請輸入一個è¯çµ¡äººå§“å或電å­éƒµä»¶ä½å€';
$messages['notuploadedwarning'] = '尚有附加檔案未上傳完畢,請等待或å–消上傳';
@@ -95,8 +99,8 @@ $messages['folderexpunged'] = '資料夾æˆåŠŸå£“縮';
$messages['deletedsuccessfully'] = '刪除æˆåŠŸ';
$messages['converting'] = '移除郵件格å¼ä¸­...';
$messages['messageopenerror'] = '無法從伺æœå™¨è¼‰å…¥éƒµä»¶';
-$messages['fileuploaderror'] = '檔案上傳失敗';
-$messages['filesizeerror'] = '上傳的檔案超éŽäº† $size 的大å°é™åˆ¶';
+$messages['fileuploaderror'] = '檔案上傳失敗。';
+$messages['filesizeerror'] = '上傳的檔案超éŽäº† $size 的大å°é™åˆ¶ã€‚';
$messages['copysuccess'] = 'æˆåŠŸè¤‡è£½ $nr 個è¯çµ¡äººã€‚';
$messages['movesuccess'] = 'æˆåŠŸç§»å‹• $nr 個è¯çµ¡äººã€‚';
$messages['copyerror'] = '無法複製任何è¯çµ¡äººã€‚';
@@ -116,17 +120,17 @@ $messages['errorsendingreceipt'] = '無法傳é€å›žæ¢';
$messages['deleteidentityconfirm'] = '您確定è¦åˆªé™¤é€™ä½é€£çµ¡äººå—Ž?';
$messages['nodeletelastidentity'] = 'ä½ ä¸èƒ½åˆªé™¤æ­¤èº«ä»½ï¼Œå› ç‚ºåªå‰©ä¸€å€‹èº«ä»½ã€‚';
$messages['forbiddencharacter'] = '資料夾å稱中包å«éžæ³•çš„å­—å…ƒ';
-$messages['selectimportfile'] = 'è«‹é¸æ“‡ä¸€å€‹ä¸Šå‚³çš„檔案';
+$messages['selectimportfile'] = 'è«‹é¸æ“‡ä¸€å€‹è¦ä¸Šå‚³çš„檔案。';
$messages['addresswriterror'] = '無法寫入é¸æ“‡çš„通訊錄';
$messages['contactaddedtogroup'] = 'æˆåŠŸæŠŠè¯çµ¡äººåŠ å…¥æ­¤ç¾¤çµ„';
$messages['contactremovedfromgroup'] = 'æˆåŠŸæŠŠç§»é™¤æ­¤ç¾¤çµ„中的è¯çµ¡äºº';
$messages['nogroupassignmentschanged'] = '群組資料沒有異動';
$messages['importwait'] = '匯入中,請ç¨å€™...';
-$messages['importformaterror'] = '匯入失敗ï¼ä¸Šè¼‰çš„檔案格å¼ä¸æ”¯æ´';
+$messages['importformaterror'] = '匯入失敗ï¼ä¸æ”¯æ´ä¸Šè¼‰çš„檔案格å¼ã€‚';
$messages['importconfirm'] = '<b>æˆåŠŸåŒ¯å…¥ $inserted ç­†è³‡æ–™ï¼Œç•¥éŽ $skipped 筆已存在的資料</b>:<p><em>$names</em></p>';
$messages['importconfirmskipped'] = '<b>ç•¥éŽ $skipped 個已存在的項目</b>';
$messages['importmessagesuccess'] = 'æˆåŠŸåŒ¯å…¥ $nr å°éƒµä»¶';
-$messages['importmessageerror'] = '匯入失敗ï¼ä¸Šè¼‰çš„檔案ä¸æ˜¯æœ‰æ•ˆçš„郵件或資料夾檔案';
+$messages['importmessageerror'] = '匯入失敗ï¼ä¸Šè¼‰çš„檔案ä¸æ˜¯æœ‰æ•ˆçš„郵件或資料夾檔案。';
$messages['opnotpermitted'] = 'ä¸å…許的æ“作';
$messages['nofromaddress'] = '在é¸æ“‡çš„身分中éºå¤±äº†é›»å­éƒµä»¶ä½å€';
$messages['editorwarning'] = '切æ›åˆ°ç´”文字編輯模å¼å°‡æœƒéºå¤±æ‰€æœ‰è¨­å®šçš„樣å¼ã€‚您確定è¦ç¹¼çºŒå—Žï¼Ÿ';
@@ -140,6 +144,7 @@ $messages['smtperror'] = 'SMTP 錯誤:$msg';
$messages['emailformaterror'] = '錯誤電å­éƒµä»¶ï¼š$email';
$messages['toomanyrecipients'] = '太多收件人。請減少至 $max 人';
$messages['maxgroupmembersreached'] = '太多群組æˆå“¡ï¼Œè¶…éŽæœ€å¤§äººæ•¸ $max 人';
+$messages['internalerror'] = '發生內部錯誤。請å†æ¬¡å˜—試。';
$messages['contactdelerror'] = '無法刪除è¯çµ¡äºº';
$messages['contactdeleted'] = 'è¯çµ¡äººæˆåŠŸåˆªé™¤';
$messages['contactrestoreerror'] = '無法復原刪除的連絡人';
diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc
index d4387194a..9114cb1fd 100644
--- a/program/steps/addressbook/copy.inc
+++ b/program/steps/addressbook/copy.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/copy.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2007, The Roundcube Dev Team |
+ | Copyright (C) 2007-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -25,15 +25,14 @@ if (!$OUTPUT->ajax_call)
$cids = rcmail_get_cids();
-$target = get_input_value('_to', RCUBE_INPUT_POST);
-$target_group = get_input_value('_togid', RCUBE_INPUT_POST);
+$target = rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST);
+$target_group = rcube_utils::get_input_value('_togid', rcube_utils::INPUT_POST);
$success = 0;
$errormsg = 'copyerror';
$maxnum = $RCMAIL->config->get('max_group_members', 0);
-foreach ($cids as $source => $cid)
-{
+foreach ($cids as $source => $cid) {
// Something wrong, target not specified
if (!strlen($target)) {
break;
diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc
index 3bb2ef500..3d57d7074 100644
--- a/program/steps/addressbook/delete.inc
+++ b/program/steps/addressbook/delete.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/delete.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -30,8 +30,7 @@ $delcnt = 0;
$undo_time = $RCMAIL->config->get('undo_timeout', 0);
$RCMAIL->session->remove('contact_undo');
-foreach ($cids as $source => $cid)
-{
+foreach ($cids as $source => $cid) {
$CONTACTS = rcmail_contact_source($source);
if ($CONTACTS->readonly) {
@@ -51,8 +50,21 @@ foreach ($cids as $source => $cid)
$deleted = !$plugin['abort'] ? $CONTACTS->delete($cid, $undo_time < 1) : $plugin['result'];
if (!$deleted) {
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'contactdelerror', 'error');
- $OUTPUT->command('list_contacts');
+ if ($plugin['message']) {
+ $error = $plugin['message'];
+ }
+ else if (($error = $CONTACTS->get_error()) && $error['message']) {
+ $error = $error['message'];
+ }
+ else {
+ $error = 'contactdelerror';
+ }
+
+ $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
+ $group = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC);
+
+ $OUTPUT->show_message($error, 'error');
+ $OUTPUT->command('list_contacts', $source, $group);
$OUTPUT->send();
}
else {
@@ -113,8 +125,8 @@ $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result));
if (!empty($_SESSION['contact_undo'])) {
$_SESSION['contact_undo']['ts'] = time();
- $msg = html::span(null, rcube_label('contactdeleted'))
- . ' ' . html::a(array('onclick' => JS_OBJECT_NAME.".command('undo', '', this)"), rcube_label('undo'));
+ $msg = html::span(null, $RCMAIL->gettext('contactdeleted'))
+ . ' ' . html::a(array('onclick' => rcmail_output::JS_OBJECT_NAME.".command('undo', '', this)"), $RCMAIL->gettext('undo'));
$OUTPUT->show_message($msg, 'confirmation', null, true, $undo_time);
}
diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc
index 7ddd3e516..3bbbfccdf 100644
--- a/program/steps/addressbook/edit.inc
+++ b/program/steps/addressbook/edit.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/edit.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2007, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -36,12 +36,12 @@ if ($RCMAIL->action == 'edit') {
// editing not allowed here
if ($CONTACTS->readonly || $record['readonly']) {
$OUTPUT->show_message('sourceisreadonly');
- rcmail_overwrite_action('show');
+ $RCMAIL->overwrite_action('show');
return;
}
}
else {
- $source = get_input_value('_source', RCUBE_INPUT_GPC);
+ $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
if (strlen($source)) {
$CONTACTS = $RCMAIL->get_address_book($source, true);
@@ -59,6 +59,25 @@ else {
$SOURCE_ID = $source;
rcmail_set_sourcename($CONTACTS);
+
+$OUTPUT->add_handlers(array(
+ 'contactedithead' => 'rcmail_contact_edithead',
+ 'contacteditform' => 'rcmail_contact_editform',
+ 'contactphoto' => 'rcmail_contact_photo',
+ 'photouploadform' => 'rcmail_upload_photo_form',
+ 'sourceselector' => 'rcmail_source_selector',
+ 'filedroparea' => 'rcmail_photo_drop_area',
+));
+
+if ($RCMAIL->action == 'add' && $OUTPUT->template_exists('contactadd')) {
+ $OUTPUT->send('contactadd');
+}
+
+// this will be executed if no template for addcontact exists
+$OUTPUT->send('contactedit');
+
+
+
function rcmail_get_edit_record()
{
global $RCMAIL, $CONTACTS;
@@ -70,7 +89,7 @@ function rcmail_get_edit_record()
else if ($RCMAIL->action != 'add'
&& !(($result = $CONTACTS->get_result()) && ($record = $result->first()))
) {
- $RCMAIL->output->show_message('contactnotfound');
+ $RCMAIL->output->show_message('contactnotfound', 'error');
return false;
}
@@ -125,7 +144,7 @@ function rcmail_contact_editform($attrib)
$form = array(
'contact' => array(
- 'name' => rcube_label('properties'),
+ 'name' => $RCMAIL->gettext('properties'),
'content' => array(
'email' => array('size' => $i_size, 'visible' => true),
'phone' => array('size' => $i_size, 'visible' => true),
@@ -135,7 +154,7 @@ function rcmail_contact_editform($attrib)
),
),
'personal' => array(
- 'name' => rcube_label('personalinfo'),
+ 'name' => $RCMAIL->gettext('personalinfo'),
'content' => array(
'gender' => array('visible' => true),
'maidenname' => array('size' => $i_size),
@@ -150,7 +169,7 @@ function rcmail_contact_editform($attrib)
if (isset($CONTACT_COLTYPES['notes'])) {
$form['notes'] = array(
- 'name' => rcube_label('notes'),
+ 'name' => $RCMAIL->gettext('notes'),
'content' => array(
'notes' => array('size' => $t_cols, 'rows' => $t_rows, 'label' => false, 'visible' => true, 'limit' => 1),
),
@@ -169,37 +188,56 @@ function rcmail_contact_editform($attrib)
function rcmail_upload_photo_form($attrib)
{
- global $OUTPUT;
-
- // set defaults
- $attrib += array('id' => 'rcmUploadform', 'buttons' => 'yes');
-
- // find max filesize value
- $max_filesize = parse_bytes(ini_get('upload_max_filesize'));
- $max_postsize = parse_bytes(ini_get('post_max_size'));
- if ($max_postsize && $max_postsize < $max_filesize)
- $max_filesize = $max_postsize;
- $max_filesize = show_bytes($max_filesize);
-
- $hidden = new html_hiddenfield(array('name' => '_cid', 'value' => $GLOBALS['cid']));
- $input = new html_inputfield(array('type' => 'file', 'name' => '_photo', 'size' => $attrib['size']));
- $button = new html_inputfield(array('type' => 'button'));
-
- $out = html::div($attrib,
- $OUTPUT->form_tag(array('id' => $attrib['id'].'Frm', 'name' => 'uploadform', 'method' => 'post', 'enctype' => 'multipart/form-data'),
- $hidden->show() .
- html::div(null, $input->show()) .
- html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) .
- (get_boolean($attrib['buttons']) ? html::div('buttons',
- $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' .
- $button->show(rcube_label('upload'), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('upload-photo', this.form)"))
- ) : '')
- )
- );
-
- $OUTPUT->add_label('addphoto','replacephoto');
- $OUTPUT->add_gui_object('uploadform', $attrib['id'].'Frm');
- return $out;
+ global $RCMAIL, $OUTPUT;
+
+ // set defaults
+ $attrib += array('id' => 'rcmUploadform', 'buttons' => 'yes');
+
+ // find max filesize value
+ $max_filesize = parse_bytes(ini_get('upload_max_filesize'));
+ $max_postsize = parse_bytes(ini_get('post_max_size'));
+
+ if ($max_postsize && $max_postsize < $max_filesize) {
+ $max_filesize = $max_postsize;
+ }
+ $max_filesize = $RCMAIL->show_bytes($max_filesize);
+
+ $hidden = new html_hiddenfield(array('name' => '_cid', 'value' => $GLOBALS['cid']));
+ $input = new html_inputfield(array('type' => 'file', 'name' => '_photo', 'size' => $attrib['size']));
+ $button = new html_inputfield(array('type' => 'button'));
+
+ $content = $hidden->show() . html::div(null, $input->show())
+ . html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))));
+
+ if (rcube_utils::get_boolean($attrib['buttons'])) {
+ $content .= html::div('buttons',
+ $button->show($RCMAIL->gettext('close'), array(
+ 'class' => 'button',
+ 'onclick' => "$('#$attrib[id]').hide()"
+ ))
+ . ' ' .
+ $button->show($RCMAIL->gettext('upload'), array(
+ 'class' => 'button mainaction',
+ 'onclick' => rcmail_output::JS_OBJECT_NAME . ".command('upload-photo', this.form)"
+ ))
+ );
+ }
+
+ $out = html::div($attrib,
+ $OUTPUT->form_tag(array(
+ 'id' => $attrib['id'] . 'Frm',
+ 'name' => 'uploadform',
+ 'method' => 'post',
+ 'enctype' => 'multipart/form-data'
+ ),
+ $content
+ )
+ );
+
+ $OUTPUT->add_label('addphoto','replacephoto');
+ $OUTPUT->add_gui_object('uploadform', $attrib['id'].'Frm');
+
+ return $out;
}
// similar function as in /steps/settings/edit_identity.inc
@@ -247,7 +285,7 @@ function rcmail_source_selector($attrib)
$attrib['name'] = '_source';
$attrib['is_escaped'] = true;
- $attrib['onchange'] = JS_OBJECT_NAME . ".command('save', 'reload', this.form)";
+ $attrib['onchange'] = rcmail_output::JS_OBJECT_NAME . ".command('save', 'reload', this.form)";
$select = new html_select($attrib);
@@ -270,19 +308,3 @@ function rcmail_photo_drop_area($attrib)
$OUTPUT->set_env('filedrop', array('action' => 'upload-photo', 'fieldname' => '_photo', 'single' => 1, 'filter' => '^image/.+'));
}
}
-
-
-$OUTPUT->add_handlers(array(
- 'contactedithead' => 'rcmail_contact_edithead',
- 'contacteditform' => 'rcmail_contact_editform',
- 'contactphoto' => 'rcmail_contact_photo',
- 'photouploadform' => 'rcmail_upload_photo_form',
- 'sourceselector' => 'rcmail_source_selector',
- 'filedroparea' => 'rcmail_photo_drop_area',
-));
-
-if ($RCMAIL->action == 'add' && $OUTPUT->template_exists('contactadd'))
- $OUTPUT->send('contactadd');
-
-// this will be executed if no template for addcontact exists
-$OUTPUT->send('contactedit');
diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc
index 1e988feab..2b45e5cd1 100644
--- a/program/steps/addressbook/export.inc
+++ b/program/steps/addressbook/export.inc
@@ -6,7 +6,7 @@
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2013, The Roundcube Dev Team |
- | Copyright (C) 2011, Kolab Systems AG |
+ | Copyright (C) 2011-2013, Kolab Systems AG |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,49 +21,8 @@
+-----------------------------------------------------------------------+
*/
-
-/**
- * Copy contact record properties into a vcard object
- */
-function prepare_for_export(&$record, $source = null)
-{
- $groups = $source && $source->groups && $source->export_groups ? $source->get_record_groups($record['ID']) : null;
-
- if (empty($record['vcard'])) {
- $vcard = new rcube_vcard();
- if ($source) {
- $vcard->extend_fieldmap($source->vcard_map);
- }
- $vcard->load($record['vcard']);
- $vcard->reset();
-
- foreach ($record as $key => $values) {
- list($field, $section) = explode(':', $key);
- foreach ((array)$values as $value) {
- if (is_array($value) || @strlen($value)) {
- $vcard->set($field, $value, strtoupper($section));
- }
- }
- }
-
- // append group names
- if ($groups) {
- $vcard->set('groups', join(',', $groups), null);
- }
-
- $record['vcard'] = $vcard->export(true);
- }
- // patch categories to alread existing vcard block
- else if ($record['vcard'] && !empty($groups) && !strpos($record['vcard'], 'CATEGORIES:')) {
- $vgroups = 'CATEGORIES:' . rcube_vcard::vcard_quote(join(',', $groups));
- $record['vcard'] = str_replace('END:VCARD', $vgroups . rcube_vcard::$eol . 'END:VCARD', $record['vcard']);
- }
-}
-
-
// Use search result
-if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']]))
-{
+if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) {
$sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name');
$search = (array)$_SESSION['search'][$_REQUEST['_search']];
$records = array();
@@ -140,7 +99,7 @@ else {
}
// send downlaod headers
-header('Content-Type: text/x-vcard; charset='.RCMAIL_CHARSET);
+header('Content-Type: text/x-vcard; charset='.RCUBE_CHARSET);
header('Content-Disposition: attachment; filename="contacts.vcf"');
while ($result && ($row = $result->next())) {
@@ -153,3 +112,42 @@ while ($result && ($row = $result->next())) {
}
exit;
+
+
+/**
+ * Copy contact record properties into a vcard object
+ */
+function prepare_for_export(&$record, $source = null)
+{
+ $groups = $source && $source->groups && $source->export_groups ? $source->get_record_groups($record['ID']) : null;
+
+ if (empty($record['vcard'])) {
+ $vcard = new rcube_vcard();
+ if ($source) {
+ $vcard->extend_fieldmap($source->vcard_map);
+ }
+ $vcard->load($record['vcard']);
+ $vcard->reset();
+
+ foreach ($record as $key => $values) {
+ list($field, $section) = explode(':', $key);
+ foreach ((array)$values as $value) {
+ if (is_array($value) || @strlen($value)) {
+ $vcard->set($field, $value, strtoupper($section));
+ }
+ }
+ }
+
+ // append group names
+ if ($groups) {
+ $vcard->set('groups', join(',', $groups), null);
+ }
+
+ $record['vcard'] = $vcard->export(true);
+ }
+ // patch categories to alread existing vcard block
+ else if ($record['vcard'] && !empty($groups) && !strpos($record['vcard'], 'CATEGORIES:')) {
+ $vgroups = 'CATEGORIES:' . rcube_vcard::vcard_quote(join(',', $groups));
+ $record['vcard'] = str_replace('END:VCARD', $vgroups . rcube_vcard::$eol . 'END:VCARD', $record['vcard']);
+ }
+}
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index f94d15338..be0dd2a33 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/func.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -23,37 +23,37 @@ $SEARCH_MODS_DEFAULT = array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1
// general definition of contact coltypes
$CONTACT_COLTYPES = array(
- 'name' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('name'), 'category' => 'main'),
- 'firstname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('firstname'), 'category' => 'main'),
- 'surname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('surname'), 'category' => 'main'),
- 'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other'), 'category' => 'main'),
- 'middlename' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('middlename'), 'category' => 'main'),
- 'prefix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => rcube_label('nameprefix'), 'category' => 'main'),
- 'suffix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => rcube_label('namesuffix'), 'category' => 'main'),
- 'nickname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('nickname'), 'category' => 'main'),
- 'jobtitle' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('jobtitle'), 'category' => 'main'),
- 'organization' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('organization'), 'category' => 'main'),
- 'department' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('department'), 'category' => 'main'),
- 'gender' => array('type' => 'select', 'limit' => 1, 'label' => rcube_label('gender'), 'options' => array('male' => rcube_label('male'), 'female' => rcube_label('female')), 'category' => 'personal'),
- 'maidenname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('maidenname'), 'category' => 'personal'),
- 'phone' => array('type' => 'text', 'size' => 40, 'maxlength' => 20, 'label' => rcube_label('phone'), 'subtypes' => array('home','home2','work','work2','mobile','main','homefax','workfax','car','pager','video','assistant','other'), 'category' => 'main'),
- 'address' => array('type' => 'composite', 'label' => rcube_label('address'), 'subtypes' => array('home','work','other'), 'childs' => array(
- 'street' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('street'), 'category' => 'main'),
- 'locality' => array('type' => 'text', 'size' => 28, 'maxlength' => 50, 'label' => rcube_label('locality'), 'category' => 'main'),
- 'zipcode' => array('type' => 'text', 'size' => 8, 'maxlength' => 15, 'label' => rcube_label('zipcode'), 'category' => 'main'),
- 'region' => array('type' => 'text', 'size' => 12, 'maxlength' => 50, 'label' => rcube_label('region'), 'category' => 'main'),
- 'country' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('country'), 'category' => 'main'),
- ), 'category' => 'main'),
- 'birthday' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => rcube_label('birthday'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'),
- 'anniversary' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => rcube_label('anniversary'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'),
- 'website' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('website'), 'subtypes' => array('homepage','work','blog','profile','other'), 'category' => 'main'),
- 'im' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('instantmessenger'), 'subtypes' => array('aim','icq','msn','yahoo','jabber','skype','other'), 'category' => 'main'),
- 'notes' => array('type' => 'textarea', 'size' => 40, 'rows' => 15, 'maxlength' => 500, 'label' => rcube_label('notes'), 'limit' => 1),
- 'photo' => array('type' => 'image', 'limit' => 1, 'category' => 'main'),
- 'assistant' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('assistant'), 'category' => 'personal'),
- 'manager' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('manager'), 'category' => 'personal'),
- 'spouse' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('spouse'), 'category' => 'personal'),
- // TODO: define fields for vcards like GEO, KEY
+ 'name' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('name'), 'category' => 'main'),
+ 'firstname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('firstname'), 'category' => 'main'),
+ 'surname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('surname'), 'category' => 'main'),
+ 'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => $RCMAIL->gettext('email'), 'subtypes' => array('home','work','other'), 'category' => 'main'),
+ 'middlename' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('middlename'), 'category' => 'main'),
+ 'prefix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => $RCMAIL->gettext('nameprefix'), 'category' => 'main'),
+ 'suffix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => $RCMAIL->gettext('namesuffix'), 'category' => 'main'),
+ 'nickname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('nickname'), 'category' => 'main'),
+ 'jobtitle' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('jobtitle'), 'category' => 'main'),
+ 'organization' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('organization'), 'category' => 'main'),
+ 'department' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('department'), 'category' => 'main'),
+ 'gender' => array('type' => 'select', 'limit' => 1, 'label' => $RCMAIL->gettext('gender'), 'options' => array('male' => $RCMAIL->gettext('male'), 'female' => $RCMAIL->gettext('female')), 'category' => 'personal'),
+ 'maidenname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('maidenname'), 'category' => 'personal'),
+ 'phone' => array('type' => 'text', 'size' => 40, 'maxlength' => 20, 'label' => $RCMAIL->gettext('phone'), 'subtypes' => array('home','home2','work','work2','mobile','main','homefax','workfax','car','pager','video','assistant','other'), 'category' => 'main'),
+ 'address' => array('type' => 'composite', 'label' => $RCMAIL->gettext('address'), 'subtypes' => array('home','work','other'), 'childs' => array(
+ 'street' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('street'), 'category' => 'main'),
+ 'locality' => array('type' => 'text', 'size' => 28, 'maxlength' => 50, 'label' => $RCMAIL->gettext('locality'), 'category' => 'main'),
+ 'zipcode' => array('type' => 'text', 'size' => 8, 'maxlength' => 15, 'label' => $RCMAIL->gettext('zipcode'), 'category' => 'main'),
+ 'region' => array('type' => 'text', 'size' => 12, 'maxlength' => 50, 'label' => $RCMAIL->gettext('region'), 'category' => 'main'),
+ 'country' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('country'), 'category' => 'main'),
+ ), 'category' => 'main'),
+ 'birthday' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => $RCMAIL->gettext('birthday'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'),
+ 'anniversary' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => $RCMAIL->gettext('anniversary'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'),
+ 'website' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('website'), 'subtypes' => array('homepage','work','blog','profile','other'), 'category' => 'main'),
+ 'im' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('instantmessenger'), 'subtypes' => array('aim','icq','msn','yahoo','jabber','skype','other'), 'category' => 'main'),
+ 'notes' => array('type' => 'textarea', 'size' => 40, 'rows' => 15, 'maxlength' => 500, 'label' => $RCMAIL->gettext('notes'), 'limit' => 1),
+ 'photo' => array('type' => 'image', 'limit' => 1, 'category' => 'main'),
+ 'assistant' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('assistant'), 'category' => 'personal'),
+ 'manager' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('manager'), 'category' => 'personal'),
+ 'spouse' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('spouse'), 'category' => 'personal'),
+ // TODO: define fields for vcards like GEO, KEY
);
$PAGE_SIZE = $RCMAIL->config->get('addressbook_pagesize', $RCMAIL->config->get('pagesize', 50));
@@ -83,12 +83,12 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) {
$OUTPUT->set_env('writable_source', $writeable);
$OUTPUT->set_env('compose_extwin', $RCMAIL->config->get('compose_extwin',false));
- $OUTPUT->set_pagetitle(rcube_label('addressbook'));
+ $OUTPUT->set_pagetitle($RCMAIL->gettext('addressbook'));
$_SESSION['addressbooks_count'] = $count;
$_SESSION['addressbooks_count_writeable'] = $writeable;
// select address book
- $source = get_input_value('_source', RCUBE_INPUT_GPC);
+ $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
// use first directory by default
if (!strlen($source) || !isset($js_list[$source])) {
@@ -109,13 +109,38 @@ if ($undo = $_SESSION['contact_undo']) {
$RCMAIL->session->remove('contact_undo');
}
+// register UI objects
+$OUTPUT->add_handlers(array(
+ 'directorylist' => 'rcmail_directory_list',
+// 'groupslist' => 'rcmail_contact_groups',
+ 'addresslist' => 'rcmail_contacts_list',
+ 'addresslisttitle' => 'rcmail_contacts_list_title',
+ 'addressframe' => 'rcmail_contact_frame',
+ 'recordscountdisplay' => 'rcmail_rowcount_display',
+ 'searchform' => array($OUTPUT, 'search_form')
+));
+
+// register action aliases
+$RCMAIL->register_action_map(array(
+ 'add' => 'edit.inc',
+ 'group-create' => 'groups.inc',
+ 'group-rename' => 'groups.inc',
+ 'group-delete' => 'groups.inc',
+ 'group-addmembers' => 'groups.inc',
+ 'group-delmembers' => 'groups.inc',
+ 'search-create' => 'search.inc',
+ 'search-delete' => 'search.inc',
+));
+
+
+
// instantiate a contacts object according to the given source
function rcmail_contact_source($source=null, $init_env=false, $writable=false)
{
global $RCMAIL, $OUTPUT, $CONTACT_COLTYPES, $PAGE_SIZE;
if (!strlen($source)) {
- $source = get_input_value('_source', RCUBE_INPUT_GPC);
+ $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
}
// Get object
@@ -129,13 +154,13 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false)
$CONTACTS->set_page(isset($_SESSION['page']) ? $_SESSION['page'] : 1);
if (!empty($_REQUEST['_gid']))
- $CONTACTS->set_group(get_input_value('_gid', RCUBE_INPUT_GPC));
+ $CONTACTS->set_group(rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC));
if (!$init_env)
return $CONTACTS;
$OUTPUT->set_env('readonly', $CONTACTS->readonly);
- $OUTPUT->set_env('source', $source);
+ $OUTPUT->set_env('source', (string) $source);
// reduce/extend $CONTACT_COLTYPES with specification from the current $CONTACT object
if (is_array($CONTACTS->coltypes)) {
@@ -162,13 +187,13 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false)
function rcmail_set_sourcename($abook)
{
- global $OUTPUT;
+ global $OUTPUT, $RCMAIL;
// get address book name (for display)
if ($abook && $_SESSION['addressbooks_count'] > 1) {
$name = $abook->get_name();
if (!$name) {
- $name = rcube_label('personaladrbook');
+ $name = $RCMAIL->gettext('personaladrbook');
}
$OUTPUT->set_env('sourcename', html_entity_decode($name, ENT_COMPAT, 'UTF-8'));
}
@@ -189,17 +214,17 @@ function rcmail_directory_list($attrib)
'id' => 'rcmli%s', 'class' => '%s', 'noclose' => true),
html::a(array('href' => '%s',
'rel' => '%s',
- 'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s'));
+ 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('list','%s',this)"), '%s'));
$sources = (array) $OUTPUT->get_env('address_sources');
reset($sources);
// currently selected source
- $current = get_input_value('_source', RCUBE_INPUT_GPC);
+ $current = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
foreach ($sources as $j => $source) {
$id = strval(strlen($source['id']) ? $source['id'] : $j);
- $js_id = JQ($id);
+ $js_id = rcube::JQ($id);
// set class name(s)
$class_name = 'addressbook';
@@ -214,7 +239,7 @@ function rcmail_directory_list($attrib)
$out .= sprintf($line_templ,
rcube_utils::html_identifier($id, true),
$class_name,
- Q(rcmail_url(null, array('_source' => $id))),
+ rcube::Q($RCMAIL->url(array('_source' => $id))),
$source['id'],
$js_id, $name);
@@ -229,13 +254,13 @@ function rcmail_directory_list($attrib)
$line_templ = html::tag('li', array(
'id' => 'rcmli%s', 'class' => '%s'),
html::a(array('href' => '#', 'rel' => 'S%s',
- 'onclick' => "return ".JS_OBJECT_NAME.".command('listsearch', '%s', this)"), '%s'));
+ 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('listsearch', '%s', this)"), '%s'));
// Saved searches
$sources = $RCMAIL->user->list_searches(rcube_user::SEARCH_ADDRESSBOOK);
foreach ($sources as $j => $source) {
$id = $source['id'];
- $js_id = JQ($id);
+ $js_id = rcube::JQ($id);
// set class name(s)
$class_name = 'contactsearch';
@@ -248,7 +273,7 @@ function rcmail_directory_list($attrib)
rcube_utils::html_identifier('S'.$id, true),
$class_name,
$id,
- $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id)));
+ $js_id, (!empty($source['name']) ? rcube::Q($source['name']) : rcube::Q($id)));
}
$OUTPUT->set_env('contactgroups', $jsdata);
@@ -275,7 +300,7 @@ function rcmail_contact_groups($args)
'id' => 'rcmli%s', 'class' => 'contactgroup'),
html::a(array('href' => '#',
'rel' => '%s:%s',
- 'onclick' => "return ".JS_OBJECT_NAME.".command('listgroup',{'source':'%s','id':'%s'},this)"), '%s'));
+ 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('listgroup',{'source':'%s','id':'%s'},this)"), '%s'));
// append collapse/expand toggle and open a new <ul>
$is_collapsed = strpos($RCMAIL->config->get('collapsed_abooks',''), '&'.rawurlencode($args['source']).'&') !== false;
@@ -285,7 +310,7 @@ function rcmail_contact_groups($args)
$groups_html .= sprintf($line_templ,
rcube_utils::html_identifier('G' . $args['source'] . $group['ID'], true),
$args['source'], $group['ID'],
- $args['source'], $group['ID'], Q($group['name'])
+ $args['source'], $group['ID'], rcube::Q($group['name'])
);
$args['jsdata']['G'.$args['source'].$group['ID']] = array(
'source' => $args['source'], 'id' => $group['ID'],
@@ -304,7 +329,7 @@ function rcmail_contact_groups($args)
// return the contacts list as HTML table
function rcmail_contacts_list($attrib)
{
- global $CONTACTS, $OUTPUT;
+ global $RCMAIL, $CONTACTS, $OUTPUT;
// define list of cols to be displayed
$a_show_cols = array('name','action');
@@ -314,7 +339,7 @@ function rcmail_contacts_list($attrib)
$attrib['id'] = 'rcmAddressList';
// create XHTML table
- $out = rcube_table_output($attrib, array(), $a_show_cols, $CONTACTS->primary_key);
+ $out = $RCMAIL->table_output($attrib, array(), $a_show_cols, $CONTACTS->primary_key);
// set client env
$OUTPUT->add_gui_object('contactslist', $attrib['id']);
@@ -330,7 +355,7 @@ function rcmail_contacts_list($attrib)
function rcmail_js_contacts_list($result, $prefix='')
{
- global $OUTPUT;
+ global $OUTPUT, $RCMAIL;
if (empty($result) || $result->count == 0)
return;
@@ -357,7 +382,7 @@ function rcmail_js_contacts_list($result, $prefix='')
$val = '';
switch ($col) {
case 'name':
- $val = Q(rcube_addressbook::compose_list_name($row));
+ $val = rcube::Q(rcube_addressbook::compose_list_name($row));
break;
case 'action':
@@ -365,8 +390,8 @@ function rcmail_js_contacts_list($result, $prefix='')
$val = html::a(array(
'href' => '#list',
'rel' => $row['ID'],
- 'title' => rcube_label('listgroup'),
- 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)", JS_OBJECT_NAME, $source_id, $row['CID']),
+ 'title' => $RCMAIL->gettext('listgroup'),
+ 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)", rcmail_output::JS_OBJECT_NAME, $source_id, $row['CID']),
), '&raquo;');
}
else
@@ -374,7 +399,7 @@ function rcmail_js_contacts_list($result, $prefix='')
break;
default:
- $val = Q($row[$col]);
+ $val = rcube::Q($row[$col]);
break;
}
@@ -391,7 +416,7 @@ function rcmail_js_contacts_list($result, $prefix='')
function rcmail_contacts_list_title($attrib)
{
- global $OUTPUT;
+ global $OUTPUT, $RCMAIL;
$attrib += array('label' => 'contacts', 'id' => 'rcmabooklisttitle', 'tag' => 'span');
unset($attrib['name']);
@@ -399,7 +424,7 @@ function rcmail_contacts_list_title($attrib)
$OUTPUT->add_gui_object('addresslist_title', $attrib['id']);
$OUTPUT->add_label('contacts');
- return html::tag($attrib['tag'], $attrib, rcube_label($attrib['label']), html::$common_attrib);
+ return html::tag($attrib['tag'], $attrib, $RCMAIL->gettext($attrib['label']), html::$common_attrib);
}
@@ -417,23 +442,23 @@ function rcmail_contact_frame($attrib)
function rcmail_rowcount_display($attrib)
{
- global $OUTPUT;
+ global $RCMAIL;
if (!$attrib['id'])
$attrib['id'] = 'rcmcountdisplay';
- $OUTPUT->add_gui_object('countdisplay', $attrib['id']);
+ $RCMAIL->output->add_gui_object('countdisplay', $attrib['id']);
if ($attrib['label'])
$_SESSION['contactcountdisplay'] = $attrib['label'];
- return html::span($attrib, rcube_label('loading'));
+ return html::span($attrib, $RCMAIL->gettext('loading'));
}
function rcmail_get_rowcount_text($result=null)
{
- global $CONTACTS, $PAGE_SIZE;
+ global $RCMAIL, $CONTACTS, $PAGE_SIZE;
// read nr of contacts
if (!$result) {
@@ -441,9 +466,9 @@ function rcmail_get_rowcount_text($result=null)
}
if ($result->count == 0)
- $out = rcube_label('nocontactsfound');
+ $out = $RCMAIL->gettext('nocontactsfound');
else
- $out = rcube_label(array(
+ $out = $RCMAIL->gettext(array(
'name' => $_SESSION['contactcountdisplay'] ? $_SESSION['contactcountdisplay'] : 'contactsfromto',
'vars' => array(
'from' => $result->first + 1,
@@ -457,13 +482,15 @@ function rcmail_get_rowcount_text($result=null)
function rcmail_get_type_label($type)
{
+ global $RCMAIL;
+
$label = 'type'.$type;
- if (rcube_label_exists($label, '*', $domain))
- return rcube_label($label, $domain);
+ if ($RCMAIL->text_exists($label, '*', $domain))
+ return $RCMAIL->gettext($label, $domain);
else if (preg_match('/\w+(\d+)$/', $label, $m)
&& ($label = preg_replace('/(\d+)$/', '', $label))
- && rcube_label_exists($label, '*', $domain))
- return rcube_label($label, $domain) . ' ' . $m[1];
+ && $RCMAIL->text_exists($label, '*', $domain))
+ return $RCMAIL->gettext($label, $domain) . ' ' . $m[1];
return ucfirst($type);
}
@@ -480,7 +507,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
$form = $plugin['form'];
$record = $plugin['record'];
$edit_mode = $RCMAIL->action != 'show';
- $del_button = $attrib['deleteicon'] ? html::img(array('src' => $RCMAIL->output->get_skin_file($attrib['deleteicon']), 'alt' => rcube_label('delete'))) : rcube_label('delete');
+ $del_button = $attrib['deleteicon'] ? html::img(array('src' => $RCMAIL->output->get_skin_file($attrib['deleteicon']), 'alt' => $RCMAIL->gettext('delete'))) : $RCMAIL->gettext('delete');
unset($attrib['deleteicon']);
$out = '';
@@ -507,7 +534,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
continue;
$select_add = new html_select(array('class' => 'addfieldmenu', 'rel' => $section));
- $select_add->add(rcube_label('addfield'), '');
+ $select_add->add($RCMAIL->gettext('addfield'), '');
// render head section with name fields (not a regular list of rows)
if ($section == 'head') {
@@ -539,7 +566,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
if ($RCMAIL->action == 'show') {
if (!empty($record[$col]))
- $fields .= html::span('namefield ' . $col, Q($record[$col])) . " ";
+ $fields .= html::span('namefield ' . $col, rcube::Q($record[$col])) . " ";
}
else {
$colprop = (array)$fieldset['content'][$col] + (array)$coltypes[$col];
@@ -548,7 +575,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
$colprop['style'] = 'display:none';
$select_add->add($colprop['label'], $col);
}
- $fields .= rcmail_get_edit_field($col, $record[$col], $colprop, $colprop['type']);
+ $fields .= rcube_output::get_edit_field($col, $record[$col], $colprop, $colprop['type']);
}
}
$content .= html::div($blockname, $fields);
@@ -557,7 +584,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
if ($edit_mode)
$content .= html::p('addfield', $select_add->show(null));
- $out .= html::tag('fieldset', $attrib, (!empty($fieldset['name']) ? html::tag('legend', null, Q($fieldset['name'])) : '') . $content) ."\n";
+ $out .= html::tag('fieldset', $attrib, (!empty($fieldset['name']) ? html::tag('legend', null, rcube::Q($fieldset['name'])) : '') . $content) ."\n";
continue;
}
@@ -575,7 +602,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
// merge colprop with global coltype configuration
$colprop += $coltypes[$field];
- $label = isset($colprop['label']) ? $colprop['label'] : rcube_label($col);
+ $label = isset($colprop['label']) ? $colprop['label'] : $RCMAIL->gettext($col);
// prepare subtype selector in edit mode
if ($edit_mode && is_array($colprop['subtypes'])) {
@@ -636,10 +663,10 @@ function rcmail_contact_form($form, $record, $attrib = null)
if ($edit_mode) {
if ($colprop['subtypes'] || $colprop['limit'] != 1) $cp['array'] = true;
- $composite['{'.$childcol.'}'] = rcmail_get_edit_field($childcol, $childvalue, $cp, $cp['type']) . " ";
+ $composite['{'.$childcol.'}'] = rcube_output::get_edit_field($childcol, $childvalue, $cp, $cp['type']) . " ";
}
else {
- $childval = $cp['render_func'] ? call_user_func($cp['render_func'], $childvalue, $childcol) : Q($childvalue);
+ $childval = $cp['render_func'] ? call_user_func($cp['render_func'], $childvalue, $childcol) : rcube::Q($childvalue);
$composite['{'.$childcol.'}'] = html::span('data ' . $childcol, $childval) . " ";
}
$j++;
@@ -666,7 +693,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
$val = rcmail_format_date_col($val);
}
- $val = rcmail_get_edit_field($col, $val, $colprop, $colprop['type']);
+ $val = rcube_output::get_edit_field($col, $val, $colprop, $colprop['type']);
$coltypes[$field]['count']++;
}
else if ($colprop['render_func'])
@@ -674,7 +701,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
else if (is_array($colprop['options']) && isset($colprop['options'][$val]))
$val = $colprop['options'][$val];
else
- $val = Q($val);
+ $val = rcube::Q($val);
// use subtype as label
if ($colprop['subtypes'])
@@ -682,12 +709,12 @@ function rcmail_contact_form($form, $record, $attrib = null)
// add delete button/link
if ($edit_mode && !($colprop['visible'] && $colprop['limit'] == 1))
- $val .= html::a(array('href' => '#del', 'class' => 'contactfieldbutton deletebutton', 'title' => rcube_label('delete'), 'rel' => $col), $del_button);
+ $val .= html::a(array('href' => '#del', 'class' => 'contactfieldbutton deletebutton', 'title' => $RCMAIL->gettext('delete'), 'rel' => $col), $del_button);
// display row with label
if ($label) {
$rows .= html::div('row',
- html::div('contactfieldlabel label', $select_subtype ? $select_subtype->show($subtype) : Q($label)) .
+ html::div('contactfieldlabel label', $select_subtype ? $select_subtype->show($subtype) : rcube::Q($label)) .
html::div('contactfieldcontent '.$colprop['type'], $val));
}
else // row without label
@@ -703,7 +730,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
// wrap rows in fieldgroup container
if ($rows) {
$content .= html::tag('fieldset', array('class' => 'contactfieldgroup ' . ($colprop['subtypes'] ? 'contactfieldgroupmulti ' : '') . 'contactcontroller' . $col, 'style' => ($rows ? null : 'display:none')),
- ($colprop['subtypes'] ? html::tag('legend', null, Q($colprop['label'])) : ' ') .
+ ($colprop['subtypes'] ? html::tag('legend', null, rcube::Q($colprop['label'])) : ' ') .
$rows);
}
}
@@ -722,7 +749,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
}
if ($content)
- $out .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $content) ."\n";
+ $out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($fieldset['name'])) . $content) ."\n";
}
if ($edit_mode) {
@@ -792,7 +819,7 @@ function rcmail_contact_photo($attrib)
function rcmail_format_date_col($val)
{
global $RCMAIL;
- return format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d'), false);
+ return $RCMAIL->format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d'), false);
}
/**
@@ -855,8 +882,8 @@ function rcmail_get_cids($filter = null)
// forms. If _source is an empty string then the ID is a string
// containing contact ID and source name in form: <ID>-<SOURCE>
- $cid = get_input_value('_cid', RCUBE_INPUT_GPC);
- $source = (string) get_input_value('_source', RCUBE_INPUT_GPC);
+ $cid = rcube_utils::get_input_value('_cid', rcube_utils::INPUT_GPC);
+ $source = (string) rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
if (is_array($cid)) {
return $cid;
@@ -893,27 +920,3 @@ function rcmail_get_cids($filter = null)
return $filter !== null ? $result[$filter] : $result;
}
-
-
-// register UI objects
-$OUTPUT->add_handlers(array(
- 'directorylist' => 'rcmail_directory_list',
-// 'groupslist' => 'rcmail_contact_groups',
- 'addresslist' => 'rcmail_contacts_list',
- 'addresslisttitle' => 'rcmail_contacts_list_title',
- 'addressframe' => 'rcmail_contact_frame',
- 'recordscountdisplay' => 'rcmail_rowcount_display',
- 'searchform' => array($OUTPUT, 'search_form')
-));
-
-// register action aliases
-$RCMAIL->register_action_map(array(
- 'add' => 'edit.inc',
- 'group-create' => 'groups.inc',
- 'group-rename' => 'groups.inc',
- 'group-delete' => 'groups.inc',
- 'group-addmembers' => 'groups.inc',
- 'group-delmembers' => 'groups.inc',
- 'search-create' => 'search.inc',
- 'search-delete' => 'search.inc',
-));
diff --git a/program/steps/addressbook/groups.inc b/program/steps/addressbook/groups.inc
index 3b9288a2b..aef93f2c7 100644
--- a/program/steps/addressbook/groups.inc
+++ b/program/steps/addressbook/groups.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/groups.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2010, The Roundcube Dev Team |
+ | Copyright (C) 2010-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,117 +19,136 @@
+-----------------------------------------------------------------------+
*/
-$source = get_input_value('_source', RCUBE_INPUT_GPC);
+$source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
$CONTACTS = rcmail_contact_source($source);
if ($CONTACTS->readonly || !$CONTACTS->groups) {
- $OUTPUT->show_message('sourceisreadonly', 'warning');
- $OUTPUT->send();
+ $OUTPUT->show_message('sourceisreadonly', 'warning');
+ $OUTPUT->send();
}
if ($RCMAIL->action == 'group-addmembers') {
- if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = rcmail_get_cids($source))) {
- $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source));
-
- $CONTACTS->set_group($gid);
- $num2add = count($plugin['ids']);
-
- if (!$plugin['abort']) {
- if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + $num2add > $maxnum)) {
- $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum));
- $OUTPUT->send();
- }
- $result = $CONTACTS->add_to_group($gid, $plugin['ids']);
+ if (($gid = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_POST)) && ($ids = rcmail_get_cids($source))) {
+ $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array(
+ 'group_id' => $gid,
+ 'ids' => $ids,
+ 'source' => $source,
+ ));
+
+ $CONTACTS->set_group($gid);
+ $num2add = count($plugin['ids']);
+
+ if (!$plugin['abort']) {
+ if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + $num2add > $maxnum)) {
+ $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum));
+ $OUTPUT->send();
+ }
+
+ $result = $CONTACTS->add_to_group($gid, $plugin['ids']);
+ }
+ else {
+ $result = $plugin['result'];
+ }
+
+ if ($result)
+ $OUTPUT->show_message('contactaddedtogroup');
+ else if ($plugin['abort'] || $CONTACTS->get_error())
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
+ else
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'nogroupassignmentschanged');
}
- else {
- $result = $plugin['result'];
- }
-
- if ($result)
- $OUTPUT->show_message('contactaddedtogroup');
- else if ($plugin['abort'] || $CONTACTS->get_error())
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
- else
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'nogroupassignmentschanged');
- }
}
-
else if ($RCMAIL->action == 'group-delmembers') {
- if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = rcmail_get_cids($source))) {
- $plugin = $RCMAIL->plugins->exec_hook('group_delmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source));
+ if (($gid = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_POST)) && ($ids = rcmail_get_cids($source))) {
+ $plugin = $RCMAIL->plugins->exec_hook('group_delmembers', array(
+ 'group_id' => $gid,
+ 'ids' => $ids,
+ 'source' => $source,
+ ));
+
+ if (!$plugin['abort'])
+ $result = $CONTACTS->remove_from_group($gid, $plugin['ids']);
+ else
+ $result = $plugin['result'];
+
+ if ($result) {
+ $OUTPUT->show_message('contactremovedfromgroup');
+ $OUTPUT->command('remove_group_contacts',array('source' => $source, 'gid' => $gid));
+ }
+ else {
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
+ }
+ }
+}
+else if ($RCMAIL->action == 'group-create') {
+ if ($name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true))) {
+ $plugin = $RCMAIL->plugins->exec_hook('group_create', array(
+ 'name' => $name,
+ 'source' => $source,
+ ));
+
+ if (!$plugin['abort'])
+ $created = $CONTACTS->create_group($plugin['name']);
+ else
+ $created = $plugin['result'];
+ }
- if (!$plugin['abort'])
- $result = $CONTACTS->remove_from_group($gid, $plugin['ids']);
- else
- $result = $plugin['result'];
+ if ($created && $OUTPUT->ajax_call) {
+ $created['name'] = rcube::Q($created['name']);
- if ($result) {
- $OUTPUT->show_message('contactremovedfromgroup');
- $OUTPUT->command('remove_group_contacts',array('source' => $source, 'gid' => $gid));
+ $OUTPUT->show_message('groupcreated', 'confirmation');
+ $OUTPUT->command('insert_contact_group', array('source' => $source) + $created);
}
- else {
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
+ else if (!$created) {
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
}
- }
-}
-
-else if ($RCMAIL->action == 'group-create') {
- if ($name = trim(get_input_value('_name', RCUBE_INPUT_POST, true))) {
- $plugin = $RCMAIL->plugins->exec_hook('group_create', array('name' => $name, 'source' => $source));
-
- if (!$plugin['abort'])
- $created = $CONTACTS->create_group($plugin['name']);
- else
- $created = $plugin['result'];
- }
-
- if ($created && $OUTPUT->ajax_call) {
- $created['name'] = Q($created['name']);
- $OUTPUT->show_message('groupcreated', 'confirmation');
- $OUTPUT->command('insert_contact_group', array('source' => $source) + $created);
- }
- else if (!$created) {
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
- }
}
-
else if ($RCMAIL->action == 'group-rename') {
- if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($name = trim(get_input_value('_name', RCUBE_INPUT_POST, true)))) {
- $plugin = $RCMAIL->plugins->exec_hook('group_rename', array('group_id' => $gid, 'name' => $name, 'source' => $source));
-
- if (!$plugin['abort'])
- $newname = $CONTACTS->rename_group($gid, $plugin['name'], $newgid);
- else
- $newname = $plugin['result'];
- }
-
- if ($newname && $OUTPUT->ajax_call) {
- $OUTPUT->show_message('grouprenamed', 'confirmation');
- $OUTPUT->command('update_contact_group', array(
- 'source' => $source, 'id' => $gid, 'name' => Q($newname), 'newid' => $newgid));
- }
- else if (!$newname)
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
-}
+ if (($gid = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_POST))
+ && ($name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)))
+ ) {
+ $plugin = $RCMAIL->plugins->exec_hook('group_rename', array(
+ 'group_id' => $gid,
+ 'name' => $name,
+ 'source' => $source,
+ ));
+
+ if (!$plugin['abort'])
+ $newname = $CONTACTS->rename_group($gid, $plugin['name'], $newgid);
+ else
+ $newname = $plugin['result'];
+ }
+ if ($newname && $OUTPUT->ajax_call) {
+ $OUTPUT->show_message('grouprenamed', 'confirmation');
+ $OUTPUT->command('update_contact_group', array(
+ 'source' => $source, 'id' => $gid, 'name' => rcube::Q($newname), 'newid' => $newgid));
+ }
+ else if (!$newname) {
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
+ }
+}
else if ($RCMAIL->action == 'group-delete') {
- if ($gid = get_input_value('_gid', RCUBE_INPUT_POST)) {
- $plugin = $RCMAIL->plugins->exec_hook('group_delete', array('group_id' => $gid, 'source' => $source));
-
- if (!$plugin['abort'])
- $deleted = $CONTACTS->delete_group($gid);
- else
- $deleted = $plugin['result'];
- }
-
- if ($deleted) {
- $OUTPUT->show_message('groupdeleted', 'confirmation');
- $OUTPUT->command('remove_group_item', array('source' => $source, 'id' => $gid));
- }
- else
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
+ if ($gid = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_POST)) {
+ $plugin = $RCMAIL->plugins->exec_hook('group_delete', array(
+ 'group_id' => $gid,
+ 'source' => $source,
+ ));
+
+ if (!$plugin['abort'])
+ $deleted = $CONTACTS->delete_group($gid);
+ else
+ $deleted = $plugin['result'];
+ }
+
+ if ($deleted) {
+ $OUTPUT->show_message('groupdeleted', 'confirmation');
+ $OUTPUT->command('remove_group_item', array('source' => $source, 'id' => $gid));
+ }
+ else {
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
+ }
}
// send response
$OUTPUT->send();
-
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index 60f5d7b61..33e473242 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/import.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2008-2009, The Roundcube Dev Team |
+ | Copyright (C) 2008-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,169 +20,14 @@
+-----------------------------------------------------------------------+
*/
-/**
- * Handler function to display the import/upload form
- */
-function rcmail_import_form($attrib)
-{
- global $RCMAIL, $OUTPUT;
- $target = get_input_value('_target', RCUBE_INPUT_GPC);
-
- $attrib += array('id' => "rcmImportForm");
-
- $writable_books = $RCMAIL->get_address_sources(true, true);
-
- $upload = new html_inputfield(array(
- 'type' => 'file',
- 'name' => '_file[]',
- 'id' => 'rcmimportfile',
- 'size' => 40,
- 'multiple' => 'multiple',
- ));
- $form = html::p(null, html::label('rcmimportfile', rcube_label('importfromfile')) . $upload->show());
- $table = new html_table(array('cols' => 2));
-
- // addressbook selector
- if (count($writable_books) > 1) {
- $select = new html_select(array('name' => '_target', 'id' => 'rcmimporttarget', 'is_escaped' => true));
-
- foreach ($writable_books as $book)
- $select->add($book['name'], $book['id']);
-
- $table->add('title', html::label('rcmimporttarget', rcube_label('importtarget')));
- $table->add(null, $select->show($target));
- }
- else {
- $abook = new html_hiddenfield(array('name' => '_target', 'value' => key($writable_books)));
- $form .= $abook->show();
- }
-
- // selector for group import options
- if (count($writable_books) >= 1 || $writable_books[0]->groups) {
- $select = new html_select(array('name' => '_groups', 'id' => 'rcmimportgroups', 'is_escaped' => true));
- $select->add(rcube_label('none'), '0');
- $select->add(rcube_label('importgroupsall'), '1');
- $select->add(rcube_label('importgroupsexisting'), '2');
-
- $table->add('title', html::label('rcmimportgroups', rcube_label('importgroups')));
- $table->add(null, $select->show(get_input_value('_groups', RCUBE_INPUT_GPC)));
- }
-
- // checkbox to replace the entire address book
- $check_replace = new html_checkbox(array('name' => '_replace', 'value' => 1, 'id' => 'rcmimportreplace'));
- $table->add('title', html::label('rcmimportreplace', rcube_label('importreplace')));
- $table->add(null, $check_replace->show(get_input_value('_replace', RCUBE_INPUT_GPC)));
-
- $form .= $table->show(array('id' => null) + $attrib);
-
- $OUTPUT->set_env('writable_source', !empty($writable_books));
- $OUTPUT->add_label('selectimportfile','importwait');
- $OUTPUT->add_gui_object('importform', $attrib['id']);
-
- $out = html::p(null, Q(rcube_label('importdesc'), 'show'));
-
- $out .= $OUTPUT->form_tag(array(
- 'action' => $RCMAIL->url('import'),
- 'method' => 'post',
- 'enctype' => 'multipart/form-data') + $attrib,
- $form);
-
- return $out;
-}
-
-
-/**
- * Render the confirmation page for the import process
- */
-function rcmail_import_confirm($attrib)
-{
- global $IMPORT_STATS;
-
- $vars = get_object_vars($IMPORT_STATS);
- $vars['names'] = $vars['skipped_names'] = '';
-
- $content = html::p(null, rcube_label(array(
- 'name' => 'importconfirm',
- 'nr' => $IMPORT_STATS->inserted,
- 'vars' => $vars,
- )) . ($IMPORT_STATS->names ? ':' : '.'));
-
- if ($IMPORT_STATS->names)
- $content .= html::p('em', join(', ', array_map('Q', $IMPORT_STATS->names)));
-
- if ($IMPORT_STATS->skipped) {
- $content .= html::p(null, rcube_label(array(
- 'name' => 'importconfirmskipped',
- 'nr' => $IMPORT_STATS->skipped,
- 'vars' => $vars,
- )) . ':');
- $content .= html::p('em', join(', ', array_map('Q', $IMPORT_STATS->skipped_names)));
- }
-
- return html::div($attrib, $content);
-}
-
-
-/**
- * Create navigation buttons for the current import step
- */
-function rcmail_import_buttons($attrib)
-{
- global $IMPORT_STATS, $OUTPUT;
- $target = get_input_value('_target', RCUBE_INPUT_GPC);
-
- $attrib += array('type' => 'input');
- unset($attrib['name']);
-
- if (is_object($IMPORT_STATS)) {
- $attrib['class'] = trim($attrib['class'] . ' mainaction');
- $out = $OUTPUT->button(array('command' => 'list', 'prop' => $target, 'label' => 'done') + $attrib);
- }
- else {
- $out = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib);
- $out .= '&nbsp;';
- $attrib['class'] = trim($attrib['class'] . ' mainaction');
- $out .= $OUTPUT->button(array('command' => 'import', 'label' => 'import') + $attrib);
- }
-
- return $out;
-}
-
-
-/**
- * Returns the matching group id. If group doesn't exist, it'll be created if allowed.
- */
-function rcmail_import_group_id($group_name, $CONTACTS, $create, &$import_groups)
-{
- $group_id = 0;
- foreach ($import_groups as $key => $group) {
- if (strtolower($group['name']) == strtolower($group_name)) {
- $group_id = $group['ID'];
- break;
- }
- }
-
- // create a new group
- if (!$group_id && $create) {
- $new_group = $CONTACTS->create_group($group_name);
- if (!$new_group['ID'])
- $new_group['ID'] = $new_group['id'];
- $import_groups[] = $new_group;
- $group_id = $new_group['ID'];
- }
-
- return $group_id;
-}
-
-
/** The import process **/
$importstep = 'rcmail_import_form';
if (is_array($_FILES['_file'])) {
- $replace = (bool)get_input_value('_replace', RCUBE_INPUT_GPC);
- $target = get_input_value('_target', RCUBE_INPUT_GPC);
- $with_groups = intval(get_input_value('_groups', RCUBE_INPUT_GPC));
+ $replace = (bool)rcube_utils::get_input_value('_replace', rcube_utils::INPUT_GPC);
+ $target = rcube_utils::get_input_value('_target', rcube_utils::INPUT_GPC);
+ $with_groups = intval(rcube_utils::get_input_value('_groups', rcube_utils::INPUT_GPC));
$vcards = array();
$upload_error = null;
@@ -232,7 +77,8 @@ if (is_array($_FILES['_file'])) {
// no vcards detected
if (!count($vcards)) {
if ($upload_error == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
- $OUTPUT->show_message('filesizeerror', 'error', array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize')))));
+ $size = $RCMAIL->show_bytes(parse_bytes(ini_get('upload_max_filesize')));
+ $OUTPUT->show_message('filesizeerror', 'error', array('size' => $size));
}
else if ($upload_error) {
$OUTPUT->show_message('fileuploaderror', 'error');
@@ -249,7 +95,7 @@ if (is_array($_FILES['_file'])) {
$IMPORT_STATS->inserted = $IMPORT_STATS->skipped = $IMPORT_STATS->invalid = $IMPORT_STATS->errors = 0;
if ($replace) {
- $CONTACTS->delete_all();
+ $CONTACTS->delete_all($CONTACTS->groups && $with_groups < 2);
}
if ($with_groups) {
@@ -276,7 +122,7 @@ if (is_array($_FILES['_file'])) {
// We're using UTF8 internally
$email = $vcard->email[0];
- $email = rcube_idn_to_utf8($email);
+ $email = rcube_utils::idn_to_utf8($email);
if (!$replace) {
$existing = null;
@@ -330,12 +176,168 @@ if (is_array($_FILES['_file'])) {
}
-$OUTPUT->set_pagetitle(rcube_label('importcontacts'));
+$OUTPUT->set_pagetitle($RCMAIL->gettext('importcontacts'));
$OUTPUT->add_handlers(array(
- 'importstep' => $importstep,
- 'importnav' => 'rcmail_import_buttons',
+ 'importstep' => $importstep,
+ 'importnav' => 'rcmail_import_buttons',
));
// render page
$OUTPUT->send('importcontacts');
+
+
+
+/**
+ * Handler function to display the import/upload form
+ */
+function rcmail_import_form($attrib)
+{
+ global $RCMAIL, $OUTPUT;
+
+ $target = rcube_utils::get_input_value('_target', rcube_utils::INPUT_GPC);
+
+ $attrib += array('id' => "rcmImportForm");
+
+ $writable_books = $RCMAIL->get_address_sources(true, true);
+
+ $upload = new html_inputfield(array(
+ 'type' => 'file',
+ 'name' => '_file[]',
+ 'id' => 'rcmimportfile',
+ 'size' => 40,
+ 'multiple' => 'multiple',
+ ));
+ $form = html::p(null, html::label('rcmimportfile', $RCMAIL->gettext('importfromfile')) . $upload->show());
+ $table = new html_table(array('cols' => 2));
+
+ // addressbook selector
+ if (count($writable_books) > 1) {
+ $select = new html_select(array('name' => '_target', 'id' => 'rcmimporttarget', 'is_escaped' => true));
+
+ foreach ($writable_books as $book) {
+ $select->add($book['name'], $book['id']);
+ }
+
+ $table->add('title', html::label('rcmimporttarget', $RCMAIL->gettext('importtarget')));
+ $table->add(null, $select->show($target));
+ }
+ else {
+ $abook = new html_hiddenfield(array('name' => '_target', 'value' => key($writable_books)));
+ $form .= $abook->show();
+ }
+
+ // selector for group import options
+ if (count($writable_books) >= 1 || $writable_books[0]->groups) {
+ $select = new html_select(array('name' => '_groups', 'id' => 'rcmimportgroups', 'is_escaped' => true));
+ $select->add($RCMAIL->gettext('none'), '0');
+ $select->add($RCMAIL->gettext('importgroupsall'), '1');
+ $select->add($RCMAIL->gettext('importgroupsexisting'), '2');
+
+ $table->add('title', html::label('rcmimportgroups', $RCMAIL->gettext('importgroups')));
+ $table->add(null, $select->show(rcube_utils::get_input_value('_groups', rcube_utils::INPUT_GPC)));
+ }
+
+ // checkbox to replace the entire address book
+ $check_replace = new html_checkbox(array('name' => '_replace', 'value' => 1, 'id' => 'rcmimportreplace'));
+ $table->add('title', html::label('rcmimportreplace', $RCMAIL->gettext('importreplace')));
+ $table->add(null, $check_replace->show(rcube_utils::get_input_value('_replace', rcube_utils::INPUT_GPC)));
+
+ $form .= $table->show(array('id' => null) + $attrib);
+
+ $OUTPUT->set_env('writable_source', !empty($writable_books));
+ $OUTPUT->add_label('selectimportfile','importwait');
+ $OUTPUT->add_gui_object('importform', $attrib['id']);
+
+ $out = html::p(null, rcube::Q($RCMAIL->gettext('importdesc'), 'show'))
+ . $OUTPUT->form_tag(array(
+ 'action' => $RCMAIL->url('import'),
+ 'method' => 'post',
+ 'enctype' => 'multipart/form-data') + $attrib,
+ $form);
+
+ return $out;
+}
+
+/**
+ * Render the confirmation page for the import process
+ */
+function rcmail_import_confirm($attrib)
+{
+ global $IMPORT_STATS, $RCMAIL;
+
+ $vars = get_object_vars($IMPORT_STATS);
+ $vars['names'] = $vars['skipped_names'] = '';
+
+ $content = html::p(null, $RCMAIL->gettext(array(
+ 'name' => 'importconfirm',
+ 'nr' => $IMPORT_STATS->inserted,
+ 'vars' => $vars,
+ )) . ($IMPORT_STATS->names ? ':' : '.'));
+
+ if ($IMPORT_STATS->names) {
+ $content .= html::p('em', join(', ', array_map('Q', $IMPORT_STATS->names)));
+ }
+
+ if ($IMPORT_STATS->skipped) {
+ $content .= html::p(null, $RCMAIL->gettext(array(
+ 'name' => 'importconfirmskipped',
+ 'nr' => $IMPORT_STATS->skipped,
+ 'vars' => $vars,
+ )) . ':')
+ . html::p('em', join(', ', array_map('Q', $IMPORT_STATS->skipped_names)));
+ }
+
+ return html::div($attrib, $content);
+}
+
+/**
+ * Create navigation buttons for the current import step
+ */
+function rcmail_import_buttons($attrib)
+{
+ global $IMPORT_STATS, $OUTPUT;
+
+ $target = rcube_utils::get_input_value('_target', rcube_utils::INPUT_GPC);
+
+ $attrib += array('type' => 'input');
+ unset($attrib['name']);
+
+ if (is_object($IMPORT_STATS)) {
+ $attrib['class'] = trim($attrib['class'] . ' mainaction');
+ $out = $OUTPUT->button(array('command' => 'list', 'prop' => $target, 'label' => 'done') + $attrib);
+ }
+ else {
+ $out = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib);
+ $out .= '&nbsp;';
+ $attrib['class'] = trim($attrib['class'] . ' mainaction');
+ $out .= $OUTPUT->button(array('command' => 'import', 'label' => 'import') + $attrib);
+ }
+
+ return $out;
+}
+
+/**
+ * Returns the matching group id. If group doesn't exist, it'll be created if allowed.
+ */
+function rcmail_import_group_id($group_name, $CONTACTS, $create, &$import_groups)
+{
+ $group_id = 0;
+ foreach ($import_groups as $key => $group) {
+ if (strtolower($group['name']) == strtolower($group_name)) {
+ $group_id = $group['ID'];
+ break;
+ }
+ }
+
+ // create a new group
+ if (!$group_id && $create) {
+ $new_group = $CONTACTS->create_group($group_name);
+ if (!$new_group['ID'])
+ $new_group['ID'] = $new_group['id'];
+ $import_groups[] = $new_group;
+ $group_id = $new_group['ID'];
+ }
+
+ return $group_id;
+}
diff --git a/program/steps/addressbook/mailto.inc b/program/steps/addressbook/mailto.inc
index c3cbcadca..f5ff20bc0 100644
--- a/program/steps/addressbook/mailto.inc
+++ b/program/steps/addressbook/mailto.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/mailto.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2007, The Roundcube Dev Team |
+ | Copyright (C) 2007-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,30 +19,27 @@
+-----------------------------------------------------------------------+
*/
-$cids = rcmail_get_cids();
-$mailto = array();
+$cids = rcmail_get_cids();
+$mailto = array();
$recipients = null;
-foreach ($cids as $source => $cid)
-{
+foreach ($cids as $source => $cid) {
$CONTACTS = $RCMAIL->get_address_book($source);
- if ($CONTACTS->ready)
- {
+ if ($CONTACTS->ready) {
$CONTACTS->set_page(1);
$CONTACTS->set_pagesize(count($cid) + 2); // +2 to skip counting query
$recipients = $CONTACTS->search($CONTACTS->primary_key, $cid, 0, true, true, 'email');
}
}
-if (!empty($_REQUEST['_gid']) && isset($_REQUEST['_source']))
-{
- $source = get_input_value('_source', RCUBE_INPUT_GPC);
+if (!empty($_REQUEST['_gid']) && isset($_REQUEST['_source'])) {
+ $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
$CONTACTS = $RCMAIL->get_address_book($source);
-
- $group_id = get_input_value('_gid', RCUBE_INPUT_GPC);
+
+ $group_id = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC);
$group_data = $CONTACTS->get_group($group_id);
-
+
// group has an email address assigned: use that
if ($group_data['email']) {
$mailto[] = format_email_recipient($group_data['email'][0], $group_data['name']);
@@ -55,16 +52,14 @@ if (!empty($_REQUEST['_gid']) && isset($_REQUEST['_source']))
}
}
-if ($recipients)
-{
+if ($recipients) {
while (is_object($recipients) && ($rec = $recipients->iterate())) {
$emails = $CONTACTS->get_col_values('email', $rec, true);
$mailto[] = format_email_recipient($emails[0], $rec['name']);
}
}
-if (!empty($mailto))
-{
+if (!empty($mailto)) {
$mailto_str = join(', ', $mailto);
$mailto_id = substr(md5($mailto_str), 0, 16);
$_SESSION['mailto'][$mailto_id] = urlencode($mailto_str);
diff --git a/program/steps/addressbook/move.inc b/program/steps/addressbook/move.inc
index f8204e9ee..6a70e7bda 100644
--- a/program/steps/addressbook/move.inc
+++ b/program/steps/addressbook/move.inc
@@ -25,8 +25,8 @@ if (!$OUTPUT->ajax_call) {
}
$cids = rcmail_get_cids();
-$target = get_input_value('_to', RCUBE_INPUT_POST);
-$target_group = get_input_value('_togid', RCUBE_INPUT_POST);
+$target = rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST);
+$target_group = rcube_utils::get_input_value('_togid', rcube_utils::INPUT_POST);
$all = 0;
$deleted = 0;
diff --git a/program/steps/addressbook/photo.inc b/program/steps/addressbook/photo.inc
index 658027de4..482185735 100644
--- a/program/steps/addressbook/photo.inc
+++ b/program/steps/addressbook/photo.inc
@@ -26,7 +26,7 @@ $source = key($cids);
$cid = $cids ? array_shift($cids[$source]) : null;
// read the referenced file
-if (($file_id = get_input_value('_photo', RCUBE_INPUT_GPC)) && ($tempfile = $_SESSION['contacts']['files'][$file_id])) {
+if (($file_id = rcube_utils::get_input_value('_photo', rcube_utils::INPUT_GPC)) && ($tempfile = $_SESSION['contacts']['files'][$file_id])) {
$tempfile = $RCMAIL->plugins->exec_hook('attachment_display', $tempfile);
if ($tempfile['status']) {
if ($tempfile['data'])
@@ -37,7 +37,7 @@ if (($file_id = get_input_value('_photo', RCUBE_INPUT_GPC)) && ($tempfile = $_SE
}
else {
// by email, search for contact first
- if ($email = get_input_value('_email', RCUBE_INPUT_GPC)) {
+ if ($email = rcube_utils::get_input_value('_email', rcube_utils::INPUT_GPC)) {
foreach ($RCMAIL->get_address_sources() as $s) {
$abook = $RCMAIL->get_address_book($s['id']);
$result = $abook->search(array('email'), $email, 1, true, true, 'photo');
@@ -77,7 +77,7 @@ else {
}
// deliver alt image
-if (!$data && ($alt_img = get_input_value('_alt', RCUBE_INPUT_GPC)) && is_file($alt_img)) {
+if (!$data && ($alt_img = rcube_utils::get_input_value('_alt', rcube_utils::INPUT_GPC)) && is_file($alt_img)) {
$data = file_get_contents($alt_img);
}
@@ -86,6 +86,6 @@ if (!$cid && $email) {
$RCMAIL->output->future_expire_header(86400);
}
-header('Content-Type: ' . rc_image_content_type($data));
+header('Content-Type: ' . rcube_mime::image_content_type($data));
echo $data ? $data : file_get_contents('program/resources/blank.gif');
exit;
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index 2adc53bcf..94556f96b 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/save.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2011, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,80 +19,87 @@
+-----------------------------------------------------------------------+
*/
-$CONTACTS = rcmail_contact_source(null, true, true);
-$cid = get_input_value('_cid', RCUBE_INPUT_POST);
+$CONTACTS = rcmail_contact_source(null, true, true);
+$cid = rcube_utils::get_input_value('_cid', rcube_utils::INPUT_POST);
$return_action = empty($cid) ? 'add' : 'edit';
// Source changed, display the form again
if (!empty($_GET['_reload'])) {
- rcmail_overwrite_action($return_action);
- return;
+ $RCMAIL->overwrite_action($return_action);
+ return;
}
// cannot edit record
if ($CONTACTS->readonly) {
- $OUTPUT->show_message('contactreadonly', 'error');
- rcmail_overwrite_action($return_action);
- return;
+ $OUTPUT->show_message('contactreadonly', 'error');
+ $RCMAIL->overwrite_action($return_action);
+ return;
}
// read POST values into hash array
$a_record = array();
foreach ($GLOBALS['CONTACT_COLTYPES'] as $col => $colprop) {
- $fname = '_'.$col;
- if ($colprop['composite'])
- continue;
- // gather form data of composite fields
- if ($colprop['childs']) {
- $values = array();
- foreach ($colprop['childs'] as $childcol => $cp) {
- $vals = get_input_value('_'.$childcol, RCUBE_INPUT_POST, true);
- foreach ((array)$vals as $i => $val)
- $values[$i][$childcol] = $val;
+ if ($colprop['composite']) {
+ continue;
}
- $subtypes = isset($_REQUEST['_subtype_' . $col]) ? (array)get_input_value('_subtype_' . $col, RCUBE_INPUT_POST) : array('');
- foreach ($subtypes as $i => $subtype) {
- $suffix = $subtype ? ':'.$subtype : '';
- if ($values[$i])
- $a_record[$col.$suffix][] = $values[$i];
- }
- }
- // assign values and subtypes
- else if (is_array($_POST[$fname])) {
- $values = get_input_value($fname, RCUBE_INPUT_POST, true);
- $subtypes = get_input_value('_subtype_' . $col, RCUBE_INPUT_POST);
-
- foreach ($values as $i => $val) {
- if ($col == 'email') {
- // extract email from full address specification, e.g. "Name" <addr@domain.tld>
- $addr = rcube_mime::decode_address_list($val, 1, false);
- if (!empty($addr) && ($addr = array_pop($addr)) && $addr['mailto']) {
- $val = $addr['mailto'];
+
+ $fname = '_'.$col;
+
+ // gather form data of composite fields
+ if ($colprop['childs']) {
+ $values = array();
+ foreach ($colprop['childs'] as $childcol => $cp) {
+ $vals = rcube_utils::get_input_value('_'.$childcol, rcube_utils::INPUT_POST, true);
+ foreach ((array)$vals as $i => $val) {
+ $values[$i][$childcol] = $val;
+ }
}
- }
- $subtype = $subtypes[$i] ? ':'.$subtypes[$i] : '';
- $a_record[$col.$subtype][] = $val;
+ $subtypes = isset($_REQUEST['_subtype_' . $col]) ? (array)rcube_utils::get_input_value('_subtype_' . $col, rcube_utils::INPUT_POST) : array('');
+ foreach ($subtypes as $i => $subtype) {
+ $suffix = $subtype ? ':'.$subtype : '';
+ if ($values[$i]) {
+ $a_record[$col.$suffix][] = $values[$i];
+ }
+ }
}
- }
- else if (isset($_POST[$fname])) {
- $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST, true);
-
- // normalize the submitted date strings
- if ($colprop['type'] == 'date') {
- if ($timestamp = rcube_utils::strtotime($a_record[$col])) {
- $a_record[$col] = date('Y-m-d', $timestamp);
+ // assign values and subtypes
+ else if (is_array($_POST[$fname])) {
+ $values = rcube_utils::get_input_value($fname, rcube_utils::INPUT_POST, true);
+ $subtypes = rcube_utils::get_input_value('_subtype_' . $col, rcube_utils::INPUT_POST);
+
+ foreach ($values as $i => $val) {
+ if ($col == 'email') {
+ // extract email from full address specification, e.g. "Name" <addr@domain.tld>
+ $addr = rcube_mime::decode_address_list($val, 1, false);
+ if (!empty($addr) && ($addr = array_pop($addr)) && $addr['mailto']) {
+ $val = $addr['mailto'];
+ }
+ }
+
+ $subtype = $subtypes[$i] ? ':'.$subtypes[$i] : '';
+ $a_record[$col.$subtype][] = $val;
}
- else {
- unset($a_record[$col]);
+ }
+ else if (isset($_POST[$fname])) {
+ $a_record[$col] = rcube_utils::get_input_value($fname, rcube_utils::INPUT_POST, true);
+
+ // normalize the submitted date strings
+ if ($colprop['type'] == 'date') {
+ if ($a_record[$col] && ($dt = rcube_utils::anytodatetime($a_record[$col]))) {
+ $a_record[$col] = $dt->format('Y-m-d');
+ }
+ else {
+ unset($a_record[$col]);
+ }
}
}
- }
}
// Generate contact's display name (must be before validation)
if (empty($a_record['name'])) {
$a_record['name'] = rcube_addressbook::compose_display_name($a_record, true);
+
// Reset it if equals to email address (from compose_display_name())
$email = rcube_addressbook::get_col_values('email', $a_record, true);
if ($a_record['name'] == $email[0]) {
@@ -103,9 +110,9 @@ if (empty($a_record['name'])) {
// do input checks (delegated to $CONTACTS instance)
if (!$CONTACTS->validate($a_record)) {
$err = (array)$CONTACTS->get_error();
- $OUTPUT->show_message($err['message'] ? Q($err['message']) : 'formincomplete', 'warning');
+ $OUTPUT->show_message($err['message'] ? rcube::Q($err['message']) : 'formincomplete', 'warning');
$GLOBALS['EDIT_RECORD'] = $a_record; // store submitted data to be used in edit form
- rcmail_overwrite_action($return_action);
+ $RCMAIL->overwrite_action($return_action);
return;
}
@@ -127,123 +134,125 @@ if (isset($a_record['photo'])) {
$RCMAIL->session->remove('contacts');
}
-$source = get_input_value('_source', RCUBE_INPUT_GPC);
+$source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
// update an existing contact
-if (!empty($cid))
-{
- $plugin = $RCMAIL->plugins->exec_hook('contact_update',
- array('id' => $cid, 'record' => $a_record, 'source' => $source));
- $a_record = $plugin['record'];
-
- if (!$plugin['abort'])
- $result = $CONTACTS->update($cid, $a_record);
- else
- $result = $plugin['result'];
-
- if ($result) {
- // LDAP DN change
- if (is_string($result) && strlen($result)>1) {
- $newcid = $result;
- // change cid in POST for 'show' action
- $_POST['_cid'] = $newcid;
- }
+if (!empty($cid)) {
+ $plugin = $RCMAIL->plugins->exec_hook('contact_update',
+ array('id' => $cid, 'record' => $a_record, 'source' => $source));
+ $a_record = $plugin['record'];
- // define list of cols to be displayed
- $a_js_cols = array();
- $record = $CONTACTS->get_record($newcid ? $newcid : $cid, true);
- $record['email'] = reset($CONTACTS->get_col_values('email', $record, true));
- $record['name'] = rcube_addressbook::compose_list_name($record);
-
- foreach (array('name') as $col)
- $a_js_cols[] = Q((string)$record[$col]);
-
- // update the changed col in list
- $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source, $record);
-
- // show confirmation
- $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
- rcmail_overwrite_action('show');
- }
- else {
- // show error message
- $err = $CONTACTS->get_error();
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : ($err['message'] ? $err['message'] : 'errorsaving'), 'error', null, false);
- rcmail_overwrite_action('show');
- }
+ if (!$plugin['abort'])
+ $result = $CONTACTS->update($cid, $a_record);
+ else
+ $result = $plugin['result'];
+
+ if ($result) {
+ // LDAP DN change
+ if (is_string($result) && strlen($result)>1) {
+ $newcid = $result;
+ // change cid in POST for 'show' action
+ $_POST['_cid'] = $newcid;
+ }
+
+ // define list of cols to be displayed
+ $a_js_cols = array();
+ $record = $CONTACTS->get_record($newcid ? $newcid : $cid, true);
+ $record['email'] = reset($CONTACTS->get_col_values('email', $record, true));
+ $record['name'] = rcube_addressbook::compose_list_name($record);
+
+ foreach (array('name') as $col) {
+ $a_js_cols[] = rcube::Q((string)$record[$col]);
+ }
+
+ // update the changed col in list
+ $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source, $record);
+
+ // show confirmation
+ $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
+ $RCMAIL->overwrite_action('show');
+ }
+ else {
+ // show error message
+ $err = $CONTACTS->get_error();
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : ($err['message'] ? $err['message'] : 'errorsaving'), 'error', null, false);
+ $RCMAIL->overwrite_action('show');
+ }
}
// insert a new contact
else {
- // Name of the addressbook already selected on the list
- $orig_source = get_input_value('_orig_source', RCUBE_INPUT_GPC);
-
- if (!strlen($source))
- $source = $orig_source;
-
- // show notice if existing contacts with same e-mail are found
- foreach ($CONTACTS->get_col_values('email', $a_record, true) as $email) {
- if ($email && ($res = $CONTACTS->search('email', $email, 1, false, true)) && $res->count) {
- $OUTPUT->show_message('contactexists', 'notice', null, false);
- break;
- }
- }
-
- $plugin = $RCMAIL->plugins->exec_hook('contact_create', array(
- 'record' => $a_record, 'source' => $source));
- $a_record = $plugin['record'];
-
- // insert record and send response
- if (!$plugin['abort'])
- $insert_id = $CONTACTS->insert($a_record);
- else
- $insert_id = $plugin['result'];
-
- if ($insert_id) {
- $CONTACTS->reset();
-
- // add new contact to the specified group
- if ($CONTACTS->groups && $CONTACTS->group_id) {
- $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array(
- 'group_id' => $CONTACTS->group_id, 'ids' => $insert_id, 'source' => $source));
-
- $counts = $CONTACTS->count();
-
- if (!$plugin['abort']) {
- if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($counts->count + 1 > $maxnum))
- $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum));
-
- $CONTACTS->add_to_group($plugin['group_id'], $plugin['ids']);
- }
+ // Name of the addressbook already selected on the list
+ $orig_source = rcube_utils::get_input_value('_orig_source', rcube_utils::INPUT_GPC);
+
+ if (!strlen($source)) {
+ $source = $orig_source;
}
+
+ // show notice if existing contacts with same e-mail are found
+ foreach ($CONTACTS->get_col_values('email', $a_record, true) as $email) {
+ if ($email && ($res = $CONTACTS->search('email', $email, 1, false, true)) && $res->count) {
+ $OUTPUT->show_message('contactexists', 'notice', null, false);
+ break;
+ }
+ }
+
+ $plugin = $RCMAIL->plugins->exec_hook('contact_create', array(
+ 'record' => $a_record, 'source' => $source));
+ $a_record = $plugin['record'];
+
+ // insert record and send response
+ if (!$plugin['abort'])
+ $insert_id = $CONTACTS->insert($a_record);
else
- $counts = $CONTACTS->count();
+ $insert_id = $plugin['result'];
+
+ if ($insert_id) {
+ $CONTACTS->reset();
+
+ // add new contact to the specified group
+ if ($CONTACTS->groups && $CONTACTS->group_id) {
+ $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array(
+ 'group_id' => $CONTACTS->group_id, 'ids' => $insert_id, 'source' => $source));
- if ((string)$source === (string)$orig_source) {
- // add contact row or jump to the page where it should appear
- $CONTACTS->reset();
- $result = $CONTACTS->search($CONTACTS->primary_key, $insert_id);
+ $counts = $CONTACTS->count();
- rcmail_js_contacts_list($result, 'parent.');
- $OUTPUT->command('parent.contact_list.select', html_identifier($insert_id));
+ if (!$plugin['abort']) {
+ if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($counts->count + 1 > $maxnum))
+ $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum));
- // update record count display
- $CONTACTS->reset();
- $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text($counts));
+ $CONTACTS->add_to_group($plugin['group_id'], $plugin['ids']);
+ }
+ }
+ else {
+ $counts = $CONTACTS->count();
+ }
+
+ if ((string)$source === (string)$orig_source) {
+ // add contact row or jump to the page where it should appear
+ $CONTACTS->reset();
+ $result = $CONTACTS->search($CONTACTS->primary_key, $insert_id);
+
+ rcmail_js_contacts_list($result, 'parent.');
+ $OUTPUT->command('parent.contact_list.select', rcube_utils::html_identifier($insert_id));
+
+ // update record count display
+ $CONTACTS->reset();
+ $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text($counts));
+ }
+ else {
+ // re-set iframe
+ $OUTPUT->command('parent.show_contentframe');
+ }
+
+ // show confirmation
+ $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
+ $OUTPUT->send('iframe');
}
else {
- // re-set iframe
- $OUTPUT->command('parent.show_contentframe');
+ // show error message
+ $err = $CONTACTS->get_error();
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : ($err['message'] ? $err['message'] : 'errorsaving'), 'error', null, false);
+ $RCMAIL->overwrite_action('add');
}
-
- // show confirmation
- $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
- $OUTPUT->send('iframe');
- }
- else {
- // show error message
- $err = $CONTACTS->get_error();
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : ($err['message'] ? $err['message'] : 'errorsaving'), 'error', null, false);
- rcmail_overwrite_action('add');
- }
}
diff --git a/program/steps/addressbook/search.inc b/program/steps/addressbook/search.inc
index d153c255a..bb22ec139 100644
--- a/program/steps/addressbook/search.inc
+++ b/program/steps/addressbook/search.inc
@@ -22,8 +22,8 @@
*/
if ($RCMAIL->action == 'search-create') {
- $id = get_input_value('_search', RCUBE_INPUT_POST);
- $name = get_input_value('_name', RCUBE_INPUT_POST, true);
+ $id = rcube_utils::get_input_value('_search', rcube_utils::INPUT_POST);
+ $name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true);
if (($params = $_SESSION['search_params']) && $params['id'] == $id) {
@@ -46,7 +46,7 @@ if ($RCMAIL->action == 'search-create') {
if ($result) {
$OUTPUT->show_message('savedsearchcreated', 'confirmation');
- $OUTPUT->command('insert_saved_search', Q($name), Q($result));
+ $OUTPUT->command('insert_saved_search', rcube::Q($name), rcube::Q($result));
}
else
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'savedsearchcreateerror', 'error');
@@ -55,7 +55,7 @@ if ($RCMAIL->action == 'search-create') {
}
if ($RCMAIL->action == 'search-delete') {
- $id = get_input_value('_sid', RCUBE_INPUT_POST);
+ $id = rcube_utils::get_input_value('_sid', rcube_utils::INPUT_POST);
$plugin = $RCMAIL->plugins->exec_hook('saved_search_delete', array('id' => $id));
@@ -66,9 +66,9 @@ if ($RCMAIL->action == 'search-delete') {
if ($result) {
$OUTPUT->show_message('savedsearchdeleted', 'confirmation');
- $OUTPUT->command('remove_search_item', Q($id));
+ $OUTPUT->command('remove_search_item', rcube::Q($id));
// contact list will be cleared, clear also page counter
- $OUTPUT->command('set_rowcount', rcube_label('nocontactsfound'));
+ $OUTPUT->command('set_rowcount', $RCMAIL->gettext('nocontactsfound'));
$OUTPUT->set_env('pagecount', 0);
}
else
@@ -91,7 +91,7 @@ function rcmail_contact_search()
global $RCMAIL, $OUTPUT, $SEARCH_MODS_DEFAULT, $PAGE_SIZE;
$adv = isset($_POST['_adv']);
- $sid = get_input_value('_sid', RCUBE_INPUT_GET);
+ $sid = rcube_utils::get_input_value('_sid', rcube_utils::INPUT_GET);
// get search criteria from saved search
if ($sid && ($search = $RCMAIL->user->get_search($sid))) {
@@ -101,7 +101,7 @@ function rcmail_contact_search()
// get fields/values from advanced search form
else if ($adv) {
foreach (array_keys($_POST) as $key) {
- $s = trim(get_input_value($key, RCUBE_INPUT_POST, true));
+ $s = trim(rcube_utils::get_input_value($key, rcube_utils::INPUT_POST, true));
if (strlen($s) && preg_match('/^_search_([a-zA-Z0-9_-]+)$/', $key, $m)) {
$search[] = $s;
$fields[] = $m[1];
@@ -115,8 +115,8 @@ function rcmail_contact_search()
}
// quick-search
else {
- $search = trim(get_input_value('_q', RCUBE_INPUT_GET, true));
- $fields = explode(',', get_input_value('_headers', RCUBE_INPUT_GET));
+ $search = trim(rcube_utils::get_input_value('_q', rcube_utils::INPUT_GET, true));
+ $fields = explode(',', rcube_utils::get_input_value('_headers', rcube_utils::INPUT_GET));
if (empty($fields)) {
$fields = array_keys($SEARCH_MODS_DEFAULT);
@@ -257,17 +257,17 @@ function rcmail_contact_search_form($attrib)
$form = array(
'main' => array(
- 'name' => rcube_label('properties'),
+ 'name' => $RCMAIL->gettext('properties'),
'content' => array(
),
),
'personal' => array(
- 'name' => rcube_label('personalinfo'),
+ 'name' => $RCMAIL->gettext('personalinfo'),
'content' => array(
),
),
'other' => array(
- 'name' => rcube_label('other'),
+ 'name' => $RCMAIL->gettext('other'),
'content' => array(
),
),
@@ -297,7 +297,7 @@ function rcmail_contact_search_form($attrib)
if ($colprop['type'] != 'image' && !$colprop['nosearch'])
{
$ftype = $colprop['type'] == 'select' ? 'select' : 'text';
- $label = isset($colprop['label']) ? $colprop['label'] : rcube_label($col);
+ $label = isset($colprop['label']) ? $colprop['label'] : $RCMAIL->gettext($col);
$category = $colprop['category'] ? $colprop['category'] : 'other';
// load jquery UI datepicker for date fields
@@ -307,8 +307,8 @@ function rcmail_contact_search_form($attrib)
$colprop['size'] = $i_size;
- $content = html::div('row', html::div('contactfieldlabel label', Q($label))
- . html::div('contactfieldcontent', rcmail_get_edit_field('search_'.$col, '', $colprop, $ftype)));
+ $content = html::div('row', html::div('contactfieldlabel label', rcube::Q($label))
+ . html::div('contactfieldcontent', rcube_output::get_edit_field('search_'.$col, '', $colprop, $ftype)));
$form[$category]['content'][] = $content;
}
@@ -332,7 +332,7 @@ function rcmail_contact_search_form($attrib)
$content = html::div('contactfieldgroup', join("\n", $f['content']));
$out .= html::tag('fieldset', $attrib,
- html::tag('legend', null, Q($f['name']))
+ html::tag('legend', null, rcube::Q($f['name']))
. $content) . "\n";
}
}
diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc
index efab5e9e5..f4224a3e2 100644
--- a/program/steps/addressbook/show.inc
+++ b/program/steps/addressbook/show.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/show.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -38,6 +38,15 @@ if ($cid && ($record = $CONTACTS->get_record($cid, true))) {
// get address book name (for display)
rcmail_set_sourcename($CONTACTS);
+$OUTPUT->add_handlers(array(
+ 'contacthead' => 'rcmail_contact_head',
+ 'contactdetails' => 'rcmail_contact_details',
+ 'contactphoto' => 'rcmail_contact_photo',
+));
+
+$OUTPUT->send('contact');
+
+
function rcmail_contact_head($attrib)
{
@@ -45,7 +54,7 @@ function rcmail_contact_head($attrib)
// check if we have a valid result
if (!(($result = $CONTACTS->get_result()) && ($record = $result->first()))) {
- $RCMAIL->output->show_message('contactnotfound');
+ $RCMAIL->output->show_message('contactnotfound', 'error');
return false;
}
@@ -72,7 +81,6 @@ function rcmail_contact_details($attrib)
// check if we have a valid result
if (!(($result = $CONTACTS->get_result()) && ($record = $result->first()))) {
- //$RCMAIL->output->show_message('contactnotfound');
return false;
}
@@ -80,7 +88,7 @@ function rcmail_contact_details($attrib)
$form = array(
'contact' => array(
- 'name' => rcube_label('properties'),
+ 'name' => $RCMAIL->gettext('properties'),
'content' => array(
'email' => array('size' => $i_size, 'render_func' => 'rcmail_render_email_value'),
'phone' => array('size' => $i_size),
@@ -90,7 +98,7 @@ function rcmail_contact_details($attrib)
),
),
'personal' => array(
- 'name' => rcube_label('personalinfo'),
+ 'name' => $RCMAIL->gettext('personalinfo'),
'content' => array(
'gender' => array('size' => $i_size),
'maidenname' => array('size' => $i_size),
@@ -102,19 +110,19 @@ function rcmail_contact_details($attrib)
),
),
);
-
+
if (isset($CONTACT_COLTYPES['notes'])) {
$form['notes'] = array(
- 'name' => rcube_label('notes'),
+ 'name' => $RCMAIL->gettext('notes'),
'content' => array(
'notes' => array('type' => 'textarea', 'label' => false),
),
);
}
-
+
if ($CONTACTS->groups) {
$form['groups'] = array(
- 'name' => rcube_label('groups'),
+ 'name' => $RCMAIL->gettext('groups'),
'content' => rcmail_contact_record_groups($record['ID']),
);
}
@@ -125,12 +133,14 @@ function rcmail_contact_details($attrib)
function rcmail_render_email_value($email)
{
+ global $RCMAIL;
+
return html::a(array(
'href' => 'mailto:' . $email,
- 'onclick' => sprintf("return %s.command('compose','%s',this)", JS_OBJECT_NAME, JQ($email)),
- 'title' => rcube_label('composeto'),
+ 'onclick' => sprintf("return %s.command('compose','%s',this)", rcmail_output::JS_OBJECT_NAME, rcube::JQ($email)),
+ 'title' => $RCMAIL->gettext('composeto'),
'class' => 'email',
- ), Q($email));
+ ), rcube::Q($email));
}
@@ -141,7 +151,7 @@ function rcmail_render_url_value($url)
'href' => $prefix . $url,
'target' => '_blank',
'class' => 'url',
- ), Q($url));
+ ), rcube::Q($url));
}
@@ -164,10 +174,10 @@ function rcmail_contact_record_groups($contact_id)
$gid = $group['ID'];
$table->add(null, $checkbox->show($members[$gid] ? $gid : null,
array('value' => $gid, 'id' => 'ff_gid' . $gid)));
- $table->add(null, html::label('ff_gid' . $gid, Q($group['name'])));
+ $table->add(null, html::label('ff_gid' . $gid, rcube::Q($group['name'])));
}
- $hiddenfields = new html_hiddenfield(array('name' => '_source', 'value' => get_input_value('_source', RCUBE_INPUT_GPC)));
+ $hiddenfields = new html_hiddenfield(array('name' => '_source', 'value' => rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC)));
$hiddenfields->add(array('name' => '_cid', 'value' => $contact_id));
$form_start = $RCMAIL->output->request_form(array(
@@ -182,12 +192,3 @@ function rcmail_contact_record_groups($contact_id)
return $form_start . html::tag('fieldset', 'contactfieldgroup contactgroups', $table->show()) . $form_end;
}
-
-
-$OUTPUT->add_handlers(array(
- 'contacthead' => 'rcmail_contact_head',
- 'contactdetails' => 'rcmail_contact_details',
- 'contactphoto' => 'rcmail_contact_photo',
-));
-
-$OUTPUT->send('contact');
diff --git a/program/steps/addressbook/undo.inc b/program/steps/addressbook/undo.inc
index c23bd1cb6..ec3feb9c0 100644
--- a/program/steps/addressbook/undo.inc
+++ b/program/steps/addressbook/undo.inc
@@ -5,7 +5,7 @@
| program/steps/addressbook/undo.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2011, Kolab Systems AG |
+ | Copyright (C) 2011-2013, Kolab Systems AG |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,14 +20,14 @@
*/
// process ajax requests only
-if (!$OUTPUT->ajax_call)
+if (!$OUTPUT->ajax_call) {
return;
+}
$undo = $_SESSION['contact_undo'];
$delcnt = 0;
-foreach ((array)$undo['data'] as $source => $cid)
-{
+foreach ((array)$undo['data'] as $source => $cid) {
$CONTACTS = rcmail_contact_source($source);
$plugin = $RCMAIL->plugins->exec_hook('contact_undelete', array(
diff --git a/program/steps/addressbook/upload_photo.inc b/program/steps/addressbook/upload_photo.inc
index 035d67e83..dbb76d229 100644
--- a/program/steps/addressbook/upload_photo.inc
+++ b/program/steps/addressbook/upload_photo.inc
@@ -54,7 +54,7 @@ if ($filepath = $_FILES['_photo']['tmp_name']) {
));
}
else {
- $attachment['error'] = rcube_label('invalidimageformat');
+ $attachment['error'] = $RCMAIL->gettext('invalidimageformat');
}
if ($attachment['status'] && !$attachment['abort']) {
@@ -63,14 +63,16 @@ if ($filepath = $_FILES['_photo']['tmp_name']) {
$OUTPUT->command('replace_contact_photo', $file_id);
}
else { // upload failed
- $err = $_FILES['_photo']['error'];
+ $err = $_FILES['_photo']['error'];
+ $size = $RCMAIL->show_bytes(parse_bytes(ini_get('upload_max_filesize')));
+
if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE)
- $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))));
+ $msg = $RCMAIL->gettext(array('name' => 'filesizeerror', 'vars' => array('size' => $size)));
else if ($attachment['error'])
$msg = $attachment['error'];
else
- $msg = rcube_label('fileuploaderror');
-
+ $msg = $RCMAIL->gettext('fileuploaderror');
+
$OUTPUT->command('display_message', $msg, 'error');
}
}
@@ -78,9 +80,9 @@ else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// if filesize exceeds post_max_size then $_FILES array is empty,
// show filesizeerror instead of fileuploaderror
if ($maxsize = ini_get('post_max_size'))
- $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes($maxsize)))));
+ $msg = $RCMAIL->gettext(array('name' => 'filesizeerror', 'vars' => array('size' => $RCMAIL->show_bytes(parse_bytes($maxsize)))));
else
- $msg = rcube_label('fileuploaderror');
+ $msg = $RCMAIL->gettext('fileuploaderror');
$OUTPUT->command('display_message', $msg, 'error');
}
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index 380557766..76bf2ee32 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -5,7 +5,7 @@
| program/steps/mail/addcontact.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,69 +20,74 @@
*/
// only process ajax requests
-if (!$OUTPUT->ajax_call)
- return;
+if (!$OUTPUT->ajax_call) {
+ return;
+}
// Get default addressbook
$CONTACTS = $RCMAIL->get_address_book(-1, true);
-if (!empty($_POST['_address']) && is_object($CONTACTS))
-{
- $contact_arr = rcube_mime::decode_address_list(get_input_value('_address', RCUBE_INPUT_POST, true), 1, false);
-
- if (!empty($contact_arr[1]['mailto'])) {
- $contact = array(
- 'email' => $contact_arr[1]['mailto'],
- 'name' => $contact_arr[1]['name']
- );
-
- // Validity checks
- if (empty($contact['email'])) {
- $OUTPUT->show_message('errorsavingcontact', 'error');
- $OUTPUT->send();
- }
-
- $email = rcube_idn_to_ascii($contact['email']);
- if (!check_email($email, false)) {
- $OUTPUT->show_message('emailformaterror', 'error', array('email' => $contact['email']));
- $OUTPUT->send();
+if (!empty($_POST['_address']) && is_object($CONTACTS)) {
+ $address = rcube_utils::get_input_value('_address', rcube_utils::INPUT_POST, true);
+ $contact_arr = rcube_mime::decode_address_list($address, 1, false);
+
+ if (!empty($contact_arr[1]['mailto'])) {
+ $contact = array(
+ 'email' => $contact_arr[1]['mailto'],
+ 'name' => $contact_arr[1]['name'],
+ );
+
+ // Validity checks
+ if (empty($contact['email'])) {
+ $OUTPUT->show_message('errorsavingcontact', 'error');
+ $OUTPUT->send();
+ }
+
+ $email = rcube_utils::idn_to_ascii($contact['email']);
+ if (!rcube_utils::check_email($email, false)) {
+ $OUTPUT->show_message('emailformaterror', 'error', array('email' => $contact['email']));
+ $OUTPUT->send();
+ }
+
+ $contact['email'] = rcube_utils::idn_to_utf8($contact['email']);
+
+ $contact = $RCMAIL->plugins->exec_hook('contact_displayname', $contact);
+
+ if (empty($contact['firstname']) || empty($contact['surname'])) {
+ $contact['name'] = rcube_addressbook::compose_display_name($contact);
+ }
+
+ // validate contact record
+ if (!$CONTACTS->validate($contact, true)) {
+ $error = $CONTACTS->get_error();
+ // TODO: show dialog to complete record
+ // if ($error['type'] == rcube_addressbook::ERROR_VALIDATE) { }
+
+ $OUTPUT->show_message($error['message'] ? $error['message'] : 'errorsavingcontact', 'error');
+ $OUTPUT->send();
+ }
+
+ // check for existing contacts
+ $existing = $CONTACTS->search('email', $contact['email'], 1, false);
+
+ if ($done = $existing->count) {
+ $OUTPUT->show_message('contactexists', 'warning');
+ }
+ else {
+ $plugin = $RCMAIL->plugins->exec_hook('contact_create', array('record' => $contact, 'source' => null));
+ $contact = $plugin['record'];
+
+ $done = !$plugin['abort'] ? $CONTACTS->insert($contact) : $plugin['result'];
+
+ if ($done) {
+ $OUTPUT->show_message('addedsuccessfully', 'confirmation');
+ }
+ }
}
-
- $contact['email'] = rcube_idn_to_utf8($contact['email']);
- $contact = $RCMAIL->plugins->exec_hook('contact_displayname', $contact);
-
- if (empty($contact['firstname']) || empty($contact['surname']))
- $contact['name'] = rcube_addressbook::compose_display_name($contact);
-
- // validate contact record
- if (!$CONTACTS->validate($contact, true)) {
- $error = $CONTACTS->get_error();
- // TODO: show dialog to complete record
- // if ($error['type'] == rcube_addressbook::ERROR_VALIDATE) { }
-
- $OUTPUT->show_message($error['message'] ? $error['message'] : 'errorsavingcontact', 'error');
- $OUTPUT->send();
- }
-
- // check for existing contacts
- $existing = $CONTACTS->search('email', $contact['email'], 1, false);
-
- if ($done = $existing->count)
- $OUTPUT->show_message('contactexists', 'warning');
- else {
- $plugin = $RCMAIL->plugins->exec_hook('contact_create', array('record' => $contact, 'source' => null));
- $contact = $plugin['record'];
-
- $done = !$plugin['abort'] ? $CONTACTS->insert($contact) : $plugin['result'];
-
- if ($done)
- $OUTPUT->show_message('addedsuccessfully', 'confirmation');
- }
- }
}
-if (!$done)
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsavingcontact', 'error');
+if (!$done) {
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsavingcontact', 'error');
+}
$OUTPUT->send();
-
diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc
index 85aa9542b..85bc36cac 100644
--- a/program/steps/mail/attachments.inc
+++ b/program/steps/mail/attachments.inc
@@ -5,7 +5,7 @@
| program/steps/mail/attachments.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,62 +21,73 @@
// Upload progress update
if (!empty($_GET['_progress'])) {
- rcube_upload_progress();
+ $RCMAIL->upload_progress();
}
-$COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GPC);
+$COMPOSE_ID = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC);
$COMPOSE = null;
if ($COMPOSE_ID && $_SESSION['compose_data_' . $COMPOSE_ID]) {
- $SESSION_KEY = 'compose_data_' . $COMPOSE_ID;
- $COMPOSE =& $_SESSION[$SESSION_KEY];
+ $SESSION_KEY = 'compose_data_' . $COMPOSE_ID;
+ $COMPOSE =& $_SESSION[$SESSION_KEY];
}
if (!$COMPOSE) {
- die("Invalid session var!");
+ die("Invalid session var!");
}
// remove an attachment
-if ($RCMAIL->action=='remove-attachment')
-{
- $id = 'undefined';
- if (preg_match('/^rcmfile(\w+)$/', $_POST['_file'], $regs))
- $id = $regs[1];
- if ($attachment = $COMPOSE['attachments'][$id])
- $attachment = $RCMAIL->plugins->exec_hook('attachment_delete', $attachment);
- if ($attachment['status']) {
- if (is_array($COMPOSE['attachments'][$id])) {
- $RCMAIL->session->remove($SESSION_KEY.'.attachments.'.$id);
- $OUTPUT->command('remove_from_attachment_list', "rcmfile$id");
+if ($RCMAIL->action=='remove-attachment') {
+ $id = 'undefined';
+
+ if (preg_match('/^rcmfile(\w+)$/', $_POST['_file'], $regs)) {
+ $id = $regs[1];
+ }
+
+ if ($attachment = $COMPOSE['attachments'][$id]) {
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_delete', $attachment);
}
- }
- $OUTPUT->send();
- exit;
+ if ($attachment['status']) {
+ if (is_array($COMPOSE['attachments'][$id])) {
+ $RCMAIL->session->remove($SESSION_KEY.'.attachments.'.$id);
+ $OUTPUT->command('remove_from_attachment_list', "rcmfile$id");
+ }
+ }
+
+ $OUTPUT->send();
+ exit;
}
-if ($RCMAIL->action=='display-attachment')
-{
- $id = 'undefined';
- if (preg_match('/^rcmfile(\w+)$/', $_GET['_file'], $regs))
- $id = $regs[1];
- if ($attachment = $COMPOSE['attachments'][$id])
- $attachment = $RCMAIL->plugins->exec_hook('attachment_display', $attachment);
-
- if ($attachment['status']) {
- if (empty($attachment['size']))
- $attachment['size'] = $attachment['data'] ? strlen($attachment['data']) : @filesize($attachment['path']);
-
- header('Content-Type: ' . $attachment['mimetype']);
- header('Content-Length: ' . $attachment['size']);
-
- if ($attachment['data'])
- echo $attachment['data'];
- else if ($attachment['path'])
- readfile($attachment['path']);
- }
- exit;
+if ($RCMAIL->action=='display-attachment') {
+ $id = 'undefined';
+
+ if (preg_match('/^rcmfile(\w+)$/', $_GET['_file'], $regs)) {
+ $id = $regs[1];
+ }
+
+ if ($attachment = $COMPOSE['attachments'][$id]) {
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_display', $attachment);
+ }
+
+ if ($attachment['status']) {
+ if (empty($attachment['size'])) {
+ $attachment['size'] = $attachment['data'] ? strlen($attachment['data']) : @filesize($attachment['path']);
+ }
+
+ header('Content-Type: ' . $attachment['mimetype']);
+ header('Content-Length: ' . $attachment['size']);
+
+ if ($attachment['data']) {
+ echo $attachment['data'];
+ }
+ else if ($attachment['path']) {
+ readfile($attachment['path']);
+ }
+ }
+
+ exit;
}
/***** attachment upload action *****/
@@ -84,93 +95,97 @@ if ($RCMAIL->action=='display-attachment')
// clear all stored output properties (like scripts and env vars)
$OUTPUT->reset();
-$uploadid = get_input_value('_uploadid', RCUBE_INPUT_GET);
+$uploadid = rcube_utils::get_input_value('_uploadid', rcube_utils::INPUT_GET);
if (is_array($_FILES['_attachments']['tmp_name'])) {
- $multiple = count($_FILES['_attachments']['tmp_name']) > 1;
-
- foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) {
- // Process uploaded attachment if there is no error
- $err = $_FILES['_attachments']['error'][$i];
-
- if (!$err) {
- $attachment = array(
- 'path' => $filepath,
- 'size' => $_FILES['_attachments']['size'][$i],
- 'name' => $_FILES['_attachments']['name'][$i],
- 'mimetype' => rc_mime_content_type($filepath, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i]),
- 'group' => $COMPOSE_ID,
- );
-
- $attachment = $RCMAIL->plugins->exec_hook('attachment_upload', $attachment);
+ $multiple = count($_FILES['_attachments']['tmp_name']) > 1;
+
+ foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) {
+ // Process uploaded attachment if there is no error
+ $err = $_FILES['_attachments']['error'][$i];
+
+ if (!$err) {
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_upload', array(
+ 'path' => $filepath,
+ 'size' => $_FILES['_attachments']['size'][$i],
+ 'name' => $_FILES['_attachments']['name'][$i],
+ 'mimetype' => rcube_mime::file_content_type($filepath, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i]),
+ 'group' => $COMPOSE_ID,
+ ));
+ }
+
+ if (!$err && $attachment['status'] && !$attachment['abort']) {
+ $id = $attachment['id'];
+
+ // store new attachment in session
+ unset($attachment['status'], $attachment['abort']);
+ $RCMAIL->session->append($SESSION_KEY.'.attachments', $id, $attachment);
+
+ if (($icon = $COMPOSE['deleteicon']) && is_file($icon)) {
+ $button = html::img(array(
+ 'src' => $icon,
+ 'alt' => $RCMAIL->gettext('delete')
+ ));
+ }
+ else if ($COMPOSE['textbuttons']) {
+ $button = rcube::Q($RCMAIL->gettext('delete'));
+ }
+ else {
+ $button = '';
+ }
+
+ $content = html::a(array(
+ 'href' => "#delete",
+ 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", rcmail_output::JS_OBJECT_NAME, $id),
+ 'title' => $RCMAIL->gettext('delete'),
+ 'class' => 'delete',
+ ), $button);
+
+ $content .= rcube::Q($attachment['name']);
+
+ $OUTPUT->command('add2attachment_list', "rcmfile$id", array(
+ 'html' => $content,
+ 'name' => $attachment['name'],
+ 'mimetype' => $attachment['mimetype'],
+ 'classname' => rcube_utils::file2class($attachment['mimetype'], $attachment['name']),
+ 'complete' => true), $uploadid);
+ }
+ else { // upload failed
+ if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
+ $size = $RCMAIL->show_bytes(parse_bytes(ini_get('upload_max_filesize')));
+ $msg = $RCMAIL->gettext(array('name' => 'filesizeerror', 'vars' => array('size' => $size)));
+ }
+ else if ($attachment['error']) {
+ $msg = $attachment['error'];
+ }
+ else {
+ $msg = $RCMAIL->gettext('fileuploaderror');
+ }
+
+ if ($attachment['error'] || $err != UPLOAD_ERR_NO_FILE) {
+ $OUTPUT->command('display_message', $msg, 'error');
+ $OUTPUT->command('remove_from_attachment_list', $uploadid);
+ }
+ }
}
-
- if (!$err && $attachment['status'] && !$attachment['abort']) {
- $id = $attachment['id'];
-
- // store new attachment in session
- unset($attachment['status'], $attachment['abort']);
- $RCMAIL->session->append($SESSION_KEY.'.attachments', $id, $attachment);
-
- if (($icon = $COMPOSE['deleteicon']) && is_file($icon)) {
- $button = html::img(array(
- 'src' => $icon,
- 'alt' => rcube_label('delete')
+}
+else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+ // if filesize exceeds post_max_size then $_FILES array is empty,
+ // show filesizeerror instead of fileuploaderror
+ if ($maxsize = ini_get('post_max_size')) {
+ $msg = $RCMAIL->gettext(array(
+ 'name' => 'filesizeerror',
+ 'vars' => array('size' => $RCMAIL->show_bytes(parse_bytes($maxsize)))
));
- }
- else if ($COMPOSE['textbuttons']) {
- $button = Q(rcube_label('delete'));
- }
- else {
- $button = '';
- }
-
- $content = html::a(array(
- 'href' => "#delete",
- 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id),
- 'title' => rcube_label('delete'),
- 'class' => 'delete',
- ), $button);
-
- $content .= Q($attachment['name']);
-
- $OUTPUT->command('add2attachment_list', "rcmfile$id", array(
- 'html' => $content,
- 'name' => $attachment['name'],
- 'mimetype' => $attachment['mimetype'],
- 'classname' => rcmail_filetype2classname($attachment['mimetype'], $attachment['name']),
- 'complete' => true), $uploadid);
}
- else { // upload failed
- if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
- $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))));
- }
- else if ($attachment['error']) {
- $msg = $attachment['error'];
- }
- else {
- $msg = rcube_label('fileuploaderror');
- }
-
- if ($attachment['error'] || $err != UPLOAD_ERR_NO_FILE) {
- $OUTPUT->command('display_message', $msg, 'error');
- $OUTPUT->command('remove_from_attachment_list', $uploadid);
- }
+ else {
+ $msg = $RCMAIL->gettext('fileuploaderror');
}
- }
-}
-else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- // if filesize exceeds post_max_size then $_FILES array is empty,
- // show filesizeerror instead of fileuploaderror
- if ($maxsize = ini_get('post_max_size'))
- $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes($maxsize)))));
- else
- $msg = rcube_label('fileuploaderror');
- $OUTPUT->command('display_message', $msg, 'error');
- $OUTPUT->command('remove_from_attachment_list', $uploadid);
+
+ $OUTPUT->command('display_message', $msg, 'error');
+ $OUTPUT->command('remove_from_attachment_list', $uploadid);
}
// send html page with JS calls as response
$OUTPUT->command('auto_save_start', false);
$OUTPUT->send('iframe');
-
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index f9e8d71a4..c15de92cf 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -5,8 +5,8 @@
| program/steps/mail/autocomplete.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2008-2011, Roundcube Dev Team |
- | Copyright (C) 2011, Kolab Systems AG |
+ | Copyright (C) 2008-2013, Roundcube Dev Team |
+ | Copyright (C) 2011-2013, Kolab Systems AG |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,124 +21,137 @@
*/
if ($RCMAIL->action == 'group-expand') {
- $abook = $RCMAIL->get_address_book(get_input_value('_source', RCUBE_INPUT_GPC));
- if ($gid = get_input_value('_gid', RCUBE_INPUT_GPC)) {
- $members = array();
- $abook->set_group($gid);
- $abook->set_pagesize(1000); // TODO: limit number of group members by config
- $result = $abook->list_records($RCMAIL->config->get('contactlist_fields'));
- while ($result && ($sql_arr = $result->iterate())) {
- foreach ((array)$sql_arr['email'] as $email) {
- $members[] = format_email_recipient($email, rcube_addressbook::compose_list_name($sql_arr));
- break; // only expand one email per contact
- }
- }
+ $abook = $RCMAIL->get_address_book(rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC));
+ if ($gid = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC)) {
+ $abook->set_group($gid);
+ $abook->set_pagesize(1000); // TODO: limit number of group members by config
+
+ $separator = trim($RCMAIL->config->get('recipients_separator', ',')) . ' ';
+ $result = $abook->list_records($RCMAIL->config->get('contactlist_fields'));
+ $members = array();
+
+ while ($result && ($sql_arr = $result->iterate())) {
+ $emails = (array) $abook->get_col_values('email', $sql_arr, true);
+ if (!empty($emails) && ($email = array_shift($emails))) {
+ $members[] = format_email_recipient($email, rcube_addressbook::compose_list_name($sql_arr));
+ }
+ }
- $separator = trim($RCMAIL->config->get('recipients_separator', ',')) . ' ';
- $OUTPUT->command('replace_group_recipients', $gid, join($separator, array_unique($members)));
- }
+ $OUTPUT->command('replace_group_recipients', $gid, join($separator, array_unique($members)));
+ }
- $OUTPUT->send();
+ $OUTPUT->send();
}
$MAXNUM = (int) $RCMAIL->config->get('autocomplete_max', 15);
$mode = (int) $RCMAIL->config->get('addressbook_search_mode');
$single = (bool) $RCMAIL->config->get('autocomplete_single');
-$search = get_input_value('_search', RCUBE_INPUT_GPC, true);
-$source = get_input_value('_source', RCUBE_INPUT_GPC);
-$sid = get_input_value('_id', RCUBE_INPUT_GPC);
+$search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true);
+$source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
+$sid = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC);
-if (strlen($source))
- $book_types = array($source);
-else
- $book_types = (array) $RCMAIL->config->get('autocomplete_addressbooks', 'sql');
+if (strlen($source)) {
+ $book_types = array($source);
+}
+else {
+ $book_types = (array) $RCMAIL->config->get('autocomplete_addressbooks', 'sql');
+}
if (!empty($book_types) && strlen($search)) {
- $contacts = array();
- $sort_keys = array();
- $books_num = count($book_types);
- $search_lc = mb_strtolower($search);
-
- foreach ($book_types as $id) {
- $abook = $RCMAIL->get_address_book($id);
- $abook->set_pagesize($MAXNUM);
-
- if ($result = $abook->search($RCMAIL->config->get('contactlist_fields'), $search, $mode, true, true, 'email')) {
- while ($sql_arr = $result->iterate()) {
- // Contact can have more than one e-mail address
- $email_arr = (array)$abook->get_col_values('email', $sql_arr, true);
- $email_cnt = count($email_arr);
- $idx = 0;
- foreach ($email_arr as $email) {
- if (empty($email)) {
- continue;
- }
-
- $sql_arr['name'] = rcube_addressbook::compose_list_name($sql_arr);
- $contact = format_email_recipient($email, $sql_arr['name']);
-
- // skip entries that don't match
- if ($email_cnt > 1 && strpos(mb_strtolower($contact), $search_lc) === false) {
- continue;
- }
-
- // skip duplicates
- if (!in_array($contact, $contacts)) {
- $contacts[] = $contact;
- $sort_keys[] = sprintf('%s %03d', $sql_arr['name'] , $idx++);
-
- if (count($contacts) >= $MAXNUM)
- break 2;
- }
-
- // skip redundant entries (show only first email address)
- if ($single) {
- break;
- }
+ $contacts = array();
+ $sort_keys = array();
+ $books_num = count($book_types);
+ $search_lc = mb_strtolower($search);
+
+ foreach ($book_types as $id) {
+ $abook = $RCMAIL->get_address_book($id);
+ $abook->set_pagesize($MAXNUM);
+
+ if ($result = $abook->search($RCMAIL->config->get('contactlist_fields'), $search, $mode, true, true, 'email')) {
+ while ($sql_arr = $result->iterate()) {
+ // Contact can have more than one e-mail address
+ $email_arr = (array)$abook->get_col_values('email', $sql_arr, true);
+ $email_cnt = count($email_arr);
+ $idx = 0;
+
+ foreach ($email_arr as $email) {
+ if (empty($email)) {
+ continue;
+ }
+
+ $name = rcube_addressbook::compose_list_name($sql_arr);
+ $contact = format_email_recipient($email, $name);
+
+ // skip entries that don't match
+ if ($email_cnt > 1 && strpos(mb_strtolower($contact), $search_lc) === false) {
+ continue;
+ }
+
+ // skip duplicates
+ if (!in_array($contact, $contacts)) {
+ $contacts[] = $contact;
+ $sort_keys[] = sprintf('%s %03d', $sql_arr['name'] , $idx++);
+
+ if (count($contacts) >= $MAXNUM) {
+ break 2;
+ }
+ }
+
+ // skip redundant entries (show only first email address)
+ if ($single) {
+ break;
+ }
+ }
+ }
}
- }
- }
- // also list matching contact groups
- if ($abook->groups && count($contacts) < $MAXNUM) {
- foreach ($abook->list_groups($search, $mode) as $group) {
- $abook->reset();
- $abook->set_group($group['ID']);
- $group_prop = $abook->get_group($group['ID']);
-
- // group (distribution list) with email address(es)
- if ($group_prop['email']) {
- $idx = 0;
- foreach ((array)$group_prop['email'] as $email) {
- $contacts[] = format_email_recipient($email, $group['name']);
- $sort_keys[] = sprintf('%s %03d', $group['name'] , $idx++);
-
- if (count($contacts) >= $MAXNUM)
- break 2;
+ // also list matching contact groups
+ if ($abook->groups && count($contacts) < $MAXNUM) {
+ foreach ($abook->list_groups($search, $mode) as $group) {
+ $abook->reset();
+ $abook->set_group($group['ID']);
+
+ $group_prop = $abook->get_group($group['ID']);
+
+ // group (distribution list) with email address(es)
+ if ($group_prop['email']) {
+ $idx = 0;
+ foreach ((array)$group_prop['email'] as $email) {
+ $contacts[] = format_email_recipient($email, $group['name']);
+ $sort_keys[] = sprintf('%s %03d', $group['name'] , $idx++);
+
+ if (count($contacts) >= $MAXNUM) {
+ break 2;
+ }
+ }
+ }
+ // show group with count
+ else if (($result = $abook->count()) && $result->count) {
+ $sort_keys[] = $group['name'];
+ $contacts[] = array(
+ 'name' => $group['name'] . ' (' . intval($result->count) . ')',
+ 'id' => $group['ID'],
+ 'source' => $id
+ );
+
+ if (count($contacts) >= $MAXNUM) {
+ break;
+ }
+ }
}
}
- // show group with count
- else if (($result = $abook->count()) && $result->count) {
- $contacts[] = array('name' => $group['name'] . ' (' . intval($result->count) . ')', 'id' => $group['ID'], 'source' => $id);
- $sort_keys[] = $group['name'];
+ }
- if (count($contacts) >= $MAXNUM)
- break;
+ if (count($contacts)) {
+ // sort contacts index
+ asort($sort_keys, SORT_LOCALE_STRING);
+ // re-sort contacts according to index
+ foreach ($sort_keys as $idx => $val) {
+ $sort_keys[$idx] = $contacts[$idx];
}
- }
- }
- }
-
- if (count($contacts)) {
- // sort contacts index
- asort($sort_keys, SORT_LOCALE_STRING);
- // re-sort contacts according to index
- foreach ($sort_keys as $idx => $val) {
- $sort_keys[$idx] = $contacts[$idx];
+ $contacts = array_values($sort_keys);
}
- $contacts = array_values($sort_keys);
- }
}
$OUTPUT->command('ksearch_query_results', $contacts, $search, $sid);
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index 8c0b1ffc0..d2d27a2ca 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -25,6 +25,7 @@ if (empty($_REQUEST['_folderlist']) && empty($_REQUEST['_list'])) {
return;
}
+$trash = $RCMAIL->config->get('trash_mbox');
$current = $RCMAIL->storage->get_folder();
$check_all = $RCMAIL->action != 'refresh' || (bool)$RCMAIL->config->get('check_all_folders');
@@ -65,7 +66,7 @@ foreach ($a_mailboxes as $mbox_name) {
if ($status && $is_current) {
// refresh saved search set
- $search_request = get_input_value('_search', RCUBE_INPUT_GPC);
+ $search_request = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC);
if ($search_request && isset($_SESSION['search'])
&& $_SESSION['search_request'] == $search_request
) {
@@ -73,7 +74,7 @@ foreach ($a_mailboxes as $mbox_name) {
}
if (!empty($_GET['_quota']))
- $OUTPUT->command('set_quota', rcmail_quota_content());
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content());
$OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
@@ -114,6 +115,29 @@ foreach ($a_mailboxes as $mbox_name) {
$OUTPUT->command('update_selection');
}
}
+ // handle flag updates
+ else if ($is_current && ($uids = rcube_utils::get_input_value('_uids', rcube_utils::INPUT_GPC))) {
+ $data = $RCMAIL->storage->folder_data($mbox_name);
+
+ if (empty($_SESSION['list_mod_seq']) || $_SESSION['list_mod_seq'] != $data['HIGHESTMODSEQ']) {
+ $flags = $RCMAIL->storage->list_flags($mbox_name, explode(',', $uids), $_SESSION['list_mod_seq']);
+ foreach ($flags as $idx => $row) {
+ $flags[$idx] = array_change_key_case(array_map('intval', $row));
+ }
+
+ // remember last HIGHESTMODSEQ value (if supported)
+ if (!empty($data['HIGHESTMODSEQ'])) {
+ $_SESSION['list_mod_seq'] = $data['HIGHESTMODSEQ'];
+ }
+
+ $RCMAIL->output->set_env('recent_flags', $flags);
+ }
+ }
+
+ // set trash folder state
+ if ($mbox_name === $trash) {
+ $OUTPUT->command('set_trash_count', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
+ }
}
// trigger refresh hook
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index dc2452506..8504d026c 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -5,7 +5,7 @@
| program/steps/mail/compose.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -26,7 +26,7 @@ define('RCUBE_COMPOSE_DRAFT', 'draft');
define('RCUBE_COMPOSE_EDIT', 'edit');
$MESSAGE_FORM = null;
-$COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET);
+$COMPOSE_ID = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GET);
$COMPOSE = null;
if ($COMPOSE_ID && $_SESSION['compose_data_'.$COMPOSE_ID])
@@ -35,73 +35,74 @@ if ($COMPOSE_ID && $_SESSION['compose_data_'.$COMPOSE_ID])
// give replicated session storage some time to synchronize
$retries = 0;
while ($COMPOSE_ID && !is_array($COMPOSE) && $RCMAIL->db->is_replicated() && $retries++ < 5) {
- usleep(500000);
- $RCMAIL->session->reload();
- if ($_SESSION['compose_data_'.$COMPOSE_ID])
- $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID];
+ usleep(500000);
+ $RCMAIL->session->reload();
+ if ($_SESSION['compose_data_'.$COMPOSE_ID]) {
+ $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID];
+ }
}
// Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or
// if a compose-ID is given (i.e. when the compose step is opened in a new window/tab).
-if (!is_array($COMPOSE))
-{
- // Infinite redirect prevention in case of broken session (#1487028)
- if ($COMPOSE_ID)
- raise_error(array('code' => 500, 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Invalid compose ID"), true, true);
-
- $COMPOSE_ID = uniqid(mt_rand());
- $_SESSION['compose_data_'.$COMPOSE_ID] = array(
- 'id' => $COMPOSE_ID,
- 'param' => rcube_utils::request2param(RCUBE_INPUT_GET, 'task|action', true),
- 'mailbox' => $RCMAIL->storage->get_folder(),
- );
- $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID];
+if (!is_array($COMPOSE)) {
+ // Infinite redirect prevention in case of broken session (#1487028)
+ if ($COMPOSE_ID) {
+ rcube::raise_error(array('code' => 500, 'type' => 'php',
+ 'file' => __FILE__, 'line' => __LINE__,
+ 'message' => "Invalid compose ID"), true, true);
+ }
- rcmail_process_compose_params($COMPOSE);
-
- // add attachments listed by message_compose hook
- if (is_array($plugin['attachments'])) {
- foreach ($plugin['attachments'] as $attach) {
- // we have structured data
- if (is_array($attach)) {
- $attachment = $attach;
- }
- // only a file path is given
- else {
- $filename = basename($attach);
- $attachment = array(
- 'group' => $COMPOSE_ID,
- 'name' => $filename,
- 'mimetype' => rc_mime_content_type($attach, $filename),
- 'path' => $attach,
- );
- }
-
- // save attachment if valid
- if (($attachment['data'] && $attachment['name']) || ($attachment['path'] && file_exists($attachment['path']))) {
- $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
- }
-
- if ($attachment['status'] && !$attachment['abort']) {
- unset($attachment['data'], $attachment['status'], $attachment['abort']);
- $COMPOSE['attachments'][$attachment['id']] = $attachment;
- }
- }
- }
-
- // check if folder for saving sent messages exists and is subscribed (#1486802)
- if ($sent_folder = $COMPOSE['param']['sent_mbox']) {
- rcmail_check_sent_folder($sent_folder, true);
- }
-
- // redirect to a unique URL with all parameters stored in session
- $OUTPUT->redirect(array(
- '_action' => 'compose',
- '_id' => $COMPOSE['id'],
- '_search' => $_REQUEST['_search'],
- ));
+ $COMPOSE_ID = uniqid(mt_rand());
+ $_SESSION['compose_data_'.$COMPOSE_ID] = array(
+ 'id' => $COMPOSE_ID,
+ 'param' => rcube_utils::request2param(rcube_utils::INPUT_GET, 'task|action', true),
+ 'mailbox' => $RCMAIL->storage->get_folder(),
+ );
+ $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID];
+
+ rcmail_process_compose_params($COMPOSE);
+
+ // add attachments listed by message_compose hook
+ if (is_array($plugin['attachments'])) {
+ foreach ($plugin['attachments'] as $attach) {
+ // we have structured data
+ if (is_array($attach)) {
+ $attachment = $attach;
+ }
+ // only a file path is given
+ else {
+ $filename = basename($attach);
+ $attachment = array(
+ 'group' => $COMPOSE_ID,
+ 'name' => $filename,
+ 'mimetype' => rcube_mime::file_content_type($attach, $filename),
+ 'path' => $attach,
+ );
+ }
+
+ // save attachment if valid
+ if (($attachment['data'] && $attachment['name']) || ($attachment['path'] && file_exists($attachment['path']))) {
+ $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
+ }
+
+ if ($attachment['status'] && !$attachment['abort']) {
+ unset($attachment['data'], $attachment['status'], $attachment['abort']);
+ $COMPOSE['attachments'][$attachment['id']] = $attachment;
+ }
+ }
+ }
+
+ // check if folder for saving sent messages exists and is subscribed (#1486802)
+ if ($sent_folder = $COMPOSE['param']['sent_mbox']) {
+ rcmail_check_sent_folder($sent_folder, true);
+ }
+
+ // redirect to a unique URL with all parameters stored in session
+ $OUTPUT->redirect(array(
+ '_action' => 'compose',
+ '_id' => $COMPOSE['id'],
+ '_search' => $_REQUEST['_search'],
+ ));
}
@@ -109,149 +110,170 @@ if (!is_array($COMPOSE))
$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'cancel',
'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage',
'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'uploadingmany',
- 'fileuploaderror', 'sendmessage');
+ 'fileuploaderror', 'sendmessage', 'savenewresponse', 'responsename', 'responsetext', 'save',
+ 'savingresponse', 'restoresavedcomposedata', 'restoremessage', 'delete', 'restore', 'ignore');
-$OUTPUT->set_env('compose_id', $COMPOSE['id']);
-$OUTPUT->set_pagetitle(rcube_label('compose'));
+$OUTPUT->set_pagetitle($RCMAIL->gettext('compose'));
-// add config parameters to client script
-if (!empty($CONFIG['drafts_mbox'])) {
- $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
- $OUTPUT->set_env('draft_autosave', $CONFIG['draft_autosave']);
-}
-// set current mailbox in client environment
+$OUTPUT->set_env('compose_id', $COMPOSE['id']);
+$OUTPUT->set_env('session_id', session_id());
$OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
$OUTPUT->set_env('top_posting', intval($RCMAIL->config->get('reply_mode')) > 0);
$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
+$drafts_mbox = $RCMAIL->config->get('drafts_mbox');
+$config_show_sig = $RCMAIL->config->get('show_sig', 1);
+
+// add config parameters to client script
+if (strlen($drafts_mbox)) {
+ $OUTPUT->set_env('drafts_mailbox', $drafts_mbox);
+ $OUTPUT->set_env('draft_autosave', $RCMAIL->config->get('draft_autosave'));
+}
+
// default font for HTML editor
-$font = rcube_fontdefs($RCMAIL->config->get('default_font'));
+$font = rcmail::font_defs($RCMAIL->config->get('default_font'));
if ($font && !is_array($font)) {
- $OUTPUT->set_env('default_font', $font);
+ $OUTPUT->set_env('default_font', $font);
}
// default font size for HTML editor
if ($font_size = $RCMAIL->config->get('default_font_size')) {
- $OUTPUT->set_env('default_font_size', $font_size);
+ $OUTPUT->set_env('default_font_size', $font_size);
}
// get reference message and set compose mode
if ($msg_uid = $COMPOSE['param']['draft_uid']) {
- $compose_mode = RCUBE_COMPOSE_DRAFT;
- $OUTPUT->set_env('draft_id', $msg_uid);
- $RCMAIL->storage->set_folder($CONFIG['drafts_mbox']);
+ $compose_mode = RCUBE_COMPOSE_DRAFT;
+ $OUTPUT->set_env('draft_id', $msg_uid);
+ $RCMAIL->storage->set_folder($drafts_mbox);
}
else if ($msg_uid = $COMPOSE['param']['reply_uid']) {
- $compose_mode = RCUBE_COMPOSE_REPLY;
+ $compose_mode = RCUBE_COMPOSE_REPLY;
}
else if ($msg_uid = $COMPOSE['param']['forward_uid']) {
- $compose_mode = RCUBE_COMPOSE_FORWARD;
- $COMPOSE['forward_uid'] = $msg_uid;
- $COMPOSE['as_attachment'] = !empty($COMPOSE['param']['attachment']);
+ $compose_mode = RCUBE_COMPOSE_FORWARD;
+ $COMPOSE['forward_uid'] = $msg_uid;
+ $COMPOSE['as_attachment'] = !empty($COMPOSE['param']['attachment']);
}
else if ($msg_uid = $COMPOSE['param']['uid']) {
- $compose_mode = RCUBE_COMPOSE_EDIT;
+ $compose_mode = RCUBE_COMPOSE_EDIT;
}
$COMPOSE['mode'] = $compose_mode;
$OUTPUT->set_env('compose_mode', $compose_mode);
-$config_show_sig = $RCMAIL->config->get('show_sig', 1);
if ($compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT) {
- // don't add signature in draft/edit mode, we'll also not remove the old-one
- // but only on page display, later we should be able to change identity/sig (#1489229)
- if ($config_show_sig == 1 || $config_show_sig == 2)
- $OUTPUT->set_env('show_sig_later', true);
+ // don't add signature in draft/edit mode, we'll also not remove the old-one
+ // but only on page display, later we should be able to change identity/sig (#1489229)
+ if ($config_show_sig == 1 || $config_show_sig == 2) {
+ $OUTPUT->set_env('show_sig_later', true);
+ }
}
else if ($config_show_sig == 1)
- $OUTPUT->set_env('show_sig', true);
+ $OUTPUT->set_env('show_sig', true);
else if ($config_show_sig == 2 && empty($compose_mode))
- $OUTPUT->set_env('show_sig', true);
+ $OUTPUT->set_env('show_sig', true);
else if ($config_show_sig == 3 && ($compose_mode == RCUBE_COMPOSE_REPLY || $compose_mode == RCUBE_COMPOSE_FORWARD))
- $OUTPUT->set_env('show_sig', true);
+ $OUTPUT->set_env('show_sig', true);
// set line length for body wrapping
$LINE_LENGTH = $RCMAIL->config->get('line_length', 72);
-if (!empty($msg_uid) && empty($COMPOSE['as_attachment']))
-{
- $mbox_name = $RCMAIL->storage->get_folder();
-
- // set format before rcube_message construction
- // use the same format as for the message view
- if (isset($_SESSION['msg_formats'][$mbox_name.':'.$msg_uid])) {
- $RCMAIL->config->set('prefer_html', $_SESSION['msg_formats'][$mbox_name.':'.$msg_uid]);
- }
- else {
- $prefer_html = $CONFIG['prefer_html'] || $CONFIG['htmleditor'] || $compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT;
- $RCMAIL->config->set('prefer_html', $prefer_html);
- }
-
- $MESSAGE = new rcube_message($msg_uid);
-
- // make sure message is marked as read
- if ($MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN']))
- $RCMAIL->storage->set_flag($msg_uid, 'SEEN');
-
- if (!empty($MESSAGE->headers->charset))
- $RCMAIL->storage->set_charset($MESSAGE->headers->charset);
-
- if (!$MESSAGE->headers) {
- // error
- }
- else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
- $COMPOSE['reply_uid'] = $msg_uid;
- $COMPOSE['reply_msgid'] = $MESSAGE->headers->messageID;
- $COMPOSE['references'] = trim($MESSAGE->headers->references . " " . $MESSAGE->headers->messageID);
-
- if (!empty($COMPOSE['param']['all']))
- $MESSAGE->reply_all = $COMPOSE['param']['all'];
-
- // Save the sent message in the same folder of the message being replied to
- if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $COMPOSE['mailbox'])
- && rcmail_check_sent_folder($sent_folder, false)
- ) {
- $COMPOSE['param']['sent_mbox'] = $sent_folder;
+if (!empty($msg_uid) && empty($COMPOSE['as_attachment'])) {
+ $mbox_name = $RCMAIL->storage->get_folder();
+
+ // set format before rcube_message construction
+ // use the same format as for the message view
+ if (isset($_SESSION['msg_formats'][$mbox_name.':'.$msg_uid])) {
+ $RCMAIL->config->set('prefer_html', $_SESSION['msg_formats'][$mbox_name.':'.$msg_uid]);
}
- }
- else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) {
- if ($compose_mode == RCUBE_COMPOSE_DRAFT && ($draft_info = $MESSAGE->headers->get('x-draft-info'))) {
- // get reply_uid/forward_uid to flag the original message when sending
- $info = rcmail_draftinfo_decode($draft_info);
+ else {
+ $prefer_html = $RCMAIL->config->get('prefer_html') || $RCMAIL->config->get('htmleditor')
+ || $compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT;
- if ($info['type'] == 'reply')
- $COMPOSE['reply_uid'] = $info['uid'];
- else if ($info['type'] == 'forward')
- $COMPOSE['forward_uid'] = $info['uid'];
+ $RCMAIL->config->set('prefer_html', $prefer_html);
+ }
- $COMPOSE['mailbox'] = $info['folder'];
+ $MESSAGE = new rcube_message($msg_uid);
- // Save the sent message in the same folder of the message being replied to
- if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $info['folder'])
- && rcmail_check_sent_folder($sent_folder, false)
- ) {
- $COMPOSE['param']['sent_mbox'] = $sent_folder;
- }
+ // make sure message is marked as read
+ if ($MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN'])) {
+ $RCMAIL->storage->set_flag($msg_uid, 'SEEN');
}
- if ($in_reply_to = $MESSAGE->headers->get('in-reply-to'))
- $COMPOSE['reply_msgid'] = '<' . $in_reply_to . '>';
+ if (!empty($MESSAGE->headers->charset)) {
+ $RCMAIL->storage->set_charset($MESSAGE->headers->charset);
+ }
- $COMPOSE['references'] = $MESSAGE->headers->references;
- }
+ if (!$MESSAGE->headers) {
+ // error
+ }
+ else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
+ $COMPOSE['reply_uid'] = $msg_uid;
+ $COMPOSE['reply_msgid'] = $MESSAGE->headers->messageID;
+ $COMPOSE['references'] = trim($MESSAGE->headers->references . " " . $MESSAGE->headers->messageID);
+
+ if (!empty($COMPOSE['param']['all'])) {
+ $MESSAGE->reply_all = $COMPOSE['param']['all'];
+ }
+
+ // Save the sent message in the same folder of the message being replied to
+ if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $COMPOSE['mailbox'])
+ && rcmail_check_sent_folder($sent_folder, false)
+ ) {
+ $COMPOSE['param']['sent_mbox'] = $sent_folder;
+ }
+ }
+ else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) {
+ if ($compose_mode == RCUBE_COMPOSE_DRAFT) {
+ if ($draft_info = $MESSAGE->headers->get('x-draft-info')) {
+ // get reply_uid/forward_uid to flag the original message when sending
+ $info = rcmail_draftinfo_decode($draft_info);
+
+ if ($info['type'] == 'reply')
+ $COMPOSE['reply_uid'] = $info['uid'];
+ else if ($info['type'] == 'forward')
+ $COMPOSE['forward_uid'] = $info['uid'];
+
+ $COMPOSE['mailbox'] = $info['folder'];
+
+ // Save the sent message in the same folder of the message being replied to
+ if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $info['folder'])
+ && rcmail_check_sent_folder($sent_folder, false)
+ ) {
+ $COMPOSE['param']['sent_mbox'] = $sent_folder;
+ }
+ }
+
+ $COMPOSE['param']['message-id'] = $MESSAGE->headers->get('message-id');
+
+ // use message UID as draft_id
+ $OUTPUT->set_env('draft_id', $msg_uid);
+ }
+
+ if ($in_reply_to = $MESSAGE->headers->get('in-reply-to')) {
+ $COMPOSE['reply_msgid'] = '<' . $in_reply_to . '>';
+ }
+
+ $COMPOSE['references'] = $MESSAGE->headers->references;
+ }
}
else {
- $MESSAGE = new stdClass();
-
- // apply mailto: URL parameters
- if (!empty($COMPOSE['param']['in-reply-to'])) {
- $COMPOSE['reply_msgid'] = '<' . $COMPOSE['param']['in-reply-to'] . '>';
- }
- if (!empty($COMPOSE['param']['references'])) {
- $COMPOSE['references'] = $COMPOSE['param']['references'];
- }
+ $MESSAGE = new stdClass();
+
+ // apply mailto: URL parameters
+ if (!empty($COMPOSE['param']['in-reply-to'])) {
+ $COMPOSE['reply_msgid'] = '<' . $COMPOSE['param']['in-reply-to'] . '>';
+ }
+
+ if (!empty($COMPOSE['param']['references'])) {
+ $COMPOSE['references'] = $COMPOSE['param']['references'];
+ }
}
+if (!empty($COMPOSE['reply_msgid']))
+ $OUTPUT->set_env('reply_msgid', $COMPOSE['reply_msgid']);
+
$MESSAGE->compose = array();
// get user's identities
@@ -259,142 +281,141 @@ $MESSAGE->identities = $RCMAIL->user->list_identities(null, true);
// Set From field value
if (!empty($_POST['_from'])) {
- $MESSAGE->compose['from'] = get_input_value('_from', RCUBE_INPUT_POST);
+ $MESSAGE->compose['from'] = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST);
}
else if (!empty($COMPOSE['param']['from'])) {
- $MESSAGE->compose['from'] = $COMPOSE['param']['from'];
+ $MESSAGE->compose['from'] = $COMPOSE['param']['from'];
}
else if (count($MESSAGE->identities)) {
- $ident = rcmail_identity_select($MESSAGE, $MESSAGE->identities, $compose_mode);
+ $ident = rcmail_identity_select($MESSAGE, $MESSAGE->identities, $compose_mode);
- $MESSAGE->compose['from_email'] = $ident['email'];
- $MESSAGE->compose['from'] = $ident['identity_id'];
+ $MESSAGE->compose['from_email'] = $ident['email'];
+ $MESSAGE->compose['from'] = $ident['identity_id'];
}
// Set other headers
$a_recipients = array();
$parts = array('to', 'cc', 'bcc', 'replyto', 'followupto');
$separator = trim($RCMAIL->config->get('recipients_separator', ',')) . ' ';
+$from_email = @mb_strtolower($MESSAGE->compose['from_email']);
foreach ($parts as $header) {
- $fvalue = '';
- $decode_header = true;
-
- // we have a set of recipients stored is session
- if ($header == 'to' && ($mailto_id = $COMPOSE['param']['mailto'])
- && $_SESSION['mailto'][$mailto_id]
- ) {
- $fvalue = urldecode($_SESSION['mailto'][$mailto_id]);
- $decode_header = false;
-
- // make session to not grow up too much
- unset($_SESSION['mailto'][$mailto_id]);
- $COMPOSE['param']['to'] = $fvalue;
- }
- else if (!empty($_POST['_'.$header])) {
- $fvalue = get_input_value('_'.$header, RCUBE_INPUT_POST, TRUE);
- }
- else if (!empty($COMPOSE['param'][$header])) {
- $fvalue = $COMPOSE['param'][$header];
- }
- else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
- // get recipent address(es) out of the message headers
- if ($header == 'to') {
- $mailfollowup = $MESSAGE->headers->others['mail-followup-to'];
- $mailreplyto = $MESSAGE->headers->others['mail-reply-to'];
-
- // Reply to mailing list...
- if ($MESSAGE->reply_all == 'list' && $mailfollowup)
- $fvalue = $mailfollowup;
- else if ($MESSAGE->reply_all == 'list'
- && preg_match('/<mailto:([^>]+)>/i', $MESSAGE->headers->others['list-post'], $m))
- $fvalue = $m[1];
- // Reply to...
- else if ($MESSAGE->reply_all && $mailfollowup)
- $fvalue = $mailfollowup;
- else if ($mailreplyto)
- $fvalue = $mailreplyto;
- else if (!empty($MESSAGE->headers->replyto))
- $fvalue = $MESSAGE->headers->replyto;
- else if (!empty($MESSAGE->headers->from))
- $fvalue = $MESSAGE->headers->from;
-
- // Reply to message sent by yourself (#1487074, #1489230)
- if (!empty($ident) && in_array($ident['ident'], array($fvalue, $MESSAGE->headers->from))) {
- $fvalue = $MESSAGE->headers->to;
- }
- }
- // add recipient of original message if reply to all
- else if ($header == 'cc' && !empty($MESSAGE->reply_all) && $MESSAGE->reply_all != 'list') {
- if ($v = $MESSAGE->headers->to)
- $fvalue .= $v;
- if ($v = $MESSAGE->headers->cc)
- $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
- // Use Sender header (#1489011)
- if (($v = $MESSAGE->headers->get('Sender', false)) && strpos($v, '-bounces@') === false)
- $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
-
- // When To: and Reply-To: are the same we add From: address to the list (#1489037)
- if ($v = $MESSAGE->headers->from) {
- $from = rcube_mime::decode_address_list($v, null, false, $MESSAGE->headers->charset, true);
- $to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, false, $MESSAGE->headers->charset, true);
- $replyto = rcube_mime::decode_address_list($MESSAGE->headers->replyto, null, false, $MESSAGE->headers->charset, true);
-
- if (count($replyto) && !count(array_diff($to, $replyto)) && count(array_diff($from, $to))) {
- $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
- }
- }
- }
- }
- else if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) {
- // get drafted headers
- if ($header=='to' && !empty($MESSAGE->headers->to))
- $fvalue = $MESSAGE->get_header('to', true);
- else if ($header=='cc' && !empty($MESSAGE->headers->cc))
- $fvalue = $MESSAGE->get_header('cc', true);
- else if ($header=='bcc' && !empty($MESSAGE->headers->bcc))
- $fvalue = $MESSAGE->get_header('bcc', true);
- else if ($header=='replyto' && !empty($MESSAGE->headers->others['mail-reply-to']))
- $fvalue = $MESSAGE->get_header('mail-reply-to');
- else if ($header=='replyto' && !empty($MESSAGE->headers->replyto))
- $fvalue = $MESSAGE->get_header('reply-to');
- else if ($header=='followupto' && !empty($MESSAGE->headers->others['mail-followup-to']))
- $fvalue = $MESSAGE->get_header('mail-followup-to');
- }
-
- // split recipients and put them back together in a unique way
- if (!empty($fvalue) && in_array($header, array('to', 'cc', 'bcc'))) {
- $to_addresses = rcube_mime::decode_address_list($fvalue, null, $decode_header, $MESSAGE->headers->charset);
- $fvalue = array();
-
- foreach ($to_addresses as $addr_part) {
- if (empty($addr_part['mailto']))
- continue;
-
- $mailto = format_email(rcube_idn_to_utf8($addr_part['mailto']));
-
- if (!in_array($mailto, $a_recipients)
- && (
- $header == 'to'
- || $compose_mode != RCUBE_COMPOSE_REPLY
- || empty($MESSAGE->compose['from_email'])
- || $mailto != $MESSAGE->compose['from_email']
- )
- ) {
- if ($addr_part['name'] && $addr_part['mailto'] != $addr_part['name'])
- $string = format_email_recipient($mailto, $addr_part['name']);
- else
- $string = $mailto;
+ $fvalue = '';
+ $decode_header = true;
+
+ // we have a set of recipients stored is session
+ if ($header == 'to' && ($mailto_id = $COMPOSE['param']['mailto'])
+ && $_SESSION['mailto'][$mailto_id]
+ ) {
+ $fvalue = urldecode($_SESSION['mailto'][$mailto_id]);
+ $decode_header = false;
- $fvalue[] = $string;
- $a_recipients[] = $addr_part['mailto'];
- }
+ // make session to not grow up too much
+ unset($_SESSION['mailto'][$mailto_id]);
+ $COMPOSE['param']['to'] = $fvalue;
+ }
+ else if (!empty($_POST['_'.$header])) {
+ $fvalue = rcube_utils::get_input_value('_'.$header, rcube_utils::INPUT_POST, TRUE);
+ }
+ else if (!empty($COMPOSE['param'][$header])) {
+ $fvalue = $COMPOSE['param'][$header];
}
+ else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
+ // get recipent address(es) out of the message headers
+ if ($header == 'to') {
+ $mailfollowup = $MESSAGE->headers->others['mail-followup-to'];
+ $mailreplyto = $MESSAGE->headers->others['mail-reply-to'];
+
+ // Reply to mailing list...
+ if ($MESSAGE->reply_all == 'list' && $mailfollowup)
+ $fvalue = $mailfollowup;
+ else if ($MESSAGE->reply_all == 'list'
+ && preg_match('/<mailto:([^>]+)>/i', $MESSAGE->headers->others['list-post'], $m))
+ $fvalue = $m[1];
+ // Reply to...
+ else if ($MESSAGE->reply_all && $mailfollowup)
+ $fvalue = $mailfollowup;
+ else if ($mailreplyto)
+ $fvalue = $mailreplyto;
+ else if (!empty($MESSAGE->headers->replyto))
+ $fvalue = $MESSAGE->headers->replyto;
+ else if (!empty($MESSAGE->headers->from))
+ $fvalue = $MESSAGE->headers->from;
+
+ // Reply to message sent by yourself (#1487074, #1489230)
+ if (!empty($ident) && in_array($ident['ident'], array($fvalue, $MESSAGE->headers->from))) {
+ $fvalue = $MESSAGE->headers->to;
+ }
+ }
+ // add recipient of original message if reply to all
+ else if ($header == 'cc' && !empty($MESSAGE->reply_all) && $MESSAGE->reply_all != 'list') {
+ if ($v = $MESSAGE->headers->to)
+ $fvalue .= $v;
+ if ($v = $MESSAGE->headers->cc)
+ $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
+ // Use Sender header (#1489011)
+ if (($v = $MESSAGE->headers->get('Sender', false)) && strpos($v, '-bounces@') === false)
+ $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
+
+ // When To: and Reply-To: are the same we add From: address to the list (#1489037)
+ if ($v = $MESSAGE->headers->from) {
+ $from = rcube_mime::decode_address_list($v, null, false, $MESSAGE->headers->charset, true);
+ $to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, false, $MESSAGE->headers->charset, true);
+ $replyto = rcube_mime::decode_address_list($MESSAGE->headers->replyto, null, false, $MESSAGE->headers->charset, true);
+
+ if (count($replyto) && !count(array_diff($to, $replyto)) && count(array_diff($from, $to))) {
+ $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
+ }
+ }
+ }
+ }
+ else if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) {
+ // get drafted headers
+ if ($header=='to' && !empty($MESSAGE->headers->to))
+ $fvalue = $MESSAGE->get_header('to', true);
+ else if ($header=='cc' && !empty($MESSAGE->headers->cc))
+ $fvalue = $MESSAGE->get_header('cc', true);
+ else if ($header=='bcc' && !empty($MESSAGE->headers->bcc))
+ $fvalue = $MESSAGE->get_header('bcc', true);
+ else if ($header=='replyto' && !empty($MESSAGE->headers->others['mail-reply-to']))
+ $fvalue = $MESSAGE->get_header('mail-reply-to');
+ else if ($header=='replyto' && !empty($MESSAGE->headers->replyto))
+ $fvalue = $MESSAGE->get_header('reply-to');
+ else if ($header=='followupto' && !empty($MESSAGE->headers->others['mail-followup-to']))
+ $fvalue = $MESSAGE->get_header('mail-followup-to');
+ }
+
+ // split recipients and put them back together in a unique way
+ if (!empty($fvalue) && in_array($header, array('to', 'cc', 'bcc'))) {
+ $to_addresses = rcube_mime::decode_address_list($fvalue, null, $decode_header, $MESSAGE->headers->charset);
+ $fvalue = array();
- $fvalue = implode($separator, $fvalue);
- }
+ foreach ($to_addresses as $addr_part) {
+ if (empty($addr_part['mailto'])) {
+ continue;
+ }
- $MESSAGE->compose[$header] = $fvalue;
+ // According to RFC5321 local part of email address is case-sensitive
+ // however, here it is better to compare addresses in case-insensitive manner
+ $mailto = format_email(rcube_utils::idn_to_utf8($addr_part['mailto']));
+ $mailto_lc = mb_strtolower($addr_part['mailto']);
+
+ if (($header == 'to' || $compose_mode != RCUBE_COMPOSE_REPLY || $mailto_lc != $from_email)
+ && !in_array($mailto_lc, $a_recipients)
+ ) {
+ if ($addr_part['name'] && $mailto != $addr_part['name']) {
+ $mailto = format_email_recipient($mailto, $addr_part['name']);
+ }
+
+ $fvalue[] = $mailto;
+ $a_recipients[] = $mailto_lc;
+ }
+ }
+
+ $fvalue = implode($separator, $fvalue);
+ }
+
+ $MESSAGE->compose[$header] = $fvalue;
}
unset($a_recipients);
@@ -402,322 +423,354 @@ unset($a_recipients);
$MESSAGE_BODY = rcmail_prepare_message_body();
+// register UI objects
+$OUTPUT->add_handlers(array(
+ 'composeheaders' => 'rcmail_compose_headers',
+ 'composesubject' => 'rcmail_compose_subject',
+ 'composebody' => 'rcmail_compose_body',
+ 'composeattachmentlist' => 'rcmail_compose_attachment_list',
+ 'composeattachmentform' => 'rcmail_compose_attachment_form',
+ 'composeattachment' => 'rcmail_compose_attachment_field',
+ 'filedroparea' => 'compose_file_drop_area',
+ 'priorityselector' => 'rcmail_priority_selector',
+ 'editorselector' => 'rcmail_editor_selector',
+ 'receiptcheckbox' => 'rcmail_receipt_checkbox',
+ 'dsncheckbox' => 'rcmail_dsn_checkbox',
+ 'storetarget' => 'rcmail_store_target_selection',
+ 'addressbooks' => 'rcmail_addressbook_list',
+ 'addresslist' => 'rcmail_contacts_list',
+ 'responseslist' => 'rcmail_compose_responses_list',
+));
+
+$OUTPUT->send('compose');
+
+
/****** compose mode functions ********/
// process compose request parameters
function rcmail_process_compose_params(&$COMPOSE)
{
- if ($COMPOSE['param']['to']) {
- $mailto = explode('?', $COMPOSE['param']['to'], 2);
+ if ($COMPOSE['param']['to']) {
+ $mailto = explode('?', $COMPOSE['param']['to'], 2);
- // #1486037: remove "mailto:" prefix
- $COMPOSE['param']['to'] = preg_replace('/^mailto:/i', '', $mailto[0]);
+ // #1486037: remove "mailto:" prefix
+ $COMPOSE['param']['to'] = preg_replace('/^mailto:/i', '', $mailto[0]);
- // Supported case-insensitive tokens in mailto URL
- $url_tokens = array('to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'body');
+ // Supported case-insensitive tokens in mailto URL
+ $url_tokens = array('to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'body');
- if (!empty($mailto[1])) {
- parse_str($mailto[1], $query);
- foreach ($query as $f => $val) {
- if (($key = array_search(strtolower($f), $url_tokens)) !== false) {
- $f = $url_tokens[$key];
- }
+ if (!empty($mailto[1])) {
+ parse_str($mailto[1], $query);
+ foreach ($query as $f => $val) {
+ if (($key = array_search(strtolower($f), $url_tokens)) !== false) {
+ $f = $url_tokens[$key];
+ }
- // merge mailto: addresses with addresses from 'to' parameter
- if ($f == 'to' && !empty($COMPOSE['param']['to'])) {
- $to_addresses = rcube_mime::decode_address_list($COMPOSE['param']['to'], null, true, null, true);
- $add_addresses = rcube_mime::decode_address_list($val, null, true);
- foreach ($add_addresses as $addr) {
- if (!in_array($addr['mailto'], $to_addresses)) {
- $to_addresses[] = $addr['mailto'];
- $COMPOSE['param']['to'] = (!empty($to_addresses) ? ', ' : '') . $addr['string'];
+ // merge mailto: addresses with addresses from 'to' parameter
+ if ($f == 'to' && !empty($COMPOSE['param']['to'])) {
+ $to_addresses = rcube_mime::decode_address_list($COMPOSE['param']['to'], null, true, null, true);
+ $add_addresses = rcube_mime::decode_address_list($val, null, true);
+
+ foreach ($add_addresses as $addr) {
+ if (!in_array($addr['mailto'], $to_addresses)) {
+ $to_addresses[] = $addr['mailto'];
+ $COMPOSE['param']['to'] = (!empty($to_addresses) ? ', ' : '') . $addr['string'];
+ }
+ }
+ }
+ else {
+ $COMPOSE['param'][$f] = $val;
+ }
}
- }
- }
- else {
- $COMPOSE['param'][$f] = $val;
}
- }
}
- }
- $RCMAIL = rcmail::get_instance();
+ // clean HTML message body which can be submitted by URL
+ if (!empty($COMPOSE['param']['body'])) {
+ $COMPOSE['param']['body'] = rcmail_wash_html($COMPOSE['param']['body'], array('safe' => false, 'inline_html' => true), array());
+ }
+
+ $RCMAIL = rcmail::get_instance();
- // select folder where to save the sent message
- $COMPOSE['param']['sent_mbox'] = $RCMAIL->config->get('sent_mbox');
+ // select folder where to save the sent message
+ $COMPOSE['param']['sent_mbox'] = $RCMAIL->config->get('sent_mbox');
- // pipe compose parameters thru plugins
- $plugin = $RCMAIL->plugins->exec_hook('message_compose', $COMPOSE);
- $COMPOSE['param'] = array_merge($COMPOSE['param'], $plugin['param']);
+ // pipe compose parameters thru plugins
+ $plugin = $RCMAIL->plugins->exec_hook('message_compose', $COMPOSE);
+ $COMPOSE['param'] = array_merge($COMPOSE['param'], $plugin['param']);
}
function rcmail_compose_headers($attrib)
{
- global $MESSAGE;
+ global $RCMAIL, $MESSAGE;
- list($form_start,) = get_form_tags($attrib);
+ list($form_start,) = get_form_tags($attrib);
- $out = '';
- $part = strtolower($attrib['part']);
+ $out = '';
+ $part = strtolower($attrib['part']);
- switch ($part)
- {
+ switch ($part) {
case 'from':
- return $form_start . rcmail_compose_header_from($attrib);
+ return $form_start . rcmail_compose_header_from($attrib);
case 'to':
case 'cc':
case 'bcc':
- $fname = '_' . $part;
- $header = $param = $part;
+ $fname = '_' . $part;
+ $header = $param = $part;
- $allow_attrib = array('id', 'class', 'style', 'cols', 'rows', 'tabindex');
- $field_type = 'html_textarea';
- break;
+ $allow_attrib = array('id', 'class', 'style', 'cols', 'rows', 'tabindex');
+ $field_type = 'html_textarea';
+ break;
case 'replyto':
case 'reply-to':
- $fname = '_replyto';
- $param = 'replyto';
- $header = 'reply-to';
+ $fname = '_replyto';
+ $param = 'replyto';
+ $header = 'reply-to';
case 'followupto':
case 'followup-to':
- if (!$fname) {
- $fname = '_followupto';
- $param = 'followupto';
- $header = 'mail-followup-to';
- }
-
- $allow_attrib = array('id', 'class', 'style', 'size', 'tabindex');
- $field_type = 'html_inputfield';
- break;
- }
-
- if ($fname && $field_type)
- {
- // pass the following attributes to the form class
- $field_attrib = array('name' => $fname, 'spellcheck' => 'false');
- foreach ($attrib as $attr => $value)
- if (in_array($attr, $allow_attrib))
- $field_attrib[$attr] = $value;
+ if (!$fname) {
+ $fname = '_followupto';
+ $param = 'followupto';
+ $header = 'mail-followup-to';
+ }
- // create teaxtarea object
- $input = new $field_type($field_attrib);
- $out = $input->show($MESSAGE->compose[$param]);
- }
+ $allow_attrib = array('id', 'class', 'style', 'size', 'tabindex');
+ $field_type = 'html_inputfield';
+ break;
+ }
- if ($form_start)
- $out = $form_start.$out;
+ if ($fname && $field_type) {
+ // pass the following attributes to the form class
+ $field_attrib = array('name' => $fname, 'spellcheck' => 'false');
+ foreach ($attrib as $attr => $value) {
+ if (in_array($attr, $allow_attrib)) {
+ $field_attrib[$attr] = $value;
+ }
+ }
- // configure autocompletion
- rcube_autocomplete_init();
+ // create teaxtarea object
+ $input = new $field_type($field_attrib);
+ $out = $input->show($MESSAGE->compose[$param]);
+ }
+
+ if ($form_start) {
+ $out = $form_start . $out;
+ }
- return $out;
+ // configure autocompletion
+ $RCMAIL->autocomplete_init();
+
+ return $out;
}
function rcmail_compose_header_from($attrib)
{
- global $MESSAGE, $OUTPUT, $RCMAIL, $COMPOSE, $compose_mode;
-
- // pass the following attributes to the form class
- $field_attrib = array('name' => '_from');
- foreach ($attrib as $attr => $value)
- if (in_array($attr, array('id', 'class', 'style', 'size', 'tabindex')))
- $field_attrib[$attr] = $value;
-
- if (count($MESSAGE->identities))
- {
- $a_signatures = array();
- $identities = array();
- $separator = intval($RCMAIL->config->get('reply_mode')) > 0
- && ($compose_mode == RCUBE_COMPOSE_REPLY || $compose_mode == RCUBE_COMPOSE_FORWARD) ? '---' : '-- ';
-
- $field_attrib['onchange'] = JS_OBJECT_NAME.".change_identity(this)";
- $select_from = new html_select($field_attrib);
-
- // create SELECT element
- foreach ($MESSAGE->identities as $sql_arr)
- {
- $identity_id = $sql_arr['identity_id'];
- $select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $identity_id);
-
- // add signature to array
- if (!empty($sql_arr['signature']) && empty($COMPOSE['param']['nosig']))
- {
- $text = $html = $sql_arr['signature'];
-
- if ($sql_arr['html_signature']) {
- $h2t = new rcube_html2text($sql_arr['signature'], false, false);
- $text = trim($h2t->get_text());
- }
- else {
- $html = htmlentities($html, ENT_NOQUOTES, RCMAIL_CHARSET);
- }
+ global $MESSAGE, $OUTPUT, $RCMAIL, $COMPOSE, $compose_mode;
- if (!preg_match('/^--[ -]\r?\n/m', $text)) {
- $text = $separator . "\n" . $text;
- $html = $separator . "<br>" . $html;
+ // pass the following attributes to the form class
+ $field_attrib = array('name' => '_from');
+ foreach ($attrib as $attr => $value) {
+ if (in_array($attr, array('id', 'class', 'style', 'size', 'tabindex'))) {
+ $field_attrib[$attr] = $value;
}
+ }
+
+ if (count($MESSAGE->identities)) {
+ $a_signatures = array();
+ $identities = array();
+ $separator = intval($RCMAIL->config->get('reply_mode')) > 0
+ && ($compose_mode == RCUBE_COMPOSE_REPLY || $compose_mode == RCUBE_COMPOSE_FORWARD) ? '---' : '-- ';
+
+ $field_attrib['onchange'] = rcmail_output::JS_OBJECT_NAME.".change_identity(this)";
+ $select_from = new html_select($field_attrib);
+
+ // create SELECT element
+ foreach ($MESSAGE->identities as $sql_arr) {
+ $identity_id = $sql_arr['identity_id'];
+ $select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $identity_id);
+
+ // add signature to array
+ if (!empty($sql_arr['signature']) && empty($COMPOSE['param']['nosig'])) {
+ $text = $html = $sql_arr['signature'];
+
+ if ($sql_arr['html_signature']) {
+ $h2t = new rcube_html2text($sql_arr['signature'], false, false);
+ $text = trim($h2t->get_text());
+ }
+ else {
+ $html = htmlentities($html, ENT_NOQUOTES, RCUBE_CHARSET);
+ }
- if (!$sql_arr['html_signature']) {
- $html = "<pre>" . $html . "</pre>";
+ if (!preg_match('/^--[ -]\r?\n/m', $text)) {
+ $text = $separator . "\n" . $text;
+ $html = $separator . "<br>" . $html;
+ }
+
+ if (!$sql_arr['html_signature']) {
+ $html = "<pre>" . $html . "</pre>";
+ }
+
+ $a_signatures[$identity_id]['text'] = $text;
+ $a_signatures[$identity_id]['html'] = $html;
+ }
+
+ // add bcc and reply-to
+ if (!empty($sql_arr['reply-to'])) {
+ $identities[$identity_id]['replyto'] = $sql_arr['reply-to'];
+ }
+ if (!empty($sql_arr['bcc'])) {
+ $identities[$identity_id]['bcc'] = $sql_arr['bcc'];
+ }
}
- $a_signatures[$identity_id]['text'] = $text;
- $a_signatures[$identity_id]['html'] = $html;
- }
-
- // add bcc and reply-to
- if (!empty($sql_arr['reply-to'])) {
- $identities[$identity_id]['replyto'] = $sql_arr['reply-to'];
- }
- if (!empty($sql_arr['bcc'])) {
- $identities[$identity_id]['bcc'] = $sql_arr['bcc'];
- }
- }
-
- $out = $select_from->show($MESSAGE->compose['from']);
-
- // add signatures to client
- $OUTPUT->set_env('signatures', $a_signatures);
- $OUTPUT->set_env('identities', $identities);
- }
- // no identities, display text input field
- else {
- $field_attrib['class'] = 'from_address';
- $input_from = new html_inputfield($field_attrib);
- $out = $input_from->show($MESSAGE->compose['from']);
- }
-
- return $out;
+ $out = $select_from->show($MESSAGE->compose['from']);
+
+ // add signatures to client
+ $OUTPUT->set_env('signatures', $a_signatures);
+ $OUTPUT->set_env('identities', $identities);
+ }
+ // no identities, display text input field
+ else {
+ $field_attrib['class'] = 'from_address';
+ $input_from = new html_inputfield($field_attrib);
+ $out = $input_from->show($MESSAGE->compose['from']);
+ }
+
+ return $out;
}
function rcmail_compose_editor_mode()
{
- global $RCMAIL, $compose_mode;
- static $useHtml;
+ global $RCMAIL, $compose_mode;
+ static $useHtml;
- if ($useHtml !== null)
- return $useHtml;
+ if ($useHtml !== null) {
+ return $useHtml;
+ }
+
+ $html_editor = intval($RCMAIL->config->get('htmleditor'));
+
+ if (isset($_POST['_is_html'])) {
+ $useHtml = !empty($_POST['_is_html']);
+ }
+ else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) {
+ $useHtml = rcmail_message_is_html();
+ }
+ else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
+ $useHtml = ($html_editor == 1 || ($html_editor >= 2 && rcmail_message_is_html()));
+ }
+ else if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
+ $useHtml = ($html_editor == 1 || ($html_editor == 3 && rcmail_message_is_html()));
+ }
+ else {
+ $useHtml = ($html_editor == 1);
+ }
- $html_editor = intval($RCMAIL->config->get('htmleditor'));
-
- if (isset($_POST['_is_html'])) {
- $useHtml = !empty($_POST['_is_html']);
- }
- else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) {
- $useHtml = rcmail_message_is_html();
- }
- else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
- $useHtml = ($html_editor == 1 || ($html_editor >= 2 && rcmail_message_is_html()));
- }
- else if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
- $useHtml = ($html_editor == 1 || ($html_editor == 3 && rcmail_message_is_html()));
- }
- else {
- $useHtml = ($html_editor == 1);
- }
-
- return $useHtml;
+ return $useHtml;
}
function rcmail_message_is_html()
{
global $RCMAIL, $MESSAGE;
+
return $RCMAIL->config->get('prefer_html') && ($MESSAGE instanceof rcube_message) && $MESSAGE->has_html_part(true);
}
function rcmail_prepare_message_body()
{
- global $RCMAIL, $MESSAGE, $COMPOSE, $compose_mode, $HTML_MODE;
-
- // use posted message body
- if (!empty($_POST['_message'])) {
- $body = get_input_value('_message', RCUBE_INPUT_POST, true);
- $isHtml = (bool) get_input_value('_is_html', RCUBE_INPUT_POST);
- }
- else if ($COMPOSE['param']['body']) {
- $body = $COMPOSE['param']['body'];
- $isHtml = false;
- }
- // forward as attachment
- else if ($compose_mode == RCUBE_COMPOSE_FORWARD && $COMPOSE['as_attachment']) {
- $isHtml = rcmail_compose_editor_mode();
- $body = '';
- rcmail_write_forward_attachments();
- }
- // reply/edit/draft/forward
- else if ($compose_mode && ($compose_mode != RCUBE_COMPOSE_REPLY || intval($RCMAIL->config->get('reply_mode')) != -1)) {
- $isHtml = rcmail_compose_editor_mode();
- $messages = array();
+ global $RCMAIL, $MESSAGE, $COMPOSE, $compose_mode, $HTML_MODE;
- if (!empty($MESSAGE->parts)) {
- // collect IDs of message/rfc822 parts
- if ($compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT) {
- foreach ($MESSAGE->attachments as $part) {
- if ($part->mimetype == 'message/rfc822') {
- $messages[] = $part->mime_id;
- }
- }
- }
+ // use posted message body
+ if (!empty($_POST['_message'])) {
+ $body = rcube_utils::get_input_value('_message', rcube_utils::INPUT_POST, true);
+ $isHtml = (bool) rcube_utils::get_input_value('_is_html', rcube_utils::INPUT_POST);
+ }
+ else if ($COMPOSE['param']['body']) {
+ $body = $COMPOSE['param']['body'];
+ $isHtml = (bool) $COMPOSE['param']['html'];
+ }
+ // forward as attachment
+ else if ($compose_mode == RCUBE_COMPOSE_FORWARD && $COMPOSE['as_attachment']) {
+ $isHtml = rcmail_compose_editor_mode();
+ $body = '';
- foreach ($MESSAGE->parts as $part) {
- // skip no-content and attachment parts (#1488557)
- if ($part->type != 'content' || !$part->size || $MESSAGE->is_attachment($part)) {
- continue;
- }
+ rcmail_write_forward_attachments();
+ }
+ // reply/edit/draft/forward
+ else if ($compose_mode && ($compose_mode != RCUBE_COMPOSE_REPLY || intval($RCMAIL->config->get('reply_mode')) != -1)) {
+ $isHtml = rcmail_compose_editor_mode();
+ $messages = array();
+
+ if (!empty($MESSAGE->parts)) {
+ // collect IDs of message/rfc822 parts
+ if ($compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT) {
+ foreach ($MESSAGE->attachments as $part) {
+ if ($part->mimetype == 'message/rfc822') {
+ $messages[] = $part->mime_id;
+ }
+ }
+ }
+
+ foreach ($MESSAGE->parts as $part) {
+ // skip no-content and attachment parts (#1488557)
+ if ($part->type != 'content' || !$part->size || $MESSAGE->is_attachment($part)) {
+ continue;
+ }
- // skip all content parts inside the message/rfc822 part in DRAFT/EDIT mode
- foreach ($messages as $mimeid) {
- if (strpos($part->mime_id, $mimeid . '.') === 0) {
- continue 2;
- }
+ // skip all content parts inside the message/rfc822 part in DRAFT/EDIT mode
+ foreach ($messages as $mimeid) {
+ if (strpos($part->mime_id, $mimeid . '.') === 0) {
+ continue 2;
+ }
+ }
+
+ if ($part_body = rcmail_compose_part_body($part, $isHtml)) {
+ $body .= ($body ? ($isHtml ? '<br/>' : "\n") : '') . $part_body;
+ }
+ }
+ }
+ else {
+ $body = rcmail_compose_part_body($MESSAGE, $isHtml);
}
- if ($part_body = rcmail_compose_part_body($part, $isHtml)) {
- $body .= ($body ? ($isHtml ? '<br/>' : "\n") : '') . $part_body;
+ // compose reply-body
+ if ($compose_mode == RCUBE_COMPOSE_REPLY)
+ $body = rcmail_create_reply_body($body, $isHtml);
+ // forward message body inline
+ else if ($compose_mode == RCUBE_COMPOSE_FORWARD)
+ $body = rcmail_create_forward_body($body, $isHtml);
+ // load draft message body
+ else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT)
+ $body = rcmail_create_draft_body($body, $isHtml);
+ }
+ else { // new message
+ $isHtml = rcmail_compose_editor_mode();
+ }
+
+ $plugin = $RCMAIL->plugins->exec_hook('message_compose_body',
+ array('body' => $body, 'html' => $isHtml, 'mode' => $compose_mode));
+
+ $body = $plugin['body'];
+ unset($plugin);
+
+ // add blocked.gif attachment (#1486516)
+ if ($isHtml && preg_match('#<img src="\./program/resources/blocked\.gif"#', $body)) {
+ if ($attachment = rcmail_save_image('program/resources/blocked.gif', 'image/gif')) {
+ $COMPOSE['attachments'][$attachment['id']] = $attachment;
+ $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
+ $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
+ $body = preg_replace('#\./program/resources/blocked\.gif#', $url, $body);
}
- }
}
- else {
- $body = rcmail_compose_part_body($MESSAGE, $isHtml);
- }
-
- // compose reply-body
- if ($compose_mode == RCUBE_COMPOSE_REPLY)
- $body = rcmail_create_reply_body($body, $isHtml);
- // forward message body inline
- else if ($compose_mode == RCUBE_COMPOSE_FORWARD)
- $body = rcmail_create_forward_body($body, $isHtml);
- // load draft message body
- else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT)
- $body = rcmail_create_draft_body($body, $isHtml);
- }
- else { // new message
- $isHtml = rcmail_compose_editor_mode();
- }
-
- $plugin = $RCMAIL->plugins->exec_hook('message_compose_body',
- array('body' => $body, 'html' => $isHtml, 'mode' => $compose_mode));
- $body = $plugin['body'];
- unset($plugin);
-
- // add blocked.gif attachment (#1486516)
- if ($isHtml && preg_match('#<img src="\./program/resources/blocked\.gif"#', $body)) {
- if ($attachment = rcmail_save_image('program/resources/blocked.gif', 'image/gif')) {
- $COMPOSE['attachments'][$attachment['id']] = $attachment;
- $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
- $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
- $body = preg_replace('#\./program/resources/blocked\.gif#', $url, $body);
- }
- }
-
- $HTML_MODE = $isHtml;
-
- return $body;
+
+ $HTML_MODE = $isHtml;
+
+ return $body;
}
function rcmail_compose_part_body($part, $isHtml = false)
@@ -726,7 +779,7 @@ function rcmail_compose_part_body($part, $isHtml = false)
// Check if we have enough memory to handle the message in it
// #1487424: we need up to 10x more memory than the body
- if (!rcmail_mem_check($part->size * 10)) {
+ if (!rcube_utils::mem_check($part->size * 10)) {
return '';
}
@@ -803,892 +856,906 @@ function rcmail_compose_part_body($part, $isHtml = false)
function rcmail_compose_body($attrib)
{
- global $RCMAIL, $CONFIG, $OUTPUT, $MESSAGE, $compose_mode, $HTML_MODE, $MESSAGE_BODY;
+ global $RCMAIL, $OUTPUT, $HTML_MODE, $MESSAGE_BODY;
- list($form_start, $form_end) = get_form_tags($attrib);
- unset($attrib['form']);
+ list($form_start, $form_end) = get_form_tags($attrib);
+ unset($attrib['form']);
- if (empty($attrib['id']))
- $attrib['id'] = 'rcmComposeBody';
+ if (empty($attrib['id']))
+ $attrib['id'] = 'rcmComposeBody';
- $attrib['name'] = '_message';
+ $attrib['name'] = '_message';
- $isHtml = $HTML_MODE;
+ $isHtml = $HTML_MODE;
- $out = $form_start ? "$form_start\n" : '';
+ $out = $form_start ? "$form_start\n" : '';
- $saveid = new html_hiddenfield(array('name' => '_draft_saveid', 'value' => $compose_mode==RCUBE_COMPOSE_DRAFT ? str_replace(array('<','>'), "", $MESSAGE->headers->messageID) : ''));
- $out .= $saveid->show();
+ $saveid = new html_hiddenfield(array('name' => '_draft_saveid', 'value' => $RCMAIL->output->get_env('draft_id')));
+ $out .= $saveid->show();
- $drafttoggle = new html_hiddenfield(array('name' => '_draft', 'value' => 'yes'));
- $out .= $drafttoggle->show();
+ $drafttoggle = new html_hiddenfield(array('name' => '_draft', 'value' => 'yes'));
+ $out .= $drafttoggle->show();
- $msgtype = new html_hiddenfield(array('name' => '_is_html', 'value' => ($isHtml?"1":"0")));
- $out .= $msgtype->show();
+ $msgtype = new html_hiddenfield(array('name' => '_is_html', 'value' => ($isHtml ? "1" : "0")));
+ $out .= $msgtype->show();
- // If desired, set this textarea to be editable by TinyMCE
- if ($isHtml) {
- $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCMAIL_CHARSET);
- $attrib['class'] = 'mce_editor';
- $attrib['is_escaped'] = true;
- $textarea = new html_textarea($attrib);
- $out .= $textarea->show($MESSAGE_BODY);
- }
- else {
- $textarea = new html_textarea($attrib);
- $out .= $textarea->show('');
- // quote plain text, inject into textarea
- $table = get_html_translation_table(HTML_SPECIALCHARS);
- $MESSAGE_BODY = strtr($MESSAGE_BODY, $table);
- $out = substr($out, 0, -11) . $MESSAGE_BODY . '</textarea>';
- }
+ $framed = new html_hiddenfield(array('name' => '_framed', 'value' => '1'));
+ $out .= $framed->show();
- $out .= $form_end ? "\n$form_end" : '';
+ // If desired, set this textarea to be editable by TinyMCE
+ if ($isHtml) {
+ $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCUBE_CHARSET);
+ $attrib['class'] = 'mce_editor';
+ $attrib['is_escaped'] = true;
+ $textarea = new html_textarea($attrib);
+ $out .= $textarea->show($MESSAGE_BODY);
+ }
+ else {
+ $textarea = new html_textarea($attrib);
+ $out .= $textarea->show('');
- $OUTPUT->set_env('composebody', $attrib['id']);
+ // quote plain text, inject into textarea
+ $table = get_html_translation_table(HTML_SPECIALCHARS);
+ $MESSAGE_BODY = strtr($MESSAGE_BODY, $table);
+ $out = substr($out, 0, -11) . $MESSAGE_BODY . '</textarea>';
+ }
+
+ $out .= $form_end ? "\n$form_end" : '';
+
+ $OUTPUT->set_env('composebody', $attrib['id']);
- // include HTML editor
- rcube_html_editor();
+ // include HTML editor
+ $RCMAIL->html_editor();
- // Set language list
- if (!empty($CONFIG['enable_spellcheck'])) {
- $engine = $RCMAIL->config->get('spellcheck_engine','googie');
- $dictionary = (bool) $RCMAIL->config->get('spellcheck_dictionary');
- $spellcheck_langs = (array) $RCMAIL->config->get('spellcheck_languages',
- array('da'=>'Dansk', 'de'=>'Deutsch', 'en' => 'English', 'es'=>'Español',
- 'fr'=>'Français', 'it'=>'Italiano', 'nl'=>'Nederlands', 'pl'=>'Polski',
- 'pt'=>'Português', 'ru'=>'РуÑÑкий', 'fi'=>'Suomi', 'sv'=>'Svenska'));
+ // Set language list
+ if ($RCMAIL->config->get('enable_spellcheck')) {
+ $engine = new rcube_spellchecker();
+ $dictionary = (bool) $RCMAIL->config->get('spellcheck_dictionary');
+ $spellcheck_langs = $engine->languages();
+ $lang = $_SESSION['language'];
- // googie works only with two-letter codes
- if ($engine == 'googie') {
- $lang = strtolower(substr($_SESSION['language'], 0, 2));
+ // if not found in the list, try with two-letter code
+ if (!$spellcheck_langs[$lang]) {
+ $lang = strtolower(substr($lang, 0, 2));
+ }
+
+ if (!$spellcheck_langs[$lang]) {
+ $lang = 'en';
+ }
- $spellcheck_langs_googie = array();
- foreach ($spellcheck_langs as $key => $name)
- $spellcheck_langs_googie[strtolower(substr($key,0,2))] = $name;
- $spellcheck_langs = $spellcheck_langs_googie;
+ $OUTPUT->set_env('spell_langs', $spellcheck_langs);
+ $OUTPUT->set_env('spell_lang', $lang);
+
+ $editor_lang_set = array();
+ foreach ($spellcheck_langs as $key => $name) {
+ $editor_lang_set[] = ($key == $lang ? '+' : '') . rcube::JQ($name).'='.rcube::JQ($key);
+ }
+
+ // include GoogieSpell
+ $OUTPUT->include_script('googiespell.js');
+ $OUTPUT->add_script(sprintf(
+ "var googie = new GoogieSpell('%s/images/googiespell/','%s&lang=', %s);\n".
+ "googie.lang_chck_spell = \"%s\";\n".
+ "googie.lang_rsm_edt = \"%s\";\n".
+ "googie.lang_close = \"%s\";\n".
+ "googie.lang_revert = \"%s\";\n".
+ "googie.lang_no_error_found = \"%s\";\n".
+ "googie.lang_learn_word = \"%s\";\n".
+ "googie.setLanguages(%s);\n".
+ "googie.setCurrentLanguage('%s');\n".
+ "googie.setDecoration(false);\n".
+ "googie.decorateTextarea('%s');\n".
+ "%s.set_env('spellcheck', googie);",
+ $RCMAIL->output->get_skin_path(),
+ $RCMAIL->url(array('_task' => 'utils', '_action' => 'spell', '_remote' => 1)),
+ !empty($dictionary) ? 'true' : 'false',
+ rcube::JQ(rcube::Q($RCMAIL->gettext('checkspelling'))),
+ rcube::JQ(rcube::Q($RCMAIL->gettext('resumeediting'))),
+ rcube::JQ(rcube::Q($RCMAIL->gettext('close'))),
+ rcube::JQ(rcube::Q($RCMAIL->gettext('revertto'))),
+ rcube::JQ(rcube::Q($RCMAIL->gettext('nospellerrors'))),
+ rcube::JQ(rcube::Q($RCMAIL->gettext('addtodict'))),
+ rcube_output::json_serialize($spellcheck_langs),
+ $lang,
+ $attrib['id'],
+ rcmail_output::JS_OBJECT_NAME), 'foot');
+
+ $OUTPUT->add_label('checking');
+ $OUTPUT->set_env('spellcheck_langs', join(',', $editor_lang_set));
}
- else {
- $lang = $_SESSION['language'];
-
- // if not found in the list, try with two-letter code
- if (!$spellcheck_langs[$lang])
- $lang = strtolower(substr($lang, 0, 2));
- }
-
- if (!$spellcheck_langs[$lang])
- $lang = 'en';
-
- $OUTPUT->set_env('spell_langs', $spellcheck_langs);
- $OUTPUT->set_env('spell_lang', $lang);
-
- $editor_lang_set = array();
- foreach ($spellcheck_langs as $key => $name) {
- $editor_lang_set[] = ($key == $lang ? '+' : '') . JQ($name).'='.JQ($key);
- }
-
- // include GoogieSpell
- $OUTPUT->include_script('googiespell.js');
- $OUTPUT->add_script(sprintf(
- "var googie = new GoogieSpell('%s/images/googiespell/','%s&lang=', %s);\n".
- "googie.lang_chck_spell = \"%s\";\n".
- "googie.lang_rsm_edt = \"%s\";\n".
- "googie.lang_close = \"%s\";\n".
- "googie.lang_revert = \"%s\";\n".
- "googie.lang_no_error_found = \"%s\";\n".
- "googie.lang_learn_word = \"%s\";\n".
- "googie.setLanguages(%s);\n".
- "googie.setCurrentLanguage('%s');\n".
- "googie.setDecoration(false);\n".
- "googie.decorateTextarea('%s');\n".
- "%s.set_env('spellcheck', googie);",
- $RCMAIL->output->get_skin_path(),
- $RCMAIL->url(array('_task' => 'utils', '_action' => 'spell', '_remote' => 1)),
- !empty($dictionary) ? 'true' : 'false',
- JQ(Q(rcube_label('checkspelling'))),
- JQ(Q(rcube_label('resumeediting'))),
- JQ(Q(rcube_label('close'))),
- JQ(Q(rcube_label('revertto'))),
- JQ(Q(rcube_label('nospellerrors'))),
- JQ(Q(rcube_label('addtodict'))),
- json_serialize($spellcheck_langs),
- $lang,
- $attrib['id'],
- JS_OBJECT_NAME), 'foot');
-
- $OUTPUT->add_label('checking');
- $OUTPUT->set_env('spellcheck_langs', join(',', $editor_lang_set));
- }
-
- $out .= "\n".'<iframe name="savetarget" src="program/resources/blank.gif" style="width:0;height:0;border:none;visibility:hidden;"></iframe>';
-
- return $out;
+
+ $out .= "\n".'<iframe name="savetarget" src="program/resources/blank.gif" style="width:0;height:0;border:none;visibility:hidden;"></iframe>';
+
+ return $out;
}
function rcmail_create_reply_body($body, $bodyIsHtml)
{
- global $RCMAIL, $MESSAGE, $LINE_LENGTH;
-
- // build reply prefix
- $from = array_pop(rcube_mime::decode_address_list($MESSAGE->get_header('from'), 1, false, $MESSAGE->headers->charset));
- $prefix = rcube_label(array(
- 'name' => 'mailreplyintro',
- 'vars' => array(
- 'date' => format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')),
- 'sender' => $from['name'] ? $from['name'] : rcube_idn_to_utf8($from['mailto']),
- )
- ));
-
- if (!$bodyIsHtml) {
- $body = preg_replace('/\r?\n/', "\n", $body);
- $body = trim($body, "\n");
-
- // soft-wrap and quote message text
- $body = rcmail_wrap_and_quote($body, $LINE_LENGTH);
-
- $prefix .= "\n";
- $suffix = '';
-
- if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
- $prefix = "\n\n\n" . $prefix;
- }
- }
- else {
- // save inline images to files
- $cid_map = rcmail_write_inline_attachments($MESSAGE);
- // set is_safe flag (we need this for html body washing)
- rcmail_check_safe($MESSAGE);
- // clean up html tags
- $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
-
- // build reply (quote content)
- $prefix = '<p>' . Q($prefix) . "</p>\n";
- $prefix .= '<blockquote>';
-
- if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
- $prefix = '<br>' . $prefix;
- $suffix = '</blockquote>';
+ global $RCMAIL, $MESSAGE, $LINE_LENGTH;
+
+ // build reply prefix
+ $from = array_pop(rcube_mime::decode_address_list($MESSAGE->get_header('from'), 1, false, $MESSAGE->headers->charset));
+ $prefix = $RCMAIL->gettext(array(
+ 'name' => 'mailreplyintro',
+ 'vars' => array(
+ 'date' => $RCMAIL->format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')),
+ 'sender' => $from['name'] ? $from['name'] : rcube_utils::idn_to_utf8($from['mailto']),
+ )
+ ));
+
+ if (!$bodyIsHtml) {
+ $body = preg_replace('/\r?\n/', "\n", $body);
+ $body = trim($body, "\n");
+
+ // soft-wrap and quote message text
+ $body = rcmail_wrap_and_quote($body, $LINE_LENGTH);
+
+ $prefix .= "\n";
+ $suffix = '';
+
+ if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
+ $prefix = "\n\n\n" . $prefix;
+ }
}
else {
- $suffix = '</blockquote><p></p>';
+ // save inline images to files
+ $cid_map = rcmail_write_inline_attachments($MESSAGE);
+ // set is_safe flag (we need this for html body washing)
+ rcmail_check_safe($MESSAGE);
+ // clean up html tags
+ $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
+
+ // build reply (quote content)
+ $prefix = '<p>' . rcube::Q($prefix) . "</p>\n";
+ $prefix .= '<blockquote>';
+
+ if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
+ $prefix = '<br>' . $prefix;
+ $suffix = '</blockquote>';
+ }
+ else {
+ $suffix = '</blockquote><p></p>';
+ }
}
- }
- return $prefix.$body.$suffix;
+ return $prefix . $body . $suffix;
}
function rcmail_create_forward_body($body, $bodyIsHtml)
{
- global $RCMAIL, $MESSAGE, $COMPOSE;
-
- // add attachments
- if (!isset($COMPOSE['forward_attachments']) && is_array($MESSAGE->mime_parts))
- $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
-
- $date = format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long'));
-
- if (!$bodyIsHtml) {
- $prefix = "\n\n\n-------- " . rcube_label('originalmessage') . " --------\n";
- $prefix .= rcube_label('subject') . ': ' . $MESSAGE->subject . "\n";
- $prefix .= rcube_label('date') . ': ' . $date . "\n";
- $prefix .= rcube_label('from') . ': ' . $MESSAGE->get_header('from') . "\n";
- $prefix .= rcube_label('to') . ': ' . $MESSAGE->get_header('to') . "\n";
-
- if ($cc = $MESSAGE->headers->get('cc'))
- $prefix .= rcube_label('cc') . ': ' . $cc . "\n";
- if (($replyto = $MESSAGE->headers->get('reply-to')) && $replyto != $MESSAGE->get_header('from'))
- $prefix .= rcube_label('replyto') . ': ' . $replyto . "\n";
-
- $prefix .= "\n";
- $body = trim($body, "\r\n");
- }
- else {
- // set is_safe flag (we need this for html body washing)
- rcmail_check_safe($MESSAGE);
- // clean up html tags
- $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
-
- $prefix = sprintf(
- "<br /><p>-------- " . rcube_label('originalmessage') . " --------</p>" .
- "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody>" .
- "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>" .
- "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>" .
- "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>" .
- "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>",
- rcube_label('subject'), Q($MESSAGE->subject),
- rcube_label('date'), Q($date),
- rcube_label('from'), Q($MESSAGE->get_header('from'), 'replace'),
- rcube_label('to'), Q($MESSAGE->get_header('to'), 'replace'));
-
- if ($cc = $MESSAGE->headers->get('cc'))
- $prefix .= sprintf("<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>",
- rcube_label('cc'), Q($cc, 'replace'));
-
- if (($replyto = $MESSAGE->headers->get('reply-to')) && $replyto != $MESSAGE->get_header('from'))
- $prefix .= sprintf("<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>",
- rcube_label('replyto'), Q($replyto, 'replace'));
-
- $prefix .= "</tbody></table><br>";
- }
-
- return $prefix.$body;
+ global $RCMAIL, $MESSAGE, $COMPOSE;
+
+ // add attachments
+ if (!isset($COMPOSE['forward_attachments']) && is_array($MESSAGE->mime_parts)) {
+ $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
+ }
+
+ $date = $RCMAIL->format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long'));
+
+ if (!$bodyIsHtml) {
+ $prefix = "\n\n\n-------- " . $RCMAIL->gettext('originalmessage') . " --------\n";
+ $prefix .= $RCMAIL->gettext('subject') . ': ' . $MESSAGE->subject . "\n";
+ $prefix .= $RCMAIL->gettext('date') . ': ' . $date . "\n";
+ $prefix .= $RCMAIL->gettext('from') . ': ' . $MESSAGE->get_header('from') . "\n";
+ $prefix .= $RCMAIL->gettext('to') . ': ' . $MESSAGE->get_header('to') . "\n";
+
+ if ($cc = $MESSAGE->headers->get('cc')) {
+ $prefix .= $RCMAIL->gettext('cc') . ': ' . $cc . "\n";
+ }
+ if (($replyto = $MESSAGE->headers->get('reply-to')) && $replyto != $MESSAGE->get_header('from')) {
+ $prefix .= $RCMAIL->gettext('replyto') . ': ' . $replyto . "\n";
+ }
+
+ $prefix .= "\n";
+ $body = trim($body, "\r\n");
+ }
+ else {
+ // set is_safe flag (we need this for html body washing)
+ rcmail_check_safe($MESSAGE);
+
+ // clean up html tags
+ $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
+
+ $prefix = sprintf(
+ "<br /><p>-------- " . $RCMAIL->gettext('originalmessage') . " --------</p>" .
+ "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody>" .
+ "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>" .
+ "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>" .
+ "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>" .
+ "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>",
+ $RCMAIL->gettext('subject'), rcube::Q($MESSAGE->subject),
+ $RCMAIL->gettext('date'), rcube::Q($date),
+ $RCMAIL->gettext('from'), rcube::Q($MESSAGE->get_header('from'), 'replace'),
+ $RCMAIL->gettext('to'), rcube::Q($MESSAGE->get_header('to'), 'replace'));
+
+ if ($cc = $MESSAGE->headers->get('cc'))
+ $prefix .= sprintf("<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>",
+ $RCMAIL->gettext('cc'), rcube::Q($cc, 'replace'));
+
+ if (($replyto = $MESSAGE->headers->get('reply-to')) && $replyto != $MESSAGE->get_header('from'))
+ $prefix .= sprintf("<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>",
+ $RCMAIL->gettext('replyto'), rcube::Q($replyto, 'replace'));
+
+ $prefix .= "</tbody></table><br>";
+ }
+
+ return $prefix . $body;
}
function rcmail_create_draft_body($body, $bodyIsHtml)
{
- global $MESSAGE, $COMPOSE;
+ global $MESSAGE, $COMPOSE;
- /**
- * add attachments
- * sizeof($MESSAGE->mime_parts can be 1 - e.g. attachment, but no text!
- */
- if (empty($COMPOSE['forward_attachments'])
- && is_array($MESSAGE->mime_parts)
- && count($MESSAGE->mime_parts) > 0)
- {
- $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
- }
+ // add attachments
+ // sizeof($MESSAGE->mime_parts can be 1 - e.g. attachment, but no text!
+ if (empty($COMPOSE['forward_attachments'])
+ && is_array($MESSAGE->mime_parts)
+ && count($MESSAGE->mime_parts) > 0
+ ) {
+ $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml);
+ }
- // clean up HTML tags - XSS prevention (#1489251)
- if ($bodyIsHtml) {
- $body = rcmail_wash_html($body, array('safe' => 1), $cid_map);
+ // clean up HTML tags - XSS prevention (#1489251)
+ if ($bodyIsHtml) {
+ $body = rcmail_wash_html($body, array('safe' => 1), $cid_map);
- // remove comments (produced by washtml)
- $body = preg_replace('/<!--[^>]+-->/', '', $body);
+ // remove comments (produced by washtml)
+ $body = preg_replace('/<!--[^>]+-->/', '', $body);
- // replace cid with href in inline images links
- if (!empty($cid_map)) {
- $body = str_replace(array_keys($cid_map), array_values($cid_map), $body);
+ // replace cid with href in inline images links
+ if (!empty($cid_map)) {
+ $body = str_replace(array_keys($cid_map), array_values($cid_map), $body);
+ }
}
- }
- return $body;
+ return $body;
}
function rcmail_remove_signature($body)
{
- global $RCMAIL;
+ global $RCMAIL;
- $body = str_replace("\r\n", "\n", $body);
- $len = strlen($body);
- $sig_max_lines = $RCMAIL->config->get('sig_max_lines', 15);
+ $body = str_replace("\r\n", "\n", $body);
+ $len = strlen($body);
+ $sig_max_lines = $RCMAIL->config->get('sig_max_lines', 15);
- while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) {
- if ($sp == 0 || $body[$sp-1] == "\n") {
- // do not touch blocks with more that X lines
- if (substr_count($body, "\n", $sp) < $sig_max_lines) {
- $body = substr($body, 0, max(0, $sp-1));
- }
- break;
+ while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) {
+ if ($sp == 0 || $body[$sp-1] == "\n") {
+ // do not touch blocks with more that X lines
+ if (substr_count($body, "\n", $sp) < $sig_max_lines) {
+ $body = substr($body, 0, max(0, $sp-1));
+ }
+ break;
+ }
}
- }
- return $body;
+ return $body;
}
function rcmail_write_compose_attachments(&$message, $bodyIsHtml)
{
- global $RCMAIL, $COMPOSE, $compose_mode;
-
- $loaded_attachments = array();
- foreach ((array)$COMPOSE['attachments'] as $attachment) {
- $loaded_attachments[$attachment['name'] . $attachment['mimetype']] = $attachment;
- }
-
- $cid_map = array();
- $messages = array();
-
- foreach ((array)$message->mime_parts as $pid => $part)
- {
- if ($part->disposition == 'attachment' || ($part->disposition == 'inline' && $bodyIsHtml) || $part->filename) {
- // skip parts that aren't valid attachments
- if ($part->ctype_primary == 'multipart' || $part->mimetype == 'application/ms-tnef') {
- continue;
- }
- // skip message attachments in reply mode
- if ($part->ctype_primary == 'message' && $compose_mode == RCUBE_COMPOSE_REPLY) {
- continue;
- }
- // skip inline images when forwarding in text mode
- if ($part->content_id && $part->disposition == 'inline' && !$bodyIsHtml && $compose_mode == RCUBE_COMPOSE_FORWARD) {
- continue;
- }
-
- // skip message/rfc822 attachments on forwards (#1489214)
- // Thunderbird when forwarding in inline mode displays such attachments
- // and skips any attachments from inside of such part, this however
- // skipped e.g. images used in HTML body or other attachments. So,
- // better to skip .eml attachments but not their content (included files).
- if ($part->mimetype == 'message/rfc822') {
- if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
- continue;
- }
- $messages[] = $part->mime_id;
- }
- else if ($compose_mode != RCUBE_COMPOSE_FORWARD) {
- // skip attachments included in message/rfc822 attachment (#1486487)
- foreach ($messages as $mimeid)
- if (strpos($part->mime_id, $mimeid . '.') === 0) {
- continue 2;
- }
- }
-
- if (($attachment = $loaded_attachments[rcmail_attachment_name($part) . $part->mimetype])
- || ($attachment = rcmail_save_attachment($message, $pid))) {
- $COMPOSE['attachments'][$attachment['id']] = $attachment;
- if ($bodyIsHtml && ($part->content_id || $part->content_location)) {
- $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
- $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
- if ($part->content_id)
- $cid_map['cid:'.$part->content_id] = $url;
- else
- $cid_map[$part->content_location] = $url;
+ global $RCMAIL, $COMPOSE, $compose_mode;
+
+ $loaded_attachments = array();
+ foreach ((array)$COMPOSE['attachments'] as $attachment) {
+ $loaded_attachments[$attachment['name'] . $attachment['mimetype']] = $attachment;
+ }
+
+ $cid_map = array();
+ $messages = array();
+
+ foreach ((array)$message->mime_parts as $pid => $part) {
+ if ($part->disposition == 'attachment' || ($part->disposition == 'inline' && $bodyIsHtml) || $part->filename) {
+ // skip parts that aren't valid attachments
+ if ($part->ctype_primary == 'multipart' || $part->mimetype == 'application/ms-tnef') {
+ continue;
+ }
+
+ // skip message attachments in reply mode
+ if ($part->ctype_primary == 'message' && $compose_mode == RCUBE_COMPOSE_REPLY) {
+ continue;
+ }
+
+ // skip inline images when forwarding in text mode
+ if ($part->content_id && $part->disposition == 'inline' && !$bodyIsHtml && $compose_mode == RCUBE_COMPOSE_FORWARD) {
+ continue;
+ }
+
+ // skip message/rfc822 attachments on forwards (#1489214)
+ // Thunderbird when forwarding in inline mode displays such attachments
+ // and skips any attachments from inside of such part, this however
+ // skipped e.g. images used in HTML body or other attachments. So,
+ // better to skip .eml attachments but not their content (included files).
+ if ($part->mimetype == 'message/rfc822') {
+ if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
+ continue;
+ }
+ $messages[] = $part->mime_id;
+ }
+ else if ($compose_mode != RCUBE_COMPOSE_FORWARD) {
+ // skip attachments included in message/rfc822 attachment (#1486487)
+ foreach ($messages as $mimeid) {
+ if (strpos($part->mime_id, $mimeid . '.') === 0) {
+ continue 2;
+ }
+ }
+ }
+
+ if (($attachment = $loaded_attachments[rcmail_attachment_name($part) . $part->mimetype])
+ || ($attachment = rcmail_save_attachment($message, $pid))
+ ) {
+ $COMPOSE['attachments'][$attachment['id']] = $attachment;
+
+ if ($bodyIsHtml && ($part->content_id || $part->content_location)) {
+ $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
+ $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
+
+ if ($part->content_id)
+ $cid_map['cid:'.$part->content_id] = $url;
+ else
+ $cid_map[$part->content_location] = $url;
+ }
+ }
}
- }
}
- }
- $COMPOSE['forward_attachments'] = true;
+ $COMPOSE['forward_attachments'] = true;
- return $cid_map;
+ return $cid_map;
}
function rcmail_write_inline_attachments(&$message)
{
- global $RCMAIL, $COMPOSE;
-
- $cid_map = array();
- foreach ((array)$message->mime_parts as $pid => $part) {
- if (($part->content_id || $part->content_location) && $part->filename) {
- if ($attachment = rcmail_save_attachment($message, $pid)) {
- $COMPOSE['attachments'][$attachment['id']] = $attachment;
- $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
- $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
- if ($part->content_id)
- $cid_map['cid:'.$part->content_id] = $url;
- else
- $cid_map[$part->content_location] = $url;
- }
+ global $RCMAIL, $COMPOSE;
+
+ $cid_map = array();
+ foreach ((array)$message->mime_parts as $pid => $part) {
+ if (($part->content_id || $part->content_location) && $part->filename) {
+ if ($attachment = rcmail_save_attachment($message, $pid)) {
+ $COMPOSE['attachments'][$attachment['id']] = $attachment;
+ $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
+ $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
+
+ if ($part->content_id)
+ $cid_map['cid:'.$part->content_id] = $url;
+ else
+ $cid_map[$part->content_location] = $url;
+ }
+ }
}
- }
- return $cid_map;
+ return $cid_map;
}
// Creates attachment(s) from the forwarded message(s)
function rcmail_write_forward_attachments()
{
- global $RCMAIL, $COMPOSE, $MESSAGE;
+ global $RCMAIL, $COMPOSE, $MESSAGE;
- $storage = $RCMAIL->get_storage();
- $mem_limit = parse_bytes(ini_get('memory_limit'));
- $curr_mem = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB
- $names = array();
+ $storage = $RCMAIL->get_storage();
+ $names = array();
- $loaded_attachments = array();
- foreach ((array)$COMPOSE['attachments'] as $attachment) {
- $loaded_attachments[$attachment['name'] . $attachment['mimetype']] = $attachment;
- }
+ $loaded_attachments = array();
+ foreach ((array)$COMPOSE['attachments'] as $attachment) {
+ $loaded_attachments[$attachment['name'] . $attachment['mimetype']] = $attachment;
+ }
- if ($COMPOSE['forward_uid'] == '*') {
- $index = $storage->index(null, rcmail_sort_column(), rcmail_sort_order());
- $COMPOSE['forward_uid'] = $index->get();
- }
- else {
- $COMPOSE['forward_uid'] = explode(',', $COMPOSE['forward_uid']);
- }
+ if ($COMPOSE['forward_uid'] == '*') {
+ $index = $storage->index(null, rcmail_sort_column(), rcmail_sort_order());
+ $COMPOSE['forward_uid'] = $index->get();
+ }
+ else if (strpos($COMPOSE['forward_uid'], ':')) {
+ $COMPOSE['forward_uid'] = rcube_imap_generic::uncompressMessageSet($COMPOSE['forward_uid']);
+ }
+ else {
+ $COMPOSE['forward_uid'] = explode(',', $COMPOSE['forward_uid']);
+ }
- foreach ((array)$COMPOSE['forward_uid'] as $uid) {
- $message = new rcube_message($uid);
+ foreach ((array)$COMPOSE['forward_uid'] as $uid) {
+ $message = new rcube_message($uid);
- if (empty($message->headers)) {
- continue;
- }
+ if (empty($message->headers)) {
+ continue;
+ }
- if (!empty($message->headers->charset)) {
- $storage->set_charset($message->headers->charset);
- }
+ if (!empty($message->headers->charset)) {
+ $storage->set_charset($message->headers->charset);
+ }
- if (empty($MESSAGE->subject)) {
- $MESSAGE->subject = $message->subject;
- }
+ if (empty($MESSAGE->subject)) {
+ $MESSAGE->subject = $message->subject;
+ }
- // generate (unique) attachment name
- $name = strlen($message->subject) ? mb_substr($message->subject, 0, 64) : 'message_rfc822';
- if (!empty($names[$name])) {
- $names[$name]++;
- $name .= '_' . $names[$name];
- }
- $names[$name] = 1;
- $name .= '.eml';
+ // generate (unique) attachment name
+ $name = strlen($message->subject) ? mb_substr($message->subject, 0, 64) : 'message_rfc822';
+ if (!empty($names[$name])) {
+ $names[$name]++;
+ $name .= '_' . $names[$name];
+ }
+ $names[$name] = 1;
+ $name .= '.eml';
+
+ $data = $path = null;
+
+ if (!empty($loaded_attachments[$name . 'message/rfc822'])) {
+ continue;
+ }
+
+ // don't load too big attachments into memory
+ if (!rcube_utils::mem_check($message->size)) {
+ $temp_dir = unslashify($RCMAIL->config->get('temp_dir'));
+ $path = tempnam($temp_dir, 'rcmAttmnt');
+ if ($fp = fopen($path, 'w')) {
+ $storage->get_raw_body($message->uid, $fp);
+ fclose($fp);
+ }
+ else {
+ return false;
+ }
+ }
+ else {
+ $data = $storage->get_raw_body($message->uid);
+ $curr_mem += $message->size;
+ }
- $data = $path = null;
+ $attachment = array(
+ 'group' => $COMPOSE['id'],
+ 'name' => $name,
+ 'mimetype' => 'message/rfc822',
+ 'data' => $data,
+ 'path' => $path,
+ 'size' => $path ? filesize($path) : strlen($data),
+ );
+
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_save', $attachment);
- if (!empty($loaded_attachments[$name . 'message/rfc822'])) {
- continue;
+ if ($attachment['status']) {
+ unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
+ $COMPOSE['attachments'][$attachment['id']] = $attachment;
+ }
+ else if ($path) {
+ @unlink($path);
+ }
}
+}
+
+
+function rcmail_save_attachment(&$message, $pid)
+{
+ global $COMPOSE;
+
+ $rcmail = rcmail::get_instance();
+ $part = $message->mime_parts[$pid];
+ $data = $path = null;
// don't load too big attachments into memory
- if ($mem_limit > 0 && $message->size > $mem_limit - $curr_mem) {
- $temp_dir = unslashify($RCMAIL->config->get('temp_dir'));
- $path = tempnam($temp_dir, 'rcmAttmnt');
- if ($fp = fopen($path, 'w')) {
- $storage->get_raw_body($message->uid, $fp);
- fclose($fp);
- }
- else {
- return false;
- }
+ if (!rcube_utils::mem_check($part->size)) {
+ $temp_dir = unslashify($rcmail->config->get('temp_dir'));
+ $path = tempnam($temp_dir, 'rcmAttmnt');
+
+ if ($fp = fopen($path, 'w')) {
+ $message->get_part_content($pid, $fp, true, 0, false);
+ fclose($fp);
+ }
+ else {
+ return false;
+ }
}
else {
- $data = $storage->get_raw_body($message->uid);
- $curr_mem += $message->size;
+ $data = $message->get_part_content($pid, null, true, 0, false);
}
+ $mimetype = $part->ctype_primary . '/' . $part->ctype_secondary;
+ $filename = rcmail_attachment_name($part);
+
$attachment = array(
- 'group' => $COMPOSE['id'],
- 'name' => $name,
- 'mimetype' => 'message/rfc822',
- 'data' => $data,
- 'path' => $path,
- 'size' => $path ? filesize($path) : strlen($data),
+ 'group' => $COMPOSE['id'],
+ 'name' => $filename,
+ 'mimetype' => $mimetype,
+ 'content_id' => $part->content_id,
+ 'data' => $data,
+ 'path' => $path,
+ 'size' => $path ? filesize($path) : strlen($data),
);
- $attachment = $RCMAIL->plugins->exec_hook('attachment_save', $attachment);
+ $attachment = $rcmail->plugins->exec_hook('attachment_save', $attachment);
if ($attachment['status']) {
- unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
- $COMPOSE['attachments'][$attachment['id']] = $attachment;
+ unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
+ return $attachment;
}
else if ($path) {
- @unlink($path);
+ @unlink($path);
}
- }
-}
-
-function rcmail_save_attachment(&$message, $pid)
-{
- global $COMPOSE;
-
- $rcmail = rcmail::get_instance();
- $part = $message->mime_parts[$pid];
- $mem_limit = parse_bytes(ini_get('memory_limit'));
- $curr_mem = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB
- $data = $path = null;
-
- // don't load too big attachments into memory
- if ($mem_limit > 0 && $part->size > $mem_limit - $curr_mem) {
- $temp_dir = unslashify($rcmail->config->get('temp_dir'));
- $path = tempnam($temp_dir, 'rcmAttmnt');
- if ($fp = fopen($path, 'w')) {
- $message->get_part_content($pid, $fp);
- fclose($fp);
- } else
- return false;
- } else {
- $data = $message->get_part_content($pid);
- }
-
- $mimetype = $part->ctype_primary . '/' . $part->ctype_secondary;
- $filename = rcmail_attachment_name($part);
-
- $attachment = array(
- 'group' => $COMPOSE['id'],
- 'name' => $filename,
- 'mimetype' => $mimetype,
- 'content_id' => $part->content_id,
- 'data' => $data,
- 'path' => $path,
- 'size' => $path ? filesize($path) : strlen($data),
- );
-
- $attachment = $rcmail->plugins->exec_hook('attachment_save', $attachment);
-
- if ($attachment['status']) {
- unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
- return $attachment;
- } else if ($path) {
- @unlink($path);
- }
-
- return false;
+ return false;
}
function rcmail_save_image($path, $mimetype='')
{
- global $COMPOSE;
+ global $COMPOSE;
- // handle attachments in memory
- $data = file_get_contents($path);
- $name = rcmail_basename($path);
+ // handle attachments in memory
+ $data = file_get_contents($path);
+ $name = rcmail_basename($path);
- $attachment = array(
- 'group' => $COMPOSE['id'],
- 'name' => $name,
- 'mimetype' => $mimetype ? $mimetype : rc_mime_content_type($path, $name),
- 'data' => $data,
- 'size' => strlen($data),
- );
+ $attachment = array(
+ 'group' => $COMPOSE['id'],
+ 'name' => $name,
+ 'mimetype' => $mimetype ? $mimetype : rcube_mime::file_content_type($path, $name),
+ 'data' => $data,
+ 'size' => strlen($data),
+ );
- $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
+ $attachment = rcmail::get_instance()->plugins->exec_hook('attachment_save', $attachment);
- if ($attachment['status']) {
- unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
- return $attachment;
- }
+ if ($attachment['status']) {
+ unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
+ return $attachment;
+ }
- return false;
+ return false;
}
function rcmail_basename($filename)
{
- // basename() is not unicode safe and locale dependent
- if (stristr(PHP_OS, 'win') || stristr(PHP_OS, 'netware')) {
- return preg_replace('/^.*[\\\\\\/]/', '', $filename);
- } else {
- return preg_replace('/^.*[\/]/', '', $filename);
- }
+ // basename() is not unicode safe and locale dependent
+ if (stristr(PHP_OS, 'win') || stristr(PHP_OS, 'netware')) {
+ return preg_replace('/^.*[\\\\\\/]/', '', $filename);
+ }
+ else {
+ return preg_replace('/^.*[\/]/', '', $filename);
+ }
}
function rcmail_compose_subject($attrib)
{
- global $MESSAGE, $COMPOSE, $compose_mode;
+ global $MESSAGE, $COMPOSE, $compose_mode;
- list($form_start, $form_end) = get_form_tags($attrib);
- unset($attrib['form']);
+ list($form_start, $form_end) = get_form_tags($attrib);
+ unset($attrib['form']);
- $attrib['name'] = '_subject';
- $attrib['spellcheck'] = 'true';
- $textfield = new html_inputfield($attrib);
+ $attrib['name'] = '_subject';
+ $attrib['spellcheck'] = 'true';
- $subject = '';
+ $textfield = new html_inputfield($attrib);
+ $subject = '';
- // use subject from post
- if (isset($_POST['_subject'])) {
- $subject = get_input_value('_subject', RCUBE_INPUT_POST, TRUE);
- }
- // create a reply-subject
- else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
- if (preg_match('/^re:/i', $MESSAGE->subject))
- $subject = $MESSAGE->subject;
- else
- $subject = 'Re: '.$MESSAGE->subject;
- }
- // create a forward-subject
- else if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
- if (preg_match('/^fwd:/i', $MESSAGE->subject))
- $subject = $MESSAGE->subject;
- else
- $subject = 'Fwd: '.$MESSAGE->subject;
- }
- // creeate a draft-subject
- else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) {
- $subject = $MESSAGE->subject;
- }
- else if (!empty($COMPOSE['param']['subject'])) {
- $subject = $COMPOSE['param']['subject'];
- }
-
- $out = $form_start ? "$form_start\n" : '';
- $out .= $textfield->show($subject);
- $out .= $form_end ? "\n$form_end" : '';
-
- return $out;
+ // use subject from post
+ if (isset($_POST['_subject'])) {
+ $subject = rcube_utils::get_input_value('_subject', rcube_utils::INPUT_POST, TRUE);
+ }
+ // create a reply-subject
+ else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
+ if (preg_match('/^re:/i', $MESSAGE->subject))
+ $subject = $MESSAGE->subject;
+ else
+ $subject = 'Re: '.$MESSAGE->subject;
+ }
+ // create a forward-subject
+ else if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
+ if (preg_match('/^fwd:/i', $MESSAGE->subject))
+ $subject = $MESSAGE->subject;
+ else
+ $subject = 'Fwd: '.$MESSAGE->subject;
+ }
+ // creeate a draft-subject
+ else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) {
+ $subject = $MESSAGE->subject;
+ }
+ else if (!empty($COMPOSE['param']['subject'])) {
+ $subject = $COMPOSE['param']['subject'];
+ }
+
+ $out = $form_start ? "$form_start\n" : '';
+ $out .= $textfield->show($subject);
+ $out .= $form_end ? "\n$form_end" : '';
+
+ return $out;
}
function rcmail_compose_attachment_list($attrib)
{
- global $OUTPUT, $CONFIG, $COMPOSE;
-
- // add ID if not given
- if (!$attrib['id'])
- $attrib['id'] = 'rcmAttachmentList';
-
- $out = "\n";
- $jslist = array();
- $button = '';
-
- if (is_array($COMPOSE['attachments'])) {
- if ($attrib['deleteicon']) {
- $button = html::img(array(
- 'src' => $CONFIG['skin_path'] . $attrib['deleteicon'],
- 'alt' => rcube_label('delete')
- ));
- }
- else if (rcube_utils::get_boolean($attrib['textbuttons'])) {
- $button = Q(rcube_label('delete'));
- }
-
- foreach ($COMPOSE['attachments'] as $id => $a_prop) {
- if (empty($a_prop))
- continue;
-
- $out .= html::tag('li',
- array(
- 'id' => 'rcmfile'.$id,
- 'class' => rcmail_filetype2classname($a_prop['mimetype'], $a_prop['name']),
- 'onmouseover' => "rcube_webmail.long_subject_title_ex(this, 0)",
- ),
- html::a(array(
- 'href' => "#delete",
- 'title' => rcube_label('delete'),
- 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id),
- 'class' => 'delete'
- ),
- $button
- ) . Q($a_prop['name'])
- );
-
- $jslist['rcmfile'.$id] = array('name' => $a_prop['name'], 'complete' => true, 'mimetype' => $a_prop['mimetype']);
- }
- }
-
- if ($attrib['deleteicon'])
- $COMPOSE['deleteicon'] = $CONFIG['skin_path'] . $attrib['deleteicon'];
- else if (rcube_utils::get_boolean($attrib['textbuttons']))
- $COMPOSE['textbuttons'] = true;
- if ($attrib['cancelicon'])
- $OUTPUT->set_env('cancelicon', $CONFIG['skin_path'] . $attrib['cancelicon']);
- if ($attrib['loadingicon'])
- $OUTPUT->set_env('loadingicon', $CONFIG['skin_path'] . $attrib['loadingicon']);
-
- $OUTPUT->set_env('attachments', $jslist);
- $OUTPUT->add_gui_object('attachmentlist', $attrib['id']);
-
- return html::tag('ul', $attrib, $out, html::$common_attrib);
+ global $RCMAIL, $OUTPUT, $COMPOSE;
+
+ // add ID if not given
+ if (!$attrib['id'])
+ $attrib['id'] = 'rcmAttachmentList';
+
+ $out = "\n";
+ $jslist = array();
+ $button = '';
+ $skin_path = $RCMAIL->config->get('skin_path');
+
+ if (is_array($COMPOSE['attachments'])) {
+ if ($attrib['deleteicon']) {
+ $button = html::img(array(
+ 'src' => $skin_path . $attrib['deleteicon'],
+ 'alt' => $RCMAIL->gettext('delete')
+ ));
+ }
+ else if (rcube_utils::get_boolean($attrib['textbuttons'])) {
+ $button = rcube::Q($RCMAIL->gettext('delete'));
+ }
+
+ foreach ($COMPOSE['attachments'] as $id => $a_prop) {
+ if (empty($a_prop)) {
+ continue;
+ }
+
+ $out .= html::tag('li', array(
+ 'id' => 'rcmfile'.$id,
+ 'class' => rcube_utils::file2class($a_prop['mimetype'], $a_prop['name']),
+ 'onmouseover' => "rcube_webmail.long_subject_title_ex(this, 0)",
+ ),
+ html::a(array(
+ 'href' => "#delete",
+ 'title' => $RCMAIL->gettext('delete'),
+ 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", rcmail_output::JS_OBJECT_NAME, $id),
+ 'class' => 'delete'
+ ),
+ $button
+ ) . rcube::Q($a_prop['name'])
+ );
+
+ $jslist['rcmfile'.$id] = array(
+ 'name' => $a_prop['name'],
+ 'complete' => true,
+ 'mimetype' => $a_prop['mimetype']
+ );
+ }
+ }
+
+ if ($attrib['deleteicon'])
+ $COMPOSE['deleteicon'] = $skin_path . $attrib['deleteicon'];
+ else if (rcube_utils::get_boolean($attrib['textbuttons']))
+ $COMPOSE['textbuttons'] = true;
+ if ($attrib['cancelicon'])
+ $OUTPUT->set_env('cancelicon', $skin_path . $attrib['cancelicon']);
+ if ($attrib['loadingicon'])
+ $OUTPUT->set_env('loadingicon', $skin_path . $attrib['loadingicon']);
+
+ $OUTPUT->set_env('attachments', $jslist);
+ $OUTPUT->add_gui_object('attachmentlist', $attrib['id']);
+
+ return html::tag('ul', $attrib, $out, html::$common_attrib);
}
function rcmail_compose_attachment_form($attrib)
{
- global $OUTPUT;
+ global $OUTPUT, $RCMAIL;
- // set defaults
- $attrib += array('id' => 'rcmUploadbox', 'buttons' => 'yes');
+ // set defaults
+ $attrib += array('id' => 'rcmUploadbox', 'buttons' => 'yes');
- // Get filesize, enable upload progress bar
- $max_filesize = rcube_upload_init();
+ // Get filesize, enable upload progress bar
+ $max_filesize = $RCMAIL->upload_init();
- $button = new html_inputfield(array('type' => 'button'));
+ $button = new html_inputfield(array('type' => 'button'));
+ $content = html::div(null, rcmail_compose_attachment_field())
+ . html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))));
- $out = html::div($attrib,
- $OUTPUT->form_tag(array('id' => $attrib['id'].'Frm', 'name' => 'uploadform', 'method' => 'post', 'enctype' => 'multipart/form-data'),
- html::div(null, rcmail_compose_attachment_field()) .
- html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) .
- (get_boolean($attrib['buttons']) ? html::div('buttons',
- $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' .
- $button->show(rcube_label('upload'), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('send-attachment', this.form)"))
- ) : '')
- )
- );
+ if (rcube_utils::get_boolean($attrib['buttons'])) {
+ $content .= html::div('buttons',
+ $button->show($RCMAIL->gettext('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' .
+ $button->show($RCMAIL->gettext('upload'), array('class' => 'button mainaction', 'onclick' => rcmail_output::JS_OBJECT_NAME . ".command('send-attachment', this.form)"))
+ );
+ }
+
+ $out = html::div($attrib, $OUTPUT->form_tag(array(
+ 'id' => $attrib['id'] . 'Frm',
+ 'name' => 'uploadform',
+ 'method' => 'post',
+ 'enctype' => 'multipart/form-data'
+ ), $content
+ ));
- $OUTPUT->add_gui_object('uploadform', $attrib['id'].'Frm');
- return $out;
+ $OUTPUT->add_gui_object('uploadform', $attrib['id'] . 'Frm');
+
+ return $out;
}
function rcmail_compose_attachment_field($attrib = array())
{
- $attrib['type'] = 'file';
- $attrib['name'] = '_attachments[]';
- $attrib['multiple'] = 'multiple';
+ $attrib['type'] = 'file';
+ $attrib['name'] = '_attachments[]';
+ $attrib['multiple'] = 'multiple';
+
+ $field = new html_inputfield($attrib);
- $field = new html_inputfield($attrib);
- return $field->show();
+ return $field->show();
}
function rcmail_priority_selector($attrib)
{
- global $MESSAGE;
+ global $RCMAIL, $MESSAGE;
- list($form_start, $form_end) = get_form_tags($attrib);
- unset($attrib['form']);
+ list($form_start, $form_end) = get_form_tags($attrib);
+ unset($attrib['form']);
- $attrib['name'] = '_priority';
- $selector = new html_select($attrib);
+ $attrib['name'] = '_priority';
+ $prio_list = array(
+ $RCMAIL->gettext('lowest') => 5,
+ $RCMAIL->gettext('low') => 4,
+ $RCMAIL->gettext('normal') => 0,
+ $RCMAIL->gettext('high') => 2,
+ $RCMAIL->gettext('highest') => 1,
+ );
- $selector->add(array(rcube_label('lowest'),
- rcube_label('low'),
- rcube_label('normal'),
- rcube_label('high'),
- rcube_label('highest')),
- array('5', '4', '0', '2', '1'));
+ $selector = new html_select($attrib);
+ $selector->add(array_keys($prio_list), array_values($prio_list));
- if (isset($_POST['_priority']))
- $sel = $_POST['_priority'];
- else if (isset($MESSAGE->headers->priority) && intval($MESSAGE->headers->priority) != 3)
- $sel = $MESSAGE->headers->priority;
- else
- $sel = 0;
+ if (isset($_POST['_priority']))
+ $sel = $_POST['_priority'];
+ else if (isset($MESSAGE->headers->priority) && intval($MESSAGE->headers->priority) != 3)
+ $sel = $MESSAGE->headers->priority;
+ else
+ $sel = 0;
- $out = $form_start ? "$form_start\n" : '';
- $out .= $selector->show(strval($sel));
- $out .= $form_end ? "\n$form_end" : '';
+ $out = $form_start ? "$form_start\n" : '';
+ $out .= $selector->show((int) $sel);
+ $out .= $form_end ? "\n$form_end" : '';
- return $out;
+ return $out;
}
function rcmail_receipt_checkbox($attrib)
{
- global $RCMAIL, $MESSAGE, $compose_mode;
+ global $RCMAIL, $MESSAGE, $compose_mode;
- list($form_start, $form_end) = get_form_tags($attrib);
- unset($attrib['form']);
+ list($form_start, $form_end) = get_form_tags($attrib);
+ unset($attrib['form']);
- if (!isset($attrib['id']))
- $attrib['id'] = 'receipt';
+ if (!isset($attrib['id']))
+ $attrib['id'] = 'receipt';
- $attrib['name'] = '_receipt';
- $attrib['value'] = '1';
- $checkbox = new html_checkbox($attrib);
+ $attrib['name'] = '_receipt';
+ $attrib['value'] = '1';
- if (isset($_POST['_receipt']))
- $mdn_default = $_POST['_receipt'];
- else if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT)))
- $mdn_default = (bool) $MESSAGE->headers->mdn_to;
- else
- $mdn_default = $RCMAIL->config->get('mdn_default');
+ $checkbox = new html_checkbox($attrib);
- $out = $form_start ? "$form_start\n" : '';
- $out .= $checkbox->show($mdn_default);
- $out .= $form_end ? "\n$form_end" : '';
+ if (isset($_POST['_receipt']))
+ $mdn_default = $_POST['_receipt'];
+ else if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT)))
+ $mdn_default = (bool) $MESSAGE->headers->mdn_to;
+ else
+ $mdn_default = $RCMAIL->config->get('mdn_default');
+
+ $out = $form_start ? "$form_start\n" : '';
+ $out .= $checkbox->show($mdn_default);
+ $out .= $form_end ? "\n$form_end" : '';
- return $out;
+ return $out;
}
function rcmail_dsn_checkbox($attrib)
{
- global $RCMAIL;
+ global $RCMAIL;
- list($form_start, $form_end) = get_form_tags($attrib);
- unset($attrib['form']);
+ list($form_start, $form_end) = get_form_tags($attrib);
+ unset($attrib['form']);
- if (!isset($attrib['id']))
- $attrib['id'] = 'dsn';
+ if (!isset($attrib['id']))
+ $attrib['id'] = 'dsn';
- $attrib['name'] = '_dsn';
- $attrib['value'] = '1';
- $checkbox = new html_checkbox($attrib);
+ $attrib['name'] = '_dsn';
+ $attrib['value'] = '1';
- if (isset($_POST['_dsn']))
- $dsn_value = $_POST['_dsn'];
- else
- $dsn_value = $RCMAIL->config->get('dsn_default');
+ $checkbox = new html_checkbox($attrib);
- $out = $form_start ? "$form_start\n" : '';
- $out .= $checkbox->show($dsn_value);
- $out .= $form_end ? "\n$form_end" : '';
+ if (isset($_POST['_dsn']))
+ $dsn_value = (int) $_POST['_dsn'];
+ else
+ $dsn_value = $RCMAIL->config->get('dsn_default');
- return $out;
+ $out = $form_start ? "$form_start\n" : '';
+ $out .= $checkbox->show($dsn_value);
+ $out .= $form_end ? "\n$form_end" : '';
+
+ return $out;
}
function rcmail_editor_selector($attrib)
{
- // determine whether HTML or plain text should be checked
- $useHtml = rcmail_compose_editor_mode();
+ global $RCMAIL;
- if (empty($attrib['editorid']))
- $attrib['editorid'] = 'rcmComposeBody';
+ // determine whether HTML or plain text should be checked
+ $useHtml = rcmail_compose_editor_mode();
- if (empty($attrib['name']))
- $attrib['name'] = 'editorSelect';
+ if (empty($attrib['editorid']))
+ $attrib['editorid'] = 'rcmComposeBody';
- $attrib['onchange'] = "return rcmail_toggle_editor(this, '".$attrib['editorid']."', '_is_html')";
+ if (empty($attrib['name']))
+ $attrib['name'] = 'editorSelect';
- $select = new html_select($attrib);
+ $attrib['onchange'] = "return rcmail_toggle_editor(this, '".$attrib['editorid']."', '_is_html')";
- $select->add(Q(rcube_label('htmltoggle')), 'html');
- $select->add(Q(rcube_label('plaintoggle')), 'plain');
+ $select = new html_select($attrib);
- return $select->show($useHtml ? 'html' : 'plain');
-/*
- foreach ($choices as $value => $text) {
- $attrib['id'] = '_' . $value;
- $attrib['value'] = $value;
- $selector .= $radio->show($chosenvalue, $attrib) . html::label($attrib['id'], Q(rcube_label($text)));
- }
+ $select->add(rcube::Q($RCMAIL->gettext('htmltoggle')), 'html');
+ $select->add(rcube::Q($RCMAIL->gettext('plaintoggle')), 'plain');
- return $selector;
-*/
+ return $select->show($useHtml ? 'html' : 'plain');
}
function rcmail_store_target_selection($attrib)
{
- global $COMPOSE;
-
- $attrib['name'] = '_store_target';
- $select = rcmail_mailbox_select(array_merge($attrib, array(
- 'noselection' => '- '.rcube_label('dontsave').' -',
- 'folder_filter' => 'mail',
- 'folder_rights' => 'w',
- )));
- return $select->show(isset($_POST['_store_target']) ? $_POST['_store_target'] : $COMPOSE['param']['sent_mbox'], $attrib);
+ global $COMPOSE, $RCMAIL;
+
+ $attrib['name'] = '_store_target';
+ $select = $RCMAIL->folder_selector(array_merge($attrib, array(
+ 'noselection' => '- ' . $RCMAIL->gettext('dontsave') . ' -',
+ 'folder_filter' => 'mail',
+ 'folder_rights' => 'w',
+ )));
+
+ return $select->show(isset($_POST['_store_target']) ? $_POST['_store_target'] : $COMPOSE['param']['sent_mbox'], $attrib);
}
function rcmail_check_sent_folder($folder, $create=false)
{
- global $RCMAIL;
+ global $RCMAIL;
- // we'll not save the message, so it doesn't matter
- if ($RCMAIL->config->get('no_save_sent_messages')) {
- return true;
- }
+ // we'll not save the message, so it doesn't matter
+ if ($RCMAIL->config->get('no_save_sent_messages')) {
+ return true;
+ }
- if ($RCMAIL->storage->folder_exists($folder, true)) {
- return true;
- }
+ if ($RCMAIL->storage->folder_exists($folder, true)) {
+ return true;
+ }
- // folder may exist but isn't subscribed (#1485241)
- if ($create) {
- if (!$RCMAIL->storage->folder_exists($folder))
- return $RCMAIL->storage->create_folder($folder, true);
- else
- return $RCMAIL->storage->subscribe($folder);
- }
+ // folder may exist but isn't subscribed (#1485241)
+ if ($create) {
+ if (!$RCMAIL->storage->folder_exists($folder))
+ return $RCMAIL->storage->create_folder($folder, true);
+ else
+ return $RCMAIL->storage->subscribe($folder);
+ }
- return false;
+ return false;
}
function get_form_tags($attrib)
{
- global $RCMAIL, $MESSAGE_FORM, $COMPOSE;
+ global $RCMAIL, $MESSAGE_FORM, $COMPOSE;
- $form_start = '';
- if (!$MESSAGE_FORM)
- {
- $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task));
- $hiddenfields->add(array('name' => '_action', 'value' => 'send'));
- $hiddenfields->add(array('name' => '_id', 'value' => $COMPOSE['id']));
- $hiddenfields->add(array('name' => '_attachments'));
+ $form_start = '';
+ if (!$MESSAGE_FORM) {
+ $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task));
+ $hiddenfields->add(array('name' => '_action', 'value' => 'send'));
+ $hiddenfields->add(array('name' => '_id', 'value' => $COMPOSE['id']));
+ $hiddenfields->add(array('name' => '_attachments'));
- $form_start = empty($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : '';
- $form_start .= $hiddenfields->show();
- }
+ $form_start = empty($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : '';
+ $form_start .= $hiddenfields->show();
+ }
- $form_end = ($MESSAGE_FORM && !strlen($attrib['form'])) ? '</form>' : '';
- $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
+ $form_end = ($MESSAGE_FORM && !strlen($attrib['form'])) ? '</form>' : '';
+ $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
- if (!$MESSAGE_FORM)
- $RCMAIL->output->add_gui_object('messageform', $form_name);
+ if (!$MESSAGE_FORM)
+ $RCMAIL->output->add_gui_object('messageform', $form_name);
- $MESSAGE_FORM = $form_name;
+ $MESSAGE_FORM = $form_name;
- return array($form_start, $form_end);
+ return array($form_start, $form_end);
}
@@ -1703,11 +1770,11 @@ function rcmail_addressbook_list($attrib = array())
'id' => 'rcmli%s', 'class' => '%s'),
html::a(array('href' => '#list',
'rel' => '%s',
- 'onclick' => "return ".JS_OBJECT_NAME.".command('list-adresses','%s',this)"), '%s'));
+ 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('list-adresses','%s',this)"), '%s'));
foreach ($RCMAIL->get_address_sources(false, true) as $j => $source) {
$id = strval(strlen($source['id']) ? $source['id'] : $j);
- $js_id = JQ($id);
+ $js_id = rcube::JQ($id);
// set class name(s)
$class_name = 'addressbook';
@@ -1715,7 +1782,7 @@ function rcmail_addressbook_list($attrib = array())
$class_name .= ' ' . $source['class_name'];
$out .= sprintf($line_templ,
- html_identifier($id,true),
+ rcube_utils::html_identifier($id,true),
$class_name,
$source['id'],
$js_id, (!empty($source['name']) ? $source['name'] : $id));
@@ -1729,7 +1796,7 @@ function rcmail_addressbook_list($attrib = array())
// return the contacts list as HTML table
function rcmail_contacts_list($attrib = array())
{
- global $OUTPUT;
+ global $RCMAIL, $OUTPUT;
$attrib += array('id' => 'rcmAddressList');
@@ -1739,7 +1806,7 @@ function rcmail_contacts_list($attrib = array())
$OUTPUT->set_env('current_page', 0);
$OUTPUT->include_script('list.js');
- return rcube_table_output($attrib, array(), array('name'), 'ID');
+ return $RCMAIL->table_output($attrib, array(), array('name'), 'ID');
}
@@ -1757,22 +1824,33 @@ function compose_file_drop_area($attrib)
}
-// register UI objects
-$OUTPUT->add_handlers(array(
- 'composeheaders' => 'rcmail_compose_headers',
- 'composesubject' => 'rcmail_compose_subject',
- 'composebody' => 'rcmail_compose_body',
- 'composeattachmentlist' => 'rcmail_compose_attachment_list',
- 'composeattachmentform' => 'rcmail_compose_attachment_form',
- 'composeattachment' => 'rcmail_compose_attachment_field',
- 'filedroparea' => 'compose_file_drop_area',
- 'priorityselector' => 'rcmail_priority_selector',
- 'editorselector' => 'rcmail_editor_selector',
- 'receiptcheckbox' => 'rcmail_receipt_checkbox',
- 'dsncheckbox' => 'rcmail_dsn_checkbox',
- 'storetarget' => 'rcmail_store_target_selection',
- 'addressbooks' => 'rcmail_addressbook_list',
- 'addresslist' => 'rcmail_contacts_list',
-));
+/**
+ *
+ */
+function rcmail_compose_responses_list($attrib)
+{
+ global $RCMAIL, $OUTPUT;
-$OUTPUT->send('compose');
+ $attrib += array('id' => 'rcmresponseslist', 'tagname' => 'ul', 'cols' => 1);
+
+ $jsenv = array();
+ $list = new html_table($attrib);
+ foreach ($RCMAIL->get_compose_responses(true) as $response) {
+ $key = $response['key'];
+ $item = html::a(array(
+ 'href '=> '#'.urlencode($response['name']),
+ 'class' => rtrim('insertresponse ' . $attrib['itemclass']),
+ 'unselectable' => 'on',
+ 'rel' => $key,
+ ), rcube::Q($response['name']));
+
+ $jsenv[$key] = $response;
+ $list->add(array(), $item);
+ }
+
+ // set client env
+ $OUTPUT->set_env('textresponses', $jsenv);
+ $OUTPUT->add_gui_object('responseslist', $attrib['id']);
+
+ return $list->show();
+}
diff --git a/program/steps/mail/copy.inc b/program/steps/mail/copy.inc
index 876657485..a392f309f 100644
--- a/program/steps/mail/copy.inc
+++ b/program/steps/mail/copy.inc
@@ -5,7 +5,7 @@
| program/steps/mail/copy.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2010, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,20 +20,21 @@
*/
// only process ajax requests
-if (!$OUTPUT->ajax_call)
- return;
+if (!$OUTPUT->ajax_call) {
+ return;
+}
// move messages
if (!empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) {
- $uids = get_input_value('_uid', RCUBE_INPUT_POST);
- $target = get_input_value('_target_mbox', RCUBE_INPUT_POST, true);
- $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true);
+ $uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST);
+ $target = rcube_utils::get_input_value('_target_mbox', rcube_utils::INPUT_POST, true);
+ $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
$copied = $RCMAIL->storage->copy_message($uids, $target, $mbox);
if (!$copied) {
// send error message
- rcmail_display_server_error('errorcopying');
+ $RCMAIL->display_server_error('errorcopying');
$OUTPUT->send();
exit;
}
@@ -43,7 +44,7 @@ if (!empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) {
rcmail_send_unread_count($target, true);
- $OUTPUT->command('set_quota', rcmail_quota_content());
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content());
}
// unknown action or missing query param
else {
diff --git a/program/steps/mail/folders.inc b/program/steps/mail/folders.inc
index 574d6e975..519a41fdd 100644
--- a/program/steps/mail/folders.inc
+++ b/program/steps/mail/folders.inc
@@ -5,7 +5,7 @@
| program/steps/mail/folders.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,14 +20,14 @@
*/
// only process ajax requests
-if (!$OUTPUT->ajax_call)
+if (!$OUTPUT->ajax_call) {
return;
+}
-$mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true);
+$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
// send EXPUNGE command
if ($RCMAIL->action == 'expunge') {
-
$success = $RCMAIL->storage->expunge_folder($mbox);
// reload message list if current mailbox
@@ -35,26 +35,26 @@ if ($RCMAIL->action == 'expunge') {
$OUTPUT->show_message('folderexpunged', 'confirmation');
if (!empty($_REQUEST['_reload'])) {
- $OUTPUT->command('set_quota', rcmail_quota_content());
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content());
$OUTPUT->command('message_list.clear');
$RCMAIL->action = 'list';
return;
}
}
else {
- rcmail_display_server_error();
+ $RCMAIL->display_server_error();
}
}
-
// clear mailbox
-else if ($RCMAIL->action == 'purge')
-{
- $delimiter = $RCMAIL->storage->get_hierarchy_delimiter();
- $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/';
- $junk_regexp = '/^' . preg_quote($CONFIG['junk_mbox'] . $delimiter, '/') . '/';
+else if ($RCMAIL->action == 'purge') {
+ $delimiter = $RCMAIL->storage->get_hierarchy_delimiter();
+ $trash_mbox = $RCMAIL->config->get('trash_mbox');
+ $junk_mbox = $RCMAIL->config->get('junk_mbox');
+ $trash_regexp = '/^' . preg_quote($trash_mbox . $delimiter, '/') . '/';
+ $junk_regexp = '/^' . preg_quote($junk_mbox . $delimiter, '/') . '/';
// we should only be purging trash and junk (or their subfolders)
- if ($mbox == $CONFIG['trash_mbox'] || $mbox == $CONFIG['junk_mbox']
+ if ($mbox == $trash_mbox || $mbox == $junk_mbox
|| preg_match($trash_regexp, $mbox) || preg_match($junk_regexp, $mbox)
) {
$success = $RCMAIL->storage->clear_folder($mbox);
@@ -69,12 +69,17 @@ else if ($RCMAIL->action == 'purge')
$OUTPUT->command('message_list.clear');
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text(), $mbox);
$OUTPUT->command('set_unread_count', $mbox, 0);
- $OUTPUT->command('set_quota', rcmail_quota_content());
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content());
rcmail_set_unseen_count($mbox, 0);
+
+ // set trash folder state
+ if ($mbox === $trash_mbox) {
+ $OUTPUT->command('set_trash_count', 0);
+ }
}
}
else {
- rcmail_display_server_error();
+ $RCMAIL->display_server_error();
}
}
}
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 48afecb60..9d7aa30cf 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -5,7 +5,7 @@
| program/steps/mail/func.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -16,44 +16,45 @@
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+ | Author: Aleksander Machniak <alec@alec.pl> |
+-----------------------------------------------------------------------+
*/
-// setup some global vars used by mail steps
-$SENT_MBOX = $RCMAIL->config->get('sent_mbox');
-$DRAFTS_MBOX = $RCMAIL->config->get('drafts_mbox');
-$SEARCH_MODS_DEFAULT = array(
- '*' => array('subject'=>1, 'from'=>1),
- $SENT_MBOX => array('subject'=>1, 'to'=>1),
- $DRAFTS_MBOX => array('subject'=>1, 'to'=>1)
-);
-
// always instantiate storage object (but not connect to server yet)
$RCMAIL->storage_init();
// set imap properties and session vars
-if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true))))
- $RCMAIL->storage->set_folder(($_SESSION['mbox'] = $mbox));
-else if ($RCMAIL->storage)
- $_SESSION['mbox'] = $RCMAIL->storage->get_folder();
+if (strlen(trim($mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)))) {
+ $RCMAIL->storage->set_folder(($_SESSION['mbox'] = $mbox));
+}
+else if ($RCMAIL->storage) {
+ $_SESSION['mbox'] = $RCMAIL->storage->get_folder();
+}
-if (!empty($_GET['_page']))
- $RCMAIL->storage->set_page(($_SESSION['page'] = intval($_GET['_page'])));
+if (!empty($_GET['_page'])) {
+ $RCMAIL->storage->set_page(($_SESSION['page'] = intval($_GET['_page'])));
+}
+
+$a_threading = $RCMAIL->config->get('message_threading', array());
+$message_sort_col = $RCMAIL->config->get('message_sort_col');
+$message_sort_order = $RCMAIL->config->get('message_sort_col');
// set default sort col/order to session
-if (!isset($_SESSION['sort_col']))
- $_SESSION['sort_col'] = !empty($CONFIG['message_sort_col']) ? $CONFIG['message_sort_col'] : '';
-if (!isset($_SESSION['sort_order']))
- $_SESSION['sort_order'] = strtoupper($CONFIG['message_sort_order']) == 'ASC' ? 'ASC' : 'DESC';
+if (!isset($_SESSION['sort_col'])) {
+ $_SESSION['sort_col'] = $message_sort_col ? $message_sort_col : '';
+}
+if (!isset($_SESSION['sort_order'])) {
+ $_SESSION['sort_order'] = strtoupper($message_sort_order) == 'ASC' ? 'ASC' : 'DESC';
+}
// set threads mode
-$a_threading = $RCMAIL->config->get('message_threading', array());
if (isset($_GET['_threads'])) {
- if ($_GET['_threads'])
- $a_threading[$_SESSION['mbox']] = true;
- else
- unset($a_threading[$_SESSION['mbox']]);
- $RCMAIL->user->save_prefs(array('message_threading' => $a_threading));
+ if ($_GET['_threads'])
+ $a_threading[$_SESSION['mbox']] = true;
+ else
+ unset($a_threading[$_SESSION['mbox']]);
+
+ $RCMAIL->user->save_prefs(array('message_threading' => $a_threading));
}
$RCMAIL->storage->set_threading($a_threading[$_SESSION['mbox']]);
@@ -61,87 +62,91 @@ $RCMAIL->storage->set_threading($a_threading[$_SESSION['mbox']]);
if (!empty($_REQUEST['_search']) && isset($_SESSION['search'])
&& $_SESSION['search_request'] == $_REQUEST['_search']
) {
- $RCMAIL->storage->set_search_set($_SESSION['search']);
- $OUTPUT->set_env('search_request', $_REQUEST['_search']);
- $OUTPUT->set_env('search_text', $_SESSION['last_text_search']);
+ $RCMAIL->storage->set_search_set($_SESSION['search']);
+
+ $OUTPUT->set_env('search_request', $_REQUEST['_search']);
+ $OUTPUT->set_env('search_text', $_SESSION['last_text_search']);
}
// set main env variables, labels and page title
if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
- // connect to storage server and trigger error on failure
- $RCMAIL->storage_connect();
-
- $mbox_name = $RCMAIL->storage->get_folder();
-
- if (empty($RCMAIL->action)) {
- // initialize searching result if search_filter is used
- if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') {
- $search_request = md5($mbox_name.$_SESSION['search_filter']);
-
- $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, rcmail_sort_column());
- $_SESSION['search'] = $RCMAIL->storage->get_search_set();
- $_SESSION['search_request'] = $search_request;
- $OUTPUT->set_env('search_request', $search_request);
- }
-
- $search_mods = $RCMAIL->config->get('search_mods', $SEARCH_MODS_DEFAULT);
- $OUTPUT->set_env('search_mods', $search_mods);
- }
-
- $threading = (bool) $RCMAIL->storage->get_threading();
- $delimiter = $RCMAIL->storage->get_hierarchy_delimiter();
-
- // set current mailbox and some other vars in client environment
- $OUTPUT->set_env('mailbox', $mbox_name);
- $OUTPUT->set_env('pagesize', $RCMAIL->storage->get_pagesize());
- $OUTPUT->set_env('delimiter', $delimiter);
- $OUTPUT->set_env('threading', $threading);
- $OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD'));
- $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0));
- if ($RCMAIL->storage->get_capability('QUOTA')) {
- $OUTPUT->set_env('quota', true);
- }
-
- foreach (array('delete_junk','flag_for_deletion','read_when_deleted','skip_deleted','display_next','message_extwin','compose_extwin','forward_attachment') as $prop) {
- if ($CONFIG[$prop])
- $OUTPUT->set_env($prop, true);
- }
-
- if ($CONFIG['trash_mbox'])
- $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
- if ($CONFIG['drafts_mbox'])
- $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
- if ($CONFIG['junk_mbox'])
- $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']);
-
- if (!empty($_SESSION['browser_caps']))
- $OUTPUT->set_env('browser_capabilities', $_SESSION['browser_caps']);
-
- if (!$OUTPUT->ajax_call)
- $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
- 'movingmessage', 'copyingmessage', 'deletingmessage', 'markingmessage',
- 'copy', 'move', 'quota', 'replyall', 'replylist', 'importwait');
-
- $pagetitle = $RCMAIL->localize_foldername($RCMAIL->storage->mod_folder($mbox_name), true);
- $pagetitle = str_replace($delimiter, " \xC2\xBB ", $pagetitle);
-
- $OUTPUT->set_pagetitle($pagetitle);
+ // connect to storage server and trigger error on failure
+ $RCMAIL->storage_connect();
+
+ $mbox_name = $RCMAIL->storage->get_folder();
+
+ if (empty($RCMAIL->action)) {
+ // initialize searching result if search_filter is used
+ if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') {
+ $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCUBE_CHARSET, rcmail_sort_column());
+
+ $search_request = md5($mbox_name.$_SESSION['search_filter']);
+ $_SESSION['search'] = $RCMAIL->storage->get_search_set();
+ $_SESSION['search_request'] = $search_request;
+
+ $OUTPUT->set_env('search_request', $search_request);
+ }
+
+ $OUTPUT->set_env('search_mods', rcmail_search_mods());
+ }
+
+ $threading = (bool) $RCMAIL->storage->get_threading();
+ $delimiter = $RCMAIL->storage->get_hierarchy_delimiter();
+
+ // set current mailbox and some other vars in client environment
+ $OUTPUT->set_env('mailbox', $mbox_name);
+ $OUTPUT->set_env('pagesize', $RCMAIL->storage->get_pagesize());
+ $OUTPUT->set_env('delimiter', $delimiter);
+ $OUTPUT->set_env('threading', $threading);
+ $OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD'));
+ $OUTPUT->set_env('reply_all_mode', (int) $RCMAIL->config->get('reply_all_mode'));
+ $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0));
+
+ if ($RCMAIL->storage->get_capability('QUOTA')) {
+ $OUTPUT->set_env('quota', true);
+ }
+
+ // set special folders
+ foreach (array('drafts', 'trash', 'junk') as $mbox) {
+ if ($folder = $RCMAIL->config->get($mbox . '_mbox')) {
+ $OUTPUT->set_env($mbox . '_mailbox', $folder);
+ }
+ }
+
+ // set configuration
+ $RCMAIL->set_env_config(array('delete_junk', 'flag_for_deletion', 'read_when_deleted',
+ 'skip_deleted', 'display_next', 'message_extwin', 'compose_extwin', 'forward_attachment'));
+
+ if (!empty($_SESSION['browser_caps'])) {
+ $OUTPUT->set_env('browser_capabilities', $_SESSION['browser_caps']);
+ }
+
+ if (!$OUTPUT->ajax_call) {
+ $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
+ 'movingmessage', 'copyingmessage', 'deletingmessage', 'markingmessage',
+ 'copy', 'move', 'quota', 'replyall', 'replylist', 'importwait');
+ }
+
+ $pagetitle = $RCMAIL->localize_foldername($RCMAIL->storage->mod_folder($mbox_name), true);
+ $pagetitle = str_replace($delimiter, " \xC2\xBB ", $pagetitle);
+
+ $OUTPUT->set_pagetitle($pagetitle);
}
// register UI objects
$OUTPUT->add_handlers(array(
- 'mailboxlist' => 'rcmail_mailbox_list',
- 'messages' => 'rcmail_message_list',
- 'messagecountdisplay' => 'rcmail_messagecount_display',
- 'quotadisplay' => 'rcmail_quota_display',
- 'mailboxname' => 'rcmail_mailbox_name_display',
- 'messageheaders' => 'rcmail_message_headers',
- 'messagefullheaders' => 'rcmail_message_full_headers',
- 'messagebody' => 'rcmail_message_body',
- 'messagecontentframe' => 'rcmail_messagecontent_frame',
- 'messageimportform' => 'rcmail_message_import_form',
- 'searchfilter' => 'rcmail_search_filter',
- 'searchform' => array($OUTPUT, 'search_form'),
+ 'mailboxlist' => array($RCMAIL, 'folder_list'),
+ 'quotadisplay' => array($RCMAIL, 'quota_display'),
+ 'messages' => 'rcmail_message_list',
+ 'messagecountdisplay' => 'rcmail_messagecount_display',
+ 'mailboxname' => 'rcmail_mailbox_name_display',
+ 'messageheaders' => 'rcmail_message_headers',
+ 'messagefullheaders' => 'rcmail_message_full_headers',
+ 'messagebody' => 'rcmail_message_body',
+ 'messagecontentframe' => 'rcmail_messagecontent_frame',
+ 'messageimportform' => 'rcmail_message_import_form',
+ 'searchfilter' => 'rcmail_search_filter',
+ 'searchform' => array($OUTPUT, 'search_form'),
));
// register action aliases
@@ -163,6 +168,28 @@ $RCMAIL->register_action_map(array(
/**
+ * Returns default search mods
+ */
+function rcmail_search_mods()
+{
+ global $RCMAIL;
+
+ $mods = $RCMAIL->config->get('search_mods');
+
+ if (empty($mods)) {
+ $mods = array('*' => array('subject' => 1, 'from' => 1));
+
+ foreach (array('sent', 'drafts') as $mbox) {
+ if ($mbox = $RCMAIL->config->get($mbox . '_mbox')) {
+ $mods[$mbox] = array('subject' => 1, 'to' => 1);
+ }
+ }
+ }
+
+ return $mods;
+}
+
+/**
* Returns 'to' if current folder is configured Sent or Drafts
* or their subfolders, otherwise returns 'from'.
*
@@ -170,20 +197,20 @@ $RCMAIL->register_action_map(array(
*/
function rcmail_message_list_smart_column_name()
{
- global $RCMAIL;
+ global $RCMAIL;
- $delim = $RCMAIL->storage->get_hierarchy_delimiter();
- $mbox = $RCMAIL->storage->get_folder();
- $sent_mbox = $RCMAIL->config->get('sent_mbox');
- $drafts_mbox = $RCMAIL->config->get('drafts_mbox');
+ $delim = $RCMAIL->storage->get_hierarchy_delimiter();
+ $mbox = $RCMAIL->storage->get_folder();
+ $sent_mbox = $RCMAIL->config->get('sent_mbox');
+ $drafts_mbox = $RCMAIL->config->get('drafts_mbox');
- if ((strpos($mbox.$delim, $sent_mbox.$delim) === 0 || strpos($mbox.$delim, $drafts_mbox.$delim) === 0)
- && strtoupper($mbox) != 'INBOX'
- ) {
- return 'to';
- }
+ if ((strpos($mbox.$delim, $sent_mbox.$delim) === 0 || strpos($mbox.$delim, $drafts_mbox.$delim) === 0)
+ && strtoupper($mbox) != 'INBOX'
+ ) {
+ return 'to';
+ }
- return 'from';
+ return 'from';
}
/**
@@ -195,21 +222,21 @@ function rcmail_message_list_smart_column_name()
*/
function rcmail_sort_column()
{
- global $RCMAIL;
+ global $RCMAIL;
- if (isset($_SESSION['sort_col'])) {
- $column = $_SESSION['sort_col'];
- }
- else {
- $column = $RCMAIL->config->get('message_sort_col');
- }
+ if (isset($_SESSION['sort_col'])) {
+ $column = $_SESSION['sort_col'];
+ }
+ else {
+ $column = $RCMAIL->config->get('message_sort_col');
+ }
- // get name of smart From/To column in folder context
- if ($column == 'fromto') {
- $column = rcmail_message_list_smart_column_name();
- }
+ // get name of smart From/To column in folder context
+ if ($column == 'fromto') {
+ $column = rcmail_message_list_smart_column_name();
+ }
- return $column;
+ return $column;
}
/**
@@ -219,13 +246,13 @@ function rcmail_sort_column()
*/
function rcmail_sort_order()
{
- global $RCMAIL;
+ global $RCMAIL;
- if (isset($_SESSION['sort_order'])) {
- return $_SESSION['sort_order'];
- }
+ if (isset($_SESSION['sort_order'])) {
+ return $_SESSION['sort_order'];
+ }
- return $RCMAIL->config->get('message_sort_order');
+ return $RCMAIL->config->get('message_sort_order');
}
/**
@@ -233,390 +260,396 @@ function rcmail_sort_order()
*/
function rcmail_message_list($attrib)
{
- global $CONFIG, $OUTPUT;
-
- // add some labels to client
- $OUTPUT->add_label('from', 'to');
-
- // add id to message list table if not specified
- if (!strlen($attrib['id']))
- $attrib['id'] = 'rcubemessagelist';
-
- // define list of cols to be displayed based on parameter or config
- if (empty($attrib['columns'])) {
- $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
- $OUTPUT->set_env('col_movable', !in_array('list_cols', (array)$CONFIG['dont_override']));
- }
- else {
- $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($attrib['columns']));
- $attrib['columns'] = $a_show_cols;
- }
-
- // save some variables for use in ajax list
- $_SESSION['list_attrib'] = $attrib;
- // make sure 'threads' and 'subject' columns are present
- if (!in_array('subject', $a_show_cols))
- array_unshift($a_show_cols, 'subject');
- if (!in_array('threads', $a_show_cols))
- array_unshift($a_show_cols, 'threads');
-
- $_SESSION['skin_path'] = $CONFIG['skin_path'];
-
- // set client env
- $OUTPUT->add_gui_object('messagelist', $attrib['id']);
- $OUTPUT->set_env('autoexpand_threads', intval($CONFIG['autoexpand_threads']));
- $OUTPUT->set_env('sort_col', $_SESSION['sort_col']);
- $OUTPUT->set_env('sort_order', $_SESSION['sort_order']);
- $OUTPUT->set_env('messages', array());
- $OUTPUT->set_env('coltypes', $a_show_cols);
-
- $OUTPUT->include_script('list.js');
-
- $table = new html_table($attrib);
- if (!$attrib['noheader']) {
- foreach (rcmail_message_list_head($attrib, $a_show_cols) as $cell)
- $table->add_header(array('class' => $cell['className'], 'id' => $cell['id']), $cell['html']);
- }
-
- return $table->show();
-}
+ global $RCMAIL, $OUTPUT;
+ // add some labels to client
+ $OUTPUT->add_label('from', 'to');
+
+ // add id to message list table if not specified
+ if (!strlen($attrib['id']))
+ $attrib['id'] = 'rcubemessagelist';
+
+ // define list of cols to be displayed based on parameter or config
+ if (empty($attrib['columns'])) {
+ $list_cols = $RCMAIL->config->get('list_cols');
+ $a_show_cols = !empty($list_cols) && is_array($list_cols) ? $list_cols : array('subject');
+
+ $OUTPUT->set_env('col_movable', !in_array('list_cols', (array)$RCMAIL->config->get('dont_override')));
+ }
+ else {
+ $a_show_cols = preg_split('/[\s,;]+/', str_replace(array("'", '"'), '', $attrib['columns']));
+ $attrib['columns'] = $a_show_cols;
+ }
+
+ // save some variables for use in ajax list
+ $_SESSION['list_attrib'] = $attrib;
+
+ // make sure 'threads' and 'subject' columns are present
+ if (!in_array('subject', $a_show_cols))
+ array_unshift($a_show_cols, 'subject');
+ if (!in_array('threads', $a_show_cols))
+ array_unshift($a_show_cols, 'threads');
+
+ $_SESSION['skin_path'] = $RCMAIL->config->get('skin_path');
+
+ // set client env
+ $OUTPUT->add_gui_object('messagelist', $attrib['id']);
+ $OUTPUT->set_env('autoexpand_threads', intval($RCMAIL->config->get('autoexpand_threads')));
+ $OUTPUT->set_env('sort_col', $_SESSION['sort_col']);
+ $OUTPUT->set_env('sort_order', $_SESSION['sort_order']);
+ $OUTPUT->set_env('messages', array());
+ $OUTPUT->set_env('coltypes', $a_show_cols);
+
+ $OUTPUT->include_script('list.js');
+
+ $table = new html_table($attrib);
+
+ if (!$attrib['noheader']) {
+ foreach (rcmail_message_list_head($attrib, $a_show_cols) as $cell)
+ $table->add_header(array('class' => $cell['className'], 'id' => $cell['id']), $cell['html']);
+ }
+
+ return $table->show();
+}
/**
* return javascript commands to add rows to the message list
*/
function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null)
{
- global $CONFIG, $RCMAIL, $OUTPUT;
+ global $RCMAIL, $OUTPUT;
- if (empty($a_show_cols)) {
- if (!empty($_SESSION['list_attrib']['columns']))
- $a_show_cols = $_SESSION['list_attrib']['columns'];
- else
- $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
- }
- else {
- if (!is_array($a_show_cols))
- $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($a_show_cols));
- $head_replace = true;
- }
+ if (empty($a_show_cols)) {
+ if (!empty($_SESSION['list_attrib']['columns']))
+ $a_show_cols = $_SESSION['list_attrib']['columns'];
+ else {
+ $list_cols = $RCMAIL->config->get('list_cols');
+ $a_show_cols = !empty($list_cols) && is_array($list_cols) ? $list_cols : array('subject');
+ }
+ }
+ else {
+ if (!is_array($a_show_cols)) {
+ $a_show_cols = preg_split('/[\s,;]+/', str_replace(array("'", '"'), '', $a_show_cols));
+ }
+ $head_replace = true;
+ }
- $mbox = $RCMAIL->storage->get_folder();
+ $mbox = $RCMAIL->storage->get_folder();
- // make sure 'threads' and 'subject' columns are present
- if (!in_array('subject', $a_show_cols))
- array_unshift($a_show_cols, 'subject');
- if (!in_array('threads', $a_show_cols))
- array_unshift($a_show_cols, 'threads');
+ // make sure 'threads' and 'subject' columns are present
+ if (!in_array('subject', $a_show_cols))
+ array_unshift($a_show_cols, 'subject');
+ if (!in_array('threads', $a_show_cols))
+ array_unshift($a_show_cols, 'threads');
- $_SESSION['list_attrib']['columns'] = $a_show_cols;
+ $_SESSION['list_attrib']['columns'] = $a_show_cols;
- // Make sure there are no duplicated columns (#1486999)
- $a_show_cols = array_unique($a_show_cols);
+ // Make sure there are no duplicated columns (#1486999)
+ $a_show_cols = array_unique($a_show_cols);
- // Plugins may set header's list_cols/list_flags and other rcube_message_header variables
- // and list columns
- $plugin = $RCMAIL->plugins->exec_hook('messages_list',
- array('messages' => $a_headers, 'cols' => $a_show_cols));
+ // Plugins may set header's list_cols/list_flags and other rcube_message_header variables
+ // and list columns
+ $plugin = $RCMAIL->plugins->exec_hook('messages_list',
+ array('messages' => $a_headers, 'cols' => $a_show_cols));
- $a_show_cols = $plugin['cols'];
- $a_headers = $plugin['messages'];
+ $a_show_cols = $plugin['cols'];
+ $a_headers = $plugin['messages'];
- $thead = $head_replace ? rcmail_message_list_head($_SESSION['list_attrib'], $a_show_cols) : NULL;
+ $thead = $head_replace ? rcmail_message_list_head($_SESSION['list_attrib'], $a_show_cols) : NULL;
- // get name of smart From/To column in folder context
- if (array_search('fromto', $a_show_cols) !== false) {
- $smart_col = rcmail_message_list_smart_column_name();
- }
+ // get name of smart From/To column in folder context
+ if (array_search('fromto', $a_show_cols) !== false) {
+ $smart_col = rcmail_message_list_smart_column_name();
+ }
- $OUTPUT->command('set_message_coltypes', $a_show_cols, $thead, $smart_col);
+ $OUTPUT->command('set_message_coltypes', $a_show_cols, $thead, $smart_col);
- if (empty($a_headers))
- return;
+ if (empty($a_headers)) {
+ return;
+ }
- // remove 'threads', 'attachment', 'flag', 'status' columns, we don't need them here
- foreach (array('threads', 'attachment', 'flag', 'status', 'priority') as $col) {
- if (($key = array_search($col, $a_show_cols)) !== FALSE)
- unset($a_show_cols[$key]);
- }
+ // remove 'threads', 'attachment', 'flag', 'status' columns, we don't need them here
+ foreach (array('threads', 'attachment', 'flag', 'status', 'priority') as $col) {
+ if (($key = array_search($col, $a_show_cols)) !== FALSE) {
+ unset($a_show_cols[$key]);
+ }
+ }
- // loop through message headers
- foreach ($a_headers as $header) {
- if (empty($header))
- continue;
+ // loop through message headers
+ foreach ($a_headers as $header) {
+ if (empty($header))
+ continue;
- $a_msg_cols = array();
- $a_msg_flags = array();
+ $a_msg_cols = array();
+ $a_msg_flags = array();
- // format each col; similar as in rcmail_message_list()
- foreach ($a_show_cols as $col) {
- $col_name = $col == 'fromto' ? $smart_col : $col;
-
- if (in_array($col_name, array('from', 'to', 'cc', 'replyto')))
- $cont = rcmail_address_string($header->$col_name, 3, false, null, $header->charset);
- else if ($col == 'subject') {
- $cont = trim(rcube_mime::decode_header($header->$col, $header->charset));
- if (!$cont) $cont = rcube_label('nosubject');
- $cont = Q($cont);
- }
- else if ($col == 'size')
- $cont = show_bytes($header->$col);
- else if ($col == 'date')
- $cont = format_date($header->date);
- else
- $cont = Q($header->$col);
-
- $a_msg_cols[$col] = $cont;
- }
-
- $a_msg_flags = array_change_key_case(array_map('intval', (array) $header->flags));
- if ($header->depth)
- $a_msg_flags['depth'] = $header->depth;
- else if ($header->has_children)
- $roots[] = $header->uid;
- if ($header->parent_uid)
- $a_msg_flags['parent_uid'] = $header->parent_uid;
- if ($header->has_children)
- $a_msg_flags['has_children'] = $header->has_children;
- if ($header->unread_children)
- $a_msg_flags['unread_children'] = $header->unread_children;
- if ($header->others['list-post'])
- $a_msg_flags['ml'] = 1;
- if ($header->priority)
- $a_msg_flags['prio'] = (int) $header->priority;
-
- $a_msg_flags['ctype'] = Q($header->ctype);
- $a_msg_flags['mbox'] = $mbox;
-
- // merge with plugin result (Deprecated, use $header->flags)
- if (!empty($header->list_flags) && is_array($header->list_flags))
- $a_msg_flags = array_merge($a_msg_flags, $header->list_flags);
- if (!empty($header->list_cols) && is_array($header->list_cols))
- $a_msg_cols = array_merge($a_msg_cols, $header->list_cols);
-
- $OUTPUT->command('add_message_row',
- $header->uid,
- $a_msg_cols,
- $a_msg_flags,
- $insert_top);
- }
-
- if ($RCMAIL->storage->get_threading()) {
- $OUTPUT->command('init_threads', (array) $roots, $mbox);
- }
-}
+ // format each col; similar as in rcmail_message_list()
+ foreach ($a_show_cols as $col) {
+ $col_name = $col == 'fromto' ? $smart_col : $col;
+ if (in_array($col_name, array('from', 'to', 'cc', 'replyto')))
+ $cont = rcmail_address_string($header->$col_name, 3, false, null, $header->charset);
+ else if ($col == 'subject') {
+ $cont = trim(rcube_mime::decode_header($header->$col, $header->charset));
+ if (!$cont) $cont = $RCMAIL->gettext('nosubject');
+ $cont = rcube::Q($cont);
+ }
+ else if ($col == 'size')
+ $cont = show_bytes($header->$col);
+ else if ($col == 'date')
+ $cont = $RCMAIL->format_date($header->date);
+ else
+ $cont = rcube::Q($header->$col);
+
+ $a_msg_cols[$col] = $cont;
+ }
+
+ $a_msg_flags = array_change_key_case(array_map('intval', (array) $header->flags));
+ if ($header->depth)
+ $a_msg_flags['depth'] = $header->depth;
+ else if ($header->has_children)
+ $roots[] = $header->uid;
+ if ($header->parent_uid)
+ $a_msg_flags['parent_uid'] = $header->parent_uid;
+ if ($header->has_children)
+ $a_msg_flags['has_children'] = $header->has_children;
+ if ($header->unread_children)
+ $a_msg_flags['unread_children'] = $header->unread_children;
+ if ($header->others['list-post'])
+ $a_msg_flags['ml'] = 1;
+ if ($header->priority)
+ $a_msg_flags['prio'] = (int) $header->priority;
+
+ $a_msg_flags['ctype'] = rcube::Q($header->ctype);
+ $a_msg_flags['mbox'] = $mbox;
+
+ // merge with plugin result (Deprecated, use $header->flags)
+ if (!empty($header->list_flags) && is_array($header->list_flags))
+ $a_msg_flags = array_merge($a_msg_flags, $header->list_flags);
+ if (!empty($header->list_cols) && is_array($header->list_cols))
+ $a_msg_cols = array_merge($a_msg_cols, $header->list_cols);
+
+ $OUTPUT->command('add_message_row',
+ $header->uid,
+ $a_msg_cols,
+ $a_msg_flags,
+ $insert_top);
+ }
+
+ if ($RCMAIL->storage->get_threading()) {
+ $OUTPUT->command('init_threads', (array) $roots, $mbox);
+ }
+}
/*
* Creates <THEAD> for message list table
*/
function rcmail_message_list_head($attrib, $a_show_cols)
{
- global $RCMAIL;
-
- $skin_path = $_SESSION['skin_path'];
+ global $RCMAIL;
- // check to see if we have some settings for sorting
- $sort_col = $_SESSION['sort_col'];
- $sort_order = $_SESSION['sort_order'];
+ $skin_path = $_SESSION['skin_path'];
- $dont_override = (array)$RCMAIL->config->get('dont_override');
- $disabled_sort = in_array('message_sort_col', $dont_override);
- $disabled_order = in_array('message_sort_order', $dont_override);
+ // check to see if we have some settings for sorting
+ $sort_col = $_SESSION['sort_col'];
+ $sort_order = $_SESSION['sort_order'];
- $RCMAIL->output->set_env('disabled_sort_col', $disabled_sort);
- $RCMAIL->output->set_env('disabled_sort_order', $disabled_order);
+ $dont_override = (array) $RCMAIL->config->get('dont_override');
+ $disabled_sort = in_array('message_sort_col', $dont_override);
+ $disabled_order = in_array('message_sort_order', $dont_override);
- // define sortable columns
- if ($disabled_sort)
- $a_sort_cols = $sort_col && !$disabled_order ? array($sort_col) : array();
- else
- $a_sort_cols = array('subject', 'date', 'from', 'to', 'fromto', 'size', 'cc');
+ $RCMAIL->output->set_env('disabled_sort_col', $disabled_sort);
+ $RCMAIL->output->set_env('disabled_sort_order', $disabled_order);
- if (!empty($attrib['optionsmenuicon'])) {
- $onclick = 'return ' . JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu')";
- if ($attrib['optionsmenuicon'] === true || $attrib['optionsmenuicon'] == 'true')
- $list_menu = html::div(array('onclick' => $onclick, 'class' => 'listmenu',
- 'id' => 'listmenulink', 'title' => rcube_label('listoptions')));
+ // define sortable columns
+ if ($disabled_sort)
+ $a_sort_cols = $sort_col && !$disabled_order ? array($sort_col) : array();
else
- $list_menu = html::a(array('href' => '#', 'onclick' => $onclick),
- html::img(array('src' => $skin_path . $attrib['optionsmenuicon'],
- 'id' => 'listmenulink', 'title' => rcube_label('listoptions')))
- );
- }
- else
- $list_menu = '';
-
- $cells = array();
-
- // get name of smart From/To column in folder context
- if (array_search('fromto', $a_show_cols) !== false) {
- $smart_col = rcmail_message_list_smart_column_name();
- }
-
- foreach ($a_show_cols as $col) {
- // get column name
- switch ($col) {
- case 'flag':
- $col_name = '<span class="flagged">&nbsp;</span>';
- break;
- case 'attachment':
- case 'priority':
- case 'status':
- $col_name = '<span class="' . $col .'">&nbsp;</span>';
- break;
- case 'threads':
- $col_name = $list_menu;
- break;
- case 'fromto':
- $col_name = Q(rcube_label($smart_col));
- break;
- default:
- $col_name = Q(rcube_label($col));
+ $a_sort_cols = array('subject', 'date', 'from', 'to', 'fromto', 'size', 'cc');
+
+ if (!empty($attrib['optionsmenuicon'])) {
+ $onclick = 'return ' . rcmail_output::JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu')";
+ if ($attrib['optionsmenuicon'] === true || $attrib['optionsmenuicon'] == 'true')
+ $list_menu = html::div(array('onclick' => $onclick, 'class' => 'listmenu',
+ 'id' => 'listmenulink', 'title' => $RCMAIL->gettext('listoptions')));
+ else
+ $list_menu = html::a(array('href' => '#', 'onclick' => $onclick),
+ html::img(array('src' => $skin_path . $attrib['optionsmenuicon'],
+ 'id' => 'listmenulink', 'title' => $RCMAIL->gettext('listoptions'))));
+ }
+ else {
+ $list_menu = '';
}
- // make sort links
- if (in_array($col, $a_sort_cols))
- $col_name = html::a(array('href'=>"./#sort", 'onclick' => 'return '.JS_OBJECT_NAME.".command('sort','".$col."',this)", 'title' => rcube_label('sortby')), $col_name);
- else if ($col_name[0] != '<')
- $col_name = '<span class="' . $col .'">' . $col_name . '</span>';
+ $cells = array();
- $sort_class = $col == $sort_col && !$disabled_order ? " sorted$sort_order" : '';
- $class_name = $col.$sort_class;
+ // get name of smart From/To column in folder context
+ if (array_search('fromto', $a_show_cols) !== false) {
+ $smart_col = rcmail_message_list_smart_column_name();
+ }
- // put it all together
- $cells[] = array('className' => $class_name, 'id' => "rcm$col", 'html' => $col_name);
- }
+ foreach ($a_show_cols as $col) {
+ // get column name
+ switch ($col) {
+ case 'flag':
+ $col_name = '<span class="flagged">&nbsp;</span>';
+ break;
+ case 'attachment':
+ case 'priority':
+ case 'status':
+ $col_name = '<span class="' . $col .'">&nbsp;</span>';
+ break;
+ case 'threads':
+ $col_name = $list_menu;
+ break;
+ case 'fromto':
+ $col_name = rcube::Q($RCMAIL->gettext($smart_col));
+ break;
+ default:
+ $col_name = rcube::Q($RCMAIL->gettext($col));
+ }
- return $cells;
-}
+ // make sort links
+ if (in_array($col, $a_sort_cols)) {
+ $col_name = html::a(array(
+ 'href' => "./#sort",
+ 'onclick' => 'return '.rcmail_output::JS_OBJECT_NAME.".command('sort','".$col."',this)",
+ 'title' => $RCMAIL->gettext('sortby')
+ ), $col_name);
+ }
+ else if ($col_name[0] != '<') {
+ $col_name = '<span class="' . $col .'">' . $col_name . '</span>';
+ }
+ $sort_class = $col == $sort_col && !$disabled_order ? " sorted$sort_order" : '';
+ $class_name = $col.$sort_class;
+
+ // put it all together
+ $cells[] = array('className' => $class_name, 'id' => "rcm$col", 'html' => $col_name);
+ }
+
+ return $cells;
+}
/**
* return an HTML iframe for loading mail content
*/
function rcmail_messagecontent_frame($attrib)
{
- global $OUTPUT, $RCMAIL;
+ global $OUTPUT, $RCMAIL;
- if (empty($attrib['id']))
- $attrib['id'] = 'rcmailcontentwindow';
+ if (empty($attrib['id']))
+ $attrib['id'] = 'rcmailcontentwindow';
- $attrib['name'] = $attrib['id'];
+ $attrib['name'] = $attrib['id'];
- if ($RCMAIL->config->get('preview_pane'))
- $OUTPUT->set_env('contentframe', $attrib['id']);
- $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif');
+ if ($RCMAIL->config->get('preview_pane')) {
+ $OUTPUT->set_env('contentframe', $attrib['id']);
+ }
- return $OUTPUT->frame($attrib, true);
-}
+ $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif');
+ return $OUTPUT->frame($attrib, true);
+}
function rcmail_messagecount_display($attrib)
{
- global $RCMAIL;
+ global $RCMAIL;
- if (!$attrib['id'])
- $attrib['id'] = 'rcmcountdisplay';
+ if (!$attrib['id'])
+ $attrib['id'] = 'rcmcountdisplay';
- $RCMAIL->output->add_gui_object('countdisplay', $attrib['id']);
+ $RCMAIL->output->add_gui_object('countdisplay', $attrib['id']);
- $content = $RCMAIL->action != 'show' ? rcmail_get_messagecount_text() : rcube_label('loading');
+ $content = $RCMAIL->action != 'show' ? rcmail_get_messagecount_text() : $RCMAIL->gettext('loading');
- return html::span($attrib, $content);
+ return html::span($attrib, $content);
}
-
-function rcmail_get_messagecount_text($count=NULL, $page=NULL)
+function rcmail_get_messagecount_text($count = null, $page = null)
{
- global $RCMAIL;
+ global $RCMAIL;
- if ($page === NULL) {
- $page = $RCMAIL->storage->get_page();
- }
+ if ($page === null) {
+ $page = $RCMAIL->storage->get_page();
+ }
- $page_size = $RCMAIL->storage->get_pagesize();
- $start_msg = ($page-1) * $page_size + 1;
+ $page_size = $RCMAIL->storage->get_pagesize();
+ $start_msg = ($page-1) * $page_size + 1;
- if ($count!==NULL)
- $max = $count;
- else if ($RCMAIL->action)
- $max = $RCMAIL->storage->count(NULL, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
+ if ($count !== null)
+ $max = $count;
+ else if ($RCMAIL->action)
+ $max = $RCMAIL->storage->count(NULL, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
- if ($max==0)
- $out = rcube_label('mailboxempty');
- else
- $out = rcube_label(array('name' => $RCMAIL->storage->get_threading() ? 'threadsfromto' : 'messagesfromto',
+ if ($max == 0)
+ $out = $RCMAIL->storage->get_search_set() ? $RCMAIL->gettext('nomessages') : $RCMAIL->gettext('mailboxempty');
+ else
+ $out = $RCMAIL->gettext(array('name' => $RCMAIL->storage->get_threading() ? 'threadsfromto' : 'messagesfromto',
'vars' => array('from' => $start_msg,
'to' => min($max, $start_msg + $page_size - 1),
'count' => $max)));
- return Q($out);
+ return rcube::Q($out);
}
-
function rcmail_mailbox_name_display($attrib)
{
- global $RCMAIL;
+ global $RCMAIL;
- if (!$attrib['id'])
- $attrib['id'] = 'rcmmailboxname';
+ if (!$attrib['id'])
+ $attrib['id'] = 'rcmmailboxname';
- $RCMAIL->output->add_gui_object('mailboxname', $attrib['id']);
+ $RCMAIL->output->add_gui_object('mailboxname', $attrib['id']);
- return html::span($attrib, rcmail_get_mailbox_name_text());
+ return html::span($attrib, rcmail_get_mailbox_name_text());
}
-
function rcmail_get_mailbox_name_text()
{
- global $RCMAIL;
- return rcmail_localize_foldername($RCMAIL->storage->get_folder());
+ global $RCMAIL;
+ return $RCMAIL->localize_foldername($RCMAIL->storage->get_folder());
}
-
function rcmail_send_unread_count($mbox_name, $force=false, $count=null, $mark='')
{
- global $RCMAIL;
+ global $RCMAIL;
- $old_unseen = rcmail_get_unseen_count($mbox_name);
+ $old_unseen = rcmail_get_unseen_count($mbox_name);
- if ($count === null)
- $unseen = $RCMAIL->storage->count($mbox_name, 'UNSEEN', $force);
- else
- $unseen = $count;
+ if ($count === null)
+ $unseen = $RCMAIL->storage->count($mbox_name, 'UNSEEN', $force);
+ else
+ $unseen = $count;
- if ($unseen != $old_unseen || ($mbox_name == 'INBOX'))
- $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen,
- ($mbox_name == 'INBOX'), $unseen && $mark ? $mark : '');
+ if ($unseen != $old_unseen || ($mbox_name == 'INBOX'))
+ $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen,
+ ($mbox_name == 'INBOX'), $unseen && $mark ? $mark : '');
- rcmail_set_unseen_count($mbox_name, $unseen);
+ rcmail_set_unseen_count($mbox_name, $unseen);
- return $unseen;
+ return $unseen;
}
-
function rcmail_set_unseen_count($mbox_name, $count)
{
- // @TODO: this data is doubled (session and cache tables) if caching is enabled
+ // @TODO: this data is doubled (session and cache tables) if caching is enabled
- // Make sure we have an array here (#1487066)
- if (!is_array($_SESSION['unseen_count']))
- $_SESSION['unseen_count'] = array();
+ // Make sure we have an array here (#1487066)
+ if (!is_array($_SESSION['unseen_count'])) {
+ $_SESSION['unseen_count'] = array();
+ }
- $_SESSION['unseen_count'][$mbox_name] = $count;
+ $_SESSION['unseen_count'][$mbox_name] = $count;
}
-
function rcmail_get_unseen_count($mbox_name)
{
- if (is_array($_SESSION['unseen_count']) && array_key_exists($mbox_name, $_SESSION['unseen_count']))
- return $_SESSION['unseen_count'][$mbox_name];
- else
- return null;
+ if (is_array($_SESSION['unseen_count']) && array_key_exists($mbox_name, $_SESSION['unseen_count'])) {
+ return $_SESSION['unseen_count'][$mbox_name];
+ }
}
-
/**
* Sets message is_safe flag according to 'show_images' option value
*
@@ -624,35 +657,34 @@ function rcmail_get_unseen_count($mbox_name)
*/
function rcmail_check_safe(&$message)
{
- global $RCMAIL;
-
- if (!$message->is_safe
- && ($show_images = $RCMAIL->config->get('show_images'))
- && $message->has_html_part()
- ) {
- switch ($show_images) {
- case 1: // known senders only
- // get default addressbook, like in addcontact.inc
- $CONTACTS = $RCMAIL->get_address_book(-1, true);
-
- if ($CONTACTS) {
- $result = $CONTACTS->search('email', $message->sender['mailto'], 1, false);
- if ($result->count) {
- $message->set_safe(true);
- }
- }
+ global $RCMAIL;
+
+ if (!$message->is_safe
+ && ($show_images = $RCMAIL->config->get('show_images'))
+ && $message->has_html_part()
+ ) {
+ switch ($show_images) {
+ case 1: // known senders only
+ // get default addressbook, like in addcontact.inc
+ $CONTACTS = $RCMAIL->get_address_book(-1, true);
+
+ if ($CONTACTS) {
+ $result = $CONTACTS->search('email', $message->sender['mailto'], 1, false);
+ if ($result->count) {
+ $message->set_safe(true);
+ }
+ }
- $RCMAIL->plugins->exec_hook('message_check_safe', array('message' => $message));
- break;
+ $RCMAIL->plugins->exec_hook('message_check_safe', array('message' => $message));
+ break;
- case 2: // always
- $message->set_safe(true);
- break;
+ case 2: // always
+ $message->set_safe(true);
+ break;
+ }
}
- }
}
-
/**
* Cleans up the given message HTML Body (for displaying)
*
@@ -663,66 +695,67 @@ function rcmail_check_safe(&$message)
*/
function rcmail_wash_html($html, $p, $cid_replaces)
{
- global $REMOTE_OBJECTS;
-
- $p += array('safe' => false, 'inline_html' => true);
-
- // charset was converted to UTF-8 in rcube_storage::get_message_part(),
- // change/add charset specification in HTML accordingly,
- // washtml cannot work without that
- $meta = '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />';
-
- // remove old meta tag and add the new one, making sure
- // that it is placed in the head (#1488093)
- $html = preg_replace('/<meta[^>]+charset=[a-z0-9-_]+[^>]*>/Ui', '', $html);
- $html = preg_replace('/(<head[^>]*>)/Ui', '\\1'.$meta, $html, -1, $rcount);
- if (!$rcount) {
- $html = '<head>' . $meta . '</head>' . $html;
- }
-
- // clean HTML with washhtml by Frederic Motte
- $wash_opts = array(
- 'show_washed' => false,
- 'allow_remote' => $p['safe'],
- 'blocked_src' => "./program/resources/blocked.gif",
- 'charset' => RCMAIL_CHARSET,
- 'cid_map' => $cid_replaces,
- 'html_elements' => array('body'),
- );
-
- if (!$p['inline_html']) {
- $wash_opts['html_elements'] = array('html','head','title','body');
- }
- if ($p['safe']) {
- $wash_opts['html_elements'][] = 'link';
- $wash_opts['html_attribs'] = array('rel','type');
- }
-
- // overwrite washer options with options from plugins
- if (isset($p['html_elements']))
- $wash_opts['html_elements'] = $p['html_elements'];
- if (isset($p['html_attribs']))
- $wash_opts['html_attribs'] = $p['html_attribs'];
-
- // initialize HTML washer
- $washer = new rcube_washtml($wash_opts);
-
- if (!$p['skip_washer_form_callback'])
- $washer->add_callback('form', 'rcmail_washtml_callback');
-
- // allow CSS styles, will be sanitized by rcmail_washtml_callback()
- if (!$p['skip_washer_style_callback'])
- $washer->add_callback('style', 'rcmail_washtml_callback');
-
- // Remove non-UTF8 characters (#1487813)
- $html = rc_utf8_clean($html);
-
- $html = $washer->wash($html);
- $REMOTE_OBJECTS = $washer->extlinks;
-
- return $html;
-}
+ global $REMOTE_OBJECTS;
+
+ $p += array('safe' => false, 'inline_html' => true);
+
+ // charset was converted to UTF-8 in rcube_storage::get_message_part(),
+ // change/add charset specification in HTML accordingly,
+ // washtml cannot work without that
+ $meta = '<meta http-equiv="Content-Type" content="text/html; charset='.RCUBE_CHARSET.'" />';
+
+ // remove old meta tag and add the new one, making sure
+ // that it is placed in the head (#1488093)
+ $html = preg_replace('/<meta[^>]+charset=[a-z0-9-_]+[^>]*>/Ui', '', $html);
+ $html = preg_replace('/(<head[^>]*>)/Ui', '\\1'.$meta, $html, -1, $rcount);
+ if (!$rcount) {
+ $html = '<head>' . $meta . '</head>' . $html;
+ }
+
+ // clean HTML with washhtml by Frederic Motte
+ $wash_opts = array(
+ 'show_washed' => false,
+ 'allow_remote' => $p['safe'],
+ 'blocked_src' => "./program/resources/blocked.gif",
+ 'charset' => RCUBE_CHARSET,
+ 'cid_map' => $cid_replaces,
+ 'html_elements' => array('body'),
+ );
+
+ if (!$p['inline_html']) {
+ $wash_opts['html_elements'] = array('html','head','title','body');
+ }
+ if ($p['safe']) {
+ $wash_opts['html_elements'][] = 'link';
+ $wash_opts['html_attribs'] = array('rel','type');
+ }
+
+ // overwrite washer options with options from plugins
+ if (isset($p['html_elements']))
+ $wash_opts['html_elements'] = $p['html_elements'];
+ if (isset($p['html_attribs']))
+ $wash_opts['html_attribs'] = $p['html_attribs'];
+ // initialize HTML washer
+ $washer = new rcube_washtml($wash_opts);
+
+ if (!$p['skip_washer_form_callback']) {
+ $washer->add_callback('form', 'rcmail_washtml_callback');
+ }
+
+ // allow CSS styles, will be sanitized by rcmail_washtml_callback()
+ if (!$p['skip_washer_style_callback']) {
+ $washer->add_callback('style', 'rcmail_washtml_callback');
+ }
+
+ // Remove non-UTF8 characters (#1487813)
+ $html = rcube_charset::clean($html);
+
+ $html = $washer->wash($html);
+ $REMOTE_OBJECTS = $washer->extlinks;
+
+ return $html;
+}
/**
* Convert the given message part to proper HTML
@@ -734,58 +767,58 @@ function rcmail_wash_html($html, $p, $cid_replaces)
*/
function rcmail_print_body($part, $p = array())
{
- global $RCMAIL;
-
- // trigger plugin hook
- $data = $RCMAIL->plugins->exec_hook('message_part_before',
- array('type' => $part->ctype_secondary, 'body' => $part->body, 'id' => $part->mime_id)
- + $p + array('safe' => false, 'plain' => false, 'inline_html' => true));
-
- // convert html to text/plain
- if ($data['plain'] && ($data['type'] == 'html' || $data['type'] == 'enriched')) {
- if ($data['type'] == 'enriched') {
- $data['body'] = rcube_enriched::to_html($data['body']);
- }
- $txt = new rcube_html2text($data['body'], false, true);
- $body = $txt->get_text();
- $part->ctype_secondary = 'plain';
- }
- // text/html
- else if ($data['type'] == 'html') {
- $body = rcmail_wash_html($data['body'], $data, $part->replaces);
- $part->ctype_secondary = $data['type'];
- }
- // text/enriched
- else if ($data['type'] == 'enriched') {
- $body = rcube_enriched::to_html($data['body']);
- $body = rcmail_wash_html($body, $data, $part->replaces);
- $part->ctype_secondary = 'html';
- }
- else {
- // assert plaintext
- $body = $part->body;
- $part->ctype_secondary = $data['type'] = 'plain';
- }
-
- // free some memory (hopefully)
- unset($data['body']);
-
- // plaintext postprocessing
- if ($part->ctype_secondary == 'plain') {
- if ($part->ctype_secondary == 'plain' && $part->ctype_parameters['format'] == 'flowed') {
- $body = rcube_mime::unfold_flowed($body);
- }
-
- $body = rcmail_plain_body($body);
- }
-
- // allow post-processing of the message body
- $data = $RCMAIL->plugins->exec_hook('message_part_after',
- array('type' => $part->ctype_secondary, 'body' => $body, 'id' => $part->mime_id) + $data);
-
- return $data['type'] == 'html' ? $data['body'] : html::tag('pre', array(), $data['body']);
-}
+ global $RCMAIL;
+
+ // trigger plugin hook
+ $data = $RCMAIL->plugins->exec_hook('message_part_before',
+ array('type' => $part->ctype_secondary, 'body' => $part->body, 'id' => $part->mime_id)
+ + $p + array('safe' => false, 'plain' => false, 'inline_html' => true));
+
+ // convert html to text/plain
+ if ($data['plain'] && ($data['type'] == 'html' || $data['type'] == 'enriched')) {
+ if ($data['type'] == 'enriched') {
+ $data['body'] = rcube_enriched::to_html($data['body']);
+ }
+
+ $txt = new rcube_html2text($data['body'], false, true);
+ $body = $txt->get_text();
+ $part->ctype_secondary = 'plain';
+ }
+ // text/html
+ else if ($data['type'] == 'html') {
+ $body = rcmail_wash_html($data['body'], $data, $part->replaces);
+ $part->ctype_secondary = $data['type'];
+ }
+ // text/enriched
+ else if ($data['type'] == 'enriched') {
+ $body = rcube_enriched::to_html($data['body']);
+ $body = rcmail_wash_html($body, $data, $part->replaces);
+ $part->ctype_secondary = 'html';
+ }
+ else {
+ // assert plaintext
+ $body = $part->body;
+ $part->ctype_secondary = $data['type'] = 'plain';
+ }
+
+ // free some memory (hopefully)
+ unset($data['body']);
+
+ // plaintext postprocessing
+ if ($part->ctype_secondary == 'plain') {
+ if ($part->ctype_secondary == 'plain' && $part->ctype_parameters['format'] == 'flowed') {
+ $body = rcube_mime::unfold_flowed($body);
+ }
+
+ $body = rcmail_plain_body($body);
+ }
+ // allow post-processing of the message body
+ $data = $RCMAIL->plugins->exec_hook('message_part_after',
+ array('type' => $part->ctype_secondary, 'body' => $body, 'id' => $part->mime_id) + $data);
+
+ return $data['type'] == 'html' ? $data['body'] : html::tag('pre', array(), $data['body']);
+}
/**
* Handle links and citation marks in plain text message
@@ -796,232 +829,245 @@ function rcmail_print_body($part, $p = array())
*/
function rcmail_plain_body($body)
{
- global $RCMAIL;
-
- // make links and email-addresses clickable
- $attribs = array('link_attribs' => array('rel' => 'noreferrer', 'target' => '_blank'));
- $replacer = new rcmail_string_replacer($attribs);
-
- // search for patterns like links and e-mail addresses and replace with tokens
- $body = $replacer->replace($body);
-
- // split body into single lines
- $body = preg_split('/\r?\n/', $body);
- $quote_level = 0;
- $last = -1;
-
- // find/mark quoted lines...
- for ($n=0, $cnt=count($body); $n < $cnt; $n++) {
- if ($body[$n][0] == '>' && preg_match('/^(>+ {0,1})+/', $body[$n], $regs)) {
- $q = substr_count($regs[0], '>');
- $body[$n] = substr($body[$n], strlen($regs[0]));
-
- if ($q > $quote_level) {
- $body[$n] = $replacer->get_replacement($replacer->add(
- str_repeat('<blockquote>', $q - $quote_level))) . $body[$n];
- $last = $n;
- }
- else if ($q < $quote_level) {
- $body[$n] = $replacer->get_replacement($replacer->add(
- str_repeat('</blockquote>', $quote_level - $q))) . $body[$n];
- $last = $n;
- }
- }
- else {
- $q = 0;
- if ($quote_level > 0)
- $body[$n] = $replacer->get_replacement($replacer->add(
- str_repeat('</blockquote>', $quote_level))) . $body[$n];
+ global $RCMAIL;
+
+ // make links and email-addresses clickable
+ $attribs = array('link_attribs' => array('rel' => 'noreferrer', 'target' => '_blank'));
+ $replacer = new rcmail_string_replacer($attribs);
+
+ // search for patterns like links and e-mail addresses and replace with tokens
+ $body = $replacer->replace($body);
+
+ // split body into single lines
+ $body = preg_split('/\r?\n/', $body);
+ $quote_level = 0;
+ $last = -1;
+
+ // find/mark quoted lines...
+ for ($n=0, $cnt=count($body); $n < $cnt; $n++) {
+ if ($body[$n][0] == '>' && preg_match('/^(>+ {0,1})+/', $body[$n], $regs)) {
+ $q = substr_count($regs[0], '>');
+ $body[$n] = substr($body[$n], strlen($regs[0]));
+
+ if ($q > $quote_level) {
+ $body[$n] = $replacer->get_replacement($replacer->add(
+ str_repeat('<blockquote>', $q - $quote_level))) . $body[$n];
+ $last = $n;
+ }
+ else if ($q < $quote_level) {
+ $body[$n] = $replacer->get_replacement($replacer->add(
+ str_repeat('</blockquote>', $quote_level - $q))) . $body[$n];
+ $last = $n;
+ }
+ }
+ else {
+ $q = 0;
+ if ($quote_level > 0)
+ $body[$n] = $replacer->get_replacement($replacer->add(
+ str_repeat('</blockquote>', $quote_level))) . $body[$n];
+ }
+
+ $quote_level = $q;
}
- $quote_level = $q;
- }
+ $body = join("\n", $body);
- $body = join("\n", $body);
+ // quote plain text (don't use rcube::Q() here, to display entities "as is")
+ $table = get_html_translation_table(HTML_SPECIALCHARS);
+ unset($table['?']);
+ $body = strtr($body, $table);
- // quote plain text (don't use Q() here, to display entities "as is")
- $table = get_html_translation_table(HTML_SPECIALCHARS);
- unset($table['?']);
- $body = strtr($body, $table);
+ // colorize signature (up to <sig_max_lines> lines)
+ $len = strlen($body);
+ $sig_max_lines = $RCMAIL->config->get('sig_max_lines', 15);
- // colorize signature (up to <sig_max_lines> lines)
- $len = strlen($body);
- $sig_max_lines = $RCMAIL->config->get('sig_max_lines', 15);
- while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) {
- if ($sp == 0 || $body[$sp-1] == "\n") {
- // do not touch blocks with more that X lines
- if (substr_count($body, "\n", $sp) < $sig_max_lines)
- $body = substr($body, 0, max(0, $sp))
- .'<span class="sig">'.substr($body, $sp).'</span>';
- break;
+ while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) {
+ if ($sp == 0 || $body[$sp-1] == "\n") {
+ // do not touch blocks with more that X lines
+ if (substr_count($body, "\n", $sp) < $sig_max_lines) {
+ $body = substr($body, 0, max(0, $sp))
+ . '<span class="sig">'.substr($body, $sp).'</span>';
+ }
+
+ break;
+ }
}
- }
- // insert url/mailto links and citation tags
- $body = $replacer->resolve($body);
+ // insert url/mailto links and citation tags
+ $body = $replacer->resolve($body);
- return $body;
+ return $body;
}
-
/**
* Callback function for washtml cleaning class
*/
function rcmail_washtml_callback($tagname, $attrib, $content, $washtml)
{
- switch ($tagname) {
+ switch ($tagname) {
case 'form':
- $out = html::div('form', $content);
- break;
+ $out = html::div('form', $content);
+ break;
case 'style':
- // decode all escaped entities and reduce to ascii strings
- $stripped = preg_replace('/[^a-zA-Z\(:;]/', '', rcmail_xss_entity_decode($content));
-
- // now check for evil strings like expression, behavior or url()
- if (!preg_match('/expression|behavior|javascript:|import[^a]/i', $stripped)) {
- if (!$washtml->get_config('allow_remote') && stripos($stripped, 'url('))
- $washtml->extlinks = true;
- else
- $out = html::tag('style', array('type' => 'text/css'), $content);
- break;
- }
+ // decode all escaped entities and reduce to ascii strings
+ $stripped = preg_replace('/[^a-zA-Z\(:;]/', '', rcube_utils::xss_entity_decode($content));
+
+ // now check for evil strings like expression, behavior or url()
+ if (!preg_match('/expression|behavior|javascript:|import[^a]/i', $stripped)) {
+ if (!$washtml->get_config('allow_remote') && stripos($stripped, 'url('))
+ $washtml->extlinks = true;
+ else
+ $out = html::tag('style', array('type' => 'text/css'), $content);
+ break;
+ }
default:
- $out = '';
- }
+ $out = '';
+ }
- return $out;
+ return $out;
}
-
/**
* return table with message headers
*/
function rcmail_message_headers($attrib, $headers=null)
{
- global $MESSAGE, $PRINT_MODE, $RCMAIL;
- static $sa_attrib;
-
- // keep header table attrib
- if (is_array($attrib) && !$sa_attrib && !$attrib['valueof'])
- $sa_attrib = $attrib;
- else if (!is_array($attrib) && is_array($sa_attrib))
- $attrib = $sa_attrib;
-
- if (!isset($MESSAGE))
- return FALSE;
-
- // get associative array of headers object
- if (!$headers) {
- $headers_obj = $MESSAGE->headers;
- $headers = get_object_vars($MESSAGE->headers);
- }
- else if (is_object($headers)) {
- $headers_obj = $headers;
- $headers = get_object_vars($headers_obj);
- }
- else {
- $headers_obj = rcube_message_header::from_array($headers);
- }
-
- // show these headers
- $standard_headers = array('subject', 'from', 'sender', 'to', 'cc', 'bcc', 'replyto',
- 'mail-reply-to', 'mail-followup-to', 'date', 'priority');
- $exclude_headers = $attrib['exclude'] ? explode(',', $attrib['exclude']) : array();
- $output_headers = array();
-
- foreach ($standard_headers as $hkey) {
- $ishtml = false;
-
- if ($headers[$hkey])
- $value = $headers[$hkey];
- else if ($headers['others'][$hkey])
- $value = $headers['others'][$hkey];
- else if (!$attrib['valueof'])
- continue;
-
- if (in_array($hkey, $exclude_headers))
- continue;
-
- $header_title = rcube_label(preg_replace('/(^mail-|-)/', '', $hkey));
-
- if ($hkey == 'date') {
- if ($PRINT_MODE)
- $header_value = format_date($value, $RCMAIL->config->get('date_long', 'x'));
- else
- $header_value = format_date($value);
- }
- else if ($hkey == 'priority') {
- if ($value) {
- $header_value = html::span('prio' . $value, rcmail_localized_priority($value));
- }
- else
- continue;
- }
- else if ($hkey == 'replyto') {
- if ($headers['replyto'] != $headers['from']) {
- $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
- $ishtml = true;
- }
- else
- continue;
- }
- else if ($hkey == 'mail-reply-to') {
- if ($headers['mail-replyto'] != $headers['reply-to']
- && $headers['reply-to'] != $headers['from']
- ) {
- $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
- $ishtml = true;
- }
- else
- continue;
- }
- else if ($hkey == 'sender') {
- if ($headers['sender'] != $headers['from']) {
- $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
- $ishtml = true;
- }
- else
- continue;
- }
- else if ($hkey == 'mail-followup-to') {
- $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
- $ishtml = true;
- }
- else if (in_array($hkey, array('from', 'to', 'cc', 'bcc'))) {
- $header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
- $ishtml = true;
- }
- else if ($hkey == 'subject' && empty($value))
- $header_value = rcube_label('nosubject');
- else
- $header_value = trim(rcube_mime::decode_header($value, $headers['charset']));
+ global $MESSAGE, $PRINT_MODE, $RCMAIL;
+ static $sa_attrib;
- $output_headers[$hkey] = array(
- 'title' => $header_title,
- 'value' => $header_value,
- 'raw' => $value,
- 'html' => $ishtml,
- );
- }
+ // keep header table attrib
+ if (is_array($attrib) && !$sa_attrib && !$attrib['valueof'])
+ $sa_attrib = $attrib;
+ else if (!is_array($attrib) && is_array($sa_attrib))
+ $attrib = $sa_attrib;
+
+ if (!isset($MESSAGE)) {
+ return false;
+ }
+
+ // get associative array of headers object
+ if (!$headers) {
+ $headers_obj = $MESSAGE->headers;
+ $headers = get_object_vars($MESSAGE->headers);
+ }
+ else if (is_object($headers)) {
+ $headers_obj = $headers;
+ $headers = get_object_vars($headers_obj);
+ }
+ else {
+ $headers_obj = rcube_message_header::from_array($headers);
+ }
+
+ // show these headers
+ $standard_headers = array('subject', 'from', 'sender', 'to', 'cc', 'bcc', 'replyto',
+ 'mail-reply-to', 'mail-followup-to', 'date', 'priority');
+ $exclude_headers = $attrib['exclude'] ? explode(',', $attrib['exclude']) : array();
+ $output_headers = array();
+
+ foreach ($standard_headers as $hkey) {
+ $ishtml = false;
+
+ if ($headers[$hkey])
+ $value = $headers[$hkey];
+ else if ($headers['others'][$hkey])
+ $value = $headers['others'][$hkey];
+ else if (!$attrib['valueof'])
+ continue;
+
+ if (in_array($hkey, $exclude_headers))
+ continue;
+
+ $header_title = $RCMAIL->gettext(preg_replace('/(^mail-|-)/', '', $hkey));
+
+ if ($hkey == 'date') {
+ if ($PRINT_MODE)
+ $header_value = $RCMAIL->format_date($value, $RCMAIL->config->get('date_long', 'x'));
+ else
+ $header_value = $RCMAIL->format_date($value);
+ }
+ else if ($hkey == 'priority') {
+ if ($value) {
+ $header_value = html::span('prio' . $value, rcmail_localized_priority($value));
+ }
+ else
+ continue;
+ }
+ else if ($hkey == 'replyto') {
+ if ($headers['replyto'] != $headers['from']) {
+ $header_value = rcmail_address_string($value, $attrib['max'], true,
+ $attrib['addicon'], $headers['charset'], $header_title);
+ $ishtml = true;
+ }
+ else
+ continue;
+ }
+ else if ($hkey == 'mail-reply-to') {
+ if ($headers['mail-replyto'] != $headers['reply-to']
+ && $headers['reply-to'] != $headers['from']
+ ) {
+ $header_value = rcmail_address_string($value, $attrib['max'], true,
+ $attrib['addicon'], $headers['charset'], $header_title);
+ $ishtml = true;
+ }
+ else
+ continue;
+ }
+ else if ($hkey == 'sender') {
+ if ($headers['sender'] != $headers['from']) {
+ $header_value = rcmail_address_string($value, $attrib['max'], true,
+ $attrib['addicon'], $headers['charset'], $header_title);
+ $ishtml = true;
+ }
+ else
+ continue;
+ }
+ else if ($hkey == 'mail-followup-to') {
+ $header_value = rcmail_address_string($value, $attrib['max'], true,
+ $attrib['addicon'], $headers['charset'], $header_title);
+ $ishtml = true;
+ }
+ else if (in_array($hkey, array('from', 'to', 'cc', 'bcc'))) {
+ $header_value = rcmail_address_string($value, $attrib['max'], true,
+ $attrib['addicon'], $headers['charset'], $header_title);
+ $ishtml = true;
+ }
+ else if ($hkey == 'subject' && empty($value))
+ $header_value = $RCMAIL->gettext('nosubject');
+ else
+ $header_value = trim(rcube_mime::decode_header($value, $headers['charset']));
- $plugin = $RCMAIL->plugins->exec_hook('message_headers_output',
- array('output' => $output_headers, 'headers' => $headers_obj, 'exclude' => $exclude_headers));
+ $output_headers[$hkey] = array(
+ 'title' => $header_title,
+ 'value' => $header_value,
+ 'raw' => $value,
+ 'html' => $ishtml,
+ );
+ }
- // single header value is requested
- if (!empty($attrib['valueof']))
- return Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show'));
+ $plugin = $RCMAIL->plugins->exec_hook('message_headers_output', array(
+ 'output' => $output_headers,
+ 'headers' => $headers_obj,
+ 'exclude' => $exclude_headers
+ ));
+
+ // single header value is requested
+ if (!empty($attrib['valueof'])) {
+ return rcube::Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show'));
+ }
- // compose html table
- $table = new html_table(array('cols' => 2));
+ // compose html table
+ $table = new html_table(array('cols' => 2));
- foreach ($plugin['output'] as $hkey => $row) {
- $table->add(array('class' => 'header-title'), Q($row['title']));
- $table->add(array('class' => 'header '.$hkey), $row['html'] ? $row['value'] : Q($row['value'], ($hkey == 'subject' ? 'strict' : 'show')));
- }
+ foreach ($plugin['output'] as $hkey => $row) {
+ $val = $row['html'] ? $row['value'] : rcube::Q($row['value'], ($hkey == 'subject' ? 'strict' : 'show'));
- return $table->show($attrib);
+ $table->add(array('class' => 'header-title'), rcube::Q($row['title']));
+ $table->add(array('class' => 'header '.$hkey), $val);
+ }
+
+ return $table->show($attrib);
}
/**
@@ -1029,18 +1075,21 @@ function rcmail_message_headers($attrib, $headers=null)
*/
function rcmail_localized_priority($value)
{
- $labels_map = array(
- '1' => 'highest',
- '2' => 'high',
- '3' => 'normal',
- '4' => 'low',
- '5' => 'lowest',
- );
-
- if ($value && $labels_map[$value])
- return rcube_label($labels_map[$value]);
-
- return '';
+ global $RCMAIL;
+
+ $labels_map = array(
+ '1' => 'highest',
+ '2' => 'high',
+ '3' => 'normal',
+ '4' => 'low',
+ '5' => 'lowest',
+ );
+
+ if ($value && $labels_map[$value]) {
+ return $RCMAIL->gettext($labels_map[$value]);
+ }
+
+ return '';
}
/**
@@ -1048,18 +1097,21 @@ function rcmail_localized_priority($value)
*/
function rcmail_message_full_headers($attrib, $headers=NULL)
{
- global $OUTPUT;
+ global $OUTPUT, $RCMAIL;
- $html = html::div(array('id' => "all-headers", 'class' => "all", 'style' => 'display:none'), html::div(array('id' => 'headers-source'), ''));
- $html .= html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('show-headers','',this)", 'title' => rcube_label('togglefullheaders')), '');
+ $html = html::div(array('id' => "all-headers", 'class' => "all", 'style' => 'display:none'), html::div(array('id' => 'headers-source'), ''));
+ $html .= html::div(array(
+ 'class' => "more-headers show-headers",
+ 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('show-headers','',this)",
+ 'title' => $RCMAIL->gettext('togglefullheaders')
+ ), '');
- $OUTPUT->add_gui_object('all_headers_row', 'all-headers');
- $OUTPUT->add_gui_object('all_headers_box', 'headers-source');
+ $OUTPUT->add_gui_object('all_headers_row', 'all-headers');
+ $OUTPUT->add_gui_object('all_headers_box', 'headers-source');
- return html::div($attrib, $html);
+ return html::div($attrib, $html);
}
-
/**
* Handler for the 'messagebody' GUI object
*
@@ -1068,518 +1120,530 @@ function rcmail_message_full_headers($attrib, $headers=NULL)
*/
function rcmail_message_body($attrib)
{
- global $CONFIG, $OUTPUT, $MESSAGE, $RCMAIL, $REMOTE_OBJECTS;
+ global $OUTPUT, $MESSAGE, $RCMAIL, $REMOTE_OBJECTS;
- if (!is_array($MESSAGE->parts) && empty($MESSAGE->body))
- return '';
+ if (!is_array($MESSAGE->parts) && empty($MESSAGE->body)) {
+ return '';
+ }
- if (!$attrib['id'])
- $attrib['id'] = 'rcmailMsgBody';
-
- $safe_mode = $MESSAGE->is_safe || intval($_GET['_safe']);
- $out = '';
-
- $header_attrib = array();
- foreach ($attrib as $attr => $value)
- if (preg_match('/^headertable([a-z]+)$/i', $attr, $regs))
- $header_attrib[$regs[1]] = $value;
-
- if (!empty($MESSAGE->parts)) {
- foreach ($MESSAGE->parts as $part) {
- if ($part->type == 'headers') {
- $out .= html::div('message-partheaders', rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : null, $part->headers));
- }
- else if ($part->type == 'content') {
- // unsupported (e.g. encrypted)
- if ($part->realtype) {
- if ($part->realtype == 'multipart/encrypted' || $part->realtype == 'application/pkcs7-mime') {
- $out .= html::span('part-notice', rcube_label('encryptedmessage'));
- }
- continue;
- }
- else if (!$part->size) {
- continue;
- }
- // Check if we have enough memory to handle the message in it
- // #1487424: we need up to 10x more memory than the body
- else if (!rcmail_mem_check($part->size * 10)) {
- $out .= html::span('part-notice', rcube_label('messagetoobig'). ' '
- . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id
- .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), rcube_label('download')));
- continue;
+ if (!$attrib['id'])
+ $attrib['id'] = 'rcmailMsgBody';
+
+ $safe_mode = $MESSAGE->is_safe || intval($_GET['_safe']);
+ $out = '';
+
+ $header_attrib = array();
+ foreach ($attrib as $attr => $value) {
+ if (preg_match('/^headertable([a-z]+)$/i', $attr, $regs)) {
+ $header_attrib[$regs[1]] = $value;
}
+ }
- if (empty($part->ctype_parameters) || empty($part->ctype_parameters['charset']))
- $part->ctype_parameters['charset'] = $MESSAGE->headers->charset;
+ if (!empty($MESSAGE->parts)) {
+ foreach ($MESSAGE->parts as $part) {
+ if ($part->type == 'headers') {
+ $out .= html::div('message-partheaders', rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : null, $part->headers));
+ }
+ else if ($part->type == 'content') {
+ // unsupported (e.g. encrypted)
+ if ($part->realtype) {
+ if ($part->realtype == 'multipart/encrypted' || $part->realtype == 'application/pkcs7-mime') {
+ $out .= html::span('part-notice', $RCMAIL->gettext('encryptedmessage'));
+ }
+ continue;
+ }
+ else if (!$part->size) {
+ continue;
+ }
- // fetch part if not available
- if (!isset($part->body))
- $part->body = $MESSAGE->get_part_content($part->mime_id);
+ // Check if we have enough memory to handle the message in it
+ // #1487424: we need up to 10x more memory than the body
+ else if (!rcube_utils::mem_check($part->size * 10)) {
+ $out .= html::span('part-notice', $RCMAIL->gettext('messagetoobig'). ' '
+ . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id
+ .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download')));
+ continue;
+ }
- // extract headers from message/rfc822 parts
- if ($part->mimetype == 'message/rfc822') {
- $msgpart = rcube_mime::parse_message($part->body);
- if (!empty($msgpart->headers)) {
- $part = $msgpart;
- $out .= html::div('message-partheaders', rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : null, $part->headers));
- }
- }
+ if (empty($part->ctype_parameters) || empty($part->ctype_parameters['charset'])) {
+ $part->ctype_parameters['charset'] = $MESSAGE->headers->charset;
+ }
- // message is cached but not exists (#1485443), or other error
- if ($part->body === false) {
- rcmail_message_error($MESSAGE->uid);
- }
+ // fetch part if not available
+ if (!isset($part->body)) {
+ $part->body = $MESSAGE->get_part_content($part->mime_id);
+ }
- $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix', array(
- 'part' => $part, 'prefix' => ''));
+ // extract headers from message/rfc822 parts
+ if ($part->mimetype == 'message/rfc822') {
+ $msgpart = rcube_mime::parse_message($part->body);
+ if (!empty($msgpart->headers)) {
+ $part = $msgpart;
+ $out .= html::div('message-partheaders', rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : null, $part->headers));
+ }
+ }
- $body = rcmail_print_body($part, array('safe' => $safe_mode, 'plain' => !$CONFIG['prefer_html']));
+ // message is cached but not exists (#1485443), or other error
+ if ($part->body === false) {
+ rcmail_message_error($MESSAGE->uid);
+ }
- if ($part->ctype_secondary == 'html') {
- $body = rcmail_html4inline($body, $attrib['id'], 'rcmBody', $attrs, $safe_mode);
- $div_attr = array('class' => 'message-htmlpart');
- $style = array();
+ $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix',
+ array('part' => $part, 'prefix' => ''));
- if (!empty($attrs)) {
- foreach ($attrs as $a_idx => $a_val)
- $style[] = $a_idx . ': ' . $a_val;
- if (!empty($style))
- $div_attr['style'] = implode('; ', $style);
- }
+ $body = rcmail_print_body($part, array('safe' => $safe_mode, 'plain' => !$RCMAIL->config->get('prefer_html')));
- $out .= html::div($div_attr, $plugin['prefix'] . $body);
+ if ($part->ctype_secondary == 'html') {
+ $body = rcmail_html4inline($body, $attrib['id'], 'rcmBody', $attrs, $safe_mode);
+ $div_attr = array('class' => 'message-htmlpart');
+ $style = array();
+
+ if (!empty($attrs)) {
+ foreach ($attrs as $a_idx => $a_val)
+ $style[] = $a_idx . ': ' . $a_val;
+ if (!empty($style))
+ $div_attr['style'] = implode('; ', $style);
+ }
+
+ $out .= html::div($div_attr, $plugin['prefix'] . $body);
+ }
+ else
+ $out .= html::div('message-part', $plugin['prefix'] . $body);
+ }
}
- else
- $out .= html::div('message-part', $plugin['prefix'] . $body);
- }
- }
- }
- else {
- // Check if we have enough memory to handle the message in it
- // #1487424: we need up to 10x more memory than the body
- if (!rcmail_mem_check(strlen($MESSAGE->body) * 10)) {
- $out .= html::span('part-notice', rcube_label('messagetoobig'). ' '
- . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part=0'
- .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), rcube_label('download')));
}
else {
- $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix', array(
- 'part' => $MESSAGE, 'prefix' => ''));
-
- $out .= html::div('message-part', $plugin['prefix'] . html::tag('pre', array(),
- rcmail_plain_body(Q($MESSAGE->body, 'strict', false))));
- }
- }
-
- // list images after mail body
- if ($RCMAIL->config->get('inline_images', true) && !empty($MESSAGE->attachments)) {
- $thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240);
- $client_mimetypes = (array)$RCMAIL->config->get('client_mimetypes');
-
- foreach ($MESSAGE->attachments as $attach_prop) {
- // skip inline images
- if ($attach_prop->content_id && $attach_prop->disposition == 'inline') {
- continue;
- }
-
- // Content-Type: image/*...
- if ($mimetype = rcmail_part_image_type($attach_prop)) {
- // display thumbnails
- if ($thumbnail_size) {
- $show_link = array(
- 'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
- 'onclick' => sprintf(
- 'return %s.command(\'load-attachment\',\'%s\',this)',
- JS_OBJECT_NAME,
- $attach_prop->mime_id)
- );
- $out .= html::p('image-attachment',
- html::a($show_link + array('class' => 'image-link', 'style' => sprintf('width:%dpx', $thumbnail_size)),
- html::img(array(
- 'class' => 'image-thumbnail',
- 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, 'image') . '&_thumb=1',
- 'title' => $attach_prop->filename,
- 'alt' => $attach_prop->filename,
- 'style' => sprintf('max-width:%dpx; max-height:%dpx', $thumbnail_size, $thumbnail_size),
- ))
- ) .
- html::span('image-filename', Q($attach_prop->filename)) .
- html::span('image-filesize', Q($RCMAIL->message_part_size($attach_prop))) .
- html::span('attachment-links',
- (in_array($mimetype, $client_mimetypes) ? html::a($show_link, rcube_label('showattachment')) . '&nbsp;' : '') .
- html::a($show_link['href'] . '&_download=1', rcube_label('download'))
- ) .
- html::br(array('style' => 'clear:both'))
- );
+ // Check if we have enough memory to handle the message in it
+ // #1487424: we need up to 10x more memory than the body
+ if (!rcube_utils::mem_check(strlen($MESSAGE->body) * 10)) {
+ $out .= html::span('part-notice', $RCMAIL->gettext('messagetoobig'). ' '
+ . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part=0'
+ .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download')));
}
else {
- $out .= html::tag('fieldset', 'image-attachment',
- html::tag('legend', 'image-filename', Q($attach_prop->filename)) .
- html::p(array('align' => "center"),
- html::img(array(
- 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, 'image'),
- 'title' => $attach_prop->filename,
- 'alt' => $attach_prop->filename,
- )))
- );
+ $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix',
+ array('part' => $MESSAGE, 'prefix' => ''));
+
+ $out .= html::div('message-part', $plugin['prefix'] . html::tag('pre', array(),
+ rcmail_plain_body(rcube::Q($MESSAGE->body, 'strict', false))));
}
- }
}
- }
- // tell client that there are blocked remote objects
- if ($REMOTE_OBJECTS && !$safe_mode)
- $OUTPUT->set_env('blockedobjects', true);
+ // list images after mail body
+ if ($RCMAIL->config->get('inline_images', true) && !empty($MESSAGE->attachments)) {
+ $thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240);
+ $client_mimetypes = (array)$RCMAIL->config->get('client_mimetypes');
+
+ foreach ($MESSAGE->attachments as $attach_prop) {
+ // skip inline images
+ if ($attach_prop->content_id && $attach_prop->disposition == 'inline') {
+ continue;
+ }
+
+ // Content-Type: image/*...
+ if ($mimetype = rcmail_part_image_type($attach_prop)) {
+ // display thumbnails
+ if ($thumbnail_size) {
+ $show_link = array(
+ 'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
+ 'onclick' => sprintf(
+ 'return %s.command(\'load-attachment\',\'%s\',this)',
+ rcmail_output::JS_OBJECT_NAME,
+ $attach_prop->mime_id)
+ );
+ $out .= html::p('image-attachment',
+ html::a($show_link + array('class' => 'image-link', 'style' => sprintf('width:%dpx', $thumbnail_size)),
+ html::img(array(
+ 'class' => 'image-thumbnail',
+ 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, 'image') . '&_thumb=1',
+ 'title' => $attach_prop->filename,
+ 'alt' => $attach_prop->filename,
+ 'style' => sprintf('max-width:%dpx; max-height:%dpx', $thumbnail_size, $thumbnail_size),
+ ))
+ ) .
+ html::span('image-filename', rcube::Q($attach_prop->filename)) .
+ html::span('image-filesize', rcube::Q($RCMAIL->message_part_size($attach_prop))) .
+ html::span('attachment-links',
+ (in_array($mimetype, $client_mimetypes) ? html::a($show_link, $RCMAIL->gettext('showattachment')) . '&nbsp;' : '') .
+ html::a($show_link['href'] . '&_download=1', $RCMAIL->gettext('download'))
+ ) .
+ html::br(array('style' => 'clear:both'))
+ );
+ }
+ else {
+ $out .= html::tag('fieldset', 'image-attachment',
+ html::tag('legend', 'image-filename', rcube::Q($attach_prop->filename)) .
+ html::p(array('align' => 'center'),
+ html::img(array(
+ 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, 'image'),
+ 'title' => $attach_prop->filename,
+ 'alt' => $attach_prop->filename,
+ )))
+ );
+ }
+ }
+ }
+ }
- return html::div($attrib, $out);
+ // tell client that there are blocked remote objects
+ if ($REMOTE_OBJECTS && !$safe_mode) {
+ $OUTPUT->set_env('blockedobjects', true);
+ }
+
+ return html::div($attrib, $out);
}
function rcmail_part_image_type($part)
{
- $rcmail = rcmail::get_instance();
-
- // Skip TIFF images if browser doesn't support this format...
- $tiff_support = !empty($_SESSION['browser_caps']) && !empty($_SESSION['browser_caps']['tif']);
- // until we can convert them to JPEG
- $tiff_support = $tiff_support || $rcmail->config->get('im_convert_path');
-
- // Content-type regexp
- $mime_regex = $tiff_support ? '/^image\//i' : '/^image\/(?!tif)/i';
-
- // Content-Type: image/*...
- if (preg_match($mime_regex, $part->mimetype)) {
- return rcmail_fix_mimetype($part->mimetype);
- }
-
- // Many clients use application/octet-stream, we'll detect mimetype
- // by checking filename extension
-
- // Supported image filename extensions to image type map
- $types = array(
- 'jpg' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'png' => 'image/png',
- 'gif' => 'image/gif',
- 'bmp' => 'image/bmp',
- );
- if ($tiff_support) {
- $types['tif'] = 'image/tiff';
- $types['tiff'] = 'image/tiff';
- }
-
- if ($part->filename
- && preg_match('/^application\/octet-stream$/i', $part->mimetype)
- && preg_match('/\.([^.]+)$/i', $part->filename, $m)
- && ($extension = strtolower($m[1]))
- && isset($types[$extension])
- ) {
- return $types[$extension];
- }
-}
+ $rcmail = rcmail::get_instance();
+
+ // Skip TIFF images if browser doesn't support this format...
+ $tiff_support = !empty($_SESSION['browser_caps']) && !empty($_SESSION['browser_caps']['tif']);
+ // until we can convert them to JPEG
+ $tiff_support = $tiff_support || $rcmail->config->get('im_convert_path');
+
+ // Content-type regexp
+ $mime_regex = $tiff_support ? '/^image\//i' : '/^image\/(?!tif)/i';
+
+ // Content-Type: image/*...
+ if (preg_match($mime_regex, $part->mimetype)) {
+ return rcmail_fix_mimetype($part->mimetype);
+ }
+ // Many clients use application/octet-stream, we'll detect mimetype
+ // by checking filename extension
+
+ // Supported image filename extensions to image type map
+ $types = array(
+ 'jpg' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'png' => 'image/png',
+ 'gif' => 'image/gif',
+ 'bmp' => 'image/bmp',
+ );
+ if ($tiff_support) {
+ $types['tif'] = 'image/tiff';
+ $types['tiff'] = 'image/tiff';
+ }
+
+ if ($part->filename
+ && preg_match('/^application\/octet-stream$/i', $part->mimetype)
+ && preg_match('/\.([^.]+)$/i', $part->filename, $m)
+ && ($extension = strtolower($m[1]))
+ && isset($types[$extension])
+ ) {
+ return $types[$extension];
+ }
+}
/**
* modify a HTML message that it can be displayed inside a HTML page
*/
function rcmail_html4inline($body, $container_id, $body_id='', &$attributes=null, $allow_remote=false)
{
- $last_style_pos = 0;
- $cont_id = $container_id.($body_id ? ' div.'.$body_id : '');
-
- // find STYLE tags
- while (($pos = stripos($body, '<style', $last_style_pos)) && ($pos2 = stripos($body, '</style>', $pos)))
- {
- $pos = strpos($body, '>', $pos) + 1;
- $len = $pos2 - $pos;
-
- // replace all css definitions with #container [def]
- $styles = substr($body, $pos, $len);
- $styles = rcmail_mod_css_styles($styles, $cont_id, $allow_remote);
-
- $body = substr_replace($body, $styles, $pos, $len);
- $last_style_pos = $pos2 + strlen($styles) - $len;
- }
-
- // modify HTML links to open a new window if clicked
- $GLOBALS['rcmail_html_container_id'] = $container_id;
- $body = preg_replace_callback('/<(a|link|area)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body);
- unset($GLOBALS['rcmail_html_container_id']);
-
- $body = preg_replace(array(
- // add comments arround html and other tags
- '/(<!DOCTYPE[^>]*>)/i',
- '/(<\?xml[^>]*>)/i',
- '/(<\/?html[^>]*>)/i',
- '/(<\/?head[^>]*>)/i',
- '/(<title[^>]*>.*<\/title>)/Ui',
- '/(<\/?meta[^>]*>)/i',
- // quote <? of php and xml files that are specified as text/html
- '/<\?/',
- '/\?>/',
- // replace <body> with <div>
- '/<body([^>]*)>/i',
- '/<\/body>/i',
- ),
- array(
- '<!--\\1-->',
- '<!--\\1-->',
- '<!--\\1-->',
- '<!--\\1-->',
- '<!--\\1-->',
- '<!--\\1-->',
- '&lt;?',
- '?&gt;',
- '<div class="'.$body_id.'"\\1>',
- '</div>',
- ),
- $body);
-
- $attributes = array();
-
- // Handle body attributes that doesn't play nicely with div elements
- $regexp = '/<div class="' . preg_quote($body_id, '/') . '"([^>]*)/';
- if (preg_match($regexp, $body, $m)) {
- $attrs = $m[0];
- // Get bgcolor, we'll set it as background-color of the message container
- if ($m[1] && preg_match('/bgcolor=["\']*([a-z0-9#]+)["\']*/', $attrs, $mb)) {
- $attributes['background-color'] = $mb[1];
- $attrs = preg_replace('/bgcolor=["\']*([a-z0-9#]+)["\']*/', '', $attrs);
- }
- // Get background, we'll set it as background-image of the message container
- if ($m[1] && preg_match('/background=["\']*([^"\'>\s]+)["\']*/', $attrs, $mb)) {
- $attributes['background-image'] = 'url('.$mb[1].')';
- $attrs = preg_replace('/background=["\']*([^"\'>\s]+)["\']*/', '', $attrs);
- }
- if (!empty($attributes)) {
- $body = preg_replace($regexp, rtrim($attrs), $body, 1);
- }
-
- // handle body styles related to background image
- if ($attributes['background-image']) {
- // get body style
- if (preg_match('/#'.preg_quote($cont_id, '/').'\s+\{([^}]+)}/i', $body, $m)) {
- // get background related style
- if (preg_match_all('/(background-position|background-repeat)\s*:\s*([^;]+);/i', $m[1], $ma, PREG_SET_ORDER)) {
- foreach ($ma as $style)
- $attributes[$style[1]] = $style[2];
+ $last_style_pos = 0;
+ $cont_id = $container_id.($body_id ? ' div.'.$body_id : '');
+
+ // find STYLE tags
+ while (($pos = stripos($body, '<style', $last_style_pos)) && ($pos2 = stripos($body, '</style>', $pos))) {
+ $pos = strpos($body, '>', $pos) + 1;
+ $len = $pos2 - $pos;
+
+ // replace all css definitions with #container [def]
+ $styles = substr($body, $pos, $len);
+ $styles = rcube_utils::mod_css_styles($styles, $cont_id, $allow_remote);
+
+ $body = substr_replace($body, $styles, $pos, $len);
+ $last_style_pos = $pos2 + strlen($styles) - $len;
+ }
+
+ // modify HTML links to open a new window if clicked
+ $GLOBALS['rcmail_html_container_id'] = $container_id;
+ $body = preg_replace_callback('/<(a|link|area)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body);
+ unset($GLOBALS['rcmail_html_container_id']);
+
+ $body = preg_replace(array(
+ // add comments arround html and other tags
+ '/(<!DOCTYPE[^>]*>)/i',
+ '/(<\?xml[^>]*>)/i',
+ '/(<\/?html[^>]*>)/i',
+ '/(<\/?head[^>]*>)/i',
+ '/(<title[^>]*>.*<\/title>)/Ui',
+ '/(<\/?meta[^>]*>)/i',
+ // quote <? of php and xml files that are specified as text/html
+ '/<\?/',
+ '/\?>/',
+ // replace <body> with <div>
+ '/<body([^>]*)>/i',
+ '/<\/body>/i',
+ ),
+ array(
+ '<!--\\1-->',
+ '<!--\\1-->',
+ '<!--\\1-->',
+ '<!--\\1-->',
+ '<!--\\1-->',
+ '<!--\\1-->',
+ '&lt;?',
+ '?&gt;',
+ '<div class="'.$body_id.'"\\1>',
+ '</div>',
+ ),
+ $body);
+
+ $attributes = array();
+
+ // Handle body attributes that doesn't play nicely with div elements
+ $regexp = '/<div class="' . preg_quote($body_id, '/') . '"([^>]*)/';
+ if (preg_match($regexp, $body, $m)) {
+ $attrs = $m[0];
+
+ // Get bgcolor, we'll set it as background-color of the message container
+ if ($m[1] && preg_match('/bgcolor=["\']*([a-z0-9#]+)["\']*/i', $attrs, $mb)) {
+ $attributes['background-color'] = $mb[1];
+ $attrs = preg_replace('/bgcolor=["\']*[a-z0-9#]+["\']*/i', '', $attrs);
+ }
+
+ // Get background, we'll set it as background-image of the message container
+ if ($m[1] && preg_match('/background=["\']*([^"\'>\s]+)["\']*/', $attrs, $mb)) {
+ $attributes['background-image'] = 'url('.$mb[1].')';
+ $attrs = preg_replace('/background=["\']*([^"\'>\s]+)["\']*/', '', $attrs);
+ }
+
+ if (!empty($attributes)) {
+ $body = preg_replace($regexp, rtrim($attrs), $body, 1);
+ }
+
+ // handle body styles related to background image
+ if ($attributes['background-image']) {
+ // get body style
+ if (preg_match('/#'.preg_quote($cont_id, '/').'\s+\{([^}]+)}/i', $body, $m)) {
+ // get background related style
+ $regexp = '/(background-position|background-repeat)\s*:\s*([^;]+);/i';
+ if (preg_match_all($regexp, $m[1], $ma, PREG_SET_ORDER)) {
+ foreach ($ma as $style) {
+ $attributes[$style[1]] = $style[2];
+ }
+ }
+ }
}
- }
}
- }
- // make sure there's 'rcmBody' div, we need it for proper css modification
- // its name is hardcoded in rcmail_message_body() also
- else {
- $body = '<div class="' . $body_id . '">' . $body . '</div>';
- }
+ // make sure there's 'rcmBody' div, we need it for proper css modification
+ // its name is hardcoded in rcmail_message_body() also
+ else {
+ $body = '<div class="' . $body_id . '">' . $body . '</div>';
+ }
- return $body;
+ return $body;
}
-
/**
* parse link (a, link, area) attributes and set correct target
*/
function rcmail_alter_html_link($matches)
{
- global $RCMAIL;
-
- $tag = strtolower($matches[1]);
- $attrib = parse_attrib_string($matches[2]);
- $end = '>';
-
- // Remove non-printable characters in URL (#1487805)
- if ($attrib['href'])
- $attrib['href'] = preg_replace('/[\x00-\x1F]/', '', $attrib['href']);
-
- if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) {
- $tempurl = 'tmp-' . md5($attrib['href']) . '.css';
- $_SESSION['modcssurls'][$tempurl] = $attrib['href'];
- $attrib['href'] = $RCMAIL->url(array('task' => 'utils', 'action' => 'modcss', 'u' => $tempurl, 'c' => $GLOBALS['rcmail_html_container_id']));
- $end = ' />';
- }
- else if (preg_match('/^mailto:(.+)/i', $attrib['href'], $mailto)) {
- list($mailto, $url) = explode('?', html_entity_decode($mailto[1], ENT_QUOTES, 'UTF-8'), 2);
-
- $url = urldecode($url);
- $mailto = urldecode($mailto);
- $addresses = rcube_mime::decode_address_list($mailto, null, true);
- $mailto = array();
-
- // do sanity checks on recipients
- foreach ($addresses as $idx => $addr) {
- if (rcube_utils::check_email($addr['mailto'], false)) {
- $addresses[$idx] = $addr['mailto'];
- $mailto[] = $addr['string'];
- }
- else {
- unset($addresses[$idx]);
- }
- }
-
- if (!empty($addresses)) {
- $attrib['href'] = 'mailto:' . implode(',', $addresses);
- $attrib['onclick'] = sprintf(
- "return %s.command('compose','%s',this)",
- JS_OBJECT_NAME,
- JQ(implode(',', $mailto) . ($url ? "?$url" : '')));
+ global $RCMAIL;
+
+ $tag = strtolower($matches[1]);
+ $attrib = html::parse_attrib_string($matches[2]);
+ $end = '>';
+
+ // Remove non-printable characters in URL (#1487805)
+ if ($attrib['href'])
+ $attrib['href'] = preg_replace('/[\x00-\x1F]/', '', $attrib['href']);
+
+ if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) {
+ $tempurl = 'tmp-' . md5($attrib['href']) . '.css';
+ $_SESSION['modcssurls'][$tempurl] = $attrib['href'];
+ $attrib['href'] = $RCMAIL->url(array('task' => 'utils', 'action' => 'modcss', 'u' => $tempurl, 'c' => $GLOBALS['rcmail_html_container_id']));
+ $end = ' />';
}
- else {
- $attrib['href'] = '#NOP';
- $attrib['onclick'] = '';
- }
- }
- else if (empty($attrib['href']) && !$attrib['name']) {
- $attrib['href'] = './#NOP';
- $attrib['onclick'] = 'return false';
- }
- else if (!empty($attrib['href']) && $attrib['href'][0] != '#') {
- $attrib['target'] = '_blank';
- }
-
- // Better security by adding rel="noreferrer" (#1484686)
- if (($tag == 'a' || $tag == 'area') && $attrib['href'] && $attrib['href'][0] != '#') {
- $attrib['rel'] = 'noreferrer';
- }
-
- // allowed attributes for a|link|area tags
- $allow = array('href','name','target','onclick','id','class','style','title',
- 'rel','type','media','alt','coords','nohref','hreflang','shape');
-
- return "<$tag" . html::attrib_string($attrib, $allow) . $end;
-}
+ else if (preg_match('/^mailto:(.+)/i', $attrib['href'], $mailto)) {
+ list($mailto, $url) = explode('?', html_entity_decode($mailto[1], ENT_QUOTES, 'UTF-8'), 2);
+
+ $url = urldecode($url);
+ $mailto = urldecode($mailto);
+ $addresses = rcube_mime::decode_address_list($mailto, null, true);
+ $mailto = array();
+
+ // do sanity checks on recipients
+ foreach ($addresses as $idx => $addr) {
+ if (rcube_utils::check_email($addr['mailto'], false)) {
+ $addresses[$idx] = $addr['mailto'];
+ $mailto[] = $addr['string'];
+ }
+ else {
+ unset($addresses[$idx]);
+ }
+ }
+ if (!empty($addresses)) {
+ $attrib['href'] = 'mailto:' . implode(',', $addresses);
+ $attrib['onclick'] = sprintf(
+ "return %s.command('compose','%s',this)",
+ rcmail_output::JS_OBJECT_NAME,
+ rcube::JQ(implode(',', $mailto) . ($url ? "?$url" : '')));
+ }
+ else {
+ $attrib['href'] = '#NOP';
+ $attrib['onclick'] = '';
+ }
+ }
+ else if (empty($attrib['href']) && !$attrib['name']) {
+ $attrib['href'] = './#NOP';
+ $attrib['onclick'] = 'return false';
+ }
+ else if (!empty($attrib['href']) && $attrib['href'][0] != '#') {
+ $attrib['target'] = '_blank';
+ }
+
+ // Better security by adding rel="noreferrer" (#1484686)
+ if (($tag == 'a' || $tag == 'area') && $attrib['href'] && $attrib['href'][0] != '#') {
+ $attrib['rel'] = 'noreferrer';
+ }
+
+ // allowed attributes for a|link|area tags
+ $allow = array('href','name','target','onclick','id','class','style','title',
+ 'rel','type','media','alt','coords','nohref','hreflang','shape');
+
+ return "<$tag" . html::attrib_string($attrib, $allow) . $end;
+}
/**
* decode address string and re-format it as HTML links
*/
function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, $default_charset=null, $title=null)
{
- global $RCMAIL, $PRINT_MODE, $CONFIG;
-
- $a_parts = rcube_mime::decode_address_list($input, null, true, $default_charset);
-
- if (!sizeof($a_parts))
- return $input;
-
- $c = count($a_parts);
- $j = 0;
- $out = '';
- $allvalues = array();
- $show_email = $RCMAIL->config->get('message_show_email');
-
- if ($addicon && !isset($_SESSION['writeable_abook'])) {
- $_SESSION['writeable_abook'] = $RCMAIL->get_address_sources(true) ? true : false;
- }
-
- foreach ($a_parts as $part) {
- $j++;
- $name = $part['name'];
- $mailto = $part['mailto'];
- $string = $part['string'];
- $valid = check_email($mailto, false);
-
- // phishing email prevention (#1488981), e.g. "valid@email.addr <phishing@email.addr>"
- if (!$show_email && $valid && $name && $name != $mailto && strpos($name, '@')) {
- $name = '';
- }
-
- // IDNA ASCII to Unicode
- if ($name == $mailto)
- $name = rcube_idn_to_utf8($name);
- if ($string == $mailto)
- $string = rcube_idn_to_utf8($string);
- $mailto = rcube_idn_to_utf8($mailto);
-
- if ($PRINT_MODE) {
- $address = sprintf('%s &lt;%s&gt;', Q($name), Q($mailto));
- }
- else if ($valid) {
- if ($linked) {
- $attrs = array(
- 'href' => 'mailto:' . $mailto,
- 'onclick' => sprintf("return %s.command('compose','%s',this)", JS_OBJECT_NAME, JQ(format_email_recipient($mailto, $name))),
- 'class' => "rcmContactAddress",
- );
+ global $RCMAIL, $PRINT_MODE;
- if ($show_email && $name && $mailto) {
- $content = Q($name ? sprintf('%s <%s>', $name, $mailto) : $mailto);
- }
- else {
- $content = Q($name ? $name : $mailto);
- $attrs['title'] = $mailto;
- }
+ $a_parts = rcube_mime::decode_address_list($input, null, true, $default_charset);
- $address = html::a($attrs, $content);
- }
- else {
- $address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"),
- Q($name ? $name : $mailto));
- }
-
- if ($addicon && $_SESSION['writeable_abook']) {
- $address .= html::a(array(
- 'href' => "#add",
- 'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, JQ($string)),
- 'title' => rcube_label('addtoaddressbook'),
- 'class' => 'rcmaddcontact',
- ),
- html::img(array(
- 'src' => $CONFIG['skin_path'] . $addicon,
- 'alt' => "Add contact",
- )));
- }
+ if (!sizeof($a_parts)) {
+ return $input;
}
- else {
- $address = '';
- if ($name)
- $address .= Q($name);
- if ($mailto)
- $address = trim($address . ' ' . Q($name ? sprintf('<%s>', $mailto) : $mailto));
+
+ $c = count($a_parts);
+ $j = 0;
+ $out = '';
+ $allvalues = array();
+ $show_email = $RCMAIL->config->get('message_show_email');
+
+ if ($addicon && !isset($_SESSION['writeable_abook'])) {
+ $_SESSION['writeable_abook'] = $RCMAIL->get_address_sources(true) ? true : false;
}
- $address = html::span('adr', $address);
- $allvalues[] = $address;
+ foreach ($a_parts as $part) {
+ $j++;
- if (!$moreadrs)
- $out .= ($out ? ', ' : '') . $address;
+ $name = $part['name'];
+ $mailto = $part['mailto'];
+ $string = $part['string'];
+ $valid = rcube_utils::check_email($mailto, false);
- if ($max && $j == $max && $c > $j) {
- if ($linked) {
- $moreadrs = $c - $j;
- }
- else {
- $out .= '...';
- break;
- }
- }
- }
+ // phishing email prevention (#1488981), e.g. "valid@email.addr <phishing@email.addr>"
+ if (!$show_email && $valid && $name && $name != $mailto && strpos($name, '@')) {
+ $name = '';
+ }
+
+ // IDNA ASCII to Unicode
+ if ($name == $mailto)
+ $name = rcube_utils::idn_to_utf8($name);
+ if ($string == $mailto)
+ $string = rcube_utils::idn_to_utf8($string);
+ $mailto = rcube_utils::idn_to_utf8($mailto);
- if ($moreadrs) {
- if ($PRINT_MODE) {
- $out .= ' ' . html::a(array(
- 'href' => '#more',
- 'class' => 'morelink',
- 'onclick' => '$(this).hide().next().show()',
- ), Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))) .
- html::span(array('style' => 'display:none'), join(', ', $allvalues));
+ if ($PRINT_MODE) {
+ $address = sprintf('%s &lt;%s&gt;', rcube::Q($name), rcube::Q($mailto));
+ }
+ else if ($valid) {
+ if ($linked) {
+ $attrs = array(
+ 'href' => 'mailto:' . $mailto,
+ 'class' => 'rcmContactAddress',
+ 'onclick' => sprintf("return %s.command('compose','%s',this)",
+ rcmail_output::JS_OBJECT_NAME, rcube::JQ(format_email_recipient($mailto, $name))),
+ );
+
+ if ($show_email && $name && $mailto) {
+ $content = rcube::Q($name ? sprintf('%s <%s>', $name, $mailto) : $mailto);
+ }
+ else {
+ $content = rcube::Q($name ? $name : $mailto);
+ $attrs['title'] = $mailto;
+ }
+
+ $address = html::a($attrs, $content);
+ }
+ else {
+ $address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"),
+ rcube::Q($name ? $name : $mailto));
+ }
+
+ if ($addicon && $_SESSION['writeable_abook']) {
+ $address .= html::a(array(
+ 'href' => "#add",
+ 'title' => $RCMAIL->gettext('addtoaddressbook'),
+ 'class' => 'rcmaddcontact',
+ 'onclick' => sprintf("return %s.command('add-contact','%s',this)",
+ rcmail_output::JS_OBJECT_NAME, rcube::JQ($string)),
+ ),
+ html::img(array(
+ 'src' => $RCMAIL->config->get('skin_path') . $addicon,
+ 'alt' => "Add contact",
+ )));
+ }
+ }
+ else {
+ $address = '';
+ if ($name)
+ $address .= rcube::Q($name);
+ if ($mailto)
+ $address = trim($address . ' ' . rcube::Q($name ? sprintf('<%s>', $mailto) : $mailto));
+ }
+
+ $address = html::span('adr', $address);
+ $allvalues[] = $address;
+
+ if (!$moreadrs)
+ $out .= ($out ? ', ' : '') . $address;
+
+ if ($max && $j == $max && $c > $j) {
+ if ($linked) {
+ $moreadrs = $c - $j;
+ }
+ else {
+ $out .= '...';
+ break;
+ }
+ }
}
- else {
- $out .= ' ' . html::a(array(
- 'href' => '#more',
- 'class' => 'morelink',
- 'onclick' => sprintf("return %s.show_popup_dialog('%s','%s')",
- JS_OBJECT_NAME,
- JQ(join(', ', $allvalues)),
- JQ($title))
- ),
- Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs)))));
+
+ if ($moreadrs) {
+ if ($PRINT_MODE) {
+ $out .= ' ' . html::a(array(
+ 'href' => '#more',
+ 'class' => 'morelink',
+ 'onclick' => '$(this).hide().next().show()',
+ ),
+ rcube::Q($RCMAIL->gettext(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs)))))
+ . html::span(array('style' => 'display:none'), join(', ', $allvalues));
+ }
+ else {
+ $out .= ' ' . html::a(array(
+ 'href' => '#more',
+ 'class' => 'morelink',
+ 'onclick' => sprintf("return %s.show_popup_dialog('%s','%s')",
+ rcmail_output::JS_OBJECT_NAME,
+ rcube::JQ(join(', ', $allvalues)),
+ rcube::JQ($title))
+ ),
+ rcube::Q($RCMAIL->gettext(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs)))));
+ }
}
- }
- return $out;
+ return $out;
}
-
/**
* Wrap text to a given number of characters per line
* but respect the mail quotation of replies messages (>).
@@ -1592,74 +1656,79 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
*/
function rcmail_wrap_and_quote($text, $length = 72)
{
- // Rebuild the message body with a maximum of $max chars, while keeping quoted message.
- $max = max(75, $length + 8);
- $lines = preg_split('/\r?\n/', trim($text));
- $out = '';
-
- foreach ($lines as $line) {
- // don't wrap already quoted lines
- if ($line[0] == '>')
- $line = '>' . rtrim($line);
- else if (mb_strlen($line) > $max) {
- $newline = '';
- foreach (explode("\n", rc_wordwrap($line, $length - 2)) as $l) {
- if (strlen($l))
- $newline .= '> ' . $l . "\n";
- else
- $newline .= ">\n";
- }
- $line = rtrim($newline);
- }
- else
- $line = '> ' . $line;
+ // Rebuild the message body with a maximum of $max chars, while keeping quoted message.
+ $max = max(75, $length + 8);
+ $lines = preg_split('/\r?\n/', trim($text));
+ $out = '';
+
+ foreach ($lines as $line) {
+ // don't wrap already quoted lines
+ if ($line[0] == '>') {
+ $line = '>' . rtrim($line);
+ }
+ else if (mb_strlen($line) > $max) {
+ $newline = '';
+
+ foreach (explode("\n", rcube_mime::wordwrap($line, $length - 2)) as $l) {
+ if (strlen($l))
+ $newline .= '> ' . $l . "\n";
+ else
+ $newline .= ">\n";
+ }
- // Append the line
- $out .= $line . "\n";
- }
+ $line = rtrim($newline);
+ }
+ else {
+ $line = '> ' . $line;
+ }
- return rtrim($out, "\n");
-}
+ // Append the line
+ $out .= $line . "\n";
+ }
+ return rtrim($out, "\n");
+}
function rcmail_draftinfo_encode($p)
{
- $parts = array();
- foreach ($p as $key => $val)
- $parts[] = $key . '=' . ($key == 'folder' ? base64_encode($val) : $val);
+ $parts = array();
+ foreach ($p as $key => $val) {
+ $parts[] = $key . '=' . ($key == 'folder' ? base64_encode($val) : $val);
+ }
- return join('; ', $parts);
+ return join('; ', $parts);
}
-
function rcmail_draftinfo_decode($str)
{
- $info = array();
- foreach (preg_split('/;\s+/', $str) as $part) {
- list($key, $val) = explode('=', $part, 2);
- if ($key == 'folder')
- $val = base64_decode($val);
- $info[$key] = $val;
- }
-
- return $info;
-}
+ $info = array();
+
+ foreach (preg_split('/;\s+/', $str) as $part) {
+ list($key, $val) = explode('=', $part, 2);
+ if ($key == 'folder') {
+ $val = base64_decode($val);
+ }
+
+ $info[$key] = $val;
+ }
+ return $info;
+}
/**
* clear message composing settings
*/
function rcmail_compose_cleanup($id)
{
- if (!isset($_SESSION['compose_data_'.$id]))
- return;
+ if (!isset($_SESSION['compose_data_'.$id])) {
+ return;
+ }
- $rcmail = rcmail::get_instance();
- $rcmail->plugins->exec_hook('attachments_cleanup', array('group' => $id));
- $rcmail->session->remove('compose_data_'.$id);
+ $rcmail = rcmail::get_instance();
+ $rcmail->plugins->exec_hook('attachments_cleanup', array('group' => $id));
+ $rcmail->session->remove('compose_data_'.$id);
}
-
/**
* Send the MDN response
*
@@ -1670,76 +1739,78 @@ function rcmail_compose_cleanup($id)
*/
function rcmail_send_mdn($message, &$smtp_error)
{
- global $RCMAIL;
-
- if (!is_object($message) || !is_a($message, 'rcube_message'))
- $message = new rcube_message($message);
-
- if ($message->headers->mdn_to && empty($message->headers->flags['MDNSENT']) &&
- ($RCMAIL->storage->check_permflag('MDNSENT') || $RCMAIL->storage->check_permflag('*')))
- {
- $identity = rcmail_identity_select($message);
- $sender = format_email_recipient($identity['email'], $identity['name']);
- $recipient = array_shift(rcube_mime::decode_address_list(
- $message->headers->mdn_to, 1, true, $message->headers->charset));
- $mailto = $recipient['mailto'];
-
- $compose = new Mail_mime("\r\n");
-
- $compose->setParam('text_encoding', 'quoted-printable');
- $compose->setParam('html_encoding', 'quoted-printable');
- $compose->setParam('head_encoding', 'quoted-printable');
- $compose->setParam('head_charset', RCMAIL_CHARSET);
- $compose->setParam('html_charset', RCMAIL_CHARSET);
- $compose->setParam('text_charset', RCMAIL_CHARSET);
-
- // compose headers array
- $headers = array(
- 'Date' => rcmail_user_date(),
- 'From' => $sender,
- 'To' => $message->headers->mdn_to,
- 'Subject' => rcube_label('receiptread') . ': ' . $message->subject,
- 'Message-ID' => rcmail_gen_message_id(),
- 'X-Sender' => $identity['email'],
- 'References' => trim($message->headers->references . ' ' . $message->headers->messageID),
- );
+ global $RCMAIL;
+
+ if (!is_object($message) || !is_a($message, 'rcube_message')) {
+ $message = new rcube_message($message);
+ }
- if ($agent = $RCMAIL->config->get('useragent'))
- $headers['User-Agent'] = $agent;
+ if ($message->headers->mdn_to && empty($message->headers->flags['MDNSENT']) &&
+ ($RCMAIL->storage->check_permflag('MDNSENT') || $RCMAIL->storage->check_permflag('*'))
+ ) {
+ $identity = rcmail_identity_select($message);
+ $sender = format_email_recipient($identity['email'], $identity['name']);
+ $recipient = array_shift(rcube_mime::decode_address_list(
+ $message->headers->mdn_to, 1, true, $message->headers->charset));
+ $mailto = $recipient['mailto'];
+
+ $compose = new Mail_mime("\r\n");
+
+ $compose->setParam('text_encoding', 'quoted-printable');
+ $compose->setParam('html_encoding', 'quoted-printable');
+ $compose->setParam('head_encoding', 'quoted-printable');
+ $compose->setParam('head_charset', RCUBE_CHARSET);
+ $compose->setParam('html_charset', RCUBE_CHARSET);
+ $compose->setParam('text_charset', RCUBE_CHARSET);
+
+ // compose headers array
+ $headers = array(
+ 'Date' => $RCMAIL->user_date(),
+ 'From' => $sender,
+ 'To' => $message->headers->mdn_to,
+ 'Subject' => $RCMAIL->gettext('receiptread') . ': ' . $message->subject,
+ 'Message-ID' => $RCMAIL->gen_message_id(),
+ 'X-Sender' => $identity['email'],
+ 'References' => trim($message->headers->references . ' ' . $message->headers->messageID),
+ );
- if ($RCMAIL->config->get('mdn_use_from'))
- $options['mdn_use_from'] = true;
+ $report = "Final-Recipient: rfc822; {$identity['email']}\r\n"
+ . "Original-Message-ID: {$message->headers->messageID}\r\n"
+ . "Disposition: manual-action/MDN-sent-manually; displayed\r\n";
- $body = rcube_label("yourmessage") . "\r\n\r\n" .
- "\t" . rcube_label("to") . ': ' . rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset) . "\r\n" .
- "\t" . rcube_label("subject") . ': ' . $message->subject . "\r\n" .
- "\t" . rcube_label("sent") . ': ' . format_date($message->headers->date, $RCMAIL->config->get('date_long')) . "\r\n" .
- "\r\n" . rcube_label("receiptnote") . "\r\n";
+ if ($message->headers->to) {
+ $report .= "Original-Recipient: {$message->headers->to}\r\n";
+ }
- $ua = $RCMAIL->config->get('useragent', "Roundcube Webmail (Version ".RCMAIL_VERSION.")");
- $report = "Reporting-UA: $ua\r\n";
+ if ($agent = $RCMAIL->config->get('useragent')) {
+ $headers['User-Agent'] = $agent;
+ $report .= "Reporting-UA: $agent\r\n";
+ }
- if ($message->headers->to)
- $report .= "Original-Recipient: {$message->headers->to}\r\n";
+ $body = $RCMAIL->gettext("yourmessage") . "\r\n\r\n" .
+ "\t" . $RCMAIL->gettext("to") . ': ' . rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset) . "\r\n" .
+ "\t" . $RCMAIL->gettext("subject") . ': ' . $message->subject . "\r\n" .
+ "\t" . $RCMAIL->gettext("sent") . ': ' . $RCMAIL->format_date($message->headers->date, $RCMAIL->config->get('date_long')) . "\r\n" .
+ "\r\n" . $RCMAIL->gettext("receiptnote");
- $report .= "Final-Recipient: rfc822; {$identity['email']}\r\n" .
- "Original-Message-ID: {$message->headers->messageID}\r\n" .
- "Disposition: manual-action/MDN-sent-manually; displayed\r\n";
+ $compose->headers($headers);
+ $compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification'));
+ $compose->setTXTBody(rcube_mime::wordwrap($body, 75, "\r\n"));
+ $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline');
- $compose->headers($headers);
- $compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification'));
- $compose->setTXTBody(rc_wordwrap($body, 75, "\r\n"));
- $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline');
+ if ($RCMAIL->config->get('mdn_use_from')) {
+ $options['mdn_use_from'] = true;
+ }
- $sent = rcmail_deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file, $options);
+ $sent = $RCMAIL->deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file, $options);
- if ($sent) {
- $RCMAIL->storage->set_flag($message->uid, 'MDNSENT');
- return true;
+ if ($sent) {
+ $RCMAIL->storage->set_flag($message->uid, 'MDNSENT');
+ return true;
+ }
}
- }
- return false;
+ return false;
}
/**
@@ -1775,28 +1846,34 @@ function rcmail_identity_select($MESSAGE, $identities = null, $compose_mode = 'r
}
}
- $from_idx = null;
- $found_idx = null;
- $default_identity = 0; // default identity is always first on the list
+ // decode From: address
+ $from = rcube_mime::decode_address_list($MESSAGE->headers->from, null, true, $MESSAGE->headers->charset);
+ $from = array_shift($from);
+ $from['mailto'] = strtolower($from['mailto']);
+
+ $from_idx = null;
+ $found_idx = array('to' => null, 'from' => null);
+ $check_from = in_array($compose_mode, array('draft', 'edit', 'reply'));
// Select identity
foreach ($identities as $idx => $ident) {
- // use From header
- if (in_array($compose_mode, array('draft', 'edit'))) {
- if ($MESSAGE->headers->from == $ident['ident']) {
+ // use From: header when in edit/draft or reply-to-self
+ if ($check_from && $from['mailto'] == strtolower($ident['email_ascii'])) {
+ // remember first matching identity address
+ if ($found_idx['from'] === null) {
+ $found_idx['from'] = $idx;
+ }
+ // match identity name
+ if ($from['name'] && $ident['name'] && $from['name'] == $ident['name']) {
$from_idx = $idx;
break;
}
}
- // reply to yourself
- else if ($compose_mode == 'reply' && $MESSAGE->headers->from == $ident['ident']) {
- $from_idx = $idx;
- break;
- }
- // use replied message recipients
+ // use replied/forwarded message recipients
else if (($found = array_search(strtolower($ident['email_ascii']), $a_recipients)) !== false) {
- if ($found_idx === null) {
- $found_idx = $idx;
+ // remember first matching identity address
+ if ($found_idx['to'] === null) {
+ $found_idx['to'] = $idx;
}
// match identity name
if ($a_names[$found] && $ident['name'] && $a_names[$found] == $ident['name']) {
@@ -1806,22 +1883,27 @@ function rcmail_identity_select($MESSAGE, $identities = null, $compose_mode = 'r
}
}
- // If matching by name+address doesn't found any matches, get first found address (identity)
+ // If matching by name+address didn't find any matches,
+ // get first found identity (address) if any
if ($from_idx === null) {
- $from_idx = $found_idx;
+ $from_idx = $found_idx['from'] !== null ? $found_idx['from'] : $found_idx['to'];
}
// Try Return-Path
if ($from_idx === null && ($return_path = $MESSAGE->headers->others['return-path'])) {
+ $return_path = array_map('strtolower', (array) $return_path);
+
foreach ($identities as $idx => $ident) {
// Return-Path header contains an email address, but on some mailing list
// it can be e.g. <pear-dev-return-55250-local=domain.tld@lists.php.net>
// where local@domain.tld is the address we're looking for (#1489241)
- $ident1 = $ident['email_ascii'];
+ $ident1 = strtolower($ident['email_ascii']);
$ident2 = str_replace('@', '=', $ident1);
+ $ident1 = '<' . $ident1 . '>';
+ $ident2 = '-' . $ident2 . '@';
- foreach ((array)$return_path as $path) {
- if (stripos($path, $ident1) !== false || stripos($path, $ident2)) {
+ foreach ($return_path as $path) {
+ if ($path == $ident1 || stripos($path, $ident2)) {
$from_idx = $idx;
break 2;
}
@@ -1835,36 +1917,41 @@ function rcmail_identity_select($MESSAGE, $identities = null, $compose_mode = 'r
$selected = $plugin['selected'];
- return $identities[$selected !== null ? $selected : $default_identity];
+ // default identity is always first on the list
+ return $identities[$selected !== null ? $selected : 0];
}
// Fixes some content-type names
function rcmail_fix_mimetype($name)
{
- // Some versions of Outlook create garbage Content-Type:
- // application/pdf.A520491B_3BF7_494D_8855_7FAC2C6C0608
- if (preg_match('/^application\/pdf.+/', $name))
- $name = 'application/pdf';
- // treat image/pjpeg (image/pjpg, image/jpg) as image/jpeg (#1489097)
- else if (preg_match('/^image\/p?jpe?g$/', $name))
- $name = 'image/jpeg';
-
- return $name;
+ // Some versions of Outlook create garbage Content-Type:
+ // application/pdf.A520491B_3BF7_494D_8855_7FAC2C6C0608
+ if (preg_match('/^application\/pdf.+/', $name)) {
+ $name = 'application/pdf';
+ }
+ // treat image/pjpeg (image/pjpg, image/jpg) as image/jpeg (#1489097)
+ else if (preg_match('/^image\/p?jpe?g$/', $name)) {
+ $name = 'image/jpeg';
+ }
+
+ return $name;
}
// return attachment filename, handle empty filename case
function rcmail_attachment_name($attachment, $display = false)
{
+ global $RCMAIL;
+
$filename = $attachment->filename;
if ($filename === null || $filename === '') {
if ($attachment->mimetype == 'text/html') {
- $filename = rcube_label('htmlmessage');
+ $filename = $RCMAIL->gettext('htmlmessage');
}
else {
$ext = (array) rcube_mime::get_mime_extensions($attachment->mimetype);
$ext = array_shift($ext);
- $filename = rcube_label('messagepart') . ' ' . $attachment->mime_id;
+ $filename = $RCMAIL->gettext('messagepart') . ' ' . $attachment->mime_id;
if ($ext) {
$filename .= '.' . $ext;
}
@@ -1876,7 +1963,7 @@ function rcmail_attachment_name($attachment, $display = false)
// Display smart names for some known mimetypes
if ($display) {
if (preg_match('/application\/(pgp|pkcs7)-signature/i', $attachment->mimetype)) {
- $filename = rcube_label('digitalsig');
+ $filename = $RCMAIL->gettext('digitalsig');
}
}
@@ -1885,92 +1972,155 @@ function rcmail_attachment_name($attachment, $display = false)
function rcmail_search_filter($attrib)
{
- global $OUTPUT, $CONFIG;
-
- if (!strlen($attrib['id']))
- $attrib['id'] = 'rcmlistfilter';
-
- $attrib['onchange'] = JS_OBJECT_NAME.'.filter_mailbox(this.value)';
-
- // Content-Type values of messages with attachments
- // the same as in app.js:add_message_row()
- $ctypes = array('application/', 'multipart/m', 'multipart/signed', 'multipart/report');
-
- // Build search string of "with attachment" filter
- $attachment = str_repeat(' OR', count($ctypes)-1);
- foreach ($ctypes as $type) {
- $attachment .= ' HEADER Content-Type ' . rcube_imap_generic::escape($type);
- }
-
- $select_filter = new html_select($attrib);
- $select_filter->add(rcube_label('all'), 'ALL');
- $select_filter->add(rcube_label('unread'), 'UNSEEN');
- $select_filter->add(rcube_label('flagged'), 'FLAGGED');
- $select_filter->add(rcube_label('unanswered'), 'UNANSWERED');
- if (!$CONFIG['skip_deleted']) {
- $select_filter->add(rcube_label('deleted'), 'DELETED');
- $select_filter->add(rcube_label('undeleted'), 'UNDELETED');
- }
- $select_filter->add(rcube_label('withattachment'), $attachment);
- $select_filter->add(rcube_label('priority').': '.rcube_label('highest'), 'HEADER X-PRIORITY 1');
- $select_filter->add(rcube_label('priority').': '.rcube_label('high'), 'HEADER X-PRIORITY 2');
- $select_filter->add(rcube_label('priority').': '.rcube_label('normal'), 'NOT HEADER X-PRIORITY 1 NOT HEADER X-PRIORITY 2 NOT HEADER X-PRIORITY 4 NOT HEADER X-PRIORITY 5');
- $select_filter->add(rcube_label('priority').': '.rcube_label('low'), 'HEADER X-PRIORITY 4');
- $select_filter->add(rcube_label('priority').': '.rcube_label('lowest'), 'HEADER X-PRIORITY 5');
-
- $out = $select_filter->show($_SESSION['search_filter']);
-
- $OUTPUT->add_gui_object('search_filter', $attrib['id']);
-
- return $out;
+ global $RCMAIL;
+
+ if (!strlen($attrib['id']))
+ $attrib['id'] = 'rcmlistfilter';
+
+ $attrib['onchange'] = rcmail_output::JS_OBJECT_NAME.'.filter_mailbox(this.value)';
+
+ // Content-Type values of messages with attachments
+ // the same as in app.js:add_message_row()
+ $ctypes = array('application/', 'multipart/m', 'multipart/signed', 'multipart/report');
+
+ // Build search string of "with attachment" filter
+ $attachment = str_repeat(' OR', count($ctypes)-1);
+ foreach ($ctypes as $type) {
+ $attachment .= ' HEADER Content-Type ' . rcube_imap_generic::escape($type);
+ }
+
+ $select_filter = new html_select($attrib);
+ $select_filter->add($RCMAIL->gettext('all'), 'ALL');
+ $select_filter->add($RCMAIL->gettext('unread'), 'UNSEEN');
+ $select_filter->add($RCMAIL->gettext('flagged'), 'FLAGGED');
+ $select_filter->add($RCMAIL->gettext('unanswered'), 'UNANSWERED');
+ if (!$RCMAIL->config->get('skip_deleted')) {
+ $select_filter->add($RCMAIL->gettext('deleted'), 'DELETED');
+ $select_filter->add($RCMAIL->gettext('undeleted'), 'UNDELETED');
+ }
+ $select_filter->add($RCMAIL->gettext('withattachment'), $attachment);
+ $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('highest'), 'HEADER X-PRIORITY 1');
+ $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('high'), 'HEADER X-PRIORITY 2');
+ $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('normal'), 'NOT HEADER X-PRIORITY 1 NOT HEADER X-PRIORITY 2 NOT HEADER X-PRIORITY 4 NOT HEADER X-PRIORITY 5');
+ $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('low'), 'HEADER X-PRIORITY 4');
+ $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('lowest'), 'HEADER X-PRIORITY 5');
+
+ $out = $select_filter->show($_SESSION['search_filter']);
+
+ $RCMAIL->output->add_gui_object('search_filter', $attrib['id']);
+
+ return $out;
}
function rcmail_message_error($uid=null)
{
- global $RCMAIL;
+ global $RCMAIL;
- // Set env variables for messageerror.html template
- if ($RCMAIL->action == 'show') {
- $mbox_name = $RCMAIL->storage->get_folder();
- $RCMAIL->output->set_env('mailbox', $mbox_name);
- $RCMAIL->output->set_env('uid', null);
- }
- // display error message
- $RCMAIL->output->show_message('messageopenerror', 'error');
- // ... display message error page
- $RCMAIL->output->send('messageerror');
+ // Set env variables for messageerror.html template
+ if ($RCMAIL->action == 'show') {
+ $mbox_name = $RCMAIL->storage->get_folder();
+
+ $RCMAIL->output->set_env('mailbox', $mbox_name);
+ $RCMAIL->output->set_env('uid', null);
+ }
+
+ // display error message
+ $RCMAIL->output->show_message('messageopenerror', 'error');
+ // ... display message error page
+ $RCMAIL->output->send('messageerror');
}
function rcmail_message_import_form($attrib = array())
{
- global $OUTPUT;
-
- // set defaults
- $attrib += array('id' => 'rcmImportform', 'buttons' => 'yes');
-
- // Get filesize, enable upload progress bar
- $max_filesize = rcube_upload_init();
-
- $button = new html_inputfield(array('type' => 'button'));
- $fileinput = new html_inputfield(array(
- 'type' => 'file',
- 'name' => '_file[]',
- 'multiple' => 'multiple',
- 'accept' => ".eml, .mbox, message/rfc822, text/*",
- ));
-
- $out = html::div($attrib,
- $OUTPUT->form_tag(array('id' => $attrib['id'].'Frm', 'method' => 'post', 'enctype' => 'multipart/form-data'),
- html::tag('input', array('type' => 'hidden', 'name' => '_unlock', 'value' => '')) .
- html::div(null, $fileinput->show()) .
- html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) .
- (get_boolean($attrib['buttons']) ? html::div('buttons',
- $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' .
- $button->show(rcube_label('upload'), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('import-messages', this.form)"))
- ) : '')
- )
- );
-
- $OUTPUT->add_gui_object('importform', $attrib['id'].'Frm');
- return $out;
+ global $RCMAIL;
+
+ // set defaults
+ $attrib += array('id' => 'rcmImportform', 'buttons' => 'yes');
+
+ // Get filesize, enable upload progress bar
+ $max_filesize = $RCMAIL->upload_init();
+
+ $button = new html_inputfield(array('type' => 'button'));
+ $fileinput = new html_inputfield(array(
+ 'type' => 'file',
+ 'name' => '_file[]',
+ 'multiple' => 'multiple',
+ 'accept' => ".eml, .mbox, message/rfc822, text/*",
+ ));
+
+ $content = html::tag('input', array('type' => 'hidden', 'name' => '_unlock', 'value' => ''))
+ . html::div(null, $fileinput->show())
+ . html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))));
+
+ if (rcube_utils::get_boolean($attrib['buttons'])) {
+ $content .= html::div('buttons',
+ $button->show($RCMAIL->gettext('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()"))
+ . ' ' .
+ $button->show($RCMAIL->gettext('upload'), array(
+ 'class' => 'button mainaction',
+ 'onclick' => rcmail_output::JS_OBJECT_NAME . ".command('import-messages', this.form)"
+ )));
+ }
+
+ $out = $RCMAIL->output->form_tag(array(
+ 'id' => $attrib['id'].'Frm',
+ 'method' => 'post',
+ 'enctype' => 'multipart/form-data'
+ ),
+ $content);
+
+ $RCMAIL->output->add_gui_object('importform', $attrib['id'].'Frm');
+
+ return html::div($attrib, $out);
+}
+
+/**
+ * Add groups from the given address source to the address book widget
+ */
+function rcmail_compose_contact_groups($abook, $source_id, $search = null, $search_mode = 0)
+{
+ global $RCMAIL, $OUTPUT;
+
+ $jsresult = array();
+ foreach ($abook->list_groups($search, $search_mode) as $group) {
+ $abook->reset();
+ $abook->set_group($group['ID']);
+ $group_prop = $abook->get_group($group['ID']);
+
+ // group (distribution list) with email address(es)
+ if ($group_prop['email']) {
+ foreach ((array)$group_prop['email'] as $email) {
+ $row_id = 'G'.$group['ID'];
+ $jsresult[$row_id] = format_email_recipient($email, $group['name']);
+ $OUTPUT->command('add_contact_row', $row_id, array(
+ 'contactgroup' => html::span(array('title' => $email), rcube::Q($group['name']))), 'group');
+ }
+ }
+ // make virtual groups clickable to list their members
+ else if ($group_prop['virtual']) {
+ $row_id = 'G'.$group['ID'];
+ $OUTPUT->command('add_contact_row', $row_id, array(
+ 'contactgroup' => html::a(array(
+ 'href' => '#list',
+ 'rel' => $group['ID'],
+ 'title' => $RCMAIL->gettext('listgroup'),
+ 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)",
+ rcmail_output::JS_OBJECT_NAME, $source_id, $group['ID']),
+ ), rcube::Q($group['name']) . '&nbsp;' . html::span('action', '&raquo;'))),
+ 'group',
+ array('ID' => $group['ID'], 'name' => $group['name'], 'virtual' => true));
+ }
+ // show group with count
+ else if (($result = $abook->count()) && $result->count) {
+ $row_id = 'E'.$group['ID'];
+ $jsresult[$row_id] = $group['name'];
+ $OUTPUT->command('add_contact_row', $row_id, array(
+ 'contactgroup' => rcube::Q($group['name'] . ' (' . intval($result->count) . ')')), 'group');
+ }
+ }
+
+ $abook->reset();
+ $abook->set_group(0);
+
+ return $jsresult;
}
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index e0c4e2911..8f869c67c 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -5,7 +5,7 @@
| program/steps/mail/get.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2011, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -22,15 +22,15 @@
// show loading page
if (!empty($_GET['_preload'])) {
- $url = preg_replace('/([&?]+)_preload=/', '\\1_mimewarning=1&_embed=', $_SERVER['REQUEST_URI']);
- $message = rcube_label('loadingdata');
+ $url = preg_replace('/([&?]+)_preload=/', '\\1_mimewarning=1&_embed=', $_SERVER['REQUEST_URI']);
+ $message = $RCMAIL->gettext('loadingdata');
- header('Content-Type: text/html; charset=' . RCMAIL_CHARSET);
- print "<html>\n<head>\n"
- . '<meta http-equiv="refresh" content="0; url='.Q($url).'">' . "\n"
- . '<meta http-equiv="content-type" content="text/html; charset='.RCMAIL_CHARSET.'">' . "\n"
+ header('Content-Type: text/html; charset=' . RCUBE_CHARSET);
+ print "<html>\n<head>\n"
+ . '<meta http-equiv="refresh" content="0; url='.rcube::Q($url).'">' . "\n"
+ . '<meta http-equiv="content-type" content="text/html; charset='.RCUBE_CHARSET.'">' . "\n"
. "</head>\n<body>\n$message\n</body>\n</html>";
- exit;
+ exit;
}
ob_end_clean();
@@ -38,353 +38,361 @@ ob_end_clean();
// similar code as in program/steps/mail/show.inc
if (!empty($_GET['_uid'])) {
- $uid = get_input_value('_uid', RCUBE_INPUT_GET);
- $RCMAIL->config->set('prefer_html', true);
- $MESSAGE = new rcube_message($uid);
+ $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET);
+ $RCMAIL->config->set('prefer_html', true);
+ $MESSAGE = new rcube_message($uid);
}
// check connection status
check_storage_status();
-$part_id = get_input_value('_part', RCUBE_INPUT_GPC);
+$part_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_GPC);
// show part page
if (!empty($_GET['_frame'])) {
- if ($part_id && ($part = $MESSAGE->mime_parts[$part_id])) {
- $filename = rcmail_attachment_name($part);
- $OUTPUT->set_pagetitle($filename);
- }
-
- // register UI objects
- $OUTPUT->add_handlers(array(
- 'messagepartframe' => 'rcmail_message_part_frame',
- 'messagepartcontrols' => 'rcmail_message_part_controls',
- ));
-
- $OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
- $OUTPUT->set_env('uid', $uid);
- $OUTPUT->set_env('part', $part_id);
- $OUTPUT->set_env('filename', $filename);
-
- $OUTPUT->send('messagepart');
- exit;
+ if ($part_id && ($part = $MESSAGE->mime_parts[$part_id])) {
+ $filename = rcmail_attachment_name($part);
+ $OUTPUT->set_pagetitle($filename);
+ }
+
+ // register UI objects
+ $OUTPUT->add_handlers(array(
+ 'messagepartframe' => 'rcmail_message_part_frame',
+ 'messagepartcontrols' => 'rcmail_message_part_controls',
+ ));
+
+ $OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
+ $OUTPUT->set_env('uid', $uid);
+ $OUTPUT->set_env('part', $part_id);
+ $OUTPUT->set_env('filename', $filename);
+
+ $OUTPUT->send('messagepart');
+ exit;
}
// render thumbnail of an image attachment
else if ($_GET['_thumb']) {
- $pid = get_input_value('_part', RCUBE_INPUT_GET);
- if ($part = $MESSAGE->mime_parts[$pid]) {
- $thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240);
- $temp_dir = $RCMAIL->config->get('temp_dir');
- list(,$ext) = explode('/', $part->mimetype);
- $mimetype = $part->mimetype;
- $file_ident = $MESSAGE->headers->messageID . ':' . $part->mime_id . ':' . $part->size . ':' . $part->mimetype;
- $cache_basename = $temp_dir . '/' . md5($file_ident . ':' . $RCMAIL->user->ID . ':' . $thumbnail_size);
- $cache_file = $cache_basename . '.' . $ext;
-
- // render thumbnail image if not done yet
- if (!is_file($cache_file)) {
- $fp = fopen(($orig_name = $cache_basename . '.orig.' . $ext), 'w');
- $MESSAGE->get_part_content($part->mime_id, $fp);
- fclose($fp);
-
- $image = new rcube_image($orig_name);
- if ($imgtype = $image->resize($thumbnail_size, $cache_file, true)) {
- $mimetype = 'image/' . $imgtype;
- unlink($orig_name);
- }
- else {
- rename($orig_name, $cache_file);
- }
- }
+ $pid = rcube_utils::get_input_value('_part', rcube_utils::INPUT_GET);
+ if ($part = $MESSAGE->mime_parts[$pid]) {
+ $thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240);
+ $temp_dir = $RCMAIL->config->get('temp_dir');
+ list(,$ext) = explode('/', $part->mimetype);
+ $mimetype = $part->mimetype;
+ $file_ident = $MESSAGE->headers->messageID . ':' . $part->mime_id . ':' . $part->size . ':' . $part->mimetype;
+ $cache_basename = $temp_dir . '/' . md5($file_ident . ':' . $RCMAIL->user->ID . ':' . $thumbnail_size);
+ $cache_file = $cache_basename . '.' . $ext;
+
+ // render thumbnail image if not done yet
+ if (!is_file($cache_file)) {
+ if ($fp = fopen(($orig_name = $cache_basename . '.orig.' . $ext), 'w')) {
+ $MESSAGE->get_part_content($part->mime_id, $fp);
+ fclose($fp);
+
+ $image = new rcube_image($orig_name);
+ if ($imgtype = $image->resize($thumbnail_size, $cache_file, true)) {
+ $mimetype = 'image/' . $imgtype;
+ unlink($orig_name);
+ }
+ else {
+ rename($orig_name, $cache_file);
+ }
+ }
+ }
- if (is_file($cache_file)) {
- header('Content-Type: ' . $mimetype);
- readfile($cache_file);
+ if (is_file($cache_file)) {
+ header('Content-Type: ' . $mimetype);
+ readfile($cache_file);
+ }
}
- }
- exit;
+ exit;
}
else if (strlen($part_id)) {
- if ($part = $MESSAGE->mime_parts[$part_id]) {
- $mimetype = rcmail_fix_mimetype($part->mimetype);
-
- // allow post-processing of the message body
- $plugin = $RCMAIL->plugins->exec_hook('message_part_get',
- array('uid' => $MESSAGE->uid, 'id' => $part->mime_id, 'mimetype' => $mimetype, 'part' => $part, 'download' => !empty($_GET['_download'])));
-
- if ($plugin['abort'])
- exit;
-
- // overwrite modified vars from plugin
- $mimetype = $plugin['mimetype'];
- $extensions = rcube_mime::get_mime_extensions($mimetype);
-
- if ($plugin['body'])
- $part->body = $plugin['body'];
-
-
- // compare file mimetype with the stated content-type headers and file extension to avoid malicious operations
- if (!empty($_REQUEST['_embed']) && empty($_REQUEST['_nocheck'])) {
- $file_extension = strtolower(pathinfo($part->filename, PATHINFO_EXTENSION));
-
- // 1. compare filename suffix with expected suffix derived from mimetype
- $valid = $file_extension && in_array($file_extension, (array)$extensions) || !empty($_REQUEST['_mimeclass']);
-
- // 2. detect the real mimetype of the attachment part and compare it with the stated mimetype and filename extension
- if ($valid || !$file_extension || $mimetype == 'application/octet-stream' || stripos($mimetype, 'text/') === 0) {
- if ($part->body) // part body is already loaded
- $body = $part->body;
- else if ($part->size && $part->size < 1024*1024) // load the entire part if it's small enough
- $body = $part->body = $MESSAGE->get_part_content($part->mime_id);
- else // fetch the first 2K of the message part
- $body = $MESSAGE->get_part_content($part->mime_id, null, true, 2048);
-
- // detect message part mimetype
- $real_mimetype = rcube_mime::file_content_type($body, $part->filename, $mimetype, true, true);
- list($real_ctype_primary, $real_ctype_secondary) = explode('/', $real_mimetype);
-
- // accept text/plain with any extension
- if ($real_mimetype == 'text/plain' && $real_mimetype == $mimetype)
- $file_extension = 'txt';
-
- // ignore differences in text/* mimetypes. Filetype detection isn't very reliable here
- if ($real_ctype_primary == 'text' && strpos($mimetype, $real_ctype_primary) === 0)
- $real_mimetype = $mimetype;
-
- // get valid file extensions
- $extensions = rcube_mime::get_mime_extensions($real_mimetype);
- $valid_extension = (!$file_extension || in_array($file_extension, (array)$extensions));
-
- // ignore filename extension if mimeclass matches (#1489029)
- if (!empty($_REQUEST['_mimeclass']) && $real_ctype_primary == $_REQUEST['_mimeclass'])
- $valid_extension = true;
-
- // fix mimetype for images wrongly declared as octet-stream
- if ($mimetype == 'application/octet-stream' && strpos($real_mimetype, 'image/') === 0 && $valid_extension)
- $mimetype = $real_mimetype;
-
- $valid = ($real_mimetype == $mimetype && $valid_extension);
- }
- else {
- $real_mimetype = $mimetype;
- }
-
- // show warning if validity checks failed
- if (!$valid) {
- // send blocked.gif for expected images
- if (empty($_REQUEST['_mimewarning']) && strpos($mimetype, 'image/') === 0) {
- // Do not cache. Failure might be the result of a misconfiguration, thus real content should be returned once fixed.
- $OUTPUT->nocacheing_headers();
- header("Content-Type: image/gif");
- header("Content-Transfer-Encoding: binary");
- readfile(INSTALL_PATH . 'program/resources/blocked.gif');
- }
- else { // html warning with a button to load the file anyway
- $OUTPUT = new rcmail_html_page();
- $OUTPUT->write(html::tag('html', null, html::tag('body', 'embed',
- html::div(array('class' => 'rcmail-inline-message rcmail-inline-warning'),
- rcube_label(array(
- 'name' => 'attachmentvalidationerror',
- 'vars' => array(
- 'expected' => $mimetype . ($file_extension ? " (.$file_extension)" : ''),
- 'detected' => $real_mimetype . ($extensions[0] ? " (.$extensions[0])" : ''),
- )
- )) .
- html::p(array('class' => 'rcmail-inline-buttons'),
- html::tag('button',
- array('onclick' => "location.href='" . $RCMAIL->url(array_merge($_GET, array('_nocheck' => 1))) . "'"),
- rcube_label('showanyway')))
- )
- )));
+ if ($part = $MESSAGE->mime_parts[$part_id]) {
+ $mimetype = rcmail_fix_mimetype($part->mimetype);
+
+ // allow post-processing of the message body
+ $plugin = $RCMAIL->plugins->exec_hook('message_part_get', array(
+ 'uid' => $MESSAGE->uid,
+ 'id' => $part->mime_id,
+ 'mimetype' => $mimetype,
+ 'part' => $part,
+ 'download' => !empty($_GET['_download'])
+ ));
+
+ if ($plugin['abort']) {
+ exit;
}
- exit;
- }
- }
+ // overwrite modified vars from plugin
+ $mimetype = $plugin['mimetype'];
+ $extensions = rcube_mime::get_mime_extensions($mimetype);
- // TIFF to JPEG conversion, if needed
- $tiff_support = !empty($_SESSION['browser_caps']) && !empty($_SESSION['browser_caps']['tif']);
- if (!empty($_REQUEST['_embed']) && !$tiff_support
- && $RCMAIL->config->get('im_convert_path')
- && rcmail_part_image_type($part) == 'image/tiff'
- ) {
- $tiff2jpeg = true;
- $mimetype = 'image/jpeg';
- }
-
+ if ($plugin['body']) {
+ $part->body = $plugin['body'];
+ }
- $browser = $RCMAIL->output->browser;
- list($ctype_primary, $ctype_secondary) = explode('/', $mimetype);
+ // compare file mimetype with the stated content-type headers and file extension to avoid malicious operations
+ if (!empty($_REQUEST['_embed']) && empty($_REQUEST['_nocheck'])) {
+ $file_extension = strtolower(pathinfo($part->filename, PATHINFO_EXTENSION));
+
+ // 1. compare filename suffix with expected suffix derived from mimetype
+ $valid = $file_extension && in_array($file_extension, (array)$extensions) || !empty($_REQUEST['_mimeclass']);
+
+ // 2. detect the real mimetype of the attachment part and compare it with the stated mimetype and filename extension
+ if ($valid || !$file_extension || $mimetype == 'application/octet-stream' || stripos($mimetype, 'text/') === 0) {
+ if ($part->body) // part body is already loaded
+ $body = $part->body;
+ else if ($part->size && $part->size < 1024*1024) // load the entire part if it's small enough
+ $body = $part->body = $MESSAGE->get_part_content($part->mime_id);
+ else // fetch the first 2K of the message part
+ $body = $MESSAGE->get_part_content($part->mime_id, null, true, 2048);
+
+ // detect message part mimetype
+ $real_mimetype = rcube_mime::file_content_type($body, $part->filename, $mimetype, true, true);
+ list($real_ctype_primary, $real_ctype_secondary) = explode('/', $real_mimetype);
+
+ // accept text/plain with any extension
+ if ($real_mimetype == 'text/plain' && $real_mimetype == $mimetype) {
+ $file_extension = 'txt';
+ }
+
+ // ignore differences in text/* mimetypes. Filetype detection isn't very reliable here
+ if ($real_ctype_primary == 'text' && strpos($mimetype, $real_ctype_primary) === 0) {
+ $real_mimetype = $mimetype;
+ }
+
+ // get valid file extensions
+ $extensions = rcube_mime::get_mime_extensions($real_mimetype);
+ $valid_extension = (!$file_extension || in_array($file_extension, (array)$extensions));
+
+ // ignore filename extension if mimeclass matches (#1489029)
+ if (!empty($_REQUEST['_mimeclass']) && $real_ctype_primary == $_REQUEST['_mimeclass']) {
+ $valid_extension = true;
+ }
+
+ // fix mimetype for images wrongly declared as octet-stream
+ if ($mimetype == 'application/octet-stream' && strpos($real_mimetype, 'image/') === 0 && $valid_extension) {
+ $mimetype = $real_mimetype;
+ }
+
+ $valid = ($real_mimetype == $mimetype && $valid_extension);
+ }
+ else {
+ $real_mimetype = $mimetype;
+ }
+
+ // show warning if validity checks failed
+ if (!$valid) {
+ // send blocked.gif for expected images
+ if (empty($_REQUEST['_mimewarning']) && strpos($mimetype, 'image/') === 0) {
+ // Do not cache. Failure might be the result of a misconfiguration, thus real content should be returned once fixed.
+ $OUTPUT->nocacheing_headers();
+ header("Content-Type: image/gif");
+ header("Content-Transfer-Encoding: binary");
+ readfile(INSTALL_PATH . 'program/resources/blocked.gif');
+ }
+ else { // html warning with a button to load the file anyway
+ $OUTPUT = new rcmail_html_page();
+ $OUTPUT->write(html::tag('html', null, html::tag('body', 'embed',
+ html::div(array('class' => 'rcmail-inline-message rcmail-inline-warning'),
+ $RCMAIL->gettext(array(
+ 'name' => 'attachmentvalidationerror',
+ 'vars' => array(
+ 'expected' => $mimetype . ($file_extension ? " (.$file_extension)" : ''),
+ 'detected' => $real_mimetype . ($extensions[0] ? " (.$extensions[0])" : ''),
+ )
+ ))
+ . html::p(array('class' => 'rcmail-inline-buttons'),
+ html::tag('button', array(
+ 'onclick' => "location.href='" . $RCMAIL->url(array_merge($_GET, array('_nocheck' => 1))) . "'"
+ ),
+ $RCMAIL->gettext('showanyway'))
+ )
+ ))));
+ }
+
+ exit;
+ }
+ }
- // send download headers
- if ($plugin['download']) {
- header("Content-Type: application/octet-stream");
- if ($browser->ie)
- header("Content-Type: application/force-download");
- }
- else if ($ctype_primary == 'text') {
- header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCMAIL_CHARSET));
- }
- else {
- header("Content-Type: $mimetype");
- header("Content-Transfer-Encoding: binary");
- }
- // deliver part content
- if ($ctype_primary == 'text' && $ctype_secondary == 'html' && empty($plugin['download'])) {
- // Check if we have enough memory to handle the message in it
- // #1487424: we need up to 10x more memory than the body
- if (!rcmail_mem_check($part->size * 10)) {
- $out = '<body>' . rcube_label('messagetoobig'). ' '
- . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id
- .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), rcube_label('download')) . '</body></html>';
- }
- else {
- // get part body if not available
- if (!$part->body)
- $part->body = $MESSAGE->get_part_content($part->mime_id);
-
- // show images?
- rcmail_check_safe($MESSAGE);
-
- // render HTML body
- $out = rcmail_print_body($part, array('safe' => $MESSAGE->is_safe, 'inline_html' => false));
-
- // insert remote objects warning into HTML body
- if ($REMOTE_OBJECTS) {
- $body_start = 0;
- if ($body_pos = strpos($out, '<body')) {
- $body_start = strpos($out, '>', $body_pos) + 1;
- }
- $out = substr($out, 0, $body_start) .
- html::div(array('class' => 'rcmail-inline-message rcmail-inline-warning'),
- Q(rcube_label('blockedimages')) . '&nbsp;' .
- html::tag('button',
- array('onclick' => "location.href='" . $RCMAIL->url(array_merge($_GET, array('_safe' => 1))) . "'"),
- Q(rcube_label('showimages')))
- ) .
- substr($out, $body_start);
+ // TIFF to JPEG conversion, if needed
+ $tiff_support = !empty($_SESSION['browser_caps']) && !empty($_SESSION['browser_caps']['tif']);
+ if (!empty($_REQUEST['_embed']) && !$tiff_support
+ && $RCMAIL->config->get('im_convert_path')
+ && rcmail_part_image_type($part) == 'image/tiff'
+ ) {
+ $tiff2jpeg = true;
+ $mimetype = 'image/jpeg';
}
- }
- // check connection status
- if ($part->size && empty($part->body)) {
- check_storage_status();
- }
- $OUTPUT = new rcube_html_page();
- $OUTPUT->write($out);
- }
- else {
- // don't kill the connection if download takes more than 30 sec.
- @set_time_limit(0);
-
- $filename = rcmail_attachment_name($part);
-
- if ($browser->ie && $browser->ver < 7)
- $filename = rawurlencode(abbreviate_string($filename, 55));
- else if ($browser->ie)
- $filename = rawurlencode($filename);
- else
- $filename = addcslashes($filename, '"');
-
- $disposition = !empty($plugin['download']) ? 'attachment' : 'inline';
-
- // Workaround for nasty IE bug (#1488844)
- // If Content-Disposition header contains string "attachment" e.g. in filename
- // IE handles data as attachment not inline
- if ($disposition == 'inline' && $browser->ie && $browser->ver < 9) {
- $filename = str_ireplace('attachment', 'attach', $filename);
- }
-
- // add filename extension if missing
- if (!pathinfo($filename, PATHINFO_EXTENSION) && ($extensions = rcube_mime::get_mime_extensions($mimetype))) {
- $filename .= '.' . $extensions[0];
- }
-
- header("Content-Disposition: $disposition; filename=\"$filename\"");
-
- // handle tiff to jpeg conversion
- if (!empty($tiff2jpeg)) {
- $temp_dir = unslashify($RCMAIL->config->get('temp_dir'));
- $file_path = tempnam($temp_dir, 'rcmAttmnt');
-
- // write content to temp file
- if ($part->body) {
- $saved = file_put_contents($file_path, $part->body);
- }
- else if ($part->size) {
- $fd = fopen($file_path, 'w');
- $saved = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $fd);
- fclose($fd);
- }
+ $browser = $RCMAIL->output->browser;
+ list($ctype_primary, $ctype_secondary) = explode('/', $mimetype);
- // convert image to jpeg and send it to the browser
- if ($saved) {
- $image = new rcube_image($file_path);
- if ($image->convert(rcube_image::TYPE_JPG, $file_path)) {
- header("Content-Length: " . filesize($file_path));
- readfile($file_path);
- }
- unlink($file_path);
- }
- }
- // do content filtering to avoid XSS through fake images
- else if (!empty($_REQUEST['_embed']) && $browser->ie && $browser->ver <= 8) {
- if ($part->body) {
- echo preg_match('/<(script|iframe|object)/i', $part->body) ? '' : $part->body;
- $sent = true;
- }
- else if ($part->size) {
- $stdout = fopen('php://output', 'w');
- stream_filter_register('rcube_content', 'rcube_content_filter') or die('Failed to register content filter');
- stream_filter_append($stdout, 'rcube_content');
- $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout);
+ if (!$plugin['download'] && $ctype_primary == 'text') {
+ header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCUBE_CHARSET));
}
- }
- // send part as-it-is
- else {
- if ($part->body) {
- header("Content-Length: " . strlen($part->body));
- echo $part->body;
- $sent = true;
+ else {
+ header("Content-Type: $mimetype");
+ header("Content-Transfer-Encoding: binary");
}
- else if ($part->size) {
- if ($size = (int)$part->d_parameters['size']) {
- header("Content-Length: $size");
- }
- // 8th argument disables re-formatting of text/* parts (#1489267)
- $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true, null, false, 0, false);
+ // deliver part content
+ if ($ctype_primary == 'text' && $ctype_secondary == 'html' && empty($plugin['download'])) {
+ // Check if we have enough memory to handle the message in it
+ // #1487424: we need up to 10x more memory than the body
+ if (!rcube_utils::mem_check($part->size * 10)) {
+ $out = '<body>' . $RCMAIL->gettext('messagetoobig'). ' '
+ . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id
+ .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download')) . '</body></html>';
+ }
+ else {
+ // get part body if not available
+ if (!$part->body) {
+ $part->body = $MESSAGE->get_part_content($part->mime_id);
+ }
+
+ // show images?
+ rcmail_check_safe($MESSAGE);
+
+ // render HTML body
+ $out = rcmail_print_body($part, array('safe' => $MESSAGE->is_safe, 'inline_html' => false));
+
+ // insert remote objects warning into HTML body
+ if ($REMOTE_OBJECTS) {
+ $body_start = 0;
+ if ($body_pos = strpos($out, '<body')) {
+ $body_start = strpos($out, '>', $body_pos) + 1;
+ }
+
+ $out = substr($out, 0, $body_start)
+ . html::div(array('class' => 'rcmail-inline-message rcmail-inline-warning'),
+ rcube::Q($RCMAIL->gettext('blockedimages')) . '&nbsp;' .
+ html::tag('button',
+ array('onclick' => "location.href='" . $RCMAIL->url(array_merge($_GET, array('_safe' => 1))) . "'"),
+ rcube::Q($RCMAIL->gettext('showimages')))
+ )
+ . substr($out, $body_start);
+ }
+ }
+
+ // check connection status
+ if ($part->size && empty($part->body)) {
+ check_storage_status();
+ }
+
+ $OUTPUT = new rcmail_html_page();
+ $OUTPUT->write($out);
+ }
+ else {
+ // don't kill the connection if download takes more than 30 sec.
+ @set_time_limit(0);
+
+ $filename = rcmail_attachment_name($part);
+
+ if ($browser->ie && $browser->ver < 7)
+ $filename = rawurlencode(abbreviate_string($filename, 55));
+ else if ($browser->ie)
+ $filename = rawurlencode($filename);
+ else
+ $filename = addcslashes($filename, '"');
+
+ $disposition = !empty($plugin['download']) ? 'attachment' : 'inline';
+
+ // Workaround for nasty IE bug (#1488844)
+ // If Content-Disposition header contains string "attachment" e.g. in filename
+ // IE handles data as attachment not inline
+ if ($disposition == 'inline' && $browser->ie && $browser->ver < 9) {
+ $filename = str_ireplace('attachment', 'attach', $filename);
+ }
+
+ // add filename extension if missing
+ if (!pathinfo($filename, PATHINFO_EXTENSION) && ($extensions = rcube_mime::get_mime_extensions($mimetype))) {
+ $filename .= '.' . $extensions[0];
+ }
+
+ header("Content-Disposition: $disposition; filename=\"$filename\"");
+
+ // handle tiff to jpeg conversion
+ if (!empty($tiff2jpeg)) {
+ $temp_dir = unslashify($RCMAIL->config->get('temp_dir'));
+ $file_path = tempnam($temp_dir, 'rcmAttmnt');
+
+ // write content to temp file
+ if ($part->body) {
+ $saved = file_put_contents($file_path, $part->body);
+ }
+ else if ($part->size) {
+ $fd = fopen($file_path, 'w');
+ $saved = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $fd);
+ fclose($fd);
+ }
+
+ // convert image to jpeg and send it to the browser
+ if ($saved) {
+ $image = new rcube_image($file_path);
+ if ($image->convert(rcube_image::TYPE_JPG, $file_path)) {
+ header("Content-Length: " . filesize($file_path));
+ readfile($file_path);
+ }
+ unlink($file_path);
+ }
+ }
+ // do content filtering to avoid XSS through fake images
+ else if (!empty($_REQUEST['_embed']) && $browser->ie && $browser->ver <= 8) {
+ if ($part->body) {
+ echo preg_match('/<(script|iframe|object)/i', $part->body) ? '' : $part->body;
+ $sent = true;
+ }
+ else if ($part->size) {
+ $stdout = fopen('php://output', 'w');
+ stream_filter_register('rcube_content', 'rcube_content_filter') or die('Failed to register content filter');
+ stream_filter_append($stdout, 'rcube_content');
+ $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout);
+ }
+ }
+ // send part as-it-is
+ else {
+ if ($part->body) {
+ header("Content-Length: " . strlen($part->body));
+ echo $part->body;
+ $sent = true;
+ }
+ else if ($part->size) {
+ if ($size = (int)$part->d_parameters['size']) {
+ header("Content-Length: $size");
+ }
+
+ // 8th argument disables re-formatting of text/* parts (#1489267)
+ $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true, null, false, 0, false);
+ }
+ }
+
+ // check connection status
+ if ($part->size && !$sent) {
+ check_storage_status();
+ }
}
- }
- // check connection status
- if ($part->size && !$sent) {
- check_storage_status();
- }
+ exit;
}
-
- exit;
- }
}
-
// print message
else {
- // send correct headers for content type
- header("Content-Type: text/html");
+ // send correct headers for content type
+ header("Content-Type: text/html");
- $cont = "<html>\n<head><title></title>\n</head>\n<body>";
- $cont .= rcmail_message_body(array());
- $cont .= "\n</body>\n</html>";
+ $cont = "<html>\n<head><title></title>\n</head>\n<body>";
+ $cont .= rcmail_message_body(array());
+ $cont .= "\n</body>\n</html>";
- $OUTPUT = new rcube_html_page();
- $OUTPUT->write($cont);
+ $OUTPUT = new rcmail_html_page();
+ $OUTPUT->write($cont);
- exit;
+ exit;
}
@@ -415,7 +423,7 @@ function check_storage_status()
header('Location: ' . $_SERVER['REQUEST_URI'] . '&_redirected=1');
}
else {
- raise_error(array(
+ rcube::raise_error(array(
'code' => 500, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => 'Unable to get/display message part. IMAP connection error'),
@@ -434,7 +442,7 @@ function rcmail_message_part_controls($attrib)
{
global $MESSAGE, $RCMAIL;
- $part = asciiwords(get_input_value('_part', RCUBE_INPUT_GPC));
+ $part = asciiwords(rcube_utils::get_input_value('_part', rcube_utils::INPUT_GPC));
if (!is_object($MESSAGE) || !is_array($MESSAGE->parts)
|| !($_GET['_uid'] && $_GET['_part']) || !$MESSAGE->mime_parts[$part]
) {
@@ -444,14 +452,14 @@ function rcmail_message_part_controls($attrib)
$part = $MESSAGE->mime_parts[$part];
$table = new html_table(array('cols' => 2));
- $table->add('title', Q(rcube_label('namex')).':');
- $table->add('header', Q(rcmail_attachment_name($part)));
+ $table->add('title', rcube::Q($RCMAIL->gettext('namex')).':');
+ $table->add('header', rcube::Q(rcmail_attachment_name($part)));
- $table->add('title', Q(rcube_label('type')).':');
- $table->add('header', Q($part->mimetype));
+ $table->add('title', rcube::Q($RCMAIL->gettext('type')).':');
+ $table->add('header', rcube::Q($part->mimetype));
- $table->add('title', Q(rcube_label('size')).':');
- $table->add('header', Q($RCMAIL->message_part_size($part)));
+ $table->add('title', rcube::Q($RCMAIL->gettext('size')).':');
+ $table->add('header', rcube::Q($RCMAIL->message_part_size($part)));
return $table->show($attrib);
}
@@ -463,7 +471,7 @@ function rcmail_message_part_frame($attrib)
{
global $MESSAGE, $RCMAIL;
- $part = $MESSAGE->mime_parts[asciiwords(get_input_value('_part', RCUBE_INPUT_GPC))];
+ $part = $MESSAGE->mime_parts[asciiwords(rcube_utils::get_input_value('_part', rcube_utils::INPUT_GPC))];
$ctype_primary = strtolower($part->ctype_primary);
$attrib['src'] = './?' . str_replace('_frame=', ($ctype_primary=='text' ? '_embed=' : '_preload='), $_SERVER['QUERY_STRING']);
diff --git a/program/steps/mail/getunread.inc b/program/steps/mail/getunread.inc
index fb7e802fb..f708c8aef 100644
--- a/program/steps/mail/getunread.inc
+++ b/program/steps/mail/getunread.inc
@@ -5,7 +5,7 @@
| program/steps/mail/getunread.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,28 +21,36 @@
$a_folders = $RCMAIL->storage->list_folders_subscribed('', '*', 'mail');
-if (!empty($a_folders))
-{
- $current = $RCMAIL->storage->get_folder();
- $inbox = ($current == 'INBOX');
- $check_all = (bool)$RCMAIL->config->get('check_all_folders');
-
- foreach ($a_folders as $mbox_row) {
- $unseen_old = rcmail_get_unseen_count($mbox_row);
-
- if (!$check_all && $unseen_old !== null && $mbox_row != $current)
- $unseen = $unseen_old;
- else
- $unseen = $RCMAIL->storage->count($mbox_row, 'UNSEEN', $unseen_old === null);
-
- if ($unseen || $unseen_old === null) {
- $OUTPUT->command('set_unread_count', $mbox_row, $unseen, $inbox && $mbox_row == 'INBOX');
+if (!empty($a_folders)) {
+ $current = $RCMAIL->storage->get_folder();
+ $inbox = ($current == 'INBOX');
+ $trash = $RCMAIL->config->get('trash_mbox');
+ $check_all = (bool)$RCMAIL->config->get('check_all_folders');
+
+ foreach ($a_folders as $mbox) {
+ $unseen_old = rcmail_get_unseen_count($mbox);
+
+ if (!$check_all && $unseen_old !== null && $mbox != $current) {
+ $unseen = $unseen_old;
+ }
+ else {
+ $unseen = $RCMAIL->storage->count($mbox, 'UNSEEN', $unseen_old === null);
+ }
+
+ // call it always for current folder, so it can update counter
+ // after possible message status change when opening a message
+ // not in preview frame
+ if ($unseen || $unseen_old === null || $mbox == $current) {
+ $OUTPUT->command('set_unread_count', $mbox, $unseen, $inbox && $mbox_row == 'INBOX');
+ }
+
+ rcmail_set_unseen_count($mbox, $unseen);
+
+ // set trash folder state
+ if ($mbox === $trash) {
+ $OUTPUT->command('set_trash_count', $RCMAIL->storage->count($mbox, 'EXISTS'));
+ }
}
-
- rcmail_set_unseen_count($mbox_row, $unseen);
- }
}
$OUTPUT->send();
-
-
diff --git a/program/steps/mail/headers.inc b/program/steps/mail/headers.inc
index cad113f68..9d3e6d348 100644
--- a/program/steps/mail/headers.inc
+++ b/program/steps/mail/headers.inc
@@ -19,8 +19,7 @@
+-----------------------------------------------------------------------+
*/
-if ($uid = get_input_value('_uid', RCUBE_INPUT_POST))
-{
+if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST)) {
$source = $RCMAIL->storage->get_raw_headers($uid);
if ($source !== false) {
@@ -48,5 +47,3 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_POST))
}
exit;
-
-
diff --git a/program/steps/mail/import.inc b/program/steps/mail/import.inc
index f7e7a3eb8..4f822e0e4 100644
--- a/program/steps/mail/import.inc
+++ b/program/steps/mail/import.inc
@@ -31,7 +31,8 @@ if (is_array($_FILES['_file'])) {
if (!$err) {
// check file content type first
- list($mtype_primary,) = explode('/', rc_mime_content_type($filepath, $_FILES['_file']['name'][$i], $_FILES['_file']['type'][$i]));
+ list($mtype_primary,) = explode('/', rcube_mime::file_content_type($filepath, $_FILES['_file']['name'][$i], $_FILES['_file']['type'][$i]));
+
if (!in_array($mtype_primary, array('text','message'))) {
$OUTPUT->show_message('importmessageerror', 'error');
continue;
@@ -39,7 +40,9 @@ if (is_array($_FILES['_file'])) {
// read the first few lines to detect header-like structure
$fp = fopen($filepath, 'r');
- do { $line = fgets($fp); }
+ do {
+ $line = fgets($fp);
+ }
while ($line !== false && trim($line) == '');
if (!preg_match('/^From\s+-/', $line) && !preg_match('/^[a-z-_]+:\s+.+/i', $line)) {
@@ -74,7 +77,8 @@ if (is_array($_FILES['_file'])) {
}
if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
- $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))));
+ $size = $RCMAIL->show_bytes(parse_bytes(ini_get('upload_max_filesize')));
+ $msg = $RCMAIL->gettext(array('name' => 'filesizeerror', 'vars' => array('size' => $size)));
}
else if ($err) {
$OUTPUT->show_message('fileuploaderror', 'error');
@@ -82,7 +86,7 @@ if (is_array($_FILES['_file'])) {
} // end foreach
if ($imported) {
- $OUTPUT->show_message(rcube_label(array('name' => 'importmessagesuccess', 'nr' => $imported, 'vars' => array('nr' => $imported))), 'confirmation');
+ $OUTPUT->show_message($RCMAIL->gettext(array('name' => 'importmessagesuccess', 'nr' => $imported, 'vars' => array('nr' => $imported))), 'confirmation');
$OUTPUT->command('command', 'list');
}
else {
@@ -93,13 +97,12 @@ else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// if filesize exceeds post_max_size then $_FILES array is empty,
// show filesizeerror instead of fileuploaderror
if ($maxsize = ini_get('post_max_size'))
- $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes($maxsize)))));
+ $msg = $RCMAIL->gettext(array('name' => 'filesizeerror', 'vars' => array('size' => $RCMAIL->show_bytes(parse_bytes($maxsize)))));
else
- $msg = rcube_label('fileuploaderror');
+ $msg = $RCMAIL->gettext('fileuploaderror');
$OUTPUT->command('display_message', $msg, 'error');
}
// send html page with JS calls as response
$OUTPUT->send('iframe');
-
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index a2380131a..277564c38 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -23,11 +23,11 @@ if (!$OUTPUT->ajax_call) {
return;
}
-$save_arr = array();
-$dont_override = (array) $RCMAIL->config->get('dont_override');
+$save_arr = array();
+$dont_override = (array) $RCMAIL->config->get('dont_override');
// is there a sort type for this request?
-if ($sort = get_input_value('_sort', RCUBE_INPUT_GET)) {
+if ($sort = rcube_utils::get_input_value('_sort', rcube_utils::INPUT_GET)) {
// yes, so set the sort vars
list($sort_col, $sort_order) = explode('_', $sort);
@@ -41,7 +41,7 @@ if ($sort = get_input_value('_sort', RCUBE_INPUT_GET)) {
}
// is there a set of columns for this request?
-if ($cols = get_input_value('_cols', RCUBE_INPUT_GET)) {
+if ($cols = rcube_utils::get_input_value('_cols', rcube_utils::INPUT_GET)) {
if (!in_array('list_cols', $dont_override)) {
$save_arr['list_cols'] = explode(',', $cols);
}
@@ -60,7 +60,7 @@ $RCMAIL->storage->folder_sync($mbox_name);
// initialize searching result if search_filter is used
if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') {
$search_request = md5($mbox_name.$_SESSION['search_filter']);
- $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, rcmail_sort_column());
+ $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCUBE_CHARSET, rcmail_sort_column());
$_SESSION['search'] = $RCMAIL->storage->get_search_set();
$_SESSION['search_request'] = $search_request;
$OUTPUT->set_env('search_request', $search_request);
@@ -90,12 +90,14 @@ if (empty($search_request) && empty($a_headers)) {
rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh']), $unseen);
// update message count display
-$pages = ceil($count/$RCMAIL->storage->get_pagesize());
+$pages = ceil($count/$RCMAIL->storage->get_pagesize());
+$exists = $RCMAIL->storage->count($mbox_name, 'EXISTS');
+
$OUTPUT->set_env('messagecount', $count);
$OUTPUT->set_env('pagecount', $pages);
$OUTPUT->set_env('threading', $threading);
$OUTPUT->set_env('current_page', $count ? $RCMAIL->storage->get_page() : 1);
-$OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
+$OUTPUT->set_env('exists', $exists);
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count), $mbox_name);
// add message rows
@@ -104,11 +106,18 @@ if (isset($a_headers) && count($a_headers)) {
if ($search_request) {
$OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count));
}
+
+ // remember last HIGHESTMODSEQ value (if supported)
+ // we need it for flag updates in check-recent
+ $data = $RCMAIL->storage->folder_data($mbox_name);
+ if (!empty($data['HIGHESTMODSEQ'])) {
+ $_SESSION['list_mod_seq'] = $data['HIGHESTMODSEQ'];
+ }
}
else {
// handle IMAP errors (e.g. #1486905)
if ($err_code = $RCMAIL->storage->get_error_code()) {
- rcmail_display_server_error();
+ $RCMAIL->display_server_error();
}
else if ($search_request)
$OUTPUT->show_message('searchnomatch', 'notice');
@@ -116,5 +125,10 @@ else {
$OUTPUT->show_message('nomessagesfound', 'notice');
}
+// set trash folder state
+if ($mbox_name === $RCMAIL->config->get('trash_mbox')) {
+ $OUTPUT->command('set_trash_count', $exists);
+}
+
// send response
$OUTPUT->send();
diff --git a/program/steps/mail/list_contacts.inc b/program/steps/mail/list_contacts.inc
index dab146431..0ee81135b 100644
--- a/program/steps/mail/list_contacts.inc
+++ b/program/steps/mail/list_contacts.inc
@@ -5,7 +5,7 @@
| program/steps/mail/list_contacts.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2012-2013, The Roundcube Dev Team |
+ | Copyright (C) 2012-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -23,15 +23,22 @@ $afields = $RCMAIL->config->get('contactlist_fields');
$addr_sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name');
$page_size = $RCMAIL->config->get('addressbook_pagesize', $RCMAIL->config->get('pagesize', 50));
$list_page = max(1, intval($_GET['_page']));
+$jsresult = array();
// Use search result
if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) {
$search = (array)$_SESSION['search'][$_REQUEST['_search']];
+ $sparam = $_SESSION['search_params']['id'] == $_REQUEST['_search'] ? $_SESSION['search_params']['data'] : array();
// get records from all sources
foreach ($search as $s => $set) {
$CONTACTS = $RCMAIL->get_address_book($s);
+ // list matching groups of this source (on page one)
+ if ($sparam[1] && $CONTACTS->groups && $list_page == 1) {
+ $jsresult += rcmail_compose_contact_groups($CONTACTS, $s, $sparam[1], (int)$RCMAIL->config->get('addressbook_search_mode'));
+ }
+
// reset page
$CONTACTS->set_page(1);
$CONTACTS->set_pagesize(9999);
@@ -65,7 +72,7 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search
}
// list contacts from selected source
else {
- $source = get_input_value('_source', RCUBE_INPUT_GPC);
+ $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
$CONTACTS = $RCMAIL->get_address_book($source);
if ($CONTACTS && $CONTACTS->ready) {
@@ -73,49 +80,12 @@ else {
$CONTACTS->set_pagesize($page_size);
$CONTACTS->set_page($list_page);
- if ($group_id = get_input_value('_gid', RCUBE_INPUT_GPC)) {
+ if ($group_id = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC)) {
$CONTACTS->set_group($group_id);
}
// list groups of this source (on page one)
else if ($CONTACTS->groups && $CONTACTS->list_page == 1) {
- foreach ($CONTACTS->list_groups() as $group) {
- $CONTACTS->reset();
- $CONTACTS->set_group($group['ID']);
- $group_prop = $CONTACTS->get_group($group['ID']);
-
- // group (distribution list) with email address(es)
- if ($group_prop['email']) {
- foreach ((array)$group_prop['email'] as $email) {
- $row_id = 'G'.$group['ID'];
- $jsresult[$row_id] = format_email_recipient($email, $group['name']);
- $OUTPUT->command('add_contact_row', $row_id, array(
- 'contactgroup' => html::span(array('title' => $email), Q($group['name']))), 'group');
- }
- }
- // make virtual groups clickable to list their members
- else if ($group_prop['virtual']) {
- $row_id = 'G'.$group['ID'];
- $OUTPUT->command('add_contact_row', $row_id, array(
- 'contactgroup' => html::a(array(
- 'href' => '#list',
- 'rel' => $row['ID'],
- 'title' => rcube_label('listgroup'),
- 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)", JS_OBJECT_NAME, $source, $group['ID']),
- ), Q($group['name']) . '&nbsp;' . html::span('action', '&raquo;'))),
- 'group',
- array('ID' => $group['ID'], 'name' => $group['name'], 'virtual' => true));
- }
- // show group with count
- else if (($result = $CONTACTS->count()) && $result->count) {
- $row_id = 'E'.$group['ID'];
- $jsresult[$row_id] = $group['name'];
- $OUTPUT->command('add_contact_row', $row_id, array(
- 'contactgroup' => Q($group['name'] . ' (' . intval($result->count) . ')')), 'group');
- }
- }
-
- $CONTACTS->reset();
- $CONTACTS->set_group(0);
+ $jsresult = rcmail_compose_contact_groups($CONTACTS, $source);
}
// get contacts for this user
@@ -134,14 +104,14 @@ else if (!empty($result) && $result->count > 0) {
// add record for every email address of the contact
$emails = $CONTACTS->get_col_values('email', $row, true);
foreach ($emails as $i => $email) {
- $row_id = $row['ID'].$i;
+ $row_id = $row['ID'].'-'.$i;
$jsresult[$row_id] = format_email_recipient($email, $name);
$classname = $row['_type'] == 'group' ? 'group' : 'person';
$keyname = $row['_type'] == 'group' ? 'contactgroup' : 'contact';
$OUTPUT->command('add_contact_row', $row_id, array(
- $keyname => html::span(array('title' => $email), Q($name ? $name : $email) .
- ($name && count($emails) > 1 ? '&nbsp;' . html::span('email', Q($email)) : '')
+ $keyname => html::span(array('title' => $email), rcube::Q($name ? $name : $email) .
+ ($name && count($emails) > 1 ? '&nbsp;' . html::span('email', rcube::Q($email)) : '')
)), $classname);
}
}
diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc
index dfc892ea1..daa8c7e54 100644
--- a/program/steps/mail/mark.inc
+++ b/program/steps/mail/mark.inc
@@ -4,7 +4,7 @@
| program/steps/mail/mark.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,112 +19,123 @@
*/
// only process ajax requests
-if (!$OUTPUT->ajax_call)
- return;
-
-$a_flags_map = array(
- 'undelete' => 'UNDELETED',
- 'delete' => 'DELETED',
- 'read' => 'SEEN',
- 'unread' => 'UNSEEN',
- 'flagged' => 'FLAGGED',
- 'unflagged' => 'UNFLAGGED');
-
-$threading = (bool) $RCMAIL->storage->get_threading();
-
-if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_value('_flag', RCUBE_INPUT_POST)))
-{
- $flag = $a_flags_map[$flag] ? $a_flags_map[$flag] : strtoupper($flag);
-
- if ($flag == 'DELETED' && $CONFIG['skip_deleted'] && $_POST['_from'] != 'show') {
- // count messages before changing anything
- $old_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');
- $old_pages = ceil($old_count / $RCMAIL->storage->get_pagesize());
- $count = sizeof(explode(',', $uids));
- }
-
- $marked = $RCMAIL->storage->set_flag($uids, $flag);
-
- if (!$marked) {
- // send error message
- if ($_POST['_from'] != 'show')
- $OUTPUT->command('list_mailbox');
- rcmail_display_server_error('errormarking');
- $OUTPUT->send();
- exit;
- }
- else if (empty($_POST['_quiet'])) {
- $OUTPUT->show_message('messagemarked', 'confirmation');
- }
-
- if ($flag == 'DELETED' && $CONFIG['read_when_deleted'] && !empty($_POST['_ruid'])) {
- $ruids = get_input_value('_ruid', RCUBE_INPUT_POST);
- $read = $RCMAIL->storage->set_flag($ruids, 'SEEN');
-
- if ($read && !$CONFIG['skip_deleted'])
- $OUTPUT->command('flag_deleted_as_read', $ruids);
- }
-
- if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$CONFIG['skip_deleted'])) {
- rcmail_send_unread_count($RCMAIL->storage->get_folder());
- }
- else if ($flag == 'DELETED' && $CONFIG['skip_deleted']) {
- if ($_POST['_from'] == 'show') {
- if ($next = get_input_value('_next_uid', RCUBE_INPUT_GPC))
- $OUTPUT->command('show_message', $next);
- else
- $OUTPUT->command('command', 'list');
- } else {
- $search_request = get_input_value('_search', RCUBE_INPUT_GPC);
- // refresh saved search set after moving some messages
- if ($search_request && $RCMAIL->storage->get_search_set()) {
- $_SESSION['search'] = $RCMAIL->storage->refresh_search();
- }
-
- $msg_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');
- $page_size = $RCMAIL->storage->get_pagesize();
- $page = $RCMAIL->storage->get_page();
- $pages = ceil($msg_count / $page_size);
- $nextpage_count = $old_count - $page_size * $page;
- $remaining = $msg_count - $page_size * ($page - 1);
-
- // jump back one page (user removed the whole last page)
- if ($page > 1 && $remaining == 0) {
- $page -= 1;
- $RCMAIL->storage->set_page($page);
- $_SESSION['page'] = $page;
- $jump_back = true;
- }
-
- // update message count display
- $OUTPUT->set_env('messagecount', $msg_count);
- $OUTPUT->set_env('current_page', $page);
- $OUTPUT->set_env('pagecount', $pages);
-
- // update mailboxlist
- $mbox = $RCMAIL->storage->get_folder();
- $unseen_count = $msg_count ? $RCMAIL->storage->count($mbox, 'UNSEEN') : 0;
- $old_unseen = rcmail_get_unseen_count($mbox);
-
- if ($old_unseen != $unseen_count) {
- $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX'));
- rcmail_set_unseen_count($mbox, $unseen_count);
- }
- $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox);
-
- if ($threading) {
- $count = get_input_value('_count', RCUBE_INPUT_POST);
- }
-
- // add new rows from next page (if any)
- if ($count && $uids != '*' && ($jump_back || $nextpage_count > 0)) {
- $a_headers = $RCMAIL->storage->list_messages($mbox, NULL,
- rcmail_sort_column(), rcmail_sort_order(), $jump_back ? NULL : $count);
-
- rcmail_js_message_list($a_headers, false);
- }
+if (!$OUTPUT->ajax_call) {
+ return;
+}
+
+$threading = (bool) $RCMAIL->storage->get_threading();
+$skip_deleted = (bool) $RCMAIL->config->get('skip_deleted');
+$read_deleted = (bool) $RCMAIL->config->get('read_when_deleted');
+
+$a_flags_map = array(
+ 'undelete' => 'UNDELETED',
+ 'delete' => 'DELETED',
+ 'read' => 'SEEN',
+ 'unread' => 'UNSEEN',
+ 'flagged' => 'FLAGGED',
+ 'unflagged' => 'UNFLAGGED',
+);
+
+if (($uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST))
+ && ($flag = rcube_utils::get_input_value('_flag', rcube_utils::INPUT_POST))
+) {
+ $flag = $a_flags_map[$flag] ? $a_flags_map[$flag] : strtoupper($flag);
+
+ if ($flag == 'DELETED' && $skip_deleted && $_POST['_from'] != 'show') {
+ // count messages before changing anything
+ $old_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');
+ $old_pages = ceil($old_count / $RCMAIL->storage->get_pagesize());
+ $count = sizeof(explode(',', $uids));
+ }
+
+ $marked = $RCMAIL->storage->set_flag($uids, $flag);
+
+ if (!$marked) {
+ // send error message
+ if ($_POST['_from'] != 'show') {
+ $OUTPUT->command('list_mailbox');
+ }
+
+ $RCMAIL->display_server_error('errormarking');
+ $OUTPUT->send();
+ exit;
+ }
+ else if (empty($_POST['_quiet'])) {
+ $OUTPUT->show_message('messagemarked', 'confirmation');
+ }
+
+ if ($flag == 'DELETED' && $read_deleted && !empty($_POST['_ruid'])) {
+ $ruids = rcube_utils::get_input_value('_ruid', rcube_utils::INPUT_POST);
+ $read = $RCMAIL->storage->set_flag($ruids, 'SEEN');
+
+ if ($read && !$skip_deleted) {
+ $OUTPUT->command('flag_deleted_as_read', $ruids);
+ }
+ }
+
+ if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$skip_deleted)) {
+ rcmail_send_unread_count($RCMAIL->storage->get_folder());
+ }
+ else if ($flag == 'DELETED' && $skip_deleted) {
+ if ($_POST['_from'] == 'show') {
+ if ($next = rcube_utils::get_input_value('_next_uid', rcube_utils::INPUT_GPC))
+ $OUTPUT->command('show_message', $next);
+ else
+ $OUTPUT->command('command', 'list');
+ }
+ else {
+ $search_request = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC);
+
+ // refresh saved search set after moving some messages
+ if ($search_request && $RCMAIL->storage->get_search_set()) {
+ $_SESSION['search'] = $RCMAIL->storage->refresh_search();
+ }
+
+ $msg_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');
+ $page_size = $RCMAIL->storage->get_pagesize();
+ $page = $RCMAIL->storage->get_page();
+ $pages = ceil($msg_count / $page_size);
+ $nextpage_count = $old_count - $page_size * $page;
+ $remaining = $msg_count - $page_size * ($page - 1);
+
+ // jump back one page (user removed the whole last page)
+ if ($page > 1 && $remaining == 0) {
+ $page -= 1;
+ $RCMAIL->storage->set_page($page);
+ $_SESSION['page'] = $page;
+ $jump_back = true;
+ }
+
+ // update message count display
+ $OUTPUT->set_env('messagecount', $msg_count);
+ $OUTPUT->set_env('current_page', $page);
+ $OUTPUT->set_env('pagecount', $pages);
+
+ // update mailboxlist
+ $mbox = $RCMAIL->storage->get_folder();
+ $unseen_count = $msg_count ? $RCMAIL->storage->count($mbox, 'UNSEEN') : 0;
+ $old_unseen = rcmail_get_unseen_count($mbox);
+
+ if ($old_unseen != $unseen_count) {
+ $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX'));
+ rcmail_set_unseen_count($mbox, $unseen_count);
+ }
+
+ $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox);
+
+ if ($threading) {
+ $count = rcube_utils::get_input_value('_count', rcube_utils::INPUT_POST);
+ }
+
+ // add new rows from next page (if any)
+ if ($count && $uids != '*' && ($jump_back || $nextpage_count > 0)) {
+ $a_headers = $RCMAIL->storage->list_messages($mbox, NULL,
+ rcmail_sort_column(), rcmail_sort_order(), $jump_back ? NULL : $count);
+
+ rcmail_js_message_list($a_headers, false);
+ }
+ }
}
- }
}
else {
$OUTPUT->show_message('internalerror', 'error');
diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc
index f15cd2460..7564bb89d 100644
--- a/program/steps/mail/move_del.inc
+++ b/program/steps/mail/move_del.inc
@@ -28,12 +28,13 @@ $threading = (bool) $RCMAIL->storage->get_threading();
$old_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');
$old_pages = ceil($old_count / $RCMAIL->storage->get_pagesize());
+$trash = $RCMAIL->config->get('trash_mbox');
+
// move messages
if ($RCMAIL->action == 'move' && !empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) {
- $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
- $target = get_input_value('_target_mbox', RCUBE_INPUT_POST, true);
- $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true);
- $trash = $RCMAIL->config->get('trash_mbox');
+ $count = sizeof(explode(',', ($uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST))));
+ $target = rcube_utils::get_input_value('_target_mbox', rcube_utils::INPUT_POST, true);
+ $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
$moved = $RCMAIL->storage->move_message($uids, $target, $mbox);
@@ -41,7 +42,7 @@ if ($RCMAIL->action == 'move' && !empty($_POST['_uid']) && strlen($_POST['_targe
// send error message
if ($_POST['_from'] != 'show')
$OUTPUT->command('list_mailbox');
- rcmail_display_server_error('errormoving', null, $target == $trash ? 'delete' : '');
+ $RCMAIL->display_server_error('errormoving', null, $target == $trash ? 'delete' : '');
$OUTPUT->send();
exit;
}
@@ -53,8 +54,8 @@ if ($RCMAIL->action == 'move' && !empty($_POST['_uid']) && strlen($_POST['_targe
}
// delete messages
else if ($RCMAIL->action=='delete' && !empty($_POST['_uid'])) {
- $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
- $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true);
+ $count = sizeof(explode(',', ($uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST))));
+ $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
$del = $RCMAIL->storage->delete_message($uids, $mbox);
@@ -62,7 +63,7 @@ else if ($RCMAIL->action=='delete' && !empty($_POST['_uid'])) {
// send error message
if ($_POST['_from'] != 'show')
$OUTPUT->command('list_mailbox');
- rcmail_display_server_error('errordeleting');
+ $RCMAIL->display_server_error('errordeleting');
$OUTPUT->send();
exit;
}
@@ -79,23 +80,22 @@ else {
exit;
}
-$search_request = get_input_value('_search', RCUBE_INPUT_GPC);
+$search_request = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC);
// refresh saved search set after moving some messages
if ($search_request && $RCMAIL->storage->get_search_set()) {
$_SESSION['search'] = $RCMAIL->storage->refresh_search();
}
-if ($_POST['_from'] == 'show')
-{
- if ($next = get_input_value('_next_uid', RCUBE_INPUT_GPC))
+if ($_POST['_from'] == 'show') {
+ if ($next = rcube_utils::get_input_value('_next_uid', rcube_utils::INPUT_GPC))
$OUTPUT->command('show_message', $next);
else
$OUTPUT->command('command', 'list');
}
-else
-{
+else {
$msg_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');
+ $exists = $RCMAIL->storage->count($mbox, 'EXISTS', true);
$page_size = $RCMAIL->storage->get_pagesize();
$page = $RCMAIL->storage->get_page();
$pages = ceil($msg_count / $page_size);
@@ -114,7 +114,7 @@ else
$OUTPUT->set_env('messagecount', $msg_count);
$OUTPUT->set_env('current_page', $page);
$OUTPUT->set_env('pagecount', $pages);
- $OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox, 'EXISTS', true));
+ $OUTPUT->set_env('exists', $exists);
// update mailboxlist
$mbox = $RCMAIL->storage->get_folder();
@@ -130,11 +130,11 @@ else
rcmail_send_unread_count($target, true);
}
- $OUTPUT->command('set_quota', rcmail_quota_content());
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content());
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox);
if ($threading) {
- $count = get_input_value('_count', RCUBE_INPUT_POST);
+ $count = rcube_utils::get_input_value('_count', rcube_utils::INPUT_POST);
}
// add new rows from next page (if any)
@@ -144,6 +144,14 @@ else
rcmail_js_message_list($a_headers, false);
}
+
+ // set trash folder state
+ if ($mbox === $trash) {
+ $OUTPUT->command('set_trash_count', $exists);
+ }
+ else if ($target !== null && $target === $trash) {
+ $OUTPUT->command('set_trash_count', $RCMAIL->storage->count($trash, 'EXISTS'));
+ }
}
// send response
diff --git a/program/steps/mail/pagenav.inc b/program/steps/mail/pagenav.inc
index e4b70ad60..74cca88f2 100644
--- a/program/steps/mail/pagenav.inc
+++ b/program/steps/mail/pagenav.inc
@@ -19,7 +19,7 @@
+-----------------------------------------------------------------------+
*/
-$uid = get_input_value('_uid', RCUBE_INPUT_GET);
+$uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET);
$index = $RCMAIL->storage->index(null, rcmail_sort_column(), rcmail_sort_order());
$cnt = $index->count_messages();
@@ -35,23 +35,27 @@ if ($prev) {
$OUTPUT->set_env('prev_uid', $prev);
$OUTPUT->command('enable_command', 'previousmessage', 'firstmessage', true);
}
+
if ($next) {
$OUTPUT->set_env('next_uid', $next);
$OUTPUT->command('enable_command', 'nextmessage', 'lastmessage', true);
}
-if ($first)
+
+if ($first) {
$OUTPUT->set_env('first_uid', $first);
-if ($last)
+}
+
+if ($last) {
$OUTPUT->set_env('last_uid', $last);
+}
// Don't need a real messages count value
$OUTPUT->set_env('messagecount', 1);
// Set rowcount text
-$OUTPUT->command('set_rowcount', rcube_label(array(
+$OUTPUT->command('set_rowcount', $RCMAIL->gettext(array(
'name' => 'messagenrof',
'vars' => array('nr' => $pos+1, 'count' => $cnt)
)));
$OUTPUT->send();
-
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index fb1b48797..a80887254 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -1,14 +1,18 @@
<?php
+
/*
+-----------------------------------------------------------------------+
| steps/mail/search.inc |
| |
- | Search functions for rc webmail |
+ | This file is part of the Roundcube Webmail client |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
| |
+ | PURPOSE: |
+ | Mail messages search action |
+-----------------------------------------------------------------------+
| Author: Benjamin Smith <defitro@gmail.com> |
| Thomas Bruederli <roundcube@gmail.com> |
@@ -24,13 +28,13 @@ $_SESSION['page'] = 1;
// using encodeURI with javascript "should" give us
// a correctly encoded query string
-$imap_charset = RCMAIL_CHARSET;
+$imap_charset = RCUBE_CHARSET;
// get search string
-$str = get_input_value('_q', RCUBE_INPUT_GET, true);
-$mbox = get_input_value('_mbox', RCUBE_INPUT_GET, true);
-$filter = get_input_value('_filter', RCUBE_INPUT_GET);
-$headers = get_input_value('_headers', RCUBE_INPUT_GET);
+$str = rcube_utils::get_input_value('_q', rcube_utils::INPUT_GET, true);
+$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GET, true);
+$filter = rcube_utils::get_input_value('_filter', rcube_utils::INPUT_GET);
+$headers = rcube_utils::get_input_value('_headers', rcube_utils::INPUT_GET);
$subject = array();
$search_request = md5($mbox.$filter.$str);
@@ -41,103 +45,108 @@ $search_str = $filter && $filter != 'ALL' ? $filter : '';
$_SESSION['search_filter'] = $filter;
// Check the search string for type of search
-if (preg_match("/^from:.*/i", $str))
-{
- list(,$srch) = explode(":", $str);
- $subject['from'] = "HEADER FROM";
+if (preg_match("/^from:.*/i", $str)) {
+ list(,$srch) = explode(":", $str);
+ $subject['from'] = "HEADER FROM";
}
-else if (preg_match("/^to:.*/i", $str))
-{
- list(,$srch) = explode(":", $str);
- $subject['to'] = "HEADER TO";
+else if (preg_match("/^to:.*/i", $str)) {
+ list(,$srch) = explode(":", $str);
+ $subject['to'] = "HEADER TO";
}
-else if (preg_match("/^cc:.*/i", $str))
-{
- list(,$srch) = explode(":", $str);
- $subject['cc'] = "HEADER CC";
+else if (preg_match("/^cc:.*/i", $str)) {
+ list(,$srch) = explode(":", $str);
+ $subject['cc'] = "HEADER CC";
}
-else if (preg_match("/^bcc:.*/i", $str))
-{
- list(,$srch) = explode(":", $str);
- $subject['bcc'] = "HEADER BCC";
+else if (preg_match("/^bcc:.*/i", $str)) {
+ list(,$srch) = explode(":", $str);
+ $subject['bcc'] = "HEADER BCC";
}
-else if (preg_match("/^subject:.*/i", $str))
-{
- list(,$srch) = explode(":", $str);
- $subject['subject'] = "HEADER SUBJECT";
+else if (preg_match("/^subject:.*/i", $str)) {
+ list(,$srch) = explode(":", $str);
+ $subject['subject'] = "HEADER SUBJECT";
}
-else if (preg_match("/^body:.*/i", $str))
-{
- list(,$srch) = explode(":", $str);
- $subject['body'] = "BODY";
+else if (preg_match("/^body:.*/i", $str)) {
+ list(,$srch) = explode(":", $str);
+ $subject['body'] = "BODY";
}
-else if (strlen(trim($str)))
-{
- if ($headers) {
- foreach (explode(',', $headers) as $header) {
- if ($header == 'text') {
- // #1488208: get rid of other headers when searching by "TEXT"
- $subject = array('text' => 'TEXT');
- break;
- }
- else {
- $subject[$header] = ($header != 'body' ? 'HEADER ' : '') . strtoupper($header);
- }
+else if (strlen(trim($str))) {
+ if ($headers) {
+ foreach (explode(',', $headers) as $header) {
+ if ($header == 'text') {
+ // #1488208: get rid of other headers when searching by "TEXT"
+ $subject = array('text' => 'TEXT');
+ break;
+ }
+ else {
+ $subject[$header] = ($header != 'body' ? 'HEADER ' : '') . strtoupper($header);
+ }
+ }
+
+ // save search modifiers for the current folder to user prefs
+ $search_mods = rcmail_search_mods();
+ $search_mods[$mbox] = array_fill_keys(array_keys($subject), 1);
+
+ $RCMAIL->user->save_prefs(array('search_mods' => $search_mods));
+ }
+ else {
+ // search in subject by default
+ $subject['subject'] = 'HEADER SUBJECT';
}
-
- // save search modifiers for the current folder to user prefs
- $search_mods = $RCMAIL->config->get('search_mods', $SEARCH_MODS_DEFAULT);
- $search_mods[$mbox] = array_fill_keys(array_keys($subject), 1);
- $RCMAIL->user->save_prefs(array('search_mods' => $search_mods));
- }
- else {
- // search in subject by default
- $subject['subject'] = 'HEADER SUBJECT';
- }
}
$search = isset($srch) ? trim($srch) : trim($str);
if (!empty($subject)) {
- $search_str .= str_repeat(' OR', count($subject)-1);
- foreach ($subject as $sub)
- $search_str .= ' ' . $sub . ' ' . rcube_imap_generic::escape($search);
+ $search_str .= str_repeat(' OR', count($subject)-1);
+ foreach ($subject as $sub) {
+ $search_str .= ' ' . $sub . ' ' . rcube_imap_generic::escape($search);
+ }
}
$search_str = trim($search_str);
$sort_column = rcmail_sort_column();
// execute IMAP search
-if ($search_str)
- $RCMAIL->storage->search($mbox, $search_str, $imap_charset, $sort_column);
+if ($search_str) {
+ $RCMAIL->storage->search($mbox, $search_str, $imap_charset, $sort_column);
+}
// save search results in session
-if (!is_array($_SESSION['search']))
- $_SESSION['search'] = array();
+if (!is_array($_SESSION['search'])) {
+ $_SESSION['search'] = array();
+}
if ($search_str) {
- $_SESSION['search'] = $RCMAIL->storage->get_search_set();
- $_SESSION['last_text_search'] = $str;
+ $_SESSION['search'] = $RCMAIL->storage->get_search_set();
+ $_SESSION['last_text_search'] = $str;
}
$_SESSION['search_request'] = $search_request;
// Get the headers
$result_h = $RCMAIL->storage->list_messages($mbox, 1, $sort_column, rcmail_sort_order());
-$count = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
+$count = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
// Make sure we got the headers
if (!empty($result_h)) {
- rcmail_js_message_list($result_h);
- if ($search_str)
- $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $RCMAIL->storage->count(NULL, 'ALL')));
+ rcmail_js_message_list($result_h);
+ if ($search_str) {
+ $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $RCMAIL->storage->count(NULL, 'ALL')));
+ }
+
+ // remember last HIGHESTMODSEQ value (if supported)
+ // we need it for flag updates in check-recent
+ $data = $RCMAIL->storage->folder_data($mbox_name);
+ if (!empty($data['HIGHESTMODSEQ'])) {
+ $_SESSION['list_mod_seq'] = $data['HIGHESTMODSEQ'];
+ }
}
// handle IMAP errors (e.g. #1486905)
else if ($err_code = $RCMAIL->storage->get_error_code()) {
- rcmail_display_server_error();
+ $RCMAIL->display_server_error();
}
else {
- $OUTPUT->show_message('searchnomatch', 'notice');
+ $OUTPUT->show_message('searchnomatch', 'notice');
}
// update message count display
diff --git a/program/steps/mail/search_contacts.inc b/program/steps/mail/search_contacts.inc
index 6a30ad1f5..d56581695 100644
--- a/program/steps/mail/search_contacts.inc
+++ b/program/steps/mail/search_contacts.inc
@@ -5,7 +5,7 @@
| program/steps/mail/search_contacts.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2013, The Roundcube Dev Team |
+ | Copyright (C) 2013-2014, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,7 +19,7 @@
+-----------------------------------------------------------------------+
*/
-$search = get_input_value('_q', RCUBE_INPUT_GPC, true);
+$search = rcube_utils::get_input_value('_q', rcube_utils::INPUT_GPC, true);
$sources = $RCMAIL->get_address_sources();
$search_mode = (int) $RCMAIL->config->get('addressbook_search_mode');
$addr_sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name');
@@ -27,12 +27,18 @@ $afields = $RCMAIL->config->get('contactlist_fields');
$page_size = $RCMAIL->config->get('addressbook_pagesize', $RCMAIL->config->get('pagesize', 50));
$records = array();
$search_set = array();
+$jsresult = array();
foreach ($sources as $s) {
$source = $RCMAIL->get_address_book($s['id']);
$source->set_page(1);
$source->set_pagesize(9999);
+ // list matching groups of this source
+ if ($source->groups) {
+ $jsresult += rcmail_compose_contact_groups($source, $s['id'], $search, $search_mode);
+ }
+
// get contacts count
$result = $source->search($afields, $search, $search_mode, true, true, 'email');
@@ -53,6 +59,8 @@ foreach ($sources as $s) {
unset($result);
}
+$group_count = count($jsresult);
+
// sort the records
ksort($records, SORT_LOCALE_STRING);
@@ -76,11 +84,11 @@ if (!empty($result) && $result->count > 0) {
// (same as in list_contacts.inc)
$emails = $source->get_col_values('email', $row, true);
foreach ($emails as $i => $email) {
- $row_id = $row['ID'].$i;
+ $row_id = $row['ID'].'-'.$i;
$jsresult[$row_id] = format_email_recipient($email, $name);
$OUTPUT->command('add_contact_row', $row_id, array(
- 'contact' => html::span(array('title' => $email), Q($name ? $name : $email) .
- ($name && count($emails) > 1 ? '&nbsp;' . html::span('email', Q($email)) : '')
+ 'contact' => html::span(array('title' => $email), rcube::Q($name ? $name : $email) .
+ ($name && count($emails) > 1 ? '&nbsp;' . html::span('email', rcube::Q($email)) : '')
)), 'person');
}
}
@@ -98,7 +106,7 @@ if (!empty($result) && $result->count > 0) {
$OUTPUT->command('set_env', 'source', '');
$OUTPUT->command('unselect_directory');
}
-else {
+else if (!$group_count) {
$OUTPUT->show_message('nocontactsfound', 'notice');
}
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index ccb8978be..2cd897e46 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -5,7 +5,7 @@
| program/steps/mail/sendmail.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2011, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -24,434 +24,224 @@
$OUTPUT->reset();
$OUTPUT->framed = TRUE;
-$savedraft = !empty($_POST['_draft']) ? true : false;
+$savedraft = !empty($_POST['_draft']) ? true : false;
+$sendmail_delay = (int) $RCMAIL->config->get('sendmail_delay');
+$drafts_mbox = $RCMAIL->config->get('drafts_mbox');
-$COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GPC);
+$COMPOSE_ID = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC);
$COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID];
/****** checks ********/
if (!isset($COMPOSE['id'])) {
- raise_error(array('code' => 500, 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Invalid compose ID"), true, false);
-
- $OUTPUT->show_message('internalerror', 'error');
- $OUTPUT->send('iframe');
-}
+ rcube::raise_error(array('code' => 500, 'type' => 'php',
+ 'file' => __FILE__, 'line' => __LINE__,
+ 'message' => "Invalid compose ID"), true, false);
-if (!$savedraft) {
- if (empty($_POST['_to']) && empty($_POST['_cc']) && empty($_POST['_bcc'])
- && empty($_POST['_subject']) && $_POST['_message']) {
- $OUTPUT->show_message('sendingfailed', 'error');
+ $OUTPUT->show_message('internalerror', 'error');
$OUTPUT->send('iframe');
- }
-
- if(!empty($CONFIG['sendmail_delay'])) {
- $wait_sec = time() - intval($CONFIG['sendmail_delay']) - intval($CONFIG['last_message_time']);
- if ($wait_sec < 0) {
- $OUTPUT->show_message('senttooquickly', 'error', array('sec' => $wait_sec * -1));
- $OUTPUT->send('iframe');
- }
- }
-}
-
-
-/****** message sending functions ********/
-
-// encrypt parts of the header
-function rcmail_encrypt_header($what)
-{
- global $CONFIG, $RCMAIL;
- if (!$CONFIG['http_received_header_encrypt']) {
- return $what;
- }
- return $RCMAIL->encrypt($what);
}
-// get identity record
-function rcmail_get_identity($id)
-{
- global $RCMAIL, $message_charset;
- global $RCMAIL;
-
- if ($sql_arr = $RCMAIL->user->get_identity($id)) {
- $out = $sql_arr;
-
- if ($message_charset != RCMAIL_CHARSET) {
- foreach ($out as $k => $v)
- $out[$k] = rcube_charset_convert($v, RCMAIL_CHARSET, $message_charset);
+if (!$savedraft) {
+ if (empty($_POST['_to']) && empty($_POST['_cc']) && empty($_POST['_bcc'])
+ && empty($_POST['_subject']) && $_POST['_message']
+ ) {
+ $OUTPUT->show_message('sendingfailed', 'error');
+ $OUTPUT->send('iframe');
}
- $out['mailto'] = $sql_arr['email'];
- $out['string'] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
-
- return $out;
- }
-
- return FALSE;
-}
-
-/**
- * go from this:
- * <img src="http[s]://.../tiny_mce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" />
- *
- * to this:
- *
- * <img src="/path/on/server/.../tiny_mce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" />
- */
-function rcmail_fix_emoticon_paths($mime_message)
-{
- global $RCMAIL;
-
- $body = $mime_message->getHTMLBody();
-
- // remove any null-byte characters before parsing
- $body = preg_replace('/\x00/', '', $body);
-
- $searchstr = 'program/js/tiny_mce/plugins/emotions/img/';
- $offset = 0;
-
- // keep track of added images, so they're only added once
- $included_images = array();
-
- if (preg_match_all('# src=[\'"]([^\'"]+)#', $body, $matches, PREG_OFFSET_CAPTURE)) {
- foreach ($matches[1] as $m) {
- // find emoticon image tags
- if (preg_match('#'.$searchstr.'(.*)$#', $m[0], $imatches)) {
- $image_name = $imatches[1];
-
- // sanitize image name so resulting attachment doesn't leave images dir
- $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i', '', $image_name);
- $img_file = INSTALL_PATH . '/' . $searchstr . $image_name;
-
- if (! in_array($image_name, $included_images)) {
- // add the image to the MIME message
- if (!$mime_message->addHTMLImage($img_file, 'image/gif', '', true, $image_name)) {
- $RCMAIL->output->show_message("emoticonerror", 'error');
- }
- array_push($included_images, $image_name);
+ if ($sendmail_delay) {
+ $wait_sec = time() - $sendmail_delay - intval($RCMAIL->config->get('last_message_time'));
+ if ($wait_sec < 0) {
+ $OUTPUT->show_message('senttooquickly', 'error', array('sec' => $wait_sec * -1));
+ $OUTPUT->send('iframe');
}
-
- $body = substr_replace($body, $img_file, $m[1] + $offset, strlen($m[0]));
- $offset += strlen($img_file) - strlen($m[0]);
- }
}
- }
-
- $mime_message->setHTMLBody($body);
-}
-
-/**
- * Extract image attachments from HTML content (data URIs)
- */
-function rcmail_extract_inline_images($mime_message, $from)
-{
- $body = $mime_message->getHTMLBody();
- $offset = 0;
- $list = array();
- $regexp = '# src=[\'"](data:(image/[a-z]+);base64,([a-z0-9+/=\r\n]+))([\'"])#i';
-
- // get domain for the Content-ID, must be the same as in Mail_Mime::get()
- if (preg_match('#@([0-9a-zA-Z\-\.]+)#', $from, $matches)) {
- $domain = $matches[1];
- } else {
- $domain = 'localhost';
- }
-
- if (preg_match_all($regexp, $body, $matches, PREG_OFFSET_CAPTURE)) {
- foreach ($matches[1] as $idx => $m) {
- $data = preg_replace('/\r\n/', '', $matches[3][$idx][0]);
- $data = base64_decode($data);
-
- if (empty($data)) {
- continue;
- }
-
- $hash = md5($data) . '@' . $domain;
- $mime_type = $matches[2][$idx][0];
- $name = $list[$hash];
-
- // add the image to the MIME message
- if (!$name) {
- $ext = preg_replace('#^[^/]+/#', '', $mime_type);
- $name = substr($hash, 0, 8) . '.' . $ext;
- $list[$hash] = $name;
-
- $mime_message->addHTMLImage($data, $mime_type, $name, false, $hash);
- }
-
- $body = substr_replace($body, $name, $m[1] + $offset, strlen($m[0]));
- $offset += strlen($name) - strlen($m[0]);
- }
- }
-
- $mime_message->setHTMLBody($body);
-}
-
-/**
- * Parse and cleanup email address input (and count addresses)
- *
- * @param string Address input
- * @param boolean Do count recipients (saved in global $RECIPIENT_COUNT)
- * @param boolean Validate addresses (errors saved in global $EMAIL_FORMAT_ERROR)
- * @return string Canonical recipients string separated by comma
- */
-function rcmail_email_input_format($mailto, $count=false, $check=true)
-{
- global $RCMAIL, $EMAIL_FORMAT_ERROR, $RECIPIENT_COUNT;
-
- // simplified email regexp, supporting quoted local part
- $email_regexp = '(\S+|("[^"]+"))@\S+';
-
- $delim = trim($RCMAIL->config->get('recipients_separator', ','));
- $regexp = array("/[,;$delim]\s*[\r\n]+/", '/[\r\n]+/', "/[,;$delim]\s*\$/m", '/;/', '/(\S{1})(<'.$email_regexp.'>)/U');
- $replace = array($delim.' ', ', ', '', $delim, '\\1 \\2');
-
- // replace new lines and strip ending ', ', make address input more valid
- $mailto = trim(preg_replace($regexp, $replace, $mailto));
-
- $result = array();
- $items = rcube_explode_quoted_string($delim, $mailto);
-
- foreach($items as $item) {
- $item = trim($item);
- // address in brackets without name (do nothing)
- if (preg_match('/^<'.$email_regexp.'>$/', $item)) {
- $item = rcube_idn_to_ascii(trim($item, '<>'));
- $result[] = $item;
- // address without brackets and without name (add brackets)
- } else if (preg_match('/^'.$email_regexp.'$/', $item)) {
- $item = rcube_idn_to_ascii($item);
- $result[] = $item;
- // address with name (handle name)
- } else if (preg_match('/<*'.$email_regexp.'>*$/', $item, $matches)) {
- $address = $matches[0];
- $name = trim(str_replace($address, '', $item));
- if ($name[0] == '"' && $name[count($name)-1] == '"') {
- $name = substr($name, 1, -1);
- }
- $name = stripcslashes($name);
- $address = rcube_idn_to_ascii(trim($address, '<>'));
- $result[] = format_email_recipient($address, $name);
- $item = $address;
- } else if (trim($item)) {
- continue;
- }
-
- // check address format
- $item = trim($item, '<>');
- if ($item && $check && !check_email($item)) {
- $EMAIL_FORMAT_ERROR = $item;
- return;
- }
- }
-
- if ($count) {
- $RECIPIENT_COUNT += count($result);
- }
-
- return implode(', ', $result);
-}
-
-
-function rcmail_generic_message_footer($isHtml)
-{
- global $CONFIG;
-
- if ($isHtml && !empty($CONFIG['generic_message_footer_html'])) {
- $file = $CONFIG['generic_message_footer_html'];
- $html_footer = true;
- }
- else {
- $file = $CONFIG['generic_message_footer'];
- $html_footer = false;
- }
-
- if ($file && realpath($file)) {
- // sanity check
- if (!preg_match('/\.(php|ini|conf)$/', $file) && strpos($file, '/etc/') === false) {
- $footer = file_get_contents($file);
- if ($isHtml && !$html_footer)
- $footer = '<pre>' . $footer . '</pre>';
- return $footer;
- }
- }
-
- return false;
}
/****** compose message ********/
-if (strlen($_POST['_draft_saveid']) > 3)
- $olddraftmessageid = get_input_value('_draft_saveid', RCUBE_INPUT_POST);
-
-$message_id = rcmail_gen_message_id();
+if (empty($COMPOSE['param']['message-id'])) {
+ $COMPOSE['param']['message-id'] = $RCMAIL->gen_message_id();
+}
+$message_id = $COMPOSE['param']['message-id'];
// set default charset
$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $OUTPUT->get_charset();
$EMAIL_FORMAT_ERROR = NULL;
-$RECIPIENT_COUNT = 0;
+$RECIPIENT_COUNT = 0;
-$mailto = rcmail_email_input_format(get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset), true);
-$mailcc = rcmail_email_input_format(get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset), true);
-$mailbcc = rcmail_email_input_format(get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset), true);
+$mailto = rcmail_email_input_format(rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST, TRUE, $message_charset), true);
+$mailcc = rcmail_email_input_format(rcube_utils::get_input_value('_cc', rcube_utils::INPUT_POST, TRUE, $message_charset), true);
+$mailbcc = rcmail_email_input_format(rcube_utils::get_input_value('_bcc', rcube_utils::INPUT_POST, TRUE, $message_charset), true);
if ($EMAIL_FORMAT_ERROR) {
- $OUTPUT->show_message('emailformaterror', 'error', array('email' => $EMAIL_FORMAT_ERROR));
- $OUTPUT->send('iframe');
+ $OUTPUT->show_message('emailformaterror', 'error', array('email' => $EMAIL_FORMAT_ERROR));
+ $OUTPUT->send('iframe');
}
if (empty($mailto) && !empty($mailcc)) {
- $mailto = $mailcc;
- $mailcc = null;
+ $mailto = $mailcc;
+ $mailcc = null;
+}
+else if (empty($mailto)) {
+ $mailto = 'undisclosed-recipients:;';
}
-else if (empty($mailto))
- $mailto = 'undisclosed-recipients:;';
// Get sender name and address...
-$from = get_input_value('_from', RCUBE_INPUT_POST, true, $message_charset);
+$from = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST, true, $message_charset);
// ... from identity...
if (is_numeric($from)) {
- if (is_array($identity_arr = rcmail_get_identity($from))) {
- if ($identity_arr['mailto'])
- $from = $identity_arr['mailto'];
- if ($identity_arr['string'])
- $from_string = $identity_arr['string'];
- }
- else {
- $from = null;
- }
+ if (is_array($identity_arr = rcmail_get_identity($from))) {
+ if ($identity_arr['mailto'])
+ $from = $identity_arr['mailto'];
+ if ($identity_arr['string'])
+ $from_string = $identity_arr['string'];
+ }
+ else {
+ $from = null;
+ }
}
// ... if there is no identity record, this might be a custom from
else if ($from_string = rcmail_email_input_format($from)) {
- if (preg_match('/(\S+@\S+)/', $from_string, $m))
- $from = trim($m[1], '<>');
- else
- $from = null;
+ if (preg_match('/(\S+@\S+)/', $from_string, $m))
+ $from = trim($m[1], '<>');
+ else
+ $from = null;
}
-if (!$from_string && $from)
- $from_string = $from;
+if (!$from_string && $from) {
+ $from_string = $from;
+}
// compose headers array
$headers = array();
// if configured, the Received headers goes to top, for good measure
-if ($CONFIG['http_received_header'])
-{
- $nldlm = "\r\n\t";
- // FROM/VIA
- $http_header = 'from ';
- if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
- $host = $_SERVER['HTTP_X_FORWARDED_FOR'];
+if ($RCMAIL->config->get('http_received_header')) {
+ $nldlm = "\r\n\t";
+ $encrypt = $RCMAIL->config->get('http_received_header_encrypt');
+
+ // FROM/VIA
+ $http_header = 'from ';
+
+ if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+ $hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'], 2);
+ $hostname = gethostbyaddr($hosts[0]);
+
+ if ($encrypt) {
+ $http_header .= rcmail_encrypt_header($hostname);
+ if ($host != $hostname)
+ $http_header .= ' ('. rcmail_encrypt_header($host) . ')';
+ }
+ else {
+ $http_header .= (($host != $hostname) ? $hostname : '[' . $host . ']');
+ if ($host != $hostname)
+ $http_header .= ' (['. $host .'])';
+ }
+ $http_header .= $nldlm . ' via ';
+ }
+
+ $host = $_SERVER['REMOTE_ADDR'];
$hostname = gethostbyaddr($host);
- if ($CONFIG['http_received_header_encrypt']) {
- $http_header .= rcmail_encrypt_header($hostname);
- if ($host != $hostname)
- $http_header .= ' ('. rcmail_encrypt_header($host) . ')';
- } else {
- $http_header .= (($host != $hostname) ? $hostname : '[' . $host . ']');
- if ($host != $hostname)
- $http_header .= ' (['. $host .'])';
- }
- $http_header .= $nldlm . ' via ';
- }
- $host = $_SERVER['REMOTE_ADDR'];
- $hostname = gethostbyaddr($host);
- if ($CONFIG['http_received_header_encrypt']) {
- $http_header .= rcmail_encrypt_header($hostname);
- if ($host != $hostname)
- $http_header .= ' ('. rcmail_encrypt_header($host) . ')';
- } else {
- $http_header .= (($host != $hostname) ? $hostname : '[' . $host . ']');
- if ($host != $hostname)
- $http_header .= ' (['. $host .'])';
- }
- // BY
- $http_header .= $nldlm . 'by ' . $_SERVER['HTTP_HOST'];
- // WITH
- $http_header .= $nldlm . 'with HTTP (' . $_SERVER['SERVER_PROTOCOL'] .
+
+ if ($encrypt) {
+ $http_header .= rcmail_encrypt_header($hostname);
+ if ($host != $hostname)
+ $http_header .= ' ('. rcmail_encrypt_header($host) . ')';
+ }
+ else {
+ $http_header .= (($host != $hostname) ? $hostname : '[' . $host . ']');
+ if ($host != $hostname)
+ $http_header .= ' (['. $host .'])';
+ }
+
+ // BY
+ $http_header .= $nldlm . 'by ' . $_SERVER['HTTP_HOST'];
+
+ // WITH
+ $http_header .= $nldlm . 'with HTTP (' . $_SERVER['SERVER_PROTOCOL'] .
' '.$_SERVER['REQUEST_METHOD'] . '); ' . date('r');
- $http_header = wordwrap($http_header, 69, $nldlm);
+ $http_header = wordwrap($http_header, 69, $nldlm);
- $headers['Received'] = $http_header;
+ $headers['Received'] = $http_header;
}
-$headers['Date'] = rcmail_user_date();
-$headers['From'] = rcube_charset_convert($from_string, RCMAIL_CHARSET, $message_charset);
+$headers['Date'] = $RCMAIL->user_date();
+$headers['From'] = rcube_charset::convert($from_string, RCUBE_CHARSET, $message_charset);
$headers['To'] = $mailto;
// additional recipients
if (!empty($mailcc)) {
- $headers['Cc'] = $mailcc;
+ $headers['Cc'] = $mailcc;
}
if (!empty($mailbcc)) {
- $headers['Bcc'] = $mailbcc;
+ $headers['Bcc'] = $mailbcc;
}
if (($max_recipients = (int) $RCMAIL->config->get('max_recipients')) > 0) {
- if ($RECIPIENT_COUNT > $max_recipients) {
- $OUTPUT->show_message('toomanyrecipients', 'error', array('max' => $max_recipients));
- $OUTPUT->send('iframe');
- }
+ if ($RECIPIENT_COUNT > $max_recipients) {
+ $OUTPUT->show_message('toomanyrecipients', 'error', array('max' => $max_recipients));
+ $OUTPUT->send('iframe');
+ }
}
// add subject
-$headers['Subject'] = trim(get_input_value('_subject', RCUBE_INPUT_POST, TRUE, $message_charset));
+$headers['Subject'] = trim(rcube_utils::get_input_value('_subject', rcube_utils::INPUT_POST, TRUE, $message_charset));
if (!empty($identity_arr['organization'])) {
- $headers['Organization'] = $identity_arr['organization'];
+ $headers['Organization'] = $identity_arr['organization'];
}
-if (!empty($_POST['_replyto'])) {
- $headers['Reply-To'] = rcmail_email_input_format(get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset));
+if ($hdr = rcube_utils::get_input_value('_replyto', rcube_utils::INPUT_POST, TRUE, $message_charset)) {
+ $headers['Reply-To'] = rcmail_email_input_format($hdr);
}
if (!empty($headers['Reply-To'])) {
- $headers['Mail-Reply-To'] = $headers['Reply-To'];
+ $headers['Mail-Reply-To'] = $headers['Reply-To'];
}
-if (!empty($_POST['_followupto'])) {
- $headers['Mail-Followup-To'] = rcmail_email_input_format(get_input_value('_followupto', RCUBE_INPUT_POST, TRUE, $message_charset));
+if ($hdr = rcube_utils::get_input_value('_followupto', rcube_utils::INPUT_POST, TRUE, $message_charset)) {
+ $headers['Mail-Followup-To'] = rcmail_email_input_format();
}
// remember reply/forward UIDs in special headers
if (!empty($COMPOSE['reply_uid']) && $savedraft) {
- $headers['X-Draft-Info'] = array('type' => 'reply', 'uid' => $COMPOSE['reply_uid']);
+ $headers['X-Draft-Info'] = array('type' => 'reply', 'uid' => $COMPOSE['reply_uid']);
}
else if (!empty($COMPOSE['forward_uid']) && $savedraft) {
- $headers['X-Draft-Info'] = array('type' => 'forward', 'uid' => $COMPOSE['forward_uid']);
+ $headers['X-Draft-Info'] = array('type' => 'forward', 'uid' => rcube_imap_generic::compressMessageSet($COMPOSE['forward_uid']));
}
if (!empty($COMPOSE['reply_msgid'])) {
- $headers['In-Reply-To'] = $COMPOSE['reply_msgid'];
+ $headers['In-Reply-To'] = $COMPOSE['reply_msgid'];
}
if (!empty($COMPOSE['references'])) {
- $headers['References'] = $COMPOSE['references'];
+ $headers['References'] = $COMPOSE['references'];
}
if (!empty($_POST['_priority'])) {
- $priority = intval($_POST['_priority']);
- $a_priorities = array(1=>'highest', 2=>'high', 4=>'low', 5=>'lowest');
- if ($str_priority = $a_priorities[$priority]) {
- $headers['X-Priority'] = sprintf("%d (%s)", $priority, ucfirst($str_priority));
- }
+ $priority = intval($_POST['_priority']);
+ $a_priorities = array(1 => 'highest', 2 => 'high', 4 => 'low', 5 => 'lowest');
+
+ if ($str_priority = $a_priorities[$priority]) {
+ $headers['X-Priority'] = sprintf("%d (%s)", $priority, ucfirst($str_priority));
+ }
}
if (!empty($_POST['_receipt'])) {
- $headers['Return-Receipt-To'] = $from_string;
- $headers['Disposition-Notification-To'] = $from_string;
+ $headers['Return-Receipt-To'] = $from_string;
+ $headers['Disposition-Notification-To'] = $from_string;
}
// additional headers
$headers['Message-ID'] = $message_id;
-$headers['X-Sender'] = $from;
+$headers['X-Sender'] = $from;
if (is_array($headers['X-Draft-Info'])) {
- $headers['X-Draft-Info'] = rcmail_draftinfo_encode($headers['X-Draft-Info'] + array('folder' => $COMPOSE['mailbox']));
+ $headers['X-Draft-Info'] = rcmail_draftinfo_encode($headers['X-Draft-Info'] + array('folder' => $COMPOSE['mailbox']));
}
-if (!empty($CONFIG['useragent'])) {
- $headers['User-Agent'] = $CONFIG['useragent'];
+if ($hdr = $RCMAIL->config->get('useragent')) {
+ $headers['User-Agent'] = $hdr;
}
// exec hook for header checking and manipulation
@@ -460,85 +250,85 @@ $data = $RCMAIL->plugins->exec_hook('message_outgoing_headers', array('headers'
// sending aborted by plugin
if ($data['abort'] && !$savedraft) {
- $OUTPUT->show_message($data['message'] ? $data['message'] : 'sendingfailed');
- $OUTPUT->send('iframe');
+ $OUTPUT->show_message($data['message'] ? $data['message'] : 'sendingfailed');
+ $OUTPUT->send('iframe');
+}
+else {
+ $headers = $data['headers'];
}
-else
- $headers = $data['headers'];
-
-$isHtml = (bool) get_input_value('_is_html', RCUBE_INPUT_POST);
+$isHtml = (bool) rcube_utils::get_input_value('_is_html', rcube_utils::INPUT_POST);
// fetch message body
-$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
+$message_body = rcube_utils::get_input_value('_message', rcube_utils::INPUT_POST, TRUE, $message_charset);
if ($isHtml) {
- $bstyle = array();
+ $bstyle = array();
- if ($font_size = $RCMAIL->config->get('default_font_size')) {
- $bstyle[] = 'font-size: ' . $font_size;
- }
- if ($font_family = $RCMAIL->config->get('default_font')) {
- $bstyle[] = 'font-family: ' . rcmail::font_defs($font_family);
- }
+ if ($font_size = $RCMAIL->config->get('default_font_size')) {
+ $bstyle[] = 'font-size: ' . $font_size;
+ }
+ if ($font_family = $RCMAIL->config->get('default_font')) {
+ $bstyle[] = 'font-family: ' . rcmail::font_defs($font_family);
+ }
- // append doctype and html/body wrappers
- $message_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">'
- . "\r\n<html><body" . (!empty($bstyle) ? " style='" . implode($bstyle, '; ') . "'" : '') . ">\r\n"
- . $message_body;
+ // append doctype and html/body wrappers
+ $message_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">'
+ . "\r\n<html><body" . (!empty($bstyle) ? " style='" . implode($bstyle, '; ') . "'" : '') . ">\r\n"
+ . $message_body;
}
if (!$savedraft) {
- if ($isHtml) {
- // remove signature's div ID
- $message_body = preg_replace('/\s*id="_rc_sig"/', '', $message_body);
+ if ($isHtml) {
+ // remove signature's div ID
+ $message_body = preg_replace('/\s*id="_rc_sig"/', '', $message_body);
+
+ // add inline css for blockquotes
+ $bstyle = 'padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px';
+ $message_body = preg_replace('/<blockquote>/',
+ '<blockquote type="cite" style="'.$bstyle.'">', $message_body);
+ }
- // add inline css for blockquotes
- $bstyle = 'padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px';
- $message_body = preg_replace('/<blockquote>/',
- '<blockquote type="cite" style="'.$bstyle.'">', $message_body);
- }
+ // Check spelling before send
+ if ($RCMAIL->config->get('spellcheck_before_send') && $RCMAIL->config->get('enable_spellcheck')
+ && empty($COMPOSE['spell_checked']) && !empty($message_body)
+ ) {
+ $message_body = str_replace("\r\n", "\n", $message_body);
+ $spellchecker = new rcube_spellchecker(rcube_utils::get_input_value('_lang', rcube_utils::INPUT_GPC));
+ $spell_result = $spellchecker->check($message_body, $isHtml);
- // Check spelling before send
- if ($CONFIG['spellcheck_before_send'] && $CONFIG['enable_spellcheck']
- && empty($COMPOSE['spell_checked']) && !empty($message_body)
- ) {
- $message_body = str_replace("\r\n", "\n", $message_body);
- $spellchecker = new rcube_spellchecker(get_input_value('_lang', RCUBE_INPUT_GPC));
- $spell_result = $spellchecker->check($message_body, $isHtml);
+ $COMPOSE['spell_checked'] = true;
- $COMPOSE['spell_checked'] = true;
+ if (!$spell_result) {
+ $result = $isHtml ? $spellchecker->get_words() : $spellchecker->get_xml();
- if (!$spell_result) {
- $result = $isHtml ? $spellchecker->get_words() : $spellchecker->get_xml();
- $OUTPUT->show_message('mispellingsfound', 'error');
- $OUTPUT->command('spellcheck_resume', $isHtml, $result);
- $OUTPUT->send('iframe');
+ $OUTPUT->show_message('mispellingsfound', 'error');
+ $OUTPUT->command('spellcheck_resume', $isHtml, $result);
+ $OUTPUT->send('iframe');
+ }
}
- }
- // generic footer for all messages
- if ($footer = rcmail_generic_message_footer($isHtml)) {
- $footer = rcube_charset_convert($footer, RCMAIL_CHARSET, $message_charset);
- $message_body .= "\r\n" . $footer;
- }
+ // generic footer for all messages
+ if ($footer = rcmail_generic_message_footer($isHtml)) {
+ $footer = rcube_charset::convert($footer, RCUBE_CHARSET, $message_charset);
+ $message_body .= "\r\n" . $footer;
+ }
}
if ($isHtml) {
- $message_body .= "\r\n</body></html>\r\n";
+ $message_body .= "\r\n</body></html>\r\n";
}
// sort attachments to make sure the order is the same as in the UI (#1488423)
-$files = get_input_value('_attachments', RCUBE_INPUT_POST);
-if ($files) {
- $files = explode(',', $files);
- $files = array_flip($files);
- foreach ($files as $idx => $val) {
- $files[$idx] = $COMPOSE['attachments'][$idx];
- unset($COMPOSE['attachments'][$idx]);
- }
+if ($files = rcube_utils::get_input_value('_attachments', rcube_utils::INPUT_POST)) {
+ $files = explode(',', $files);
+ $files = array_flip($files);
+ foreach ($files as $idx => $val) {
+ $files[$idx] = $COMPOSE['attachments'][$idx];
+ unset($COMPOSE['attachments'][$idx]);
+ }
- $COMPOSE['attachments'] = array_merge(array_filter($files), $COMPOSE['attachments']);
+ $COMPOSE['attachments'] = array_merge(array_filter($files), $COMPOSE['attachments']);
}
// set line length for body wrapping
@@ -552,110 +342,142 @@ $MAIL_MIME = new Mail_mime("\r\n");
// Check if we have enough memory to handle the message in it
// It's faster than using files, so we'll do this if we only can
-if (is_array($COMPOSE['attachments']) && $CONFIG['smtp_server']
- && ($mem_limit = parse_bytes(ini_get('memory_limit'))))
-{
- $memory = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB
-
- foreach ($COMPOSE['attachments'] as $id => $attachment)
- $memory += $attachment['size'];
+if (is_array($COMPOSE['attachments']) && $RCMAIL->config->get('smtp_server')
+ && ($mem_limit = parse_bytes(ini_get('memory_limit')))
+) {
+ $memory = 0;
+ foreach ($COMPOSE['attachments'] as $id => $attachment) {
+ $memory += $attachment['size'];
+ }
- // Yeah, Net_SMTP needs up to 12x more memory, 1.33 is for base64
- if ($memory * 1.33 * 12 > $mem_limit)
- $MAIL_MIME->setParam('delay_file_io', true);
+ // Yeah, Net_SMTP needs up to 12x more memory, 1.33 is for base64
+ if (!rcube_utils::mem_check($memory * 1.33 * 12)) {
+ $MAIL_MIME->setParam('delay_file_io', true);
+ }
}
// For HTML-formatted messages, construct the MIME message with both
// the HTML part and the plain-text part
-
if ($isHtml) {
- $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
- array('body' => $message_body, 'type' => 'html', 'message' => $MAIL_MIME));
+ $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
+ array('body' => $message_body, 'type' => 'html', 'message' => $MAIL_MIME));
- $MAIL_MIME->setHTMLBody($plugin['body']);
+ $MAIL_MIME->setHTMLBody($plugin['body']);
- // replace emoticons
- $plugin['body'] = rcmail_replace_emoticons($plugin['body']);
+ // replace emoticons
+ $plugin['body'] = $RCMAIL->replace_emoticons($plugin['body']);
- // add a plain text version of the e-mail as an alternative part.
- $h2t = new rcube_html2text($plugin['body'], false, true, 0, $message_charset);
- $plainTextPart = rc_wordwrap($h2t->get_text(), $LINE_LENGTH, "\r\n", false, $message_charset);
- $plainTextPart = wordwrap($plainTextPart, 998, "\r\n", true);
+ // add a plain text version of the e-mail as an alternative part.
+ $h2t = new rcube_html2text($plugin['body'], false, true, 0, $message_charset);
+ $plainTextPart = rcube_mime::wordwrap($h2t->get_text(), $LINE_LENGTH, "\r\n", false, $message_charset);
+ $plainTextPart = wordwrap($plainTextPart, 998, "\r\n", true);
- // make sure all line endings are CRLF (#1486712)
- $plainTextPart = preg_replace('/\r?\n/', "\r\n", $plainTextPart);
+ // make sure all line endings are CRLF (#1486712)
+ $plainTextPart = preg_replace('/\r?\n/', "\r\n", $plainTextPart);
- $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
- array('body' => $plainTextPart, 'type' => 'alternative', 'message' => $MAIL_MIME));
+ $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
+ array('body' => $plainTextPart, 'type' => 'alternative', 'message' => $MAIL_MIME));
- $MAIL_MIME->setTXTBody($plugin['body']);
+ $MAIL_MIME->setTXTBody($plugin['body']);
- // look for "emoticon" images from TinyMCE and change their src paths to
- // be file paths on the server instead of URL paths.
- rcmail_fix_emoticon_paths($MAIL_MIME);
+ // look for "emoticon" images from TinyMCE and change their src paths to
+ // be file paths on the server instead of URL paths.
+ rcmail_fix_emoticon_paths($MAIL_MIME);
- // Extract image Data URIs into message attachments (#1488502)
- rcmail_extract_inline_images($MAIL_MIME, $from);
+ // Extract image Data URIs into message attachments (#1488502)
+ rcmail_extract_inline_images($MAIL_MIME, $from);
}
else {
- $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
- array('body' => $message_body, 'type' => 'plain', 'message' => $MAIL_MIME));
+ $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
+ array('body' => $message_body, 'type' => 'plain', 'message' => $MAIL_MIME));
- $message_body = $plugin['body'];
+ $message_body = $plugin['body'];
- // compose format=flowed content if enabled
- if ($flowed = ($savedraft || $RCMAIL->config->get('send_format_flowed', true)))
- $message_body = rcube_mime::format_flowed($message_body, min($LINE_LENGTH+2, 79), $message_charset);
- else
- $message_body = rc_wordwrap($message_body, $LINE_LENGTH, "\r\n", false, $message_charset);
+ // compose format=flowed content if enabled
+ if ($flowed = ($savedraft || $RCMAIL->config->get('send_format_flowed', true)))
+ $message_body = rcube_mime::format_flowed($message_body, min($LINE_LENGTH+2, 79), $message_charset);
+ else
+ $message_body = rcube_mime::wordwrap($message_body, $LINE_LENGTH, "\r\n", false, $message_charset);
- $message_body = wordwrap($message_body, 998, "\r\n", true);
+ $message_body = wordwrap($message_body, 998, "\r\n", true);
- $MAIL_MIME->setTXTBody($message_body, false, true);
+ $MAIL_MIME->setTXTBody($message_body, false, true);
}
// add stored attachments, if any
-if (is_array($COMPOSE['attachments']))
-{
- foreach ($COMPOSE['attachments'] as $id => $attachment) {
- // This hook retrieves the attachment contents from the file storage backend
- $attachment = $RCMAIL->plugins->exec_hook('attachment_get', $attachment);
+if (is_array($COMPOSE['attachments'])) {
+ foreach ($COMPOSE['attachments'] as $id => $attachment) {
+ // This hook retrieves the attachment contents from the file storage backend
+ $attachment = $RCMAIL->plugins->exec_hook('attachment_get', $attachment);
+
+ if ($isHtml) {
+ $dispurl = '/\ssrc\s*=\s*[\'"]*\S+display-attachment\S+file=rcmfile'
+ . preg_quote($attachment['id']) . '[\s\'"]*/';
+ $message_body = $MAIL_MIME->getHTMLBody();
+ $is_inline = preg_match($dispurl, $message_body);
+ }
+ else {
+ $is_inline = false;
+ }
- $dispurl = '/\ssrc\s*=\s*[\'"]*\S+display-attachment\S+file=rcmfile' . preg_quote($attachment['id']) . '[\s\'"]*/';
- $message_body = $MAIL_MIME->getHTMLBody();
- if ($isHtml && (preg_match($dispurl, $message_body) > 0)) {
- $message_body = preg_replace($dispurl, ' src="'.$attachment['name'].'" ', $message_body);
- $MAIL_MIME->setHTMLBody($message_body);
+ // inline image
+ if ($is_inline) {
+ // Mail_Mime does not support many inline attachments with the same name (#1489406)
+ // we'll generate cid: urls here to workaround this
+ $cid = preg_replace('/[^0-9a-zA-Z]/', '', uniqid(time(), true));
+ if (preg_match('#(@[0-9a-zA-Z\-\.]+)#', $from, $matches)) {
+ $cid .= $matches[1];
+ }
+ else {
+ $cid .= '@localhost';
+ }
- if ($attachment['data'])
- $MAIL_MIME->addHTMLImage($attachment['data'], $attachment['mimetype'], $attachment['name'], false);
- else
- $MAIL_MIME->addHTMLImage($attachment['path'], $attachment['mimetype'], $attachment['name'], true);
- }
- else {
- $ctype = str_replace('image/pjpeg', 'image/jpeg', $attachment['mimetype']); // #1484914
- $file = $attachment['data'] ? $attachment['data'] : $attachment['path'];
+ $message_body = preg_replace($dispurl, ' src="cid:' . $cid . '" ', $message_body);
+
+ $MAIL_MIME->setHTMLBody($message_body);
- $MAIL_MIME->addAttachment($file,
- $ctype,
- $attachment['name'],
- ($attachment['data'] ? false : true),
- ($ctype == 'message/rfc822' ? '8bit' : 'base64'),
- 'attachment',
- '', '', '',
- $CONFIG['mime_param_folding'] ? 'quoted-printable' : NULL,
- $CONFIG['mime_param_folding'] == 2 ? 'quoted-printable' : NULL,
- '', RCMAIL_CHARSET
- );
+ if ($attachment['data'])
+ $MAIL_MIME->addHTMLImage($attachment['data'], $attachment['mimetype'], $attachment['name'], false, $cid);
+ else
+ $MAIL_MIME->addHTMLImage($attachment['path'], $attachment['mimetype'], $attachment['name'], true, $cid);
+ }
+ else {
+ $ctype = str_replace('image/pjpeg', 'image/jpeg', $attachment['mimetype']); // #1484914
+ $file = $attachment['data'] ? $attachment['data'] : $attachment['path'];
+ $folding = (int) $RCMAIL->config->get('mime_param_folding');
+
+ $MAIL_MIME->addAttachment($file,
+ $ctype,
+ $attachment['name'],
+ $attachment['data'] ? false : true,
+ $ctype == 'message/rfc822' ? '8bit' : 'base64',
+ 'attachment',
+ '', '', '',
+ $folding ? 'quoted-printable' : NULL,
+ $folding == 2 ? 'quoted-printable' : NULL,
+ '', RCUBE_CHARSET
+ );
+ }
}
- }
}
// choose transfer encoding for plain/text body
-if (preg_match('/[^\x00-\x7F]/', $MAIL_MIME->getTXTBody()))
- $transfer_encoding = $RCMAIL->config->get('force_7bit') ? 'quoted-printable' : '8bit';
-else
- $transfer_encoding = '7bit';
+if (preg_match('/[^\x00-\x7F]/', $MAIL_MIME->getTXTBody())) {
+ $text_charset = $message_charset;
+ $transfer_encoding = $RCMAIL->config->get('force_7bit') ? 'quoted-printable' : '8bit';
+}
+else {
+ $text_charset = '';
+ $transfer_encoding = '7bit';
+}
+
+if ($flowed) {
+ if (!$text_charset) {
+ $text_charset = 'US-ASCII';
+ }
+
+ $text_charset .= ";\r\n format=flowed";
+}
// encoding settings for mail composing
$MAIL_MIME->setParam('text_encoding', $transfer_encoding);
@@ -663,191 +485,432 @@ $MAIL_MIME->setParam('html_encoding', 'quoted-printable');
$MAIL_MIME->setParam('head_encoding', 'quoted-printable');
$MAIL_MIME->setParam('head_charset', $message_charset);
$MAIL_MIME->setParam('html_charset', $message_charset);
-$MAIL_MIME->setParam('text_charset', $message_charset . ($flowed ? ";\r\n format=flowed" : ''));
+$MAIL_MIME->setParam('text_charset', $text_charset);
// encoding subject header with mb_encode provides better results with asian characters
if (function_exists('mb_encode_mimeheader')) {
- mb_internal_encoding($message_charset);
- $headers['Subject'] = mb_encode_mimeheader($headers['Subject'],
- $message_charset, 'Q', "\r\n", 8);
- mb_internal_encoding(RCMAIL_CHARSET);
+ mb_internal_encoding($message_charset);
+ $headers['Subject'] = mb_encode_mimeheader($headers['Subject'],
+ $message_charset, 'Q', "\r\n", 8);
+ mb_internal_encoding(RCUBE_CHARSET);
}
// pass headers to message object
$MAIL_MIME->headers($headers);
// Begin SMTP Delivery Block
-if (!$savedraft)
-{
- // check 'From' address (identity may be incomplete)
- if (empty($from)) {
- $OUTPUT->show_message('nofromaddress', 'error');
- $OUTPUT->send('iframe');
- }
-
- // Handle Delivery Status Notification request
- if (!empty($_POST['_dsn'])) {
- $smtp_opts['dsn'] = true;
- }
-
- $sent = rcmail_deliver_message($MAIL_MIME, $from, $mailto,
- $smtp_error, $mailbody_file, $smtp_opts);
+if (!$savedraft) {
+ // check 'From' address (identity may be incomplete)
+ if (empty($from)) {
+ $OUTPUT->show_message('nofromaddress', 'error');
+ $OUTPUT->send('iframe');
+ }
- // return to compose page if sending failed
- if (!$sent) {
- // remove temp file
- if ($mailbody_file) {
- unlink($mailbody_file);
+ // Handle Delivery Status Notification request
+ if (!empty($_POST['_dsn'])) {
+ $smtp_opts['dsn'] = true;
}
- if ($smtp_error)
- $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
- else
- $OUTPUT->show_message('sendingfailed', 'error');
- $OUTPUT->send('iframe');
- }
+ $sent = $RCMAIL->deliver_message($MAIL_MIME, $from, $mailto,
+ $smtp_error, $mailbody_file, $smtp_opts);
- // save message sent time
- if (!empty($CONFIG['sendmail_delay']))
- $RCMAIL->user->save_prefs(array('last_message_time' => time()));
+ // return to compose page if sending failed
+ if (!$sent) {
+ // remove temp file
+ if ($mailbody_file) {
+ unlink($mailbody_file);
+ }
- // set replied/forwarded flag
- if ($COMPOSE['reply_uid'])
- $RCMAIL->storage->set_flag($COMPOSE['reply_uid'], 'ANSWERED', $COMPOSE['mailbox']);
- else if ($COMPOSE['forward_uid'])
- $RCMAIL->storage->set_flag($COMPOSE['forward_uid'], 'FORWARDED', $COMPOSE['mailbox']);
+ if ($smtp_error)
+ $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
+ else
+ $OUTPUT->show_message('sendingfailed', 'error');
+ $OUTPUT->send('iframe');
+ }
-} // End of SMTP Delivery Block
+ // save message sent time
+ if ($sendmail_delay) {
+ $RCMAIL->user->save_prefs(array('last_message_time' => time()));
+ }
+ // set replied/forwarded flag
+ if ($COMPOSE['reply_uid'])
+ $RCMAIL->storage->set_flag($COMPOSE['reply_uid'], 'ANSWERED', $COMPOSE['mailbox']);
+ else if ($COMPOSE['forward_uid'])
+ $RCMAIL->storage->set_flag($COMPOSE['forward_uid'], 'FORWARDED', $COMPOSE['mailbox']);
+}
// Determine which folder to save message
-if ($savedraft)
- $store_target = $CONFIG['drafts_mbox'];
-else if (!$RCMAIL->config->get('no_save_sent_messages'))
- $store_target = isset($_POST['_store_target']) ? get_input_value('_store_target', RCUBE_INPUT_POST) : $CONFIG['sent_mbox'];
+if ($savedraft) {
+ $store_target = $drafts_mbox;
+}
+else if (!$RCMAIL->config->get('no_save_sent_messages')) {
+ $store_target = rcube_utils::get_input_value('_store_target', rcube_utils::INPUT_POST);
+ if (!strlen($store_target)) {
+ $sore_target = $RCMAIL->config->get('sent_mbox');
+ }
+}
if ($store_target) {
- // check if folder is subscribed
- if ($RCMAIL->storage->folder_exists($store_target, true))
- $store_folder = true;
- // folder may be existing but not subscribed (#1485241)
- else if (!$RCMAIL->storage->folder_exists($store_target))
- $store_folder = $RCMAIL->storage->create_folder($store_target, true);
- else if ($RCMAIL->storage->subscribe($store_target))
- $store_folder = true;
-
- // append message to sent box
- if ($store_folder) {
- // message body in file
- if ($mailbody_file || $MAIL_MIME->getParam('delay_file_io')) {
- $headers = $MAIL_MIME->txtHeaders();
-
- // file already created
- if ($mailbody_file)
- $msg = $mailbody_file;
- else {
- $temp_dir = $RCMAIL->config->get('temp_dir');
- $mailbody_file = tempnam($temp_dir, 'rcmMsg');
- if (!PEAR::isError($msg = $MAIL_MIME->saveMessageBody($mailbody_file)))
- $msg = $mailbody_file;
- }
+ // check if folder is subscribed
+ if ($RCMAIL->storage->folder_exists($store_target, true)) {
+ $store_folder = true;
}
- else {
- $msg = $MAIL_MIME->getMessage();
- $headers = '';
+ // folder may be existing but not subscribed (#1485241)
+ else if (!$RCMAIL->storage->folder_exists($store_target)) {
+ $store_folder = $RCMAIL->storage->create_folder($store_target, true);
}
-
- if (PEAR::isError($msg))
- raise_error(array('code' => 650, 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Could not create message: ".$msg->getMessage()),
- TRUE, FALSE);
- else {
- $saved = $RCMAIL->storage->save_message($store_target, $msg, $headers,
- $mailbody_file ? true : false, array('SEEN'));
+ else if ($RCMAIL->storage->subscribe($store_target)) {
+ $store_folder = true;
}
- if ($mailbody_file) {
- unlink($mailbody_file);
- $mailbody_file = null;
- }
- }
+ // append message to sent box
+ if ($store_folder) {
+ // message body in file
+ if ($mailbody_file || $MAIL_MIME->getParam('delay_file_io')) {
+ $headers = $MAIL_MIME->txtHeaders();
- // raise error if saving failed
- if (!$saved) {
- raise_error(array('code' => 800, 'type' => 'imap',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Could not save message in $store_target"), TRUE, FALSE);
+ // file already created
+ if ($mailbody_file) {
+ $msg = $mailbody_file;
+ }
+ else {
+ $temp_dir = $RCMAIL->config->get('temp_dir');
+ $mailbody_file = tempnam($temp_dir, 'rcmMsg');
- if ($savedraft) {
- $OUTPUT->show_message('errorsaving', 'error');
- // start the auto-save timer again
- $OUTPUT->command('auto_save_start');
- $OUTPUT->send('iframe');
- }
- }
+ if (!PEAR::isError($msg = $MAIL_MIME->saveMessageBody($mailbody_file))) {
+ $msg = $mailbody_file;
+ }
+ }
+ }
+ else {
+ $msg = $MAIL_MIME->getMessage();
+ $headers = '';
+ }
- if ($olddraftmessageid) {
- // delete previous saved draft
- // @TODO: use message UID (remember to check UIDVALIDITY) to skip this SEARCH
- $delete_idx = $RCMAIL->storage->search_once($CONFIG['drafts_mbox'],
- 'HEADER Message-ID '.$olddraftmessageid);
+ if (PEAR::isError($msg)) {
+ rcube::raise_error(array('code' => 650, 'type' => 'php',
+ 'file' => __FILE__, 'line' => __LINE__,
+ 'message' => "Could not create message: ".$msg->getMessage()),
+ true, false);
+ }
+ else {
+ $saved = $RCMAIL->storage->save_message($store_target, $msg, $headers,
+ $mailbody_file ? true : false, array('SEEN'));
+ }
- if ($del_uid = $delete_idx->get_element('FIRST')) {
- $deleted = $RCMAIL->storage->delete_message($del_uid, $CONFIG['drafts_mbox']);
+ if ($mailbody_file) {
+ unlink($mailbody_file);
+ $mailbody_file = null;
+ }
+ }
- // raise error if deletion of old draft failed
- if (!$deleted)
- raise_error(array('code' => 800, 'type' => 'imap',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Could not delete message from ".$CONFIG['drafts_mbox']), TRUE, FALSE);
+ // raise error if saving failed
+ if (!$saved) {
+ rcube::raise_error(array('code' => 800, 'type' => 'imap',
+ 'file' => __FILE__, 'line' => __LINE__,
+ 'message' => "Could not save message in $store_target"), true, false);
+
+ if ($savedraft) {
+ $OUTPUT->show_message('errorsaving', 'error');
+ // start the auto-save timer again
+ $OUTPUT->command('auto_save_start');
+ $OUTPUT->send('iframe');
+ }
+ }
+
+ // delete previous saved draft
+ if ($saved && ($old_id = rcube_utils::get_input_value('_draft_saveid', rcube_utils::INPUT_POST))) {
+ $deleted = $RCMAIL->storage->delete_message($old_id, $drafts_mbox);
+
+ // raise error if deletion of old draft failed
+ if (!$deleted) {
+ rcube::raise_error(array('code' => 800, 'type' => 'imap',
+ 'file' => __FILE__, 'line' => __LINE__,
+ 'message' => "Could not delete message from $drafts_mbox"), true, false);
+ }
}
- }
}
// remove temp file
else if ($mailbody_file) {
- unlink($mailbody_file);
+ unlink($mailbody_file);
}
if ($savedraft) {
- $msgid = strtr($message_id, array('>' => '', '<' => ''));
+ // remember new draft-uid ($saved could be an UID or true/false here)
+ if ($saved && is_bool($saved)) {
+ $index = $RCMAIL->storage->search_once($drafts_mbox, 'HEADER Message-ID ' . $message_id);
+ $saved = @max($index->get());
+ }
- // remember new draft-uid ($saved could be an UID or TRUE here)
- if (is_bool($saved)) {
- $draft_idx = $RCMAIL->storage->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid);
- $saved = $draft_idx->get_element('FIRST');
- }
- $COMPOSE['param']['draft_uid'] = $saved;
- $plugin = $RCMAIL->plugins->exec_hook('message_draftsaved', array('msgid' => $msgid, 'uid' => $saved, 'folder' => $store_target));
+ if ($saved) {
+ $plugin = $RCMAIL->plugins->exec_hook('message_draftsaved',
+ array('msgid' => $message_id, 'uid' => $saved, 'folder' => $store_target));
- // display success
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'messagesaved', 'confirmation');
+ // display success
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'messagesaved', 'confirmation');
- // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning
- $OUTPUT->command('set_draft_id', $msgid);
- $OUTPUT->command('compose_field_hash', true);
+ // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning
+ $COMPOSE['param']['draft_uid'] = $plugin['uid'];
+ $OUTPUT->command('set_draft_id', $plugin['uid']);
+ $OUTPUT->command('compose_field_hash', true);
+ }
- // start the auto-save timer again
- $OUTPUT->command('auto_save_start');
+ // start the auto-save timer again
+ $OUTPUT->command('auto_save_start');
}
else {
- $folders = array();
+ $folders = array();
- if ($COMPOSE['mode'] == 'reply' || $COMPOSE['mode'] == 'forward')
- $folders[] = $COMPOSE['mailbox'];
+ if ($COMPOSE['mode'] == 'reply' || $COMPOSE['mode'] == 'forward') {
+ $folders[] = $COMPOSE['mailbox'];
+ }
- rcmail_compose_cleanup($COMPOSE_ID);
+ rcmail_compose_cleanup($COMPOSE_ID);
+ $OUTPUT->command('remove_compose_data', $COMPOSE_ID);
- if ($store_folder && !$saved)
- $OUTPUT->command('sent_successfully', 'error', rcube_label('errorsavingsent'), $folders);
- else {
- if ($store_folder) {
- $folders[] = $store_target;
+ if ($store_folder && !$saved) {
+ $OUTPUT->command('sent_successfully', 'error', $RCMAIL->gettext('errorsavingsent'), $folders);
+ }
+ else if ($store_folder) {
+ $folders[] = $store_target;
}
- $OUTPUT->command('sent_successfully', 'confirmation', rcube_label('messagesent'), $folders);
- }
+ $OUTPUT->command('sent_successfully', 'confirmation', $RCMAIL->gettext('messagesent'), $folders);
}
$OUTPUT->send('iframe');
+
+
+/****** message sending functions ********/
+
+// encrypt parts of the header
+function rcmail_encrypt_header($what)
+{
+ global $RCMAIL;
+
+ if (!$RCMAIL->config->get('http_received_header_encrypt')) {
+ return $what;
+ }
+
+ return $RCMAIL->encrypt($what);
+}
+
+// get identity record
+function rcmail_get_identity($id)
+{
+ global $RCMAIL, $message_charset;
+
+ if ($sql_arr = $RCMAIL->user->get_identity($id)) {
+ $out = $sql_arr;
+
+ if ($message_charset != RCUBE_CHARSET) {
+ foreach ($out as $k => $v) {
+ $out[$k] = rcube_charset::convert($v, RCUBE_CHARSET, $message_charset);
+ }
+ }
+
+ $out['mailto'] = $sql_arr['email'];
+ $out['string'] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
+
+ return $out;
+ }
+
+ return false;
+}
+
+/**
+ * go from this:
+ * <img src="http[s]://.../tiny_mce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" />
+ *
+ * to this:
+ *
+ * <img src="/path/on/server/.../tiny_mce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" />
+ */
+function rcmail_fix_emoticon_paths($mime_message)
+{
+ global $RCMAIL;
+
+ $body = $mime_message->getHTMLBody();
+
+ // remove any null-byte characters before parsing
+ $body = preg_replace('/\x00/', '', $body);
+
+ $searchstr = 'program/js/tiny_mce/plugins/emotions/img/';
+ $offset = 0;
+
+ // keep track of added images, so they're only added once
+ $included_images = array();
+
+ if (preg_match_all('# src=[\'"]([^\'"]+)#', $body, $matches, PREG_OFFSET_CAPTURE)) {
+ foreach ($matches[1] as $m) {
+ // find emoticon image tags
+ if (preg_match('#'.$searchstr.'(.*)$#', $m[0], $imatches)) {
+ $image_name = $imatches[1];
+
+ // sanitize image name so resulting attachment doesn't leave images dir
+ $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i', '', $image_name);
+ $img_file = INSTALL_PATH . '/' . $searchstr . $image_name;
+
+ if (! in_array($image_name, $included_images)) {
+ // add the image to the MIME message
+ if (!$mime_message->addHTMLImage($img_file, 'image/gif', '', true, $image_name)) {
+ $RCMAIL->output->show_message("emoticonerror", 'error');
+ }
+
+ array_push($included_images, $image_name);
+ }
+
+ $body = substr_replace($body, $img_file, $m[1] + $offset, strlen($m[0]));
+ $offset += strlen($img_file) - strlen($m[0]);
+ }
+ }
+ }
+
+ $mime_message->setHTMLBody($body);
+}
+
+/**
+ * Extract image attachments from HTML content (data URIs)
+ */
+function rcmail_extract_inline_images($mime_message, $from)
+{
+ $body = $mime_message->getHTMLBody();
+ $offset = 0;
+ $list = array();
+ $domain = 'localhost';
+ $regexp = '#img[^>]+src=[\'"](data:([^;]*);base64,([a-z0-9+/=\r\n]+))([\'"])#i';
+
+ if (preg_match_all($regexp, $body, $matches, PREG_OFFSET_CAPTURE)) {
+ // get domain for the Content-ID, must be the same as in Mail_Mime::get()
+ if (preg_match('#@([0-9a-zA-Z\-\.]+)#', $from, $m)) {
+ $domain = $m[1];
+ }
+
+ foreach ($matches[1] as $idx => $m) {
+ $data = preg_replace('/\r\n/', '', $matches[3][$idx][0]);
+ $data = base64_decode($data);
+
+ if (empty($data)) {
+ continue;
+ }
+
+ $hash = md5($data) . '@' . $domain;
+ $mime_type = $matches[2][$idx][0];
+ $name = $list[$hash];
+
+ if (empty($mime_type)) {
+ $mime_type = rcube_mime::image_content_type($data);
+ }
+
+ // add the image to the MIME message
+ if (!$name) {
+ $ext = preg_replace('#^[^/]+/#', '', $mime_type);
+ $name = substr($hash, 0, 8) . '.' . $ext;
+ $list[$hash] = $name;
+
+ $mime_message->addHTMLImage($data, $mime_type, $name, false, $hash);
+ }
+
+ $body = substr_replace($body, $name, $m[1] + $offset, strlen($m[0]));
+ $offset += strlen($name) - strlen($m[0]);
+ }
+ }
+
+ $mime_message->setHTMLBody($body);
+}
+
+/**
+ * Parse and cleanup email address input (and count addresses)
+ *
+ * @param string Address input
+ * @param boolean Do count recipients (saved in global $RECIPIENT_COUNT)
+ * @param boolean Validate addresses (errors saved in global $EMAIL_FORMAT_ERROR)
+ * @return string Canonical recipients string separated by comma
+ */
+function rcmail_email_input_format($mailto, $count=false, $check=true)
+{
+ global $RCMAIL, $EMAIL_FORMAT_ERROR, $RECIPIENT_COUNT;
+
+ // simplified email regexp, supporting quoted local part
+ $email_regexp = '(\S+|("[^"]+"))@\S+';
+
+ $delim = trim($RCMAIL->config->get('recipients_separator', ','));
+ $regexp = array("/[,;$delim]\s*[\r\n]+/", '/[\r\n]+/', "/[,;$delim]\s*\$/m", '/;/', '/(\S{1})(<'.$email_regexp.'>)/U');
+ $replace = array($delim.' ', ', ', '', $delim, '\\1 \\2');
+
+ // replace new lines and strip ending ', ', make address input more valid
+ $mailto = trim(preg_replace($regexp, $replace, $mailto));
+ $items = rcube_utils::explode_quoted_string($delim, $mailto);
+ $result = array();
+
+ foreach ($items as $item) {
+ $item = trim($item);
+ // address in brackets without name (do nothing)
+ if (preg_match('/^<'.$email_regexp.'>$/', $item)) {
+ $item = rcube_utils::idn_to_ascii(trim($item, '<>'));
+ $result[] = $item;
+ }
+ // address without brackets and without name (add brackets)
+ else if (preg_match('/^'.$email_regexp.'$/', $item)) {
+ $item = rcube_utils::idn_to_ascii($item);
+ $result[] = $item;
+ }
+ // address with name (handle name)
+ else if (preg_match('/<*'.$email_regexp.'>*$/', $item, $matches)) {
+ $address = $matches[0];
+ $name = trim(str_replace($address, '', $item));
+ if ($name[0] == '"' && $name[count($name)-1] == '"') {
+ $name = substr($name, 1, -1);
+ }
+ $name = stripcslashes($name);
+ $address = rcube_utils::idn_to_ascii(trim($address, '<>'));
+ $result[] = format_email_recipient($address, $name);
+ $item = $address;
+ }
+ else if (trim($item)) {
+ continue;
+ }
+
+ // check address format
+ $item = trim($item, '<>');
+ if ($item && $check && !rcube_utils::check_email($item)) {
+ $EMAIL_FORMAT_ERROR = $item;
+ return;
+ }
+ }
+
+ if ($count) {
+ $RECIPIENT_COUNT += count($result);
+ }
+
+ return implode(', ', $result);
+}
+
+
+function rcmail_generic_message_footer($isHtml)
+{
+ global $RCMAIL;
+
+ if ($isHtml && ($file = $RCMAIL->config->get('generic_message_footer_html'))) {
+ $html_footer = true;
+ }
+ else {
+ $file = $RCMAIL->config->get('generic_message_footer');
+ $html_footer = false;
+ }
+
+ if ($file && realpath($file)) {
+ // sanity check
+ if (!preg_match('/\.(php|ini|conf)$/', $file) && strpos($file, '/etc/') === false) {
+ $footer = file_get_contents($file);
+ if ($isHtml && !$html_footer) {
+ $footer = '<pre>' . $footer . '</pre>';
+ }
+ return $footer;
+ }
+ }
+
+ return false;
+}
diff --git a/program/steps/mail/sendmdn.inc b/program/steps/mail/sendmdn.inc
index 01d0807be..727e75bb9 100644
--- a/program/steps/mail/sendmdn.inc
+++ b/program/steps/mail/sendmdn.inc
@@ -5,7 +5,7 @@
| program/steps/mail/sendmdn.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2008-2009, The Roundcube Dev Team |
+ | Copyright (C) 2008-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,23 +20,24 @@
*/
// only process ajax requests
-if (!$OUTPUT->ajax_call)
- return;
+if (!$OUTPUT->ajax_call) {
+ return;
+}
if (!empty($_POST['_uid'])) {
- $sent = rcmail_send_mdn(get_input_value('_uid', RCUBE_INPUT_POST), $smtp_error);
+ $sent = rcmail_send_mdn(rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST), $smtp_error);
}
// show either confirm or error message
if ($sent) {
- $OUTPUT->set_env('mdn_request', false);
- $OUTPUT->show_message('receiptsent', 'confirmation');
+ $OUTPUT->set_env('mdn_request', false);
+ $OUTPUT->show_message('receiptsent', 'confirmation');
}
else if ($smtp_error) {
- $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
+ $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
}
else {
- $OUTPUT->show_message('errorsendingreceipt', 'error');
+ $OUTPUT->show_message('errorsendingreceipt', 'error');
}
$OUTPUT->send();
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 9d85f9c8f..9498d1dc5 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -5,7 +5,7 @@
| program/steps/mail/show.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -22,312 +22,333 @@
$PRINT_MODE = $RCMAIL->action == 'print' ? TRUE : FALSE;
// Read browser capabilities and store them in session
-if ($caps = get_input_value('_caps', RCUBE_INPUT_GET)) {
- $browser_caps = array();
- foreach (explode(',', $caps) as $cap) {
- $cap = explode('=', $cap);
- $browser_caps[$cap[0]] = $cap[1];
- }
- $_SESSION['browser_caps'] = $browser_caps;
+if ($caps = rcube_utils::get_input_value('_caps', rcube_utils::INPUT_GET)) {
+ $browser_caps = array();
+ foreach (explode(',', $caps) as $cap) {
+ $cap = explode('=', $cap);
+ $browser_caps[$cap[0]] = $cap[1];
+ }
+ $_SESSION['browser_caps'] = $browser_caps;
}
-$uid = get_input_value('_uid', RCUBE_INPUT_GET);
+$uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET);
$mbox_name = $RCMAIL->storage->get_folder();
// similar code as in program/steps/mail/get.inc
if ($uid) {
- // set message format (need to be done before rcube_message construction)
- if (!empty($_GET['_format'])) {
- $prefer_html = $_GET['_format'] == 'html';
- $RCMAIL->config->set('prefer_html', $prefer_html);
- $_SESSION['msg_formats'][$mbox_name.':'.$uid] = $prefer_html;
- }
- else if (isset($_SESSION['msg_formats'][$mbox_name.':'.$uid])) {
- $RCMAIL->config->set('prefer_html', $_SESSION['msg_formats'][$mbox_name.':'.$uid]);
- }
-
- $MESSAGE = new rcube_message($uid);
-
- // if message not found (wrong UID)...
- if (empty($MESSAGE->headers)) {
- rcmail_message_error($uid);
- }
-
-
- // show images?
- rcmail_check_safe($MESSAGE);
-
- // set message charset as default
- if (!empty($MESSAGE->headers->charset))
- $RCMAIL->storage->set_charset($MESSAGE->headers->charset);
-
- $OUTPUT->set_pagetitle(abbreviate_string($MESSAGE->subject, 128, '...', true));
-
- // give message uid to the client
- $OUTPUT->set_env('uid', $MESSAGE->uid);
- // set environement
- $OUTPUT->set_env('safemode', $MESSAGE->is_safe);
- $OUTPUT->set_env('sender', $MESSAGE->sender['string']);
- $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
- $OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter());
- $OUTPUT->set_env('mailbox', $mbox_name);
- $OUTPUT->set_env('compose_extwin', $RCMAIL->config->get('compose_extwin',false));
-
- // mimetypes supported by the browser (default settings)
- $mimetypes = (array)$RCMAIL->config->get('client_mimetypes');
-
- // Remove unsupported types, which makes that attachment which cannot be
- // displayed in a browser will be downloaded directly without displaying an overlay page
- if (empty($_SESSION['browser_caps']['pdf']) && ($key = array_search('application/pdf', $mimetypes)) !== false) {
- unset($mimetypes[$key]);
- }
- if (empty($_SESSION['browser_caps']['flash']) && ($key = array_search('application/x-shockwave-flash', $mimetypes)) !== false) {
- unset($mimetypes[$key]);
- }
- if (empty($_SESSION['browser_caps']['tif']) && ($key = array_search('image/tiff', $mimetypes)) !== false) {
- // we can convert tiff to jpeg
- if (!$RCMAIL->config->get('im_convert_path')) {
- unset($mimetypes[$key]);
+ // set message format (need to be done before rcube_message construction)
+ if (!empty($_GET['_format'])) {
+ $prefer_html = $_GET['_format'] == 'html';
+ $RCMAIL->config->set('prefer_html', $prefer_html);
+ $_SESSION['msg_formats'][$mbox_name.':'.$uid] = $prefer_html;
}
- }
-
- $OUTPUT->set_env('mimetypes', array_values($mimetypes));
-
- if ($CONFIG['drafts_mbox'])
- $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
- if ($CONFIG['trash_mbox'])
- $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
- if ($CONFIG['junk_mbox'])
- $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']);
- if ($CONFIG['delete_junk'])
- $OUTPUT->set_env('delete_junk', true);
- if ($CONFIG['flag_for_deletion'])
- $OUTPUT->set_env('flag_for_deletion', true);
- if ($CONFIG['read_when_deleted'])
- $OUTPUT->set_env('read_when_deleted', true);
- if ($CONFIG['skip_deleted'])
- $OUTPUT->set_env('skip_deleted', true);
- if ($CONFIG['display_next'])
- $OUTPUT->set_env('display_next', true);
- if ($MESSAGE->headers->get('list-post', false))
- $OUTPUT->set_env('list_post', true);
- if ($CONFIG['forward_attachment'])
- $OUTPUT->set_env('forward_attachment', true);
-
- if (!$OUTPUT->ajax_call)
- $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
- 'movingmessage', 'deletingmessage', 'markingmessage', 'replyall', 'replylist');
-
- $prefer_html = $RCMAIL->config->get('prefer_html');
- if ($MESSAGE->has_html_part()) {
- $OUTPUT->set_env('optional_format', $prefer_html ? 'text' : 'html');
- }
-
- // check for unset disposition notification
- if ($MESSAGE->headers->mdn_to
- && empty($MESSAGE->headers->flags['MDNSENT'])
- && empty($MESSAGE->headers->flags['SEEN'])
- && ($RCMAIL->storage->check_permflag('MDNSENT') || $RCMAIL->storage->check_permflag('*'))
- && $mbox_name != $CONFIG['drafts_mbox']
- && $mbox_name != $CONFIG['sent_mbox']
- ) {
- $mdn_cfg = intval($CONFIG['mdn_requests']);
-
- if ($mdn_cfg == 1 || (($mdn_cfg == 3 || $mdn_cfg == 4) && rcmail_contact_exists($MESSAGE->sender['mailto']))) {
- // Send MDN
- if (rcmail_send_mdn($MESSAGE, $smtp_error))
- $OUTPUT->show_message('receiptsent', 'confirmation');
- else if ($smtp_error)
- $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
- else
- $OUTPUT->show_message('errorsendingreceipt', 'error');
+ else if (isset($_SESSION['msg_formats'][$mbox_name.':'.$uid])) {
+ $RCMAIL->config->set('prefer_html', $_SESSION['msg_formats'][$mbox_name.':'.$uid]);
}
- else if ($mdn_cfg != 2 && $mdn_cfg != 4) {
- // Ask user
- $OUTPUT->add_label('mdnrequest');
- $OUTPUT->set_env('mdn_request', true);
+
+ $MESSAGE = new rcube_message($uid);
+
+ // if message not found (wrong UID)...
+ if (empty($MESSAGE->headers)) {
+ rcmail_message_error($uid);
}
- }
-
- if (empty($MESSAGE->headers->flags['SEEN'])
- && ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))
- ) {
- $RCMAIL->plugins->exec_hook('message_read', array('uid' => $MESSAGE->uid,
- 'mailbox' => $mbox_name, 'message' => $MESSAGE));
- }
-}
+ // show images?
+ rcmail_check_safe($MESSAGE);
-function rcmail_message_attachments($attrib)
-{
- global $PRINT_MODE, $MESSAGE, $RCMAIL;
-
- $out = $ol = '';
- $attachments = array();
-
- if (sizeof($MESSAGE->attachments)) {
- foreach ($MESSAGE->attachments as $attach_prop) {
- $filename = rcmail_attachment_name($attach_prop, true);
-
- if ($PRINT_MODE) {
- $size = $RCMAIL->message_part_size($attach_prop);
- $ol .= html::tag('li', null, Q(sprintf("%s (%s)", $filename, $size)));
- }
- else {
- if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
- $title = $filename;
- $filename = abbreviate_string($filename, $attrib['maxlength']);
+ // set message charset as default
+ if (!empty($MESSAGE->headers->charset)) {
+ $RCMAIL->storage->set_charset($MESSAGE->headers->charset);
+ }
+
+ $OUTPUT->set_pagetitle(abbreviate_string($MESSAGE->subject, 128, '...', true));
+
+ // set message environment
+ $OUTPUT->set_env('uid', $MESSAGE->uid);
+ $OUTPUT->set_env('safemode', $MESSAGE->is_safe);
+ $OUTPUT->set_env('sender', $MESSAGE->sender['string']);
+ $OUTPUT->set_env('mailbox', $mbox_name);
+ $OUTPUT->set_env('permaurl', $RCMAIL->url(array('_action' => 'show', '_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
+
+ if ($MESSAGE->headers->get('list-post', false)) {
+ $OUTPUT->set_env('list_post', true);
+ }
+
+ // set environment
+ $OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter());
+
+ // set configuration
+ $RCMAIL->set_env_config(array('delete_junk', 'flag_for_deletion', 'read_when_deleted',
+ 'skip_deleted', 'display_next', 'compose_extwin', 'forward_attachment'));
+
+ // set special folders
+ foreach (array('drafts', 'trash', 'junk') as $mbox) {
+ if ($folder = $RCMAIL->config->get($mbox . '_mbox')) {
+ $OUTPUT->set_env($mbox . '_mailbox', $folder);
}
- else {
- $title = '';
+ }
+
+ // mimetypes supported by the browser (default settings)
+ $mimetypes = (array)$RCMAIL->config->get('client_mimetypes');
+
+ // Remove unsupported types, which makes that attachment which cannot be
+ // displayed in a browser will be downloaded directly without displaying an overlay page
+ if (empty($_SESSION['browser_caps']['pdf']) && ($key = array_search('application/pdf', $mimetypes)) !== false) {
+ unset($mimetypes[$key]);
+ }
+ if (empty($_SESSION['browser_caps']['flash']) && ($key = array_search('application/x-shockwave-flash', $mimetypes)) !== false) {
+ unset($mimetypes[$key]);
+ }
+ if (empty($_SESSION['browser_caps']['tif']) && ($key = array_search('image/tiff', $mimetypes)) !== false) {
+ // we can convert tiff to jpeg
+ if (!$RCMAIL->config->get('im_convert_path')) {
+ unset($mimetypes[$key]);
}
+ }
- $mimetype = rcmail_fix_mimetype($attach_prop->mimetype);
- $class = rcmail_filetype2classname($mimetype, $filename);
- $id = 'attach' . $attach_prop->mime_id;
- $link = html::a(array(
- 'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
- 'onclick' => sprintf('return %s.command(\'load-attachment\',\'%s\',this)',
- JS_OBJECT_NAME, $attach_prop->mime_id),
- 'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
- 'title' => Q($title),
- ), Q($filename));
- $ol .= html::tag('li', array('class' => $class, 'id' => $id), $link);
-
- $attachments[$attach_prop->mime_id] = $mimetype;
- }
+ $OUTPUT->set_env('mimetypes', array_values($mimetypes));
+
+ if ($MESSAGE->has_html_part()) {
+ $prefer_html = $RCMAIL->config->get('prefer_html');
+ $OUTPUT->set_env('optional_format', $prefer_html ? 'text' : 'html');
+ }
+
+ if (!$OUTPUT->ajax_call) {
+ $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
+ 'movingmessage', 'deletingmessage', 'markingmessage', 'replyall', 'replylist');
}
- $out = html::tag('ul', $attrib, $ol, html::$common_attrib);
- $RCMAIL->output->set_env('attachments', $attachments);
- }
+ // check for unset disposition notification
+ if ($MESSAGE->headers->mdn_to
+ && empty($MESSAGE->headers->flags['MDNSENT'])
+ && empty($MESSAGE->headers->flags['SEEN'])
+ && ($RCMAIL->storage->check_permflag('MDNSENT') || $RCMAIL->storage->check_permflag('*'))
+ && $mbox_name != $RCMAIL->config->get('drafts_mbox')
+ && $mbox_name != $RCMAIL->config->get('sent_mbox')
+ ) {
+ $mdn_cfg = intval($RCMAIL->config->get('mdn_requests'));
+
+ if ($mdn_cfg == 1 || (($mdn_cfg == 3 || $mdn_cfg == 4) && rcmail_contact_exists($MESSAGE->sender['mailto']))) {
+ // Send MDN
+ if (rcmail_send_mdn($MESSAGE, $smtp_error))
+ $OUTPUT->show_message('receiptsent', 'confirmation');
+ else if ($smtp_error)
+ $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']);
+ else
+ $OUTPUT->show_message('errorsendingreceipt', 'error');
+ }
+ else if ($mdn_cfg != 2 && $mdn_cfg != 4) {
+ // Ask user
+ $OUTPUT->add_label('mdnrequest');
+ $OUTPUT->set_env('mdn_request', true);
+ }
+ }
- return $out;
+ if (empty($MESSAGE->headers->flags['SEEN'])
+ && ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($RCMAIL->config->get('preview_pane_mark_read')) == 0))
+ ) {
+ $RCMAIL->plugins->exec_hook('message_read', array(
+ 'uid' => $MESSAGE->uid,
+ 'mailbox' => $mbox_name,
+ 'message' => $MESSAGE,
+ ));
+ }
}
-function rcmail_remote_objects_msg()
+
+$OUTPUT->add_handlers(array(
+ 'messageattachments' => 'rcmail_message_attachments',
+ 'mailboxname' => 'rcmail_mailbox_name_display',
+ 'messageobjects' => 'rcmail_message_objects',
+ 'contactphoto' => 'rcmail_message_contactphoto',
+));
+
+
+if ($RCMAIL->action == 'print' && $OUTPUT->template_exists('messageprint'))
+ $OUTPUT->send('messageprint', false);
+else if ($RCMAIL->action == 'preview' && $OUTPUT->template_exists('messagepreview'))
+ $OUTPUT->send('messagepreview', false);
+else
+ $OUTPUT->send('message', false);
+
+
+// mark message as read
+if ($MESSAGE && $MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN']) &&
+ ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($RCMAIL->config->get('preview_pane_mark_read')) == 0))
+) {
+ if ($RCMAIL->storage->set_flag($MESSAGE->uid, 'SEEN')) {
+ if ($count = rcmail_get_unseen_count($mbox_name)) {
+ rcmail_set_unseen_count($mbox_name, $count - 1);
+ }
+ }
+}
+
+exit;
+
+
+
+function rcmail_message_attachments($attrib)
{
- global $MESSAGE, $RCMAIL;
+ global $PRINT_MODE, $MESSAGE, $RCMAIL;
+
+ $out = $ol = '';
+ $attachments = array();
+
+ if (sizeof($MESSAGE->attachments)) {
+ foreach ($MESSAGE->attachments as $attach_prop) {
+ $filename = rcmail_attachment_name($attach_prop, true);
+
+ if ($PRINT_MODE) {
+ $size = $RCMAIL->message_part_size($attach_prop);
+ $ol .= html::tag('li', null, rcube::Q(sprintf("%s (%s)", $filename, $size)));
+ }
+ else {
+ if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
+ $title = $filename;
+ $filename = abbreviate_string($filename, $attrib['maxlength']);
+ }
+ else {
+ $title = '';
+ }
+
+ $mimetype = rcmail_fix_mimetype($attach_prop->mimetype);
+ $class = rcube_utils::file2class($mimetype, $filename);
+ $id = 'attach' . $attach_prop->mime_id;
+ $link = html::a(array(
+ 'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
+ 'onclick' => sprintf('return %s.command(\'load-attachment\',\'%s\',this)',
+ rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id),
+ 'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
+ 'title' => rcube::Q($title),
+ ), rcube::Q($filename));
+
+ $ol .= html::tag('li', array('class' => $class, 'id' => $id), $link);
+
+ $attachments[$attach_prop->mime_id] = $mimetype;
+ }
+ }
- $attrib['id'] = 'remote-objects-message';
- $attrib['class'] = 'notice';
- $attrib['style'] = 'display: none';
+ $out = html::tag('ul', $attrib, $ol, html::$common_attrib);
- $msg = Q(rcube_label('blockedimages')) . '&nbsp;';
- $msg .= html::a(array('href' => "#loadimages", 'onclick' => JS_OBJECT_NAME.".command('load-images')"), Q(rcube_label('showimages')));
+ $RCMAIL->output->set_env('attachments', $attachments);
+ }
+
+ return $out;
+}
+
+function rcmail_remote_objects_msg()
+{
+ global $MESSAGE, $RCMAIL;
+
+ $attrib['id'] = 'remote-objects-message';
+ $attrib['class'] = 'notice';
+ $attrib['style'] = 'display: none';
+
+ $msg = rcube::Q($RCMAIL->gettext('blockedimages')) . '&nbsp;';
+ $msg .= html::a(array(
+ 'href' => "#loadimages",
+ 'onclick' => rcmail_output::JS_OBJECT_NAME.".command('load-images')"
+ ),
+ rcube::Q($RCMAIL->gettext('showimages')));
+
+ // add link to save sender in addressbook and reload message
+ if ($MESSAGE->sender['mailto'] && $RCMAIL->config->get('show_images') == 1) {
+ $msg .= ' ' . html::a(array(
+ 'href' => "#alwaysload",
+ 'onclick' => rcmail_output::JS_OBJECT_NAME.".command('always-load')",
+ 'style' => "white-space:nowrap"
+ ),
+ rcube::Q($RCMAIL->gettext(array('name' => 'alwaysshow', 'vars' => array('sender' => $MESSAGE->sender['mailto'])))));
+ }
- // add link to save sender in addressbook and reload message
- if ($MESSAGE->sender['mailto'] && $RCMAIL->config->get('show_images') == 1) {
- $msg .= ' ' . html::a(array('href' => "#alwaysload", 'onclick' => JS_OBJECT_NAME.".command('always-load')", 'style' => "white-space:nowrap"),
- Q(rcube_label(array('name' => 'alwaysshow', 'vars' => array('sender' => $MESSAGE->sender['mailto'])))));
- }
+ $RCMAIL->output->add_gui_object('remoteobjectsmsg', $attrib['id']);
- $RCMAIL->output->add_gui_object('remoteobjectsmsg', $attrib['id']);
- return html::div($attrib, $msg);
+ return html::div($attrib, $msg);
}
function rcmail_message_buttons()
{
- global $RCMAIL;
+ global $RCMAIL;
- $mbox = $RCMAIL->storage->get_folder();
- $delim = $RCMAIL->storage->get_hierarchy_delimiter();
- $dbox = $RCMAIL->config->get('drafts_mbox');
+ $mbox = $RCMAIL->storage->get_folder();
+ $delim = $RCMAIL->storage->get_hierarchy_delimiter();
+ $dbox = $RCMAIL->config->get('drafts_mbox');
- // the message is not a draft
- if ($mbox != $dbox && strpos($mbox, $dbox.$delim) !== 0) {
- return '';
- }
+ // the message is not a draft
+ if ($mbox != $dbox && strpos($mbox, $dbox.$delim) !== 0) {
+ return '';
+ }
- $attrib['id'] = 'message-buttons';
- $attrib['class'] = 'notice';
+ $attrib['id'] = 'message-buttons';
+ $attrib['class'] = 'notice';
- $msg = Q(rcube_label('isdraft')) . '&nbsp;';
- $msg .= html::a(array('href' => "#edit", 'onclick' => JS_OBJECT_NAME.".command('edit')"), Q(rcube_label('edit')));
+ $msg = rcube::Q($RCMAIL->gettext('isdraft')) . '&nbsp;';
+ $msg .= html::a(array(
+ 'href' => "#edit",
+ 'onclick' => rcmail_output::JS_OBJECT_NAME.".command('edit')"
+ ),
+ rcube::Q($RCMAIL->gettext('edit')));
- return html::div($attrib, $msg);
+ return html::div($attrib, $msg);
}
function rcmail_message_objects($attrib)
{
- global $RCMAIL, $MESSAGE;
+ global $RCMAIL, $MESSAGE;
- if (!$attrib['id'])
- $attrib['id'] = 'message-objects';
+ if (!$attrib['id'])
+ $attrib['id'] = 'message-objects';
- $content = array(
- rcmail_message_buttons(),
- rcmail_remote_objects_msg(),
- );
+ $content = array(
+ rcmail_message_buttons(),
+ rcmail_remote_objects_msg(),
+ );
- $plugin = $RCMAIL->plugins->exec_hook('message_objects',
- array('content' => $content, 'message' => $MESSAGE));
+ $plugin = $RCMAIL->plugins->exec_hook('message_objects',
+ array('content' => $content, 'message' => $MESSAGE));
- $content = implode("\n", $plugin['content']);
+ $content = implode("\n", $plugin['content']);
- return html::div($attrib, $content);
+ return html::div($attrib, $content);
}
function rcmail_contact_exists($email)
{
- global $RCMAIL;
+ global $RCMAIL;
- if ($email) {
- // @TODO: search in all address books?
- $CONTACTS = $RCMAIL->get_address_book(-1, true);
+ if ($email) {
+ // @TODO: search in all address books?
+ $CONTACTS = $RCMAIL->get_address_book(-1, true);
- if (is_object($CONTACTS)) {
- $existing = $CONTACTS->search('email', $email, true, false);
- if ($existing->count) {
- return true;
- }
+ if (is_object($CONTACTS)) {
+ $existing = $CONTACTS->search('email', $email, true, false);
+ if ($existing->count) {
+ return true;
+ }
+ }
}
- }
- return false;
+ return false;
}
function rcmail_message_contactphoto($attrib)
{
- global $RCMAIL, $MESSAGE;
+ global $RCMAIL, $MESSAGE;
- $placeholder = $attrib['placeholder'] ? $RCMAIL->config->get('skin_path') . $attrib['placeholder'] : null;
- if ($MESSAGE->sender)
- $photo_img = $RCMAIL->url(array('_task' => 'addressbook', '_action' => 'photo', '_email' => $MESSAGE->sender['mailto'], '_alt' => $placeholder));
- else
- $photo_img = $placeholder ? $placeholder : 'program/resources/blank.gif';
+ $placeholder = $attrib['placeholder'] ? $RCMAIL->config->get('skin_path') . $attrib['placeholder'] : null;
- return html::img(array('src' => $photo_img) + $attrib);
-}
-
-
-$OUTPUT->add_handlers(array(
- 'messageattachments' => 'rcmail_message_attachments',
- 'mailboxname' => 'rcmail_mailbox_name_display',
- 'messageobjects' => 'rcmail_message_objects',
- 'contactphoto' => 'rcmail_message_contactphoto',
-));
-
-
-if ($RCMAIL->action == 'print' && $OUTPUT->template_exists('messageprint'))
- $OUTPUT->send('messageprint', false);
-else if ($RCMAIL->action == 'preview' && $OUTPUT->template_exists('messagepreview'))
- $OUTPUT->send('messagepreview', false);
-else
- $OUTPUT->send('message', false);
-
-
-// mark message as read
-if ($MESSAGE && $MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN']) &&
- ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0)))
-{
- if ($RCMAIL->storage->set_flag($MESSAGE->uid, 'SEEN')) {
- if ($count = rcmail_get_unseen_count($mbox_name)) {
- rcmail_set_unseen_count($mbox_name, $count - 1);
+ if ($MESSAGE->sender) {
+ $photo_img = $RCMAIL->url(array(
+ '_task' => 'addressbook',
+ '_action' => 'photo',
+ '_email' => $MESSAGE->sender['mailto'],
+ '_alt' => $placeholder
+ ));
+ }
+ else {
+ $photo_img = $placeholder ? $placeholder : 'program/resources/blank.gif';
}
- }
-}
-
-exit;
+ return html::img(array('src' => $photo_img) + $attrib);
+}
diff --git a/program/steps/mail/viewsource.inc b/program/steps/mail/viewsource.inc
index c560d7d41..0328d9600 100644
--- a/program/steps/mail/viewsource.inc
+++ b/program/steps/mail/viewsource.inc
@@ -5,7 +5,7 @@
| program/steps/mail/viewsource.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -22,39 +22,39 @@
ob_end_clean();
// similar code as in program/steps/mail/get.inc
-if ($uid = get_input_value('_uid', RCUBE_INPUT_GET))
-{
- $headers = $RCMAIL->storage->get_message_headers($uid);
- $charset = $headers->charset ? $headers->charset : $CONFIG['default_charset'];
- header("Content-Type: text/plain; charset={$charset}");
-
- if (!empty($_GET['_save'])) {
- $subject = rcube_mime::decode_header($headers->subject, $headers->charset);
- $filename = ($subject ? $subject : $RCMAIL->config->get('product_name', 'email')) . '.eml';
- $browser = $RCMAIL->output->browser;
-
- if ($browser->ie && $browser->ver < 7)
- $filename = rawurlencode(abbreviate_string($filename, 55));
- else if ($browser->ie)
- $filename = rawurlencode($filename);
- else
- $filename = addcslashes($filename, '"');
-
- header("Content-Length: {$headers->size}");
- header("Content-Disposition: attachment; filename=\"$filename\"");
- }
-
- $RCMAIL->storage->print_raw_body($uid, empty($_GET['_save']));
+if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET)) {
+ $headers = $RCMAIL->storage->get_message_headers($uid);
+ $charset = $headers->charset ? $headers->charset : $RCMAIL->config->get('default_charset');
+
+ header("Content-Type: text/plain; charset={$charset}");
+
+ if (!empty($_GET['_save'])) {
+ $subject = rcube_mime::decode_header($headers->subject, $headers->charset);
+ $filename = ($subject ? $subject : $RCMAIL->config->get('product_name', 'email')) . '.eml';
+ $browser = $RCMAIL->output->browser;
+
+ if ($browser->ie && $browser->ver < 7)
+ $filename = rawurlencode(abbreviate_string($filename, 55));
+ else if ($browser->ie)
+ $filename = rawurlencode($filename);
+ else
+ $filename = addcslashes($filename, '"');
+
+ header("Content-Length: {$headers->size}");
+ header("Content-Disposition: attachment; filename=\"$filename\"");
+ }
+
+ $RCMAIL->storage->print_raw_body($uid, empty($_GET['_save']));
}
-else
-{
- raise_error(array(
- 'code' => 500,
- 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => 'Message UID '.$uid.' not found'),
- true, true);
+else {
+ rcube::raise_error(array(
+ 'code' => 500,
+ 'type' => 'php',
+ 'file' => __FILE__,
+ 'line' => __LINE__,
+ 'message' => "Message UID $uid not found"
+ ),
+ true, true);
}
exit;
-
diff --git a/program/steps/settings/about.inc b/program/steps/settings/about.inc
index 0fdefddda..026bfc1a2 100644
--- a/program/steps/settings/about.inc
+++ b/program/steps/settings/about.inc
@@ -5,8 +5,8 @@
| program/steps/settings/about.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2011, The Roundcube Dev Team |
- | Copyright (C) 2011, Kolab Systems AG |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
+ | Copyright (C) 2011-2013, Kolab Systems AG |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,78 +21,83 @@
*/
+$OUTPUT->set_pagetitle($RCMAIL->gettext('about'));
+
+$OUTPUT->add_handler('supportlink', 'rcmail_supportlink');
+$OUTPUT->add_handler('pluginlist', 'rcmail_plugins_list');
+
+$OUTPUT->send('about');
+
+
+
function rcmail_supportlink($attrib)
{
- global $RCMAIL;
+ global $RCMAIL;
+
+ if ($url = $RCMAIL->config->get('support_url')) {
+ $label = $attrib['label'] ? $attrib['label'] : 'support';
+ $attrib['href'] = $url;
- if ($url = $RCMAIL->config->get('support_url')) {
- $label = $attrib['label'] ? $attrib['label'] : 'support';
- $attrib['href'] = $url;
- return html::a($attrib, rcube_label($label));
- }
+ return html::a($attrib, $RCMAIL->gettext($label));
+ }
}
function rcmail_plugins_list($attrib)
{
- global $RCMAIL;
-
- if (!$attrib['id'])
- $attrib['id'] = 'rcmpluginlist';
-
- $plugins = array_filter((array) $RCMAIL->config->get('plugins'));
- $plugin_info = array();
-
- foreach ($plugins as $name) {
- if ($info = $RCMAIL->plugins->get_info($name))
- $plugin_info[$name] = $info;
- }
-
- // load info from required plugins, too
- foreach ($plugin_info as $name => $info) {
- if (is_array($info['required']) && !empty($info['required'])) {
- foreach ($info['required'] as $req_name) {
- if (!isset($plugin_info[$req_name]) && ($req_info = $RCMAIL->plugins->get_info($req_name)))
- $plugin_info[$req_name] = $req_info;
- }
- }
- }
+ global $RCMAIL;
- if (empty($plugin_info)) {
- return '';
- }
+ if (!$attrib['id']) {
+ $attrib['id'] = 'rcmpluginlist';
+ }
- ksort($plugin_info, SORT_LOCALE_STRING);
+ $plugins = array_filter((array) $RCMAIL->config->get('plugins'));
+ $plugin_info = array();
- $table = new html_table($attrib);
+ foreach ($plugins as $name) {
+ if ($info = $RCMAIL->plugins->get_info($name)) {
+ $plugin_info[$name] = $info;
+ }
+ }
- // add table header
- $table->add_header('name', rcube_label('plugin'));
- $table->add_header('version', rcube_label('version'));
- $table->add_header('license', rcube_label('license'));
- $table->add_header('source', rcube_label('source'));
+ // load info from required plugins, too
+ foreach ($plugin_info as $name => $info) {
+ if (is_array($info['required']) && !empty($info['required'])) {
+ foreach ($info['required'] as $req_name) {
+ if (!isset($plugin_info[$req_name]) && ($req_info = $RCMAIL->plugins->get_info($req_name))) {
+ $plugin_info[$req_name] = $req_info;
+ }
+ }
+ }
+ }
- foreach ($plugin_info as $name => $data) {
- $uri = $data['src_uri'] ? $data['src_uri'] : $data['uri'];
- if ($uri && stripos($uri, 'http') !== 0) {
- $uri = 'http://' . $uri;
+ if (empty($plugin_info)) {
+ return '';
}
- $table->add_row();
- $table->add('name', Q($data['name'] ? $data['name'] : $name));
- $table->add('version', Q($data['version']));
- $table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', href=> Q($data['license_uri'])),
- Q($data['license'])) : $data['license']);
- $table->add('source', $uri ? html::a(array('target' => '_blank', href=> Q($uri)),
- Q(rcube_label('download'))) : '');
- }
+ ksort($plugin_info, SORT_LOCALE_STRING);
+
+ $table = new html_table($attrib);
+
+ // add table header
+ $table->add_header('name', $RCMAIL->gettext('plugin'));
+ $table->add_header('version', $RCMAIL->gettext('version'));
+ $table->add_header('license', $RCMAIL->gettext('license'));
+ $table->add_header('source', $RCMAIL->gettext('source'));
+
+ foreach ($plugin_info as $name => $data) {
+ $uri = $data['src_uri'] ? $data['src_uri'] : $data['uri'];
+ if ($uri && stripos($uri, 'http') !== 0) {
+ $uri = 'http://' . $uri;
+ }
+
+ $table->add_row();
+ $table->add('name', rcube::Q($data['name'] ? $data['name'] : $name));
+ $table->add('version', rcube::Q($data['version']));
+ $table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', href=> rcube::Q($data['license_uri'])),
+ rcube::Q($data['license'])) : $data['license']);
+ $table->add('source', $uri ? html::a(array('target' => '_blank', href=> rcube::Q($uri)),
+ rcube::Q($RCMAIL->gettext('download'))) : '');
+ }
- return $table->show();
+ return $table->show();
}
-
-
-$OUTPUT->set_pagetitle(rcube_label('about'));
-
-$OUTPUT->add_handler('supportlink', 'rcmail_supportlink');
-$OUTPUT->add_handler('pluginlist', 'rcmail_plugins_list');
-
-$OUTPUT->send('about');
diff --git a/program/steps/settings/delete_identity.inc b/program/steps/settings/delete_identity.inc
index d5146db66..f77620438 100644
--- a/program/steps/settings/delete_identity.inc
+++ b/program/steps/settings/delete_identity.inc
@@ -5,7 +5,7 @@
| program/steps/settings/delete_identity.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,33 +19,37 @@
+-----------------------------------------------------------------------+
*/
-$iid = get_input_value('_iid', RCUBE_INPUT_GPC);
+$iid = rcube_utils::get_input_value('_iid', rcube_utils::INPUT_GPC);
// check request token
-if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(RCUBE_INPUT_GPC)) {
- $OUTPUT->show_message('invalidrequest', 'error');
- rcmail_overwrite_action('identities');
- return;
+if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(rcube_utils::INPUT_GPC)) {
+ $OUTPUT->show_message('invalidrequest', 'error');
+ $RCMAIL->overwrite_action('identities');
+ return;
}
-if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid))
-{
- $plugin = $RCMAIL->plugins->exec_hook('identity_delete', array('id' => $iid));
-
- $deleted = !$plugin['abort'] ? $RCMAIL->user->delete_identity($iid) : $plugin['result'];
+if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid)) {
+ $plugin = $RCMAIL->plugins->exec_hook('identity_delete', array('id' => $iid));
- if ($deleted > 0 && $deleted !== false)
- $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false);
- else
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : ($deleted < 0 ? 'nodeletelastidentity' : 'errorsaving'), 'error', null, false);
+ $deleted = !$plugin['abort'] ? $RCMAIL->user->delete_identity($iid) : $plugin['result'];
- // send response
- if ($OUTPUT->ajax_call)
- $OUTPUT->send();
+ if ($deleted > 0 && $deleted !== false) {
+ $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false);
+ }
+ else {
+ $msg = $plugin['message'] ? $plugin['message'] : ($deleted < 0 ? 'nodeletelastidentity' : 'errorsaving');
+ $OUTPUT->show_message($msg, 'error', null, false);
+ }
+
+ // send response
+ if ($OUTPUT->ajax_call) {
+ $OUTPUT->send();
+ }
}
-if ($OUTPUT->ajax_call)
- exit;
+if ($OUTPUT->ajax_call) {
+ exit;
+}
// go to identities page
-rcmail_overwrite_action('identities');
+$RCMAIL->overwrite_action('identities');
diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc
index f19e2177b..fc6b2cd16 100644
--- a/program/steps/settings/edit_folder.inc
+++ b/program/steps/settings/edit_folder.inc
@@ -5,7 +5,7 @@
| program/steps/settings/edit_folder.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,7 +19,17 @@
+-----------------------------------------------------------------------+
*/
-// WARNING: folder names in UI are encoded with RCMAIL_CHARSET
+// register UI objects
+$OUTPUT->add_handlers(array(
+ 'folderdetails' => 'rcmail_folder_form',
+));
+
+$OUTPUT->add_label('nonamewarning');
+
+$OUTPUT->send('folderedit');
+
+
+// WARNING: folder names in UI are encoded with RCUBE_CHARSET
function rcmail_folder_form($attrib)
{
@@ -28,12 +38,12 @@ function rcmail_folder_form($attrib)
$storage = $RCMAIL->get_storage();
// edited folder name (empty in create-folder mode)
- $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true));
- $mbox_imap = rcube_charset_convert($mbox, RCMAIL_CHARSET, 'UTF7-IMAP');
+ $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true);
+ $mbox_imap = rcube_charset::convert($mbox, RCUBE_CHARSET, 'UTF7-IMAP');
// predefined path for new folder
- $parent = trim(get_input_value('_path', RCUBE_INPUT_GPC, true));
- $parent_imap = rcube_charset_convert($parent, RCMAIL_CHARSET, 'UTF7-IMAP');
+ $parent = rcube_utils::get_input_value('_path', rcube_utils::INPUT_GPC, true);
+ $parent_imap = rcube_charset::convert($parent, RCUBE_CHARSET, 'UTF7-IMAP');
$threading_supported = $storage->get_capability('THREAD');
$delimiter = $storage->get_hierarchy_delimiter();
@@ -46,7 +56,7 @@ function rcmail_folder_form($attrib)
$path = explode($delimiter, $mbox_imap);
$folder = array_pop($path);
$path = implode($delimiter, $path);
- $folder = rcube_charset_convert($folder, 'UTF7-IMAP');
+ $folder = rcube_charset::convert($folder, 'UTF7-IMAP');
$hidden_fields = array('name' => '_mbox', 'value' => $mbox);
}
@@ -73,33 +83,33 @@ function rcmail_folder_form($attrib)
// General tab
$form['props'] = array(
- 'name' => rcube_label('properties'),
+ 'name' => $RCMAIL->gettext('properties'),
);
// Location (name)
if ($options['protected']) {
- $foldername = str_replace($delimiter, ' &raquo; ', Q(rcmail_localize_folderpath($mbox_imap)));
+ $foldername = str_replace($delimiter, ' &raquo; ', rcube::Q($RCMAIL->localize_folderpath($mbox_imap)));
}
else if ($options['norename']) {
- $foldername = Q($folder);
+ $foldername = rcube::Q($folder);
}
else {
if (isset($_POST['_name']))
- $folder = trim(get_input_value('_name', RCUBE_INPUT_POST, true));
+ $folder = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true));
$foldername = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30));
$foldername = $foldername->show($folder);
if ($options['special']) {
- $foldername .= '&nbsp;(' . Q(rcmail_localize_foldername($mbox_imap)) .')';
+ $foldername .= '&nbsp;(' . rcube::Q($RCMAIL->localize_foldername($mbox_imap)) .')';
}
}
$form['props']['fieldsets']['location'] = array(
- 'name' => rcube_label('location'),
+ 'name' => $RCMAIL->gettext('location'),
'content' => array(
'name' => array(
- 'label' => rcube_label('foldername'),
+ 'label' => $RCMAIL->gettext('foldername'),
'value' => $foldername,
),
),
@@ -121,7 +131,7 @@ function rcmail_folder_form($attrib)
$exceptions[] = substr($prefix, 0, -1);
}
- $select = rcmail_mailbox_select(array(
+ $select = $RCMAIL->folder_selector(array(
'name' => '_parent',
'noselection' => '---',
'realnames' => false,
@@ -132,21 +142,21 @@ function rcmail_folder_form($attrib)
));
$form['props']['fieldsets']['location']['content']['path'] = array(
- 'label' => rcube_label('parentfolder'),
+ 'label' => $RCMAIL->gettext('parentfolder'),
'value' => $select->show($selected),
);
}
// Settings
$form['props']['fieldsets']['settings'] = array(
- 'name' => rcube_label('settings'),
+ 'name' => $RCMAIL->gettext('settings'),
);
// Settings: threading
if ($threading_supported && ($mbox_imap == 'INBOX' || (!$options['noselect'] && !$options['is_root']))) {
$select = new html_select(array('name' => '_viewmode', 'id' => '_listmode'));
- $select->add(rcube_label('list'), 0);
- $select->add(rcube_label('threads'), 1);
+ $select->add($RCMAIL->gettext('list'), 0);
+ $select->add($RCMAIL->gettext('threads'), 1);
if (isset($_POST['_viewmode'])) {
$value = (int) $_POST['_viewmode'];
@@ -157,38 +167,38 @@ function rcmail_folder_form($attrib)
}
$form['props']['fieldsets']['settings']['content']['viewmode'] = array(
- 'label' => rcube_label('listmode'),
+ 'label' => $RCMAIL->gettext('listmode'),
'value' => $select->show($value),
);
}
/*
// Settings: sorting column
$select = new html_select(array('name' => '_sortcol', 'id' => '_sortcol'));
- $select->add(rcube_label('nonesort'), '');
- $select->add(rcube_label('arrival'), 'arrival');
- $select->add(rcube_label('sentdate'), 'date');
- $select->add(rcube_label('subject'), 'subject');
- $select->add(rcube_label('fromto'), 'from');
- $select->add(rcube_label('replyto'), 'replyto');
- $select->add(rcube_label('cc'), 'cc');
- $select->add(rcube_label('size'), 'size');
+ $select->add($RCMAIL->gettext('nonesort'), '');
+ $select->add($RCMAIL->gettext('arrival'), 'arrival');
+ $select->add($RCMAIL->gettext('sentdate'), 'date');
+ $select->add($RCMAIL->gettext('subject'), 'subject');
+ $select->add($RCMAIL->gettext('fromto'), 'from');
+ $select->add($RCMAIL->gettext('replyto'), 'replyto');
+ $select->add($RCMAIL->gettext('cc'), 'cc');
+ $select->add($RCMAIL->gettext('size'), 'size');
$value = isset($_POST['_sortcol']) ? $_POST['_sortcol'] : '';
$form['props']['fieldsets']['settings']['content']['sortcol'] = array(
- 'label' => rcube_label('listsorting'),
+ 'label' => $RCMAIL->gettext('listsorting'),
'value' => $select->show($value),
);
// Settings: sorting order
$select = new html_select(array('name' => '_sortord', 'id' => '_sortord'));
- $select->add(rcube_label('asc'), 'ASC');
- $select->add(rcube_label('desc'), 'DESC');
+ $select->add($RCMAIL->gettext('asc'), 'ASC');
+ $select->add($RCMAIL->gettext('desc'), 'DESC');
$value = isset($_POST['_sortord']) ? $_POST['_sortord'] : '';
$form['props']['fieldsets']['settings']['content']['sortord'] = array(
- 'label' => rcube_label('listorder'),
+ 'label' => $RCMAIL->gettext('listorder'),
'value' => $select->show(),
);
*/
@@ -196,7 +206,7 @@ function rcmail_folder_form($attrib)
if (strlen($mbox)) {
// Number of messages
$form['props']['fieldsets']['info'] = array(
- 'name' => rcube_label('info'),
+ 'name' => $RCMAIL->gettext('info'),
'content' => array()
);
@@ -207,9 +217,9 @@ function rcmail_folder_form($attrib)
if ($msgcount) {
// create link with folder-size command
$onclick = sprintf("return %s.command('folder-size', '%s', this)",
- JS_OBJECT_NAME, JQ($mbox_imap));
+ rcmail_output::JS_OBJECT_NAME, rcube::JQ($mbox_imap));
$size = html::a(array('href' => '#', 'onclick' => $onclick,
- 'id' => 'folder-size'), rcube_label('getfoldersize'));
+ 'id' => 'folder-size'), $RCMAIL->gettext('getfoldersize'));
}
else {
// no messages -> zero size
@@ -217,11 +227,11 @@ function rcmail_folder_form($attrib)
}
$form['props']['fieldsets']['info']['content']['count'] = array(
- 'label' => rcube_label('messagecount'),
+ 'label' => $RCMAIL->gettext('messagecount'),
'value' => (int) $msgcount
);
$form['props']['fieldsets']['info']['content']['size'] = array(
- 'label' => rcube_label('size'),
+ 'label' => $RCMAIL->gettext('size'),
'value' => $size,
);
}
@@ -229,8 +239,8 @@ function rcmail_folder_form($attrib)
// show folder type only if we have non-private namespaces
if (!empty($namespace['shared']) || !empty($namespace['others'])) {
$form['props']['fieldsets']['info']['content']['foldertype'] = array(
- 'label' => rcube_label('foldertype'),
- 'value' => rcube_label($options['namespace'] . 'folder'));
+ 'label' => $RCMAIL->gettext('foldertype'),
+ 'value' => $RCMAIL->gettext($options['namespace'] . 'folder'));
}
}
@@ -256,7 +266,8 @@ function rcmail_folder_form($attrib)
foreach ($tab['fieldsets'] as $fieldset) {
$subcontent = rcmail_get_form_part($fieldset, $attrib);
if ($subcontent) {
- $content .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $subcontent) ."\n";
+ $subcontent = html::tag('legend', null, rcube::Q($fieldset['name'])) . $subcontent;
+ $content .= html::tag('fieldset', null, $subcontent) ."\n";
}
}
}
@@ -265,7 +276,7 @@ function rcmail_folder_form($attrib)
}
if ($content && sizeof($form) > 1) {
- $out .= html::tag('fieldset', null, html::tag('legend', null, Q($tab['name'])) . $content) ."\n";
+ $out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) ."\n";
}
else {
$out .= $content ."\n";
@@ -287,9 +298,9 @@ function rcmail_get_form_part($form, $attrib = array())
$table = new html_table(array('cols' => 2));
foreach ($form['content'] as $col => $colprop) {
$colprop['id'] = '_'.$col;
- $label = !empty($colprop['label']) ? $colprop['label'] : rcube_label($col);
+ $label = !empty($colprop['label']) ? $colprop['label'] : $RCMAIL->gettext($col);
- $table->add('title', html::label($colprop['id'], Q($label)));
+ $table->add('title', html::label($colprop['id'], rcube::Q($label)));
$table->add(null, $colprop['value']);
}
$content = $table->show($attrib);
@@ -300,15 +311,3 @@ function rcmail_get_form_part($form, $attrib = array())
return $content;
}
-
-
-//$OUTPUT->set_pagetitle(rcube_label('folders'));
-
-// register UI objects
-$OUTPUT->add_handlers(array(
- 'folderdetails' => 'rcmail_folder_form',
-));
-
-$OUTPUT->add_label('nonamewarning');
-
-$OUTPUT->send('folderedit');
diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc
index edd4ba60d..f208c8a05 100644
--- a/program/steps/settings/edit_identity.inc
+++ b/program/steps/settings/edit_identity.inc
@@ -5,7 +5,7 @@
| program/steps/settings/edit_identity.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2011, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -23,152 +23,158 @@ define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0)));
// edit-identity
if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') {
- $IDENTITY_RECORD = $RCMAIL->user->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC));
-
- if (is_array($IDENTITY_RECORD))
- $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']);
- else {
- $OUTPUT->show_message('dberror', 'error');
- // go to identities page
- rcmail_overwrite_action('identities');
- return;
- }
+ $id = rcube_utils::get_input_value('_iid', rcube_utils::INPUT_GPC);
+ $IDENTITY_RECORD = $RCMAIL->user->get_identity($id);
+
+ if (is_array($IDENTITY_RECORD)) {
+ $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']);
+ }
+ else {
+ $OUTPUT->show_message('dberror', 'error');
+ // go to identities page
+ $RCMAIL->overwrite_action('identities');
+ return;
+ }
}
// add-identity
else {
- if (IDENTITIES_LEVEL > 1) {
- $OUTPUT->show_message('opnotpermitted', 'error');
- // go to identities page
- rcmail_overwrite_action('identities');
- return;
- }
- else if (IDENTITIES_LEVEL == 1) {
- $IDENTITY_RECORD['email'] = $RCMAIL->get_user_email();
- }
+ if (IDENTITIES_LEVEL > 1) {
+ $OUTPUT->show_message('opnotpermitted', 'error');
+ // go to identities page
+ $RCMAIL->overwrite_action('identities');
+ return;
+ }
+ else if (IDENTITIES_LEVEL == 1) {
+ $IDENTITY_RECORD['email'] = $RCMAIL->get_user_email();
+ }
+}
+
+$OUTPUT->include_script('list.js');
+$OUTPUT->add_handler('identityform', 'rcube_identity_form');
+$OUTPUT->set_env('identities_level', IDENTITIES_LEVEL);
+$OUTPUT->add_label('deleteidentityconfirm');
+
+$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action == 'add-identity' ? 'newidentity' : 'edititem')));
+
+if ($RCMAIL->action == 'add-identity' && $OUTPUT->template_exists('identityadd')) {
+ $OUTPUT->send('identityadd');
}
+$OUTPUT->send('identityedit');
+
function rcube_identity_form($attrib)
{
- global $IDENTITY_RECORD, $RCMAIL, $OUTPUT;
-
- // Add HTML editor script(s)
- rcube_html_editor('identity');
-
- // add some labels to client
- $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting', 'editorwarning');
-
- $i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
- $t_rows = !empty($attrib['textarearows']) ? $attrib['textarearows'] : 6;
- $t_cols = !empty($attrib['textareacols']) ? $attrib['textareacols'] : 40;
-
- // list of available cols
- $form = array(
- 'addressing' => array(
- 'name' => rcube_label('settings'),
- 'content' => array(
- 'name' => array('type' => 'text', 'size' => $i_size),
- 'email' => array('type' => 'text', 'size' => $i_size),
- 'organization' => array('type' => 'text', 'size' => $i_size),
- 'reply-to' => array('type' => 'text', 'size' => $i_size),
- 'bcc' => array('type' => 'text', 'size' => $i_size),
- 'standard' => array('type' => 'checkbox', 'label' => rcube_label('setdefault')),
- )),
- 'signature' => array(
- 'name' => rcube_label('signature'),
- 'content' => array(
- 'signature' => array('type' => 'textarea', 'size' => $t_cols, 'rows' => $t_rows,
- 'spellcheck' => true),
- 'html_signature' => array('type' => 'checkbox', 'label' => rcube_label('htmlsignature'),
- 'onclick' => 'return rcmail_toggle_editor(this, \'rcmfd_signature\');'),
- ))
- );
-
- // Enable TinyMCE editor
- if ($IDENTITY_RECORD['html_signature']) {
- $form['signature']['content']['signature']['class'] = 'mce_editor';
- $form['signature']['content']['signature']['is_escaped'] = true;
-
- // Correctly handle HTML entities in HTML editor (#1488483)
- $IDENTITY_RECORD['signature'] = htmlspecialchars($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCMAIL_CHARSET);
- }
-
- // disable some field according to access level
- if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) {
- $form['addressing']['content']['email']['disabled'] = true;
- $form['addressing']['content']['email']['class'] = 'disabled';
- }
-
- if (IDENTITIES_LEVEL == 4) {
- foreach($form['addressing']['content'] as $formfield => $value){
- $form['addressing']['content'][$formfield]['disabled'] = true;
- $form['addressing']['content'][$formfield]['class'] = 'disabled';
+ global $IDENTITY_RECORD, $RCMAIL, $OUTPUT;
+
+ // Add HTML editor script(s)
+ $RCMAIL->html_editor('identity');
+
+ // add some labels to client
+ $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting', 'editorwarning');
+
+ $i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
+ $t_rows = !empty($attrib['textarearows']) ? $attrib['textarearows'] : 6;
+ $t_cols = !empty($attrib['textareacols']) ? $attrib['textareacols'] : 40;
+
+ // list of available cols
+ $form = array(
+ 'addressing' => array(
+ 'name' => $RCMAIL->gettext('settings'),
+ 'content' => array(
+ 'name' => array('type' => 'text', 'size' => $i_size),
+ 'email' => array('type' => 'text', 'size' => $i_size),
+ 'organization' => array('type' => 'text', 'size' => $i_size),
+ 'reply-to' => array('type' => 'text', 'size' => $i_size),
+ 'bcc' => array('type' => 'text', 'size' => $i_size),
+ 'standard' => array('type' => 'checkbox', 'label' => $RCMAIL->gettext('setdefault')),
+ )),
+ 'signature' => array(
+ 'name' => $RCMAIL->gettext('signature'),
+ 'content' => array(
+ 'signature' => array('type' => 'textarea', 'size' => $t_cols, 'rows' => $t_rows,
+ 'spellcheck' => true),
+ 'html_signature' => array('type' => 'checkbox',
+ 'label' => $RCMAIL->gettext('htmlsignature'),
+ 'onclick' => 'return rcmail_toggle_editor(this, \'rcmfd_signature\');'),
+ ))
+ );
+
+ // Enable TinyMCE editor
+ if ($IDENTITY_RECORD['html_signature']) {
+ $form['signature']['content']['signature']['class'] = 'mce_editor';
+ $form['signature']['content']['signature']['is_escaped'] = true;
+
+ // Correctly handle HTML entities in HTML editor (#1488483)
+ $IDENTITY_RECORD['signature'] = htmlspecialchars($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCUBE_CHARSET);
}
- }
- $IDENTITY_RECORD['email'] = rcube_idn_to_utf8($IDENTITY_RECORD['email']);
+ // disable some field according to access level
+ if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) {
+ $form['addressing']['content']['email']['disabled'] = true;
+ $form['addressing']['content']['email']['class'] = 'disabled';
+ }
- // Allow plugins to modify identity form content
- $plugin = $RCMAIL->plugins->exec_hook('identity_form', array(
- 'form' => $form, 'record' => $IDENTITY_RECORD));
+ if (IDENTITIES_LEVEL == 4) {
+ foreach($form['addressing']['content'] as $formfield => $value){
+ $form['addressing']['content'][$formfield]['disabled'] = true;
+ $form['addressing']['content'][$formfield]['class'] = 'disabled';
+ }
+ }
- $form = $plugin['form'];
- $IDENTITY_RECORD = $plugin['record'];
+ $IDENTITY_RECORD['email'] = rcube_utils::idn_to_utf8($IDENTITY_RECORD['email']);
- // Set form tags and hidden fields
- list($form_start, $form_end) = get_form_tags($attrib, 'save-identity',
- intval($IDENTITY_RECORD['identity_id']),
- array('name' => '_iid', 'value' => $IDENTITY_RECORD['identity_id']));
+ // Allow plugins to modify identity form content
+ $plugin = $RCMAIL->plugins->exec_hook('identity_form', array(
+ 'form' => $form, 'record' => $IDENTITY_RECORD));
- unset($plugin);
- unset($attrib['form'], $attrib['id']);
+ $form = $plugin['form'];
+ $IDENTITY_RECORD = $plugin['record'];
- // return the complete edit form as table
- $out = "$form_start\n";
+ // Set form tags and hidden fields
+ list($form_start, $form_end) = get_form_tags($attrib, 'save-identity',
+ intval($IDENTITY_RECORD['identity_id']),
+ array('name' => '_iid', 'value' => $IDENTITY_RECORD['identity_id']));
- foreach ($form as $fieldset) {
- if (empty($fieldset['content']))
- continue;
+ unset($plugin);
+ unset($attrib['form'], $attrib['id']);
- $content = '';
- if (is_array($fieldset['content'])) {
- $table = new html_table(array('cols' => 2));
- foreach ($fieldset['content'] as $col => $colprop) {
- $colprop['id'] = 'rcmfd_'.$col;
+ // return the complete edit form as table
+ $out = "$form_start\n";
- $label = !empty($colprop['label']) ? $colprop['label'] :
- rcube_label(str_replace('-', '', $col));
+ foreach ($form as $fieldset) {
+ if (empty($fieldset['content'])) {
+ continue;
+ }
- $value = !empty($colprop['value']) ? $colprop['value'] :
- rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']);
+ $content = '';
+ if (is_array($fieldset['content'])) {
+ $table = new html_table(array('cols' => 2));
- $table->add('title', html::label($colprop['id'], Q($label)));
- $table->add(null, $value);
- }
- $content = $table->show($attrib);
- }
- else {
- $content = $fieldset['content'];
- }
+ foreach ($fieldset['content'] as $col => $colprop) {
+ $colprop['id'] = 'rcmfd_'.$col;
- $out .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $content) ."\n";
- }
+ $label = !empty($colprop['label']) ? $colprop['label'] :
+ $RCMAIL->gettext(str_replace('-', '', $col));
- $out .= $form_end;
+ $value = !empty($colprop['value']) ? $colprop['value'] :
+ rcube_output::get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']);
- return $out;
-}
+ $table->add('title', html::label($colprop['id'], rcube::Q($label)));
+ $table->add(null, $value);
+ }
-$OUTPUT->include_script('list.js');
-$OUTPUT->add_handler('identityform', 'rcube_identity_form');
-$OUTPUT->set_env('identities_level', IDENTITIES_LEVEL);
-$OUTPUT->add_label('deleteidentityconfirm');
-
-$OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem')));
-
-if ($RCMAIL->action=='add-identity' && $OUTPUT->template_exists('identityadd'))
- $OUTPUT->send('identityadd');
+ $content = $table->show($attrib);
+ }
+ else {
+ $content = $fieldset['content'];
+ }
-$OUTPUT->send('identityedit');
+ $content = html::tag('legend', null, rcube::Q($fieldset['name'])) . $content;
+ $out .= html::tag('fieldset', null, $content) . "\n";
+ }
+ $out .= $form_end;
+ return $out;
+}
diff --git a/program/steps/settings/edit_prefs.inc b/program/steps/settings/edit_prefs.inc
index adf6b1623..05f4db6a6 100644
--- a/program/steps/settings/edit_prefs.inc
+++ b/program/steps/settings/edit_prefs.inc
@@ -5,7 +5,7 @@
| program/steps/settings/edit_prefs.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2007, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,65 +19,65 @@
+-----------------------------------------------------------------------+
*/
-if (!$OUTPUT->ajax_call)
- $OUTPUT->set_pagetitle(rcube_label('preferences'));
+if (!$OUTPUT->ajax_call) {
+ $OUTPUT->set_pagetitle($RCMAIL->gettext('preferences'));
+}
-$CURR_SECTION = get_input_value('_section', RCUBE_INPUT_GPC);
+$CURR_SECTION = rcube_utils::get_input_value('_section', rcube_utils::INPUT_GPC);
list($SECTIONS,) = rcmail_user_prefs($CURR_SECTION);
+// register UI objects
+$OUTPUT->add_handlers(array(
+ 'userprefs' => 'rcmail_user_prefs_form',
+ 'sectionname' => 'rcmail_prefs_section_name',
+));
+
+$OUTPUT->send('settingsedit');
+
+
+
function rcmail_user_prefs_form($attrib)
{
- global $RCMAIL, $CURR_SECTION, $SECTIONS;
+ global $RCMAIL, $CURR_SECTION, $SECTIONS;
- // add some labels to client
- $RCMAIL->output->add_label('nopagesizewarning');
+ // add some labels to client
+ $RCMAIL->output->add_label('nopagesizewarning');
- unset($attrib['form']);
+ unset($attrib['form']);
- list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs', null,
- array('name' => '_section', 'value' => $CURR_SECTION));
+ list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs', null,
+ array('name' => '_section', 'value' => $CURR_SECTION));
- $out = $form_start;
+ $out = $form_start;
- foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $class => $block) {
- if (!empty($block['options'])) {
- $table = new html_table(array('cols' => 2));
+ foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $class => $block) {
+ if (!empty($block['options'])) {
+ $table = new html_table(array('cols' => 2));
- foreach ($block['options'] as $option) {
- if (isset($option['title'])) {
- $table->add('title', $option['title']);
- $table->add(null, $option['content']);
+ foreach ($block['options'] as $option) {
+ if (isset($option['title'])) {
+ $table->add('title', $option['title']);
+ $table->add(null, $option['content']);
+ }
+ else {
+ $table->add(array('colspan' => 2), $option['content']);
+ }
+ }
+
+ $out .= html::tag('fieldset', $class, html::tag('legend', null, $block['name']) . $table->show($attrib));
}
- else {
- $table->add(array('colspan' => 2), $option['content']);
+ else if (!empty($block['content'])) {
+ $out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $block['content']);
}
- }
-
- $out .= html::tag('fieldset', $class, html::tag('legend', null, $block['name']) . $table->show($attrib));
}
- else if (!empty($block['content'])) {
- $out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $block['content']);
- }
- }
- return $out . $form_end;
+ return $out . $form_end;
}
function rcmail_prefs_section_name()
{
- global $SECTIONS, $CURR_SECTION;
-
- return $SECTIONS[$CURR_SECTION]['section'];
-}
-
-
-// register UI objects
-$OUTPUT->add_handlers(array(
- 'userprefs' => 'rcmail_user_prefs_form',
- 'sectionname' => 'rcmail_prefs_section_name',
-));
-
-$OUTPUT->send('settingsedit');
-
+ global $SECTIONS, $CURR_SECTION;
+ return $SECTIONS[$CURR_SECTION]['section'];
+}
diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc
new file mode 100644
index 000000000..6d3c3dc41
--- /dev/null
+++ b/program/steps/settings/edit_response.inc
@@ -0,0 +1,108 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/settings/edit_response.inc |
+ | |
+ | This file is part of the Roundcube Webmail client |
+ | Copyright (C) 2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ | PURPOSE: |
+ | Show edit form for a canned response record or to add a new one |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com> |
+ +-----------------------------------------------------------------------+
+*/
+
+$responses = $RCMAIL->get_compose_responses();
+
+// edit-response
+if (($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_GPC))) {
+ foreach ($responses as $i => $response) {
+ if ($response['key'] == $key) {
+ $RESPONSE_RECORD = $response;
+ $RESPONSE_RECORD['index'] = $i;
+ break;
+ }
+ }
+}
+
+// save response
+if ($RCMAIL->action == 'save-response' && isset($_POST['_name']) && !$RESPONSE_RECORD['static']) {
+ $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST));
+ $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST, true));
+
+ if (!empty($name) && !empty($text)) {
+ $dupes = 0;
+ foreach ($responses as $i => $resp) {
+ if ($RESPONSE_RECORD && $RESPONSE_RECORD['index'] === $i)
+ continue;
+ if (strcasecmp($name, preg_replace('/\s\(\d+\)$/', '', $resp['name'])) == 0)
+ $dupes++;
+ }
+ if ($dupes) { // require a unique name
+ $name .= ' (' . ++$dupes . ')';
+ }
+
+ $response = array('name' => $name, 'text' => $text, 'format' => 'text', 'key' => substr(md5($name), 0, 16));
+ if ($RESPONSE_RECORD && $responses[$RESPONSE_RECORD['index']]) {
+ $responses[$RESPONSE_RECORD['index']] = $response;
+ }
+ else {
+ $responses[] = $response;
+ }
+
+ $responses = array_filter($responses, function($item){ return empty($item['static']); });
+ if ($RCMAIL->user->save_prefs(array('compose_responses' => array_values($responses)))) {
+ $RCMAIL->output->show_message('successfullysaved', 'confirmation');
+ $RCMAIL->output->command('parent.update_response_row', $response, $key);
+ $RCMAIL->overwrite_action('edit-response');
+ $RESPONSE_RECORD = $response;
+ }
+ }
+ else {
+ $RCMAIL->output->show_message('formincomplete', 'error');
+ }
+}
+
+$OUTPUT->set_env('readonly', !empty($RESPONSE_RECORD['static']));
+$OUTPUT->add_handler('responseform', 'rcube_response_form');
+$OUTPUT->set_pagetitle($RCMAIL->gettext($RCMAIL->action == 'add-response' ? 'savenewresponse' : 'editresponse'));
+
+$OUTPUT->send('responseedit');
+
+
+function rcube_response_form($attrib)
+{
+ global $RCMAIL, $OUTPUT, $RESPONSE_RECORD;
+
+ // Set form tags and hidden fields
+ $disabled = !empty($RESPONSE_RECORD['static']);
+ $key = $RESPONSE_RECORD['key'];
+ list($form_start, $form_end) = get_form_tags($attrib, 'save-response', $key, array('name' => '_key', 'value' => $key));
+ unset($attrib['form'], $attrib['id']);
+
+ // return the complete edit form as table
+ $out = "$form_start\n";
+
+ $table = new html_table(array('cols' => 2));
+ $label = $RCMAIL->gettext('responsename');
+
+ $table->add('title', html::label('ffname', rcube::Q($RCMAIL->gettext('responsename'))));
+ $table->add(null, rcube_output::get_edit_field('name', $RESPONSE_RECORD['name'],
+ array('id' => 'ffname', 'size' => $attrib['size'], 'disabled' => $disabled), 'text'));
+
+ $table->add('title', html::label('fftext', rcube::Q($RCMAIL->gettext('responsetext'))));
+ $table->add(null, rcube_output::get_edit_field('text', $RESPONSE_RECORD['text'],
+ array('id' => 'fftext', 'size' => $attrib['textareacols'], 'rows' => $attrib['textarearows'], 'disabled' => $disabled), 'textarea'));
+
+ $out .= $table->show($attrib);
+ $out .= $form_end;
+
+ return $out;
+}
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index 64af18d62..b09ea03ce 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -5,7 +5,7 @@
| program/steps/settings/folders.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,15 +20,15 @@
+-----------------------------------------------------------------------+
*/
-// WARNING: folder names in UI are encoded with RCMAIL_CHARSET
+// WARNING: folder names in UI are encoded with RCUBE_CHARSET
// init IMAP connection
$STORAGE = $RCMAIL->get_storage();
// subscribe mailbox
-if ($RCMAIL->action == 'subscribe')
-{
- $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP');
+if ($RCMAIL->action == 'subscribe') {
+ $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true, 'UTF7-IMAP');
+
if (strlen($mbox)) {
$result = $STORAGE->subscribe(array($mbox));
@@ -53,28 +53,24 @@ if ($RCMAIL->action == 'subscribe')
$OUTPUT->show_message('foldersubscribed', 'confirmation');
}
else
- rcmail_display_server_error('errorsaving');
+ $RCMAIL->display_server_error('errorsaving');
}
}
-
// unsubscribe mailbox
-else if ($RCMAIL->action == 'unsubscribe')
-{
- $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP');
+else if ($RCMAIL->action == 'unsubscribe') {
+ $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true, 'UTF7-IMAP');
if (strlen($mbox)) {
$result = $STORAGE->unsubscribe(array($mbox));
if ($result)
$OUTPUT->show_message('folderunsubscribed', 'confirmation');
else
- rcmail_display_server_error('errorsaving');
+ $RCMAIL->display_server_error('errorsaving');
}
}
-
// delete an existing mailbox
-else if ($RCMAIL->action == 'delete-folder')
-{
- $mbox_utf8 = get_input_value('_mbox', RCUBE_INPUT_POST, true);
- $mbox = rcube_charset_convert($mbox_utf8, RCMAIL_CHARSET, 'UTF7-IMAP');
+else if ($RCMAIL->action == 'delete-folder') {
+ $mbox_utf8 = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
+ $mbox = rcube_charset::convert($mbox_utf8, RCUBE_CHARSET, 'UTF7-IMAP');
if (strlen($mbox)) {
$plugin = $RCMAIL->plugins->exec_hook('folder_delete', array('name' => $mbox));
@@ -98,22 +94,20 @@ else if ($RCMAIL->action == 'delete-folder')
$OUTPUT->show_message('folderdeleted', 'confirmation');
// Clear content frame
$OUTPUT->command('subscription_select');
- $OUTPUT->command('set_quota', rcmail_quota_content());
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content());
}
else if (!$deleted) {
- rcmail_display_server_error('errorsaving');
+ $RCMAIL->display_server_error('errorsaving');
}
}
-
// rename an existing mailbox
-else if ($RCMAIL->action == 'rename-folder')
-{
- $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, true));
- $oldname_utf8 = trim(get_input_value('_folder_oldname', RCUBE_INPUT_POST, true));
+else if ($RCMAIL->action == 'rename-folder') {
+ $name_utf8 = trim(rcube_utils::get_input_value('_folder_newname', rcube_utils::INPUT_POST, true));
+ $oldname_utf8 = rcube_utils::get_input_value('_folder_oldname', rcube_utils::INPUT_POST, true);
if (strlen($name_utf8) && strlen($oldname_utf8)) {
- $name = rcube_charset_convert($name_utf8, RCMAIL_CHARSET, 'UTF7-IMAP');
- $oldname = rcube_charset_convert($oldname_utf8, RCMAIL_CHARSET, 'UTF7-IMAP');
+ $name = rcube_charset::convert($name_utf8, RCUBE_CHARSET, 'UTF7-IMAP');
+ $oldname = rcube_charset::convert($oldname_utf8, RCUBE_CHARSET, 'UTF7-IMAP');
$rename = rcmail_rename_folder($oldname, $name);
}
@@ -122,20 +116,19 @@ else if ($RCMAIL->action == 'rename-folder')
rcmail_update_folder_row($name, $oldname);
}
else if (!$rename) {
- rcmail_display_server_error('errorsaving');
+ $RCMAIL->display_server_error('errorsaving');
}
}
-
// clear mailbox
-else if ($RCMAIL->action == 'purge')
-{
- $mbox_utf8 = get_input_value('_mbox', RCUBE_INPUT_POST, true);
- $mbox = rcube_charset_convert($mbox_utf8, RCMAIL_CHARSET, 'UTF7-IMAP');
- $delimiter = $STORAGE->get_hierarchy_delimiter();
- $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/';
+else if ($RCMAIL->action == 'purge') {
+ $mbox_utf8 = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
+ $mbox = rcube_charset::convert($mbox_utf8, RCUBE_CHARSET, 'UTF7-IMAP');
+ $delimiter = $STORAGE->get_hierarchy_delimiter();
+ $trash_mbox = $RCMAIL->config->get('trash_mbox');
+ $trash_regexp = '/^' . preg_quote($trash . $delimiter, '/') . '/';
// we should only be purging trash (or their subfolders)
- if (!strlen($CONFIG['trash_mbox']) || $mbox == $CONFIG['trash_mbox']
+ if (!strlen($trash_mbox) || $mbox === $trash_mbox
|| preg_match($trash_regexp, $mbox)
) {
$success = $STORAGE->delete_message('*', $mbox);
@@ -143,7 +136,7 @@ else if ($RCMAIL->action == 'purge')
}
// copy to Trash
else {
- $success = $STORAGE->move_message('1:*', $CONFIG['trash_mbox'], $mbox);
+ $success = $STORAGE->move_message('1:*', $trash_mbox, $mbox);
$delete = false;
}
@@ -151,7 +144,7 @@ else if ($RCMAIL->action == 'purge')
$OUTPUT->set_env('messagecount', 0);
if ($delete) {
$OUTPUT->show_message('folderpurged', 'confirmation');
- $OUTPUT->command('set_quota', rcmail_quota_content());
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content());
}
else {
$OUTPUT->show_message('messagemoved', 'confirmation');
@@ -160,29 +153,48 @@ else if ($RCMAIL->action == 'purge')
$OUTPUT->command('show_folder', $mbox_utf8, null, true);
}
else {
- rcmail_display_server_error('errorsaving');
+ $RCMAIL->display_server_error('errorsaving');
}
}
-
// get mailbox size
-else if ($RCMAIL->action == 'folder-size')
-{
- $name = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true));
+else if ($RCMAIL->action == 'folder-size') {
+ $name = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
$size = $STORAGE->folder_size($name);
// @TODO: check quota and show percentage usage of specified mailbox?
if ($size !== false) {
- $OUTPUT->command('folder_size_update', show_bytes($size));
+ $OUTPUT->command('folder_size_update', $RCMAIL->show_bytes($size));
}
else {
- rcmail_display_server_error();
+ $RCMAIL->display_server_error();
}
}
-if ($OUTPUT->ajax_call)
+if ($OUTPUT->ajax_call) {
$OUTPUT->send();
+}
+
+$OUTPUT->set_pagetitle($RCMAIL->gettext('folders'));
+$OUTPUT->include_script('list.js');
+$OUTPUT->set_env('prefix_ns', $STORAGE->get_namespace('prefix'));
+if ($STORAGE->get_capability('QUOTA')) {
+ $OUTPUT->set_env('quota', true);
+}
+
+// add some labels to client
+$OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting',
+ 'foldermoving', 'foldersubscribing', 'folderunsubscribing', 'quota');
+
+// register UI objects
+$OUTPUT->add_handlers(array(
+ 'foldersubscription' => 'rcube_subscription_form',
+ 'folderframe' => 'rcmail_folder_frame',
+ 'quotadisplay' => array($RCMAIL, 'quota_display'),
+));
+
+$OUTPUT->send('folders');
// build table with all folders listed by server
@@ -200,7 +212,7 @@ function rcube_subscription_form($attrib)
if ($attrib['noheader'] !== true && $attrib['noheader'] != "true") {
// add table header
- $table->add_header('name', rcube_label('foldername'));
+ $table->add_header('name', $RCMAIL->gettext('foldername'));
$table->add_header('subscribed', '');
}
@@ -225,7 +237,7 @@ function rcube_subscription_form($attrib)
$folder_id = $folder;
$folder = $STORAGE->mod_folder($folder);
$foldersplit = explode($delimiter, $folder);
- $name = rcube_charset_convert(array_pop($foldersplit), 'UTF7-IMAP');
+ $name = rcube_charset::convert(array_pop($foldersplit), 'UTF7-IMAP');
$parent_folder = join($delimiter, $foldersplit);
$level = count($foldersplit);
@@ -234,7 +246,7 @@ function rcube_subscription_form($attrib)
for ($i=1; $i<=$level; $i++) {
$ancestor_folder = join($delimiter, array_slice($foldersplit, 0, $i));
if ($ancestor_folder && !$seen[$ancestor_folder]++) {
- $ancestor_name = rcube_charset_convert($foldersplit[$i-1], 'UTF7-IMAP');
+ $ancestor_name = rcube_charset::convert($foldersplit[$i-1], 'UTF7-IMAP');
$list_folders[] = array(
'id' => $ancestor_folder,
'name' => $ancestor_name,
@@ -270,8 +282,8 @@ function rcube_subscription_form($attrib)
$checkbox_subscribe = new html_checkbox(array(
'name' => '_subscribed[]',
- 'title' => rcube_label('changesubscription'),
- 'onclick' => JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)",
+ 'title' => $RCMAIL->gettext('changesubscription'),
+ 'onclick' => rcmail_output::JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)",
));
// create list of available folders
@@ -283,9 +295,9 @@ function rcube_subscription_form($attrib)
$noselect = false;
$classes = array($i%2 ? 'even' : 'odd');
- $folder_utf8 = rcube_charset_convert($folder['id'], 'UTF7-IMAP');
+ $folder_utf8 = rcube_charset::convert($folder['id'], 'UTF7-IMAP');
$display_folder = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $folder['level'])
- . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']);
+ . rcube::Q($protected ? $RCMAIL->localize_foldername($folder['id']) : $folder['name']);
if ($folder['virtual']) {
$classes[] = 'virtual';
@@ -366,8 +378,9 @@ function rcmail_folder_frame($attrib)
{
global $OUTPUT;
- if (!$attrib['id'])
+ if (!$attrib['id']) {
$attrib['id'] = 'rcmfolderframe';
+ }
return $OUTPUT->frame($attrib, true);
}
@@ -416,25 +429,3 @@ function rcmail_rename_folder($oldname, $newname)
return false;
}
-
-
-$OUTPUT->set_pagetitle(rcube_label('folders'));
-$OUTPUT->include_script('list.js');
-$OUTPUT->set_env('prefix_ns', $STORAGE->get_namespace('prefix'));
-if ($STORAGE->get_capability('QUOTA')) {
- $OUTPUT->set_env('quota', true);
-}
-
-// add some labels to client
-$OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting',
- 'foldermoving', 'foldersubscribing', 'folderunsubscribing', 'quota');
-
-// register UI objects
-$OUTPUT->add_handlers(array(
- 'foldersubscription' => 'rcube_subscription_form',
- 'folderframe' => 'rcmail_folder_frame',
- 'quotadisplay' => 'rcmail_quota_display',
-));
-
-$OUTPUT->send('folders');
-
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index af278e5fa..7c36df3b1 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -5,7 +5,7 @@
| program/steps/settings/func.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -20,9 +20,33 @@
*/
if (!$OUTPUT->ajax_call) {
- $OUTPUT->set_pagetitle(rcube_label('preferences'));
+ $OUTPUT->set_pagetitle($RCMAIL->gettext('preferences'));
}
+// register UI objects
+$OUTPUT->add_handlers(array(
+ 'settingstabs' => 'rcmail_settings_tabs',
+ 'prefsframe' => 'rcmail_preferences_frame',
+ 'sectionslist' => 'rcmail_sections_list',
+ 'identitieslist' => 'rcmail_identities_list',
+));
+
+// register action aliases
+$RCMAIL->register_action_map(array(
+ 'folders' => 'folders.inc',
+ 'rename-folder' => 'folders.inc',
+ 'delete-folder' => 'folders.inc',
+ 'subscribe' => 'folders.inc',
+ 'unsubscribe' => 'folders.inc',
+ 'purge' => 'folders.inc',
+ 'folder-size' => 'folders.inc',
+ 'add-identity' => 'edit_identity.inc',
+ 'add-response' => 'edit_response.inc',
+ 'save-response' => 'edit_response.inc',
+ 'delete-response' => 'responses.inc',
+));
+
+
// similar function as /steps/settings/identities.inc::rcmail_identity_frame()
function rcmail_preferences_frame($attrib)
{
@@ -48,7 +72,7 @@ function rcmail_sections_list($attrib)
list($list, $cols) = rcmail_user_prefs();
// create XHTML table
- $out = rcube_table_output($attrib, $list, $cols, 'id');
+ $out = $RCMAIL->table_output($attrib, $list, $cols, 'id');
// set client env
$RCMAIL->output->add_gui_object('sectionslist', $attrib['id']);
@@ -70,7 +94,7 @@ function rcmail_identities_list($attrib)
// get identities list and define 'mail' column
$list = $RCMAIL->user->list_identities();
foreach ($list as $idx => $row) {
- $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>');
+ $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_utils::idn_to_utf8($row['email']) .'>');
}
// get all identites from DB and define list of cols to be displayed
@@ -81,7 +105,7 @@ function rcmail_identities_list($attrib)
// @TODO: use <UL> instead of <TABLE> for identities list
// create XHTML table
- $out = rcube_table_output($attrib, $plugin['list'], $plugin['cols'], 'identity_id');
+ $out = $RCMAIL->table_output($attrib, $plugin['list'], $plugin['cols'], 'identity_id');
// set client env
$OUTPUT->add_gui_object('identitieslist', $attrib['id']);
@@ -127,13 +151,13 @@ function rcmail_user_prefs($current = null)
{
global $RCMAIL;
- $sections['general'] = array('id' => 'general', 'section' => rcube_label('uisettings'));
- $sections['mailbox'] = array('id' => 'mailbox', 'section' => rcube_label('mailboxview'));
- $sections['mailview'] = array('id' => 'mailview','section' => rcube_label('messagesdisplaying'));
- $sections['compose'] = array('id' => 'compose', 'section' => rcube_label('messagescomposition'));
- $sections['addressbook'] = array('id' => 'addressbook','section' => rcube_label('addressbook'));
- $sections['folders'] = array('id' => 'folders', 'section' => rcube_label('specialfolders'));
- $sections['server'] = array('id' => 'server', 'section' => rcube_label('serversettings'));
+ $sections['general'] = array('id' => 'general', 'section' => $RCMAIL->gettext('uisettings'));
+ $sections['mailbox'] = array('id' => 'mailbox', 'section' => $RCMAIL->gettext('mailboxview'));
+ $sections['mailview'] = array('id' => 'mailview','section' => $RCMAIL->gettext('messagesdisplaying'));
+ $sections['compose'] = array('id' => 'compose', 'section' => $RCMAIL->gettext('messagescomposition'));
+ $sections['addressbook'] = array('id' => 'addressbook','section' => $RCMAIL->gettext('addressbook'));
+ $sections['folders'] = array('id' => 'folders', 'section' => $RCMAIL->gettext('specialfolders'));
+ $sections['server'] = array('id' => 'server', 'section' => $RCMAIL->gettext('serversettings'));
// hook + define list cols
$plugin = $RCMAIL->plugins->exec_hook('preferences_sections_list',
@@ -155,10 +179,10 @@ function rcmail_user_prefs($current = null)
// general
case 'general':
$blocks = array(
- 'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'skin' => array('name' => Q(rcube_label('skin'))),
- 'browser' => array('name' => Q(rcube_label('browseroptions'))),
- 'advanced'=> array('name' => Q(rcube_label('advancedoptions'))),
+ 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))),
+ 'skin' => array('name' => rcube::Q($RCMAIL->gettext('skin'))),
+ 'browser' => array('name' => rcube::Q($RCMAIL->gettext('browseroptions'))),
+ 'advanced'=> array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))),
);
// language selection
@@ -175,7 +199,7 @@ function rcmail_user_prefs($current = null)
$select->add(array_values($a_lang), array_keys($a_lang));
$blocks['main']['options']['language'] = array(
- 'title' => html::label($field_id, Q(rcube_label('language'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('language'))),
'content' => $select->show($RCMAIL->user->language),
);
}
@@ -188,7 +212,7 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_timezone';
$select = new html_select(array('name' => '_timezone', 'id' => $field_id));
- $select->add(rcube_label('autodetect'), 'auto');
+ $select->add($RCMAIL->gettext('autodetect'), 'auto');
$zones = array();
foreach (DateTimeZone::listIdentifiers() as $i => $tzs) {
@@ -210,7 +234,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['timezone'] = array(
- 'title' => html::label($field_id, Q(rcube_label('timezone'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('timezone'))),
'content' => $select->show((string)$config['timezone']),
);
}
@@ -232,7 +256,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['time_format'] = array(
- 'title' => html::label($field_id, Q(rcube_label('timeformat'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('timeformat'))),
'content' => $select->show($RCMAIL->config->get('time_format')),
);
}
@@ -253,7 +277,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['date_format'] = array(
- 'title' => html::label($field_id, Q(rcube_label('dateformat'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('dateformat'))),
'content' => $select->show($config['date_format']),
);
}
@@ -268,7 +292,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['prettydate'] = array(
- 'title' => html::label($field_id, Q(rcube_label('prettydate'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('prettydate'))),
'content' => $input->show($config['prettydate']?1:0),
);
}
@@ -281,16 +305,16 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_refresh_interval';
$select = new html_select(array('name' => '_refresh_interval', 'id' => $field_id));
- $select->add(rcube_label('never'), 0);
+ $select->add($RCMAIL->gettext('never'), 0);
foreach (array(1, 3, 5, 10, 15, 30, 60) as $min) {
if (!$config['min_refresh_interval'] || $config['min_refresh_interval'] <= $min * 60) {
- $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min)));
+ $label = $RCMAIL->gettext(array('name' => 'everynminutes', 'vars' => array('n' => $min)));
$select->add($label, $min);
}
}
$blocks['main']['options']['refresh_interval'] = array(
- 'title' => html::label($field_id, Q(rcube_label('refreshinterval'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('refreshinterval'))),
'content' => $select->show($config['refresh_interval']/60),
);
}
@@ -318,16 +342,16 @@ function rcmail_user_prefs($current = null)
if (is_array($meta) && $meta['name']) {
$skinname = $meta['name'];
- $author_link = $meta['url'] ? html::a(array('href' => $meta['url'], 'target' => '_blank'), Q($meta['author'])) : Q($meta['author']);
- $license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank'), Q($meta['license'])) : Q($meta['license']);
+ $author_link = $meta['url'] ? html::a(array('href' => $meta['url'], 'target' => '_blank'), rcube::Q($meta['author'])) : rcube::Q($meta['author']);
+ $license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank'), rcube::Q($meta['license'])) : rcube::Q($meta['license']);
}
$blocks['skin']['options'][$skin]['content'] = html::label(array('class' => 'skinselection'),
html::span('skinitem', $input->show($config['skin'], array('value' => $skin, 'id' => $field_id.$skin))) .
html::span('skinitem', html::img(array('src' => $thumbnail, 'class' => 'skinthumbnail', 'alt' => $skin, 'width' => 64, 'height' => 64))) .
- html::span('skinitem', html::span('skinname', Q($skinname)) . html::br() .
+ html::span('skinitem', html::span('skinname', rcube::Q($skinname)) . html::br() .
html::span('skinauthor', $author_link ? 'by ' . $author_link : '') . html::br() .
- html::span('skinlicense', $license_link ? rcube_label('license').':&nbsp;' . $license_link : ''))
+ html::span('skinlicense', $license_link ? $RCMAIL->gettext('license').':&nbsp;' . $license_link : ''))
);
}
}
@@ -344,7 +368,7 @@ function rcmail_user_prefs($current = null)
$checkbox = new html_checkbox(array('name' => '_standard_windows', 'id' => $field_id, 'value' => 1));
$blocks['browser']['options']['standard_windows'] = array(
- 'title' => html::label($field_id, Q(rcube_label('standardwindows'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('standardwindows'))),
'content' => $checkbox->show($config['standard_windows']?1:0),
);
}
@@ -352,13 +376,13 @@ function rcmail_user_prefs($current = null)
if ($current) {
$product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail');
$RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');",
- JS_OBJECT_NAME, JQ($product_name)), 'foot');
+ rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'foot');
}
$blocks['browser']['options']['mailtoprotohandler'] = array(
'content' => html::a(array(
'href' => '#',
- 'id' => 'mailtoprotohandler'), Q(rcube_label('mailtoprotohandler'))),
+ 'id' => 'mailtoprotohandler'), rcube::Q($RCMAIL->gettext('mailtoprotohandler'))),
);
break;
@@ -366,9 +390,9 @@ function rcmail_user_prefs($current = null)
// Mailbox view (mail screen)
case 'mailbox':
$blocks = array(
- 'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'new_message' => array('name' => Q(rcube_label('newmessage'))),
- 'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
+ 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))),
+ 'new_message' => array('name' => rcube::Q($RCMAIL->gettext('newmessage'))),
+ 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))),
);
// show config parameter for preview pane
@@ -382,7 +406,7 @@ function rcmail_user_prefs($current = null)
'onchange' => "$('#rcmfd_preview_pane_mark_read').prop('disabled', !this.checked)"));
$blocks['main']['options']['preview_pane'] = array(
- 'title' => html::label($field_id, Q(rcube_label('previewpane'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('previewpane'))),
'content' => $input->show($config['preview_pane']?1:0),
);
}
@@ -400,16 +424,16 @@ function rcmail_user_prefs($current = null)
$select = new html_select(array('name' => '_preview_pane_mark_read', 'id' => $field_id,
'disabled' => $config['preview_pane']?0:1));
- $select->add(rcube_label('never'), '-1');
- $select->add(rcube_label('immediately'), 0);
+ $select->add($RCMAIL->gettext('never'), '-1');
+ $select->add($RCMAIL->gettext('immediately'), 0);
foreach (array(5, 10, 20, 30) as $sec) {
- $label = rcube_label(array('name' => 'afternseconds', 'vars' => array('n' => $sec)));
+ $label = $RCMAIL->gettext(array('name' => 'afternseconds', 'vars' => array('n' => $sec)));
$select->add($label, $sec);
}
$blocks['main']['options']['preview_pane_mark_read'] = array(
- 'title' => html::label($field_id, Q(rcube_label('previewpanemarkread'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('previewpanemarkread'))),
'content' => $select->show(intval($config['preview_pane_mark_read'])),
);
}
@@ -421,14 +445,14 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_mdn_requests';
$select = new html_select(array('name' => '_mdn_requests', 'id' => $field_id));
- $select->add(rcube_label('askuser'), 0);
- $select->add(rcube_label('autosend'), 1);
- $select->add(rcube_label('autosendknown'), 3);
- $select->add(rcube_label('autosendknownignore'), 4);
- $select->add(rcube_label('ignore'), 2);
+ $select->add($RCMAIL->gettext('askuser'), 0);
+ $select->add($RCMAIL->gettext('autosend'), 1);
+ $select->add($RCMAIL->gettext('autosendknown'), 3);
+ $select->add($RCMAIL->gettext('autosendknownignore'), 4);
+ $select->add($RCMAIL->gettext('ignore'), 2);
$blocks['main']['options']['mdn_requests'] = array(
- 'title' => html::label($field_id, Q(rcube_label('mdnrequests'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('mdnrequests'))),
'content' => $select->show($config['mdn_requests']),
);
}
@@ -444,12 +468,12 @@ function rcmail_user_prefs($current = null)
if ($supported) {
$field_id = 'rcmfd_autoexpand_threads';
$select = new html_select(array('name' => '_autoexpand_threads', 'id' => $field_id));
- $select->add(rcube_label('never'), 0);
- $select->add(rcube_label('do_expand'), 1);
- $select->add(rcube_label('expand_only_unread'), 2);
+ $select->add($RCMAIL->gettext('never'), 0);
+ $select->add($RCMAIL->gettext('do_expand'), 1);
+ $select->add($RCMAIL->gettext('expand_only_unread'), 2);
$blocks['main']['options']['autoexpand_threads'] = array(
- 'title' => html::label($field_id, Q(rcube_label('autoexpand_threads'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autoexpand_threads'))),
'content' => $select->show($config['autoexpand_threads']),
);
}
@@ -466,7 +490,7 @@ function rcmail_user_prefs($current = null)
$size = intval($config['mail_pagesize'] ? $config['mail_pagesize'] : $config['pagesize']);
$blocks['main']['options']['pagesize'] = array(
- 'title' => html::label($field_id, Q(rcube_label('pagesize'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('pagesize'))),
'content' => $input->show($size ? $size : 50),
);
}
@@ -480,7 +504,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1));
$blocks['new_message']['options']['check_all_folders'] = array(
- 'title' => html::label($field_id, Q(rcube_label('checkallfolders'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('checkallfolders'))),
'content' => $input->show($config['check_all_folders']?1:0),
);
}
@@ -489,8 +513,8 @@ function rcmail_user_prefs($current = null)
// Message viewing
case 'mailview':
$blocks = array(
- 'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
+ 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))),
+ 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))),
);
// show checkbox to open message view in new window
@@ -503,7 +527,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_message_extwin', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['message_extwin'] = array(
- 'title' => html::label($field_id, Q(rcube_label('showinextwin'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showinextwin'))),
'content' => $input->show($config['message_extwin']?1:0),
);
}
@@ -518,7 +542,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_message_show_email', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['message_show_email'] = array(
- 'title' => html::label($field_id, Q(rcube_label('showemail'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showemail'))),
'content' => $input->show($config['message_show_email']?1:0),
);
}
@@ -534,7 +558,7 @@ function rcmail_user_prefs($current = null)
'onchange' => "$('#rcmfd_show_images').prop('disabled', !this.checked).val(0)"));
$blocks['main']['options']['prefer_html'] = array(
- 'title' => html::label($field_id, Q(rcube_label('preferhtml'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('preferhtml'))),
'content' => $input->show($config['prefer_html']?1:0),
);
}
@@ -547,7 +571,7 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_default_charset';
$blocks['advanced']['options']['default_charset'] = array(
- 'title' => html::label($field_id, Q(rcube_label('defaultcharset'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('defaultcharset'))),
'content' => $RCMAIL->output->charset_selector(array(
'id' => $field_id, 'name' => '_default_charset', 'selected' => $config['default_charset']
)));
@@ -562,12 +586,12 @@ function rcmail_user_prefs($current = null)
$input = new html_select(array('name' => '_show_images', 'id' => $field_id,
'disabled' => !$config['prefer_html']));
- $input->add(rcube_label('never'), 0);
- $input->add(rcube_label('fromknownsenders'), 1);
- $input->add(rcube_label('always'), 2);
+ $input->add($RCMAIL->gettext('never'), 0);
+ $input->add($RCMAIL->gettext('fromknownsenders'), 1);
+ $input->add($RCMAIL->gettext('always'), 2);
$blocks['main']['options']['show_images'] = array(
- 'title' => html::label($field_id, Q(rcube_label('showremoteimages'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showremoteimages'))),
'content' => $input->show($config['prefer_html'] ? $config['show_images'] : 0),
);
}
@@ -581,7 +605,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['inline_images'] = array(
- 'title' => html::label($field_id, Q(rcube_label('showinlineimages'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showinlineimages'))),
'content' => $input->show($config['inline_images']?1:0),
);
}
@@ -596,7 +620,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['display_next'] = array(
- 'title' => html::label($field_id, Q(rcube_label('displaynext'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('displaynext'))),
'content' => $input->show($config['display_next']?1:0),
);
}
@@ -605,10 +629,10 @@ function rcmail_user_prefs($current = null)
// Mail composition
case 'compose':
$blocks = array(
- 'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'sig' => array('name' => Q(rcube_label('signatureoptions'))),
- 'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))),
- 'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
+ 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))),
+ 'sig' => array('name' => rcube::Q($RCMAIL->gettext('signatureoptions'))),
+ 'spellcheck' => array('name' => rcube::Q($RCMAIL->gettext('spellcheckoptions'))),
+ 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))),
);
// show checkbox to compose messages in a new window
@@ -621,7 +645,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_compose_extwin', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['compose_extwin'] = array(
- 'title' => html::label($field_id, Q(rcube_label('composeextwin'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('composeextwin'))),
'content' => $input->show($config['compose_extwin']?1:0),
);
}
@@ -634,13 +658,13 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_htmleditor';
$select = new html_select(array('name' => '_htmleditor', 'id' => $field_id));
- $select->add(rcube_label('never'), 0);
- $select->add(rcube_label('always'), 1);
- $select->add(rcube_label('htmlonreply'), 2);
- $select->add(rcube_label('htmlonreplyandforward'), 3);
+ $select->add($RCMAIL->gettext('never'), 0);
+ $select->add($RCMAIL->gettext('always'), 1);
+ $select->add($RCMAIL->gettext('htmlonreply'), 2);
+ $select->add($RCMAIL->gettext('htmlonreplyandforward'), 3);
$blocks['main']['options']['htmleditor'] = array(
- 'title' => html::label($field_id, Q(rcube_label('htmleditor'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('htmleditor'))),
'content' => $select->show(intval($config['htmleditor'])),
);
}
@@ -653,14 +677,14 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_autosave';
$select = new html_select(array('name' => '_draft_autosave', 'id' => $field_id, 'disabled' => empty($config['drafts_mbox'])));
- $select->add(rcube_label('never'), 0);
+ $select->add($RCMAIL->gettext('never'), 0);
foreach (array(1, 3, 5, 10) as $i => $min) {
- $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min)));
+ $label = $RCMAIL->gettext(array('name' => 'everynminutes', 'vars' => array('n' => $min)));
$select->add($label, $min*60);
}
$blocks['main']['options']['draft_autosave'] = array(
- 'title' => html::label($field_id, Q(rcube_label('autosavedraft'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autosavedraft'))),
'content' => $select->show($config['draft_autosave']),
);
}
@@ -673,12 +697,12 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_param_folding';
$select = new html_select(array('name' => '_mime_param_folding', 'id' => $field_id));
- $select->add(rcube_label('2231folding'), 0);
- $select->add(rcube_label('miscfolding'), 1);
- $select->add(rcube_label('2047folding'), 2);
+ $select->add($RCMAIL->gettext('2231folding'), 0);
+ $select->add($RCMAIL->gettext('miscfolding'), 1);
+ $select->add($RCMAIL->gettext('2047folding'), 2);
$blocks['advanced']['options']['mime_param_folding'] = array(
- 'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('mimeparamfolding'))),
'content' => $select->show($config['mime_param_folding']),
);
}
@@ -692,7 +716,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_force_7bit', 'id' => $field_id, 'value' => 1));
$blocks['advanced']['options']['force_7bit'] = array(
- 'title' => html::label($field_id, Q(rcube_label('force7bit'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('force7bit'))),
'content' => $input->show($config['force_7bit']?1:0),
);
}
@@ -706,7 +730,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_mdn_default', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['mdn_default'] = array(
- 'title' => html::label($field_id, Q(rcube_label('reqmdn'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('reqmdn'))),
'content' => $input->show($config['mdn_default']?1:0),
);
}
@@ -720,7 +744,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_dsn_default', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['dsn_default'] = array(
- 'title' => html::label($field_id, Q(rcube_label('reqdsn'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('reqdsn'))),
'content' => $input->show($config['dsn_default']?1:0),
);
}
@@ -734,7 +758,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_reply_same_folder', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['reply_same_folder'] = array(
- 'title' => html::label($field_id, Q(rcube_label('replysamefolder'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('replysamefolder'))),
'content' => $input->show($config['reply_same_folder']?1:0),
);
}
@@ -747,12 +771,12 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_reply_mode';
$select = new html_select(array('name' => '_reply_mode', 'id' => $field_id));
- $select->add(rcube_label('replyempty'), -1);
- $select->add(rcube_label('replybottomposting'), 0);
- $select->add(rcube_label('replytopposting'), 1);
+ $select->add($RCMAIL->gettext('replyempty'), -1);
+ $select->add($RCMAIL->gettext('replybottomposting'), 0);
+ $select->add($RCMAIL->gettext('replytopposting'), 1);
$blocks['main']['options']['reply_mode'] = array(
- 'title' => html::label($field_id, Q(rcube_label('whenreplying'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('whenreplying'))),
'content' => $select->show(intval($config['reply_mode'])),
);
}
@@ -766,7 +790,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_spellcheck_before_send', 'id' => $field_id, 'value' => 1));
$blocks['spellcheck']['options']['spellcheck_before_send'] = array(
- 'title' => html::label($field_id, Q(rcube_label('spellcheckbeforesend'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('spellcheckbeforesend'))),
'content' => $input->show($config['spellcheck_before_send']?1:0),
);
}
@@ -782,7 +806,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_'.$key, 'id' => 'rcmfd_'.$key, 'value' => 1));
$blocks['spellcheck']['options'][$key] = array(
- 'title' => html::label($field_id, Q(rcube_label(str_replace('_', '', $key)))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext(str_replace('_', '', $key)))),
'content' => $input->show($config[$key]?1:0),
);
}
@@ -797,13 +821,13 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_show_sig';
$select = new html_select(array('name' => '_show_sig', 'id' => $field_id));
- $select->add(rcube_label('never'), 0);
- $select->add(rcube_label('always'), 1);
- $select->add(rcube_label('newmessageonly'), 2);
- $select->add(rcube_label('replyandforwardonly'), 3);
+ $select->add($RCMAIL->gettext('never'), 0);
+ $select->add($RCMAIL->gettext('always'), 1);
+ $select->add($RCMAIL->gettext('newmessageonly'), 2);
+ $select->add($RCMAIL->gettext('replyandforwardonly'), 3);
$blocks['sig']['options']['show_sig'] = array(
- 'title' => html::label($field_id, Q(rcube_label('autoaddsignature'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autoaddsignature'))),
'content' => $select->show($RCMAIL->config->get('show_sig', 1)),
);
}
@@ -817,7 +841,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_strip_existing_sig', 'id' => $field_id, 'value' => 1));
$blocks['sig']['options']['strip_existing_sig'] = array(
- 'title' => html::label($field_id, Q(rcube_label('replyremovesignature'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('replyremovesignature'))),
'content' => $input->show($config['strip_existing_sig']?1:0),
);
}
@@ -830,11 +854,11 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_forward_attachment';
$select = new html_select(array('name' => '_forward_attachment', 'id' => $field_id));
- $select->add(rcube_label('inline'), 0);
- $select->add(rcube_label('asattachment'), 1);
+ $select->add($RCMAIL->gettext('inline'), 0);
+ $select->add($RCMAIL->gettext('asattachment'), 1);
$blocks['main']['options']['forward_attachment'] = array(
- 'title' => html::label($field_id, Q(rcube_label('forwardmode'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('forwardmode'))),
'content' => $select->show(intval($config['forward_attachment'])),
);
}
@@ -858,24 +882,42 @@ function rcmail_user_prefs($current = null)
$select_default_font = new html_select(array('name' => '_default_font', 'id' => $field_id));
$select_default_font->add('', '');
- $fonts = rcube_fontdefs();
+ $fonts = rcmail::font_defs();
foreach ($fonts as $fname => $font) {
$select_default_font->add($fname, $fname);
}
$blocks['main']['options']['default_font'] = array(
- 'title' => html::label($field_id, Q(rcube_label('defaultfont'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('defaultfont'))),
'content' => $select_default_font->show($RCMAIL->config->get('default_font', 1)) .
$select_default_font_size->show($RCMAIL->config->get('default_font_size', 1))
);
}
+
+ if (!isset($no_override['reply_all_mode'])) {
+ if (!$current) {
+ continue 2;
+ }
+
+ $field_id = 'rcmfd_reply_all_mode';
+ $select = new html_select(array('name' => '_reply_all_mode', 'id' => $field_id));
+
+ $select->add($RCMAIL->gettext('replyalldefault'), 0);
+ $select->add($RCMAIL->gettext('replyalllist'), 1);
+
+ $blocks['main']['options']['reply_all_mode'] = array(
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('replyallmode'))),
+ 'content' => $select->show(intval($config['reply_all_mode'])),
+ );
+ }
+
break;
// Addressbook config
case 'addressbook':
$blocks = array(
- 'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
+ 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))),
+ 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))),
);
if (!isset($no_override['default_addressbook'])
@@ -893,7 +935,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['default_addressbook'] = array(
- 'title' => html::label($field_id, Q(rcube_label('defaultabook'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('defaultabook'))),
'content' => $select->show($config['default_addressbook']),
);
}
@@ -907,13 +949,13 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_addressbook_name_listing';
$select = new html_select(array('name' => '_addressbook_name_listing', 'id' => $field_id));
- $select->add(rcube_label('name'), 0);
- $select->add(rcube_label('firstname') . ' ' . rcube_label('surname'), 1);
- $select->add(rcube_label('surname') . ' ' . rcube_label('firstname'), 2);
- $select->add(rcube_label('surname') . ', ' . rcube_label('firstname'), 3);
+ $select->add($RCMAIL->gettext('name'), 0);
+ $select->add($RCMAIL->gettext('firstname') . ' ' . $RCMAIL->gettext('surname'), 1);
+ $select->add($RCMAIL->gettext('surname') . ' ' . $RCMAIL->gettext('firstname'), 2);
+ $select->add($RCMAIL->gettext('surname') . ', ' . $RCMAIL->gettext('firstname'), 3);
$blocks['main']['options']['list_name_listing'] = array(
- 'title' => html::label($field_id, Q(rcube_label('listnamedisplay'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('listnamedisplay'))),
'content' => $select->show($config['addressbook_name_listing']),
);
}
@@ -927,12 +969,12 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_addressbook_sort_col';
$select = new html_select(array('name' => '_addressbook_sort_col', 'id' => $field_id));
- $select->add(rcube_label('name'), 'name');
- $select->add(rcube_label('firstname'), 'firstname');
- $select->add(rcube_label('surname'), 'surname');
+ $select->add($RCMAIL->gettext('name'), 'name');
+ $select->add($RCMAIL->gettext('firstname'), 'firstname');
+ $select->add($RCMAIL->gettext('surname'), 'surname');
$blocks['main']['options']['sort_col'] = array(
- 'title' => html::label($field_id, Q(rcube_label('listsorting'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('listsorting'))),
'content' => $select->show($config['addressbook_sort_col']),
);
}
@@ -948,7 +990,7 @@ function rcmail_user_prefs($current = null)
$size = intval($config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize']);
$blocks['main']['options']['pagesize'] = array(
- 'title' => html::label($field_id, Q(rcube_label('pagesize'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('pagesize'))),
'content' => $input->show($size ? $size : 50),
);
}
@@ -962,7 +1004,7 @@ function rcmail_user_prefs($current = null)
$checkbox = new html_checkbox(array('name' => '_autocomplete_single', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['autocomplete_single'] = array(
- 'title' => html::label($field_id, Q(rcube_label('autocompletesingle'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autocompletesingle'))),
'content' => $checkbox->show($config['autocomplete_single']?1:0),
);
}
@@ -971,8 +1013,8 @@ function rcmail_user_prefs($current = null)
// Special IMAP folders
case 'folders':
$blocks = array(
- 'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
+ 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))),
+ 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))),
);
if (!isset($no_override['show_real_foldernames'])) {
@@ -984,14 +1026,14 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_show_real_foldernames', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['show_real_foldernames'] = array(
- 'title' => html::label($field_id, Q(rcube_label('show_real_foldernames'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('show_real_foldernames'))),
'content' => $input->show($config['show_real_foldernames']?1:0),
);
}
// Configure special folders
if (!isset($no_override['default_folders']) && $current) {
- $select = rcmail_mailbox_select(array(
+ $select = $RCMAIL->folder_selector(array(
'noselection' => '---',
'realnames' => true,
'maxlength' => 30,
@@ -1009,7 +1051,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['drafts_mbox'] = array(
- 'title' => Q(rcube_label('drafts')),
+ 'title' => rcube::Q($RCMAIL->gettext('drafts')),
'content' => $select->show($config['drafts_mbox'], array('name' => "_drafts_mbox", 'onchange' => $onchange)),
);
}
@@ -1020,7 +1062,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['sent_mbox'] = array(
- 'title' => Q(rcube_label('sent')),
+ 'title' => rcube::Q($RCMAIL->gettext('sent')),
'content' => $select->show($config['sent_mbox'], array('name' => "_sent_mbox", 'onchange' => '')),
);
}
@@ -1031,7 +1073,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['junk_mbox'] = array(
- 'title' => Q(rcube_label('junk')),
+ 'title' => rcube::Q($RCMAIL->gettext('junk')),
'content' => $select->show($config['junk_mbox'], array('name' => "_junk_mbox", 'onchange' => $onchange)),
);
}
@@ -1042,7 +1084,7 @@ function rcmail_user_prefs($current = null)
}
$blocks['main']['options']['trash_mbox'] = array(
- 'title' => Q(rcube_label('trash')),
+ 'title' => rcube::Q($RCMAIL->gettext('trash')),
'content' => $select->show($config['trash_mbox'], array('name' => "_trash_mbox", 'onchange' => $onchange)),
);
}
@@ -1051,9 +1093,9 @@ function rcmail_user_prefs($current = null)
// Server settings
case 'server':
$blocks = array(
- 'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'maintenance' => array('name' => Q(rcube_label('maintenance'))),
- 'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
+ 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))),
+ 'maintenance' => array('name' => rcube::Q($RCMAIL->gettext('maintenance'))),
+ 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))),
);
if (!isset($no_override['read_when_deleted'])) {
@@ -1065,7 +1107,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['read_when_deleted'] = array(
- 'title' => html::label($field_id, Q(rcube_label('readwhendeleted'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('readwhendeleted'))),
'content' => $input->show($config['read_when_deleted']?1:0),
);
}
@@ -1079,7 +1121,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['flag_for_deletion'] = array(
- 'title' => html::label($field_id, Q(rcube_label('flagfordeletion'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('flagfordeletion'))),
'content' => $input->show($config['flag_for_deletion']?1:0),
);
}
@@ -1094,7 +1136,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_skip_deleted', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['skip_deleted'] = array(
- 'title' => html::label($field_id, Q(rcube_label('skipdeleted'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('skipdeleted'))),
'content' => $input->show($config['skip_deleted']?1:0),
);
}
@@ -1108,7 +1150,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_delete_always', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['delete_always'] = array(
- 'title' => html::label($field_id, Q(rcube_label('deletealways'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('deletealways'))),
'content' => $input->show($config['delete_always']?1:0),
);
}
@@ -1122,7 +1164,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_delete_junk', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['delete_junk'] = array(
- 'title' => html::label($field_id, Q(rcube_label('deletejunk'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('deletejunk'))),
'content' => $input->show($config['delete_junk']?1:0),
);
}
@@ -1137,7 +1179,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1));
$blocks['maintenance']['options']['logout_purge'] = array(
- 'title' => html::label($field_id, Q(rcube_label('logoutclear'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('logoutclear'))),
'content' => $input->show($config['logout_purge']?1:0),
);
}
@@ -1152,7 +1194,7 @@ function rcmail_user_prefs($current = null)
$input = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1));
$blocks['maintenance']['options']['logout_expunge'] = array(
- 'title' => html::label($field_id, Q(rcube_label('logoutcompact'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('logoutcompact'))),
'content' => $input->show($config['logout_expunge']?1:0),
);
}
@@ -1162,14 +1204,31 @@ function rcmail_user_prefs($current = null)
$data = $RCMAIL->plugins->exec_hook('preferences_list',
array('section' => $sect['id'], 'blocks' => $blocks, 'current' => $current));
+ $advanced_prefs = (array) $RCMAIL->config->get('advanced_prefs');
+
// create output
- foreach ($data['blocks'] as $block) {
+ foreach ($data['blocks'] as $key => $block) {
if (!empty($block['content']) || !empty($block['options'])) {
$found = true;
- break;
+ }
+ // move some options to the 'advanced' block as configured by admin
+ if ($key != 'advanced') {
+ foreach ($advanced_prefs as $opt) {
+ if ($block['options'][$opt]) {
+ $data['blocks']['advanced']['options'][$opt] = $block['options'][$opt];
+ unset($data['blocks'][$key]['options'][$opt]);
+ }
+ }
}
}
+ // move 'advanced' block to the end of the list
+ if (!empty($data['blocks']['advanced'])) {
+ $adv = $data['blocks']['advanced'];
+ unset($data['blocks']['advanced']);
+ $data['blocks']['advanced'] = $adv;
+ }
+
if (!$found)
unset($sections[$idx]);
else
@@ -1230,20 +1289,22 @@ function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class
$storage = $RCMAIL->get_storage();
$delimiter = $storage->get_hierarchy_delimiter();
- $name_utf8 = rcube_charset_convert($name, 'UTF7-IMAP');
+ $name_utf8 = rcube_charset::convert($name, 'UTF7-IMAP');
$protected = $protect_folders && in_array($name, $default_folders);
$foldersplit = explode($delimiter, $storage->mod_folder($name));
$level = count($foldersplit) - 1;
$display_name = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level)
- . Q($protected ? rcmail_localize_foldername($name) : rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP'));
+ . rcube::Q($protected ? $RCMAIL->localize_foldername($name) : rcube_charset::convert($foldersplit[$level], 'UTF7-IMAP'));
- if ($oldname === null)
+ if ($oldname === null) {
$OUTPUT->command('add_folder_row', $name_utf8, $display_name, $protected, $subscribe,
false, $class_name);
- else
- $OUTPUT->command('replace_folder_row', rcube_charset_convert($oldname, 'UTF7-IMAP'),
+ }
+ else {
+ $OUTPUT->command('replace_folder_row', rcube_charset::convert($oldname, 'UTF7-IMAP'),
$name_utf8, $display_name, $protected, $class_name);
+ }
}
/**
@@ -1260,17 +1321,18 @@ function rcmail_settings_tabs($attrib)
array('command' => 'preferences', 'type' => 'link', 'label' => 'preferences', 'title' => 'editpreferences'),
array('command' => 'folders', 'type' => 'link', 'label' => 'folders', 'title' => 'managefolders'),
array('command' => 'identities', 'type' => 'link', 'label' => 'identities', 'title' => 'manageidentities'),
+ array('command' => 'responses', 'type' => 'link', 'label' => 'responses', 'title' => 'editresponses'),
);
// get all identites from DB and define list of cols to be displayed
$plugin = $RCMAIL->plugins->exec_hook('settings_actions', array(
'actions' => $default_actions,
- 'attrib' => $attrib,
+ 'attrib' => $attrib,
));
- $attrib = $plugin['attrib'];
+ $attrib = $plugin['attrib'];
$tagname = $attrib['tagname'];
- $tabs = array();
+ $tabs = array();
foreach ($plugin['actions'] as $k => $action) {
if (!$action['command'] && !$action['href'] && $action['action']) {
@@ -1278,13 +1340,15 @@ function rcmail_settings_tabs($attrib)
}
$button = $OUTPUT->button($action);
- $attr = $attrib;
+ $attr = $attrib;
$cmd = $action['action'] ? $action['action'] : $action['command'];
- $id = $action['id'] ? $action['id'] : $cmd;
+ $id = $action['id'] ? $action['id'] : $cmd;
+
if (!empty($id)) {
$attr['id'] = preg_replace('/[^a-z0-9]/i', '', $attrib['idprefix'] . $id);
}
+
$classnames = array($attrib['class']);
if (!empty($action['class'])) {
$classnames[] = $action['class'];
@@ -1295,30 +1359,10 @@ function rcmail_settings_tabs($attrib)
if ($RCMAIL->action == $cmd) {
$classnames[] = $attrib['selclass'];
}
+
$attr['class'] = join(' ', $classnames);
$tabs[] = html::tag($tagname, $attr, $button, html::$common_attrib);
}
return join('', $tabs);
}
-
-
-// register UI objects
-$OUTPUT->add_handlers(array(
- 'settingstabs' => 'rcmail_settings_tabs',
- 'prefsframe' => 'rcmail_preferences_frame',
- 'sectionslist' => 'rcmail_sections_list',
- 'identitieslist' => 'rcmail_identities_list',
-));
-
-// register action aliases
-$RCMAIL->register_action_map(array(
- 'folders' => 'folders.inc',
- 'rename-folder' => 'folders.inc',
- 'delete-folder' => 'folders.inc',
- 'subscribe' => 'folders.inc',
- 'unsubscribe' => 'folders.inc',
- 'purge' => 'folders.inc',
- 'folder-size' => 'folders.inc',
- 'add-identity' => 'edit_identity.inc',
-));
diff --git a/program/steps/settings/identities.inc b/program/steps/settings/identities.inc
index 82a1841a3..e19c16c79 100644
--- a/program/steps/settings/identities.inc
+++ b/program/steps/settings/identities.inc
@@ -5,7 +5,7 @@
| program/steps/settings/identities.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2007, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,23 +21,24 @@
define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0)));
-$OUTPUT->set_pagetitle(rcube_label('identities'));
+$OUTPUT->set_pagetitle($RCMAIL->gettext('identities'));
$OUTPUT->include_script('list.js');
-
-// similar function as /steps/addressbook/func.inc::rcmail_contact_frame()
-function rcmail_identity_frame($attrib)
- {
- global $OUTPUT;
-
- if (!$attrib['id'])
- $attrib['id'] = 'rcmIdentityFrame';
-
- return $OUTPUT->frame($attrib, true);
- }
-
$OUTPUT->add_handler('identityframe', 'rcmail_identity_frame');
$OUTPUT->set_env('identities_level', IDENTITIES_LEVEL);
$OUTPUT->add_label('deleteidentityconfirm');
$OUTPUT->send('identities');
+
+
+// similar function as /steps/addressbook/func.inc::rcmail_contact_frame()
+function rcmail_identity_frame($attrib)
+{
+ global $OUTPUT;
+
+ if (!$attrib['id']) {
+ $attrib['id'] = 'rcmIdentityFrame';
+ }
+
+ return $OUTPUT->frame($attrib, true);
+}
diff --git a/program/steps/settings/responses.inc b/program/steps/settings/responses.inc
new file mode 100644
index 000000000..06093b3b8
--- /dev/null
+++ b/program/steps/settings/responses.inc
@@ -0,0 +1,133 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/settings/responses.inc |
+ | |
+ | This file is part of the Roundcube Webmail client |
+ | Copyright (C) 2013, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
+ | |
+ | PURPOSE: |
+ | Manage and save canned response texts |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com> |
+ +-----------------------------------------------------------------------+
+*/
+
+
+if (!empty($_POST['_insert'])) {
+ $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST));
+ $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST, true));
+
+ if (!empty($name) && !empty($text)) {
+ $dupes = 0;
+ $responses = $RCMAIL->get_compose_responses(false, true);
+ foreach ($responses as $resp) {
+ if (strcasecmp($name, preg_replace('/\s\(\d+\)$/', '', $resp['name'])) == 0)
+ $dupes++;
+ }
+ if ($dupes) { // require a unique name
+ $name .= ' (' . ++$dupes . ')';
+ }
+
+ $response = array('name' => $name, 'text' => $text, 'format' => 'text', 'key' => substr(md5($name), 0, 16));
+ $responses[] = $response;
+
+ if ($RCMAIL->user->save_prefs(array('compose_responses' => $responses))) {
+ $RCMAIL->output->command('add_response_item', $response);
+ $RCMAIL->output->command('display_message', $RCMAIL->gettext('successfullysaved'), 'confirmation');
+ }
+ else {
+ $RCMAIL->output->command('display_message', $RCMAIL->gettext('errorsaving'), 'error');
+ }
+ }
+
+ // send response
+ $RCMAIL->output->send();
+}
+
+if ($RCMAIL->action == 'delete-response') {
+ if ($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_GPC)) {
+ $responses = $RCMAIL->get_compose_responses(false, true);
+ foreach ($responses as $i => $response) {
+ if (empty($response['key']))
+ $response['key'] = substr(md5($response['name']), 0, 16);
+ if ($response['key'] == $key) {
+ unset($responses[$i]);
+ $deleted = $RCMAIL->user->save_prefs(array('compose_responses' => $responses));
+ break;
+ }
+ }
+ }
+
+ if ($deleted) {
+ $RCMAIL->output->command('display_message', $RCMAIL->gettext('deletedsuccessfully'), 'confirmation');
+ $RCMAIL->output->command('remove_response', $key);
+ }
+
+ if ($RCMAIL->output->ajax_call) {
+ $RCMAIL->output->send();
+ }
+}
+
+
+$OUTPUT->set_pagetitle($RCMAIL->gettext('responses'));
+$OUTPUT->include_script('list.js');
+
+$OUTPUT->add_handlers(array(
+ 'responseframe' => 'rcmail_response_frame',
+ 'responseslist' => 'rcmail_responses_list',
+));
+$OUTPUT->add_label('deleteresponseconfirm');
+
+$OUTPUT->send('responses');
+
+
+/**
+ *
+ */
+function rcmail_responses_list($attrib)
+{
+ global $RCMAIL, $OUTPUT;
+
+ $attrib += array('id' => 'rcmresponseslist', 'tagname' => 'table', 'cols' => 1);
+
+ $plugin = $RCMAIL->plugins->exec_hook('responses_list', array(
+ 'list' => $RCMAIL->get_compose_responses(true),
+ 'cols' => array('name')
+ ));
+
+ $out = $RCMAIL->table_output($attrib, $plugin['list'], $plugin['cols'], 'key');
+
+ $readonly_responses = array();
+ foreach ($plugin['list'] as $item) {
+ if (!empty($item['static'])) {
+ $readonly_responses[] = $item['key'];
+ }
+ }
+
+ // set client env
+ $OUTPUT->add_gui_object('responseslist', $attrib['id']);
+ $OUTPUT->set_env('readonly_responses', $readonly_responses);
+
+ return $out;
+}
+
+// similar function as /steps/addressbook/func.inc::rcmail_contact_frame()
+function rcmail_response_frame($attrib)
+{
+ global $OUTPUT;
+
+ if (!$attrib['id']) {
+ $attrib['id'] = 'rcmResponseFrame';
+ }
+
+ $OUTPUT->set_env('contentframe', $attrib['id']);
+
+ return $OUTPUT->frame($attrib, true);
+}
diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc
index 877b0fbbe..d1449bb38 100644
--- a/program/steps/settings/save_folder.inc
+++ b/program/steps/settings/save_folder.inc
@@ -1,11 +1,11 @@
<?php
-/**
+/*
+-----------------------------------------------------------------------+
| program/steps/settings/save_folder.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,18 +19,17 @@
+-----------------------------------------------------------------------+
*/
-// WARNING: folder names in UI are encoded with RCMAIL_CHARSET
+// WARNING: folder names in UI are encoded with RCUBE_CHARSET
// init IMAP connection
$STORAGE = $RCMAIL->get_storage();
+$name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true));
+$old = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true);
+$path = rcube_utils::get_input_value('_parent', rcube_utils::INPUT_POST, true);
-$name = trim(get_input_value('_name', RCUBE_INPUT_POST, true));
-$old = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true));
-$path = trim(get_input_value('_parent', RCUBE_INPUT_POST, true));
-
-$name_imap = rcube_charset_convert($name, RCMAIL_CHARSET, 'UTF7-IMAP');
-$old_imap = rcube_charset_convert($old, RCMAIL_CHARSET, 'UTF7-IMAP');
+$name_imap = rcube_charset::convert($name, RCUBE_CHARSET, 'UTF7-IMAP');
+$old_imap = rcube_charset::convert($old, RCUBE_CHARSET, 'UTF7-IMAP');
// $path is in UTF7-IMAP already
$delimiter = $STORAGE->get_hierarchy_delimiter();
@@ -40,16 +39,16 @@ $options = strlen($old_imap) ? rcmail_folder_options($old_imap) : array();
if ($options['protected'] || $options['norename']) {
}
else if (!strlen($name)) {
- $error = rcube_label('cannotbeempty');
+ $error = $RCMAIL->gettext('namecannotbeempty');
}
else if (mb_strlen($name) > 128) {
- $error = rcube_label('nametoolong');
+ $error = $RCMAIL->gettext('nametoolong');
}
else {
// these characters are problematic e.g. when used in LIST/LSUB
foreach (array($delimiter, '%', '*') as $char) {
if (strpos($name, $delimiter) !== false) {
- $error = rcube_label('forbiddencharacter') . " ($char)";
+ $error = $RCMAIL->gettext('forbiddencharacter') . " ($char)";
break;
}
}
@@ -76,7 +75,7 @@ if (!$error && strlen($path) && (!strlen($old_imap) || $old_imap != $name_imap))
if ($parent_opts['namespace'] != 'personal'
&& (empty($parent_opts['rights']) || !preg_match('/[ck]/', implode($parent_opts['rights'])))
) {
- $error = rcube_label('parentnotwritable');
+ $error = $RCMAIL->gettext('parentnotwritable');
}
}
@@ -90,15 +89,14 @@ else {
$folder['options'] = $options;
$folder['settings'] = array(
// List view mode: 0-list, 1-threads
- 'view_mode' => (int) get_input_value('_viewmode', RCUBE_INPUT_POST),
- 'sort_column' => get_input_value('_sortcol', RCUBE_INPUT_POST),
- 'sort_order' => get_input_value('_sortord', RCUBE_INPUT_POST),
+ 'view_mode' => (int) rcube_utils::get_input_value('_viewmode', rcube_utils::INPUT_POST),
+ 'sort_column' => rcube_utils::get_input_value('_sortcol', rcube_utils::INPUT_POST),
+ 'sort_order' => rcube_utils::get_input_value('_sortord', rcube_utils::INPUT_POST),
);
}
// create a new mailbox
if (!$error && !strlen($old)) {
-
$folder['subscribe'] = true;
$plugin = $RCMAIL->plugins->exec_hook('folder_create', array('record' => $folder));
@@ -136,7 +134,6 @@ if (!$error && !strlen($old)) {
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
}
}
-
// update a mailbox
else if (!$error) {
$plugin = $RCMAIL->plugins->exec_hook('folder_update', array('record' => $folder));
@@ -192,6 +189,9 @@ else if (!$error) {
rcmail_update_folder_row($folder['name'], $folder['oldname'], $folder['subscribe'], $folder['class']);
$OUTPUT->send('iframe');
}
+ else if (!empty($folder['class'])) {
+ rcmail_update_folder_row($folder['name'], $folder['oldname'], $folder['subscribe'], $folder['class']);
+ }
}
else {
// show error message
@@ -199,4 +199,4 @@ else if (!$error) {
}
}
-rcmail_overwrite_action('edit-folder');
+$RCMAIL->overwrite_action('edit-folder');
diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc
index d3b132f8b..1584c5f00 100644
--- a/program/steps/settings/save_identity.inc
+++ b/program/steps/settings/save_identity.inc
@@ -5,7 +5,7 @@
| program/steps/settings/save_identity.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -21,161 +21,173 @@
define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0)));
-$a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature', 'html_signature');
+$a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature', 'html_signature');
$a_boolean_cols = array('standard', 'html_signature');
$updated = $default_id = false;
// check input
if (IDENTITIES_LEVEL != 4 && (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3))) {
- $OUTPUT->show_message('formincomplete', 'warning');
- rcmail_overwrite_action('edit-identity');
- return;
+ $OUTPUT->show_message('formincomplete', 'warning');
+ $RCMAIL->overwrite_action('edit-identity');
+ return;
}
$save_data = array();
foreach ($a_save_cols as $col) {
- $fname = '_'.$col;
- if (isset($_POST[$fname]))
- $save_data[$col] = get_input_value($fname, RCUBE_INPUT_POST, true);
+ $fname = '_'.$col;
+ if (isset($_POST[$fname])) {
+ $save_data[$col] = rcube_utils::get_input_value($fname, rcube_utils::INPUT_POST, true);
+ }
}
// set "off" values for checkboxes that were not checked, and therefore
// not included in the POST body.
foreach ($a_boolean_cols as $col) {
- $fname = '_' . $col;
- if (!isset($_POST[$fname]))
- $save_data[$col] = 0;
+ $fname = '_' . $col;
+ if (!isset($_POST[$fname])) {
+ $save_data[$col] = 0;
+ }
}
// unset email address if user has no rights to change it
if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) {
- unset($save_data['email']);
+ unset($save_data['email']);
}
// unset all fields except signature
else if (IDENTITIES_LEVEL == 4) {
- foreach ($save_data as $idx => $value) {
- if ($idx != 'signature' && $idx != 'html_signature') {
- unset($save_data[$idx]);
+ foreach ($save_data as $idx => $value) {
+ if ($idx != 'signature' && $idx != 'html_signature') {
+ unset($save_data[$idx]);
+ }
}
- }
}
// Validate e-mail addresses
-$email_checks = array(rcube_idn_to_ascii($save_data['email']));
+$email_checks = array(rcube_utils::idn_to_ascii($save_data['email']));
foreach (array('reply-to', 'bcc') as $item) {
- foreach (rcube_mime::decode_address_list($save_data[$item], null, false) as $rcpt)
- $email_checks[] = rcube_idn_to_ascii($rcpt['mailto']);
+ foreach (rcube_mime::decode_address_list($save_data[$item], null, false) as $rcpt) {
+ $email_checks[] = rcube_utils::idn_to_ascii($rcpt['mailto']);
+ }
}
foreach ($email_checks as $email) {
- if ($email && !check_email($email)) {
- // show error message
- $OUTPUT->show_message('emailformaterror', 'error', array('email' => rcube_idn_to_utf8($email)), false);
- rcmail_overwrite_action('edit-identity');
- return;
- }
+ if ($email && !rcube_utils::check_email($email)) {
+ // show error message
+ $OUTPUT->show_message('emailformaterror', 'error', array('email' => rcube_utils::idn_to_utf8($email)), false);
+ $RCMAIL->overwrite_action('edit-identity');
+ return;
+ }
}
// XSS protection in HTML signature (#1489251)
if (!empty($save_data['signature']) && !empty($save_data['html_signature'])) {
- $save_data['signature'] = rcmail_wash_html($save_data['signature']);
+ $save_data['signature'] = rcmail_wash_html($save_data['signature']);
- // clear POST data of signature, we want to use safe content
- // when the form is displayed again
- unset($_POST['_signature']);
+ // clear POST data of signature, we want to use safe content
+ // when the form is displayed again
+ unset($_POST['_signature']);
}
// update an existing contact
if ($_POST['_iid']) {
- $iid = get_input_value('_iid', RCUBE_INPUT_POST);
-
- if (in_array(IDENTITIES_LEVEL, array(1,3,4))) {
- // merge with old identity data, fixes #1488834
- $identity = $RCMAIL->user->get_identity($iid);
- $save_data = array_merge($identity, $save_data);
- unset($save_data['changed'], $save_data['del'], $save_data['user_id'], $save_data['identity_id']);
- }
-
- $plugin = $RCMAIL->plugins->exec_hook('identity_update', array('id' => $iid, 'record' => $save_data));
- $save_data = $plugin['record'];
-
- if ($save_data['email'])
- $save_data['email'] = rcube_idn_to_ascii($save_data['email']);
- if (!$plugin['abort'])
- $updated = $RCMAIL->user->update_identity($iid, $save_data);
- else
- $updated = $plugin['result'];
-
- if ($updated) {
- $OUTPUT->show_message('successfullysaved', 'confirmation');
-
- if (!empty($save_data['standard']))
- $default_id = $iid;
-
- if ($_POST['_framed']) {
- // update the changed col in list
- $OUTPUT->command('parent.update_identity_row', $iid, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>')));
+ $iid = rcube_utils::get_input_value('_iid', rcube_utils::INPUT_POST);
+
+ if (in_array(IDENTITIES_LEVEL, array(1,3,4))) {
+ // merge with old identity data, fixes #1488834
+ $identity = $RCMAIL->user->get_identity($iid);
+ $save_data = array_merge($identity, $save_data);
+
+ unset($save_data['changed'], $save_data['del'], $save_data['user_id'], $save_data['identity_id']);
}
- }
- else {
- // show error message
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
- rcmail_overwrite_action('edit-identity');
- return;
- }
-}
+ $plugin = $RCMAIL->plugins->exec_hook('identity_update', array('id' => $iid, 'record' => $save_data));
+ $save_data = $plugin['record'];
+
+ if ($save_data['email']) {
+ $save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']);
+ }
+
+ if (!$plugin['abort'])
+ $updated = $RCMAIL->user->update_identity($iid, $save_data);
+ else
+ $updated = $plugin['result'];
+
+ if ($updated) {
+ $OUTPUT->show_message('successfullysaved', 'confirmation');
+
+ if (!empty($save_data['standard'])) {
+ $default_id = $iid;
+ }
+
+ if ($_POST['_framed']) {
+ // update the changed col in list
+ $name = $save_data['name'] . ' <' . rcube_utils::idn_to_utf8($save_data['email']) .'>';
+ $OUTPUT->command('parent.update_identity_row', $iid, rcube::Q(trim($name)));
+ }
+ }
+ else {
+ // show error message
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
+ $RCMAIL->overwrite_action('edit-identity');
+ return;
+ }
+}
// insert a new identity record
else if (IDENTITIES_LEVEL < 2) {
- if (IDENTITIES_LEVEL == 1) {
- $save_data['email'] = $RCMAIL->get_user_email();
- }
+ if (IDENTITIES_LEVEL == 1) {
+ $save_data['email'] = $RCMAIL->get_user_email();
+ }
- $plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data));
- $save_data = $plugin['record'];
+ $plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data));
+ $save_data = $plugin['record'];
- if ($save_data['email'])
- $save_data['email'] = rcube_idn_to_ascii($save_data['email']);
+ if ($save_data['email']) {
+ $save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']);
+ }
- if (!$plugin['abort'])
- $insert_id = $save_data['email'] ? $RCMAIL->user->insert_identity($save_data) : null;
- else
- $insert_id = $plugin['result'];
+ if (!$plugin['abort'])
+ $insert_id = $save_data['email'] ? $RCMAIL->user->insert_identity($save_data) : null;
+ else
+ $insert_id = $plugin['result'];
- if ($insert_id) {
- $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
+ if ($insert_id) {
+ $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
- $_GET['_iid'] = $insert_id;
+ $_GET['_iid'] = $insert_id;
- if (!empty($save_data['standard']))
- $default_id = $insert_id;
+ if (!empty($save_data['standard'])) {
+ $default_id = $insert_id;
+ }
- if ($_POST['_framed']) {
- // add a new row to the list
- $OUTPUT->command('parent.update_identity_row', $insert_id, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>')), true);
+ if ($_POST['_framed']) {
+ // add a new row to the list
+ $name = $save_data['name'] . ' <' . rcube_utils::idn_to_utf8($save_data['email']) .'>';
+ $OUTPUT->command('parent.update_identity_row', $insert_id, rcube::Q(trim($name)), true);
+ }
+ }
+ else {
+ // show error message
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
+ $RCMAIL->overwrite_action('edit-identity');
+ return;
}
- }
- else {
- // show error message
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
- rcmail_overwrite_action('edit-identity');
- return;
- }
}
-else
- $OUTPUT->show_message('opnotpermitted', 'error');
-
+else {
+ $OUTPUT->show_message('opnotpermitted', 'error');
+}
// mark all other identities as 'not-default'
-if ($default_id)
- $RCMAIL->user->set_default($default_id);
+if ($default_id) {
+ $RCMAIL->user->set_default($default_id);
+}
// go to next step
if (!empty($_REQUEST['_framed'])) {
- rcmail_overwrite_action('edit-identity');
+ $RCMAIL->overwrite_action('edit-identity');
+}
+else {
+ $RCMAIL->overwrite_action('identities');
}
-else
- rcmail_overwrite_action('identities');
/**
@@ -185,16 +197,16 @@ function rcmail_wash_html($html)
{
// Add header with charset spec., washtml cannot work without that
$html = '<html><head>'
- . '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />'
+ . '<meta http-equiv="Content-Type" content="text/html; charset='.RCUBE_CHARSET.'" />'
. '</head><body>' . $html . '</body></html>';
// clean HTML with washhtml by Frederic Motte
$wash_opts = array(
- 'show_washed' => false,
- 'allow_remote' => 1,
- 'charset' => RCMAIL_CHARSET,
+ 'show_washed' => false,
+ 'allow_remote' => 1,
+ 'charset' => RCUBE_CHARSET,
'html_elements' => array('body', 'link'),
- 'html_attribs' => array('rel', 'type'),
+ 'html_attribs' => array('rel', 'type'),
);
// initialize HTML washer
@@ -204,12 +216,12 @@ function rcmail_wash_html($html)
//$washer->add_callback('style', 'rcmail_washtml_callback');
// Remove non-UTF8 characters (#1487813)
- $html = rc_utf8_clean($html);
+ $html = rcube_charset::clean($html);
$html = $washer->wash($html);
// remove unwanted comments and tags (produced by washtml)
$html = preg_replace(array('/<!--[^>]+-->/', '/<\/?body>/'), '', $html);
- return $html;
+ return $html;
}
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 717c7ad8c..f71eee39a 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -5,7 +5,7 @@
| program/steps/settings/save_prefs.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2009, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,190 +19,191 @@
+-----------------------------------------------------------------------+
*/
-$CURR_SECTION = get_input_value('_section', RCUBE_INPUT_POST);
-
+$CURR_SECTION = rcube_utils::get_input_value('_section', rcube_utils::INPUT_POST);
$a_user_prefs = array();
// set options for specified section
-switch ($CURR_SECTION)
-{
- case 'general':
+switch ($CURR_SECTION) {
+case 'general':
$a_user_prefs = array(
- 'language' => isset($_POST['_language']) ? get_input_value('_language', RCUBE_INPUT_POST) : $CONFIG['language'],
- 'timezone' => isset($_POST['_timezone']) ? get_input_value('_timezone', RCUBE_INPUT_POST) : $CONFIG['timezone'],
- 'date_format' => isset($_POST['_date_format']) ? get_input_value('_date_format', RCUBE_INPUT_POST) : $CONFIG['date_format'],
- 'time_format' => isset($_POST['_time_format']) ? get_input_value('_time_format', RCUBE_INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'),
- 'prettydate' => isset($_POST['_pretty_date']) ? TRUE : FALSE,
- 'refresh_interval' => isset($_POST['_refresh_interval']) ? intval($_POST['_refresh_interval'])*60 : $CONFIG['refresh_interval'],
- 'standard_windows' => isset($_POST['_standard_windows']) ? TRUE : FALSE,
- 'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'],
+ 'language' => isset($_POST['_language']) ? rcube_utils::get_input_value('_language', rcube_utils::INPUT_POST) : $CONFIG['language'],
+ 'timezone' => isset($_POST['_timezone']) ? rcube_utils::get_input_value('_timezone', rcube_utils::INPUT_POST) : $CONFIG['timezone'],
+ 'date_format' => isset($_POST['_date_format']) ? rcube_utils::get_input_value('_date_format', rcube_utils::INPUT_POST) : $CONFIG['date_format'],
+ 'time_format' => isset($_POST['_time_format']) ? rcube_utils::get_input_value('_time_format', rcube_utils::INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'),
+ 'prettydate' => isset($_POST['_pretty_date']) ? true : false,
+ 'refresh_interval' => isset($_POST['_refresh_interval']) ? intval($_POST['_refresh_interval'])*60 : $CONFIG['refresh_interval'],
+ 'standard_windows' => isset($_POST['_standard_windows']) ? true : false,
+ 'skin' => isset($_POST['_skin']) ? rcube_utils::get_input_value('_skin', rcube_utils::INPUT_POST) : $CONFIG['skin'],
);
// compose derived date/time format strings
if ((isset($_POST['_date_format']) || isset($_POST['_time_format'])) && $a_user_prefs['date_format'] && $a_user_prefs['time_format']) {
- $a_user_prefs['date_short'] = 'D ' . $a_user_prefs['time_format'];
- $a_user_prefs['date_long'] = $a_user_prefs['date_format'] . ' ' . $a_user_prefs['time_format'];
+ $a_user_prefs['date_short'] = 'D ' . $a_user_prefs['time_format'];
+ $a_user_prefs['date_long'] = $a_user_prefs['date_format'] . ' ' . $a_user_prefs['time_format'];
}
- break;
+ break;
- case 'mailbox':
+case 'mailbox':
$a_user_prefs = array(
- 'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE,
- 'preview_pane_mark_read' => isset($_POST['_preview_pane_mark_read']) ? intval($_POST['_preview_pane_mark_read']) : $CONFIG['preview_pane_mark_read'],
- 'autoexpand_threads' => isset($_POST['_autoexpand_threads']) ? intval($_POST['_autoexpand_threads']) : 0,
- 'mdn_requests' => isset($_POST['_mdn_requests']) ? intval($_POST['_mdn_requests']) : 0,
- 'check_all_folders' => isset($_POST['_check_all_folders']) ? TRUE : FALSE,
- 'mail_pagesize' => is_numeric($_POST['_mail_pagesize']) ? max(2, intval($_POST['_mail_pagesize'])) : $CONFIG['mail_pagesize'],
+ 'preview_pane' => isset($_POST['_preview_pane']) ? true : false,
+ 'preview_pane_mark_read' => isset($_POST['_preview_pane_mark_read']) ? intval($_POST['_preview_pane_mark_read']) : $CONFIG['preview_pane_mark_read'],
+ 'autoexpand_threads' => isset($_POST['_autoexpand_threads']) ? intval($_POST['_autoexpand_threads']) : 0,
+ 'mdn_requests' => isset($_POST['_mdn_requests']) ? intval($_POST['_mdn_requests']) : 0,
+ 'check_all_folders' => isset($_POST['_check_all_folders']) ? true : false,
+ 'mail_pagesize' => is_numeric($_POST['_mail_pagesize']) ? max(2, intval($_POST['_mail_pagesize'])) : $CONFIG['mail_pagesize'],
);
- break;
+ break;
- case 'mailview':
+case 'mailview':
$a_user_prefs = array(
- 'message_extwin' => intval($_POST['_message_extwin']),
- 'message_show_email' => isset($_POST['_message_show_email']) ? TRUE : FALSE,
- 'prefer_html' => isset($_POST['_prefer_html']) ? TRUE : FALSE,
- 'inline_images' => isset($_POST['_inline_images']) ? TRUE : FALSE,
- 'show_images' => isset($_POST['_show_images']) ? intval($_POST['_show_images']) : 0,
- 'display_next' => isset($_POST['_display_next']) ? TRUE : FALSE,
- 'default_charset' => get_input_value('_default_charset', RCUBE_INPUT_POST),
+ 'message_extwin' => intval($_POST['_message_extwin']),
+ 'message_show_email' => isset($_POST['_message_show_email']) ? true : false,
+ 'prefer_html' => isset($_POST['_prefer_html']) ? true : false,
+ 'inline_images' => isset($_POST['_inline_images']) ? true : false,
+ 'show_images' => isset($_POST['_show_images']) ? intval($_POST['_show_images']) : 0,
+ 'display_next' => isset($_POST['_display_next']) ? true : false,
+ 'default_charset' => rcube_utils::get_input_value('_default_charset', rcube_utils::INPUT_POST),
);
- break;
+ break;
- case 'compose':
+case 'compose':
$a_user_prefs = array(
- 'compose_extwin' => intval($_POST['_compose_extwin']),
- 'htmleditor' => intval($_POST['_htmleditor']),
- 'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0,
- 'mime_param_folding' => isset($_POST['_mime_param_folding']) ? intval($_POST['_mime_param_folding']) : 0,
- 'force_7bit' => isset($_POST['_force_7bit']) ? TRUE : FALSE,
- 'mdn_default' => isset($_POST['_mdn_default']) ? TRUE : FALSE,
- 'dsn_default' => isset($_POST['_dsn_default']) ? TRUE : FALSE,
- 'reply_same_folder' => isset($_POST['_reply_same_folder']) ? TRUE : FALSE,
- 'spellcheck_before_send' => isset($_POST['_spellcheck_before_send']) ? TRUE : FALSE,
- 'spellcheck_ignore_syms' => isset($_POST['_spellcheck_ignore_syms']) ? TRUE : FALSE,
- 'spellcheck_ignore_nums' => isset($_POST['_spellcheck_ignore_nums']) ? TRUE : FALSE,
- 'spellcheck_ignore_caps' => isset($_POST['_spellcheck_ignore_caps']) ? TRUE : FALSE,
- 'show_sig' => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1,
- 'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
- 'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
- 'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST),
- 'default_font_size' => get_input_value('_default_font_size', RCUBE_INPUT_POST),
- 'forward_attachment' => !empty($_POST['_forward_attachment']),
+ 'compose_extwin' => intval($_POST['_compose_extwin']),
+ 'htmleditor' => intval($_POST['_htmleditor']),
+ 'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0,
+ 'mime_param_folding' => isset($_POST['_mime_param_folding']) ? intval($_POST['_mime_param_folding']) : 0,
+ 'force_7bit' => isset($_POST['_force_7bit']) ? true : false,
+ 'mdn_default' => isset($_POST['_mdn_default']) ? true : false,
+ 'dsn_default' => isset($_POST['_dsn_default']) ? true : false,
+ 'reply_same_folder' => isset($_POST['_reply_same_folder']) ? true : false,
+ 'spellcheck_before_send' => isset($_POST['_spellcheck_before_send']) ? true : false,
+ 'spellcheck_ignore_syms' => isset($_POST['_spellcheck_ignore_syms']) ? true : false,
+ 'spellcheck_ignore_nums' => isset($_POST['_spellcheck_ignore_nums']) ? true : false,
+ 'spellcheck_ignore_caps' => isset($_POST['_spellcheck_ignore_caps']) ? true : false,
+ 'show_sig' => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1,
+ 'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
+ 'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
+ 'default_font' => rcube_utils::get_input_value('_default_font', rcube_utils::INPUT_POST),
+ 'default_font_size' => rcube_utils::get_input_value('_default_font_size', rcube_utils::INPUT_POST),
+ 'reply_all_mode' => intval($_POST['_reply_all_mode']),
+ 'forward_attachment' => !empty($_POST['_forward_attachment']),
);
- break;
+ break;
- case 'addressbook':
+case 'addressbook':
$a_user_prefs = array(
- 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true),
- 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE,
- 'addressbook_sort_col' => get_input_value('_addressbook_sort_col', RCUBE_INPUT_POST),
- 'addressbook_name_listing' => intval(get_input_value('_addressbook_name_listing', RCUBE_INPUT_POST)),
- 'addressbook_pagesize' => is_numeric($_POST['_addressbook_pagesize']) ? max(2, intval($_POST['_addressbook_pagesize'])) : $CONFIG['addressbook_pagesize'],
+ 'default_addressbook' => rcube_utils::get_input_value('_default_addressbook', rcube_utils::INPUT_POST, true),
+ 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? true : false,
+ 'addressbook_sort_col' => rcube_utils::get_input_value('_addressbook_sort_col', rcube_utils::INPUT_POST),
+ 'addressbook_name_listing' => intval(rcube_utils::get_input_value('_addressbook_name_listing', rcube_utils::INPUT_POST)),
+ 'addressbook_pagesize' => is_numeric($_POST['_addressbook_pagesize']) ? max(2, intval($_POST['_addressbook_pagesize'])) : $CONFIG['addressbook_pagesize'],
);
- break;
+ break;
- case 'server':
+case 'server':
$a_user_prefs = array(
- 'read_when_deleted' => isset($_POST['_read_when_deleted']) ? TRUE : FALSE,
- 'skip_deleted' => isset($_POST['_skip_deleted']) ? TRUE : FALSE,
- 'flag_for_deletion' => isset($_POST['_flag_for_deletion']) ? TRUE : FALSE,
- 'delete_always' => isset($_POST['_delete_always']) ? TRUE : FALSE,
- 'delete_junk' => isset($_POST['_delete_junk']) ? TRUE : FALSE,
- 'logout_purge' => isset($_POST['_logout_purge']) ? TRUE : FALSE,
- 'logout_expunge' => isset($_POST['_logout_expunge']) ? TRUE : FALSE,
+ 'read_when_deleted' => isset($_POST['_read_when_deleted']) ? true : false,
+ 'skip_deleted' => isset($_POST['_skip_deleted']) ? true : false,
+ 'flag_for_deletion' => isset($_POST['_flag_for_deletion']) ? true : false,
+ 'delete_always' => isset($_POST['_delete_always']) ? true : false,
+ 'delete_junk' => isset($_POST['_delete_junk']) ? true : false,
+ 'logout_purge' => isset($_POST['_logout_purge']) ? true : false,
+ 'logout_expunge' => isset($_POST['_logout_expunge']) ? true : false,
);
- break;
+ break;
- case 'folders':
+case 'folders':
$a_user_prefs = array(
- 'show_real_foldernames' =>
- isset($_POST['_show_real_foldernames']) ? TRUE : FALSE,
- 'drafts_mbox' => get_input_value('_drafts_mbox', RCUBE_INPUT_POST, true),
- 'sent_mbox' => get_input_value('_sent_mbox', RCUBE_INPUT_POST, true),
- 'junk_mbox' => get_input_value('_junk_mbox', RCUBE_INPUT_POST, true),
- 'trash_mbox' => get_input_value('_trash_mbox', RCUBE_INPUT_POST, true),
+ 'show_real_foldernames' => isset($_POST['_show_real_foldernames']) ? true : false,
+ 'drafts_mbox' => rcube_utils::get_input_value('_drafts_mbox', rcube_utils::INPUT_POST, true),
+ 'sent_mbox' => rcube_utils::get_input_value('_sent_mbox', rcube_utils::INPUT_POST, true),
+ 'junk_mbox' => rcube_utils::get_input_value('_junk_mbox', rcube_utils::INPUT_POST, true),
+ 'trash_mbox' => rcube_utils::get_input_value('_trash_mbox', rcube_utils::INPUT_POST, true),
);
- break;
+ break;
}
$plugin = rcmail::get_instance()->plugins->exec_hook('preferences_save',
- array('prefs' => $a_user_prefs, 'section' => $CURR_SECTION));
+ array('prefs' => $a_user_prefs, 'section' => $CURR_SECTION));
$a_user_prefs = $plugin['prefs'];
// don't override these parameters
-foreach ((array)$CONFIG['dont_override'] as $p)
- $a_user_prefs[$p] = $CONFIG[$p];
+foreach ((array)$CONFIG['dont_override'] as $p) {
+ $a_user_prefs[$p] = $CONFIG[$p];
+}
// verify some options
-switch ($CURR_SECTION)
-{
- case 'general':
-
+switch ($CURR_SECTION) {
+case 'general':
// switch UI language
if (isset($_POST['_language']) && $a_user_prefs['language'] != $_SESSION['language']) {
- $RCMAIL->load_language($a_user_prefs['language']);
- $OUTPUT->command('reload', 500);
+ $RCMAIL->load_language($a_user_prefs['language']);
+ $OUTPUT->command('reload', 500);
}
// switch skin (if valid, otherwise unset the pref and fall back to default)
if (!$OUTPUT->set_skin($a_user_prefs['skin']))
- unset($a_user_prefs['skin']);
+ unset($a_user_prefs['skin']);
else if ($RCMAIL->config->get('skin') != $a_user_prefs['skin'])
- $OUTPUT->command('reload', 500);
+ $OUTPUT->command('reload', 500);
$a_user_prefs['timezone'] = (string) $a_user_prefs['timezone'];
if (!empty($a_user_prefs['refresh_interval']) && !empty($CONFIG['min_refresh_interval'])) {
- if ($a_user_prefs['refresh_interval'] < $CONFIG['min_refresh_interval']) {
- $a_user_prefs['refresh_interval'] = $CONFIG['min_refresh_interval'];
- }
+ if ($a_user_prefs['refresh_interval'] < $CONFIG['min_refresh_interval']) {
+ $a_user_prefs['refresh_interval'] = $CONFIG['min_refresh_interval'];
+ }
}
break;
- case 'mailbox':
-
+case 'mailbox':
// force min size
- if ($a_user_prefs['mail_pagesize'] < 1)
- $a_user_prefs['mail_pagesize'] = 10;
+ if ($a_user_prefs['mail_pagesize'] < 1) {
+ $a_user_prefs['mail_pagesize'] = 10;
+ }
- if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['mail_pagesize'] > $CONFIG['max_pagesize']))
- $a_user_prefs['mail_pagesize'] = (int) $CONFIG['max_pagesize'];
+ if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['mail_pagesize'] > $CONFIG['max_pagesize'])) {
+ $a_user_prefs['mail_pagesize'] = (int) $CONFIG['max_pagesize'];
+ }
break;
- case 'addressbook':
-
+case 'addressbook':
// force min size
- if ($a_user_prefs['addressbook_pagesize'] < 1)
- $a_user_prefs['addressbook_pagesize'] = 10;
+ if ($a_user_prefs['addressbook_pagesize'] < 1) {
+ $a_user_prefs['addressbook_pagesize'] = 10;
+ }
- if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['addressbook_pagesize'] > $CONFIG['max_pagesize']))
- $a_user_prefs['addressbook_pagesize'] = (int) $CONFIG['max_pagesize'];
+ if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['addressbook_pagesize'] > $CONFIG['max_pagesize'])) {
+ $a_user_prefs['addressbook_pagesize'] = (int) $CONFIG['max_pagesize'];
+ }
break;
- case 'folders':
-
+case 'folders':
// special handling for 'default_folders'
if (in_array('default_folders', (array)$CONFIG['dont_override'])) {
- foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p)
- $a_user_prefs[$p] = $CONFIG[$p];
- } else {
- $a_user_prefs['default_folders'] = array('INBOX');
- foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) {
- if ($a_user_prefs[$p])
- $a_user_prefs['default_folders'][] = $a_user_prefs[$p];
- }
+ foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) {
+ $a_user_prefs[$p] = $CONFIG[$p];
+ }
+ }
+ else {
+ $a_user_prefs['default_folders'] = array('INBOX');
+ foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) {
+ if ($a_user_prefs[$p]) {
+ $a_user_prefs['default_folders'][] = $a_user_prefs[$p];
+ }
+ }
}
break;
@@ -210,15 +211,14 @@ switch ($CURR_SECTION)
// Save preferences
if (!$plugin['abort'])
- $saved = $RCMAIL->user->save_prefs($a_user_prefs);
+ $saved = $RCMAIL->user->save_prefs($a_user_prefs);
else
- $saved = $plugin['result'];
+ $saved = $plugin['result'];
if ($saved)
- $OUTPUT->show_message('successfullysaved', 'confirmation');
+ $OUTPUT->show_message('successfullysaved', 'confirmation');
else
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
// display the form again
-rcmail_overwrite_action('edit-prefs');
-
+$RCMAIL->overwrite_action('edit-prefs');
diff --git a/program/steps/utils/error.inc b/program/steps/utils/error.inc
index 9fb71c528..2a3a9a61e 100644
--- a/program/steps/utils/error.inc
+++ b/program/steps/utils/error.inc
@@ -5,7 +5,7 @@
| program/steps/utils/error.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2012, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -22,10 +22,10 @@
$rcmail = rcmail::get_instance();
// browser is not compatible with this application
-if ($ERROR_CODE==409) {
- $user_agent = htmlentities($_SERVER['HTTP_USER_AGENT']);
- $__error_title = 'Your browser does not suit the requirements for this application';
- $__error_text = <<<EOF
+if ($ERROR_CODE == 409) {
+ $user_agent = htmlentities($_SERVER['HTTP_USER_AGENT']);
+ $__error_title = 'Your browser does not suit the requirements for this application';
+ $__error_text = <<<EOF
<i>Supported browsers:</i><br />
&raquo; &nbsp;Microsoft Internet Explorer 7+<br />
&raquo; &nbsp;Mozilla Firefox 3+<br />
@@ -42,24 +42,24 @@ EOF;
}
// authorization error
-else if ($ERROR_CODE==401) {
- $__error_title = "AUTHORIZATION FAILED";
- $__error_text = "Could not verify that you are authorized to access this service!<br />\n".
- "Please contact your server-administrator.";
+else if ($ERROR_CODE == 401) {
+ $__error_title = "AUTHORIZATION FAILED";
+ $__error_text = "Could not verify that you are authorized to access this service!<br />\n"
+ . "Please contact your server-administrator.";
}
// forbidden due to request check
-else if ($ERROR_CODE==403) {
- $__error_title = "REQUEST CHECK FAILED";
- $__error_text = "Access to this service was denied due to failing security checks!<br />\n".
- "Please contact your server-administrator.";
+else if ($ERROR_CODE == 403) {
+ $__error_title = "REQUEST CHECK FAILED";
+ $__error_text = "Access to this service was denied due to failing security checks!<br />\n"
+ . "Please contact your server-administrator.";
}
// failed request (wrong step in URL)
-else if ($ERROR_CODE==404) {
- $__error_title = "REQUEST FAILED/FILE NOT FOUND";
- $request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
- $__error_text = <<<EOF
+else if ($ERROR_CODE == 404) {
+ $request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
+ $__error_title = "REQUEST FAILED/FILE NOT FOUND";
+ $__error_text = <<<EOF
The requested page was not found!<br />
Please contact your server-administrator.
@@ -69,35 +69,36 @@ EOF;
}
// database connection error
-else if ($ERROR_CODE==601)
-{
- $__error_title = "CONFIGURATION ERROR";
- $__error_text = nl2br($ERROR_MESSAGE) . "<br />Please read the INSTALL instructions!";
+else if ($ERROR_CODE == 601) {
+ $__error_title = "CONFIGURATION ERROR";
+ $__error_text = nl2br($ERROR_MESSAGE) . "<br />Please read the INSTALL instructions!";
}
// database connection error
-else if ($ERROR_CODE==603) {
- $__error_title = "DATABASE ERROR: CONNECTION FAILED!";
- $__error_text = "Unable to connect to the database!<br />Please contact your server-administrator.";
+else if ($ERROR_CODE == 603) {
+ $__error_title = "DATABASE ERROR: CONNECTION FAILED!";
+ $__error_text = "Unable to connect to the database!<br />Please contact your server-administrator.";
}
// system error
else {
- $__error_title = "SERVICE CURRENTLY NOT AVAILABLE!";
- $__error_text = "Please contact your server-administrator.";
-
- if (($rcmail->config->get('debug_level') & 4) && $ERROR_MESSAGE)
- $__error_text = $ERROR_MESSAGE;
- else
- $__error_text = sprintf('Error No. [%s]', $ERROR_CODE);
+ $__error_title = "SERVICE CURRENTLY NOT AVAILABLE!";
+ $__error_text = "Please contact your server-administrator.";
+
+ if (($rcmail->config->get('debug_level') & 4) && $ERROR_MESSAGE) {
+ $__error_text = $ERROR_MESSAGE;
+ }
+ else {
+ $__error_text = sprintf('Error No. [%s]', $ERROR_CODE);
+ }
}
$HTTP_ERR_CODE = $ERROR_CODE && $ERROR_CODE < 600 ? $ERROR_CODE : 500;
// Ajax request
if ($rcmail->output && $rcmail->output->type == 'js') {
- header("HTTP/1.0 $HTTP_ERR_CODE $__error_title");
- die;
+ header("HTTP/1.0 $HTTP_ERR_CODE $__error_title");
+ die;
}
// compose page content
@@ -109,8 +110,9 @@ $__page_content = <<<EOF
EOF;
if ($rcmail->output && $rcmail->output->template_exists('error')) {
- $rcmail->output->reset();
- $rcmail->output->send('error');
+ $rcmail->output->reset();
+ $rcmail->output->set_env('server_error', $ERROR_CODE);
+ $rcmail->output->send('error');
}
$__skin = $rcmail->config->get('skin', 'default');
@@ -136,4 +138,3 @@ $__page_content
EOF;
exit;
-
diff --git a/program/steps/utils/html2text.inc b/program/steps/utils/html2text.inc
index c6481b197..c01443b22 100644
--- a/program/steps/utils/html2text.inc
+++ b/program/steps/utils/html2text.inc
@@ -22,7 +22,7 @@
$html = $HTTP_RAW_POST_DATA;
// Replace emoticon images with its text representation
-$html = rcmail_replace_emoticons($html);
+$html = $RCMAIL->replace_emoticons($html);
$converter = new rcube_html2text($html, false, true, 0);
diff --git a/program/steps/utils/modcss.inc b/program/steps/utils/modcss.inc
index 1a28c6598..c8a7cb524 100644
--- a/program/steps/utils/modcss.inc
+++ b/program/steps/utils/modcss.inc
@@ -55,7 +55,7 @@ $ctype = '~Content-Type:\s+text/(css|plain)~i';
if ($source !== false && preg_match($ctype, $headers)) {
header('Content-Type: text/css');
- echo rcmail_mod_css_styles($source, preg_replace('/[^a-z0-9]/i', '', $_GET['_c']));
+ echo rcube_utils::mod_css_styles($source, preg_replace('/[^a-z0-9]/i', '', $_GET['_c']));
exit;
}
diff --git a/program/steps/utils/save_pref.inc b/program/steps/utils/save_pref.inc
index 7def8733d..183c398d3 100644
--- a/program/steps/utils/save_pref.inc
+++ b/program/steps/utils/save_pref.inc
@@ -5,7 +5,7 @@
| program/steps/utils/save_pref.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2010, The Roundcube Dev Team |
+ | Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@@ -19,17 +19,27 @@
+-----------------------------------------------------------------------+
*/
-$name = get_input_value('_name', RCUBE_INPUT_POST);
-$value = get_input_value('_value', RCUBE_INPUT_POST);
+$name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST);
+$value = rcube_utils::get_input_value('_value', rcube_utils::INPUT_POST);
+$sessname = rcube_utils::get_input_value('_session', rcube_utils::INPUT_POST);
+
+// Whitelisted preferences and session variables, others
+// can be added by plugins
$whitelist = array(
'preview_pane',
'list_cols',
'collapsed_folders',
'collapsed_abooks',
);
+$whitelist_sess = array(
+ 'list_attrib/columns',
+);
+
+$whitelist = array_merge($whitelist, $RCMAIL->plugins->allowed_prefs);
+$whitelist_sess = array_merge($whitelist_sess, $RCMAIL->plugins->allowed_session_prefs);
-if (!in_array($name, array_merge($whitelist, $RCMAIL->plugins->allowed_prefs))) {
- raise_error(array('code' => 500, 'type' => 'php',
+if (!in_array($name, $whitelist) || ($sessname && !in_array($sessname, $whitelist_sess))) {
+ rcube::raise_error(array('code' => 500, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => sprintf("Hack attempt detected (user: %s)", $RCMAIL->get_user_name())),
true, false);
@@ -42,7 +52,7 @@ if (!in_array($name, array_merge($whitelist, $RCMAIL->plugins->allowed_prefs)))
$RCMAIL->user->save_prefs(array($name => $value));
// update also session if requested
-if ($sessname = get_input_value('_session', RCUBE_INPUT_POST)) {
+if ($sessname) {
// Support multidimensional arrays...
$vars = explode('/', $sessname);
@@ -57,5 +67,3 @@ if ($sessname = get_input_value('_session', RCUBE_INPUT_POST)) {
$OUTPUT->reset();
$OUTPUT->send();
-
-
diff --git a/program/steps/utils/spell.inc b/program/steps/utils/spell.inc
index 1c68e8328..c8807e32f 100644
--- a/program/steps/utils/spell.inc
+++ b/program/steps/utils/spell.inc
@@ -20,7 +20,7 @@
*/
// read input
-$lang = get_input_value('lang', RCUBE_INPUT_GET);
+$lang = rcube_utils::get_input_value('lang', rcube_utils::INPUT_GET);
$data = file_get_contents('php://input');
$learn_word = strpos($data, '<learnword>');
@@ -29,13 +29,13 @@ $learn_word = strpos($data, '<learnword>');
$left = strpos($data, '<text>');
$right = strrpos($data, '</text>');
$data = substr($data, $left+6, $right-($left+6));
-$data = html_entity_decode($data, ENT_QUOTES, RCMAIL_CHARSET);
+$data = html_entity_decode($data, ENT_QUOTES, RCUBE_CHARSET);
$spellchecker = new rcube_spellchecker($lang);
if ($learn_word) {
$spellchecker->add_word($data);
- $result = '<?xml version="1.0" encoding="'.RCMAIL_CHARSET.'"?><learnwordresult></learnwordresult>';
+ $result = '<?xml version="1.0" encoding="'.RCUBE_CHARSET.'"?><learnwordresult></learnwordresult>';
}
else {
$spellchecker->check($data);
@@ -47,12 +47,15 @@ if ($err = $spellchecker->error()) {
'file' => __FILE__, 'line' => __LINE__,
'message' => "Spell check engine error: " . trim($err)),
true, false);
+
+ header("HTTP/1.0 500 Internal Server Error");
+ exit;
}
// set response length
header("Content-Length: " . strlen($result));
// Don't use server's default Content-Type charset (#1486406)
-header("Content-Type: text/xml; charset=" . RCMAIL_CHARSET);
+header("Content-Type: text/xml; charset=" . RCUBE_CHARSET);
print $result;
exit;
diff --git a/program/steps/utils/spell_html.inc b/program/steps/utils/spell_html.inc
index 96b41e230..27b14acef 100644
--- a/program/steps/utils/spell_html.inc
+++ b/program/steps/utils/spell_html.inc
@@ -56,7 +56,7 @@ if ($error = $spellchecker->error()) {
}
// send output
-header("Content-Type: text/xml; charset=".RCMAIL_CHARSET);
+header("Content-Type: text/xml; charset=".RCUBE_CHARSET);
echo json_encode($result);
exit;