summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.htaccess26
-rw-r--r--CHANGELOG9
-rwxr-xr-xbin/cleandb.sh2
-rwxr-xr-xbin/cssshrink.sh62
-rwxr-xr-xbin/jsshrink.sh36
-rwxr-xr-xbin/jsunshrink.sh14
-rw-r--r--plugins/archive/archive.js2
-rw-r--r--plugins/archive/archive.php2
-rw-r--r--plugins/archive/skins/classic/archive.css2
-rw-r--r--plugins/help/help.js2
-rw-r--r--plugins/managesieve/Changelog2
-rw-r--r--plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php16
-rw-r--r--plugins/managesieve/managesieve.js28
-rw-r--r--plugins/managesieve/managesieve.php1
-rw-r--r--plugins/password/password.js16
-rw-r--r--plugins/vcard_attachments/vcardattach.js3
-rw-r--r--program/include/rcmail.php29
-rw-r--r--program/include/rcmail_output_html.php39
-rw-r--r--program/js/app.js163
-rw-r--r--program/js/list.js146
-rw-r--r--program/lib/Roundcube/rcube_addressbook.php3
-rw-r--r--program/lib/Roundcube/rcube_contacts.php9
-rw-r--r--program/lib/Roundcube/rcube_imap.php37
-rw-r--r--program/lib/Roundcube/rcube_ldap.php3
-rw-r--r--program/lib/Roundcube/rcube_storage.php12
-rw-r--r--program/lib/Roundcube/rcube_utils.php31
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/localization/sk_SK/csv2vcard.inc93
-rw-r--r--program/steps/addressbook/copy.inc4
-rw-r--r--program/steps/addressbook/delete.inc9
-rw-r--r--program/steps/addressbook/edit.inc24
-rw-r--r--program/steps/addressbook/export.inc2
-rw-r--r--program/steps/addressbook/func.inc160
-rw-r--r--program/steps/addressbook/groups.inc16
-rw-r--r--program/steps/addressbook/import.inc43
-rw-r--r--program/steps/addressbook/mailto.inc4
-rw-r--r--program/steps/addressbook/move.inc4
-rw-r--r--program/steps/addressbook/photo.inc8
-rw-r--r--program/steps/addressbook/save.inc34
-rw-r--r--program/steps/addressbook/search.inc34
-rw-r--r--program/steps/addressbook/show.inc26
-rw-r--r--program/steps/addressbook/upload_photo.inc16
-rw-r--r--program/steps/mail/addcontact.inc8
-rw-r--r--program/steps/mail/attachments.inc29
-rw-r--r--program/steps/mail/autocomplete.inc14
-rw-r--r--program/steps/mail/check_recent.inc22
-rw-r--r--program/steps/mail/compose.inc164
-rw-r--r--program/steps/mail/copy.inc10
-rw-r--r--program/steps/mail/folders.inc10
-rw-r--r--program/steps/mail/func.inc224
-rw-r--r--program/steps/mail/get.inc52
-rw-r--r--program/steps/mail/headers.inc2
-rw-r--r--program/steps/mail/import.inc11
-rw-r--r--program/steps/mail/list.inc19
-rw-r--r--program/steps/mail/list_contacts.inc20
-rw-r--r--program/steps/mail/mark.inc12
-rw-r--r--program/steps/mail/move_del.inc22
-rw-r--r--program/steps/mail/pagenav.inc4
-rw-r--r--program/steps/mail/search.inc19
-rw-r--r--program/steps/mail/search_contacts.inc8
-rw-r--r--program/steps/mail/sendmail.inc81
-rw-r--r--program/steps/mail/sendmdn.inc2
-rw-r--r--program/steps/mail/show.inc28
-rw-r--r--program/steps/mail/viewsource.inc4
-rw-r--r--program/steps/settings/about.inc24
-rw-r--r--program/steps/settings/delete_identity.inc10
-rw-r--r--program/steps/settings/edit_folder.inc86
-rw-r--r--program/steps/settings/edit_identity.inc30
-rw-r--r--program/steps/settings/edit_prefs.inc4
-rw-r--r--program/steps/settings/edit_response.inc14
-rw-r--r--program/steps/settings/folders.inc63
-rw-r--r--program/steps/settings/func.inc278
-rw-r--r--program/steps/settings/identities.inc2
-rw-r--r--program/steps/settings/responses.inc16
-rw-r--r--program/steps/settings/save_folder.inc28
-rw-r--r--program/steps/settings/save_identity.inc38
-rw-r--r--program/steps/settings/save_prefs.inc35
-rw-r--r--program/steps/utils/html2text.inc2
-rw-r--r--program/steps/utils/modcss.inc2
-rw-r--r--program/steps/utils/save_pref.inc8
-rw-r--r--program/steps/utils/spell.inc8
-rw-r--r--program/steps/utils/spell_html.inc2
-rw-r--r--skins/classic/common.css51
-rw-r--r--skins/classic/functions.js1
-rw-r--r--skins/classic/includes/messagetoolbar.html5
-rw-r--r--skins/classic/mail.css74
-rw-r--r--skins/classic/templates/message.html4
-rw-r--r--skins/larry/images/listicons.pngbin26546 -> 37369 bytes
-rw-r--r--skins/larry/includes/mailtoolbar.html2
-rw-r--r--skins/larry/mail.css6
-rw-r--r--skins/larry/styles.css33
-rw-r--r--skins/larry/templates/message.html4
-rw-r--r--skins/larry/ui.js5
93 files changed, 1669 insertions, 1104 deletions
diff --git a/.htaccess b/.htaccess
index 43ab5b04f..0342e0878 100644
--- a/.htaccess
+++ b/.htaccess
@@ -27,26 +27,16 @@ php_value session.gc_probability 1
RewriteEngine On
RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico
-# security rules
-RewriteRule ^/?(\.git|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
-RewriteRule /?(README(.md)?|composer\.json-dist|composer\.json|package\.xml)$ - [F]
+# security rules:
+# - deny access to files not containing a dot or starting with a dot
+# in all locations except installer directory
+RewriteRule ^(?!installer)(\.?[^\.]+)$ - [F]
+# - deny access to some locations
+RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
+# - deny access to some documentation files
+RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml)$ - [F]
</IfModule>
-# deny access to all files not containing a "." (dot)
-# to block access to different README, Changelog, INSTALL, etc.
-# files of various skins and plugins.
-<FilesMatch "^[^\.]+$">
- # Apache 2.4
- <IfModule mod_authz_core.c>
- Require all denied
- </IfModule>
- # Apache 2.2
- <IfModule !mod_authz_core.c>
- Order Allow,Deny
- Deny from all
- </IfModule>
-</FilesMatch>
-
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
diff --git a/CHANGELOG b/CHANGELOG
index 3f1bcf39d..ff09b2f62 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,15 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix so message flags modified by another client are applied on the list on refresh (#1485186)
+- Fix broken text/* attachments when forwarding/editing a message (#1489426)
+- Improved minified files handling, added css minification (#1486988)
+- Fix handling of X-Forwarded-For header with multiple addresses (#1489481)
+- Fix border issue on folders list in classic skin (#1489473)
+- Implemented menu actions to copy/move messages, added folder-selector widget (#1484086)
+- Fix security rules in .htaccess preventing access to base URL without the ending slash (#1489477)
+- Fix regression where only first new folder was placed in correct place on the list (#1489472)
+- Fix issue where children of selected and collapsed thread were skipped on various actions (#1489457)
- Fix issue where groups were not deleted when "Replace entire addressbook" option on contacts import was used (#1489420)
- Fix unreliable mimetype tests in Installer (#1489453)
- Fix performance of listing writeable folders (#1489451)
diff --git a/bin/cleandb.sh b/bin/cleandb.sh
index ea905c873..3a3c2572e 100755
--- a/bin/cleandb.sh
+++ b/bin/cleandb.sh
@@ -48,7 +48,7 @@ $threshold = date('Y-m-d 00:00:00', time() - $days * 86400);
foreach (array('contacts','contactgroups','identities') as $table) {
- $sqltable = get_table_name($table);
+ $sqltable = $db->table_name($table);
// also delete linked records
// could be skipped for databases which respect foreign key constraints
diff --git a/bin/cssshrink.sh b/bin/cssshrink.sh
new file mode 100755
index 000000000..604a0467c
--- /dev/null
+++ b/bin/cssshrink.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+PWD=`dirname "$0"`
+JAR_DIR='/tmp'
+VERSION='2.4.8'
+COMPILER_URL="https://github.com/yui/yuicompressor/releases/download/v${VERSION}/yuicompressor-${VERSION}.zip"
+
+do_shrink() {
+ rm -f "$2"
+ java -jar $JAR_DIR/yuicompressor.jar -v -o "$2" "$1"
+}
+
+if [ ! -w "$JAR_DIR" ]; then
+ JAR_DIR=$PWD
+fi
+
+if java -version >/dev/null 2>&1; then
+ :
+else
+ echo "Java not found. Please ensure that the 'java' program is in your PATH."
+ exit 1
+fi
+
+if [ ! -r "$JAR_DIR/yuicompressor.jar" ]; then
+ if which wget >/dev/null 2>&1 && which unzip >/dev/null 2>&1; then
+ wget "$COMPILER_URL" -O "/tmp/$$.zip"
+ elif which curl >/dev/null 2>&1 && which unzip >/dev/null 2>&1; then
+ curl "$COMPILER_URL" -o "/tmp/$$.zip"
+ else
+ echo "Please download $COMPILER_URL and extract compiler.jar to $JAR_DIR/."
+ exit 1
+ fi
+ (cd $JAR_DIR && unzip "/tmp/$$.zip" && mv "yuicompressor-${VERSION}.jar" "yuicompressor.jar")
+ rm -f "/tmp/$$.zip"
+fi
+
+# compress single file from argument
+if [ $# -gt 0 ]; then
+ CSS_FILE="$1"
+
+ echo "Shrinking $CSS_FILE"
+ minfile=`echo $CSS_FILE | sed -e 's/\.css$/\.min\.css/'`
+ do_shrink "$CSS_FILE" "$minfile"
+ exit
+fi
+
+DIRS="$PWD/../skins/* $PWD/../plugins/* $PWD/../plugins/*/skins/*"
+# default: compress application scripts
+for dir in $DIRS; do
+ for file in $dir/*.css; do
+ echo "$file" | grep -e '.min.css$' >/dev/null
+ if [ $? -eq 0 ]; then
+ continue
+ fi
+ if [ ! -f "$file" ]; then
+ continue
+ fi
+
+ echo "Shrinking $file"
+ minfile=`echo $file | sed -e 's/\.css$/\.min\.css/'`
+ do_shrink "$file" "$minfile"
+ done
+done
diff --git a/bin/jsshrink.sh b/bin/jsshrink.sh
index b13d7b2c7..f7c7b22e9 100755
--- a/bin/jsshrink.sh
+++ b/bin/jsshrink.sh
@@ -1,7 +1,10 @@
#!/bin/sh
-JS_DIR=`dirname "$0"`/../program/js
+PWD=`dirname "$0"`
+JS_DIR="$PWD/../program/js"
JAR_DIR='/tmp'
LANG_IN='ECMASCRIPT3'
+# latest version requires Java 7, we'll use an older one
+#CLOSURE_COMPILER_URL='http://dl.google.com/closure-compiler/compiler-latest.zip'
CLOSURE_COMPILER_URL='http://dl.google.com/closure-compiler/compiler-20131014.zip'
do_shrink() {
@@ -15,7 +18,7 @@ if [ ! -d "$JS_DIR" ]; then
fi
if [ ! -w "$JAR_DIR" ]; then
- JAR_DIR=`dirname "$0"`
+ JAR_DIR=$PWD
fi
if java -version >/dev/null 2>&1; then
@@ -47,21 +50,26 @@ if [ $# -gt 0 ]; then
LANG_IN="$2"
fi
- if [ ! -r "${JS_FILE}.src" ]; then
- mv "$JS_FILE" "${JS_FILE}.src"
- fi
echo "Shrinking $JS_FILE"
- do_shrink "${JS_FILE}.src" "$JS_FILE" "$LANG_IN"
+ minfile=`echo $JS_FILE | sed -e 's/\.js$/\.min\.js/'`
+ do_shrink "$JS_FILE" "$minfile" "$LANG_IN"
exit
fi
+DIRS="$PWD/../program/js $PWD/../skins/* $PWD/../plugins/* $PWD/../plugins/*/skins/*"
# default: compress application scripts
-for fn in app common googiespell list treelist; do
- if [ -r "$JS_DIR/${fn}.js.src" ]; then
- echo "$JS_DIR/${fn}.js.src already exists, not overwriting"
- else
- mv "$JS_DIR/${fn}.js" "$JS_DIR/${fn}.js.src"
- fi
- echo "Shrinking $JS_DIR/${fn}.js"
- do_shrink "$JS_DIR/${fn}.js.src" "$JS_DIR/${fn}.js" "$LANG_IN"
+for dir in $DIRS; do
+ for file in $dir/*.js; do
+ echo "$file" | grep -e '.min.js$' >/dev/null
+ if [ $? -eq 0 ]; then
+ continue
+ fi
+ if [ ! -f "$file" ]; then
+ continue
+ fi
+
+ echo "Shrinking $file"
+ minfile=`echo $file | sed -e 's/\.js$/\.min\.js/'`
+ do_shrink "$file" "$minfile" "$LANG_IN"
+ done
done
diff --git a/bin/jsunshrink.sh b/bin/jsunshrink.sh
deleted file mode 100755
index ef1bb47a1..000000000
--- a/bin/jsunshrink.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-JS_DIR=`dirname "$0"`/../program/js
-
-if [ ! -d "$JS_DIR" ]; then
- echo "Directory $JS_DIR not found."
- exit 1
-fi
-
-for fn in app common googiespell list treelist; do
- if [ -r "$JS_DIR/${fn}.js.src" ]; then
- mv "$JS_DIR/${fn}.js.src" "$JS_DIR/${fn}.js"
- echo "Reverted $JS_DIR/${fn}.js"
- fi
-done
diff --git a/plugins/archive/archive.js b/plugins/archive/archive.js
index 6ed4f971a..813033401 100644
--- a/plugins/archive/archive.js
+++ b/plugins/archive/archive.js
@@ -1,4 +1,4 @@
-/*
+/**
* Archive plugin script
* @version 2.1
*/
diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php
index 4a00d5f58..a0fd2efa9 100644
--- a/plugins/archive/archive.php
+++ b/plugins/archive/archive.php
@@ -268,7 +268,7 @@ class archive extends rcube_plugin
$archive_type->add($this->gettext('archivetypefolder'), 'folder');
$args['blocks']['archive'] = array(
- 'name' => Q(rcube_label('settingstitle', 'archive')),
+ 'name' => Q($this->gettext('settingstitle')),
'options' => array('archive_type' => array(
'title' => $this->gettext('archivetype'),
'content' => $archive_type->show($rcmail->config->get('archive_type'))
diff --git a/plugins/archive/skins/classic/archive.css b/plugins/archive/skins/classic/archive.css
index 3880fe3da..fc5984b39 100644
--- a/plugins/archive/skins/classic/archive.css
+++ b/plugins/archive/skins/classic/archive.css
@@ -4,7 +4,7 @@
background: url(archive_act.png) 0 0 no-repeat;
}
-#mailboxlist li.mailbox.archive {
+#mailboxlist li.mailbox.archive > a {
background-image: url(foldericon.png);
background-position: 5px 1px;
}
diff --git a/plugins/help/help.js b/plugins/help/help.js
index 59a93c537..03edb7ab2 100644
--- a/plugins/help/help.js
+++ b/plugins/help/help.js
@@ -1,4 +1,4 @@
-/*
+/**
* Help plugin client script
* @version 1.4
*/
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index b7b9ecf68..a5a231b9a 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,3 +1,5 @@
+- Nicely handle server-side modification of script names (#1489412)
+
* version 7.1 [2013-11-22]
-----------------------------------------------------------
- lib/Net Sieve.php moved to Roundcube /lib directory
diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
index e0f6ead9a..4a375d353 100644
--- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
+++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
@@ -132,6 +132,11 @@ class rcube_sieve_engine
// Get list of scripts
$list = $this->list_scripts();
+ // reset current script when entering filters UI (#1489412)
+ if ($this->rc->action == 'plugin.managesieve') {
+ $this->rc->session->remove('managesieve_current');
+ }
+
if (!empty($_GET['_set']) || !empty($_POST['_set'])) {
$script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true);
}
@@ -179,15 +184,20 @@ class rcube_sieve_engine
case SIEVE_ERROR_CONNECTION:
case SIEVE_ERROR_LOGIN:
$this->rc->output->show_message('managesieve.filterconnerror', 'error');
+ rcube::raise_error(array('code' => 403, 'type' => 'php',
+ 'file' => __FILE__, 'line' => __LINE__,
+ 'message' => "Unable to connect to managesieve on $host:$port"), true, false);
break;
+
default:
$this->rc->output->show_message('managesieve.filterunknownerror', 'error');
break;
}
- rcube::raise_error(array('code' => 403, 'type' => 'php',
- 'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Unable to connect to managesieve on $host:$port"), true, false);
+ // reload interface in case of possible error when specified script wasn't found (#1489412)
+ if ($script_name !== null && !empty($list) && !in_array($script_name, $list)) {
+ $this->rc->output->command('reload', 500);
+ }
// to disable 'Add filter' button set env variable
$this->rc->output->set_env('filterconnerror', true);
diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js
index 22a50ba4d..4e810b1ae 100644
--- a/plugins/managesieve/managesieve.js
+++ b/plugins/managesieve/managesieve.js
@@ -21,7 +21,7 @@ if (window.rcmail) {
rcmail.add_element(tab, 'tabs');
}
- if (rcmail.env.task == 'mail' || rcmail.env.action.indexOf('plugin.managesieve') != -1) {
+ if (rcmail.env.task == 'mail' || rcmail.env.action.startsWith('plugin.managesieve')) {
// Create layer for form tips
if (!rcmail.env.framed) {
rcmail.env.ms_tip_layer = $('<div id="managesieve-tip" class="popupmenu"></div>');
@@ -40,7 +40,7 @@ if (window.rcmail) {
rcmail.register_command('plugin.managesieve-setact', function() { rcmail.managesieve_setact() });
rcmail.register_command('plugin.managesieve-setget', function() { rcmail.managesieve_setget() });
- if (rcmail.env.action == 'plugin.managesieve' || rcmail.env.action == 'plugin.managesieve-save') {
+ if (rcmail.env.action.startsWith('plugin.managesieve')) {
if (rcmail.gui_objects.sieveform) {
rcmail.enable_command('plugin.managesieve-save', true);
@@ -122,7 +122,7 @@ rcube_webmail.prototype.managesieve_del = function()
var id = this.filters_list.get_single_selection();
if (confirm(this.get_label('managesieve.filterdeleteconfirm'))) {
var lock = this.set_busy(true, 'loading');
- this.http_post('plugin.managesieve',
+ this.http_post('plugin.managesieve-action',
'_act=delete&_fid='+this.filters_list.rows[id].uid, lock);
}
};
@@ -132,7 +132,7 @@ rcube_webmail.prototype.managesieve_act = function()
var id = this.filters_list.get_single_selection(),
lock = this.set_busy(true, 'loading');
- this.http_post('plugin.managesieve',
+ this.http_post('plugin.managesieve-action',
'_act=act&_fid='+this.filters_list.rows[id].uid, lock);
};
@@ -150,7 +150,7 @@ rcube_webmail.prototype.managesieve_setselect = function(list)
this.show_contentframe(false);
this.filters_list.clear(true);
this.enable_command('plugin.managesieve-setdel', list.rowcount > 1);
- this.enable_command( 'plugin.managesieve-setact', 'plugin.managesieve-setget', true);
+ this.enable_command('plugin.managesieve-setact', 'plugin.managesieve-setget', true);
var id = list.get_single_selection();
if (id != null)
@@ -179,7 +179,7 @@ rcube_webmail.prototype.managesieve_list = function(script)
{
var lock = this.set_busy(true, 'loading');
- this.http_post('plugin.managesieve', '_act=list&_set='+urlencode(script), lock);
+ this.http_post('plugin.managesieve-action', '_act=list&_set='+urlencode(script), lock);
};
// Script download request
@@ -188,7 +188,7 @@ rcube_webmail.prototype.managesieve_setget = function()
var id = this.filtersets_list.get_single_selection(),
script = this.env.filtersets[id];
- location.href = this.env.comm_path+'&_action=plugin.managesieve&_act=setget&_set='+urlencode(script);
+ location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_act=setget&_set='+urlencode(script);
};
// Set activate/deactivate request
@@ -199,7 +199,7 @@ rcube_webmail.prototype.managesieve_setact = function()
script = this.env.filtersets[id],
action = $('#rcmrow'+id).hasClass('disabled') ? 'setact' : 'deact';
- this.http_post('plugin.managesieve', '_act='+action+'&_set='+urlencode(script), lock);
+ this.http_post('plugin.managesieve-action', '_act='+action+'&_set='+urlencode(script), lock);
};
// Set delete request
@@ -212,7 +212,7 @@ rcube_webmail.prototype.managesieve_setdel = function()
lock = this.set_busy(true, 'loading'),
script = this.env.filtersets[id];
- this.http_post('plugin.managesieve', '_act=setdel&_set='+urlencode(script), lock);
+ this.http_post('plugin.managesieve-action', '_act=setdel&_set='+urlencode(script), lock);
};
// Set add request
@@ -224,7 +224,7 @@ rcube_webmail.prototype.managesieve_setadd = function()
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
var lock = this.set_busy(true, 'loading');
target = window.frames[this.env.contentframe];
- target.location.href = this.env.comm_path+'&_action=plugin.managesieve&_framed=1&_newset=1&_unlock='+lock;
+ target.location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_framed=1&_newset=1&_unlock='+lock;
}
};
@@ -384,7 +384,7 @@ rcube_webmail.prototype.load_managesieveframe = function(id)
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
target = window.frames[this.env.contentframe];
var msgid = this.set_busy(true, 'loading');
- target.location.href = this.env.comm_path+'&_action=plugin.managesieve&_framed=1'
+ target.location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_framed=1'
+(has_id ? '&_fid='+id : '')+'&_unlock='+msgid;
}
};
@@ -405,7 +405,7 @@ rcube_webmail.prototype.managesieve_dragend = function(e)
var lock = this.set_busy(true, 'loading');
this.show_contentframe(false);
- this.http_post('plugin.managesieve', '_act=move&_fid='+this.drag_filter
+ this.http_post('plugin.managesieve-action', '_act=move&_fid='+this.drag_filter
+'&_to='+this.drag_filter_target, lock);
}
this.drag_active = false;
@@ -458,7 +458,7 @@ rcube_webmail.prototype.managesieve_save = function()
// Operations on filters form
rcube_webmail.prototype.managesieve_ruleadd = function(id)
{
- this.http_post('plugin.managesieve', '_act=ruleadd&_rid='+id);
+ this.http_post('plugin.managesieve-action', '_act=ruleadd&_rid='+id);
};
rcube_webmail.prototype.managesieve_rulefill = function(content, id, after)
@@ -497,7 +497,7 @@ rcube_webmail.prototype.managesieve_ruledel = function(id)
rcube_webmail.prototype.managesieve_actionadd = function(id)
{
- this.http_post('plugin.managesieve', '_act=actionadd&_aid='+id);
+ this.http_post('plugin.managesieve-action', '_act=actionadd&_aid='+id);
};
rcube_webmail.prototype.managesieve_actionfill = function(content, id, after)
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php
index 6970193c2..46c4e2e5b 100644
--- a/plugins/managesieve/managesieve.php
+++ b/plugins/managesieve/managesieve.php
@@ -41,6 +41,7 @@ class managesieve extends rcube_plugin
// register actions
$this->register_action('plugin.managesieve', array($this, 'managesieve_actions'));
+ $this->register_action('plugin.managesieve-action', array($this, 'managesieve_actions'));
$this->register_action('plugin.managesieve-save', array($this, 'managesieve_save'));
if ($this->rc->task == 'settings') {
diff --git a/plugins/password/password.js b/plugins/password/password.js
index 12c9074ff..1bfb2a0d3 100644
--- a/plugins/password/password.js
+++ b/plugins/password/password.js
@@ -1,4 +1,4 @@
-/*
+/**
* Password plugin script
* @version @package_version@
*/
@@ -8,17 +8,17 @@ if (window.rcmail) {
// register command handler
rcmail.register_command('plugin.password-save', function() {
- var input_curpasswd = rcube_find_object('_curpasswd');
- var input_newpasswd = rcube_find_object('_newpasswd');
- var input_confpasswd = rcube_find_object('_confpasswd');
-
- if (input_curpasswd && input_curpasswd.value=='') {
+ var input_curpasswd = rcube_find_object('_curpasswd'),
+ input_newpasswd = rcube_find_object('_newpasswd'),
+ input_confpasswd = rcube_find_object('_confpasswd');
+
+ if (input_curpasswd && input_curpasswd.value == '') {
alert(rcmail.gettext('nocurpassword', 'password'));
input_curpasswd.focus();
- } else if (input_newpasswd && input_newpasswd.value=='') {
+ } else if (input_newpasswd && input_newpasswd.value == '') {
alert(rcmail.gettext('nopassword', 'password'));
input_newpasswd.focus();
- } else if (input_confpasswd && input_confpasswd.value=='') {
+ } else if (input_confpasswd && input_confpasswd.value == '') {
alert(rcmail.gettext('nopassword', 'password'));
input_confpasswd.focus();
} else if (input_newpasswd && input_confpasswd && input_newpasswd.value != input_confpasswd.value) {
diff --git a/plugins/vcard_attachments/vcardattach.js b/plugins/vcard_attachments/vcardattach.js
index 29bc1a60f..b287acd4a 100644
--- a/plugins/vcard_attachments/vcardattach.js
+++ b/plugins/vcard_attachments/vcardattach.js
@@ -1,4 +1,4 @@
-/*
+/**
* vcard_attachments plugin script
* @version @package_version@
*/
@@ -13,6 +13,7 @@ function plugin_vcard_save_contact(mime_id)
function plugin_vcard_insertrow(data)
{
var ctype = data.row.ctype;
+
if (ctype == 'text/vcard' || ctype == 'text/x-vcard' || ctype == 'text/directory') {
$('#rcmrow'+data.uid+' > td.attachment').html('<img src="'+rcmail.env.vcard_icon+'" alt="" />');
}
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 8abe87303..dbf56e55f 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1282,13 +1282,22 @@ 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;
@@ -1473,9 +1482,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));
@@ -1630,7 +1643,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;');
}
@@ -1857,7 +1870,7 @@ class rcmail extends rcube
}
$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))));
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index 6db826e2e..e4059b73d 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -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'));
@@ -658,16 +661,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
@@ -971,7 +995,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 . ' :: ';
@@ -1211,10 +1235,7 @@ class rcmail_output_html extends rcmail_output
public function include_script($file, $position='head')
{
if (!preg_match('|^https?://|i', $file) && $file[0] != '/') {
- $file = $this->scripts_path . $file;
- if ($fs = @filemtime($file)) {
- $file .= '?s=' . $fs;
- }
+ $file = $this->file_mod($this->scripts_path . $file);
}
if (!is_array($this->script_files[$position])) {
diff --git a/program/js/app.js b/program/js/app.js
index bba796f20..4c9b11a1f 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -843,14 +843,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;
@@ -1412,8 +1412,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)
@@ -2613,10 +2611,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)
@@ -2633,10 +2633,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)
@@ -2663,20 +2665,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) {
@@ -2716,7 +2705,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)
{
@@ -5758,19 +5747,23 @@ 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) {
- var n = v[0];
- n = n.replace(replace_from, replace_to);
- v.push(n);
+ if (v.length < 4) {
+ var n = v[0];
+ n = n.replace(replace_from, replace_to);
+ v.push(n);
+ }
folders.push(v);
});
+
folders.sort(function(a, b) {
var len = a.length - 1; n1 = a[len], n2 = b[len];
return n1 < n2 ? -1 : 1;
@@ -6563,6 +6556,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 *********/
@@ -6832,6 +6924,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;
@@ -6844,7 +6946,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 });
}
}
@@ -6855,7 +6956,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 });
}
}
@@ -7157,13 +7257,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;
};
diff --git a/program/js/list.js b/program/js/list.js
index e3a38ba7f..54daa983e 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)
{
@@ -32,10 +32,6 @@ function rcube_list_widget(list, p)
this.list = list ? list : null;
this.tagname = this.list ? this.list.nodeName.toLowerCase() : 'table';
this.id_regexp = /^rcmrow([a-z0-9\-_=\+\/]+)/i;
- this.thead;
- this.tbody;
- this.fixed_header;
- this.frame = null;
this.rows = {};
this.selection = [];
this.rowcount = 0;
@@ -249,6 +245,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();
},
@@ -257,7 +256,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;
@@ -269,6 +268,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);
},
@@ -277,7 +280,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) {
@@ -305,6 +308,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);
},
/**
@@ -531,17 +538,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;
@@ -553,6 +561,7 @@ collapse: function(row)
this.resize();
this.triggerEvent('listupdate');
+
return false;
},
@@ -950,7 +959,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;
@@ -1046,9 +1055,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].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;
},
@@ -1292,60 +1318,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 ($.inArray(uid, selection) > -1)
+ return;
+
+ selection.push(uid);
- 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();
+ // 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 (me.subject_col < 0 || (me.subject_col >= 0 && me.subject_col == i)) {
- var subject = $(elem).text();
+ // break the loop asap
+ if (selection.length > limit + 1)
+ return false;
+ });
- if (subject) {
- // remove leading spaces
- subject = $.trim(subject);
- // truncate line to 50 characters
- subject = (subject.length > 50 ? subject.substring(0, 50) + '...' : subject);
+ // 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;
+ }
- var entry = $('<div>').text(subject);
- me.draglayer.append(entry);
- }
+ $('> ' + 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();
- return false; // break
+ if (subject) {
+ // remove leading spaces
+ subject = $.trim(subject);
+ // truncate line to 50 characters
+ subject = (subject.length > 50 ? subject.substring(0, 50) + '...' : subject);
+
+ self.draglayer.append($('<div>').text(subject));
+ return false;
}
- });
- }
- }
+ }
+ });
+ });
this.draglayer.show();
this.drag_active = true;
@@ -1420,6 +1457,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,
@@ -1530,7 +1570,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);
diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php
index ed6ffcd28..4d9fa3db1 100644
--- a/program/lib/Roundcube/rcube_addressbook.php
+++ b/program/lib/Roundcube/rcube_addressbook.php
@@ -281,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)
{
diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php
index ee53f44ed..d215760cf 100644
--- a/program/lib/Roundcube/rcube_contacts.php
+++ b/program/lib/Roundcube/rcube_contacts.php
@@ -626,7 +626,7 @@ 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) {
@@ -655,13 +655,14 @@ 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) {
@@ -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;
}
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index dc5305808..4c3bf6fcd 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
@@ -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);
}
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index 2d4aa0838..0da3e2c87 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -1618,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) {
diff --git a/program/lib/Roundcube/rcube_storage.php b/program/lib/Roundcube/rcube_storage.php
index e697b2c73..ca65af1cb 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
diff --git a/program/lib/Roundcube/rcube_utils.php b/program/lib/Roundcube/rcube_utils.php
index 27a618d83..c48cd80e8 100644
--- a/program/lib/Roundcube/rcube_utils.php
+++ b/program/lib/Roundcube/rcube_utils.php
@@ -622,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
@@ -642,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);
}
@@ -680,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 '';
@@ -912,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);
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 92ec82617..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';
diff --git a/program/localization/sk_SK/csv2vcard.inc b/program/localization/sk_SK/csv2vcard.inc
new file mode 100644
index 000000000..724ed7438
--- /dev/null
+++ b/program/localization/sk_SK/csv2vcard.inc
@@ -0,0 +1,93 @@
+<?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> |
+ +-----------------------------------------------------------------------+
+*/
+
+// This is a list of CSV column names specified in CSV file header
+// These must be original texts used in Outlook/Thunderbird exported csv files
+// Encoding UTF-8
+
+$map = array();
+
+// MS Outlook 2010
+$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";
+
+// Thunderbird
+$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/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc
index d4387194a..9af22ec35 100644
--- a/program/steps/addressbook/copy.inc
+++ b/program/steps/addressbook/copy.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);
$success = 0;
$errormsg = 'copyerror';
diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc
index b69d519ac..b2aac8a71 100644
--- a/program/steps/addressbook/delete.inc
+++ b/program/steps/addressbook/delete.inc
@@ -61,8 +61,11 @@ foreach ($cids as $source => $cid)
$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');
+ $OUTPUT->command('list_contacts', $source, $group);
$OUTPUT->send();
}
else {
@@ -123,8 +126,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 de78baa1b..b5f51d883 100644
--- a/program/steps/addressbook/edit.inc
+++ b/program/steps/addressbook/edit.inc
@@ -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);
@@ -125,7 +125,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 +135,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 +150,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,7 +169,7 @@ function rcmail_contact_editform($attrib)
function rcmail_upload_photo_form($attrib)
{
- global $OUTPUT;
+ global $RCMAIL, $OUTPUT;
// set defaults
$attrib += array('id' => 'rcmUploadform', 'buttons' => 'yes');
@@ -179,7 +179,7 @@ function rcmail_upload_photo_form($attrib)
$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);
+ $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']));
@@ -189,10 +189,10 @@ function rcmail_upload_photo_form($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)"))
+ html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) .
+ (rcube_utils::get_boolean($attrib['buttons']) ? 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)"))
) : '')
)
);
@@ -247,7 +247,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);
diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc
index 1e988feab..c112f08a3 100644
--- a/program/steps/addressbook/export.inc
+++ b/program/steps/addressbook/export.inc
@@ -140,7 +140,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())) {
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index f94d15338..db21be290 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -23,36 +23,36 @@ $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'),
+ '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' => 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),
+ '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' => 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'),
+ '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
);
@@ -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])) {
@@ -115,7 +115,7 @@ 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,7 +129,7 @@ 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;
@@ -162,13 +162,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 +189,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 +214,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 +229,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 +248,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 +275,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 +285,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 +304,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 +314,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 +330,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 +357,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 +365,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 +374,7 @@ function rcmail_js_contacts_list($result, $prefix='')
break;
default:
- $val = Q($row[$col]);
+ $val = rcube::Q($row[$col]);
break;
}
@@ -391,7 +391,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 +399,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 +417,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 +441,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 +457,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 +482,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 +509,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 +541,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 +550,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 +559,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 +577,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 +638,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 +668,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 +676,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 +684,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 +705,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 +724,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 +794,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 +857,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;
diff --git a/program/steps/addressbook/groups.inc b/program/steps/addressbook/groups.inc
index 3b9288a2b..900e7ff9f 100644
--- a/program/steps/addressbook/groups.inc
+++ b/program/steps/addressbook/groups.inc
@@ -19,7 +19,7 @@
+-----------------------------------------------------------------------+
*/
-$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) {
@@ -28,7 +28,7 @@ if ($CONTACTS->readonly || !$CONTACTS->groups) {
}
if ($RCMAIL->action == 'group-addmembers') {
- if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = rcmail_get_cids($source))) {
+ 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);
@@ -55,7 +55,7 @@ if ($RCMAIL->action == 'group-addmembers') {
}
else if ($RCMAIL->action == 'group-delmembers') {
- if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = rcmail_get_cids($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'])
@@ -74,7 +74,7 @@ else if ($RCMAIL->action == 'group-delmembers') {
}
else if ($RCMAIL->action == 'group-create') {
- if ($name = trim(get_input_value('_name', RCUBE_INPUT_POST, true))) {
+ 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'])
@@ -84,7 +84,7 @@ else if ($RCMAIL->action == 'group-create') {
}
if ($created && $OUTPUT->ajax_call) {
- $created['name'] = Q($created['name']);
+ $created['name'] = rcube::Q($created['name']);
$OUTPUT->show_message('groupcreated', 'confirmation');
$OUTPUT->command('insert_contact_group', array('source' => $source) + $created);
}
@@ -94,7 +94,7 @@ else if ($RCMAIL->action == 'group-create') {
}
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)))) {
+ 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'])
@@ -106,14 +106,14 @@ else if ($RCMAIL->action == 'group-rename') {
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));
+ '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)) {
+ 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'])
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index 4cfa94778..c56ddf8f2 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -26,7 +26,7 @@
function rcmail_import_form($attrib)
{
global $RCMAIL, $OUTPUT;
- $target = get_input_value('_target', RCUBE_INPUT_GPC);
+ $target = rcube_utils::get_input_value('_target', rcube_utils::INPUT_GPC);
$attrib += array('id' => "rcmImportForm");
@@ -39,7 +39,7 @@ function rcmail_import_form($attrib)
'size' => 40,
'multiple' => 'multiple',
));
- $form = html::p(null, html::label('rcmimportfile', rcube_label('importfromfile')) . $upload->show());
+ $form = html::p(null, html::label('rcmimportfile', $RCMAIL->gettext('importfromfile')) . $upload->show());
$table = new html_table(array('cols' => 2));
// addressbook selector
@@ -49,7 +49,7 @@ function rcmail_import_form($attrib)
foreach ($writable_books as $book)
$select->add($book['name'], $book['id']);
- $table->add('title', html::label('rcmimporttarget', rcube_label('importtarget')));
+ $table->add('title', html::label('rcmimporttarget', $RCMAIL->gettext('importtarget')));
$table->add(null, $select->show($target));
}
else {
@@ -60,18 +60,18 @@ function rcmail_import_form($attrib)
// 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');
+ $select->add($RCMAIL->gettext('none'), '0');
+ $select->add($RCMAIL->gettext('importgroupsall'), '1');
+ $select->add($RCMAIL->gettext('importgroupsexisting'), '2');
- $table->add('title', html::label('rcmimportgroups', rcube_label('importgroups')));
- $table->add(null, $select->show(get_input_value('_groups', RCUBE_INPUT_GPC)));
+ $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', rcube_label('importreplace')));
- $table->add(null, $check_replace->show(get_input_value('_replace', RCUBE_INPUT_GPC)));
+ $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);
@@ -79,7 +79,7 @@ function rcmail_import_form($attrib)
$OUTPUT->add_label('selectimportfile','importwait');
$OUTPUT->add_gui_object('importform', $attrib['id']);
- $out = html::p(null, Q(rcube_label('importdesc'), 'show'));
+ $out = html::p(null, rcube::Q($RCMAIL->gettext('importdesc'), 'show'));
$out .= $OUTPUT->form_tag(array(
'action' => $RCMAIL->url('import'),
@@ -96,12 +96,12 @@ function rcmail_import_form($attrib)
*/
function rcmail_import_confirm($attrib)
{
- global $IMPORT_STATS;
+ global $IMPORT_STATS, $RCMAIL;
$vars = get_object_vars($IMPORT_STATS);
$vars['names'] = $vars['skipped_names'] = '';
- $content = html::p(null, rcube_label(array(
+ $content = html::p(null, $RCMAIL->gettext(array(
'name' => 'importconfirm',
'nr' => $IMPORT_STATS->inserted,
'vars' => $vars,
@@ -111,7 +111,7 @@ function rcmail_import_confirm($attrib)
$content .= html::p('em', join(', ', array_map('Q', $IMPORT_STATS->names)));
if ($IMPORT_STATS->skipped) {
- $content .= html::p(null, rcube_label(array(
+ $content .= html::p(null, $RCMAIL->gettext(array(
'name' => 'importconfirmskipped',
'nr' => $IMPORT_STATS->skipped,
'vars' => $vars,
@@ -129,7 +129,7 @@ function rcmail_import_confirm($attrib)
function rcmail_import_buttons($attrib)
{
global $IMPORT_STATS, $OUTPUT;
- $target = get_input_value('_target', RCUBE_INPUT_GPC);
+ $target = rcube_utils::get_input_value('_target', rcube_utils::INPUT_GPC);
$attrib += array('type' => 'input');
unset($attrib['name']);
@@ -180,9 +180,9 @@ function rcmail_import_group_id($group_name, $CONTACTS, $create, &$import_groups
$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 +232,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');
@@ -276,7 +277,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,7 +331,7 @@ if (is_array($_FILES['_file'])) {
}
-$OUTPUT->set_pagetitle(rcube_label('importcontacts'));
+$OUTPUT->set_pagetitle($RCMAIL->gettext('importcontacts'));
$OUTPUT->add_handlers(array(
'importstep' => $importstep,
diff --git a/program/steps/addressbook/mailto.inc b/program/steps/addressbook/mailto.inc
index c3cbcadca..fc6a38dc9 100644
--- a/program/steps/addressbook/mailto.inc
+++ b/program/steps/addressbook/mailto.inc
@@ -37,10 +37,10 @@ foreach ($cids as $source => $cid)
if (!empty($_REQUEST['_gid']) && isset($_REQUEST['_source']))
{
- $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);
- $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
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 7911802b9..c4935b7e7 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -20,19 +20,19 @@
*/
$CONTACTS = rcmail_contact_source(null, true, true);
-$cid = get_input_value('_cid', RCUBE_INPUT_POST);
+$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);
+ $RCMAIL->overwrite_action($return_action);
return;
}
// cannot edit record
if ($CONTACTS->readonly) {
$OUTPUT->show_message('contactreadonly', 'error');
- rcmail_overwrite_action($return_action);
+ $RCMAIL->overwrite_action($return_action);
return;
}
@@ -46,11 +46,11 @@ foreach ($GLOBALS['CONTACT_COLTYPES'] as $col => $colprop) {
if ($colprop['childs']) {
$values = array();
foreach ($colprop['childs'] as $childcol => $cp) {
- $vals = get_input_value('_'.$childcol, RCUBE_INPUT_POST, true);
+ $vals = rcube_utils::get_input_value('_'.$childcol, rcube_utils::INPUT_POST, true);
foreach ((array)$vals as $i => $val)
$values[$i][$childcol] = $val;
}
- $subtypes = isset($_REQUEST['_subtype_' . $col]) ? (array)get_input_value('_subtype_' . $col, RCUBE_INPUT_POST) : array('');
+ $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])
@@ -59,8 +59,8 @@ foreach ($GLOBALS['CONTACT_COLTYPES'] as $col => $colprop) {
}
// 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);
+ $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') {
@@ -76,7 +76,7 @@ foreach ($GLOBALS['CONTACT_COLTYPES'] as $col => $colprop) {
}
}
else if (isset($_POST[$fname])) {
- $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST, true);
+ $a_record[$col] = rcube_utils::get_input_value($fname, rcube_utils::INPUT_POST, true);
// normalize the submitted date strings
if ($colprop['type'] == 'date') {
@@ -103,9 +103,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,7 +127,7 @@ 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))
@@ -156,27 +156,27 @@ if (!empty($cid))
$record['name'] = rcube_addressbook::compose_list_name($record);
foreach (array('name') as $col)
- $a_js_cols[] = Q((string)$record[$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');
+ $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');
+ $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);
+ $orig_source = rcube_utils::get_input_value('_orig_source', rcube_utils::INPUT_GPC);
if (!strlen($source))
$source = $orig_source;
@@ -225,7 +225,7 @@ else {
$result = $CONTACTS->search($CONTACTS->primary_key, $insert_id);
rcmail_js_contacts_list($result, 'parent.');
- $OUTPUT->command('parent.contact_list.select', html_identifier($insert_id));
+ $OUTPUT->command('parent.contact_list.select', rcube_utils::html_identifier($insert_id));
// update record count display
$CONTACTS->reset();
@@ -244,6 +244,6 @@ 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');
+ $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 840023990..e6a515bd6 100644
--- a/program/steps/addressbook/show.inc
+++ b/program/steps/addressbook/show.inc
@@ -79,7 +79,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),
@@ -89,7 +89,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),
@@ -101,19 +101,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']),
);
}
@@ -124,12 +124,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));
}
@@ -140,7 +142,7 @@ function rcmail_render_url_value($url)
'href' => $prefix . $url,
'target' => '_blank',
'class' => 'url',
- ), Q($url));
+ ), rcube::Q($url));
}
@@ -163,10 +165,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(
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..9d16e094b 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -28,7 +28,7 @@ $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);
+ $contact_arr = rcube_mime::decode_address_list(rcube_utils::get_input_value('_address', rcube_utils::INPUT_POST, true), 1, false);
if (!empty($contact_arr[1]['mailto'])) {
$contact = array(
@@ -42,13 +42,13 @@ if (!empty($_POST['_address']) && is_object($CONTACTS))
$OUTPUT->send();
}
- $email = rcube_idn_to_ascii($contact['email']);
- if (!check_email($email, false)) {
+ $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_idn_to_utf8($contact['email']);
+ $contact['email'] = rcube_utils::idn_to_utf8($contact['email']);
$contact = $RCMAIL->plugins->exec_hook('contact_displayname', $contact);
if (empty($contact['firstname']) || empty($contact['surname']))
diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc
index 85aa9542b..f0ad97d20 100644
--- a/program/steps/mail/attachments.inc
+++ b/program/steps/mail/attachments.inc
@@ -21,10 +21,10 @@
// 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]) {
@@ -84,7 +84,7 @@ 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;
@@ -98,7 +98,7 @@ if (is_array($_FILES['_attachments']['tmp_name'])) {
'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]),
+ 'mimetype' => rcube_mime::file_content_type($filepath, $_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i]),
'group' => $COMPOSE_ID,
);
@@ -115,11 +115,11 @@ if (is_array($_FILES['_attachments']['tmp_name'])) {
if (($icon = $COMPOSE['deleteicon']) && is_file($icon)) {
$button = html::img(array(
'src' => $icon,
- 'alt' => rcube_label('delete')
+ 'alt' => $RCMAIL->gettext('delete')
));
}
else if ($COMPOSE['textbuttons']) {
- $button = Q(rcube_label('delete'));
+ $button = rcube::Q($RCMAIL->gettext('delete'));
}
else {
$button = '';
@@ -127,29 +127,30 @@ if (is_array($_FILES['_attachments']['tmp_name'])) {
$content = html::a(array(
'href' => "#delete",
- 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id),
- 'title' => rcube_label('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 .= Q($attachment['name']);
+ $content .= rcube::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']),
+ '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) {
- $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 ($attachment['error']) {
$msg = $attachment['error'];
}
else {
- $msg = rcube_label('fileuploaderror');
+ $msg = $RCMAIL->gettext('fileuploaderror');
}
if ($attachment['error'] || $err != UPLOAD_ERR_NO_FILE) {
@@ -163,9 +164,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');
$OUTPUT->command('remove_from_attachment_list', $uploadid);
}
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index f9e8d71a4..acc86229f 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -21,16 +21,16 @@
*/
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)) {
+ $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)) {
$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) {
+ $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));
- break; // only expand one email per contact
}
}
@@ -45,9 +45,9 @@ if ($RCMAIL->action == 'group-expand') {
$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);
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index 8c0b1ffc0..60da68a96 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -65,7 +65,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 +73,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 +114,24 @@ 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);
+ }
+ }
}
// trigger refresh hook
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index f75b219ff..d5154ffed 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -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])
@@ -47,14 +47,14 @@ if (!is_array($COMPOSE))
{
// Infinite redirect prevention in case of broken session (#1487028)
if ($COMPOSE_ID)
- raise_error(array('code' => 500, 'type' => 'php',
+ rcube::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),
+ 'param' => rcube_utils::request2param(rcube_utils::INPUT_GET, 'task|action', true),
'mailbox' => $RCMAIL->storage->get_folder(),
);
$COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID];
@@ -74,7 +74,7 @@ if (!is_array($COMPOSE))
$attachment = array(
'group' => $COMPOSE_ID,
'name' => $filename,
- 'mimetype' => rc_mime_content_type($attach, $filename),
+ 'mimetype' => rcube_mime::file_content_type($attach, $filename),
'path' => $attach,
);
}
@@ -114,7 +114,7 @@ $OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubj
$OUTPUT->set_env('compose_id', $COMPOSE['id']);
$OUTPUT->set_env('session_id', session_id());
-$OUTPUT->set_pagetitle(rcube_label('compose'));
+$OUTPUT->set_pagetitle($RCMAIL->gettext('compose'));
// add config parameters to client script
if (!empty($CONFIG['drafts_mbox'])) {
@@ -127,7 +127,7 @@ $OUTPUT->set_env('top_posting', intval($RCMAIL->config->get('reply_mode')) > 0);
$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
// 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);
}
@@ -264,7 +264,7 @@ $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'];
@@ -297,7 +297,7 @@ foreach ($parts as $header) {
$COMPOSE['param']['to'] = $fvalue;
}
else if (!empty($_POST['_'.$header])) {
- $fvalue = get_input_value('_'.$header, RCUBE_INPUT_POST, TRUE);
+ $fvalue = rcube_utils::get_input_value('_'.$header, rcube_utils::INPUT_POST, TRUE);
}
else if (!empty($COMPOSE['param'][$header])) {
$fvalue = $COMPOSE['param'][$header];
@@ -376,7 +376,7 @@ foreach ($parts as $header) {
if (empty($addr_part['mailto']))
continue;
- $mailto = format_email(rcube_idn_to_utf8($addr_part['mailto']));
+ $mailto = format_email(rcube_utils::idn_to_utf8($addr_part['mailto']));
if (!in_array($mailto, $a_recipients)
&& (
@@ -463,7 +463,7 @@ function rcmail_process_compose_params(&$COMPOSE)
function rcmail_compose_headers($attrib)
{
- global $MESSAGE;
+ global $RCMAIL, $MESSAGE;
list($form_start,) = get_form_tags($attrib);
@@ -521,7 +521,7 @@ function rcmail_compose_headers($attrib)
$out = $form_start.$out;
// configure autocompletion
- rcube_autocomplete_init();
+ $RCMAIL->autocomplete_init();
return $out;
}
@@ -544,7 +544,7 @@ function rcmail_compose_header_from($attrib)
$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)";
+ $field_attrib['onchange'] = rcmail_output::JS_OBJECT_NAME.".change_identity(this)";
$select_from = new html_select($field_attrib);
// create SELECT element
@@ -563,7 +563,7 @@ function rcmail_compose_header_from($attrib)
$text = trim($h2t->get_text());
}
else {
- $html = htmlentities($html, ENT_NOQUOTES, RCMAIL_CHARSET);
+ $html = htmlentities($html, ENT_NOQUOTES, RCUBE_CHARSET);
}
if (!preg_match('/^--[ -]\r?\n/m', $text)) {
@@ -646,8 +646,8 @@ function rcmail_prepare_message_body()
// 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);
+ $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'];
@@ -736,7 +736,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 '';
}
@@ -841,7 +841,7 @@ function rcmail_compose_body($attrib)
// If desired, set this textarea to be editable by TinyMCE
if ($isHtml) {
- $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCMAIL_CHARSET);
+ $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCUBE_CHARSET);
$attrib['class'] = 'mce_editor';
$attrib['is_escaped'] = true;
$textarea = new html_textarea($attrib);
@@ -861,7 +861,7 @@ function rcmail_compose_body($attrib)
$OUTPUT->set_env('composebody', $attrib['id']);
// include HTML editor
- rcube_html_editor();
+ $RCMAIL->html_editor();
// Set language list
if (!empty($CONFIG['enable_spellcheck'])) {
@@ -882,7 +882,7 @@ function rcmail_compose_body($attrib)
$editor_lang_set = array();
foreach ($spellcheck_langs as $key => $name) {
- $editor_lang_set[] = ($key == $lang ? '+' : '') . JQ($name).'='.JQ($key);
+ $editor_lang_set[] = ($key == $lang ? '+' : '') . rcube::JQ($name).'='.rcube::JQ($key);
}
// include GoogieSpell
@@ -903,16 +903,16 @@ function rcmail_compose_body($attrib)
$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),
+ 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'],
- JS_OBJECT_NAME), 'foot');
+ rcmail_output::JS_OBJECT_NAME), 'foot');
$OUTPUT->add_label('checking');
$OUTPUT->set_env('spellcheck_langs', join(',', $editor_lang_set));
@@ -930,11 +930,11 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
// build reply prefix
$from = array_pop(rcube_mime::decode_address_list($MESSAGE->get_header('from'), 1, false, $MESSAGE->headers->charset));
- $prefix = rcube_label(array(
+ $prefix = $RCMAIL->gettext(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']),
+ 'date' => $RCMAIL->format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')),
+ 'sender' => $from['name'] ? $from['name'] : rcube_utils::idn_to_utf8($from['mailto']),
)
));
@@ -961,7 +961,7 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
$body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
// build reply (quote content)
- $prefix = '<p>' . Q($prefix) . "</p>\n";
+ $prefix = '<p>' . rcube::Q($prefix) . "</p>\n";
$prefix .= '<blockquote>';
if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
@@ -985,19 +985,19 @@ function rcmail_create_forward_body($body, $bodyIsHtml)
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'));
+ $date = $RCMAIL->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";
+ $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 .= rcube_label('cc') . ': ' . $cc . "\n";
+ $prefix .= $RCMAIL->gettext('cc') . ': ' . $cc . "\n";
if (($replyto = $MESSAGE->headers->get('reply-to')) && $replyto != $MESSAGE->get_header('from'))
- $prefix .= rcube_label('replyto') . ': ' . $replyto . "\n";
+ $prefix .= $RCMAIL->gettext('replyto') . ': ' . $replyto . "\n";
$prefix .= "\n";
$body = trim($body, "\r\n");
@@ -1009,24 +1009,24 @@ function rcmail_create_forward_body($body, $bodyIsHtml)
$body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
$prefix = sprintf(
- "<br /><p>-------- " . rcube_label('originalmessage') . " --------</p>" .
+ "<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>",
- 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'));
+ $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>",
- rcube_label('cc'), Q($cc, 'replace'));
+ $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>",
- rcube_label('replyto'), Q($replyto, 'replace'));
+ $RCMAIL->gettext('replyto'), rcube::Q($replyto, 'replace'));
$prefix .= "</tbody></table><br>";
}
@@ -1286,12 +1286,12 @@ function rcmail_save_attachment(&$message, $pid)
$temp_dir = unslashify($rcmail->config->get('temp_dir'));
$path = tempnam($temp_dir, 'rcmAttmnt');
if ($fp = fopen($path, 'w')) {
- $message->get_part_content($pid, $fp);
+ $message->get_part_content($pid, $fp, true, 0, false);
fclose($fp);
} else
return false;
} else {
- $data = $message->get_part_content($pid);
+ $data = $message->get_part_content($pid, null, true, 0, false);
}
$mimetype = $part->ctype_primary . '/' . $part->ctype_secondary;
@@ -1330,7 +1330,7 @@ function rcmail_save_image($path, $mimetype='')
$attachment = array(
'group' => $COMPOSE['id'],
'name' => $name,
- 'mimetype' => $mimetype ? $mimetype : rc_mime_content_type($path, $name),
+ 'mimetype' => $mimetype ? $mimetype : rcube_mime::file_content_type($path, $name),
'data' => $data,
'size' => strlen($data),
);
@@ -1370,7 +1370,7 @@ function rcmail_compose_subject($attrib)
// use subject from post
if (isset($_POST['_subject'])) {
- $subject = get_input_value('_subject', RCUBE_INPUT_POST, TRUE);
+ $subject = rcube_utils::get_input_value('_subject', rcube_utils::INPUT_POST, TRUE);
}
// create a reply-subject
else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
@@ -1404,7 +1404,7 @@ function rcmail_compose_subject($attrib)
function rcmail_compose_attachment_list($attrib)
{
- global $OUTPUT, $CONFIG, $COMPOSE;
+ global $RCMAIL, $OUTPUT, $CONFIG, $COMPOSE;
// add ID if not given
if (!$attrib['id'])
@@ -1418,11 +1418,11 @@ function rcmail_compose_attachment_list($attrib)
if ($attrib['deleteicon']) {
$button = html::img(array(
'src' => $CONFIG['skin_path'] . $attrib['deleteicon'],
- 'alt' => rcube_label('delete')
+ 'alt' => $RCMAIL->gettext('delete')
));
}
else if (rcube_utils::get_boolean($attrib['textbuttons'])) {
- $button = Q(rcube_label('delete'));
+ $button = rcube::Q($RCMAIL->gettext('delete'));
}
foreach ($COMPOSE['attachments'] as $id => $a_prop) {
@@ -1432,17 +1432,17 @@ function rcmail_compose_attachment_list($attrib)
$out .= html::tag('li',
array(
'id' => 'rcmfile'.$id,
- 'class' => rcmail_filetype2classname($a_prop['mimetype'], $a_prop['name']),
+ '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' => rcube_label('delete'),
- 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id),
+ 'title' => $RCMAIL->gettext('delete'),
+ 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", rcmail_output::JS_OBJECT_NAME, $id),
'class' => 'delete'
),
$button
- ) . Q($a_prop['name'])
+ ) . rcube::Q($a_prop['name'])
);
$jslist['rcmfile'.$id] = array('name' => $a_prop['name'], 'complete' => true, 'mimetype' => $a_prop['mimetype']);
@@ -1467,23 +1467,23 @@ function rcmail_compose_attachment_list($attrib)
function rcmail_compose_attachment_form($attrib)
{
- global $OUTPUT;
+ global $OUTPUT, $RCMAIL;
// set defaults
$attrib += array('id' => 'rcmUploadbox', 'buttons' => 'yes');
// Get filesize, enable upload progress bar
- $max_filesize = rcube_upload_init();
+ $max_filesize = $RCMAIL->upload_init();
$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'),
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)"))
+ html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) .
+ (rcube_utils::get_boolean($attrib['buttons']) ? 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)"))
) : '')
)
);
@@ -1506,7 +1506,7 @@ function rcmail_compose_attachment_field($attrib = array())
function rcmail_priority_selector($attrib)
{
- global $MESSAGE;
+ global $RCMAIL, $MESSAGE;
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
@@ -1514,11 +1514,11 @@ function rcmail_priority_selector($attrib)
$attrib['name'] = '_priority';
$selector = new html_select($attrib);
- $selector->add(array(rcube_label('lowest'),
- rcube_label('low'),
- rcube_label('normal'),
- rcube_label('high'),
- rcube_label('highest')),
+ $selector->add(array($RCMAIL->gettext('lowest'),
+ $RCMAIL->gettext('low'),
+ $RCMAIL->gettext('normal'),
+ $RCMAIL->gettext('high'),
+ $RCMAIL->gettext('highest')),
array('5', '4', '0', '2', '1'));
if (isset($_POST['_priority']))
@@ -1594,6 +1594,8 @@ function rcmail_dsn_checkbox($attrib)
function rcmail_editor_selector($attrib)
{
+ global $RCMAIL;
+
// determine whether HTML or plain text should be checked
$useHtml = rcmail_compose_editor_mode();
@@ -1607,15 +1609,15 @@ function rcmail_editor_selector($attrib)
$select = new html_select($attrib);
- $select->add(Q(rcube_label('htmltoggle')), 'html');
- $select->add(Q(rcube_label('plaintoggle')), 'plain');
+ $select->add(rcube::Q($RCMAIL->gettext('htmltoggle')), 'html');
+ $select->add(rcube::Q($RCMAIL->gettext('plaintoggle')), 'plain');
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)));
+ $selector .= $radio->show($chosenvalue, $attrib) . html::label($attrib['id'], rcube::Q($RCMAIL->gettext($text)));
}
return $selector;
@@ -1625,11 +1627,11 @@ function rcmail_editor_selector($attrib)
function rcmail_store_target_selection($attrib)
{
- global $COMPOSE;
+ global $COMPOSE, $RCMAIL;
$attrib['name'] = '_store_target';
- $select = rcmail_mailbox_select(array_merge($attrib, array(
- 'noselection' => '- '.rcube_label('dontsave').' -',
+ $select = $RCMAIL->folder_selector(array_merge($attrib, array(
+ 'noselection' => '- ' . $RCMAIL->gettext('dontsave') . ' -',
'folder_filter' => 'mail',
'folder_rights' => 'w',
)));
@@ -1701,11 +1703,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';
@@ -1713,7 +1715,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));
@@ -1727,7 +1729,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');
@@ -1737,7 +1739,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');
}
@@ -1773,7 +1775,7 @@ function rcmail_compose_responses_list($attrib)
'class' => rtrim('insertresponse ' . $attrib['itemclass']),
'unselectable' => 'on',
'rel' => $key,
- ), Q($response['name']));
+ ), rcube::Q($response['name']));
$jsenv[$key] = $response;
$list->add(array(), $item);
diff --git a/program/steps/mail/copy.inc b/program/steps/mail/copy.inc
index 876657485..4cebae6c6 100644
--- a/program/steps/mail/copy.inc
+++ b/program/steps/mail/copy.inc
@@ -25,15 +25,15 @@ if (!$OUTPUT->ajax_call)
// 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 +43,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..d7cfd93f3 100644
--- a/program/steps/mail/folders.inc
+++ b/program/steps/mail/folders.inc
@@ -23,7 +23,7 @@
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') {
@@ -35,14 +35,14 @@ 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();
}
}
@@ -69,12 +69,12 @@ 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);
}
}
else {
- rcmail_display_server_error();
+ $RCMAIL->display_server_error();
}
}
}
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index aefe1744c..00d66a0d0 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -32,7 +32,7 @@ $SEARCH_MODS_DEFAULT = array(
$RCMAIL->storage_init();
// set imap properties and session vars
-if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true))))
+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();
@@ -78,7 +78,7 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
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);
@@ -131,10 +131,10 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
// register UI objects
$OUTPUT->add_handlers(array(
- 'mailboxlist' => 'rcmail_mailbox_list',
+ 'mailboxlist' => array($RCMAIL, 'folder_list'),
'messages' => 'rcmail_message_list',
'messagecountdisplay' => 'rcmail_messagecount_display',
- 'quotadisplay' => 'rcmail_quota_display',
+ 'quotadisplay' => array($RCMAIL, 'quota_display'),
'mailboxname' => 'rcmail_mailbox_name_display',
'messageheaders' => 'rcmail_message_headers',
'messagefullheaders' => 'rcmail_message_full_headers',
@@ -249,7 +249,7 @@ function rcmail_message_list($attrib)
$OUTPUT->set_env('col_movable', !in_array('list_cols', (array)$CONFIG['dont_override']));
}
else {
- $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($attrib['columns']));
+ $a_show_cols = preg_split('/[\s,;]+/', str_replace(array("'", '"'), '', $attrib['columns']));
$attrib['columns'] = $a_show_cols;
}
@@ -298,7 +298,7 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null
}
else {
if (!is_array($a_show_cols))
- $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($a_show_cols));
+ $a_show_cols = preg_split('/[\s,;]+/', str_replace(array("'", '"'), '', $a_show_cols));
$head_replace = true;
}
@@ -357,15 +357,15 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null
$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);
+ if (!$cont) $cont = $RCMAIL->gettext('nosubject');
+ $cont = rcube::Q($cont);
}
else if ($col == 'size')
$cont = show_bytes($header->$col);
else if ($col == 'date')
- $cont = format_date($header->date);
+ $cont = $RCMAIL->format_date($header->date);
else
- $cont = Q($header->$col);
+ $cont = rcube::Q($header->$col);
$a_msg_cols[$col] = $cont;
}
@@ -386,7 +386,7 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null
if ($header->priority)
$a_msg_flags['prio'] = (int) $header->priority;
- $a_msg_flags['ctype'] = Q($header->ctype);
+ $a_msg_flags['ctype'] = rcube::Q($header->ctype);
$a_msg_flags['mbox'] = $mbox;
// merge with plugin result (Deprecated, use $header->flags)
@@ -435,14 +435,14 @@ function rcmail_message_list_head($attrib, $a_show_cols)
$a_sort_cols = array('subject', 'date', 'from', 'to', 'fromto', 'size', 'cc');
if (!empty($attrib['optionsmenuicon'])) {
- $onclick = 'return ' . JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu')";
+ $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' => rcube_label('listoptions')));
+ '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' => rcube_label('listoptions')))
+ 'id' => 'listmenulink', 'title' => $RCMAIL->gettext('listoptions')))
);
}
else
@@ -470,15 +470,15 @@ function rcmail_message_list_head($attrib, $a_show_cols)
$col_name = $list_menu;
break;
case 'fromto':
- $col_name = Q(rcube_label($smart_col));
+ $col_name = rcube::Q($RCMAIL->gettext($smart_col));
break;
default:
- $col_name = Q(rcube_label($col));
+ $col_name = rcube::Q($RCMAIL->gettext($col));
}
// 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);
+ $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>';
@@ -522,7 +522,7 @@ function rcmail_messagecount_display($attrib)
$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);
}
@@ -545,14 +545,14 @@ function rcmail_get_messagecount_text($count=NULL, $page=NULL)
$max = $RCMAIL->storage->count(NULL, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
if ($max==0)
- $out = rcube_label('mailboxempty');
+ $out = $RCMAIL->gettext('mailboxempty');
else
- $out = rcube_label(array('name' => $RCMAIL->storage->get_threading() ? 'threadsfromto' : 'messagesfromto',
+ $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);
}
@@ -572,7 +572,7 @@ function rcmail_mailbox_name_display($attrib)
function rcmail_get_mailbox_name_text()
{
global $RCMAIL;
- return rcmail_localize_foldername($RCMAIL->storage->get_folder());
+ return $RCMAIL->localize_foldername($RCMAIL->storage->get_folder());
}
@@ -671,7 +671,7 @@ function rcmail_wash_html($html, $p, $cid_replaces)
// 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.'" />';
+ $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)
@@ -686,7 +686,7 @@ function rcmail_wash_html($html, $p, $cid_replaces)
'show_washed' => false,
'allow_remote' => $p['safe'],
'blocked_src' => "./program/resources/blocked.gif",
- 'charset' => RCMAIL_CHARSET,
+ 'charset' => RCUBE_CHARSET,
'cid_map' => $cid_replaces,
'html_elements' => array('body'),
);
@@ -716,7 +716,7 @@ function rcmail_wash_html($html, $p, $cid_replaces)
$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);
$REMOTE_OBJECTS = $washer->extlinks;
@@ -840,7 +840,7 @@ function rcmail_plain_body($body)
$body = join("\n", $body);
- // quote plain text (don't use Q() here, to display entities "as is")
+ // 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);
@@ -877,7 +877,7 @@ function rcmail_washtml_callback($tagname, $attrib, $content, $washtml)
case 'style':
// decode all escaped entities and reduce to ascii strings
- $stripped = preg_replace('/[^a-zA-Z\(:;]/', '', rcmail_xss_entity_decode($content));
+ $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)) {
@@ -945,13 +945,13 @@ function rcmail_message_headers($attrib, $headers=null)
if (in_array($hkey, $exclude_headers))
continue;
- $header_title = rcube_label(preg_replace('/(^mail-|-)/', '', $hkey));
+ $header_title = $RCMAIL->gettext(preg_replace('/(^mail-|-)/', '', $hkey));
if ($hkey == 'date') {
if ($PRINT_MODE)
- $header_value = format_date($value, $RCMAIL->config->get('date_long', 'x'));
+ $header_value = $RCMAIL->format_date($value, $RCMAIL->config->get('date_long', 'x'));
else
- $header_value = format_date($value);
+ $header_value = $RCMAIL->format_date($value);
}
else if ($hkey == 'priority') {
if ($value) {
@@ -995,7 +995,7 @@ function rcmail_message_headers($attrib, $headers=null)
$ishtml = true;
}
else if ($hkey == 'subject' && empty($value))
- $header_value = rcube_label('nosubject');
+ $header_value = $RCMAIL->gettext('nosubject');
else
$header_value = trim(rcube_mime::decode_header($value, $headers['charset']));
@@ -1012,14 +1012,14 @@ function rcmail_message_headers($attrib, $headers=null)
// single header value is requested
if (!empty($attrib['valueof']))
- return Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show'));
+ return rcube::Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show'));
// 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')));
+ $table->add(array('class' => 'header-title'), rcube::Q($row['title']));
+ $table->add(array('class' => 'header '.$hkey), $row['html'] ? $row['value'] : rcube::Q($row['value'], ($hkey == 'subject' ? 'strict' : 'show')));
}
return $table->show($attrib);
@@ -1030,6 +1030,8 @@ function rcmail_message_headers($attrib, $headers=null)
*/
function rcmail_localized_priority($value)
{
+ global $RCMAIL;
+
$labels_map = array(
'1' => 'highest',
'2' => 'high',
@@ -1039,7 +1041,7 @@ function rcmail_localized_priority($value)
);
if ($value && $labels_map[$value])
- return rcube_label($labels_map[$value]);
+ return $RCMAIL->gettext($labels_map[$value]);
return '';
}
@@ -1049,10 +1051,10 @@ 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('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');
@@ -1094,7 +1096,7 @@ function rcmail_message_body($attrib)
// 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'));
+ $out .= html::span('part-notice', $RCMAIL->gettext('encryptedmessage'));
}
continue;
}
@@ -1103,10 +1105,10 @@ function rcmail_message_body($attrib)
}
// 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'). ' '
+ 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()), rcube_label('download')));
+ .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download')));
continue;
}
@@ -1158,17 +1160,17 @@ function rcmail_message_body($attrib)
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'). ' '
+ 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()), rcube_label('download')));
+ .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('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))));
+ rcmail_plain_body(rcube::Q($MESSAGE->body, 'strict', false))));
}
}
@@ -1191,7 +1193,7 @@ function rcmail_message_body($attrib)
'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
'onclick' => sprintf(
'return %s.command(\'load-attachment\',\'%s\',this)',
- JS_OBJECT_NAME,
+ rcmail_output::JS_OBJECT_NAME,
$attach_prop->mime_id)
);
$out .= html::p('image-attachment',
@@ -1204,18 +1206,18 @@ function rcmail_message_body($attrib)
'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('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, rcube_label('showattachment')) . '&nbsp;' : '') .
- html::a($show_link['href'] . '&_download=1', rcube_label('download'))
+ (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', Q($attach_prop->filename)) .
+ 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'),
@@ -1295,7 +1297,7 @@ function rcmail_html4inline($body, $container_id, $body_id='', &$attributes=null
// replace all css definitions with #container [def]
$styles = substr($body, $pos, $len);
- $styles = rcmail_mod_css_styles($styles, $cont_id, $allow_remote);
+ $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;
@@ -1385,7 +1387,7 @@ function rcmail_alter_html_link($matches)
global $RCMAIL;
$tag = strtolower($matches[1]);
- $attrib = parse_attrib_string($matches[2]);
+ $attrib = html::parse_attrib_string($matches[2]);
$end = '>';
// Remove non-printable characters in URL (#1487805)
@@ -1421,8 +1423,8 @@ function rcmail_alter_html_link($matches)
$attrib['href'] = 'mailto:' . implode(',', $addresses);
$attrib['onclick'] = sprintf(
"return %s.command('compose','%s',this)",
- JS_OBJECT_NAME,
- JQ(implode(',', $mailto) . ($url ? "?$url" : '')));
+ rcmail_output::JS_OBJECT_NAME,
+ rcube::JQ(implode(',', $mailto) . ($url ? "?$url" : '')));
}
else {
$attrib['href'] = '#NOP';
@@ -1477,7 +1479,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
$name = $part['name'];
$mailto = $part['mailto'];
$string = $part['string'];
- $valid = check_email($mailto, false);
+ $valid = rcube_utils::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, '@')) {
@@ -1486,27 +1488,27 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
// IDNA ASCII to Unicode
if ($name == $mailto)
- $name = rcube_idn_to_utf8($name);
+ $name = rcube_utils::idn_to_utf8($name);
if ($string == $mailto)
- $string = rcube_idn_to_utf8($string);
- $mailto = rcube_idn_to_utf8($mailto);
+ $string = rcube_utils::idn_to_utf8($string);
+ $mailto = rcube_utils::idn_to_utf8($mailto);
if ($PRINT_MODE) {
- $address = sprintf('%s &lt;%s&gt;', Q($name), Q($mailto));
+ $address = sprintf('%s &lt;%s&gt;', rcube::Q($name), rcube::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))),
+ 'onclick' => sprintf("return %s.command('compose','%s',this)", rcmail_output::JS_OBJECT_NAME, rcube::JQ(format_email_recipient($mailto, $name))),
'class' => "rcmContactAddress",
);
if ($show_email && $name && $mailto) {
- $content = Q($name ? sprintf('%s <%s>', $name, $mailto) : $mailto);
+ $content = rcube::Q($name ? sprintf('%s <%s>', $name, $mailto) : $mailto);
}
else {
- $content = Q($name ? $name : $mailto);
+ $content = rcube::Q($name ? $name : $mailto);
$attrs['title'] = $mailto;
}
@@ -1514,14 +1516,14 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
}
else {
$address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"),
- Q($name ? $name : $mailto));
+ rcube::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'),
+ 'onclick' => sprintf("return %s.command('add-contact','%s',this)", rcmail_output::JS_OBJECT_NAME, rcube::JQ($string)),
+ 'title' => $RCMAIL->gettext('addtoaddressbook'),
'class' => 'rcmaddcontact',
),
html::img(array(
@@ -1533,9 +1535,9 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
else {
$address = '';
if ($name)
- $address .= Q($name);
+ $address .= rcube::Q($name);
if ($mailto)
- $address = trim($address . ' ' . Q($name ? sprintf('<%s>', $mailto) : $mailto));
+ $address = trim($address . ' ' . rcube::Q($name ? sprintf('<%s>', $mailto) : $mailto));
}
$address = html::span('adr', $address);
@@ -1561,7 +1563,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
'href' => '#more',
'class' => 'morelink',
'onclick' => '$(this).hide().next().show()',
- ), Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))) .
+ ), rcube::Q($RCMAIL->gettext(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))) .
html::span(array('style' => 'display:none'), join(', ', $allvalues));
}
else {
@@ -1569,11 +1571,11 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
'href' => '#more',
'class' => 'morelink',
'onclick' => sprintf("return %s.show_popup_dialog('%s','%s')",
- JS_OBJECT_NAME,
- JQ(join(', ', $allvalues)),
- JQ($title))
+ rcmail_output::JS_OBJECT_NAME,
+ rcube::JQ(join(', ', $allvalues)),
+ rcube::JQ($title))
),
- Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs)))));
+ rcube::Q($RCMAIL->gettext(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs)))));
}
}
@@ -1604,7 +1606,7 @@ function rcmail_wrap_and_quote($text, $length = 72)
$line = '>' . rtrim($line);
else if (mb_strlen($line) > $max) {
$newline = '';
- foreach (explode("\n", rc_wordwrap($line, $length - 2)) as $l) {
+ foreach (explode("\n", rcube_mime::wordwrap($line, $length - 2)) as $l) {
if (strlen($l))
$newline .= '> ' . $l . "\n";
else
@@ -1690,17 +1692,17 @@ function rcmail_send_mdn($message, &$smtp_error)
$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->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(),
+ 'Date' => $RCMAIL->user_date(),
'From' => $sender,
'To' => $message->headers->mdn_to,
- 'Subject' => rcube_label('receiptread') . ': ' . $message->subject,
- 'Message-ID' => rcmail_gen_message_id(),
+ 'Subject' => $RCMAIL->gettext('receiptread') . ': ' . $message->subject,
+ 'Message-ID' => $RCMAIL->gen_message_id(),
'X-Sender' => $identity['email'],
'References' => trim($message->headers->references . ' ' . $message->headers->messageID),
);
@@ -1718,21 +1720,21 @@ function rcmail_send_mdn($message, &$smtp_error)
$report .= "Reporting-UA: $agent\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");
+ $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");
$compose->headers($headers);
$compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification'));
- $compose->setTXTBody(rc_wordwrap($body, 75, "\r\n"));
+ $compose->setTXTBody(rcube_mime::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');
@@ -1868,16 +1870,18 @@ function rcmail_fix_mimetype($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;
}
@@ -1889,7 +1893,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');
}
}
@@ -1898,12 +1902,12 @@ function rcmail_attachment_name($attachment, $display = false)
function rcmail_search_filter($attrib)
{
- global $OUTPUT, $CONFIG;
+ global $RCMAIL, $OUTPUT, $CONFIG;
if (!strlen($attrib['id']))
$attrib['id'] = 'rcmlistfilter';
- $attrib['onchange'] = JS_OBJECT_NAME.'.filter_mailbox(this.value)';
+ $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()
@@ -1916,20 +1920,20 @@ function rcmail_search_filter($attrib)
}
$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');
+ $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 (!$CONFIG['skip_deleted']) {
- $select_filter->add(rcube_label('deleted'), 'DELETED');
- $select_filter->add(rcube_label('undeleted'), 'UNDELETED');
+ $select_filter->add($RCMAIL->gettext('deleted'), 'DELETED');
+ $select_filter->add($RCMAIL->gettext('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');
+ $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']);
@@ -1956,13 +1960,13 @@ function rcmail_message_error($uid=null)
function rcmail_message_import_form($attrib = array())
{
- global $OUTPUT;
+ global $OUTPUT, $RCMAIL;
// set defaults
$attrib += array('id' => 'rcmImportform', 'buttons' => 'yes');
// Get filesize, enable upload progress bar
- $max_filesize = rcube_upload_init();
+ $max_filesize = $RCMAIL->upload_init();
$button = new html_inputfield(array('type' => 'button'));
$fileinput = new html_inputfield(array(
@@ -1976,10 +1980,10 @@ function rcmail_message_import_form($attrib = array())
$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)"))
+ html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) .
+ (rcube_utils::get_boolean($attrib['buttons']) ? 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)"))
) : '')
)
);
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index be1366dcf..d588343de 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -23,12 +23,12 @@
// show loading page
if (!empty($_GET['_preload'])) {
$url = preg_replace('/([&?]+)_preload=/', '\\1_mimewarning=1&_embed=', $_SERVER['REQUEST_URI']);
- $message = rcube_label('loadingdata');
+ $message = $RCMAIL->gettext('loadingdata');
- header('Content-Type: text/html; charset=' . RCMAIL_CHARSET);
+ header('Content-Type: text/html; charset=' . RCUBE_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"
+ . '<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;
}
@@ -38,7 +38,7 @@ ob_end_clean();
// similar code as in program/steps/mail/show.inc
if (!empty($_GET['_uid'])) {
- $uid = get_input_value('_uid', RCUBE_INPUT_GET);
+ $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET);
$RCMAIL->config->set('prefer_html', true);
$MESSAGE = new rcube_message($uid);
}
@@ -46,7 +46,7 @@ if (!empty($_GET['_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'])) {
@@ -72,7 +72,7 @@ if (!empty($_GET['_frame'])) {
// render thumbnail of an image attachment
else if ($_GET['_thumb']) {
- $pid = get_input_value('_part', RCUBE_INPUT_GET);
+ $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');
@@ -187,7 +187,7 @@ else if (strlen($part_id)) {
$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(
+ $RCMAIL->gettext(array(
'name' => 'attachmentvalidationerror',
'vars' => array(
'expected' => $mimetype . ($file_extension ? " (.$file_extension)" : ''),
@@ -197,7 +197,7 @@ else if (strlen($part_id)) {
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')))
+ $RCMAIL->gettext('showanyway')))
)
)));
}
@@ -221,7 +221,7 @@ else if (strlen($part_id)) {
list($ctype_primary, $ctype_secondary) = explode('/', $mimetype);
if (!$plugin['download'] && $ctype_primary == 'text') {
- header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCMAIL_CHARSET));
+ header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCUBE_CHARSET));
}
else {
header("Content-Type: $mimetype");
@@ -232,10 +232,10 @@ else if (strlen($part_id)) {
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'). ' '
+ 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()), rcube_label('download')) . '</body></html>';
+ .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download')) . '</body></html>';
}
else {
// get part body if not available
@@ -256,10 +256,10 @@ else if (strlen($part_id)) {
}
$out = substr($out, 0, $body_start) .
html::div(array('class' => 'rcmail-inline-message rcmail-inline-warning'),
- Q(rcube_label('blockedimages')) . '&nbsp;' .
+ rcube::Q($RCMAIL->gettext('blockedimages')) . '&nbsp;' .
html::tag('button',
array('onclick' => "location.href='" . $RCMAIL->url(array_merge($_GET, array('_safe' => 1))) . "'"),
- Q(rcube_label('showimages')))
+ rcube::Q($RCMAIL->gettext('showimages')))
) .
substr($out, $body_start);
}
@@ -270,7 +270,7 @@ else if (strlen($part_id)) {
check_storage_status();
}
- $OUTPUT = new rcube_html_page();
+ $OUTPUT = new rcmail_html_page();
$OUTPUT->write($out);
}
else {
@@ -376,7 +376,7 @@ else {
$cont .= rcmail_message_body(array());
$cont .= "\n</body>\n</html>";
- $OUTPUT = new rcube_html_page();
+ $OUTPUT = new rcmail_html_page();
$OUTPUT->write($cont);
exit;
@@ -410,7 +410,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'),
@@ -429,7 +429,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]
) {
@@ -439,14 +439,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);
}
@@ -458,7 +458,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/headers.inc b/program/steps/mail/headers.inc
index cad113f68..ae1f1db81 100644
--- a/program/steps/mail/headers.inc
+++ b/program/steps/mail/headers.inc
@@ -19,7 +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);
diff --git a/program/steps/mail/import.inc b/program/steps/mail/import.inc
index f7e7a3eb8..69124f71a 100644
--- a/program/steps/mail/import.inc
+++ b/program/steps/mail/import.inc
@@ -31,7 +31,7 @@ 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;
@@ -74,7 +74,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 +83,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,9 +94,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/list.inc b/program/steps/mail/list.inc
index a2380131a..91c53e852 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);
@@ -104,11 +104,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');
diff --git a/program/steps/mail/list_contacts.inc b/program/steps/mail/list_contacts.inc
index dab146431..46f81353a 100644
--- a/program/steps/mail/list_contacts.inc
+++ b/program/steps/mail/list_contacts.inc
@@ -65,7 +65,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,7 +73,7 @@ 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)
@@ -89,7 +89,7 @@ else {
$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');
+ 'contactgroup' => html::span(array('title' => $email), rcube::Q($group['name']))), 'group');
}
}
// make virtual groups clickable to list their members
@@ -99,9 +99,9 @@ else {
'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;'))),
+ 'title' => $RCMAIL->gettext('listgroup'),
+ 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)", rcmail_output::JS_OBJECT_NAME, $source, $group['ID']),
+ ), rcube::Q($group['name']) . '&nbsp;' . html::span('action', '&raquo;'))),
'group',
array('ID' => $group['ID'], 'name' => $group['name'], 'virtual' => true));
}
@@ -110,7 +110,7 @@ else {
$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');
+ 'contactgroup' => rcube::Q($group['name'] . ' (' . intval($result->count) . ')')), 'group');
}
}
@@ -134,14 +134,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..b081bc9b0 100644
--- a/program/steps/mail/mark.inc
+++ b/program/steps/mail/mark.inc
@@ -32,7 +32,7 @@ $a_flags_map = array(
$threading = (bool) $RCMAIL->storage->get_threading();
-if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_value('_flag', RCUBE_INPUT_POST)))
+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);
@@ -49,7 +49,7 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
// send error message
if ($_POST['_from'] != 'show')
$OUTPUT->command('list_mailbox');
- rcmail_display_server_error('errormarking');
+ $RCMAIL->display_server_error('errormarking');
$OUTPUT->send();
exit;
}
@@ -58,7 +58,7 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
}
if ($flag == 'DELETED' && $CONFIG['read_when_deleted'] && !empty($_POST['_ruid'])) {
- $ruids = get_input_value('_ruid', RCUBE_INPUT_POST);
+ $ruids = rcube_utils::get_input_value('_ruid', rcube_utils::INPUT_POST);
$read = $RCMAIL->storage->set_flag($ruids, 'SEEN');
if ($read && !$CONFIG['skip_deleted'])
@@ -70,12 +70,12 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
}
else if ($flag == 'DELETED' && $CONFIG['skip_deleted']) {
if ($_POST['_from'] == 'show') {
- if ($next = get_input_value('_next_uid', RCUBE_INPUT_GPC))
+ 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 = 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();
@@ -113,7 +113,7 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
$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)
diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc
index f15cd2460..587373997 100644
--- a/program/steps/mail/move_del.inc
+++ b/program/steps/mail/move_del.inc
@@ -30,9 +30,9 @@ $old_pages = ceil($old_count / $RCMAIL->storage->get_pagesize());
// 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);
+ $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);
$trash = $RCMAIL->config->get('trash_mbox');
$moved = $RCMAIL->storage->move_message($uids, $target, $mbox);
@@ -41,7 +41,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 +53,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 +62,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,7 +79,7 @@ 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()) {
@@ -88,7 +88,7 @@ if ($search_request && $RCMAIL->storage->get_search_set()) {
if ($_POST['_from'] == 'show')
{
- if ($next = get_input_value('_next_uid', RCUBE_INPUT_GPC))
+ if ($next = rcube_utils::get_input_value('_next_uid', rcube_utils::INPUT_GPC))
$OUTPUT->command('show_message', $next);
else
$OUTPUT->command('command', 'list');
@@ -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)
diff --git a/program/steps/mail/pagenav.inc b/program/steps/mail/pagenav.inc
index e4b70ad60..59c131f69 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();
@@ -48,7 +48,7 @@ if ($last)
$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)
)));
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index fb1b48797..210bedbb8 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -24,13 +24,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);
@@ -131,10 +131,17 @@ 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')));
+
+ // 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');
diff --git a/program/steps/mail/search_contacts.inc b/program/steps/mail/search_contacts.inc
index 6a30ad1f5..4d5abf9ef 100644
--- a/program/steps/mail/search_contacts.inc
+++ b/program/steps/mail/search_contacts.inc
@@ -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');
@@ -76,11 +76,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');
}
}
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index fe966a4d4..9f79df343 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -26,13 +26,13 @@ $OUTPUT->framed = TRUE;
$savedraft = !empty($_POST['_draft']) ? true : false;
-$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',
+ rcube::raise_error(array('code' => 500, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Invalid compose ID"), true, false);
@@ -78,9 +78,9 @@ function rcmail_get_identity($id)
if ($sql_arr = $RCMAIL->user->get_identity($id)) {
$out = $sql_arr;
- if ($message_charset != RCMAIL_CHARSET) {
+ if ($message_charset != RCUBE_CHARSET) {
foreach ($out as $k => $v)
- $out[$k] = rcube_charset_convert($v, RCMAIL_CHARSET, $message_charset);
+ $out[$k] = rcube_charset::convert($v, RCUBE_CHARSET, $message_charset);
}
$out['mailto'] = $sql_arr['email'];
@@ -212,17 +212,17 @@ function rcmail_email_input_format($mailto, $count=false, $check=true)
$mailto = trim(preg_replace($regexp, $replace, $mailto));
$result = array();
- $items = rcube_explode_quoted_string($delim, $mailto);
+ $items = rcube_utils::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, '<>'));
+ $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_idn_to_ascii($item);
+ $item = rcube_utils::idn_to_ascii($item);
$result[] = $item;
// address with name (handle name)
} else if (preg_match('/<*'.$email_regexp.'>*$/', $item, $matches)) {
@@ -232,7 +232,7 @@ function rcmail_email_input_format($mailto, $count=false, $check=true)
$name = substr($name, 1, -1);
}
$name = stripcslashes($name);
- $address = rcube_idn_to_ascii(trim($address, '<>'));
+ $address = rcube_utils::idn_to_ascii(trim($address, '<>'));
$result[] = format_email_recipient($address, $name);
$item = $address;
} else if (trim($item)) {
@@ -241,7 +241,7 @@ function rcmail_email_input_format($mailto, $count=false, $check=true)
// check address format
$item = trim($item, '<>');
- if ($item && $check && !check_email($item)) {
+ if ($item && $check && !rcube_utils::check_email($item)) {
$EMAIL_FORMAT_ERROR = $item;
return;
}
@@ -285,9 +285,9 @@ function rcmail_generic_message_footer($isHtml)
/****** compose message ********/
if (strlen($_POST['_draft_saveid']) > 3)
- $olddraftmessageid = get_input_value('_draft_saveid', RCUBE_INPUT_POST);
+ $olddraftmessageid = rcube_utils::get_input_value('_draft_saveid', rcube_utils::INPUT_POST);
-$message_id = rcmail_gen_message_id();
+$message_id = $RCMAIL->gen_message_id();
// set default charset
$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $OUTPUT->get_charset();
@@ -295,9 +295,9 @@ $message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $OUTPUT->get
$EMAIL_FORMAT_ERROR = NULL;
$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));
@@ -312,7 +312,7 @@ 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))) {
@@ -345,9 +345,10 @@ 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'];
- $hostname = gethostbyaddr($host);
+ if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+ $hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'], 2);
+ $hostname = gethostbyaddr($hosts[0]);
+
if ($CONFIG['http_received_header_encrypt']) {
$http_header .= rcmail_encrypt_header($hostname);
if ($host != $hostname)
@@ -380,8 +381,8 @@ if ($CONFIG['http_received_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
@@ -400,19 +401,19 @@ if (($max_recipients = (int) $RCMAIL->config->get('max_recipients')) > 0) {
}
// 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'];
}
if (!empty($_POST['_replyto'])) {
- $headers['Reply-To'] = rcmail_email_input_format(get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset));
+ $headers['Reply-To'] = rcmail_email_input_format(rcube_utils::get_input_value('_replyto', rcube_utils::INPUT_POST, TRUE, $message_charset));
}
if (!empty($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));
+ $headers['Mail-Followup-To'] = rcmail_email_input_format(rcube_utils::get_input_value('_followupto', rcube_utils::INPUT_POST, TRUE, $message_charset));
}
// remember reply/forward UIDs in special headers
@@ -467,10 +468,10 @@ 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();
@@ -504,7 +505,7 @@ if (!$savedraft) {
&& 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));
+ $spellchecker = new rcube_spellchecker(rcube_utils::get_input_value('_lang', rcube_utils::INPUT_GPC));
$spell_result = $spellchecker->check($message_body, $isHtml);
$COMPOSE['spell_checked'] = true;
@@ -519,7 +520,7 @@ if (!$savedraft) {
// generic footer for all messages
if ($footer = rcmail_generic_message_footer($isHtml)) {
- $footer = rcube_charset_convert($footer, RCMAIL_CHARSET, $message_charset);
+ $footer = rcube_charset::convert($footer, RCUBE_CHARSET, $message_charset);
$message_body .= "\r\n" . $footer;
}
}
@@ -529,7 +530,7 @@ if ($isHtml) {
}
// sort attachments to make sure the order is the same as in the UI (#1488423)
-$files = get_input_value('_attachments', RCUBE_INPUT_POST);
+$files = rcube_utils::get_input_value('_attachments', rcube_utils::INPUT_POST);
if ($files) {
$files = explode(',', $files);
$files = array_flip($files);
@@ -575,11 +576,11 @@ if ($isHtml) {
$MAIL_MIME->setHTMLBody($plugin['body']);
// replace emoticons
- $plugin['body'] = rcmail_replace_emoticons($plugin['body']);
+ $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 = 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)
@@ -607,7 +608,7 @@ else {
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);
+ $message_body = rcube_mime::wordwrap($message_body, $LINE_LENGTH, "\r\n", false, $message_charset);
$message_body = wordwrap($message_body, 998, "\r\n", true);
@@ -662,7 +663,7 @@ if (is_array($COMPOSE['attachments'])) {
'', '', '',
$CONFIG['mime_param_folding'] ? 'quoted-printable' : NULL,
$CONFIG['mime_param_folding'] == 2 ? 'quoted-printable' : NULL,
- '', RCMAIL_CHARSET
+ '', RCUBE_CHARSET
);
}
}
@@ -699,7 +700,7 @@ 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(RCUBE_CHARSET);
}
// pass headers to message object
@@ -719,7 +720,7 @@ if (!$savedraft)
$smtp_opts['dsn'] = true;
}
- $sent = rcmail_deliver_message($MAIL_MIME, $from, $mailto,
+ $sent = $RCMAIL->deliver_message($MAIL_MIME, $from, $mailto,
$smtp_error, $mailbody_file, $smtp_opts);
// return to compose page if sending failed
@@ -753,7 +754,7 @@ if (!$savedraft)
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'];
+ $store_target = isset($_POST['_store_target']) ? rcube_utils::get_input_value('_store_target', rcube_utils::INPUT_POST) : $CONFIG['sent_mbox'];
if ($store_target) {
// check if folder is subscribed
@@ -787,7 +788,7 @@ if ($store_target) {
}
if (PEAR::isError($msg))
- raise_error(array('code' => 650, 'type' => 'php',
+ rcube::raise_error(array('code' => 650, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Could not create message: ".$msg->getMessage()),
TRUE, FALSE);
@@ -804,7 +805,7 @@ if ($store_target) {
// raise error if saving failed
if (!$saved) {
- raise_error(array('code' => 800, 'type' => 'imap',
+ rcube::raise_error(array('code' => 800, 'type' => 'imap',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Could not save message in $store_target"), TRUE, FALSE);
@@ -827,7 +828,7 @@ if ($store_target) {
// raise error if deletion of old draft failed
if (!$deleted)
- raise_error(array('code' => 800, 'type' => 'imap',
+ rcube::raise_error(array('code' => 800, 'type' => 'imap',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Could not delete message from ".$CONFIG['drafts_mbox']), TRUE, FALSE);
}
@@ -870,13 +871,13 @@ else {
$OUTPUT->command('remove_compose_data', $COMPOSE_ID);
if ($store_folder && !$saved)
- $OUTPUT->command('sent_successfully', 'error', rcube_label('errorsavingsent'), $folders);
+ $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);
}
}
diff --git a/program/steps/mail/sendmdn.inc b/program/steps/mail/sendmdn.inc
index 01d0807be..7cc152a2b 100644
--- a/program/steps/mail/sendmdn.inc
+++ b/program/steps/mail/sendmdn.inc
@@ -24,7 +24,7 @@ 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
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 9d85f9c8f..6382e49fe 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -22,7 +22,7 @@
$PRINT_MODE = $RCMAIL->action == 'print' ? TRUE : FALSE;
// Read browser capabilities and store them in session
-if ($caps = get_input_value('_caps', RCUBE_INPUT_GET)) {
+if ($caps = rcube_utils::get_input_value('_caps', rcube_utils::INPUT_GET)) {
$browser_caps = array();
foreach (explode(',', $caps) as $cap) {
$cap = explode('=', $cap);
@@ -31,7 +31,7 @@ if ($caps = get_input_value('_caps', RCUBE_INPUT_GET)) {
$_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
@@ -68,7 +68,7 @@ if ($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('permaurl', $RCMAIL->url(array('_action' => 'show', '_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));
@@ -172,7 +172,7 @@ function rcmail_message_attachments($attrib)
if ($PRINT_MODE) {
$size = $RCMAIL->message_part_size($attach_prop);
- $ol .= html::tag('li', null, Q(sprintf("%s (%s)", $filename, $size)));
+ $ol .= html::tag('li', null, rcube::Q(sprintf("%s (%s)", $filename, $size)));
}
else {
if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
@@ -184,15 +184,15 @@ function rcmail_message_attachments($attrib)
}
$mimetype = rcmail_fix_mimetype($attach_prop->mimetype);
- $class = rcmail_filetype2classname($mimetype, $filename);
+ $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)',
- JS_OBJECT_NAME, $attach_prop->mime_id),
+ rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id),
'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
- 'title' => Q($title),
- ), Q($filename));
+ 'title' => rcube::Q($title),
+ ), rcube::Q($filename));
$ol .= html::tag('li', array('class' => $class, 'id' => $id), $link);
$attachments[$attach_prop->mime_id] = $mimetype;
@@ -214,13 +214,13 @@ function rcmail_remote_objects_msg()
$attrib['class'] = 'notice';
$attrib['style'] = 'display: none';
- $msg = Q(rcube_label('blockedimages')) . '&nbsp;';
- $msg .= html::a(array('href' => "#loadimages", 'onclick' => JS_OBJECT_NAME.".command('load-images')"), Q(rcube_label('showimages')));
+ $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' => JS_OBJECT_NAME.".command('always-load')", 'style' => "white-space:nowrap"),
- Q(rcube_label(array('name' => 'alwaysshow', 'vars' => array('sender' => $MESSAGE->sender['mailto'])))));
+ $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'])))));
}
$RCMAIL->output->add_gui_object('remoteobjectsmsg', $attrib['id']);
@@ -243,8 +243,8 @@ function rcmail_message_buttons()
$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);
}
diff --git a/program/steps/mail/viewsource.inc b/program/steps/mail/viewsource.inc
index c560d7d41..719239344 100644
--- a/program/steps/mail/viewsource.inc
+++ b/program/steps/mail/viewsource.inc
@@ -22,7 +22,7 @@
ob_end_clean();
// similar code as in program/steps/mail/get.inc
-if ($uid = get_input_value('_uid', RCUBE_INPUT_GET))
+if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET))
{
$headers = $RCMAIL->storage->get_message_headers($uid);
$charset = $headers->charset ? $headers->charset : $CONFIG['default_charset'];
@@ -48,7 +48,7 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET))
}
else
{
- raise_error(array(
+ rcube::raise_error(array(
'code' => 500,
'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
diff --git a/program/steps/settings/about.inc b/program/steps/settings/about.inc
index 0fdefddda..eae4da842 100644
--- a/program/steps/settings/about.inc
+++ b/program/steps/settings/about.inc
@@ -28,7 +28,7 @@ function rcmail_supportlink($attrib)
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));
}
}
@@ -66,10 +66,10 @@ function rcmail_plugins_list($attrib)
$table = new html_table($attrib);
// 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'));
+ $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'];
@@ -78,19 +78,19 @@ function rcmail_plugins_list($attrib)
}
$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'))) : '');
+ $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();
}
-$OUTPUT->set_pagetitle(rcube_label('about'));
+$OUTPUT->set_pagetitle($RCMAIL->gettext('about'));
$OUTPUT->add_handler('supportlink', 'rcmail_supportlink');
$OUTPUT->add_handler('pluginlist', 'rcmail_plugins_list');
diff --git a/program/steps/settings/delete_identity.inc b/program/steps/settings/delete_identity.inc
index d5146db66..85d128c8f 100644
--- a/program/steps/settings/delete_identity.inc
+++ b/program/steps/settings/delete_identity.inc
@@ -19,19 +19,19 @@
+-----------------------------------------------------------------------+
*/
-$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)) {
+if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(rcube_utils::INPUT_GPC)) {
$OUTPUT->show_message('invalidrequest', 'error');
- rcmail_overwrite_action('identities');
+ $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 ($deleted > 0 && $deleted !== false)
@@ -48,4 +48,4 @@ 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 7f2a10ebc..ff28d04c8 100644
--- a/program/steps/settings/edit_folder.inc
+++ b/program/steps/settings/edit_folder.inc
@@ -19,7 +19,7 @@
+-----------------------------------------------------------------------+
*/
-// WARNING: folder names in UI are encoded with RCMAIL_CHARSET
+// WARNING: folder names in UI are encoded with RCUBE_CHARSET
function rcmail_folder_form($attrib)
{
@@ -28,12 +28,12 @@ function rcmail_folder_form($attrib)
$storage = $RCMAIL->get_storage();
// edited folder name (empty in create-folder mode)
- $mbox = 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 = 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 +46,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 +73,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 +121,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 +132,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 +157,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 +196,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 +207,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 +217,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 +229,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 +256,7 @@ 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";
+ $content .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($fieldset['name'])) . $subcontent) ."\n";
}
}
}
@@ -265,7 +265,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 +287,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);
@@ -302,7 +302,7 @@ function rcmail_get_form_part($form, $attrib = array())
}
-//$OUTPUT->set_pagetitle(rcube_label('folders'));
+//$OUTPUT->set_pagetitle($RCMAIL->gettext('folders'));
// register UI objects
$OUTPUT->add_handlers(array(
diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc
index edd4ba60d..974acb42a 100644
--- a/program/steps/settings/edit_identity.inc
+++ b/program/steps/settings/edit_identity.inc
@@ -23,14 +23,14 @@ 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));
+ $IDENTITY_RECORD = $RCMAIL->user->get_identity(rcube_utils::get_input_value('_iid', rcube_utils::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');
+ $RCMAIL->overwrite_action('identities');
return;
}
}
@@ -39,7 +39,7 @@ else {
if (IDENTITIES_LEVEL > 1) {
$OUTPUT->show_message('opnotpermitted', 'error');
// go to identities page
- rcmail_overwrite_action('identities');
+ $RCMAIL->overwrite_action('identities');
return;
}
else if (IDENTITIES_LEVEL == 1) {
@@ -53,7 +53,7 @@ function rcube_identity_form($attrib)
global $IDENTITY_RECORD, $RCMAIL, $OUTPUT;
// Add HTML editor script(s)
- rcube_html_editor('identity');
+ $RCMAIL->html_editor('identity');
// add some labels to client
$OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting', 'editorwarning');
@@ -65,21 +65,21 @@ function rcube_identity_form($attrib)
// list of available cols
$form = array(
'addressing' => array(
- 'name' => rcube_label('settings'),
+ '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' => rcube_label('setdefault')),
+ 'standard' => array('type' => 'checkbox', 'label' => $RCMAIL->gettext('setdefault')),
)),
'signature' => array(
- 'name' => rcube_label('signature'),
+ 'name' => $RCMAIL->gettext('signature'),
'content' => array(
'signature' => array('type' => 'textarea', 'size' => $t_cols, 'rows' => $t_rows,
'spellcheck' => true),
- 'html_signature' => array('type' => 'checkbox', 'label' => rcube_label('htmlsignature'),
+ 'html_signature' => array('type' => 'checkbox', 'label' => $RCMAIL->gettext('htmlsignature'),
'onclick' => 'return rcmail_toggle_editor(this, \'rcmfd_signature\');'),
))
);
@@ -90,7 +90,7 @@ function rcube_identity_form($attrib)
$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);
+ $IDENTITY_RECORD['signature'] = htmlspecialchars($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCUBE_CHARSET);
}
// disable some field according to access level
@@ -106,7 +106,7 @@ function rcube_identity_form($attrib)
}
}
- $IDENTITY_RECORD['email'] = rcube_idn_to_utf8($IDENTITY_RECORD['email']);
+ $IDENTITY_RECORD['email'] = rcube_utils::idn_to_utf8($IDENTITY_RECORD['email']);
// Allow plugins to modify identity form content
$plugin = $RCMAIL->plugins->exec_hook('identity_form', array(
@@ -137,12 +137,12 @@ function rcube_identity_form($attrib)
$colprop['id'] = 'rcmfd_'.$col;
$label = !empty($colprop['label']) ? $colprop['label'] :
- rcube_label(str_replace('-', '', $col));
+ $RCMAIL->gettext(str_replace('-', '', $col));
$value = !empty($colprop['value']) ? $colprop['value'] :
- rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']);
+ rcube_output::get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']);
- $table->add('title', html::label($colprop['id'], Q($label)));
+ $table->add('title', html::label($colprop['id'], rcube::Q($label)));
$table->add(null, $value);
}
$content = $table->show($attrib);
@@ -151,7 +151,7 @@ function rcube_identity_form($attrib)
$content = $fieldset['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";
}
$out .= $form_end;
@@ -164,7 +164,7 @@ $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')));
+$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem')));
if ($RCMAIL->action=='add-identity' && $OUTPUT->template_exists('identityadd'))
$OUTPUT->send('identityadd');
diff --git a/program/steps/settings/edit_prefs.inc b/program/steps/settings/edit_prefs.inc
index adf6b1623..93e27aedc 100644
--- a/program/steps/settings/edit_prefs.inc
+++ b/program/steps/settings/edit_prefs.inc
@@ -20,10 +20,10 @@
*/
if (!$OUTPUT->ajax_call)
- $OUTPUT->set_pagetitle(rcube_label('preferences'));
+ $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);
function rcmail_user_prefs_form($attrib)
diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc
index 49856775a..371d7ecc4 100644
--- a/program/steps/settings/edit_response.inc
+++ b/program/steps/settings/edit_response.inc
@@ -22,7 +22,7 @@
$responses = $RCMAIL->get_compose_responses();
// edit-response
-if (($key = get_input_value('_key', RCUBE_INPUT_GPC))) {
+if (($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_GPC))) {
foreach ($responses as $i => $response) {
if ($response['key'] == $key) {
$RESPONSE_RECORD = $response;
@@ -34,8 +34,8 @@ if (($key = get_input_value('_key', RCUBE_INPUT_GPC))) {
// save response
if ($RCMAIL->action == 'save-response' && isset($_POST['_name']) && !$RESPONSE_RECORD['static']) {
- $name = trim(get_input_value('_name', RCUBE_INPUT_POST));
- $text = trim(get_input_value('_text', RCUBE_INPUT_POST));
+ $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST));
+ $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST));
if (!empty($name) && !empty($text)) {
$dupes = 0;
@@ -85,12 +85,12 @@ function rcube_response_form($attrib)
$out = "$form_start\n";
$table = new html_table(array('cols' => 2));
- $label = rcube_label('responsename');
+ $label = $RCMAIL->gettext('responsename');
- $table->add('title', html::label('ffname', Q(rcube_label('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', Q(rcube_label('responsetext'))));
+ $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);
@@ -101,7 +101,7 @@ function rcube_response_form($attrib)
$OUTPUT->set_env('readonly', !empty($RESPONSE_RECORD['static']));
$OUTPUT->add_handler('responseform', 'rcube_response_form');
-$OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-response' ? 'savenewresponse' : 'editresponse')));
+$OUTPUT->set_pagetitle($RCMAIL->gettext($RCMAIL->action == 'add-response' ? 'savenewresponse' : 'editresponse'));
$OUTPUT->send('responseedit');
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index 44482e938..118590318 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -20,7 +20,7 @@
+-----------------------------------------------------------------------+
*/
-// 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();
@@ -28,7 +28,7 @@ $STORAGE = $RCMAIL->get_storage();
// subscribe mailbox
if ($RCMAIL->action == 'subscribe')
{
- $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP');
+ $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,28 @@ 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');
+ $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');
+ $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 +98,22 @@ 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 = get_input_value('_folder_oldname', RCUBE_INPUT_POST, true);
+ $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,15 +122,15 @@ 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');
+ $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_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/';
@@ -151,7 +151,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,24 +160,24 @@ 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 = get_input_value('_mbox', RCUBE_INPUT_POST, true);
+ $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();
}
}
@@ -200,7 +200,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 +225,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 +234,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 +270,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 +283,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';
@@ -418,7 +418,7 @@ function rcmail_rename_folder($oldname, $newname)
}
-$OUTPUT->set_pagetitle(rcube_label('folders'));
+$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')) {
@@ -432,9 +432,8 @@ $OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting'
// register UI objects
$OUTPUT->add_handlers(array(
'foldersubscription' => 'rcube_subscription_form',
- 'folderframe' => 'rcmail_folder_frame',
- 'quotadisplay' => 'rcmail_quota_display',
+ 'folderframe' => 'rcmail_folder_frame',
+ 'quotadisplay' => array($RCMAIL, 'quota_display'),
));
$OUTPUT->send('folders');
-
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 81744d904..c504e6c40 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -20,7 +20,7 @@
*/
if (!$OUTPUT->ajax_call) {
- $OUTPUT->set_pagetitle(rcube_label('preferences'));
+ $OUTPUT->set_pagetitle($RCMAIL->gettext('preferences'));
}
// similar function as /steps/settings/identities.inc::rcmail_identity_frame()
@@ -48,7 +48,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 +70,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 +81,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 +127,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 +155,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 +175,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 +188,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 +210,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 +232,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 +253,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 +268,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 +281,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 +318,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 +344,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 +352,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 +366,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 +382,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 +400,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 +421,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 +444,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 +466,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 +480,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 +489,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 +503,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 +518,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 +534,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 +547,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 +562,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 +581,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 +596,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 +605,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 +621,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 +634,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 +653,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 +673,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 +692,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 +706,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 +720,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 +734,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 +747,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 +766,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 +782,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 +797,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 +817,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 +830,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,13 +858,13 @@ 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))
);
@@ -878,11 +878,11 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_reply_all_mode';
$select = new html_select(array('name' => '_reply_all_mode', 'id' => $field_id));
- $select->add(rcube_label('replyalldefault'), 0);
- $select->add(rcube_label('replyalllist'), 1);
+ $select->add($RCMAIL->gettext('replyalldefault'), 0);
+ $select->add($RCMAIL->gettext('replyalllist'), 1);
$blocks['main']['options']['reply_all_mode'] = array(
- 'title' => html::label($field_id, Q(rcube_label('replyallmode'))),
+ 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('replyallmode'))),
'content' => $select->show(intval($config['reply_all_mode'])),
);
}
@@ -892,8 +892,8 @@ function rcmail_user_prefs($current = null)
// 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'])
@@ -911,7 +911,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']),
);
}
@@ -925,13 +925,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']),
);
}
@@ -945,12 +945,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']),
);
}
@@ -966,7 +966,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),
);
}
@@ -980,7 +980,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),
);
}
@@ -989,8 +989,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'])) {
@@ -1002,14 +1002,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,
@@ -1027,7 +1027,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)),
);
}
@@ -1038,7 +1038,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' => '')),
);
}
@@ -1049,7 +1049,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)),
);
}
@@ -1060,7 +1060,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)),
);
}
@@ -1069,9 +1069,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'])) {
@@ -1083,7 +1083,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),
);
}
@@ -1097,7 +1097,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),
);
}
@@ -1112,7 +1112,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),
);
}
@@ -1126,7 +1126,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),
);
}
@@ -1140,7 +1140,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),
);
}
@@ -1155,7 +1155,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),
);
}
@@ -1170,7 +1170,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),
);
}
@@ -1265,19 +1265,19 @@ 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)
$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'),
+ $OUTPUT->command('replace_folder_row', rcube_charset::convert($oldname, 'UTF7-IMAP'),
$name_utf8, $display_name, $protected, $class_name);
}
diff --git a/program/steps/settings/identities.inc b/program/steps/settings/identities.inc
index 82a1841a3..7072acf72 100644
--- a/program/steps/settings/identities.inc
+++ b/program/steps/settings/identities.inc
@@ -21,7 +21,7 @@
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');
diff --git a/program/steps/settings/responses.inc b/program/steps/settings/responses.inc
index cfc4148c3..45d1405f7 100644
--- a/program/steps/settings/responses.inc
+++ b/program/steps/settings/responses.inc
@@ -21,8 +21,8 @@
if (!empty($_POST['_insert'])) {
- $name = trim(get_input_value('_name', RCUBE_INPUT_POST));
- $text = trim(get_input_value('_text', RCUBE_INPUT_POST));
+ $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST));
+ $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST));
if (!empty($name) && !empty($text)) {
$dupes = 0;
@@ -40,10 +40,10 @@ if (!empty($_POST['_insert'])) {
if ($RCMAIL->user->save_prefs(array('compose_responses' => $responses))) {
$RCMAIL->output->command('add_response_item', $response);
- $RCMAIL->output->command('display_message', rcube_label('successfullysaved'), 'confirmation');
+ $RCMAIL->output->command('display_message', $RCMAIL->gettext('successfullysaved'), 'confirmation');
}
else {
- $RCMAIL->output->command('display_message', rcube_label('errorsaving'), 'error');
+ $RCMAIL->output->command('display_message', $RCMAIL->gettext('errorsaving'), 'error');
}
}
@@ -53,7 +53,7 @@ if (!empty($_POST['_insert'])) {
if ($RCMAIL->action == 'delete-response') {
- if ($key = get_input_value('_key', RCUBE_INPUT_GPC)) {
+ 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']))
@@ -67,7 +67,7 @@ if ($RCMAIL->action == 'delete-response') {
}
if ($deleted) {
- $RCMAIL->output->command('display_message', rcube_label('deletedsuccessfully'), 'confirmation');
+ $RCMAIL->output->command('display_message', $RCMAIL->gettext('deletedsuccessfully'), 'confirmation');
$RCMAIL->output->command('remove_response', $key);
}
@@ -77,7 +77,7 @@ if ($RCMAIL->action == 'delete-response') {
}
-$OUTPUT->set_pagetitle(rcube_label('responses'));
+$OUTPUT->set_pagetitle($RCMAIL->gettext('responses'));
$OUTPUT->include_script('list.js');
@@ -95,7 +95,7 @@ function rcmail_responses_list($attrib)
'cols' => array('name')
));
- $out = rcube_table_output($attrib, $plugin['list'], $plugin['cols'], 'key');
+ $out = $RCMAIL->table_output($attrib, $plugin['list'], $plugin['cols'], 'key');
// set client env
$OUTPUT->add_gui_object('responseslist', $attrib['id']);
diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc
index efb096d57..f876ff8e0 100644
--- a/program/steps/settings/save_folder.inc
+++ b/program/steps/settings/save_folder.inc
@@ -19,18 +19,18 @@
+-----------------------------------------------------------------------+
*/
-// 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(get_input_value('_name', RCUBE_INPUT_POST, true));
-$old = get_input_value('_mbox', RCUBE_INPUT_POST, true);
-$path = get_input_value('_parent', RCUBE_INPUT_POST, true);
+$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_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 +40,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 +76,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,9 +90,9 @@ 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),
);
}
@@ -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..5bd04003d 100644
--- a/program/steps/settings/save_identity.inc
+++ b/program/steps/settings/save_identity.inc
@@ -28,7 +28,7 @@ $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');
+ $RCMAIL->overwrite_action('edit-identity');
return;
}
@@ -36,7 +36,7 @@ $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);
+ $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
@@ -61,17 +61,17 @@ else if (IDENTITIES_LEVEL == 4) {
}
// 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']);
+ $email_checks[] = rcube_utils::idn_to_ascii($rcpt['mailto']);
}
foreach ($email_checks as $email) {
- if ($email && !check_email($email)) {
+ if ($email && !rcube_utils::check_email($email)) {
// show error message
- $OUTPUT->show_message('emailformaterror', 'error', array('email' => rcube_idn_to_utf8($email)), false);
- rcmail_overwrite_action('edit-identity');
+ $OUTPUT->show_message('emailformaterror', 'error', array('email' => rcube_utils::idn_to_utf8($email)), false);
+ $RCMAIL->overwrite_action('edit-identity');
return;
}
}
@@ -87,7 +87,7 @@ if (!empty($save_data['signature']) && !empty($save_data['html_signature'])) {
// update an existing contact
if ($_POST['_iid']) {
- $iid = get_input_value('_iid', RCUBE_INPUT_POST);
+ $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
@@ -100,7 +100,7 @@ if ($_POST['_iid']) {
$save_data = $plugin['record'];
if ($save_data['email'])
- $save_data['email'] = rcube_idn_to_ascii($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
@@ -114,13 +114,13 @@ if ($_POST['_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']) .'>')));
+ $OUTPUT->command('parent.update_identity_row', $iid, rcube::Q(trim($save_data['name'] . ' <' . rcube_utils::idn_to_utf8($save_data['email']) .'>')));
}
}
else {
// show error message
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
- rcmail_overwrite_action('edit-identity');
+ $RCMAIL->overwrite_action('edit-identity');
return;
}
}
@@ -135,7 +135,7 @@ else if (IDENTITIES_LEVEL < 2) {
$save_data = $plugin['record'];
if ($save_data['email'])
- $save_data['email'] = rcube_idn_to_ascii($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;
@@ -152,13 +152,13 @@ else if (IDENTITIES_LEVEL < 2) {
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);
+ $OUTPUT->command('parent.update_identity_row', $insert_id, rcube::Q(trim($save_data['name'] . ' <' . rcube_utils::idn_to_utf8($save_data['email']) .'>')), true);
}
}
else {
// show error message
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
- rcmail_overwrite_action('edit-identity');
+ $RCMAIL->overwrite_action('edit-identity');
return;
}
}
@@ -172,10 +172,10 @@ if ($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');
+ $RCMAIL->overwrite_action('identities');
/**
@@ -185,14 +185,14 @@ 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,
+ 'charset' => RCUBE_CHARSET,
'html_elements' => array('body', 'link'),
'html_attribs' => array('rel', 'type'),
);
@@ -204,7 +204,7 @@ 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);
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index bcd05bb85..325c66ae8 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -19,7 +19,7 @@
+-----------------------------------------------------------------------+
*/
-$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();
@@ -28,14 +28,14 @@ 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'),
+ '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']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'],
+ 'skin' => isset($_POST['_skin']) ? rcube_utils::get_input_value('_skin', rcube_utils::INPUT_POST) : $CONFIG['skin'],
);
// compose derived date/time format strings
@@ -66,7 +66,7 @@ switch ($CURR_SECTION)
'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),
+ 'default_charset' => rcube_utils::get_input_value('_default_charset', rcube_utils::INPUT_POST),
);
break;
@@ -88,8 +88,8 @@ switch ($CURR_SECTION)
'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),
+ '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']),
);
@@ -98,10 +98,10 @@ switch ($CURR_SECTION)
case 'addressbook':
$a_user_prefs = array(
- 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true),
+ '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' => get_input_value('_addressbook_sort_col', RCUBE_INPUT_POST),
- 'addressbook_name_listing' => intval(get_input_value('_addressbook_name_listing', RCUBE_INPUT_POST)),
+ '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'],
);
@@ -124,10 +124,10 @@ switch ($CURR_SECTION)
$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),
+ '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;
@@ -221,5 +221,4 @@ else
$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/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 7c30be71b..183c398d3 100644
--- a/program/steps/utils/save_pref.inc
+++ b/program/steps/utils/save_pref.inc
@@ -19,9 +19,9 @@
+-----------------------------------------------------------------------+
*/
-$name = get_input_value('_name', RCUBE_INPUT_POST);
-$value = get_input_value('_value', RCUBE_INPUT_POST);
-$sessname = get_input_value('_session', 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
@@ -39,7 +39,7 @@ $whitelist = array_merge($whitelist, $RCMAIL->plugins->allowed_prefs);
$whitelist_sess = array_merge($whitelist_sess, $RCMAIL->plugins->allowed_session_prefs);
if (!in_array($name, $whitelist) || ($sessname && !in_array($sessname, $whitelist_sess))) {
- raise_error(array('code' => 500, 'type' => 'php',
+ 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);
diff --git a/program/steps/utils/spell.inc b/program/steps/utils/spell.inc
index 595cfd6f2..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);
@@ -56,6 +56,6 @@ if ($err = $spellchecker->error()) {
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;
diff --git a/skins/classic/common.css b/skins/classic/common.css
index 186be2485..10bc91c09 100644
--- a/skins/classic/common.css
+++ b/skins/classic/common.css
@@ -965,6 +965,57 @@ ul.toolbarmenu li.separator_above
}
+/*** folder selector ***/
+
+#folder-selector li a
+{
+ padding: 0;
+}
+
+#folder-selector li a span
+{
+ background: url(images/icons/folders.png) no-repeat 6px 0;
+ display: block;
+ height: 15px;
+ min-height: 14px;
+ padding: 2px 4px 2px 28px;
+ overflow: hidden;
+ max-width: 120px;
+ text-overflow: ellipsis;
+}
+
+#folder-selector li a.virtual
+{
+ color: #A0A0A0;
+}
+
+#folder-selector li a.active:hover span
+{
+ color: white;
+}
+
+#folder-selector li a.inbox span
+{
+ background-position: 6px -18px;
+}
+#folder-selector li a.drafts span
+{
+ background-position: 6px -37px;
+}
+#folder-selector li a.sent span
+{
+ background-position: 6px -54px;
+}
+#folder-selector li a.trash span
+{
+ background-position: 6px -91px;
+}
+#folder-selector li a.junk span
+{
+ background-position: 6px -73px;
+}
+
+
/***** tabbed interface elements *****/
div.tabsbar,
diff --git a/skins/classic/functions.js b/skins/classic/functions.js
index 2b7886d38..4312d57bc 100644
--- a/skins/classic/functions.js
+++ b/skins/classic/functions.js
@@ -419,6 +419,7 @@ body_mouseup: function(evt, p)
&& !this.popups[i].toggle
&& (!this.popups[i].editable || !this.target_overlaps(target, this.popups[i].id))
&& (!this.popups[i].sticky || !rcube_mouse_is_over(evt, rcube_find_object(this.popups[i].id)))
+ && !$(target).is('.folder-selector-link') && !$(target).children('.folder-selector-link').length
) {
window.setTimeout('rcmail_ui.show_popup("'+i+'",false);', 50);
}
diff --git a/skins/classic/includes/messagetoolbar.html b/skins/classic/includes/messagetoolbar.html
index 8f8efd291..8d98c7e42 100644
--- a/skins/classic/includes/messagetoolbar.html
+++ b/skins/classic/includes/messagetoolbar.html
@@ -20,9 +20,6 @@
<roundcube:container name="toolbar" id="messagetoolbar" />
<roundcube:button name="markmenulink" id="markmenulink" type="link" class="button markmessage" title="markmessages" onclick="rcmail_ui.show_popup('markmenu');return false" content=" " />
<roundcube:button name="messagemenulink" id="messagemenulink" type="link" class="button messagemenu" title="moreactions" onclick="rcmail_ui.show_popup('messagemenu');return false" content=" " />
-<roundcube:if condition="template:name == 'message'" />
-<roundcube:object name="mailboxlist" type="select" noSelection="moveto" maxlength="25" onchange="rcmail.command('move', this.options[this.selectedIndex].value)" class="mboxlist" folder_filter="mail" />
-<roundcube:endif />
</div>
<div id="forwardmenu" class="popupmenu">
@@ -46,6 +43,8 @@
<li><roundcube:button class="printlink" command="print" label="printmessage" classAct="printlink active" /></li>
<li><roundcube:button class="downloadlink" command="download" label="emlsave" classAct="downloadlink active" /></li>
<li><roundcube:button class="editlink" command="edit" prop="new" label="editasnew" classAct="editlink active" /></li>
+ <li><roundcube:button class="movelink" command="move" label="moveto" classAct="copylink active" innerclass="folder-selector-link" /></li>
+ <li><roundcube:button class="copylink" command="copy" label="copyto" classAct="movelink active" innerclass="folder-selector-link" /></li>
<li class="separator_below"><roundcube:button class="sourcelink" command="viewsource" label="viewsource" classAct="sourcelink active" /></li>
<li><roundcube:button class="openlink" command="open" label="openinextwin" target="_blank" classAct="openlink active" /></li>
<roundcube:container name="messagemenu" id="messagemenu" />
diff --git a/skins/classic/mail.css b/skins/classic/mail.css
index e5d55e05c..bf07383c9 100644
--- a/skins/classic/mail.css
+++ b/skins/classic/mail.css
@@ -175,23 +175,6 @@
background-position: -512px 0;
}
-#messagetoolbar select.mboxlist
-{
- position: relative;
- margin: 0 8px;
- top: 7px;
-}
-
-#messagetoolbar select.mboxlist option
-{
- padding-left: 15px;
-}
-
-#messagetoolbar select.mboxlist option[value=""]
-{
- padding-left: 2px;
-}
-
#messagemenu li a.active:hover,
#attachmentmenu li a.active:hover,
#markmessagemenu li a.active:hover
@@ -412,36 +395,35 @@
display: block;
position: relative;
font-size: 11px;
- background: url(images/icons/folders.png) 5px 0 no-repeat;
border-bottom: 1px solid #EBEBEB;
}
#mailboxlist li ul li:last-child
{
- border-bottom: none;
+ border-bottom: 0 none;
}
-#mailboxlist li.inbox
+#mailboxlist li.inbox a
{
background-position: 5px -18px;
}
-#mailboxlist li.drafts
+#mailboxlist li.drafts a
{
background-position: 5px -37px;
}
-#mailboxlist li.sent
+#mailboxlist li.sent a
{
background-position: 5px -54px;
}
-#mailboxlist li.junk
+#mailboxlist li.junk a
{
background-position: 5px -73px;
}
-#mailboxlist li.trash
+#mailboxlist li.trash a
{
background-position: 5px -91px;
}
@@ -456,6 +438,7 @@
padding-bottom: 2px;
text-decoration: none;
height: 15px;
+ background: url(images/icons/folders.png) 5px 0 no-repeat;
}
#mailboxlist li.unread
@@ -497,13 +480,50 @@
padding: 0;
margin: 0;
border-top: 1px solid #EBEBEB;
- padding-left: 15px;
- background-position: 25px 1px;
background-color: #FFF;
- color: blue;
font-weight: normal;
}
+#mailboxlist li.mailbox ul li a {
+ padding-left: 40px; /* 24 + 1 x 16 */
+ background-position: 20px 0; /* 4 + 1 x 16 */
+}
+#mailboxlist li.mailbox ul li div.treetoggle {
+ left: 23px !important;
+}
+
+#mailboxlist li.mailbox ul ul li.mailbox a {
+ padding-left: 56px; /* 2x */
+ background-position: 36px 0;
+}
+#mailboxlist li.mailbox ul ul li div.treetoggle {
+ left: 39px !important;
+}
+
+#mailboxlist li.mailbox ul ul ul li.mailbox a {
+ padding-left: 72px; /* 3x */
+ background-position: 52px 0;
+}
+#mailboxlist li.mailbox ul ul ul li div.treetoggle {
+ left: 55px !important;
+}
+
+#mailboxlist li.mailbox ul ul ul ul li.mailbox a {
+ padding-left: 88px; /* 4x */
+ background-position: 68px 0;
+}
+#mailboxlist li.mailbox ul ul ul ul li div.treetoggle {
+ left: 71px !important;
+}
+
+/* indent folders on levels > 4 */
+#mailboxlist li.mailbox ul ul ul ul ul li {
+ padding-left: 16px;
+}
+#mailboxlist li.mailbox ul ul ul ul ul li div.treetoggle {
+ left: 87px !important;
+}
+
#listcontrols
{
position: relative;
diff --git a/skins/classic/templates/message.html b/skins/classic/templates/message.html
index bd4fbf277..3ab0a2e5e 100644
--- a/skins/classic/templates/message.html
+++ b/skins/classic/templates/message.html
@@ -30,11 +30,13 @@
<div id="mailboxlist-container">
<div id="mailboxlist-title" class="boxtitle"><roundcube:label name="mailboxlist" /></div>
<div class="boxlistcontent">
- <roundcube:object name="mailboxlist" id="mailboxlist" class="treelist" maxlength="25" />
+ <roundcube:object name="mailboxlist" id="mailboxlist" class="treelist" folder_filter="mail" />
</div>
<div class="boxfooter"></div>
</div>
</div>
+<roundcube:else />
+<roundcube:object name="mailboxlist" folder_filter="mail" type="js" />
<roundcube:endif />
<div id="messageframe">
diff --git a/skins/larry/images/listicons.png b/skins/larry/images/listicons.png
index 8a17cc5bd..49342a318 100644
--- a/skins/larry/images/listicons.png
+++ b/skins/larry/images/listicons.png
Binary files differ
diff --git a/skins/larry/includes/mailtoolbar.html b/skins/larry/includes/mailtoolbar.html
index 59f2d581a..5708a94f1 100644
--- a/skins/larry/includes/mailtoolbar.html
+++ b/skins/larry/includes/mailtoolbar.html
@@ -39,6 +39,8 @@
<li><roundcube:button command="download" label="emlsave" class="icon" classAct="icon active" innerclass="icon download" /></li>
<li><roundcube:button command="edit" prop="new" label="editasnew" class="icon" classAct="icon active" innerclass="icon edit" /></li>
<li><roundcube:button command="viewsource" label="viewsource" class="icon" classAct="icon active" innerclass="icon viewsource" /></li>
+ <li><roundcube:button command="move" label="moveto" class="icon" classAct="icon active" innerclass="icon move folder-selector-link" /></li>
+ <li><roundcube:button command="copy" label="copyto" class="icon" classAct="icon active" innerclass="icon copy folder-selector-link" /></li>
<li><roundcube:button command="open" label="openinextwin" target="_blank" class="icon" classAct="icon active" innerclass="icon extwin" /></li>
<roundcube:container name="messagemenu" id="messagemenu" />
</ul>
diff --git a/skins/larry/mail.css b/skins/larry/mail.css
index 8e1634ad7..d3b09c087 100644
--- a/skins/larry/mail.css
+++ b/skins/larry/mail.css
@@ -417,12 +417,6 @@ a.iconbutton.threadmode.selected {
right: 0;
}
-#messagetoolbar .toolbarselect {
- position: absolute;
- bottom: 6px;
- right: 3px;
-}
-
#messagesearchtools {
position: absolute;
right: 0;
diff --git a/skins/larry/styles.css b/skins/larry/styles.css
index 9c72e46a9..21d93c106 100644
--- a/skins/larry/styles.css
+++ b/skins/larry/styles.css
@@ -2019,6 +2019,7 @@ select.decorated option {
#quotadisplay {
left: 6px;
+ height: 18px;
font-size: 12px;
font-weight: bold;
text-shadow: 0px 1px 1px #fff;
@@ -2328,6 +2329,38 @@ ul.toolbarmenu li span.conversation {
z-index: 255;
}
+/*** folder selector ***/
+
+#folder-selector li a span {
+ background: url("images/listicons.png") 4px -2021px no-repeat;
+ display: block;
+ height: 17px;
+ min-height: 14px;
+ padding: 4px 4px 1px 28px;
+ overflow: hidden;
+ max-width: 120px;
+ text-overflow: ellipsis;
+}
+
+#folder-selector li a.virtual {
+ opacity: .2;
+}
+
+#folder-selector li a.inbox span {
+ background-position: 4px -2049px;
+}
+#folder-selector li a.drafts span {
+ background-position: 4px -1388px;
+}
+#folder-selector li a.sent span {
+ background-position: 4px -2074px;
+}
+#folder-selector li a.trash span {
+ background-position: 4px -1508px;
+}
+#folder-selector li a.junk span {
+ background-position: 4px -2100px;
+}
/*** attachment list ***/
diff --git a/skins/larry/templates/message.html b/skins/larry/templates/message.html
index e63705f76..df92b7511 100644
--- a/skins/larry/templates/message.html
+++ b/skins/larry/templates/message.html
@@ -16,9 +16,6 @@
<roundcube:button command="list" type="link" class="button back disabled" classAct="button back" classSel="button back pressed" label="back" />
<roundcube:endif />
<roundcube:include file="/includes/mailtoolbar.html" />
- <div class="toolbarselect">
- <roundcube:object name="mailboxlist" type="select" noSelection="moveto" maxlength="25" onchange="rcmail.command('move', this.options[this.selectedIndex].value)" class="mailboxlist decorated" folder_filter="mail" />
- </div>
</div>
<roundcube:if condition="!env:extwin" />
@@ -36,6 +33,7 @@
<div id="mailview-right" class="offset uibox">
<roundcube:else />
+<roundcube:object name="mailboxlist" folder_filter="mail" type="js" />
<div id="mailview-right" class="offset fullwidth uibox">
<roundcube:endif />
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index d203acf57..d66131075 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -369,8 +369,10 @@ function rcube_mail_ui()
function body_mouseup(e)
{
var config, obj, target = e.target;
+
if (target.className == 'inner')
target = e.target.parentNode;
+
for (var id in popups) {
obj = popups[id];
config = popupconfig[id];
@@ -379,9 +381,10 @@ function rcube_mail_ui()
&& !config.toggle
&& (!config.editable || !target_overlaps(target, obj.get(0)))
&& (!config.sticky || !rcube_mouse_is_over(e, obj.get(0)))
+ && !$(target).is('.folder-selector-link')
) {
var myid = id+'';
- window.setTimeout(function(){ show_popupmenu(myid, false) }, 10);
+ window.setTimeout(function() { show_popupmenu(myid, false); }, 10);
}
}
}