Page MenuHomePhorge

No OneTemporary

Size
484 KB
Referenced Files
None
Subscribers
None
This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/CHANGELOG b/CHANGELOG
index a38421722..ced9dba4a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,248 +1,261 @@
CHANGELOG RoundCube Webmail
---------------------------
+2006/06/26 (richs)
+----------
+- Added button to immediately check for new messages
+- New message checking now displays status "Checking for new messages..."
+- New message checking now looks for unread messages in all mailboxes (Feature #1326401)
+- Task buttons now respond to clicks by darkening (as in other applications)
+- Fixed "Sender" column changing to "Recipient" for "Sent" and "Drafts" message lists
+- Added ability to sort messages by "Size"
+- Added ability to rename folders (Feature #1326396)
+- Added 'protect_default_folders' option to main.inc.php to prevent renames/deletes/unsubscribes of default folders
+- Corrected 5 typos of "INSTLL" to "INSTALL" in program/include/main.inc
+
+
2006/06/25
----------
- Changed behavior to include host-specific configuration (Bug #1483849)
- Assume ISO-8859-1 encoding of mail messages by default (Patch #1483839)
- Fixed spell checker to work with the new URL at google.com
- Some memory and security optimizations sendmail.inc
- Updated UGRADING description
2006/06/19
----------
- Added Drafts support (Feature #1326839) (richs)
2006/06/02
----------
- Updated Estonian localization and moved from ee to et
- Added Bulgarian localization
2006/05/25
----------
- Finalized GoogieSpell integration
2006/05/18
----------
- Added Arabic and Armenian localizations
- Updated Russian localization
- Removed MDB2 classes from repository. Install them seperately if used.
- Updated MDB2 wrapper class contributed by Lukas Kahwe Smith
- Allow & in e-mail addresses
2006/05/05
----------
- Fixed typos in function rcube_button() (Bugs #1473198 and #1473201)
- Check for zlib.output_compression before using ob_gzhandler (Bug #1471069)
- Casting date parts in iil_StrToTime() to avoid warnings (Bug #1482140)
- Corrected INSTALL description (Bug #1476106)
- Added charset to javascript HTTP headers
- Fixed Opera bug with CC and BCC fields (Bug #1474576)
- Changed login page title regarding product name (Bug #1476413)
- Pimped search function
- Applied attachment viewing/forwarding patches by Andrew Fladmark
- Applied prev/next patch by Leonard Bouchet
- Applied patches by Mark Bucciarelli
- Applied patch for requesting receipts by Salvatore Ansani
- Integrated GoogieSpell as suggested by phil (styling is not perfect yet, localization is missing)
2006/04/13
----------
- Added Slovenian localization
- Updated Portuguese localization
- Fixed parent.location problem for compose-links
- Added sort order saving patch by Jacob Brunson
- Added gzip compression support
2006/04/02
----------
- Added Lithuanian localization
- Improved search function
- Added version string as template object
- Load host-specific configuration file (see config/main.inc.php)
- New config parameter adding domain to user names for login
- Strip tags on _auth, _action, _task parameters
- Corrected labels for next/previous page buttons in address book
2006/03/23
----------
- Auto-detect mail header delimiters
- Regard daylight savings
- Localized quota display
- Started implementing search function
2006/03/20
----------
- Avoid error message when saving an unchanged identity (Bug #1429510)
- Fixed hard-coded cols selection for sent folder (Bug #1354586)
- Enable some HTML links for use with "open in new window" or "save target"
- Check meta-key instead of ctrl on Macs
- Ignore double clicks when holding down a modifier key
- Fixed reloading of the login page
- Fixed typo in compose template (Bug #1446852)
- Added compose button to message read step (Request #1433288)
- New config parameter for persistent database connections (Bug #1431817)
2006/03/14
----------
- Don't remove internal HTML tags in plaintext messages
- Improved error handling in DB connection failure
2006/02/22
----------
- Updated localizations
- Fixed bug #1435989
2006/02/19
----------
- Updated localizations
- Applied patch of Anders Karlsson
- Applied patch of Jacob Brunson
- Applied patch for virtuser_query by Robin Elfrink
- Added support for References header (patch by Auke)
- Added support for mbstring module by Tadashi Jokagi
- Added function for automatic remove of slashes on GET and POST vars
if magic_quotes is enabled
2006/02/05
----------
- Added Slovak, Hungarian, Bosnian and Croation translation
- Fixed bug when inserting signatures with !?&
- Chopping message headers before inserting into the message cache table
(to avoid bugs in Postgres)
- Allow one-char domains in e-mail addresses
- Make product name in page title configurable
- Make username available as skin object
- Added session_write_close() in rcube_db class destructor to avoid problems
in PHP 5.0.5
- Use move_uploaded_file() instead of copy() for a more secure handling of
uploaded attachments
- Additional config parameter to show/hide deleted messages
- Added periodic request for checking new mails (Request #1307821)
- Added EXPUNGE command
- Optimized loading time for mail interface
- Changed to full UTF-8 support
- Additional timezones (Patch #1389912)
- Added LDAP public search (experimental)
- Applied patch for correct ctrl/shift behavior for message selection (Bug #1326364)
- Casting to strings when adding empty headers to message cache (Bug #1406026)
- Skip sender-address as recipient when Reply-to-all
- Fixes in utf8-class
- Added patch for Quota display by Aury Fink Filho <nuny@aury.com.br>
- Added garbage collector for message cache
- Added patches for BCC headers
2005/12/16
----------
- Added Turkish and Simplified Chinese translation
- Use virtusertable to resolve e-mail addresses at login
- Configurable mail_domain used to compose correct e-mail addresses
on first login
2005/12/03
----------
- Added Finnish, Romanian, Polish, Czech, British, Norwegian, Greek, Russian,
Estonian and Chinese translation
- Get IMAP server capabilities in array
- Check for NAMESPACE capability before sending command
- Set default user language from config 'locale_string'
- Added sorting patch for message list
- Make default sort col/order configurable
- Fixed XSS in address book and identities
- Added more XSS protection (Bug #1308236)
- Added tab indexes for compose form
- Added 'changed' col to contacts table
- Support for 160-bit session hashes
- Added input check for contacts and identities (Patch #1346523)
- Added messages/warning to compose step (Patch #1323895)
- Added favicon to the default skin
- Fixed Bug #1334337 as far as possible
- Added Reply-To-All functionality (Request #1326395, Patch #1349777)
- Redesign of client side AJAX code (enable multi threading)
- Added keep-alive signal every minute
- Make logs dir configurable
- Added support for SMTPS
- Decode attachment file names
- Make delimiter for message headers configurable
- Add generic footer to sent messages
- Choose the rigt identity when replying
- Remove signature when replying (Request #1333167)
- Signatures for each identity
- Select charset when composing message
- Complete re-design of the caching mechanism
2005/08/11
----------
- Write list header to client even if list is empty
- Add functions "select all", "select none" to message list
- Improved filter for HTML messages to remove potentially malicious tags
(script, iframe, object) and event handlers.
- Buttons for next/previous message in view mode
- Add new created contact to list and show confirmation status
- Added folder management (subscribe/create/delete)
- Log message sending (SMTP log)
- Grant access for Camino browser
- Added German translation
2005/10/20
----------
- Added Swedish, Latvian, Portuguese and Catalan translation
- Make SMTP auth method configurable
- Make mailboxlist scrollable (Bug #1326372)
- Fixed SSL support
- Improved support for Courier IMAP (root folder and delimiter issues)
- Moved taskbar from bottom to top
- Added 'session_lifetime' parameter
- Fixed wrong unread count when deleting message (Bug #1332434)
- Srip tags when creating a new folder (Bug #1332084)
- Translate HTML tags in message headers (Bug #1330134)
- Correction in German translation (Bug #1329434)
- Display folder names with special chars correctly (Bug #1330157)
2005/10/07
----------
- Added French, Italian, Spanish, Danish, Dutch translation
- Clarified license (Bug #1305966)
- Fixed PHP warnings (Bug #1299403)
- Fixed english translation (Bug #1295406)
- Fixed bug #1290833: Last character of email not seen
- Fixed bug #1292199 when creating new user
- Allow more browsers (Bug #1285101)
- Added setting for showing pretty dates
- Added support for SQLite database
- Make use of message caching configurable
- Also add attachments when forwarding a message
- Long folder names will not flow over message list (Bug #1267232)
- Show nested mailboxes hieracically
- Enable IMAPS by host
2005/08/20
----------
- Improved cacheing of mailbox messagecount
- Fixed javascript bug when creating a new message folder
- Fixed javascript bugs #1260990 and #1260992: folder selection
- Make Trash folder configurable
- Auto create folders Inbox, Sent and Trash (if configured)
- Support for IMAP root folder
- Added support fot text/enriched messages
- Make list of special mailboxes configurable
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index dda852c48..806ec1a07 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -1,208 +1,211 @@
<?php
/*
+-----------------------------------------------------------------------+
| Main configuration file |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
*/
$rcmail_config = array();
// system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
$rcmail_config['debug_level'] = 1;
// enable caching of messages and mailbox data in the local database.
// this is recommended if the IMAP server does not run on the same machine
$rcmail_config['enable_caching'] = TRUE;
// lifetime of message cache
// possible units: s, m, h, d, w
$rcmail_config['message_cache_lifetime'] = '10d';
// automatically create a new RoundCube user when log-in the first time.
// a new user will be created once the IMAP login succeeds.
// set to false if only registered users can use this service
$rcmail_config['auto_create_user'] = TRUE;
// the mail host chosen to perform the log-in
// leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL connection, enter ssl://hostname:993
$rcmail_config['default_host'] = '';
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 143;
// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['username_domain'] = '';
// This domain will be used to form e-mail addresses of new users
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['mail_domain'] = '';
// Path to a virtuser table file to resolve user names and e-mail addresses
$rcmail_config['virtuser_file'] = '';
// Query to resolve user names and e-mail addresses from the database
// %u will be replaced with the current username for login.
// The query should select the user's e-mail address as first col
$rcmail_config['virtuser_query'] = '';
// use this host for sending mails.
// to use SSL connection, set ssl://smtp.host.com
// if left blank, the PHP mail() function is used
$rcmail_config['smtp_server'] = '';
// SMTP port (default is 25; 465 for SSL)
$rcmail_config['smtp_port'] = 25;
// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_config['smtp_user'] = '';
// SMTP password (if required) if you use %p as the password RoundCube
// will use the current user's password for login
$rcmail_config['smtp_pass'] = '';
// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$rcmail_config['smtp_auth_type'] = '';
// Log sent messages
$rcmail_config['smtp_log'] = TRUE;
// these cols are shown in the message list
// available cols are: subject, from, to, cc, replyto, date, size, encoding
$rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size');
// relative path to the skin folder
$rcmail_config['skin_path'] = 'skins/default/';
// use this folder to store temp files (must be writebale for apache user)
$rcmail_config['temp_dir'] = 'temp/';
// use this folder to store log files (must be writebale for apache user)
$rcmail_config['log_dir'] = 'logs/';
// session lifetime in minutes
$rcmail_config['session_lifetime'] = 10;
// check client IP in session athorization
$rcmail_config['ip_check'] = TRUE;
// the default locale setting
$rcmail_config['locale_string'] = 'en';
// use this format for short date display
$rcmail_config['date_short'] = 'D H:i';
// use this format for detailed date/time formatting
$rcmail_config['date_long'] = 'd.m.Y H:i';
// add this user-agent to message headers when sending
$rcmail_config['useragent'] = 'RoundCube Webmail/0.1b';
// use this name to compose page titles
$rcmail_config['product_name'] = 'RoundCube Webmail';
// only list folders within this path
$rcmail_config['imap_root'] = '';
// store draft message is this mailbox
// leave blank if draft messages should not be stored
$rcmail_config['drafts_mbox'] = 'Drafts';
// store sent message is this mailbox
// leave blank if sent messages should not be stored
$rcmail_config['sent_mbox'] = 'Sent';
// move messages to this folder when deleting them
// leave blank if they should be deleted directly
$rcmail_config['trash_mbox'] = 'Trash';
// display these folders separately in the mailbox list
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
+// protect the default folders from renames, deletes, and subscription changes
+$rcmail_config['protect_default_folders'] = TRUE;
+
// Set TRUE if deleted messages should not be displayed
// This will make the application run slower
$rcmail_config['skip_deleted'] = FALSE;
// Set true to Mark deleted messages as read as well as deleted
// False means that a message's read status is not affected by marking it as deleted
$rcmail_config['read_when_deleted'] = TRUE;
// When a Trash folder is not present and a message is deleted, flag
// the message for deletion rather than deleting it immediately. Setting this to
// false causes deleted messages to be permanantly removed if there is no Trash folder
$rcmail_config['flag_for_deletion'] = TRUE;
// Make use of the built-in spell checker. It is based on GoogieSpell
// which means that the message content will be sent to Google in order to check spelling
$rcmail_config['enable_spellcheck'] = TRUE;
// path to a text file which will be added to each sent message
// paths are relative to the RoundCube root folder
$rcmail_config['generic_message_footer'] = '';
// this string is used as a delimiter for message headers when sending
// leave empty for auto-detection
$rcmail_config['mail_header_delimiter'] = NULL;
// in order to enable public ldap search, create a config array
// like the Verisign example below. if you would like to test,
// simply uncomment the Verisign example.
/**
* example config for Verisign directory
*
* $rcmail_config['ldap_public']['Verisign'] = array('hosts' => array('directory.verisign.com'),
* 'port' => 389,
* 'base_dn' => '',
* 'search_fields' => array('Email' => 'mail', 'Name' => 'cn'),
* 'name_field' => 'cn',
* 'mail_field' => 'mail',
* 'scope' => 'sub',
* 'fuzzy_search' => 0);
*/
// try to load host-specific configuration
$rcmail_config['include_host_config'] = FALSE;
/***** these settings can be overwritten by user's preferences *****/
// show up to X items in list view
$rcmail_config['pagesize'] = 40;
// use this timezone to display date/time
$rcmail_config['timezone'] = 1;
// daylight savings are On
$rcmail_config['dst_active'] = TRUE;
// prefer displaying HTML messages
$rcmail_config['prefer_html'] = TRUE;
// show pretty dates as standard
$rcmail_config['prettydate'] = TRUE;
// default sort col
$rcmail_config['message_sort_col'] = 'date';
// default sort order
$rcmail_config['message_sort_order'] = 'DESC';
// list of configuration option names that need to be available in Javascript.
$rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_deletion');
// end of config file
?>
diff --git a/index.php b/index.php
index 334910534..84e11aeba 100644
--- a/index.php
+++ b/index.php
@@ -1,362 +1,362 @@
<?php
/*
+-----------------------------------------------------------------------+
| RoundCube Webmail IMAP Client |
| Version 0.1-20060505 |
| |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions |
| are met: |
| |
| o Redistributions of source code must retain the above copyright |
| notice, this list of conditions and the following disclaimer. |
| o Redistributions in binary form must reproduce the above copyright |
| notice, this list of conditions and the following disclaimer in the |
| documentation and/or other materials provided with the distribution.|
| o The names of the authors may not be used to endorse or promote |
| products derived from this software without specific prior written |
| permission. |
| |
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
define('RCMAIL_VERSION', '0.1-20060505');
// define global vars
$CHARSET = 'UTF-8';
$OUTPUT_TYPE = 'html';
$JS_OBJECT_NAME = 'rcmail';
$INSTALL_PATH = dirname($_SERVER['SCRIPT_FILENAME']);
$MAIN_TASKS = array('mail','settings','addressbook','logout');
if (empty($INSTALL_PATH))
$INSTALL_PATH = './';
else
$INSTALL_PATH .= '/';
// RC include folders MUST be included FIRST to avoid other
// possible not compatible libraries (i.e PEAR) to be included
// instead the ones provided by RC
ini_set('include_path', $INSTALL_PATH.PATH_SEPARATOR.$INSTALL_PATH.'program'.PATH_SEPARATOR.$INSTALL_PATH.'program/lib'.PATH_SEPARATOR.ini_get('include_path'));
ini_set('session.name', 'sessid');
ini_set('session.use_cookies', 1);
ini_set('session.gc_maxlifetime', 21600);
ini_set('session.gc_divisor', 500);
ini_set('error_reporting', E_ALL&~E_NOTICE);
// increase maximum execution time for php scripts
// (does not work in safe mode)
@set_time_limit(120);
// include base files
require_once('include/rcube_shared.inc');
require_once('include/rcube_imap.inc');
require_once('include/bugs.inc');
require_once('include/main.inc');
require_once('include/cache.inc');
require_once('PEAR.php');
// set PEAR error handling
// PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_NOTICE);
// use gzip compression if supported
if (function_exists('ob_gzhandler') && !ini_get('zlib.output_compression'))
ob_start('ob_gzhandler');
else
ob_start();
// catch some url/post parameters
$_auth = get_input_value('_auth', RCUBE_INPUT_GPC);
$_task = get_input_value('_task', RCUBE_INPUT_GPC);
$_action = get_input_value('_action', RCUBE_INPUT_GPC);
$_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed']));
if (empty($_task))
$_task = 'mail';
if (!empty($_GET['_remote']))
$REMOTE_REQUEST = TRUE;
// start session with requested task
rcmail_startup($_task);
// set session related variables
$COMM_PATH = sprintf('./?_auth=%s&_task=%s', $sess_auth, $_task);
$SESS_HIDDEN_FIELD = sprintf('<input type="hidden" name="_auth" value="%s" />', $sess_auth);
// add framed parameter
if ($_framed)
{
$COMM_PATH .= '&_framed=1';
$SESS_HIDDEN_FIELD .= "\n".'<input type="hidden" name="_framed" value="1" />';
}
// init necessary objects for GUI
load_gui();
// check DB connections and exit on failure
if ($err_str = $DB->is_error())
{
raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
'message' => $err_str), FALSE, TRUE);
}
// error steps
if ($_action=='error' && !empty($_GET['_code']))
{
raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE);
}
// try to log in
if ($_action=='login' && $_task=='mail')
{
$host = $_POST['_host'] ? $_POST['_host'] : $CONFIG['default_host'];
// check if client supports cookies
if (empty($_COOKIE))
{
show_message("cookiesdisabled", 'warning');
}
else if (isset($_POST['_user']) && isset($_POST['_pass']) &&
rcmail_login(get_input_value('_user', RCUBE_INPUT_POST),
get_input_value('_pass', RCUBE_INPUT_POST),
$host))
{
// send redirect
header("Location: $COMM_PATH");
exit;
}
else
{
show_message("loginfailed", 'warning');
$_SESSION['user_id'] = '';
}
}
// end session
else if ($_action=='logout' && isset($_SESSION['user_id']))
{
show_message('loggedout');
rcmail_kill_session();
}
// check session cookie and auth string
else if ($_action!='login' && $sess_auth && $_SESSION['user_id'])
{
if ($_auth !== $sess_auth || $_auth != rcmail_auth_hash($_SESSION['client_id'], $_SESSION['auth_time']) ||
($CONFIG['session_lifetime'] && isset($SESS_CHANGED) && $SESS_CHANGED + $CONFIG['session_lifetime']*60 < mktime()))
{
$message = show_message('sessionerror', 'error');
rcmail_kill_session();
}
}
// log in to imap server
if (!empty($_SESSION['user_id']) && $_task=='mail')
{
$conn = $IMAP->connect($_SESSION['imap_host'], $_SESSION['username'], decrypt_passwd($_SESSION['password']), $_SESSION['imap_port'], $_SESSION['imap_ssl']);
if (!$conn)
{
show_message('imaperror', 'error');
$_SESSION['user_id'] = '';
}
else
rcmail_set_imap_prop();
}
// not logged in -> set task to 'login
if (empty($_SESSION['user_id']))
{
if ($REMOTE_REQUEST)
{
$message .= "setTimeout(\"location.href='\"+this.env.comm_path+\"'\", 2000);";
rcube_remote_response($message);
}
$_task = 'login';
}
// set task and action to client
$script = sprintf("%s.set_env('task', '%s');", $JS_OBJECT_NAME, $_task);
if (!empty($_action))
$script .= sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action);
$OUTPUT->add_script($script);
// not logged in -> show login page
if (!$_SESSION['user_id'])
{
parse_template('login');
exit;
}
// handle keep-alive signal
if ($_action=='keep-alive')
{
rcube_remote_response('');
exit;
}
// include task specific files
if ($_task=='mail')
{
include_once('program/steps/mail/func.inc');
if ($_action=='show' || $_action=='print')
include('program/steps/mail/show.inc');
if ($_action=='get')
include('program/steps/mail/get.inc');
if ($_action=='moveto' || $_action=='delete')
include('program/steps/mail/move_del.inc');
if ($_action=='mark')
include('program/steps/mail/mark.inc');
if ($_action=='viewsource')
include('program/steps/mail/viewsource.inc');
if ($_action=='send')
include('program/steps/mail/sendmail.inc');
if ($_action=='upload')
include('program/steps/mail/upload.inc');
if ($_action=='compose')
include('program/steps/mail/compose.inc');
if ($_action=='addcontact')
include('program/steps/mail/addcontact.inc');
if ($_action=='expunge' || $_action=='purge')
include('program/steps/mail/folders.inc');
if ($_action=='check-recent')
include('program/steps/mail/check_recent.inc');
if ($_action=='getunread')
include('program/steps/mail/getunread.inc');
if ($_action=='list' && isset($_GET['_remote']))
include('program/steps/mail/list.inc');
if ($_action=='search')
include('program/steps/mail/search.inc');
if ($_action=='spell')
include('program/steps/mail/spell.inc');
if ($_action=='rss')
include('program/steps/mail/rss.inc');
// kill compose entry from session
if (isset($_SESSION['compose']))
rcmail_compose_cleanup();
// make sure the message count is refreshed
$IMAP->messagecount($_SESSION['mbox'], 'ALL', TRUE);
}
// include task specific files
if ($_task=='addressbook')
{
include_once('program/steps/addressbook/func.inc');
if ($_action=='save')
include('program/steps/addressbook/save.inc');
if ($_action=='edit' || $_action=='add')
include('program/steps/addressbook/edit.inc');
if ($_action=='delete')
include('program/steps/addressbook/delete.inc');
if ($_action=='show')
include('program/steps/addressbook/show.inc');
if ($_action=='list' && $_GET['_remote'])
include('program/steps/addressbook/list.inc');
if ($_action=='ldappublicsearch')
include('program/steps/addressbook/ldapsearchform.inc');
}
// include task specific files
if ($_task=='settings')
{
include_once('program/steps/settings/func.inc');
if ($_action=='save-identity')
include('program/steps/settings/save_identity.inc');
if ($_action=='add-identity' || $_action=='edit-identity')
include('program/steps/settings/edit_identity.inc');
if ($_action=='delete-identity')
include('program/steps/settings/delete_identity.inc');
if ($_action=='identities')
include('program/steps/settings/identities.inc');
if ($_action=='save-prefs')
include('program/steps/settings/save_prefs.inc');
- if ($_action=='folders' || $_action=='subscribe' || $_action=='unsubscribe' || $_action=='create-folder' || $_action=='delete-folder')
+ if ($_action=='folders' || $_action=='subscribe' || $_action=='unsubscribe' || $_action=='create-folder' || $_action=='rename-folder' || $_action=='delete-folder')
include('program/steps/settings/manage_folders.inc');
}
// parse main template
// only allow these templates to be included
if (in_array($_task, $MAIN_TASKS))
parse_template($_task);
// if we arrive here, something went wrong
raise_error(array('code' => 404,
'type' => 'php',
'line' => __LINE__,
'file' => __FILE__,
'message' => "Invalid request"), TRUE, TRUE);
?>
diff --git a/program/include/main.inc b/program/include/main.inc
index 0a158dcb6..cc019af67 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1,1753 +1,1759 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/include/main.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev, - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Provide basic functions for the webmail package |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
require_once('lib/des.inc');
require_once('lib/utf7.inc');
require_once('lib/utf8.class.php');
// define constannts for input reading
define('RCUBE_INPUT_GET', 0x0101);
define('RCUBE_INPUT_POST', 0x0102);
define('RCUBE_INPUT_GPC', 0x0103);
// register session and connect to server
function rcmail_startup($task='mail')
{
global $sess_id, $sess_auth, $sess_user_lang;
global $CONFIG, $INSTALL_PATH, $BROWSER, $OUTPUT, $_SESSION, $IMAP, $DB, $JS_OBJECT_NAME;
// check client
$BROWSER = rcube_browser();
// load config file
include_once('config/main.inc.php');
$CONFIG = is_array($rcmail_config) ? $rcmail_config : array();
// load host-specific configuration
rcmail_load_host_config($CONFIG);
$CONFIG['skin_path'] = $CONFIG['skin_path'] ? preg_replace('/\/$/', '', $CONFIG['skin_path']) : 'skins/default';
// load db conf
include_once('config/db.inc.php');
$CONFIG = array_merge($CONFIG, $rcmail_config);
if (empty($CONFIG['log_dir']))
$CONFIG['log_dir'] = $INSTALL_PATH.'logs';
else
$CONFIG['log_dir'] = ereg_replace('\/$', '', $CONFIG['log_dir']);
// set PHP error logging according to config
if ($CONFIG['debug_level'] & 1)
{
ini_set('log_errors', 1);
ini_set('error_log', $CONFIG['log_dir'].'/errors');
}
if ($CONFIG['debug_level'] & 4)
ini_set('display_errors', 1);
else
ini_set('display_errors', 0);
// set session garbage collecting time according to session_lifetime
if (!empty($CONFIG['session_lifetime']))
ini_set('session.gc_maxlifetime', ($CONFIG['session_lifetime']+2)*60);
// prepare DB connection
require_once('include/rcube_'.(empty($CONFIG['db_backend']) ? 'db' : $CONFIG['db_backend']).'.inc');
$DB = new rcube_db($CONFIG['db_dsnw'], $CONFIG['db_dsnr'], $CONFIG['db_persistent']);
$DB->sqlite_initials = $INSTALL_PATH.'SQL/sqlite.initial.sql';
$DB->db_connect('w');
// we can use the database for storing session data
// session queries do not work with MDB2
if (!$DB->is_error())
include_once('include/session.inc');
// init session
session_start();
$sess_id = session_id();
// create session and set session vars
if (!$_SESSION['client_id'])
{
$_SESSION['client_id'] = $sess_id;
$_SESSION['user_lang'] = rcube_language_prop($CONFIG['locale_string']);
$_SESSION['auth_time'] = mktime();
$_SESSION['auth'] = rcmail_auth_hash($sess_id, $_SESSION['auth_time']);
unset($GLOBALS['_auth']);
}
// set session vars global
$sess_auth = $_SESSION['auth'];
$sess_user_lang = rcube_language_prop($_SESSION['user_lang']);
// overwrite config with user preferences
if (is_array($_SESSION['user_prefs']))
$CONFIG = array_merge($CONFIG, $_SESSION['user_prefs']);
// reset some session parameters when changing task
if ($_SESSION['task'] != $task)
unset($_SESSION['page']);
// set current task to session
$_SESSION['task'] = $task;
// create IMAP object
if ($task=='mail')
rcmail_imap_init();
// set localization
if ($CONFIG['locale_string'])
setlocale(LC_ALL, $CONFIG['locale_string']);
else if ($sess_user_lang)
setlocale(LC_ALL, $sess_user_lang);
register_shutdown_function('rcmail_shutdown');
}
// load a host-specific config file if configured
function rcmail_load_host_config(&$config)
{
$fname = NULL;
if (is_array($config['include_host_config']))
$fname = $config['include_host_config'][$_SERVER['HTTP_HOST']];
else if (!empty($config['include_host_config']))
$fname = preg_replace('/[^a-z0-9\.\-_]/i', '', $_SERVER['HTTP_HOST']) . '.inc.php';
if ($fname && is_file('config/'.$fname))
{
include('config/'.$fname);
$config = array_merge($config, $rcmail_config);
}
}
// create authorization hash
function rcmail_auth_hash($sess_id, $ts)
{
global $CONFIG;
$auth_string = sprintf('rcmail*sess%sR%s*Chk:%s;%s',
$sess_id,
$ts,
$CONFIG['ip_check'] ? $_SERVER['REMOTE_ADDR'] : '***.***.***.***',
$_SERVER['HTTP_USER_AGENT']);
if (function_exists('sha1'))
return sha1($auth_string);
else
return md5($auth_string);
}
// create IMAP object and connect to server
function rcmail_imap_init($connect=FALSE)
{
global $CONFIG, $DB, $IMAP;
$IMAP = new rcube_imap($DB);
$IMAP->debug_level = $CONFIG['debug_level'];
$IMAP->skip_deleted = $CONFIG['skip_deleted'];
// connect with stored session data
if ($connect)
{
if (!($conn = $IMAP->connect($_SESSION['imap_host'], $_SESSION['username'], decrypt_passwd($_SESSION['password']), $_SESSION['imap_port'], $_SESSION['imap_ssl'])))
show_message('imaperror', 'error');
rcmail_set_imap_prop();
}
// enable caching of imap data
if ($CONFIG['enable_caching']===TRUE)
$IMAP->set_caching(TRUE);
if (is_array($CONFIG['default_imap_folders']))
$IMAP->set_default_mailboxes($CONFIG['default_imap_folders']);
// set pagesize from config
if (isset($CONFIG['pagesize']))
$IMAP->set_pagesize($CONFIG['pagesize']);
}
// set root dir and last stored mailbox
// this must be done AFTER connecting to the server
function rcmail_set_imap_prop()
{
global $CONFIG, $IMAP;
// set root dir from config
if (!empty($CONFIG['imap_root']))
$IMAP->set_rootdir($CONFIG['imap_root']);
if (!empty($_SESSION['mbox']))
$IMAP->set_mailbox($_SESSION['mbox']);
if (isset($_SESSION['page']))
$IMAP->set_page($_SESSION['page']);
}
// do these things on script shutdown
function rcmail_shutdown()
{
global $IMAP;
if (is_object($IMAP))
{
$IMAP->close();
$IMAP->write_cache();
}
// before closing the database connection, write session data
session_write_close();
}
// destroy session data and remove cookie
function rcmail_kill_session()
{
// save user preferences
$a_user_prefs = $_SESSION['user_prefs'];
if (!is_array($a_user_prefs))
$a_user_prefs = array();
if ((isset($_SESSION['sort_col']) && $_SESSION['sort_col']!=$a_user_prefs['message_sort_col']) ||
(isset($_SESSION['sort_order']) && $_SESSION['sort_order']!=$a_user_prefs['message_sort_order']))
{
$a_user_prefs['message_sort_col'] = $_SESSION['sort_col'];
$a_user_prefs['message_sort_order'] = $_SESSION['sort_order'];
rcmail_save_user_prefs($a_user_prefs);
}
$_SESSION = array();
session_destroy();
}
// return correct name for a specific database table
function get_table_name($table)
{
global $CONFIG;
// return table name if configured
$config_key = 'db_table_'.$table;
if (strlen($CONFIG[$config_key]))
return $CONFIG[$config_key];
return $table;
}
// return correct name for a specific database sequence
// (used for Postres only)
function get_sequence_name($sequence)
{
global $CONFIG;
// return table name if configured
$config_key = 'db_sequence_'.$sequence;
if (strlen($CONFIG[$config_key]))
return $CONFIG[$config_key];
return $table;
}
// check the given string and returns language properties
function rcube_language_prop($lang, $prop='lang')
{
- global $INSTLL_PATH;
+ global $INSTALL_PATH;
static $rcube_languages, $rcube_language_aliases, $rcube_charsets;
if (empty($rcube_languages))
- @include($INSTLL_PATH.'program/localization/index.inc');
+ @include($INSTALL_PATH.'program/localization/index.inc');
// check if we have an alias for that language
if (!isset($rcube_languages[$lang]) && isset($rcube_language_aliases[$lang]))
$lang = $rcube_language_aliases[$lang];
// try the first two chars
if (!isset($rcube_languages[$lang]) && strlen($lang)>2)
{
$lang = substr($lang, 0, 2);
$lang = rcube_language_prop($lang);
}
if (!isset($rcube_languages[$lang]))
$lang = 'en_US';
// language has special charset configured
if (isset($rcube_charsets[$lang]))
$charset = $rcube_charsets[$lang];
else
$charset = 'UTF-8';
if ($prop=='charset')
return $charset;
else
return $lang;
}
// init output object for GUI and add common scripts
function load_gui()
{
global $CONFIG, $OUTPUT, $COMM_PATH, $JS_OBJECT_NAME, $sess_user_lang;
// init output page
$OUTPUT = new rcube_html_page();
// add common javascripts
$javascript = "var $JS_OBJECT_NAME = new rcube_webmail();\n";
$javascript .= "$JS_OBJECT_NAME.set_env('comm_path', '$COMM_PATH');\n";
if (isset($CONFIG['javascript_config'] )){
foreach ($CONFIG['javascript_config'] as $js_config_var){
$javascript .= "$JS_OBJECT_NAME.set_env('$js_config_var', '" . $CONFIG[$js_config_var] . "');\n";
}
}
if (!empty($GLOBALS['_framed']))
$javascript .= "$JS_OBJECT_NAME.set_env('framed', true);\n";
$OUTPUT->add_script($javascript);
$OUTPUT->include_script('common.js');
$OUTPUT->include_script('app.js');
$OUTPUT->scripts_path = 'program/js/';
// set locale setting
rcmail_set_locale($sess_user_lang);
// set user-selected charset
if (!empty($CONFIG['charset']))
$OUTPUT->set_charset($CONFIG['charset']);
// add some basic label to client
- rcube_add_label('loading');
+ rcube_add_label('loading','checkingmail');
}
// set localization charset based on the given language
function rcmail_set_locale($lang)
{
global $OUTPUT, $MBSTRING, $MBSTRING_ENCODING;
static $s_mbstring_loaded = NULL;
// settings for mbstring module (by Tadashi Jokagi)
if ($s_mbstring_loaded===NULL)
{
if ($s_mbstring_loaded = extension_loaded("mbstring"))
{
$MBSTRING = TRUE;
if (function_exists("mb_mbstring_encodings"))
$MBSTRING_ENCODING = mb_mbstring_encodings();
else
$MBSTRING_ENCODING = array("ISO-8859-1", "UTF-7", "UTF7-IMAP", "UTF-8",
"ISO-2022-JP", "EUC-JP", "EUCJP-WIN",
"SJIS", "SJIS-WIN");
$MBSTRING_ENCODING = array_map("strtoupper", $MBSTRING_ENCODING);
if (in_array("SJIS", $MBSTRING_ENCODING))
$MBSTRING_ENCODING[] = "SHIFT_JIS";
}
else
{
$MBSTRING = FALSE;
$MBSTRING_ENCODING = array();
}
}
if ($MBSTRING && function_exists("mb_language"))
{
if (!@mb_language(strtok($lang, "_")))
$MBSTRING = FALSE; // unsupport language
}
$OUTPUT->set_charset(rcube_language_prop($lang, 'charset'));
}
// perfom login to the IMAP server and to the webmail service
function rcmail_login($user, $pass, $host=NULL)
{
global $CONFIG, $IMAP, $DB, $sess_user_lang;
$user_id = NULL;
if (!$host)
$host = $CONFIG['default_host'];
// parse $host URL
$a_host = parse_url($host);
if ($a_host['host'])
{
$host = $a_host['host'];
$imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE;
$imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']);
}
else
$imap_port = $CONFIG['default_port'];
/* Modify username with domain if required
Inspired by Marco <P0L0_notspam_binware.org>
*/
// Check if we need to add domain
if ($CONFIG['username_domain'] && !strstr($user, '@'))
{
if (is_array($CONFIG['username_domain']) && isset($CONFIG['username_domain'][$host]))
$user .= '@'.$CONFIG['username_domain'][$host];
else if (!empty($CONFIG['username_domain']))
$user .= '@'.$CONFIG['username_domain'];
}
// query if user already registered
$sql_result = $DB->query("SELECT user_id, username, language, preferences
FROM ".get_table_name('users')."
WHERE mail_host=? AND (username=? OR alias=?)",
$host,
$user,
$user);
// user already registered -> overwrite username
if ($sql_arr = $DB->fetch_assoc($sql_result))
{
$user_id = $sql_arr['user_id'];
$user = $sql_arr['username'];
}
// try to resolve email address from virtuser table
if (!empty($CONFIG['virtuser_file']) && strstr($user, '@'))
$user = rcmail_email2user($user);
// exit if IMAP login failed
if (!($imap_login = $IMAP->connect($host, $user, $pass, $imap_port, $imap_ssl)))
return FALSE;
// user already registered
if ($user_id && !empty($sql_arr))
{
// get user prefs
if (strlen($sql_arr['preferences']))
{
$user_prefs = unserialize($sql_arr['preferences']);
$_SESSION['user_prefs'] = $user_prefs;
array_merge($CONFIG, $user_prefs);
}
// set user specific language
if (strlen($sql_arr['language']))
$sess_user_lang = $_SESSION['user_lang'] = $sql_arr['language'];
// update user's record
$DB->query("UPDATE ".get_table_name('users')."
SET last_login=now()
WHERE user_id=?",
$user_id);
}
// create new system user
else if ($CONFIG['auto_create_user'])
{
$user_id = rcmail_create_user($user, $host);
}
if ($user_id)
{
$_SESSION['user_id'] = $user_id;
$_SESSION['imap_host'] = $host;
$_SESSION['imap_port'] = $imap_port;
$_SESSION['imap_ssl'] = $imap_ssl;
$_SESSION['username'] = $user;
$_SESSION['user_lang'] = $sess_user_lang;
$_SESSION['password'] = encrypt_passwd($pass);
// force reloading complete list of subscribed mailboxes
$IMAP->clear_cache('mailboxes');
return TRUE;
}
return FALSE;
}
// create new entry in users and identities table
function rcmail_create_user($user, $host)
{
global $DB, $CONFIG, $IMAP;
$user_email = '';
// try to resolve user in virtusertable
if (!empty($CONFIG['virtuser_file']) && strstr($user, '@')==FALSE)
$user_email = rcmail_user2email($user);
$DB->query("INSERT INTO ".get_table_name('users')."
(created, last_login, username, mail_host, alias, language)
VALUES (now(), now(), ?, ?, ?, ?)",
$user,
$host,
$user_email,
$_SESSION['user_lang']);
if ($user_id = $DB->insert_id(get_sequence_name('users')))
{
if (is_array($CONFIG['mail_domain']) && isset($CONFIG['mail_domain'][$host]))
$mail_domain = $CONFIG['mail_domain'][$host];
else if (!empty($CONFIG['mail_domain']))
$mail_domain = $CONFIG['mail_domain'];
else
$mail_domain = $host;
if ($user_email=='')
$user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $mail_domain);
$user_name = $user!=$user_email ? $user : '';
// try to resolve the e-mail address from the virtuser table
if (!empty($CONFIG['virtuser_query']))
{
$sql_result = $DB->query(preg_replace('/%u/', $user, $CONFIG['virtuser_query']));
if ($sql_arr = $DB->fetch_array($sql_result))
$user_email = $sql_arr[0];
}
// also create new identity records
$DB->query("INSERT INTO ".get_table_name('identities')."
(user_id, del, standard, name, email)
VALUES (?, 0, 1, ?, ?)",
$user_id,
$user_name,
$user_email);
// get existing mailboxes
$a_mailboxes = $IMAP->list_mailboxes();
}
else
{
raise_error(array('code' => 500,
'type' => 'php',
'line' => __LINE__,
'file' => __FILE__,
'message' => "Failed to create new user"), TRUE, FALSE);
}
return $user_id;
}
// load virtuser table in array
function rcmail_getvirtualfile()
{
global $CONFIG;
if (empty($CONFIG['virtuser_file']) || !is_file($CONFIG['virtuser_file']))
return FALSE;
// read file
$a_lines = file($CONFIG['virtuser_file']);
return $a_lines;
}
// find matches of the given pattern in virtuser table
function rcmail_findinvirtual($pattern)
{
$result = array();
$virtual = rcmail_getvirtualfile();
if ($virtual==FALSE)
return $result;
// check each line for matches
foreach ($virtual as $line)
{
$line = trim($line);
if (empty($line) || $line{0}=='#')
continue;
if (eregi($pattern, $line))
$result[] = $line;
}
return $result;
}
// resolve username with virtuser table
function rcmail_email2user($email)
{
$user = $email;
$r = rcmail_findinvirtual("^$email");
for ($i=0; $i<count($r); $i++)
{
$data = $r[$i];
$arr = preg_split('/\s+/', $data);
if(count($arr)>0)
{
$user = trim($arr[count($arr)-1]);
break;
}
}
return $user;
}
// resolve e-mail address with virtuser table
function rcmail_user2email($user)
{
$email = "";
$r = rcmail_findinvirtual("$user$");
for ($i=0; $i<count($r); $i++)
{
$data=$r[$i];
$arr = preg_split('/\s+/', $data);
if (count($arr)>0)
{
$email = trim($arr[0]);
break;
}
}
return $email;
}
function rcmail_save_user_prefs($a_user_prefs)
{
global $DB, $CONFIG, $sess_user_lang;
$DB->query("UPDATE ".get_table_name('users')."
SET preferences=?,
language=?
WHERE user_id=?",
serialize($a_user_prefs),
$sess_user_lang,
$_SESSION['user_id']);
if ($DB->affected_rows())
{
$_SESSION['user_prefs'] = $a_user_prefs;
$CONFIG = array_merge($CONFIG, $a_user_prefs);
return TRUE;
}
return FALSE;
}
// overwrite action variable
function rcmail_overwrite_action($action)
{
global $OUTPUT, $JS_OBJECT_NAME;
$GLOBALS['_action'] = $action;
$OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $action));
}
function show_message($message, $type='notice', $vars=NULL)
{
global $OUTPUT, $JS_OBJECT_NAME, $REMOTE_REQUEST;
$framed = $GLOBALS['_framed'];
$command = sprintf("display_message('%s', '%s');",
addslashes(rep_specialchars_output(rcube_label(array('name' => $message, 'vars' => $vars)))),
$type);
if ($REMOTE_REQUEST)
return 'this.'.$command;
else
$OUTPUT->add_script(sprintf("%s%s.%s",
$framed ? sprintf('if(parent.%s)parent.', $JS_OBJECT_NAME) : '',
$JS_OBJECT_NAME,
$command));
// console(rcube_label($message));
}
function console($msg, $type=1)
{
if ($GLOBALS['REMOTE_REQUEST'])
print "// $msg\n";
else
{
print $msg;
print "\n<hr>\n";
}
}
function encrypt_passwd($pass)
{
$cypher = des('rcmail?24BitPwDkeyF**ECB', $pass, 1, 0, NULL);
return base64_encode($cypher);
}
function decrypt_passwd($cypher)
{
$pass = des('rcmail?24BitPwDkeyF**ECB', base64_decode($cypher), 0, 0, NULL);
return trim($pass);
}
// send correct response on a remote request
function rcube_remote_response($js_code, $flush=FALSE)
{
global $OUTPUT, $CHARSET;
static $s_header_sent = FALSE;
if (!$s_header_sent)
{
$s_header_sent = TRUE;
send_nocacheing_headers();
header('Content-Type: application/x-javascript; charset='.$CHARSET);
print '/** remote response ['.date('d/M/Y h:i:s O')."] **/\n";
}
// send response code
print rcube_charset_convert($js_code, $CHARSET, $OUTPUT->get_charset());
if ($flush) // flush the output buffer
flush();
else // terminate script
exit;
}
// read directory program/localization/ and return a list of available languages
function rcube_list_languages()
{
global $CONFIG, $INSTALL_PATH;
static $sa_languages = array();
if (!sizeof($sa_languages))
{
- @include($INSTLL_PATH.'program/localization/index.inc');
+ @include($INSTALL_PATH.'program/localization/index.inc');
- if ($dh = @opendir($INSTLL_PATH.'program/localization'))
+ if ($dh = @opendir($INSTALL_PATH.'program/localization'))
{
while (($name = readdir($dh)) !== false)
{
- if ($name{0}=='.' || !is_dir($INSTLL_PATH.'program/localization/'.$name))
+ if ($name{0}=='.' || !is_dir($INSTALL_PATH.'program/localization/'.$name))
continue;
if ($label = $rcube_languages[$name])
$sa_languages[$name] = $label ? $label : $name;
}
closedir($dh);
}
}
return $sa_languages;
}
// add a localized label to the client environment
function rcube_add_label()
{
global $OUTPUT, $JS_OBJECT_NAME;
$arg_list = func_get_args();
foreach ($arg_list as $i => $name)
$OUTPUT->add_script(sprintf("%s.add_label('%s', '%s');",
$JS_OBJECT_NAME,
$name,
rep_specialchars_output(rcube_label($name), 'js')));
}
// remove temp files of a session
function rcmail_clear_session_temp($sess_id)
{
global $CONFIG;
$temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '');
$cache_dir = $temp_dir.$sess_id;
if (is_dir($cache_dir))
{
clear_directory($cache_dir);
rmdir($cache_dir);
}
}
// remove all expired message cache records
function rcmail_message_cache_gc()
{
global $DB, $CONFIG;
// no cache lifetime configured
if (empty($CONFIG['message_cache_lifetime']))
return;
// get target timestamp
$ts = get_offset_time($CONFIG['message_cache_lifetime'], -1);
$DB->query("DELETE FROM ".get_table_name('messages')."
WHERE created < ".$DB->fromunixtime($ts));
}
// convert a string from one charset to another
// this function is not complete and not tested well
function rcube_charset_convert($str, $from, $to=NULL)
{
global $MBSTRING, $MBSTRING_ENCODING;
$from = strtoupper($from);
$to = $to==NULL ? strtoupper($GLOBALS['CHARSET']) : strtoupper($to);
if ($from==$to)
return $str;
// convert charset using mbstring module
if ($MBSTRING)
{
$to = $to=="UTF-7" ? "UTF7-IMAP" : $to;
$from = $from=="UTF-7" ? "UTF7-IMAP": $from;
if (in_array($to, $MBSTRING_ENCODING) && in_array($from, $MBSTRING_ENCODING))
return mb_convert_encoding($str, $to, $from);
}
// convert charset using iconv module
if (function_exists('iconv') && $from!='UTF-7' && $to!='UTF-7')
return iconv($from, $to, $str);
$conv = new utf8();
// convert string to UTF-8
if ($from=='UTF-7')
$str = rcube_charset_convert(UTF7DecodeString($str), 'ISO-8859-1');
else if ($from=='ISO-8859-1' && function_exists('utf8_encode'))
$str = utf8_encode($str);
else if ($from!='UTF-8')
{
$conv->loadCharset($from);
$str = $conv->strToUtf8($str);
}
// encode string for output
if ($to=='UTF-7')
return UTF7EncodeString($str);
else if ($to=='ISO-8859-1' && function_exists('utf8_decode'))
return utf8_decode($str);
else if ($to!='UTF-8')
{
$conv->loadCharset($to);
return $conv->utf8ToStr($str);
}
// return UTF-8 string
return $str;
}
// replace specials characters to a specific encoding type
function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
{
global $OUTPUT_TYPE, $OUTPUT;
static $html_encode_arr, $js_rep_table, $rtf_rep_table, $xml_rep_table;
if (!$enctype)
$enctype = $GLOBALS['OUTPUT_TYPE'];
// convert nbsps back to normal spaces if not html
if ($enctype!='html')
$str = str_replace(chr(160), ' ', $str);
// encode for plaintext
if ($enctype=='text')
return str_replace("\r\n", "\n", $mode=='remove' ? strip_tags($str) : $str);
// encode for HTML output
if ($enctype=='html')
{
if (!$html_encode_arr)
{
$html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS);
unset($html_encode_arr['?']);
unset($html_encode_arr['&']);
}
$ltpos = strpos($str, '<');
$encode_arr = $html_encode_arr;
// don't replace quotes and html tags
if (($mode=='show' || $mode=='') && $ltpos!==false && strpos($str, '>', $ltpos)!==false)
{
unset($encode_arr['"']);
unset($encode_arr['<']);
unset($encode_arr['>']);
}
else if ($mode=='remove')
$str = strip_tags($str);
$out = strtr($str, $encode_arr);
return $newlines ? nl2br($out) : $out;
}
if ($enctype=='url')
return rawurlencode($str);
// if the replace tables for RTF, XML and JS are not yet defined
if (!$js_rep_table)
{
$js_rep_table = $rtf_rep_table = $xml_rep_table = array();
$xml_rep_table['&'] = '&amp;';
for ($c=160; $c<256; $c++) // can be increased to support more charsets
{
$hex = dechex($c);
$rtf_rep_table[Chr($c)] = "\\'$hex";
$xml_rep_table[Chr($c)] = "&#$c;";
if ($OUTPUT->get_charset()=='ISO-8859-1')
$js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
}
$js_rep_table['"'] = sprintf("\u%s%s", str_repeat('0', 4-strlen(dechex(34))), dechex(34));
$xml_rep_table['"'] = '&quot;';
}
// encode for RTF
if ($enctype=='xml')
return strtr($str, $xml_rep_table);
// encode for javascript use
if ($enctype=='js')
{
if ($OUTPUT->get_charset()!='UTF-8')
$str = rcube_charset_convert($str, $GLOBALS['CHARSET'], $OUTPUT->get_charset());
return preg_replace(array("/\r\n/", '/"/', "/([^\\\])'/"), array('\n', '\"', "$1\'"), strtr($str, $js_rep_table));
}
// encode for RTF
if ($enctype=='rtf')
return preg_replace("/\r\n/", "\par ", strtr($str, $rtf_rep_table));
// no encoding given -> return original string
return $str;
}
/**
* Read input value and convert it for internal use
* Performs stripslashes() and charset conversion if necessary
*
* @param string Field name to read
* @param int Source to get value from (GPC)
* @param boolean Allow HTML tags in field value
* @param string Charset to convert into
* @return string Field value or NULL if not available
*/
function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL)
{
global $OUTPUT;
$value = NULL;
if ($source==RCUBE_INPUT_GET && isset($_GET[$fname]))
$value = $_GET[$fname];
else if ($source==RCUBE_INPUT_POST && isset($_POST[$fname]))
$value = $_POST[$fname];
else if ($source==RCUBE_INPUT_GPC)
{
if (isset($_POST[$fname]))
$value = $_POST[$fname];
else if (isset($_GET[$fname]))
$value = $_GET[$fname];
else if (isset($_COOKIE[$fname]))
$value = $_COOKIE[$fname];
}
// strip slashes if magic_quotes enabled
if ((bool)get_magic_quotes_gpc())
$value = stripslashes($value);
// remove HTML tags if not allowed
if (!$allow_html)
$value = strip_tags($value);
// convert to internal charset
if (is_object($OUTPUT))
return rcube_charset_convert($value, $OUTPUT->get_charset(), $charset);
else
return $value;
}
// ************** template parsing and gui functions **************
// return boolean if a specific template exists
function template_exists($name)
{
global $CONFIG, $OUTPUT;
$skin_path = $CONFIG['skin_path'];
// check template file
return is_file("$skin_path/templates/$name.html");
}
// get page template an replace variable
// similar function as used in nexImage
function parse_template($name='main', $exit=TRUE)
{
global $CONFIG, $OUTPUT;
$skin_path = $CONFIG['skin_path'];
// read template file
$templ = '';
$path = "$skin_path/templates/$name.html";
if($fp = @fopen($path, 'r'))
{
$templ = fread($fp, filesize($path));
fclose($fp);
}
else
{
raise_error(array('code' => 500,
'type' => 'php',
'line' => __LINE__,
'file' => __FILE__,
'message' => "Error loading template for '$name'"), TRUE, TRUE);
return FALSE;
}
// parse for specialtags
$output = parse_rcube_xml($templ);
$OUTPUT->write(trim(parse_with_globals($output)), $skin_path);
if ($exit)
exit;
}
// replace all strings ($varname) with the content of the according global variable
function parse_with_globals($input)
{
$GLOBALS['__comm_path'] = $GLOBALS['COMM_PATH'];
$output = preg_replace('/\$(__[a-z0-9_\-]+)/e', '$GLOBALS["\\1"]', $input);
return $output;
}
function parse_rcube_xml($input)
{
$output = preg_replace('/<roundcube:([-_a-z]+)\s+([^>]+)>/Uie', "rcube_xml_command('\\1', '\\2')", $input);
return $output;
}
function rcube_xml_command($command, $str_attrib, $a_attrib=NULL)
{
global $IMAP, $CONFIG, $OUTPUT;
$attrib = array();
$command = strtolower($command);
preg_match_all('/\s*([-_a-z]+)=["]([^"]+)["]?/i', stripslashes($str_attrib), $regs, PREG_SET_ORDER);
// convert attributes to an associative array (name => value)
if ($regs)
foreach ($regs as $attr)
$attrib[strtolower($attr[1])] = $attr[2];
else if ($a_attrib)
$attrib = $a_attrib;
// execute command
switch ($command)
{
// return a button
case 'button':
if ($attrib['command'])
return rcube_button($attrib);
break;
// show a label
case 'label':
if ($attrib['name'] || $attrib['command'])
return rep_specialchars_output(rcube_label($attrib));
break;
// create a menu item
case 'menu':
if ($attrib['command'] && $attrib['group'])
rcube_menu($attrib);
break;
// include a file
case 'include':
$path = realpath($CONFIG['skin_path'].$attrib['file']);
if($fp = @fopen($path, 'r'))
{
$incl = fread($fp, filesize($path));
fclose($fp);
return parse_rcube_xml($incl);
}
break;
// return code for a specific application object
case 'object':
$object = strtolower($attrib['name']);
$object_handlers = array(
// GENERAL
'loginform' => 'rcmail_login_form',
'username' => 'rcmail_current_username',
// MAIL
'mailboxlist' => 'rcmail_mailbox_list',
'message' => 'rcmail_message_container',
'messages' => 'rcmail_message_list',
'messagecountdisplay' => 'rcmail_messagecount_display',
'quotadisplay' => 'rcmail_quota_display',
'messageheaders' => 'rcmail_message_headers',
'messagebody' => 'rcmail_message_body',
'messageattachments' => 'rcmail_message_attachments',
'blockedobjects' => 'rcmail_remote_objects_msg',
'messagecontentframe' => 'rcmail_messagecontent_frame',
'messagepartframe' => 'rcmail_message_part_frame',
'messagepartcontrols' => 'rcmail_message_part_controls',
'composeheaders' => 'rcmail_compose_headers',
'composesubject' => 'rcmail_compose_subject',
'composebody' => 'rcmail_compose_body',
'composeattachmentlist' => 'rcmail_compose_attachment_list',
'composeattachmentform' => 'rcmail_compose_attachment_form',
'composeattachment' => 'rcmail_compose_attachment_field',
'priorityselector' => 'rcmail_priority_selector',
'charsetselector' => 'rcmail_charset_selector',
'searchform' => 'rcmail_search_form',
'receiptcheckbox' => 'rcmail_receipt_checkbox',
// ADDRESS BOOK
'addresslist' => 'rcmail_contacts_list',
'addressframe' => 'rcmail_contact_frame',
'recordscountdisplay' => 'rcmail_rowcount_display',
'contactdetails' => 'rcmail_contact_details',
'contacteditform' => 'rcmail_contact_editform',
'ldappublicsearch' => 'rcmail_ldap_public_search_form',
'ldappublicaddresslist' => 'rcmail_ldap_public_list',
// USER SETTINGS
'userprefs' => 'rcmail_user_prefs_form',
'itentitieslist' => 'rcmail_identities_list',
'identityframe' => 'rcmail_identity_frame',
'identityform' => 'rcube_identity_form',
'foldersubscription' => 'rcube_subscription_form',
'createfolder' => 'rcube_create_folder_form',
+ 'renamefolder' => 'rcube_rename_folder_form',
'composebody' => 'rcmail_compose_body'
);
// execute object handler function
if ($object_handlers[$object] && function_exists($object_handlers[$object]))
return call_user_func($object_handlers[$object], $attrib);
else if ($object=='productname')
{
$name = !empty($CONFIG['product_name']) ? $CONFIG['product_name'] : 'RoundCube Webmail';
return rep_specialchars_output($name, 'html', 'all');
}
else if ($object=='version')
{
return (string)RCMAIL_VERSION;
}
else if ($object=='pagetitle')
{
$task = $GLOBALS['_task'];
$title = !empty($CONFIG['product_name']) ? $CONFIG['product_name'].' :: ' : '';
if ($task=='login')
$title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $CONFIG['product_name'])));
else if ($task=='mail' && isset($GLOBALS['MESSAGE']['subject']))
$title .= $GLOBALS['MESSAGE']['subject'];
else if (isset($GLOBALS['PAGE_TITLE']))
$title .= $GLOBALS['PAGE_TITLE'];
else if ($task=='mail' && ($mbox_name = $IMAP->get_mailbox_name()))
$title .= rcube_charset_convert($mbox_name, 'UTF-7', 'UTF-8');
else
$title .= ucfirst($task);
return rep_specialchars_output($title, 'html', 'all');
}
break;
}
return '';
}
// create and register a button
function rcube_button($attrib)
{
global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $BROWSER, $COMM_PATH, $MAIN_TASKS;
static $sa_buttons = array();
static $s_button_count = 100;
$skin_path = $CONFIG['skin_path'];
if (!($attrib['command'] || $attrib['name']))
return '';
// try to find out the button type
if ($attrib['type'])
$attrib['type'] = strtolower($attrib['type']);
else
$attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $arg['imageact']) ? 'image' : 'link';
$command = $attrib['command'];
// take the button from the stack
if($attrib['name'] && $sa_buttons[$attrib['name']])
$attrib = $sa_buttons[$attrib['name']];
// add button to button stack
else if($attrib['image'] || $arg['imageact'] || $attrib['imagepas'] || $attrib['class'])
{
if(!$attrib['name'])
$attrib['name'] = $command;
if (!$attrib['image'])
$attrib['image'] = $attrib['imagepas'] ? $attrib['imagepas'] : $attrib['imageact'];
$sa_buttons[$attrib['name']] = $attrib;
}
// get saved button for this command/name
else if ($command && $sa_buttons[$command])
$attrib = $sa_buttons[$command];
//else
// return '';
// set border to 0 because of the link arround the button
if ($attrib['type']=='image' && !isset($attrib['border']))
$attrib['border'] = 0;
if (!$attrib['id'])
$attrib['id'] = sprintf('rcmbtn%d', $s_button_count++);
// get localized text for labels and titles
if ($attrib['title'])
$attrib['title'] = rep_specialchars_output(rcube_label($attrib['title']));
if ($attrib['label'])
$attrib['label'] = rep_specialchars_output(rcube_label($attrib['label']));
if ($attrib['alt'])
$attrib['alt'] = rep_specialchars_output(rcube_label($attrib['alt']));
// set title to alt attribute for IE browsers
if ($BROWSER['ie'] && $attrib['title'] && !$attrib['alt'])
{
$attrib['alt'] = $attrib['title'];
unset($attrib['title']);
}
// add empty alt attribute for XHTML compatibility
if (!isset($attrib['alt']))
$attrib['alt'] = '';
// register button in the system
if ($attrib['command'])
{
$OUTPUT->add_script(sprintf("%s.register_button('%s', '%s', '%s', '%s', '%s', '%s');",
$JS_OBJECT_NAME,
$command,
$attrib['id'],
$attrib['type'],
$attrib['imageact'] ? $skin_path.$attrib['imageact'] : $attrib['classact'],
- $attirb['imagesel'] ? $skin_path.$attirb['imagesel'] : $attrib['classsel'],
+ $attrib['imagesel'] ? $skin_path.$attrib['imagesel'] : $attrib['classsel'],
$attrib['imageover'] ? $skin_path.$attrib['imageover'] : ''));
// make valid href to task buttons
if (in_array($attrib['command'], $MAIN_TASKS))
$attrib['href'] = ereg_replace('_task=[a-z]+', '_task='.$attrib['command'], $COMM_PATH);
}
// overwrite attributes
if (!$attrib['href'])
$attrib['href'] = '#';
if ($command)
$attrib['onclick'] = sprintf("return %s.command('%s','%s',this)", $JS_OBJECT_NAME, $command, $attrib['prop']);
if ($command && $attrib['imageover'])
{
$attrib['onmouseover'] = sprintf("return %s.button_over('%s','%s')", $JS_OBJECT_NAME, $command, $attrib['id']);
$attrib['onmouseout'] = sprintf("return %s.button_out('%s','%s')", $JS_OBJECT_NAME, $command, $attrib['id']);
}
+ if ($command && $attrib['imagesel'])
+ {
+ $attrib['onmousedown'] = sprintf("return %s.button_sel('%s','%s')", $JS_OBJECT_NAME, $command, $attrib['id']);
+ $attrib['onmouseup'] = sprintf("return %s.button_out('%s','%s')", $JS_OBJECT_NAME, $command, $attrib['id']);
+ }
$out = '';
// generate image tag
if ($attrib['type']=='image')
{
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'width', 'height', 'border', 'hspace', 'vspace', 'align', 'alt'));
$img_tag = sprintf('<img src="%%s"%s />', $attrib_str);
$btn_content = sprintf($img_tag, $skin_path.$attrib['image']);
if ($attrib['label'])
$btn_content .= ' '.$attrib['label'];
- $link_attrib = array('href', 'onclick', 'onmouseover', 'onmouseout', 'title');
+ $link_attrib = array('href', 'onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'title');
}
else if ($attrib['type']=='link')
{
$btn_content = $attrib['label'] ? $attrib['label'] : $attrib['command'];
$link_attrib = array('href', 'onclick', 'title', 'id', 'class', 'style');
}
else if ($attrib['type']=='input')
{
$attrib['type'] = 'button';
if ($attrib['label'])
$attrib['value'] = $attrib['label'];
$attrib_str = create_attrib_string($attrib, array('type', 'value', 'onclick', 'id', 'class', 'style'));
$out = sprintf('<input%s disabled />', $attrib_str);
}
// generate html code for button
if ($btn_content)
{
$attrib_str = create_attrib_string($attrib, $link_attrib);
$out = sprintf('<a%s>%s</a>', $attrib_str, $btn_content);
}
return $out;
}
function rcube_menu($attrib)
{
return '';
}
function rcube_table_output($attrib, $table_data, $a_show_cols, $id_col)
{
global $DB;
// allow the following attributes to be added to the <table> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
$table = '<table' . $attrib_str . ">\n";
// add table title
$table .= "<thead><tr>\n";
foreach ($a_show_cols as $col)
$table .= '<td class="'.$col.'">' . rep_specialchars_output(rcube_label($col)) . "</td>\n";
$table .= "</tr></thead>\n<tbody>\n";
$c = 0;
if (!is_array($table_data))
{
while ($table_data && ($sql_arr = $DB->fetch_assoc($table_data)))
{
$zebra_class = $c%2 ? 'even' : 'odd';
$table .= sprintf('<tr id="rcmrow%d" class="contact '.$zebra_class.'">'."\n", $sql_arr[$id_col]);
// format each col
foreach ($a_show_cols as $col)
{
$cont = rep_specialchars_output($sql_arr[$col]);
$table .= '<td class="'.$col.'">' . $cont . "</td>\n";
}
$table .= "</tr>\n";
$c++;
}
}
else
{
foreach ($table_data as $row_data)
{
$zebra_class = $c%2 ? 'even' : 'odd';
$table .= sprintf('<tr id="rcmrow%d" class="contact '.$zebra_class.'">'."\n", $row_data[$id_col]);
// format each col
foreach ($a_show_cols as $col)
{
$cont = rep_specialchars_output($row_data[$col]);
$table .= '<td class="'.$col.'">' . $cont . "</td>\n";
}
$table .= "</tr>\n";
$c++;
}
}
// complete message table
$table .= "</tbody></table>\n";
return $table;
}
function rcmail_get_edit_field($col, $value, $attrib, $type='text')
{
$fname = '_'.$col;
$attrib['name'] = $fname;
if ($type=='checkbox')
{
$attrib['value'] = '1';
$input = new checkbox($attrib);
}
else if ($type=='textarea')
{
$attrib['cols'] = $attrib['size'];
$input = new textarea($attrib);
}
else
$input = new textfield($attrib);
// use value from post
if (!empty($_POST[$fname]))
$value = $_POST[$fname];
$out = $input->show($value);
return $out;
}
function create_attrib_string($attrib, $allowed_attribs=array('id', 'class', 'style'))
{
// allow the following attributes to be added to the <iframe> tag
$attrib_str = '';
foreach ($allowed_attribs as $a)
if (isset($attrib[$a]))
$attrib_str .= sprintf(' %s="%s"', $a, $attrib[$a]);
return $attrib_str;
}
function format_date($date, $format=NULL)
{
global $CONFIG, $sess_user_lang;
$ts = NULL;
if (is_numeric($date))
$ts = $date;
else if (!empty($date))
$ts = @strtotime($date);
if (empty($ts))
return '';
// get user's timezone
$tz = $CONFIG['timezone'];
if ($CONFIG['dst_active'])
$tz++;
// convert time to user's timezone
$timestamp = $ts - date('Z', $ts) + ($tz * 3600);
// get current timestamp in user's timezone
$now = time(); // local time
$now -= (int)date('Z'); // make GMT time
$now += ($tz * 3600); // user's time
$now_date = getdate();
$today_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday'], $now_date['year']);
$week_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday']-6, $now_date['year']);
// define date format depending on current time
if ($CONFIG['prettydate'] && !$format && $timestamp > $today_limit)
return sprintf('%s %s', rcube_label('today'), date('H:i', $timestamp));
else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit)
$format = $CONFIG['date_short'] ? $CONFIG['date_short'] : 'D H:i';
else if (!$format)
$format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i';
// parse format string manually in order to provide localized weekday and month names
// an alternative would be to convert the date() format string to fit with strftime()
$out = '';
for($i=0; $i<strlen($format); $i++)
{
if ($format{$i}=='\\') // skip escape chars
continue;
// write char "as-is"
if ($format{$i}==' ' || $format{$i-1}=='\\')
$out .= $format{$i};
// weekday (short)
else if ($format{$i}=='D')
$out .= rcube_label(strtolower(date('D', $timestamp)));
// weekday long
else if ($format{$i}=='l')
$out .= rcube_label(strtolower(date('l', $timestamp)));
// month name (short)
else if ($format{$i}=='M')
$out .= rcube_label(strtolower(date('M', $timestamp)));
// month name (long)
else if ($format{$i}=='F')
$out .= rcube_label(strtolower(date('F', $timestamp)));
else
$out .= date($format{$i}, $timestamp);
}
return $out;
}
// ************** functions delivering gui objects **************
function rcmail_message_container($attrib)
{
global $OUTPUT, $JS_OBJECT_NAME;
if (!$attrib['id'])
$attrib['id'] = 'rcmMessageContainer';
// allow the following attributes to be added to the <table> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
$out = '<div' . $attrib_str . "></div>";
$OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('message', '$attrib[id]');");
return $out;
}
// return the IMAP username of the current session
function rcmail_current_username($attrib)
{
global $DB;
static $s_username;
// alread fetched
if (!empty($s_username))
return $s_username;
// get e-mail address form default identity
$sql_result = $DB->query("SELECT email AS mailto
FROM ".get_table_name('identities')."
WHERE user_id=?
AND standard=1
AND del<>1",
$_SESSION['user_id']);
if ($DB->num_rows($sql_result))
{
$sql_arr = $DB->fetch_assoc($sql_result);
$s_username = $sql_arr['mailto'];
}
else if (strstr($_SESSION['username'], '@'))
$s_username = $_SESSION['username'];
else
$s_username = $_SESSION['username'].'@'.$_SESSION['imap_host'];
return $s_username;
}
// return code for the webmail login form
function rcmail_login_form($attrib)
{
global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $SESS_HIDDEN_FIELD;
$labels = array();
$labels['user'] = rcube_label('username');
$labels['pass'] = rcube_label('password');
$labels['host'] = rcube_label('server');
$input_user = new textfield(array('name' => '_user', 'size' => 30));
$input_pass = new passwordfield(array('name' => '_pass', 'size' => 30));
$input_action = new hiddenfield(array('name' => '_action', 'value' => 'login'));
$fields = array();
$fields['user'] = $input_user->show(get_input_value('_user', RCUBE_INPUT_POST));
$fields['pass'] = $input_pass->show();
$fields['action'] = $input_action->show();
if (is_array($CONFIG['default_host']))
{
$select_host = new select(array('name' => '_host'));
foreach ($CONFIG['default_host'] as $key => $value)
$select_host->add($value, (is_numeric($key) ? $value : $key));
$fields['host'] = $select_host->show($_POST['_host']);
}
else if (!strlen($CONFIG['default_host']))
{
$input_host = new textfield(array('name' => '_host', 'size' => 30));
$fields['host'] = $input_host->show($_POST['_host']);
}
$form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
$form_start = !strlen($attrib['form']) ? '<form name="form" action="./" method="post">' : '';
$form_end = !strlen($attrib['form']) ? '</form>' : '';
if ($fields['host'])
$form_host = <<<EOF
</tr><tr>
<td class="title">$labels[host]</td>
<td>$fields[host]</td>
EOF;
$OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('loginform', '$form_name');");
$out = <<<EOF
$form_start
$SESS_HIDDEN_FIELD
$fields[action]
<table><tr>
<td class="title">$labels[user]</td>
<td>$fields[user]</td>
</tr><tr>
<td class="title">$labels[pass]</td>
<td>$fields[pass]</td>
$form_host
</tr></table>
$form_end
EOF;
return $out;
}
function rcmail_charset_selector($attrib)
{
global $OUTPUT;
// pass the following attributes to the form class
$field_attrib = array('name' => '_charset');
foreach ($attrib as $attr => $value)
if (in_array($attr, array('id', 'class', 'style', 'size', 'tabindex')))
$field_attrib[$attr] = $value;
$charsets = array(
'US-ASCII' => 'ASCII (English)',
'EUC-JP' => 'EUC-JP (Japanese)',
'EUC-KR' => 'EUC-KR (Korean)',
'BIG5' => 'BIG5 (Chinese)',
'GB2312' => 'GB2312 (Chinese)',
'ISO-2022-JP' => 'ISO-2022-JP (Japanese)',
'ISO-8859-1' => 'ISO-8859-1 (Latin-1)',
'ISO-8859-2' => 'ISO-8895-2 (Central European)',
'ISO-8859-7' => 'ISO-8859-7 (Greek)',
'ISO-8859-9' => 'ISO-8859-9 (Turkish)',
'Windows-1251' => 'Windows-1251 (Cyrillic)',
'Windows-1252' => 'Windows-1252 (Western)',
'Windows-1255' => 'Windows-1255 (Hebrew)',
'Windows-1256' => 'Windows-1256 (Arabic)',
'Windows-1257' => 'Windows-1257 (Baltic)',
'UTF-8' => 'UTF-8'
);
$select = new select($field_attrib);
$select->add(array_values($charsets), array_keys($charsets));
$set = $_POST['_charset'] ? $_POST['_charset'] : $OUTPUT->get_charset();
return $select->show($set);
}
/****** debugging function ********/
function rcube_timer()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
function rcube_print_time($timer, $label='Timer')
{
static $print_count = 0;
$print_count++;
$now = rcube_timer();
$diff = $now-$timer;
if (empty($label))
$label = 'Timer '.$print_count;
console(sprintf("%s: %0.4f sec", $label, $diff));
}
?>
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index dccd64fc9..7ad4ad082 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -1,2092 +1,2113 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/include/rcube_imap.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| IMAP wrapper that implements the Iloha IMAP Library (IIL) |
| See http://ilohamail.org/ for details |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
/**
* Obtain classes from the Iloha IMAP library
*/
require_once('lib/imap.inc');
require_once('lib/mime.inc');
require_once('lib/utf7.inc');
/**
* Interface class for accessing an IMAP server
*
* This is a wrapper that implements the Iloha IMAP Library (IIL)
*
* @package RoundCube Webmail
* @author Thomas Bruederli <roundcube@gmail.com>
* @version 1.22
* @link http://ilohamail.org
*/
class rcube_imap
{
var $db;
var $conn;
var $root_ns = '';
var $root_dir = '';
var $mailbox = 'INBOX';
var $list_page = 1;
var $page_size = 10;
var $sort_field = 'date';
var $sort_order = 'DESC';
var $default_charset = 'ISO-8859-1';
var $delimiter = NULL;
var $caching_enabled = FALSE;
var $default_folders = array('inbox', 'drafts', 'sent', 'junk', 'trash');
var $cache = array();
var $cache_keys = array();
var $cache_changes = array();
var $uid_id_map = array();
var $msg_headers = array();
var $capabilities = array();
var $skip_deleted = FALSE;
var $debug_level = 1;
/**
* Object constructor
*
* @param object Database connection
*/
function __construct($db_conn)
{
$this->db = $db_conn;
}
/**
* PHP 4 object constructor
*
* @see rcube_imap::__construct
*/
function rcube_imap($db_conn)
{
$this->__construct($db_conn);
}
/**
* Connect to an IMAP server
*
* @param string Host to connect
* @param string Username for IMAP account
* @param string Password for IMAP account
* @param number Port to connect to
* @param boolean Use SSL connection
* @return boolean TRUE on success, FALSE on failure
* @access public
*/
function connect($host, $user, $pass, $port=143, $use_ssl=FALSE)
{
global $ICL_SSL, $ICL_PORT, $IMAP_USE_INTERNAL_DATE;
// check for Open-SSL support in PHP build
if ($use_ssl && in_array('openssl', get_loaded_extensions()))
$ICL_SSL = TRUE;
else if ($use_ssl)
{
raise_error(array('code' => 403, 'type' => 'imap', 'file' => __FILE__,
'message' => 'Open SSL not available;'), TRUE, FALSE);
$port = 143;
}
$ICL_PORT = $port;
$IMAP_USE_INTERNAL_DATE = false;
$this->conn = iil_Connect($host, $user, $pass, array('imap' => 'check'));
$this->host = $host;
$this->user = $user;
$this->pass = $pass;
$this->port = $port;
$this->ssl = $use_ssl;
// print trace mesages
if ($this->conn && ($this->debug_level & 8))
console($this->conn->message);
// write error log
else if (!$this->conn && $GLOBALS['iil_error'])
{
raise_error(array('code' => 403,
'type' => 'imap',
'message' => $GLOBALS['iil_error']), TRUE, FALSE);
}
// get account namespace
if ($this->conn)
{
$this->_parse_capability($this->conn->capability);
iil_C_NameSpace($this->conn);
if (!empty($this->conn->delimiter))
$this->delimiter = $this->conn->delimiter;
if (!empty($this->conn->rootdir))
{
$this->set_rootdir($this->conn->rootdir);
$this->root_ns = ereg_replace('[\.\/]$', '', $this->conn->rootdir);
}
}
return $this->conn ? TRUE : FALSE;
}
/**
* Close IMAP connection
* Usually done on script shutdown
*
* @access public
*/
function close()
{
if ($this->conn)
iil_Close($this->conn);
}
/**
* Close IMAP connection and re-connect
* This is used to avoid some strange socket errors when talking to Courier IMAP
*
* @access public
*/
function reconnect()
{
$this->close();
$this->connect($this->host, $this->user, $this->pass, $this->port, $this->ssl);
}
/**
* Set a root folder for the IMAP connection.
*
* Only folders within this root folder will be displayed
* and all folder paths will be translated using this folder name
*
* @param string Root folder
* @access public
*/
function set_rootdir($root)
{
if (ereg('[\.\/]$', $root)) //(substr($root, -1, 1)==='/')
$root = substr($root, 0, -1);
$this->root_dir = $root;
if (empty($this->delimiter))
$this->get_hierarchy_delimiter();
}
/**
* This list of folders will be listed above all other folders
*
* @param array Indexed list of folder names
* @access public
*/
function set_default_mailboxes($arr)
{
if (is_array($arr))
{
$this->default_folders = array();
// add mailbox names lower case
foreach ($arr as $mbox_row)
$this->default_folders[] = strtolower($mbox_row);
// add inbox if not included
if (!in_array('inbox', $this->default_folders))
array_unshift($arr, 'inbox');
}
}
/**
* Set internal mailbox reference.
*
* All operations will be perfomed on this mailbox/folder
*
* @param string Mailbox/Folder name
* @access public
*/
function set_mailbox($new_mbox)
{
$mailbox = $this->_mod_mailbox($new_mbox);
if ($this->mailbox == $mailbox)
return;
$this->mailbox = $mailbox;
// clear messagecount cache for this mailbox
$this->_clear_messagecount($mailbox);
}
/**
* Set internal list page
*
* @param number Page number to list
* @access public
*/
function set_page($page)
{
$this->list_page = (int)$page;
}
/**
* Set internal page size
*
* @param number Number of messages to display on one page
* @access public
*/
function set_pagesize($size)
{
$this->page_size = (int)$size;
}
/**
* Returns the currently used mailbox name
*
* @return string Name of the mailbox/folder
* @access public
*/
function get_mailbox_name()
{
return $this->conn ? $this->_mod_mailbox($this->mailbox, 'out') : '';
}
/**
* Returns the IMAP server's capability
*
* @param string Capability name
* @return mixed Capability value or TRUE if supported, FALSE if not
* @access public
*/
function get_capability($cap)
{
$cap = strtoupper($cap);
return $this->capabilities[$cap];
}
/**
* Returns the delimiter that is used by the IMAP server for folder separation
*
* @return string Delimiter string
* @access public
*/
function get_hierarchy_delimiter()
{
if ($this->conn && empty($this->delimiter))
$this->delimiter = iil_C_GetHierarchyDelimiter($this->conn);
if (empty($this->delimiter))
$this->delimiter = '/';
return $this->delimiter;
}
/**
* Public method for mailbox listing.
*
* Converts mailbox name with root dir first
*
* @param string Optional root folder
* @param string Optional filter for mailbox listing
* @return array List of mailboxes/folders
* @access public
*/
function list_mailboxes($root='', $filter='*')
{
$a_out = array();
$a_mboxes = $this->_list_mailboxes($root, $filter);
foreach ($a_mboxes as $mbox_row)
{
$name = $this->_mod_mailbox($mbox_row, 'out');
if (strlen($name))
$a_out[] = $name;
}
// sort mailboxes
$a_out = $this->_sort_mailbox_list($a_out);
return $a_out;
}
/**
* Private method for mailbox listing
*
* @return array List of mailboxes/folders
* @access private
* @see rcube_imap::list_mailboxes
*/
function _list_mailboxes($root='', $filter='*')
{
$a_defaults = $a_out = array();
// get cached folder list
$a_mboxes = $this->get_cache('mailboxes');
if (is_array($a_mboxes))
return $a_mboxes;
// retrieve list of folders from IMAP server
$a_folders = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox($root), $filter);
if (!is_array($a_folders) || !sizeof($a_folders))
$a_folders = array();
// create INBOX if it does not exist
if (!in_array_nocase('INBOX', $a_folders))
{
$this->create_mailbox('INBOX', TRUE);
array_unshift($a_folders, 'INBOX');
}
$a_mailbox_cache = array();
// write mailboxlist to cache
$this->update_cache('mailboxes', $a_folders);
return $a_folders;
}
/**
* Get message count for a specific mailbox
*
* @param string Mailbox/folder name
* @param string Mode for count [ALL|UNSEEN|RECENT]
* @param boolean Force reading from server and update cache
* @return number Number of messages
* @access public
*/
function messagecount($mbox_name='', $mode='ALL', $force=FALSE)
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
return $this->_messagecount($mailbox, $mode, $force);
}
/**
* Private method for getting nr of messages
*
* @access private
* @see rcube_imap::messagecount
*/
function _messagecount($mailbox='', $mode='ALL', $force=FALSE)
{
$a_mailbox_cache = FALSE;
$mode = strtoupper($mode);
if (empty($mailbox))
$mailbox = $this->mailbox;
$a_mailbox_cache = $this->get_cache('messagecount');
// return cached value
if (!$force && is_array($a_mailbox_cache[$mailbox]) && isset($a_mailbox_cache[$mailbox][$mode]))
return $a_mailbox_cache[$mailbox][$mode];
// RECENT count is fetched abit different
if ($mode == 'RECENT')
$count = iil_C_CheckForRecent($this->conn, $mailbox);
// use SEARCH for message counting
else if ($this->skip_deleted)
{
$search_str = "ALL UNDELETED";
// get message count and store in cache
if ($mode == 'UNSEEN')
$search_str .= " UNSEEN";
// get message count using SEARCH
// not very performant but more precise (using UNDELETED)
$count = 0;
$index = $this->_search_index($mailbox, $search_str);
if (is_array($index))
{
$str = implode(",", $index);
if (!empty($str))
$count = count($index);
}
}
else
{
if ($mode == 'UNSEEN')
$count = iil_C_CountUnseen($this->conn, $mailbox);
else
$count = iil_C_CountMessages($this->conn, $mailbox);
}
if (!is_array($a_mailbox_cache[$mailbox]))
$a_mailbox_cache[$mailbox] = array();
$a_mailbox_cache[$mailbox][$mode] = (int)$count;
// write back to cache
$this->update_cache('messagecount', $a_mailbox_cache);
return (int)$count;
}
/**
* Public method for listing headers
* convert mailbox name with root dir first
*
* @param string Mailbox/folder name
* @param number Current page to list
* @param string Header field to sort by
* @param string Sort order [ASC|DESC]
* @return array Indexed array with message header objects
* @access public
*/
function list_headers($mbox_name='', $page=NULL, $sort_field=NULL, $sort_order=NULL)
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
return $this->_list_headers($mailbox, $page, $sort_field, $sort_order);
}
/**
* Private method for listing message headers
*
* @access private
* @see rcube_imap::list_headers
*/
function _list_headers($mailbox='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $recursive=FALSE)
{
if (!strlen($mailbox))
return array();
if ($sort_field!=NULL)
$this->sort_field = $sort_field;
if ($sort_order!=NULL)
$this->sort_order = strtoupper($sort_order);
$max = $this->_messagecount($mailbox);
$start_msg = ($this->list_page-1) * $this->page_size;
list($begin, $end) = $this->_get_message_range($max, $page);
/*
if ($page=='all')
{
$begin = 0;
$end = $max;
}
else if (!$this->get_capability('sort') && $this->sort_order=='DESC')
{
$begin = $max - $this->page_size - $start_msg;
$end = $max - $start_msg;
}
else
{
$begin = $start_msg;
$end = $start_msg + $this->page_size;
}
if ($begin < 0) $begin = 0;
if ($end < 0) $end = $max;
if ($end > $max) $end = $max;
*/
//console("fetch headers $start_msg to ".($start_msg+$this->page_size)." (msg $begin to $end)");
$headers_sorted = FALSE;
$cache_key = $mailbox.'.msg';
$cache_status = $this->check_cache_status($mailbox, $cache_key);
//console("Cache status = $cache_status");
// cache is OK, we can get all messages from local cache
if ($cache_status>0)
{
$a_msg_headers = $this->get_message_cache($cache_key, $start_msg, $start_msg+$this->page_size, $this->sort_field, $this->sort_order);
$headers_sorted = TRUE;
}
else
{
// retrieve headers from IMAP
if ($this->get_capability('sort') && ($msg_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, $this->skip_deleted ? 'UNDELETED' : '')))
{
//console("$mailbox: ".join(',', $msg_index));
$msgs = $msg_index[$begin];
for ($i=$begin+1; $i < $end; $i++)
$msgs = $msgs.','.$msg_index[$i];
$sorted = TRUE;
}
else
{
$msgs = sprintf("%d:%d", $begin+1, $end);
$sorted = FALSE;
}
// cache is dirty, sync it
if ($this->caching_enabled && $cache_status==-1 && !$recursive)
{
$this->sync_header_index($mailbox);
return $this->_list_headers($mailbox, $page, $this->sort_field, $this->sort_order, TRUE);
}
// fetch reuested headers from server
$a_msg_headers = array();
$deleted_count = $this->_fetch_headers($mailbox, $msgs, $a_msg_headers, $cache_key);
// delete cached messages with a higher index than $max
$this->clear_message_cache($cache_key, $max);
// kick child process to sync cache
// ...
}
// return empty array if no messages found
if (!is_array($a_msg_headers) || empty($a_msg_headers))
return array();
// if not already sorted
// if (!$headers_sorted)
// $a_msg_headers = iil_SortHeaders($a_msg_headers, $this->sort_field, $this->sort_order);
if (!$headers_sorted && $this->sort_order == 'DESC')
$a_msg_headers = array_reverse($a_msg_headers);
return array_values($a_msg_headers);
}
/**
* Public method for listing a specific set of headers
* convert mailbox name with root dir first
*
* @param string Mailbox/folder name
* @param array List of message ids to list
* @param number Current page to list
* @param string Header field to sort by
* @param string Sort order [ASC|DESC]
* @return array Indexed array with message header objects
* @access public
*/
function list_header_set($mbox_name='', $msgs, $page=NULL, $sort_field=NULL, $sort_order=NULL)
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
return $this->_list_header_set($mailbox, $msgs, $page, $sort_field, $sort_order);
}
/**
* Private method for listing a set of message headers
*
* @access private
* @see rcube_imap::list_header_set
*/
function _list_header_set($mailbox, $msgs, $page=NULL, $sort_field=NULL, $sort_order=NULL)
{
// also accept a comma-separated list of message ids
if (is_string($msgs))
$msgs = split(',', $msgs);
if (!strlen($mailbox) || empty($msgs))
return array();
if ($sort_field!=NULL)
$this->sort_field = $sort_field;
if ($sort_order!=NULL)
$this->sort_order = strtoupper($sort_order);
$max = count($msgs);
$start_msg = ($this->list_page-1) * $this->page_size;
// fetch reuested headers from server
$a_msg_headers = array();
$this->_fetch_headers($mailbox, join(',', $msgs), $a_msg_headers, NULL);
// return empty array if no messages found
if (!is_array($a_msg_headers) || empty($a_msg_headers))
return array();
// if not already sorted
$a_msg_headers = iil_SortHeaders($a_msg_headers, $this->sort_field, $this->sort_order);
// only return the requested part of the set
return array_slice(array_values($a_msg_headers), $start_msg, min($max-$start_msg, $this->page_size));
}
/**
* Helper function to get first and last index of the requested set
*
* @param number message count
* @param mixed page number to show, or string 'all'
* @return array array with two values: first index, last index
* @access private
*/
function _get_message_range($max, $page)
{
$start_msg = ($this->list_page-1) * $this->page_size;
if ($page=='all')
{
$begin = 0;
$end = $max;
}
else if ($this->sort_order=='DESC')
{
$begin = $max - $this->page_size - $start_msg;
$end = $max - $start_msg;
}
else
{
$begin = $start_msg;
$end = $start_msg + $this->page_size;
}
if ($begin < 0) $begin = 0;
if ($end < 0) $end = $max;
if ($end > $max) $end = $max;
return array($begin, $end);
}
/**
* Fetches message headers
* Used for loop
*
* @param string Mailbox name
* @param string Message index to fetch
* @param array Reference to message headers array
* @param array Array with cache index
* @return number Number of deleted messages
* @access private
*/
function _fetch_headers($mailbox, $msgs, &$a_msg_headers, $cache_key)
{
// cache is incomplete
$cache_index = $this->get_message_cache_index($cache_key);
// fetch reuested headers from server
$a_header_index = iil_C_FetchHeaders($this->conn, $mailbox, $msgs);
$deleted_count = 0;
if (!empty($a_header_index))
{
foreach ($a_header_index as $i => $headers)
{
if ($headers->deleted && $this->skip_deleted)
{
// delete from cache
if ($cache_index[$headers->id] && $cache_index[$headers->id] == $headers->uid)
$this->remove_message_cache($cache_key, $headers->id);
$deleted_count++;
continue;
}
// add message to cache
if ($this->caching_enabled && $cache_index[$headers->id] != $headers->uid)
$this->add_message_cache($cache_key, $headers->id, $headers);
$a_msg_headers[$headers->uid] = $headers;
}
}
return $deleted_count;
}
// return sorted array of message UIDs
function message_index($mbox_name='', $sort_field=NULL, $sort_order=NULL)
{
if ($sort_field!=NULL)
$this->sort_field = $sort_field;
if ($sort_order!=NULL)
$this->sort_order = strtoupper($sort_order);
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
$key = "$mbox:".$this->sort_field.":".$this->sort_order.".msgi";
// have stored it in RAM
if (isset($this->cache[$key]))
return $this->cache[$key];
// check local cache
$cache_key = $mailbox.'.msg';
$cache_status = $this->check_cache_status($mailbox, $cache_key);
// cache is OK
if ($cache_status>0)
{
$a_index = $this->get_message_cache_index($cache_key, TRUE, $this->sort_field, $this->sort_order);
return array_values($a_index);
}
// fetch complete message index
$msg_count = $this->_messagecount($mailbox);
if ($this->get_capability('sort') && ($a_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, '', TRUE)))
{
if ($this->sort_order == 'DESC')
$a_index = array_reverse($a_index);
$this->cache[$key] = $a_index;
}
else
{
$a_index = iil_C_FetchHeaderIndex($this->conn, $mailbox, "1:$msg_count", $this->sort_field);
$a_uids = iil_C_FetchUIDs($this->conn, $mailbox);
if ($this->sort_order=="ASC")
asort($a_index);
else if ($this->sort_order=="DESC")
arsort($a_index);
$i = 0;
$this->cache[$key] = array();
foreach ($a_index as $index => $value)
$this->cache[$key][$i++] = $a_uids[$index];
}
return $this->cache[$key];
}
function sync_header_index($mailbox)
{
$cache_key = $mailbox.'.msg';
$cache_index = $this->get_message_cache_index($cache_key);
$msg_count = $this->_messagecount($mailbox);
// fetch complete message index
$a_message_index = iil_C_FetchHeaderIndex($this->conn, $mailbox, "1:$msg_count", 'UID');
foreach ($a_message_index as $id => $uid)
{
// message in cache at correct position
if ($cache_index[$id] == $uid)
{
// console("$id / $uid: OK");
unset($cache_index[$id]);
continue;
}
// message in cache but in wrong position
if (in_array((string)$uid, $cache_index, TRUE))
{
// console("$id / $uid: Moved");
unset($cache_index[$id]);
}
// other message at this position
if (isset($cache_index[$id]))
{
// console("$id / $uid: Delete");
$this->remove_message_cache($cache_key, $id);
unset($cache_index[$id]);
}
// console("$id / $uid: Add");
// fetch complete headers and add to cache
$headers = iil_C_FetchHeader($this->conn, $mailbox, $id);
$this->add_message_cache($cache_key, $headers->id, $headers);
}
// those ids that are still in cache_index have been deleted
if (!empty($cache_index))
{
foreach ($cache_index as $id => $uid)
$this->remove_message_cache($cache_key, $id);
}
}
/**
* Invoke search request to IMAP server
*
* @param string mailbox name to search in
* @param string search criteria (ALL, TO, FROM, SUBJECT, etc)
* @param string search string
* @return array search results as list of message ids
* @access public
*/
function search($mbox_name='', $criteria='ALL', $str=NULL)
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
if ($str && $criteria)
{
$criteria = 'CHARSET UTF-8 '.$criteria.' "'.UTF7EncodeString($str).'"';
return $this->_search_index($mailbox, $criteria);
}
else
return $this->_search_index($mailbox, $criteria);
}
/**
* Private search method
*
* @return array search results as list of message ids
* @access private
* @see rcube_imap::search()
*/
function _search_index($mailbox, $criteria='ALL')
{
$a_messages = iil_C_Search($this->conn, $mailbox, $criteria);
// clean message list (there might be some empty entries)
if (is_array($a_messages))
{
foreach ($a_messages as $i => $val)
if (empty($val))
unset($a_messages[$i]);
}
return $a_messages;
}
function get_headers($id, $mbox_name=NULL, $is_uid=TRUE)
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
// get cached headers
if ($is_uid && ($headers = $this->get_cached_message($mailbox.'.msg', $id)))
return $headers;
$msg_id = $is_uid ? $this->_uid2id($id) : $id;
$headers = iil_C_FetchHeader($this->conn, $mailbox, $msg_id);
// write headers cache
if ($headers)
$this->add_message_cache($mailbox.'.msg', $msg_id, $headers);
return $headers;
}
function get_body($uid, $part=1)
{
if (!($msg_id = $this->_uid2id($uid)))
return FALSE;
$structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id);
$structure = iml_GetRawStructureArray($structure_str);
$body = iil_C_FetchPartBody($this->conn, $this->mailbox, $msg_id, $part);
$encoding = iml_GetPartEncodingCode($structure, $part);
if ($encoding==3) $body = $this->mime_decode($body, 'base64');
else if ($encoding==4) $body = $this->mime_decode($body, 'quoted-printable');
return $body;
}
function get_raw_body($uid)
{
if (!($msg_id = $this->_uid2id($uid)))
return FALSE;
$body = iil_C_FetchPartHeader($this->conn, $this->mailbox, $msg_id, NULL);
$body .= iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, NULL, 1);
return $body;
}
// set message flag to one or several messages
// possible flags are: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT
function set_flag($uids, $flag)
{
$flag = strtoupper($flag);
$msg_ids = array();
if (!is_array($uids))
$uids = explode(',',$uids);
foreach ($uids as $uid) {
$msg_ids[$uid] = $this->_uid2id($uid);
}
if ($flag=='UNDELETED')
$result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids)));
else if ($flag=='UNSEEN')
$result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids)));
else
$result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag);
// reload message headers if cached
$cache_key = $this->mailbox.'.msg';
if ($this->caching_enabled)
{
foreach ($msg_ids as $uid => $id)
{
if ($cached_headers = $this->get_cached_message($cache_key, $uid))
{
$this->remove_message_cache($cache_key, $id);
//$this->get_headers($uid);
}
}
// close and re-open connection
// this prevents connection problems with Courier
$this->reconnect();
}
// set nr of messages that were flaged
$count = count($msg_ids);
// clear message count cache
if ($result && $flag=='SEEN')
$this->_set_messagecount($this->mailbox, 'UNSEEN', $count*(-1));
else if ($result && $flag=='UNSEEN')
$this->_set_messagecount($this->mailbox, 'UNSEEN', $count);
else if ($result && $flag=='DELETED')
$this->_set_messagecount($this->mailbox, 'ALL', $count*(-1));
return $result;
}
// append a mail message (source) to a specific mailbox
function save_message($mbox_name, &$message)
{
$mailbox = $this->_mod_mailbox($mbox_name);
// make sure mailbox exists
if (in_array($mailbox, $this->_list_mailboxes()))
$saved = iil_C_Append($this->conn, $mailbox, $message);
if ($saved)
{
// increase messagecount of the target mailbox
$this->_set_messagecount($mailbox, 'ALL', 1);
}
return $saved;
}
// move a message from one mailbox to another
function move_message($uids, $to_mbox, $from_mbox='')
{
$to_mbox = $this->_mod_mailbox($to_mbox);
$from_mbox = $from_mbox ? $this->_mod_mailbox($from_mbox) : $this->mailbox;
// make sure mailbox exists
if (!in_array($to_mbox, $this->_list_mailboxes()))
{
if (in_array(strtolower($to_mbox), $this->default_folders))
$this->create_mailbox($to_mbox, TRUE);
else
return FALSE;
}
// convert the list of uids to array
$a_uids = is_string($uids) ? explode(',', $uids) : (is_array($uids) ? $uids : NULL);
// exit if no message uids are specified
if (!is_array($a_uids))
return false;
// convert uids to message ids
$a_mids = array();
foreach ($a_uids as $uid)
$a_mids[] = $this->_uid2id($uid, $from_mbox);
$moved = iil_C_Move($this->conn, join(',', $a_mids), $from_mbox, $to_mbox);
// send expunge command in order to have the moved message
// really deleted from the source mailbox
if ($moved)
{
$this->_expunge($from_mbox, FALSE);
$this->_clear_messagecount($from_mbox);
$this->_clear_messagecount($to_mbox);
}
// update cached message headers
$cache_key = $from_mbox.'.msg';
if ($moved && ($a_cache_index = $this->get_message_cache_index($cache_key)))
{
$start_index = 100000;
foreach ($a_uids as $uid)
{
$index = array_search($uid, $a_cache_index);
$start_index = min($index, $start_index);
}
// clear cache from the lowest index on
$this->clear_message_cache($cache_key, $start_index);
}
return $moved;
}
// mark messages as deleted and expunge mailbox
function delete_message($uids, $mbox_name='')
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
// convert the list of uids to array
$a_uids = is_string($uids) ? explode(',', $uids) : (is_array($uids) ? $uids : NULL);
// exit if no message uids are specified
if (!is_array($a_uids))
return false;
// convert uids to message ids
$a_mids = array();
foreach ($a_uids as $uid)
$a_mids[] = $this->_uid2id($uid, $mailbox);
$deleted = iil_C_Delete($this->conn, $mailbox, join(',', $a_mids));
// send expunge command in order to have the deleted message
// really deleted from the mailbox
if ($deleted)
{
$this->_expunge($mailbox, FALSE);
$this->_clear_messagecount($mailbox);
}
// remove deleted messages from cache
$cache_key = $mailbox.'.msg';
if ($deleted && ($a_cache_index = $this->get_message_cache_index($cache_key)))
{
$start_index = 100000;
foreach ($a_uids as $uid)
{
$index = array_search($uid, $a_cache_index);
$start_index = min($index, $start_index);
}
// clear cache from the lowest index on
$this->clear_message_cache($cache_key, $start_index);
}
return $deleted;
}
// clear all messages in a specific mailbox
function clear_mailbox($mbox_name=NULL)
{
$mailbox = !empty($mbox_name) ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
$msg_count = $this->_messagecount($mailbox, 'ALL');
if ($msg_count>0)
{
$cleared = iil_C_ClearFolder($this->conn, $mailbox);
// make sure the message count cache is cleared as well
if ($cleared)
{
$this->clear_message_cache($mailbox.'.msg');
$a_mailbox_cache = $this->get_cache('messagecount');
unset($a_mailbox_cache[$mailbox]);
$this->update_cache('messagecount', $a_mailbox_cache);
}
return $cleared;
}
else
return 0;
}
// send IMAP expunge command and clear cache
function expunge($mbox_name='', $clear_cache=TRUE)
{
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
return $this->_expunge($mailbox, $clear_cache);
}
// send IMAP expunge command and clear cache
function _expunge($mailbox, $clear_cache=TRUE)
{
$result = iil_C_Expunge($this->conn, $mailbox);
if ($result>=0 && $clear_cache)
{
//$this->clear_message_cache($mailbox.'.msg');
$this->_clear_messagecount($mailbox);
}
return $result;
}
/* --------------------------------
* folder managment
* --------------------------------*/
// return an array with all folders available in IMAP server
function list_unsubscribed($root='')
{
static $sa_unsubscribed;
if (is_array($sa_unsubscribed))
return $sa_unsubscribed;
// retrieve list of folders from IMAP server
$a_mboxes = iil_C_ListMailboxes($this->conn, $this->_mod_mailbox($root), '*');
// modify names with root dir
foreach ($a_mboxes as $mbox_name)
{
$name = $this->_mod_mailbox($mbox_name, 'out');
if (strlen($name))
$a_folders[] = $name;
}
// filter folders and sort them
$sa_unsubscribed = $this->_sort_mailbox_list($a_folders);
return $sa_unsubscribed;
}
/**
* Get quota
* added by Nuny
*/
function get_quota()
{
if ($this->get_capability('QUOTA'))
{
$result = iil_C_GetQuota($this->conn);
if ($result["total"])
return sprintf("%.2fMB / %.2fMB (%.0f%%)", $result["used"] / 1000.0, $result["total"] / 1000.0, $result["percent"]);
}
return FALSE;
}
// subscribe to a specific mailbox(es)
function subscribe($mbox_name, $mode='subscribe')
{
if (is_array($mbox_name))
$a_mboxes = $mbox_name;
else if (is_string($mbox_name) && strlen($mbox_name))
$a_mboxes = explode(',', $mbox_name);
// let this common function do the main work
return $this->_change_subscription($a_mboxes, 'subscribe');
}
// unsubscribe mailboxes
function unsubscribe($mbox_name)
{
if (is_array($mbox_name))
$a_mboxes = $mbox_name;
else if (is_string($mbox_name) && strlen($mbox_name))
$a_mboxes = explode(',', $mbox_name);
// let this common function do the main work
return $this->_change_subscription($a_mboxes, 'unsubscribe');
}
// create a new mailbox on the server and register it in local cache
function create_mailbox($name, $subscribe=FALSE)
{
$result = FALSE;
// replace backslashes
$name = preg_replace('/[\\\]+/', '-', $name);
$name_enc = UTF7EncodeString($name);
// reduce mailbox name to 100 chars
$name_enc = substr($name_enc, 0, 100);
$abs_name = $this->_mod_mailbox($name_enc);
$a_mailbox_cache = $this->get_cache('mailboxes');
if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array($abs_name, $a_mailbox_cache)))
$result = iil_C_CreateFolder($this->conn, $abs_name);
// update mailboxlist cache
if ($result && $subscribe)
$this->subscribe($name_enc);
return $result ? $name : FALSE;
}
// set a new name to an existing mailbox
- function rename_mailbox($mbox_name, $new_name)
+ function rename_mailbox($mbox_name, $new_name, $subscribe=TRUE)
{
- // not implemented yet
+ $result = FALSE;
+
+ // replace backslashes
+ $name = preg_replace('/[\\\]+/', '-', $new_name);
+
+ $name_enc = UTF7EncodeString($new_name);
+
+ // reduce mailbox name to 100 chars
+ $name_enc = substr($name_enc, 0, 100);
+
+ $abs_name = $this->_mod_mailbox($name_enc);
+ $a_mailbox_cache = $this->get_cache('mailboxes');
+
+ if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array($abs_name, $a_mailbox_cache)))
+ $result = iil_C_RenameFolder($this->conn, $mbox_name, $abs_name);
+
+ // update mailboxlist cache
+ if ($result && $subscribe)
+ $this->unsubscribe($mbox_name);
+ $this->subscribe($name_enc);
+
+ return $result ? $name : FALSE;
}
// remove mailboxes from server
function delete_mailbox($mbox_name)
{
$deleted = FALSE;
if (is_array($mbox_name))
$a_mboxes = $mbox_name;
else if (is_string($mbox_name) && strlen($mbox_name))
$a_mboxes = explode(',', $mbox_name);
if (is_array($a_mboxes))
foreach ($a_mboxes as $mbox_name)
{
$mailbox = $this->_mod_mailbox($mbox_name);
// unsubscribe mailbox before deleting
iil_C_UnSubscribe($this->conn, $mailbox);
// send delete command to server
$result = iil_C_DeleteFolder($this->conn, $mailbox);
if ($result>=0)
$deleted = TRUE;
}
// clear mailboxlist cache
if ($deleted)
{
$this->clear_message_cache($mailbox.'.msg');
$this->clear_cache('mailboxes');
}
return $deleted;
}
/* --------------------------------
* internal caching methods
* --------------------------------*/
function set_caching($set)
{
if ($set && is_object($this->db))
$this->caching_enabled = TRUE;
else
$this->caching_enabled = FALSE;
}
function get_cache($key)
{
// read cache
if (!isset($this->cache[$key]) && $this->caching_enabled)
{
$cache_data = $this->_read_cache_record('IMAP.'.$key);
$this->cache[$key] = strlen($cache_data) ? unserialize($cache_data) : FALSE;
}
return $this->cache[$key];
}
function update_cache($key, $data)
{
$this->cache[$key] = $data;
$this->cache_changed = TRUE;
$this->cache_changes[$key] = TRUE;
}
function write_cache()
{
if ($this->caching_enabled && $this->cache_changed)
{
foreach ($this->cache as $key => $data)
{
if ($this->cache_changes[$key])
$this->_write_cache_record('IMAP.'.$key, serialize($data));
}
}
}
function clear_cache($key=NULL)
{
if ($key===NULL)
{
foreach ($this->cache as $key => $data)
$this->_clear_cache_record('IMAP.'.$key);
$this->cache = array();
$this->cache_changed = FALSE;
$this->cache_changes = array();
}
else
{
$this->_clear_cache_record('IMAP.'.$key);
$this->cache_changes[$key] = FALSE;
unset($this->cache[$key]);
}
}
function _read_cache_record($key)
{
$cache_data = FALSE;
if ($this->db)
{
// get cached data from DB
$sql_result = $this->db->query(
"SELECT cache_id, data
FROM ".get_table_name('cache')."
WHERE user_id=?
AND cache_key=?",
$_SESSION['user_id'],
$key);
if ($sql_arr = $this->db->fetch_assoc($sql_result))
{
$cache_data = $sql_arr['data'];
$this->cache_keys[$key] = $sql_arr['cache_id'];
}
}
return $cache_data;
}
function _write_cache_record($key, $data)
{
if (!$this->db)
return FALSE;
// check if we already have a cache entry for this key
if (!isset($this->cache_keys[$key]))
{
$sql_result = $this->db->query(
"SELECT cache_id
FROM ".get_table_name('cache')."
WHERE user_id=?
AND cache_key=?",
$_SESSION['user_id'],
$key);
if ($sql_arr = $this->db->fetch_assoc($sql_result))
$this->cache_keys[$key] = $sql_arr['cache_id'];
else
$this->cache_keys[$key] = FALSE;
}
// update existing cache record
if ($this->cache_keys[$key])
{
$this->db->query(
"UPDATE ".get_table_name('cache')."
SET created=now(),
data=?
WHERE user_id=?
AND cache_key=?",
$data,
$_SESSION['user_id'],
$key);
}
// add new cache record
else
{
$this->db->query(
"INSERT INTO ".get_table_name('cache')."
(created, user_id, cache_key, data)
VALUES (now(), ?, ?, ?)",
$_SESSION['user_id'],
$key,
$data);
}
}
function _clear_cache_record($key)
{
$this->db->query(
"DELETE FROM ".get_table_name('cache')."
WHERE user_id=?
AND cache_key=?",
$_SESSION['user_id'],
$key);
}
/* --------------------------------
* message caching methods
* --------------------------------*/
// checks if the cache is up-to-date
// return: -3 = off, -2 = incomplete, -1 = dirty
function check_cache_status($mailbox, $cache_key)
{
if (!$this->caching_enabled)
return -3;
$cache_index = $this->get_message_cache_index($cache_key, TRUE);
$msg_count = $this->_messagecount($mailbox);
$cache_count = count($cache_index);
// console("Cache check: $msg_count !== ".count($cache_index));
if ($cache_count==$msg_count)
{
// get highest index
$header = iil_C_FetchHeader($this->conn, $mailbox, "$msg_count");
$cache_uid = array_pop($cache_index);
// uids of highest message matches -> cache seems OK
if ($cache_uid == $header->uid)
return 1;
// cache is dirty
return -1;
}
// if cache count differs less than 10% report as dirty
else if (abs($msg_count - $cache_count) < $msg_count/10)
return -1;
else
return -2;
}
function get_message_cache($key, $from, $to, $sort_field, $sort_order)
{
$cache_key = "$key:$from:$to:$sort_field:$sort_order";
$db_header_fields = array('idx', 'uid', 'subject', 'from', 'to', 'cc', 'date', 'size');
if (!in_array($sort_field, $db_header_fields))
$sort_field = 'idx';
if ($this->caching_enabled && !isset($this->cache[$cache_key]))
{
$this->cache[$cache_key] = array();
$sql_result = $this->db->limitquery(
"SELECT idx, uid, headers
FROM ".get_table_name('messages')."
WHERE user_id=?
AND cache_key=?
ORDER BY ".$this->db->quoteIdentifier($sort_field)." ".
strtoupper($sort_order),
$from,
$to-$from,
$_SESSION['user_id'],
$key);
while ($sql_arr = $this->db->fetch_assoc($sql_result))
{
$uid = $sql_arr['uid'];
$this->cache[$cache_key][$uid] = unserialize($sql_arr['headers']);
}
}
return $this->cache[$cache_key];
}
function get_cached_message($key, $uid, $body=FALSE)
{
if (!$this->caching_enabled)
return FALSE;
$internal_key = '__single_msg';
if ($this->caching_enabled && (!isset($this->cache[$internal_key][$uid]) || $body))
{
$sql_select = "idx, uid, headers";
if ($body)
$sql_select .= ", body";
$sql_result = $this->db->query(
"SELECT $sql_select
FROM ".get_table_name('messages')."
WHERE user_id=?
AND cache_key=?
AND uid=?",
$_SESSION['user_id'],
$key,
$uid);
if ($sql_arr = $this->db->fetch_assoc($sql_result))
{
$headers = unserialize($sql_arr['headers']);
if (is_object($headers) && !empty($sql_arr['body']))
$headers->body = $sql_arr['body'];
$this->cache[$internal_key][$uid] = $headers;
}
}
return $this->cache[$internal_key][$uid];
}
function get_message_cache_index($key, $force=FALSE, $sort_col='idx', $sort_order='ASC')
{
static $sa_message_index = array();
// empty key -> empty array
if (empty($key))
return array();
if (!empty($sa_message_index[$key]) && !$force)
return $sa_message_index[$key];
$sa_message_index[$key] = array();
$sql_result = $this->db->query(
"SELECT idx, uid
FROM ".get_table_name('messages')."
WHERE user_id=?
AND cache_key=?
ORDER BY ".$this->db->quote_identifier($sort_col)." ".$sort_order,
$_SESSION['user_id'],
$key);
while ($sql_arr = $this->db->fetch_assoc($sql_result))
$sa_message_index[$key][$sql_arr['idx']] = $sql_arr['uid'];
return $sa_message_index[$key];
}
function add_message_cache($key, $index, $headers)
{
if (!$key || !is_object($headers) || empty($headers->uid))
return;
$this->db->query(
"INSERT INTO ".get_table_name('messages')."
(user_id, del, cache_key, created, idx, uid, subject, ".$this->db->quoteIdentifier('from').", ".$this->db->quoteIdentifier('to').", cc, date, size, headers)
VALUES (?, 0, ?, now(), ?, ?, ?, ?, ?, ?, ".$this->db->fromunixtime($headers->timestamp).", ?, ?)",
$_SESSION['user_id'],
$key,
$index,
$headers->uid,
(string)substr($this->decode_header($headers->subject, TRUE), 0, 128),
(string)substr($this->decode_header($headers->from, TRUE), 0, 128),
(string)substr($this->decode_header($headers->to, TRUE), 0, 128),
(string)substr($this->decode_header($headers->cc, TRUE), 0, 128),
(int)$headers->size,
serialize($headers));
}
function remove_message_cache($key, $index)
{
$this->db->query(
"DELETE FROM ".get_table_name('messages')."
WHERE user_id=?
AND cache_key=?
AND idx=?",
$_SESSION['user_id'],
$key,
$index);
}
function clear_message_cache($key, $start_index=1)
{
$this->db->query(
"DELETE FROM ".get_table_name('messages')."
WHERE user_id=?
AND cache_key=?
AND idx>=?",
$_SESSION['user_id'],
$key,
$start_index);
}
/* --------------------------------
* encoding/decoding methods
* --------------------------------*/
function decode_address_list($input, $max=NULL)
{
$a = $this->_parse_address_list($input);
$out = array();
if (!is_array($a))
return $out;
$c = count($a);
$j = 0;
foreach ($a as $val)
{
$j++;
$address = $val['address'];
$name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name']));
$string = $name!==$address ? sprintf('%s <%s>', strpos($name, ',')!==FALSE ? '"'.$name.'"' : $name, $address) : $address;
$out[$j] = array('name' => $name,
'mailto' => $address,
'string' => $string);
if ($max && $j==$max)
break;
}
return $out;
}
function decode_header($input, $remove_quotes=FALSE)
{
$str = $this->decode_mime_string((string)$input);
if ($str{0}=='"' && $remove_quotes)
{
$str = str_replace('"', '', $str);
}
return $str;
}
function decode_mime_string($input)
{
$out = '';
$pos = strpos($input, '=?');
if ($pos !== false)
{
$out = substr($input, 0, $pos);
$end_cs_pos = strpos($input, "?", $pos+2);
$end_en_pos = strpos($input, "?", $end_cs_pos+1);
$end_pos = strpos($input, "?=", $end_en_pos+1);
$encstr = substr($input, $pos+2, ($end_pos-$pos-2));
$rest = substr($input, $end_pos+2);
$out .= rcube_imap::_decode_mime_string_part($encstr);
$out .= rcube_imap::decode_mime_string($rest);
return $out;
}
// no encoding information, defaults to what is specified in the class header
return rcube_charset_convert($input, $this->default_charset);
}
function _decode_mime_string_part($str)
{
$a = explode('?', $str);
$count = count($a);
// should be in format "charset?encoding?base64_string"
if ($count >= 3)
{
for ($i=2; $i<$count; $i++)
$rest.=$a[$i];
if (($a[1]=="B")||($a[1]=="b"))
$rest = base64_decode($rest);
else if (($a[1]=="Q")||($a[1]=="q"))
{
$rest = str_replace("_", " ", $rest);
$rest = quoted_printable_decode($rest);
}
return rcube_charset_convert($rest, $a[0]);
}
else
return $str; // we dont' know what to do with this
}
function mime_decode($input, $encoding='7bit')
{
switch (strtolower($encoding))
{
case '7bit':
return $input;
break;
case 'quoted-printable':
return quoted_printable_decode($input);
break;
case 'base64':
return base64_decode($input);
break;
default:
return $input;
}
}
function mime_encode($input, $encoding='7bit')
{
switch ($encoding)
{
case 'quoted-printable':
return quoted_printable_encode($input);
break;
case 'base64':
return base64_encode($input);
break;
default:
return $input;
}
}
// convert body chars according to the ctype_parameters
function charset_decode($body, $ctype_param)
{
if (is_array($ctype_param) && !empty($ctype_param['charset']))
return rcube_charset_convert($body, $ctype_param['charset']);
// defaults to what is specified in the class header
return rcube_charset_convert($body, $this->default_charset);
}
/* --------------------------------
* private methods
* --------------------------------*/
function _mod_mailbox($mbox_name, $mode='in')
{
if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || ($mbox_name == 'INBOX' && $mode == 'in'))
return $mbox_name;
if (!empty($this->root_dir) && $mode=='in')
$mbox_name = $this->root_dir.$this->delimiter.$mbox_name;
else if (strlen($this->root_dir) && $mode=='out')
$mbox_name = substr($mbox_name, strlen($this->root_dir)+1);
return $mbox_name;
}
// sort mailboxes first by default folders and then in alphabethical order
function _sort_mailbox_list($a_folders)
{
$a_out = $a_defaults = array();
// find default folders and skip folders starting with '.'
foreach($a_folders as $i => $folder)
{
if ($folder{0}=='.')
continue;
if (($p = array_search(strtolower($folder), $this->default_folders))!==FALSE)
$a_defaults[$p] = $folder;
else
$a_out[] = $folder;
}
sort($a_out);
ksort($a_defaults);
return array_merge($a_defaults, $a_out);
}
function get_id($uid, $mbox_name=NULL)
{
return $this->_uid2id($uid, $mbox_name);
}
function get_uid($id,$mbox_name=NULL)
{
return $this->_id2uid($id, $mbox_name);
}
function _uid2id($uid, $mbox_name=NULL)
{
if (!$mbox_name)
$mbox_name = $this->mailbox;
if (!isset($this->uid_id_map[$mbox_name][$uid]))
$this->uid_id_map[$mbox_name][$uid] = iil_C_UID2ID($this->conn, $mbox_name, $uid);
return $this->uid_id_map[$mbox_name][$uid];
}
function _id2uid($id, $mbox_name=NULL)
{
if (!$mbox_name)
$mbox_name = $this->mailbox;
return iil_C_ID2UID($this->conn, $mbox_name, $id);
}
// parse string or array of server capabilities and put them in internal array
function _parse_capability($caps)
{
if (!is_array($caps))
$cap_arr = explode(' ', $caps);
else
$cap_arr = $caps;
foreach ($cap_arr as $cap)
{
if ($cap=='CAPABILITY')
continue;
if (strpos($cap, '=')>0)
{
list($key, $value) = explode('=', $cap);
if (!is_array($this->capabilities[$key]))
$this->capabilities[$key] = array();
$this->capabilities[$key][] = $value;
}
else
$this->capabilities[$cap] = TRUE;
}
}
// subscribe/unsubscribe a list of mailboxes and update local cache
function _change_subscription($a_mboxes, $mode)
{
$updated = FALSE;
if (is_array($a_mboxes))
foreach ($a_mboxes as $i => $mbox_name)
{
$mailbox = $this->_mod_mailbox($mbox_name);
$a_mboxes[$i] = $mailbox;
if ($mode=='subscribe')
$result = iil_C_Subscribe($this->conn, $mailbox);
else if ($mode=='unsubscribe')
$result = iil_C_UnSubscribe($this->conn, $mailbox);
if ($result>=0)
$updated = TRUE;
}
// get cached mailbox list
if ($updated)
{
$a_mailbox_cache = $this->get_cache('mailboxes');
if (!is_array($a_mailbox_cache))
return $updated;
// modify cached list
if ($mode=='subscribe')
$a_mailbox_cache = array_merge($a_mailbox_cache, $a_mboxes);
else if ($mode=='unsubscribe')
$a_mailbox_cache = array_diff($a_mailbox_cache, $a_mboxes);
// write mailboxlist to cache
$this->update_cache('mailboxes', $this->_sort_mailbox_list($a_mailbox_cache));
}
return $updated;
}
// increde/decrese messagecount for a specific mailbox
function _set_messagecount($mbox_name, $mode, $increment)
{
$a_mailbox_cache = FALSE;
$mailbox = $mbox_name ? $mbox_name : $this->mailbox;
$mode = strtoupper($mode);
$a_mailbox_cache = $this->get_cache('messagecount');
if (!is_array($a_mailbox_cache[$mailbox]) || !isset($a_mailbox_cache[$mailbox][$mode]) || !is_numeric($increment))
return FALSE;
// add incremental value to messagecount
$a_mailbox_cache[$mailbox][$mode] += $increment;
// there's something wrong, delete from cache
if ($a_mailbox_cache[$mailbox][$mode] < 0)
unset($a_mailbox_cache[$mailbox][$mode]);
// write back to cache
$this->update_cache('messagecount', $a_mailbox_cache);
return TRUE;
}
// remove messagecount of a specific mailbox from cache
function _clear_messagecount($mbox_name='')
{
$a_mailbox_cache = FALSE;
$mailbox = $mbox_name ? $mbox_name : $this->mailbox;
$a_mailbox_cache = $this->get_cache('messagecount');
if (is_array($a_mailbox_cache[$mailbox]))
{
unset($a_mailbox_cache[$mailbox]);
$this->update_cache('messagecount', $a_mailbox_cache);
}
}
function _parse_address_list($str)
{
$a = $this->_explode_quoted_string(',', $str);
$result = array();
foreach ($a as $key => $val)
{
$val = str_replace("\"<", "\" <", $val);
$sub_a = $this->_explode_quoted_string(' ', $val);
foreach ($sub_a as $k => $v)
{
if ((strpos($v, '@') > 0) && (strpos($v, '.') > 0))
$result[$key]['address'] = str_replace('<', '', str_replace('>', '', $v));
else
$result[$key]['name'] .= (empty($result[$key]['name'])?'':' ').str_replace("\"",'',stripslashes($v));
}
if (empty($result[$key]['name']))
$result[$key]['name'] = $result[$key]['address'];
$result[$key]['name'] = $this->decode_header($result[$key]['name']);
}
return $result;
}
function _explode_quoted_string($delimiter, $string)
{
$quotes = explode("\"", $string);
foreach ($quotes as $key => $val)
if (($key % 2) == 1)
$quotes[$key] = str_replace($delimiter, "_!@!_", $quotes[$key]);
$string = implode("\"", $quotes);
$result = explode($delimiter, $string);
foreach ($result as $key => $val)
$result[$key] = str_replace("_!@!_", $delimiter, $result[$key]);
return $result;
}
}
function quoted_printable_encode($input="", $line_max=76, $space_conv=false)
{
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split("/(?:\r\n|\r|\n)/", $input);
$eol = "\r\n";
$escape = "=";
$output = "";
while( list(, $line) = each($lines))
{
//$line = rtrim($line); // remove trailing white space -> no =20\r\n necessary
$linlen = strlen($line);
$newline = "";
for($i = 0; $i < $linlen; $i++)
{
$c = substr( $line, $i, 1 );
$dec = ord( $c );
if ( ( $i == 0 ) && ( $dec == 46 ) ) // convert first point in the line into =2E
{
$c = "=2E";
}
if ( $dec == 32 )
{
if ( $i == ( $linlen - 1 ) ) // convert space at eol only
{
$c = "=20";
}
else if ( $space_conv )
{
$c = "=20";
}
}
else if ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) // always encode "\t", which is *not* required
{
$h2 = floor($dec/16);
$h1 = floor($dec%16);
$c = $escape.$hex["$h2"].$hex["$h1"];
}
if ( (strlen($newline) + strlen($c)) >= $line_max ) // CRLF is not counted
{
$output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
$newline = "";
// check if newline first character will be point or not
if ( $dec == 46 )
{
$c = "=2E";
}
}
$newline .= $c;
} // end of for
$output .= $newline.$eol;
} // end of while
return trim($output);
}
?>
diff --git a/program/js/app.js b/program/js/app.js
index c0dac3fed..c61c20a63 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1,3525 +1,3605 @@
/*
+-----------------------------------------------------------------------+
| RoundCube Webmail Client Script |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev, - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Authors: Thomas Bruederli <roundcube@gmail.com> |
| Charles McNulty <charles@charlesmcnulty.com> |
+-----------------------------------------------------------------------+
$Id$
*/
// Constants
var CONTROL_KEY = 1;
var SHIFT_KEY = 2;
var CONTROL_SHIFT_KEY = 3;
var rcube_webmail_client;
function rcube_webmail()
{
this.env = new Object();
this.labels = new Object();
this.buttons = new Object();
this.gui_objects = new Object();
this.commands = new Object();
this.selection = new Array();
this.last_selected = 0;
this.in_message_list = false;
// create public reference to myself
rcube_webmail_client = this;
this.ref = 'rcube_webmail_client';
// webmail client settings
this.dblclick_time = 600;
this.message_time = 5000;
this.request_timeout = 180000;
this.kepp_alive_interval = 60000;
this.mbox_expression = new RegExp('[^0-9a-z\-_]', 'gi');
this.env.blank_img = 'skins/default/images/blank.gif';
// mimetypes supported by the browser (default settings)
this.mimetypes = new Array('text/plain', 'text/html', 'text/xml',
'image/jpeg', 'image/gif', 'image/png',
'application/x-javascript', 'application/pdf',
'application/x-shockwave-flash');
// set environment variable
this.set_env = function(name, value)
{
//if (!this.busy)
this.env[name] = value;
};
// add a localized label to the client environment
this.add_label = function(key, value)
{
this.labels[key] = value;
};
// add a button to the button list
this.register_button = function(command, id, type, act, sel, over)
{
if (!this.buttons[command])
this.buttons[command] = new Array();
var button_prop = {id:id, type:type};
if (act) button_prop.act = act;
if (sel) button_prop.sel = sel;
if (over) button_prop.over = over;
this.buttons[command][this.buttons[command].length] = button_prop;
};
// register a specific gui object
this.gui_object = function(name, id)
{
this.gui_objects[name] = id;
};
// initialize webmail client
this.init = function()
{
this.task = this.env.task;
// check browser
if (!bw.dom || !bw.xmlhttp_test())
{
location.href = this.env.comm_path+'&_action=error&_code=0x199';
return;
}
// find all registered gui objects
for (var n in this.gui_objects)
this.gui_objects[n] = rcube_find_object(this.gui_objects[n]);
// tell parent window that this frame is loaded
if (this.env.framed && parent.rcmail && parent.rcmail.set_busy)
parent.rcmail.set_busy(false);
// enable general commands
this.enable_command('logout', 'mail', 'addressbook', 'settings', true);
switch (this.task)
{
case 'mail':
var msg_list_frame = this.gui_objects.mailcontframe;
var msg_list = this.gui_objects.messagelist;
if (msg_list)
{
msg_list_frame.onmousedown = function(e){return rcube_webmail_client.click_on_list(e);};
this.init_messagelist(msg_list);
this.enable_command('toggle_status', true);
}
// enable mail commands
- this.enable_command('list', 'compose', 'add-contact', 'search', 'reset-search', true);
+ this.enable_command('list', 'checkmail', 'compose', 'add-contact', 'search', 'reset-search', true);
if (this.env.action=='show')
{
this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'viewsource', 'print', 'load-attachment', true);
if (this.env.next_uid)
this.enable_command('nextmessage', true);
if (this.env.prev_uid)
this.enable_command('previousmessage', true);
}
if (this.env.action=='show' && this.env.blockedobjects)
{
if (this.gui_objects.remoteobjectsmsg)
this.gui_objects.remoteobjectsmsg.style.display = 'block';
this.enable_command('load-images', true);
}
if (this.env.action=='compose')
{
this.enable_command('add-attachment', 'send-attachment', 'send', true);
if (this.env.spellcheck)
this.enable_command('spellcheck', true);
if (this.env.drafts_mailbox)
this.enable_command('savedraft', true);
}
if (this.env.messagecount)
this.enable_command('select-all', 'select-none', 'sort', 'expunge', true);
if (this.env.messagecount && this.env.mailbox==this.env.trash_mailbox)
this.enable_command('purge', true);
this.set_page_buttons();
// focus this window
window.focus();
// init message compose form
if (this.env.action=='compose')
this.init_messageform();
// show printing dialog
if (this.env.action=='print')
window.print();
// get unread count for each mailbox
if (this.gui_objects.mailboxlist)
this.http_request('getunread', '');
break;
case 'addressbook':
var contacts_list = this.gui_objects.contactslist;
var ldap_contacts_list = this.gui_objects.ldapcontactslist;
if (contacts_list)
this.init_contactslist(contacts_list);
if (ldap_contacts_list)
this.init_ldapsearchlist(ldap_contacts_list);
this.set_page_buttons();
if (this.env.cid)
this.enable_command('show', 'edit', true);
if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform)
this.enable_command('save', true);
this.enable_command('list', 'add', true);
this.enable_command('ldappublicsearch', this.env.ldappublicsearch);
break;
case 'settings':
this.enable_command('preferences', 'identities', 'save', 'folders', true);
if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity')
this.enable_command('edit', 'add', 'delete', true);
if (this.env.action=='edit-identity' || this.env.action=='add-identity')
this.enable_command('save', true);
if (this.env.action=='folders')
- this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'delete-folder', true);
+ this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', 'delete-folder', true);
var identities_list = this.gui_objects.identitieslist;
if (identities_list)
this.init_identitieslist(identities_list);
break;
case 'login':
var input_user = rcube_find_object('_user');
var input_pass = rcube_find_object('_pass');
if (input_user && input_user.value=='')
input_user.focus();
else if (input_pass)
input_pass.focus();
this.enable_command('login', true);
break;
default:
break;
}
// enable basic commands
this.enable_command('logout', true);
// disable browser's contextmenus
// document.oncontextmenu = function(){ return false; }
// load body click event
document.onmousedown = function(){ return rcube_webmail_client.reset_click(); };
document.onkeydown = function(e){ return rcube_webmail_client.key_pressed(e, msg_list_frame); };
// flag object as complete
this.loaded = true;
// show message
if (this.pending_message)
this.display_message(this.pending_message[0], this.pending_message[1]);
// start interval for keep-alive/recent_check signal
if (this.kepp_alive_interval && this.task=='mail' && this.gui_objects.messagelist)
this.kepp_alive_int = setInterval(this.ref+'.check_for_recent()', this.kepp_alive_interval);
else if (this.task!='login')
this.kepp_alive_int = setInterval(this.ref+'.send_keep_alive()', this.kepp_alive_interval);
};
// reset last clicked if user clicks on anything other than the message table
this.reset_click = function() {
this.in_message_list = false;
for (var n=0; n<this.selection.length; n++) {
id = this.selection[n];
if (this.list_rows[id].obj) {
this.set_classname(this.list_rows[id].obj, 'selected', false);
this.set_classname(this.list_rows[id].obj, 'unfocused', true);
}
}
};
this.click_on_list = function(e)
{
if (!e)
e = window.event;
for (var n=0; n<this.selection.length; n++) {
id = this.selection[n];
if (this.list_rows[id].obj) {
this.set_classname(this.list_rows[id].obj, 'selected', true);
this.set_classname(this.list_rows[id].obj, 'unfocused', false);
}
}
this.in_message_list = true;
e.cancelBubble = true;
};
this.key_pressed = function(e, msg_list_frame) {
if (this.in_message_list != true)
return true;
var keyCode = document.layers ? e.which : document.all ? event.keyCode : document.getElementById ? e.keyCode : 0;
var mod_key = this.get_modifier(e);
switch (keyCode) {
case 13:
this.command('show','',this);
break;
case 40:
case 38:
return this.use_arrow_key(keyCode, mod_key, msg_list_frame);
break;
case 46:
return this.use_delete_key(keyCode, mod_key, msg_list_frame);
break;
default:
return true;
}
return true;
}
this.use_arrow_key = function(keyCode, mod_key, msg_list_frame) {
var scroll_to = 0;
if (keyCode == 40) { // down arrow key pressed
new_row = this.get_next_row();
if (!new_row) return false;
scroll_to = (Number(new_row.offsetTop) + Number(new_row.offsetHeight)) - Number(msg_list_frame.offsetHeight);
} else if (keyCode == 38) { // up arrow key pressed
new_row = this.get_prev_row();
if (!new_row) return false;
scroll_to = new_row.offsetTop;
} else {return true;}
this.select_row(new_row.uid,mod_key,true);
if (((Number(new_row.offsetTop)) < (Number(msg_list_frame.scrollTop))) ||
((Number(new_row.offsetTop) + Number(new_row.offsetHeight)) > (Number(msg_list_frame.scrollTop) + Number(msg_list_frame.offsetHeight)))) {
msg_list_frame.scrollTop = scroll_to;
}
return false;
};
this.use_delete_key = function(keyCode, mod_key, msg_list_frame){
this.command('delete','',this);
return false;
}
// get all message rows from HTML table and init each row
this.init_messagelist = function(msg_list)
{
if (msg_list && msg_list.tBodies[0])
{
this.message_rows = new Array();
var row;
for(var r=0; r<msg_list.tBodies[0].childNodes.length; r++)
{
row = msg_list.tBodies[0].childNodes[r];
while (row && (row.nodeType != 1 || row.style.display == 'none')) {
row = row.nextSibling;
r++;
}
//row = msg_list.tBodies[0].rows[r];
if (row) this.init_message_row(row);
}
}
// alias to common rows array
this.list_rows = this.message_rows;
};
// make references in internal array and set event handlers
this.init_message_row = function(row)
{
var uid, msg_icon;
if (String(row.id).match(/rcmrow([0-9]+)/))
{
uid = RegExp.$1;
row.uid = uid;
this.message_rows[uid] = {id:row.id, obj:row,
classname:row.className,
deleted:this.env.messages[uid] ? this.env.messages[uid].deleted : null,
unread:this.env.messages[uid] ? this.env.messages[uid].unread : null,
replied:this.env.messages[uid] ? this.env.messages[uid].replied : null};
// set eventhandlers to table row
row.onmousedown = function(e){ return rcube_webmail_client.drag_row(e, this.uid); };
row.onmouseup = function(e){ return rcube_webmail_client.click_row(e, this.uid); };
if (document.all)
row.onselectstart = function() { return false; };
// set eventhandler to message icon
if ((msg_icon = row.cells[0].childNodes[0]) && row.cells[0].childNodes[0].nodeName=='IMG')
{
msg_icon.id = 'msgicn_'+uid;
msg_icon._row = row;
msg_icon.onmousedown = function(e) { rcube_webmail_client.command('toggle_status', this); };
// get message icon and save original icon src
this.message_rows[uid].icon = msg_icon;
}
}
};
// init message compose form: set focus and eventhandlers
this.init_messageform = function()
{
if (!this.gui_objects.messageform)
return false;
//this.messageform = this.gui_objects.messageform;
var input_from = rcube_find_object('_from');
var input_to = rcube_find_object('_to');
var input_cc = rcube_find_object('_cc');
var input_bcc = rcube_find_object('_bcc');
var input_replyto = rcube_find_object('_replyto');
var input_subject = rcube_find_object('_subject');
var input_message = rcube_find_object('_message');
// init live search events
if (input_to)
this.init_address_input_events(input_to);
if (input_cc)
this.init_address_input_events(input_cc);
if (input_bcc)
this.init_address_input_events(input_bcc);
// add signature according to selected identity
if (input_from && input_from.type=='select-one')
this.change_identity(input_from);
if (input_to && input_to.value=='')
input_to.focus();
else if (input_subject && input_subject.value=='')
input_subject.focus();
else if (input_message)
this.set_caret2start(input_message); // input_message.focus();
// get summary of all field values
this.cmp_hash = this.compose_field_hash();
};
this.init_address_input_events = function(obj)
{
var handler = function(e){ return rcube_webmail_client.ksearch_keypress(e,this); };
var handler2 = function(e){ return rcube_webmail_client.ksearch_blur(e,this); };
if (bw.safari)
{
obj.addEventListener('keydown', handler, false);
// obj.addEventListener('blur', handler2, false);
}
else if (bw.mz)
{
obj.addEventListener('keypress', handler, false);
obj.addEventListener('blur', handler2, false);
}
else if (bw.ie)
{
obj.onkeydown = handler;
//obj.attachEvent('onkeydown', handler);
// obj.attachEvent('onblur', handler2, false);
}
obj.setAttribute('autocomplete', 'off');
};
// get all contact rows from HTML table and init each row
this.init_contactslist = function(contacts_list)
{
if (contacts_list && contacts_list.tBodies[0])
{
this.contact_rows = new Array();
var row;
for(var r=0; r<contacts_list.tBodies[0].childNodes.length; r++)
{
row = contacts_list.tBodies[0].childNodes[r];
this.init_table_row(row, 'contact_rows');
}
}
// alias to common rows array
this.list_rows = this.contact_rows;
if (this.env.cid)
this.highlight_row(this.env.cid);
};
// get all contact rows from HTML table and init each row
this.init_ldapsearchlist = function(ldap_contacts_list)
{
if (ldap_contacts_list && ldap_contacts_list.tBodies[0])
{
this.ldap_contact_rows = new Array();
var row;
for(var r=0; r<ldap_contacts_list.tBodies[0].childNodes.length; r++)
{
row = ldap_contacts_list.tBodies[0].childNodes[r];
this.init_table_row(row, 'ldap_contact_rows');
}
}
// alias to common rows array
this.list_rows = this.ldap_contact_rows;
};
// make references in internal array and set event handlers
this.init_table_row = function(row, array_name)
{
var cid;
if (String(row.id).match(/rcmrow([0-9]+)/))
{
cid = RegExp.$1;
row.cid = cid;
this[array_name][cid] = {id:row.id,
obj:row,
classname:row.className};
// set eventhandlers to table row
row.onmousedown = function(e) { rcube_webmail_client.in_selection_before=this.cid; return false; }; // fake for drag handler
row.onmouseup = function(e){ return rcube_webmail_client.click_row(e, this.cid); };
}
};
// get all contact rows from HTML table and init each row
this.init_identitieslist = function(identities_list)
{
if (identities_list && identities_list.tBodies[0])
{
this.identity_rows = new Array();
var row;
for(var r=0; r<identities_list.tBodies[0].childNodes.length; r++)
{
row = identities_list.tBodies[0].childNodes[r];
this.init_table_row(row, 'identity_rows');
}
}
// alias to common rows array
this.list_rows = this.identity_rows;
if (this.env.iid)
this.highlight_row(this.env.iid);
};
/*********************************************************/
/********* client command interface *********/
/*********************************************************/
// execute a specific command on the web client
this.command = function(command, props, obj)
{
if (obj && obj.blur)
obj.blur();
if (this.busy)
return false;
// command not supported or allowed
if (!this.commands[command])
{
// pass command to parent window
if (this.env.framed && parent.rcmail && parent.rcmail.command)
parent.rcmail.command(command, props);
return false;
}
// check input before leaving compose step
if (this.task=='mail' && this.env.action=='compose' && (command=='list' || command=='mail' || command=='addressbook' || command=='settings'))
{
if (this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
return false;
}
// process command
switch (command)
{
case 'login':
if (this.gui_objects.loginform)
this.gui_objects.loginform.submit();
break;
case 'logout':
location.href = this.env.comm_path+'&_action=logout';
break;
// commands to switch task
case 'mail':
case 'addressbook':
case 'settings':
this.switch_task(command);
break;
// misc list commands
case 'list':
if (this.task=='mail')
{
if (this.env.search_request<0 || (this.env.search_request && props != this.env.mailbox))
this.reset_qsearch();
+
+ // Reset message list header, unless returning from compose/read/etc
+ if (this.env.mailbox != props && this.message_rows)
+ this.clear_message_list_header();
+
this.list_mailbox(props);
}
else if (this.task=='addressbook')
this.list_contacts();
break;
+
case 'sort':
// get the type of sorting
var a_sort = props.split('_');
var sort_col = a_sort[0];
var sort_order = a_sort[1] ? a_sort[1].toUpperCase() : null;
var header;
// no sort order specified: toggle
if (sort_order==null)
{
if (this.env.sort_col==sort_col)
sort_order = this.env.sort_order=='ASC' ? 'DESC' : 'ASC';
else
sort_order = this.env.sort_order;
}
if (this.env.sort_col==sort_col && this.env.sort_order==sort_order)
break;
// set table header class
if (header = document.getElementById('rcmHead'+this.env.sort_col))
this.set_classname(header, 'sorted'+(this.env.sort_order.toUpperCase()), false);
if (header = document.getElementById('rcmHead'+sort_col))
this.set_classname(header, 'sorted'+sort_order, true);
// save new sort properties
this.env.sort_col = sort_col;
this.env.sort_order = sort_order;
// reload message list
this.list_mailbox('', '', sort_col+'_'+sort_order);
break;
case 'nextpage':
this.list_page('next');
break;
case 'previouspage':
this.list_page('prev');
break;
case 'expunge':
if (this.env.messagecount)
this.expunge_mailbox(this.env.mailbox);
break;
case 'purge':
case 'empty-mailbox':
if (this.env.messagecount)
this.purge_mailbox(this.env.mailbox);
break;
// common commands used in multiple tasks
case 'show':
if (this.task=='mail')
{
var uid = this.get_single_uid();
if (uid && (!this.env.uid || uid != this.env.uid))
{
if (this.env.mailbox==this.env.drafts_mailbox)
{
this.set_busy(true);
location.href = this.env.comm_path+'&_action=compose&_draft_uid='+uid+'&_mbox='+escape(this.env.mailbox);
}
else
{
this.show_message(uid);
}
}
}
else if (this.task=='addressbook')
{
var cid = props ? props : this.get_single_cid();
if (cid && !(this.env.action=='show' && cid==this.env.cid))
this.load_contact(cid, 'show');
}
break;
case 'add':
if (this.task=='addressbook')
if (!window.frames[this.env.contentframe].rcmail)
this.load_contact(0, 'add');
else
{
if (window.frames[this.env.contentframe].rcmail.selection.length)
this.add_ldap_contacts();
else
this.load_contact(0, 'add');
}
else if (this.task=='settings')
{
this.clear_selection();
this.load_identity(0, 'add-identity');
}
break;
case 'edit':
var cid;
if (this.task=='addressbook' && (cid = this.get_single_cid()))
this.load_contact(cid, 'edit');
else if (this.task=='settings' && props)
this.load_identity(props, 'edit-identity');
break;
case 'save-identity':
case 'save':
if (this.gui_objects.editform)
{
var input_pagesize = rcube_find_object('_pagesize');
var input_name = rcube_find_object('_name');
var input_email = rcube_find_object('_email');
// user prefs
if (input_pagesize && isNaN(input_pagesize.value))
{
alert(this.get_label('nopagesizewarning'));
input_pagesize.focus();
break;
}
// contacts/identities
else
{
if (input_name && input_name.value == '')
{
alert(this.get_label('nonamewarning'));
input_name.focus();
break;
}
else if (input_email && !rcube_check_email(input_email.value))
{
alert(this.get_label('noemailwarning'));
input_email.focus();
break;
}
}
this.gui_objects.editform.submit();
}
break;
case 'delete':
// mail task
if (this.task=='mail')
this.delete_messages();
// addressbook task
else if (this.task=='addressbook')
this.delete_contacts();
// user settings task
else if (this.task=='settings')
this.delete_identity();
break;
// mail task commands
case 'move':
case 'moveto':
this.move_messages(props);
break;
case 'toggle_status':
if (props && !props._row)
break;
var uid;
var flag = 'read';
if (props._row.uid)
{
uid = props._row.uid;
this.dont_select = true;
// toggle read/unread
if (this.message_rows[uid].deleted) {
flag = 'undelete';
} else if (!this.message_rows[uid].unread)
flag = 'unread';
}
this.mark_message(flag, uid);
break;
case 'load-images':
if (this.env.uid)
this.show_message(this.env.uid, true);
break;
case 'load-attachment':
var url = this.env.comm_path+'&_action=get&_mbox='+this.env.mailbox+'&_uid='+this.env.uid+'&_part='+props.part;
// open attachment in frame if it's of a supported mimetype
if (this.env.uid && props.mimetype && find_in_array(props.mimetype, this.mimetypes)>=0)
{
this.attachment_win = window.open(url+'&_frame=1', 'rcubemailattachment');
if (this.attachment_win)
{
setTimeout(this.ref+'.attachment_win.focus()', 10);
break;
}
}
location.href = url;
break;
case 'select-all':
this.select_all(props);
break;
case 'select-none':
this.clear_selection();
break;
case 'nextmessage':
if (this.env.next_uid)
this.show_message(this.env.next_uid);
//location.href = this.env.comm_path+'&_action=show&_uid='+this.env.next_uid+'&_mbox='+this.env.mailbox;
break;
case 'previousmessage':
if (this.env.prev_uid)
this.show_message(this.env.prev_uid);
//location.href = this.env.comm_path+'&_action=show&_uid='+this.env.prev_uid+'&_mbox='+this.env.mailbox;
break;
+ case 'checkmail':
+ this.check_for_recent();
+ break;
case 'compose':
var url = this.env.comm_path+'&_action=compose';
if (this.task=='mail' && this.env.mailbox==this.env.drafts_mailbox)
{
var uid = this.get_single_uid();
url += '&_draft_uid='+uid+'&_mbox='+escape(this.env.mailbox);
}
// modify url if we're in addressbook
else if (this.task=='addressbook')
{
url = this.get_task_url('mail', url);
var a_cids = new Array();
// use contact_id passed as command parameter
if (props)
a_cids[a_cids.length] = props;
// get selected contacts
else
{
if (!window.frames[this.env.contentframe].rcmail.selection.length)
{
for (var n=0; n<this.selection.length; n++)
a_cids[a_cids.length] = this.selection[n];
}
else
{
var frameRcmail = window.frames[this.env.contentframe].rcmail;
// get the email address(es)
for (var n=0; n<frameRcmail.selection.length; n++)
a_cids[a_cids.length] = frameRcmail.ldap_contact_rows[frameRcmail.selection[n]].obj.cells[1].innerHTML;
}
}
if (a_cids.length)
url += '&_to='+a_cids.join(',');
else
break;
}
else if (props)
url += '&_to='+props;
// don't know if this is necessary...
url = url.replace(/&_framed=1/, "");
this.set_busy(true);
// need parent in case we are coming from the contact frame
if (this.env.framed)
parent.location.href = url;
else
location.href = url;
break;
case 'spellcheck':
if (this.env.spellcheck && this.env.spellcheck.spellCheck)
this.env.spellcheck.spellCheck(this.env.spellcheck.check_link);
break;
case 'savedraft':
if (!this.gui_objects.messageform)
break;
// if saving Drafts is disabled in main.inc.php
if (!this.env.drafts_mailbox)
break;
this.set_busy(true, 'savingmessage');
var form = this.gui_objects.messageform;
form.submit();
break;
case 'send':
if (!this.gui_objects.messageform)
break;
if (!this.check_compose_input())
break;
// all checks passed, send message
this.set_busy(true, 'sendingmessage');
var form = this.gui_objects.messageform;
form._draft.value='';
form.submit();
break;
case 'add-attachment':
this.show_attachment_form(true);
case 'send-attachment':
this.upload_file(props)
break;
case 'reply-all':
case 'reply':
var uid;
if (uid = this.get_single_uid())
{
this.set_busy(true);
location.href = this.env.comm_path+'&_action=compose&_reply_uid='+uid+'&_mbox='+escape(this.env.mailbox)+(command=='reply-all' ? '&_all=1' : '');
}
break;
case 'forward':
var uid;
if (uid = this.get_single_uid())
{
this.set_busy(true);
location.href = this.env.comm_path+'&_action=compose&_forward_uid='+uid+'&_mbox='+escape(this.env.mailbox);
}
break;
case 'print':
var uid;
if (uid = this.get_single_uid())
{
this.printwin = window.open(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+escape(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : ''));
if (this.printwin)
setTimeout(this.ref+'.printwin.focus()', 20);
}
break;
case 'viewsource':
var uid;
if (uid = this.get_single_uid())
{
this.sourcewin = window.open(this.env.comm_path+'&_action=viewsource&_uid='+this.env.uid+'&_mbox='+escape(this.env.mailbox));
if (this.sourcewin)
setTimeout(this.ref+'.sourcewin.focus()', 20);
}
break;
case 'add-contact':
this.add_contact(props);
break;
// mail quicksearch
case 'search':
if (!props && this.gui_objects.qsearchbox)
props = this.gui_objects.qsearchbox.value;
if (props)
this.qsearch(escape(props), this.env.mailbox);
break;
// reset quicksearch
case 'reset-search':
var s = this.env.search_request;
this.reset_qsearch();
if (s)
this.list_mailbox(this.env.mailbox);
break;
// ldap search
case 'ldappublicsearch':
if (this.gui_objects.ldappublicsearchform)
this.gui_objects.ldappublicsearchform.submit();
else
this.ldappublicsearch(command);
break;
// user settings commands
case 'preferences':
location.href = this.env.comm_path;
break;
case 'identities':
location.href = this.env.comm_path+'&_action=identities';
break;
case 'delete-identity':
this.delete_identity();
case 'folders':
location.href = this.env.comm_path+'&_action=folders';
break;
case 'subscribe':
this.subscribe_folder(props);
break;
case 'unsubscribe':
this.unsubscribe_folder(props);
break;
case 'create-folder':
this.create_folder(props);
break;
+ case 'rename-folder':
+ this.rename_folder(props);
+ break;
+
case 'delete-folder':
if (confirm(this.get_label('deletefolderconfirm')))
this.delete_folder(props);
break;
}
return obj ? false : true;
};
// set command enabled or disabled
this.enable_command = function()
{
var args = arguments;
if(!args.length) return -1;
var command;
var enable = args[args.length-1];
for(var n=0; n<args.length-1; n++)
{
command = args[n];
this.commands[command] = enable;
this.set_button(command, (enable ? 'act' : 'pas'));
}
return true;
};
// lock/unlock interface
this.set_busy = function(a, message)
{
if (a && message)
{
var msg = this.get_label(message);
if (msg==message)
msg = 'Loading...';
this.display_message(msg, 'loading', true);
}
else if (!a && this.busy)
this.hide_message();
this.busy = a;
//document.body.style.cursor = a ? 'wait' : 'default';
if (this.gui_objects.editform)
this.lock_form(this.gui_objects.editform, a);
// clear pending timer
if (this.request_timer)
clearTimeout(this.request_timer);
// set timer for requests
if (a && this.request_timeout)
this.request_timer = setTimeout(this.ref+'.request_timed_out()', this.request_timeout);
};
// return a localized string
this.get_label = function(name)
{
if (this.labels[name])
return this.labels[name];
else
return name;
};
// switch to another application task
this.switch_task = function(task)
{
if (this.task===task && task!='mail')
return;
var url = this.get_task_url(task);
if (task=='mail')
url += '&_mbox=INBOX';
this.set_busy(true);
location.href = url;
};
this.get_task_url = function(task, url)
{
if (!url)
url = this.env.comm_path;
return url.replace(/_task=[a-z]+/, '_task='+task);
};
// called when a request timed out
this.request_timed_out = function()
{
this.set_busy(false);
this.display_message('Request timed out!', 'error');
};
/*********************************************************/
/********* event handling methods *********/
/*********************************************************/
// onmouseup handler for mailboxlist item
this.mbox_mouse_up = function(mbox)
{
if (this.drag_active)
this.command('moveto', mbox);
else
this.command('list', mbox);
return false;
};
// onmousedown-handler of message list row
this.drag_row = function(e, id)
{
this.in_selection_before = this.in_selection(id) ? id : false;
// don't do anything (another action processed before)
if (this.dont_select)
return false;
// selects currently unselected row
if (!this.in_selection_before && !this.list_rows[id].clicked)
{
var mod_key = this.get_modifier(e);
this.select_row(id,mod_key,false);
}
if (this.selection.length)
{
this.drag_start = true;
document.onmousemove = function(e){ return rcube_webmail_client.drag_mouse_move(e); };
document.onmouseup = function(e){ return rcube_webmail_client.drag_mouse_up(e); };
}
return false;
};
// onmouseup-handler of message list row
this.click_row = function(e, id)
{
var mod_key = this.get_modifier(e);
// don't do anything (another action processed before)
if (this.dont_select)
{
this.dont_select = false;
return false;
}
// unselects currently selected row
if (!this.drag_active && this.in_selection_before==id && !this.list_rows[id].clicked)
this.select_row(id,mod_key,false);
this.drag_start = false;
this.in_selection_before = false;
// row was double clicked
if (this.task=='mail' && this.list_rows && this.list_rows[id].clicked && this.in_selection(id))
{
if (this.env.mailbox==this.env.drafts_mailbox)
{
this.set_busy(true);
location.href = this.env.comm_path+'&_action=compose&_draft_uid='+id+'&_mbox='+escape(this.env.mailbox);
}
else
{
this.show_message(id);
}
return false;
}
else if (this.task=='addressbook')
{
if (this.contact_rows && this.selection.length==1)
{
this.load_contact(this.selection[0], 'show', true);
// change the text for the add contact button
var links = parent.document.getElementById('abooktoolbar').getElementsByTagName('A');
for (i = 0; i < links.length; i++)
{
var onclickstring = new String(links[i].onclick);
if (onclickstring.search('\"add\"') != -1)
links[i].title = this.env.newcontact;
}
}
else if (this.contact_rows && this.contact_rows[id].clicked)
{
this.load_contact(id, 'show');
return false;
}
else if (this.ldap_contact_rows && !this.ldap_contact_rows[id].clicked)
{
// clear selection
parent.rcmail.clear_selection();
// disable delete
parent.rcmail.set_button('delete', 'pas');
// change the text for the add contact button
var links = parent.document.getElementById('abooktoolbar').getElementsByTagName('A');
for (i = 0; i < links.length; i++)
{
var onclickstring = new String(links[i].onclick);
if (onclickstring.search('\"add\"') != -1)
links[i].title = this.env.addcontact;
}
}
// handle double click event
else if (this.ldap_contact_rows && this.selection.length==1 && this.ldap_contact_rows[id].clicked)
this.command('compose', this.ldap_contact_rows[id].obj.cells[1].innerHTML);
else if (this.env.contentframe)
{
var elm = document.getElementById(this.env.contentframe);
elm.style.visibility = 'hidden';
}
}
else if (this.task=='settings')
{
if (this.selection.length==1)
this.command('edit', this.selection[0]);
}
this.list_rows[id].clicked = true;
setTimeout(this.ref+'.list_rows['+id+'].clicked=false;', this.dblclick_time);
return false;
};
/*********************************************************/
/********* (message) list functionality *********/
/*********************************************************/
// get next and previous rows that are not hidden
this.get_next_row = function(){
if (!this.list_rows) return false;
var last_selected_row = this.list_rows[this.last_selected];
var new_row = last_selected_row.obj.nextSibling;
while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none')) {
new_row = new_row.nextSibling;
}
return new_row;
}
this.get_prev_row = function(){
if (!this.list_rows) return false;
var last_selected_row = this.list_rows[this.last_selected];
var new_row = last_selected_row.obj.previousSibling;
while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none')) {
new_row = new_row.previousSibling;
}
return new_row;
}
// highlight/unhighlight a row
this.highlight_row = function(id, multiple)
{
var selected = false
if (this.list_rows[id] && !multiple)
{
this.clear_selection();
this.selection[0] = id;
this.list_rows[id].obj.className += ' selected';
selected = true;
}
else if (this.list_rows[id])
{
if (!this.in_selection(id)) // select row
{
this.selection[this.selection.length] = id;
this.set_classname(this.list_rows[id].obj, 'selected', true);
}
else // unselect row
{
var p = find_in_array(id, this.selection);
var a_pre = this.selection.slice(0, p);
var a_post = this.selection.slice(p+1, this.selection.length);
this.selection = a_pre.concat(a_post);
this.set_classname(this.list_rows[id].obj, 'selected', false);
this.set_classname(this.list_rows[id].obj, 'unfocused', false);
}
selected = (this.selection.length==1);
}
// enable/disable commands for message
if (this.task=='mail')
{
if (this.env.mailbox==this.env.drafts_mailbox)
{
//alert(this.env.mailbox);
//this.disable_command('reply', 'reply-all', 'forward', 'print', 'moveto');
this.enable_command('show', selected);
this.enable_command('delete', this.selection.length>0 ? true : false);
}
else
{
this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected);
this.enable_command('delete', 'moveto', this.selection.length>0 ? true : false);
}
}
else if (this.task=='addressbook')
{
this.enable_command('edit', /*'print',*/ selected);
this.enable_command('delete', 'compose', this.selection.length>0 ? true : false);
}
};
// selects or unselects the proper row depending on the modifier key pressed
this.select_row = function(id,mod_key,with_mouse) {
if (!mod_key) {
this.shift_start = id;
this.highlight_row(id, false);
} else {
switch (mod_key) {
case SHIFT_KEY: {
this.shift_select(id,false);
break; }
case CONTROL_KEY: {
this.shift_start = id;
if (!with_mouse)
this.highlight_row(id, true);
break;
}
case CONTROL_SHIFT_KEY: {
this.shift_select(id,true);
break;
}
default: {
this.highlight_row(id, false);
break;
}
}
}
if (this.last_selected != 0) { this.set_classname(this.list_rows[this.last_selected].obj, 'focused', false);}
this.last_selected = id;
this.set_classname(this.list_rows[id].obj, 'focused', true);
};
this.shift_select = function(id, control) {
var from_rowIndex = this.list_rows[this.shift_start].obj.rowIndex;
var to_rowIndex = this.list_rows[id].obj.rowIndex;
var i = ((from_rowIndex < to_rowIndex)? from_rowIndex : to_rowIndex);
var j = ((from_rowIndex > to_rowIndex)? from_rowIndex : to_rowIndex);
// iterate through the entire message list
for (var n in this.list_rows) {
if ((this.list_rows[n].obj.rowIndex >= i) && (this.list_rows[n].obj.rowIndex <= j)) {
if (!this.in_selection(n))
this.highlight_row(n, true);
} else {
if (this.in_selection(n) && !control)
this.highlight_row(n, true);
}
}
};
this.clear_selection = function()
{
for(var n=0; n<this.selection.length; n++)
if (this.list_rows[this.selection[n]]) {
this.set_classname(this.list_rows[this.selection[n]].obj, 'selected', false);
this.set_classname(this.list_rows[this.selection[n]].obj, 'unfocused', false);
}
this.selection = new Array();
};
// check if given id is part of the current selection
this.in_selection = function(id)
{
for(var n in this.selection)
if (this.selection[n]==id)
return true;
return false;
};
// select each row in list
this.select_all = function(filter)
{
if (!this.list_rows || !this.list_rows.length)
return false;
// reset selection first
this.clear_selection();
for (var n in this.list_rows) {
if (!filter || this.list_rows[n][filter]==true)
this.highlight_row(n, true);
}
return true;
};
// when user doble-clicks on a row
this.show_message = function(id, safe)
{
var add_url = '';
var target = window;
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
target = window.frames[this.env.contentframe];
add_url = '&_framed=1';
}
if (safe)
add_url = '&_safe=1';
if (id)
{
this.set_busy(true, 'loading');
target.location.href = this.env.comm_path+'&_action=show&_uid='+id+'&_mbox='+escape(this.env.mailbox)+add_url;
}
};
// list a specific page
this.list_page = function(page)
{
if (page=='next')
page = this.env.current_page+1;
if (page=='prev' && this.env.current_page>1)
page = this.env.current_page-1;
if (page > 0 && page <= this.env.pagecount)
{
this.env.current_page = page;
if (this.task=='mail')
this.list_mailbox(this.env.mailbox, page);
else if (this.task=='addressbook')
this.list_contacts(page);
}
};
// list messages of a specific mailbox
this.list_mailbox = function(mbox, page, sort)
{
this.last_selected = 0;
var add_url = '';
var target = window;
if (!mbox)
mbox = this.env.mailbox;
// add sort to url if set
if (sort)
add_url += '&_sort=' + sort;
// set page=1 if changeing to another mailbox
if (!page && mbox != this.env.mailbox)
{
page = 1;
add_url += '&_refresh=1';
this.env.current_page = page;
this.clear_selection();
}
// also send search request to get the right messages
if (this.env.search_request)
add_url += '&_search='+this.env.search_request;
if (this.env.mailbox!=mbox)
this.select_mailbox(mbox);
// load message list remotely
if (this.gui_objects.messagelist)
{
this.list_mailbox_remote(mbox, page, add_url);
return;
}
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
target = window.frames[this.env.contentframe];
add_url += '&_framed=1';
}
// load message list to target frame/window
if (mbox)
{
this.set_busy(true, 'loading');
target.location.href = this.env.comm_path+'&_mbox='+escape(mbox)+(page ? '&_page='+page : '')+add_url;
}
};
// send remote request to load message list
this.list_mailbox_remote = function(mbox, page, add_url)
{
// clear message list first
this.clear_message_list();
// send request to server
var url = '_mbox='+escape(mbox)+(page ? '&_page='+page : '');
this.set_busy(true, 'loading');
this.http_request('list', url+add_url, true);
};
this.clear_message_list = function()
{
var table = this.gui_objects.messagelist;
+
var tbody = document.createElement('TBODY');
table.insertBefore(tbody, table.tBodies[0]);
table.removeChild(table.tBodies[1]);
this.message_rows = new Array();
this.list_rows = this.message_rows;
};
+ this.clear_message_list_header = function()
+ {
+ var table = this.gui_objects.messagelist;
+
+ var colgroup = document.createElement('COLGROUP');
+ table.removeChild(table.colgroup);
+ table.insertBefore(colgroup, table.thead);
+
+ var thead = document.createElement('THEAD');
+ table.removeChild(table.thead);
+ table.insertBefore(thead, table.tBodies[0]);
+ };
this.expunge_mailbox = function(mbox)
{
var lock = false;
var add_url = '';
// lock interface if it's the active mailbox
if (mbox == this.env.mailbox)
{
lock = true;
this.set_busy(true, 'loading');
add_url = '&_reload=1';
}
// send request to server
var url = '_mbox='+escape(mbox);
this.http_request('expunge', url+add_url, lock);
};
this.purge_mailbox = function(mbox)
{
var lock = false;
var add_url = '';
if (!confirm(this.get_label('purgefolderconfirm')))
return false;
// lock interface if it's the active mailbox
if (mbox == this.env.mailbox)
{
lock = true;
this.set_busy(true, 'loading');
add_url = '&_reload=1';
}
// send request to server
var url = '_mbox='+escape(mbox);
this.http_request('purge', url+add_url, lock);
return true;
};
// move selected messages to the specified mailbox
this.move_messages = function(mbox)
{
// exit if no mailbox specified or if selection is empty
if (!mbox || !(this.selection.length || this.env.uid) || mbox==this.env.mailbox)
return;
var a_uids = new Array();
if (this.env.uid)
a_uids[a_uids.length] = this.env.uid;
else
{
var id;
for (var n=0; n<this.selection.length; n++)
{
id = this.selection[n];
a_uids[a_uids.length] = id;
// 'remove' message row from list (just hide it)
if (this.message_rows[id].obj)
this.message_rows[id].obj.style.display = 'none';
}
next_row = this.get_next_row();
prev_row = this.get_prev_row();
new_row = (next_row) ? next_row : prev_row;
if (new_row) this.select_row(new_row.uid,false,false);
}
var lock = false;
// show wait message
if (this.env.action=='show')
{
lock = true;
this.set_busy(true, 'movingmessage');
}
// send request to server
this.http_request('moveto', '_uid='+a_uids.join(',')+'&_mbox='+escape(this.env.mailbox)+'&_target_mbox='+escape(mbox)+'&_from='+(this.env.action ? this.env.action : ''), lock);
};
this.permanently_remove_messages = function() {
// exit if no mailbox specified or if selection is empty
if (!(this.selection.length || this.env.uid))
return;
var a_uids = new Array();
if (this.env.uid)
a_uids[a_uids.length] = this.env.uid;
else
{
var id;
for (var n=0; n<this.selection.length; n++)
{
id = this.selection[n];
a_uids[a_uids.length] = id;
// 'remove' message row from list (just hide it)
if (this.message_rows[id].obj)
this.message_rows[id].obj.style.display = 'none';
}
}
next_row = this.get_next_row();
prev_row = this.get_prev_row();
new_row = (next_row) ? next_row : prev_row;
if (new_row) this.select_row(new_row.uid,false,false);
// send request to server
this.http_request('delete', '_uid='+a_uids.join(',')+'&_mbox='+escape(this.env.mailbox)+'&_from='+(this.env.action ? this.env.action : ''));
}
// delete selected messages from the current mailbox
this.delete_messages = function()
{
// exit if no mailbox specified or if selection is empty
if (!(this.selection.length || this.env.uid))
return;
// if there is a trash mailbox defined and we're not currently in it:
if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase()!=String(this.env.trash_mailbox).toLowerCase())
this.move_messages(this.env.trash_mailbox);
// if there is a trash mailbox defined but we *are* in it:
else if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() == String(this.env.trash_mailbox).toLowerCase())
this.permanently_remove_messages();
// if there isn't a defined trash mailbox and the config is set to flag for deletion
else if (!this.env.trash_mailbox && this.env.flag_for_deletion) {
flag = 'delete';
this.mark_message(flag);
if(this.env.action=="show"){
this.command('nextmessage','',this);
} else if (this.selection.length == 1) {
next_row = this.get_next_row();
prev_row = this.get_prev_row();
new_row = (next_row) ? next_row : prev_row;
if (new_row) this.select_row(new_row.uid,false,false);
}
// if there isn't a defined trash mailbox and the config is set NOT to flag for deletion
}else if (!this.env.trash_mailbox && !this.env.flag_for_deletion) {
this.permanently_remove_messages();
}
return;
};
// set a specific flag to one or more messages
this.mark_message = function(flag, uid)
{
var a_uids = new Array();
if (uid)
a_uids[0] = uid;
else if (this.env.uid)
a_uids[0] = this.env.uid;
else
{
var id;
for (var n=0; n<this.selection.length; n++)
{
id = this.selection[n];
a_uids[a_uids.length] = id;
}
}
switch (flag) {
case 'read':
case 'unread':
this.toggle_read_status(flag,a_uids);
break;
case 'delete':
case 'undelete':
this.toggle_delete_status(a_uids);
break;
}
};
// set class to read/unread
this.toggle_read_status = function(flag, a_uids) {
// mark all message rows as read/unread
var icn_src;
for (var i=0; i<a_uids.length; i++)
{
uid = a_uids[i];
if (this.message_rows[uid])
{
this.message_rows[uid].unread = (flag=='unread' ? true : false);
if (this.message_rows[uid].classname.indexOf('unread')<0 && this.message_rows[uid].unread)
{
this.message_rows[uid].classname += ' unread';
this.set_classname(this.message_rows[uid].obj, 'unread', true);
if (this.env.unreadicon)
icn_src = this.env.unreadicon;
}
else if (!this.message_rows[uid].unread)
{
this.message_rows[uid].classname = this.message_rows[uid].classname.replace(/\s*unread/, '');
this.set_classname(this.message_rows[uid].obj, 'unread', false);
if (this.message_rows[uid].replied && this.env.repliedicon)
icn_src = this.env.repliedicon;
else if (this.env.messageicon)
icn_src = this.env.messageicon;
}
if (this.message_rows[uid].icon && icn_src)
this.message_rows[uid].icon.src = icn_src;
}
}
this.http_request('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
}
// mark all message rows as deleted/undeleted
this.toggle_delete_status = function(a_uids) {
if (this.env.read_when_deleted) {
this.toggle_read_status('read',a_uids);
}
// if deleting message from "view message" don't bother with delete icon
if (this.env.action == "show")
return false;
if (a_uids.length==1){
if(this.message_rows[a_uids[0]].classname.indexOf('deleted') < 0 ){
this.flag_as_deleted(a_uids)
} else {
this.flag_as_undeleted(a_uids)
}
return true;
}
var all_deleted = true;
for (var i=0; i<a_uids.length; i++) {
uid = a_uids[i];
if (this.message_rows[uid]) {
if (this.message_rows[uid].classname.indexOf('deleted')<0) {
all_deleted = false;
break;
}
}
}
if (all_deleted)
this.flag_as_undeleted(a_uids);
else
this.flag_as_deleted(a_uids);
return true;
}
this.flag_as_undeleted = function(a_uids){
// if deleting message from "view message" don't bother with delete icon
if (this.env.action == "show")
return false;
var icn_src;
for (var i=0; i<a_uids.length; i++) {
uid = a_uids[i];
if (this.message_rows[uid]) {
this.message_rows[uid].deleted = false;
if (this.message_rows[uid].classname.indexOf('deleted') > 0) {
this.message_rows[uid].classname = this.message_rows[uid].classname.replace(/\s*deleted/, '');
this.set_classname(this.message_rows[uid].obj, 'deleted', false);
}
if (this.message_rows[uid].unread && this.env.unreadicon)
icn_src = this.env.unreadicon;
else if (this.message_rows[uid].replied && this.env.repliedicon)
icn_src = this.env.repliedicon;
else if (this.env.messageicon)
icn_src = this.env.messageicon;
if (this.message_rows[uid].icon && icn_src)
this.message_rows[uid].icon.src = icn_src;
}
}
this.http_request('mark', '_uid='+a_uids.join(',')+'&_flag=undelete');
return true;
}
this.flag_as_deleted = function(a_uids) {
// if deleting message from "view message" don't bother with delete icon
if (this.env.action == "show")
return false;
for (var i=0; i<a_uids.length; i++) {
uid = a_uids[i];
if (this.message_rows[uid]) {
this.message_rows[uid].deleted = true;
if (this.message_rows[uid].classname.indexOf('deleted')<0) {
this.message_rows[uid].classname += ' deleted';
this.set_classname(this.message_rows[uid].obj, 'deleted', true);
}
if (this.message_rows[uid].icon && this.env.deletedicon)
this.message_rows[uid].icon.src = this.env.deletedicon;
}
}
this.http_request('mark', '_uid='+a_uids.join(',')+'&_flag=delete');
return true;
}
/*********************************************************/
/********* message compose methods *********/
/*********************************************************/
// checks the input fields before sending a message
this.check_compose_input = function()
{
// check input fields
var input_to = rcube_find_object('_to');
var input_subject = rcube_find_object('_subject');
var input_message = rcube_find_object('_message');
// check for empty recipient
if (input_to && !rcube_check_email(input_to.value, true))
{
alert(this.get_label('norecipientwarning'));
input_to.focus();
return false;
}
// display localized warning for missing subject
if (input_subject && input_subject.value == '')
{
var subject = prompt(this.get_label('nosubjectwarning'), this.get_label('nosubject'));
// user hit cancel, so don't send
if (!subject && subject !== '')
{
input_subject.focus();
return false;
}
else
{
input_subject.value = subject ? subject : this.get_label('nosubject');
}
}
// check for empty body
if (input_message.value=='')
{
if (!confirm(this.get_label('nobodywarning')))
{
input_message.focus();
return false;
}
}
return true;
};
this.compose_field_hash = function()
{
// check input fields
var input_to = rcube_find_object('_to');
var input_cc = rcube_find_object('_to');
var input_bcc = rcube_find_object('_to');
var input_subject = rcube_find_object('_subject');
var input_message = rcube_find_object('_message');
var str = '';
if (input_to && input_to.value)
str += input_to.value+':';
if (input_cc && input_cc.value)
str += input_cc.value+':';
if (input_bcc && input_bcc.value)
str += input_bcc.value+':';
if (input_subject && input_subject.value)
str += input_subject.value+':';
if (input_message && input_message.value)
str += input_message.value;
return str;
};
this.change_identity = function(obj)
{
if (!obj || !obj.options)
return false;
var id = obj.options[obj.selectedIndex].value;
var input_message = rcube_find_object('_message');
var message = input_message ? input_message.value : '';
var sig, p;
if (!this.env.identity)
this.env.identity = id
// remove the 'old' signature
if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity])
{
sig = this.env.signatures[this.env.identity];
if (sig.indexOf('--')!=0)
sig = '--\n'+sig;
p = message.lastIndexOf(sig);
if (p>=0)
message = message.substring(0, p-1) + message.substring(p+sig.length, message.length);
}
// add the new signature string
if (this.env.signatures && this.env.signatures[id])
{
sig = this.env.signatures[id];
if (sig.indexOf('--')!=0)
sig = '--\n'+sig;
message += '\n'+sig;
}
if (input_message)
input_message.value = message;
this.env.identity = id;
return true;
};
this.show_attachment_form = function(a)
{
if (!this.gui_objects.uploadbox)
return false;
var elm, list;
if (elm = this.gui_objects.uploadbox)
{
if (a && (list = this.gui_objects.attachmentlist))
{
var pos = rcube_get_object_pos(list);
var left = pos.x;
var top = pos.y + list.offsetHeight + 10;
elm.style.top = top+'px';
elm.style.left = left+'px';
}
elm.style.visibility = a ? 'visible' : 'hidden';
}
// clear upload form
if (!a && this.gui_objects.attachmentform && this.gui_objects.attachmentform!=this.gui_objects.messageform)
this.gui_objects.attachmentform.reset();
return true;
};
// upload attachment file
this.upload_file = function(form)
{
if (!form)
return false;
// get file input fields
var send = false;
for (var n=0; n<form.elements.length; n++)
if (form.elements[n].type=='file' && form.elements[n].value)
{
send = true;
break;
}
// create hidden iframe and post upload form
if (send)
{
var ts = new Date().getTime();
var frame_name = 'rcmupload'+ts;
// have to do it this way for IE
// otherwise the form will be posted to a new window
if(document.all && !window.opera)
{
var html = '<iframe name="'+frame_name+'" src="program/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>';
document.body.insertAdjacentHTML('BeforeEnd',html);
}
else // for standards-compilant browsers
{
var frame = document.createElement('IFRAME');
frame.name = frame_name;
frame.width = 10;
frame.height = 10;
frame.style.visibility = 'hidden';
document.body.appendChild(frame);
}
form.target = frame_name;
form.action = this.env.comm_path+'&_action=upload';
form.setAttribute('enctype', 'multipart/form-data');
form.submit();
}
// set reference to the form object
this.gui_objects.attachmentform = form;
return true;
};
// add file name to attachment list
// called from upload page
this.add2attachment_list = function(name)
{
if (!this.gui_objects.attachmentlist)
return false;
var li = document.createElement('LI');
li.innerHTML = name;
this.gui_objects.attachmentlist.appendChild(li);
return true;
};
// send remote request to add a new contact
this.add_contact = function(value)
{
if (value)
this.http_request('addcontact', '_address='+value);
return true;
};
// send remote request to search mail
this.qsearch = function(value, mbox)
{
if (value && mbox)
{
this.clear_message_list();
this.set_busy(true, 'searching');
this.http_request('search', '_search='+value+'&_mbox='+mbox, true);
}
return true;
};
// reset quick-search form
this.reset_qsearch = function()
{
if (this.gui_objects.qsearchbox)
this.gui_objects.qsearchbox.value = '';
this.env.search_request = null;
return true;
};
/*********************************************************/
/********* keyboard live-search methods *********/
/*********************************************************/
// handler for keyboard events on address-fields
this.ksearch_keypress = function(e, obj)
{
if (typeof(this.env.contacts)!='object' || !this.env.contacts.length)
return true;
if (this.ksearch_timer)
clearTimeout(this.ksearch_timer);
if (!e)
e = window.event;
var highlight;
var key = e.keyCode ? e.keyCode : e.which;
switch (key)
{
case 38: // key up
case 40: // key down
if (!this.ksearch_pane)
break;
var dir = key==38 ? 1 : 0;
var next;
highlight = document.getElementById('rcmksearchSelected');
if (!highlight)
highlight = this.ksearch_pane.ul.firstChild;
if (highlight && (next = dir ? highlight.previousSibling : highlight.nextSibling))
{
highlight.removeAttribute('id');
//highlight.removeAttribute('class');
this.set_classname(highlight, 'selected', false);
this.set_classname(highlight, 'unfocused', false);
}
if (next)
{
next.setAttribute('id', 'rcmksearchSelected');
this.set_classname(next, 'selected', true);
this.ksearch_selected = next._rcm_id;
}
if (e.preventDefault)
e.preventDefault();
return false;
case 9: // tab
if(e.shiftKey)
break;
case 13: // enter
if (this.ksearch_selected===null || !this.ksearch_input || !this.ksearch_value)
break;
// get cursor pos
var inp_value = this.ksearch_input.value.toLowerCase();
var cpos = this.get_caret_pos(this.ksearch_input);
var p = inp_value.lastIndexOf(this.ksearch_value, cpos);
// replace search string with full address
var pre = this.ksearch_input.value.substring(0, p);
var end = this.ksearch_input.value.substring(p+this.ksearch_value.length, this.ksearch_input.value.length);
var insert = this.env.contacts[this.ksearch_selected]+', ';
this.ksearch_input.value = pre + insert + end;
//this.ksearch_input.value = this.ksearch_input.value.substring(0, p)+insert;
// set caret to insert pos
cpos = p+insert.length;
if (this.ksearch_input.setSelectionRange)
this.ksearch_input.setSelectionRange(cpos, cpos);
// hide ksearch pane
this.ksearch_hide();
if (e.preventDefault)
e.preventDefault();
return false;
case 27: // escape
this.ksearch_hide();
break;
}
// start timer
this.ksearch_timer = setTimeout(this.ref+'.ksearch_get_results()', 200);
this.ksearch_input = obj;
return true;
};
// address search processor
this.ksearch_get_results = function()
{
var inp_value = this.ksearch_input ? this.ksearch_input.value : null;
if (inp_value===null)
return;
// get string from current cursor pos to last comma
var cpos = this.get_caret_pos(this.ksearch_input);
var p = inp_value.lastIndexOf(',', cpos-1);
var q = inp_value.substring(p+1, cpos);
// trim query string
q = q.replace(/(^\s+|\s+$)/g, '').toLowerCase();
if (!q.length || q==this.ksearch_value)
{
if (!q.length && this.ksearch_pane && this.ksearch_pane.visible)
this.ksearch_pane.show(0);
return;
}
this.ksearch_value = q;
// start searching the contact list
var a_results = new Array();
var a_result_ids = new Array();
var c=0;
for (var i=0; i<this.env.contacts.length; i++)
{
if (this.env.contacts[i].toLowerCase().indexOf(q)>=0)
{
a_results[c] = this.env.contacts[i];
a_result_ids[c++] = i;
if (c==15) // limit search results
break;
}
}
// display search results
if (c && a_results.length)
{
var p, ul, li;
// create results pane if not present
if (!this.ksearch_pane)
{
ul = document.createElement('UL');
this.ksearch_pane = new rcube_layer('rcmKSearchpane', {vis:0, zindex:30000});
this.ksearch_pane.elm.appendChild(ul);
this.ksearch_pane.ul = ul;
}
else
ul = this.ksearch_pane.ul;
// remove all search results
ul.innerHTML = '';
// add each result line to list
for (i=0; i<a_results.length; i++)
{
li = document.createElement('LI');
li.innerHTML = a_results[i].replace(/</, '&lt;').replace(/>/, '&gt;');
li._rcm_id = a_result_ids[i];
ul.appendChild(li);
}
// check if last selected item is still in result list
if (this.ksearch_selected!==null)
{
p = find_in_array(this.ksearch_selected, a_result_ids);
if (p>=0 && ul.childNodes)
{
ul.childNodes[p].setAttribute('id', 'rcmksearchSelected');
this.set_classname(ul.childNodes[p], 'selected', true);
}
else
this.ksearch_selected = null;
}
// if no item selected, select the first one
if (this.ksearch_selected===null)
{
ul.firstChild.setAttribute('id', 'rcmksearchSelected');
this.set_classname(ul.firstChild, 'selected', true);
this.ksearch_selected = a_result_ids[0];
}
// resize the containing layer to fit the list
//this.ksearch_pane.resize(ul.offsetWidth, ul.offsetHeight);
// move the results pane right under the input box and make it visible
var pos = rcube_get_object_pos(this.ksearch_input);
this.ksearch_pane.move(pos.x, pos.y+this.ksearch_input.offsetHeight);
this.ksearch_pane.show(1);
}
// hide results pane
else
this.ksearch_hide();
};
this.ksearch_blur = function(e, obj)
{
if (this.ksearch_timer)
clearTimeout(this.ksearch_timer);
this.ksearch_value = '';
this.ksearch_input = null;
this.ksearch_hide();
};
this.ksearch_hide = function()
{
this.ksearch_selected = null;
if (this.ksearch_pane)
this.ksearch_pane.show(0);
};
/*********************************************************/
/********* address book methods *********/
/*********************************************************/
this.list_contacts = function(page)
{
var add_url = '';
var target = window;
if (page && this.current_page==page)
return false;
// load contacts remotely
if (this.gui_objects.contactslist)
{
this.list_contacts_remote(page);
return;
}
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
target = window.frames[this.env.contentframe];
add_url = '&_framed=1';
}
this.set_busy(true, 'loading');
location.href = this.env.comm_path+(page ? '&_page='+page : '')+add_url;
};
// send remote request to load contacts list
this.list_contacts_remote = function(page)
{
// clear list
var table = this.gui_objects.contactslist;
var tbody = document.createElement('TBODY');
table.insertBefore(tbody, table.tBodies[0]);
table.tBodies[1].style.display = 'none';
this.contact_rows = new Array();
this.list_rows = this.contact_rows;
// send request to server
var url = page ? '&_page='+page : '';
this.set_busy(true, 'loading');
this.http_request('list', url, true);
};
// load contact record
this.load_contact = function(cid, action, framed)
{
var add_url = '';
var target = window;
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
add_url = '&_framed=1';
target = window.frames[this.env.contentframe];
document.getElementById(this.env.contentframe).style.visibility = 'inherit';
}
else if (framed)
return false;
//if (this.env.framed && add_url=='')
// add_url = '&_framed=1';
if (action && (cid || action=='add'))
{
this.set_busy(true);
target.location.href = this.env.comm_path+'&_action='+action+'&_cid='+cid+add_url;
}
return true;
};
this.delete_contacts = function()
{
// exit if no mailbox specified or if selection is empty
if (!(this.selection.length || this.env.cid) || !confirm(this.get_label('deletecontactconfirm')))
return;
var a_cids = new Array();
if (this.env.cid)
a_cids[a_cids.length] = this.env.cid;
else
{
var id;
for (var n=0; n<this.selection.length; n++)
{
id = this.selection[n];
a_cids[a_cids.length] = id;
// 'remove' row from list (just hide it)
if (this.contact_rows[id].obj)
this.contact_rows[id].obj.style.display = 'none';
}
// hide content frame if we delete the currently displayed contact
if (this.selection.length==1 && this.env.contentframe)
{
var elm = document.getElementById(this.env.contentframe);
elm.style.visibility = 'hidden';
}
}
// send request to server
this.http_request('delete', '_cid='+a_cids.join(',')+'&_from='+(this.env.action ? this.env.action : ''));
return true;
};
// update a contact record in the list
this.update_contact_row = function(cid, cols_arr)
{
if (!this.contact_rows[cid] || !this.contact_rows[cid].obj)
return false;
var row = this.contact_rows[cid].obj;
for (var c=0; c<cols_arr.length; c++){
if (row.cells[c])
row.cells[c].innerHTML = cols_arr[c];
}
return true;
};
// load ldap search form
this.ldappublicsearch = function(action)
{
var add_url = '';
var target = window;
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
add_url = '&_framed=1';
target = window.frames[this.env.contentframe];
document.getElementById(this.env.contentframe).style.visibility = 'inherit';
}
else
return false;
if (action == 'ldappublicsearch')
target.location.href = this.env.comm_path+'&_action='+action+add_url;
return true;
};
// add ldap contacts to address book
this.add_ldap_contacts = function()
{
if (window.frames[this.env.contentframe].rcmail)
{
var frame = window.frames[this.env.contentframe];
// build the url
var url = '&_framed=1';
var emails = '&_emails=';
var names = '&_names=';
var end = '';
for (var n=0; n<frame.rcmail.selection.length; n++)
{
end = n < frame.rcmail.selection.length - 1 ? ',' : '';
emails += frame.rcmail.ldap_contact_rows[frame.rcmail.selection[n]].obj.cells[1].innerHTML + end;
names += frame.rcmail.ldap_contact_rows[frame.rcmail.selection[n]].obj.cells[0].innerHTML + end;
}
frame.location.href = this.env.comm_path + '&_action=save&_framed=1' + emails + names;
}
return false;
}
/*********************************************************/
/********* user settings methods *********/
/*********************************************************/
// load contact record
this.load_identity = function(id, action)
{
if (action=='edit-identity' && (!id || id==this.env.iid))
return false;
var add_url = '';
var target = window;
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
add_url = '&_framed=1';
target = window.frames[this.env.contentframe];
document.getElementById(this.env.contentframe).style.visibility = 'inherit';
}
if (action && (id || action=='add-identity'))
{
this.set_busy(true);
target.location.href = this.env.comm_path+'&_action='+action+'&_iid='+id+add_url;
}
return true;
};
this.delete_identity = function(id)
{
// exit if no mailbox specified or if selection is empty
if (!(this.selection.length || this.env.iid))
return;
if (!id)
id = this.env.iid ? this.env.iid : this.selection[0];
/*
// 'remove' row from list (just hide it)
if (this.identity_rows && this.identity_rows[id].obj)
{
this.clear_selection();
this.identity_rows[id].obj.style.display = 'none';
}
*/
// if (this.env.framed && id)
this.set_busy(true);
location.href = this.env.comm_path+'&_action=delete-identity&_iid='+id;
// else if (id)
// this.http_request('delete-identity', '_iid='+id);
return true;
};
this.create_folder = function(name)
{
var form;
if ((form = this.gui_objects.editform) && form.elements['_folder_name'])
name = form.elements['_folder_name'].value;
if (name)
this.http_request('create-folder', '_name='+escape(name), true);
else if (form.elements['_folder_name'])
form.elements['_folder_name'].focus();
};
+ this.rename_folder = function(props)
+ {
+ var form;
+ if ((form = this.gui_objects.editform) && form.elements['_folder_oldname'] && form.elements['_folder_newname'])
+ {
+ oldname = form.elements['_folder_oldname'].value;
+ newname = form.elements['_folder_newname'].value;
+ }
+
+ if (oldname && newname)
+ this.http_request('rename-folder', '_folder_oldname='+escape(oldname)+'&_folder_newname='+escape(newname));
+ else if (form.elements['_folder_newname'])
+ form.elements['_folder_newname'].focus();
+ };
+
this.delete_folder = function(folder)
{
if (folder)
{
this.http_request('delete-folder', '_mboxes='+escape(folder));
}
};
this.remove_folder_row = function(folder)
{
for (var id in this.env.subscriptionrows)
if (this.env.subscriptionrows[id]==folder)
break;
var row;
if (id && (row = document.getElementById(id)))
row.style.display = 'none';
+
+ // remove folder from rename-folder list
+ var form;
+ if ((form = this.gui_objects.editform) && form.elements['_folder_oldname'])
+ {
+ for (var i=0;i<form.elements['_folder_oldname'].options.length;i++)
+ {
+ if (form.elements['_folder_oldname'].options[i].value == folder)
+ {
+ form.elements['_folder_oldname'].options[i] = null;
+ break;
+ }
+ }
+ }
};
this.subscribe_folder = function(folder)
{
var form;
if ((form = this.gui_objects.editform) && form.elements['_unsubscribed'])
this.change_subscription('_unsubscribed', '_subscribed', 'subscribe');
else if (folder)
this.http_request('subscribe', '_mboxes='+escape(folder));
};
this.unsubscribe_folder = function(folder)
{
var form;
if ((form = this.gui_objects.editform) && form.elements['_subscribed'])
this.change_subscription('_subscribed', '_unsubscribed', 'unsubscribe');
else if (folder)
this.http_request('unsubscribe', '_mboxes='+escape(folder));
};
this.change_subscription = function(from, to, action)
{
var form;
if (form = this.gui_objects.editform)
{
var a_folders = new Array();
var list_from = form.elements[from];
for (var i=0; list_from && i<list_from.options.length; i++)
{
if (list_from.options[i] && list_from.options[i].selected)
{
a_folders[a_folders.length] = list_from.options[i].value;
list_from[i] = null;
i--;
}
}
// yes, we have some folders selected
if (a_folders.length)
{
var list_to = form.elements[to];
var index;
for (var n=0; n<a_folders.length; n++)
{
index = list_to.options.length;
list_to[index] = new Option(a_folders[n]);
}
this.http_request(action, '_mboxes='+escape(a_folders.join(',')));
}
}
};
// add a new folder to the subscription list by cloning a folder row
this.add_folder_row = function(name)
{
if (!this.gui_objects.subscriptionlist)
return false;
var tbody = this.gui_objects.subscriptionlist.tBodies[0];
var id = tbody.childNodes.length+1;
-
+
// clone a table row
var row = this.clone_table_row(tbody.rows[0]);
row.id = 'rcmrow'+id;
tbody.appendChild(row);
// add to folder/row-ID map
this.env.subscriptionrows[row.id] = name;
// set folder name
row.cells[0].innerHTML = name;
if (row.cells[1].firstChild.tagName=='INPUT')
{
row.cells[1].firstChild.value = name;
row.cells[1].firstChild.checked = true;
}
if (row.cells[2].firstChild.tagName=='A')
row.cells[2].firstChild.onclick = new Function(this.ref+".command('delete-folder','"+name+"')");
- var form;
- if ((form = this.gui_objects.editform) && form.elements['_folder_name'])
- form.elements['_folder_name'].value = '';
+ var form;
+ if ((form = this.gui_objects.editform) && form.elements['_folder_name'])
+ form.elements['_folder_name'].value = '';
+
+ // add new folder to rename-folder list
+ if (form.elements['_folder_oldname'])
+ form.elements['_folder_oldname'].options[form.elements['_folder_oldname'].options.length] = new Option(name,name);
+
};
// duplicate a specific table row
this.clone_table_row = function(row)
{
var cell, td;
var new_row = document.createElement('TR');
for(var n=0; n<row.childNodes.length; n++)
{
cell = row.childNodes[n];
td = document.createElement('TD');
if (cell.className)
td.className = cell.className;
if (cell.align)
td.setAttribute('align', cell.align);
td.innerHTML = cell.innerHTML;
new_row.appendChild(td);
}
return new_row;
};
/*********************************************************/
/********* GUI functionality *********/
/*********************************************************/
// eable/disable buttons for page shifting
this.set_page_buttons = function()
{
this.enable_command('nextpage', (this.env.pagecount > this.env.current_page));
this.enable_command('previouspage', (this.env.current_page > 1));
}
// set button to a specific state
this.set_button = function(command, state)
{
var a_buttons = this.buttons[command];
var button, obj;
if(!a_buttons || !a_buttons.length)
return;
for(var n=0; n<a_buttons.length; n++)
{
button = a_buttons[n];
obj = document.getElementById(button.id);
// get default/passive setting of the button
if (obj && button.type=='image' && !button.status)
button.pas = obj._original_src ? obj._original_src : obj.src;
else if (obj && !button.status)
button.pas = String(obj.className);
// set image according to button state
if (obj && button.type=='image' && button[state])
{
button.status = state;
obj.src = button[state];
}
// set class name according to button state
else if (obj && typeof(button[state])!='undefined')
{
button.status = state;
obj.className = button[state];
}
// disable/enable input buttons
if (obj && button.type=='input')
{
button.status = state;
obj.disabled = !state;
}
}
};
// mouse over button
this.button_over = function(command, id)
{
var a_buttons = this.buttons[command];
var button, img;
if(!a_buttons || !a_buttons.length)
return;
for(var n=0; n<a_buttons.length; n++)
{
button = a_buttons[n];
if(button.id==id && button.status=='act')
{
img = document.getElementById(button.id);
if (img && button.over)
img.src = button.over;
}
}
};
+ // mouse down on button
+ this.button_sel = function(command, id)
+ {
+ var a_buttons = this.buttons[command];
+ var button, img;
+
+ if(!a_buttons || !a_buttons.length)
+ return;
+
+ for(var n=0; n<a_buttons.length; n++)
+ {
+ button = a_buttons[n];
+ if(button.id==id && button.status=='act')
+ {
+ img = document.getElementById(button.id);
+ if (img && button.sel)
+ img.src = button.sel;
+ }
+ }
+ };
// mouse out of button
this.button_out = function(command, id)
{
var a_buttons = this.buttons[command];
var button, img;
if(!a_buttons || !a_buttons.length)
return;
for(var n=0; n<a_buttons.length; n++)
{
button = a_buttons[n];
if(button.id==id && button.status=='act')
{
img = document.getElementById(button.id);
if (img && button.act)
img.src = button.act;
}
}
};
// set/unset a specific class name
this.set_classname = function(obj, classname, set)
{
var reg = new RegExp('\s*'+classname, 'i');
if (!set && obj.className.match(reg))
obj.className = obj.className.replace(reg, '');
else if (set && !obj.className.match(reg))
obj.className += ' '+classname;
};
// display a specific alttext
this.alttext = function(text)
{
};
// display a system message
this.display_message = function(msg, type, hold)
{
if (!this.loaded) // save message in order to display after page loaded
{
this.pending_message = new Array(msg, type);
return true;
}
if (!this.gui_objects.message)
return false;
if (this.message_timer)
clearTimeout(this.message_timer);
var cont = msg;
if (type)
cont = '<div class="'+type+'">'+cont+'</div>';
this.gui_objects.message._rcube = this;
this.gui_objects.message.innerHTML = cont;
this.gui_objects.message.style.display = 'block';
if (type!='loading')
this.gui_objects.message.onmousedown = function(){ this._rcube.hide_message(); return true; };
if (!hold)
this.message_timer = setTimeout(this.ref+'.hide_message()', this.message_time);
};
// make a message row disapear
this.hide_message = function()
{
if (this.gui_objects.message)
{
this.gui_objects.message.style.display = 'none';
this.gui_objects.message.onmousedown = null;
}
};
// mark a mailbox as selected and set environment variable
this.select_mailbox = function(mbox)
{
if (this.gui_objects.mailboxlist)
{
var item, reg, text_obj;
var s_current = this.env.mailbox.toLowerCase().replace(this.mbox_expression, '');
var s_mbox = String(mbox).toLowerCase().replace(this.mbox_expression, '');
var s_current = this.env.mailbox.toLowerCase().replace(this.mbox_expression, '');
var current_li = document.getElementById('rcmbx'+s_current);
var mbox_li = document.getElementById('rcmbx'+s_mbox);
if (current_li) {
this.set_classname(current_li, 'selected', false);
this.set_classname(current_li, 'unfocused', false);
}
if (mbox_li)
this.set_classname(mbox_li, 'selected', true);
}
this.env.mailbox = mbox;
};
// create a table row in the message list
this.add_message_row = function(uid, cols, flags, attachment, attop)
{
if (!this.gui_objects.messagelist || !this.gui_objects.messagelist.tBodies[0])
return false;
var tbody = this.gui_objects.messagelist.tBodies[0];
var rowcount = tbody.rows.length;
var even = rowcount%2;
this.env.messages[uid] = {deleted:flags.deleted?1:0,
replied:flags.replied?1:0,
unread:flags.unread?1:0};
var row = document.createElement('TR');
row.id = 'rcmrow'+uid;
row.className = 'message '+(even ? 'even' : 'odd')+(flags.unread ? ' unread' : '')+(flags.deleted ? ' deleted' : '');
if (this.in_selection(uid))
row.className += ' selected';
var icon = flags.deleted && this.env.deletedicon ? this.env.deletedicon:
(flags.unread && this.env.unreadicon ? this.env.unreadicon :
(flags.replied && this.env.repliedicon ? this.env.repliedicon : this.env.messageicon));
var col = document.createElement('TD');
col.className = 'icon';
col.innerHTML = icon ? '<img src="'+icon+'" alt="" border="0" />' : '';
row.appendChild(col);
// add each submitted col
for (var c in cols)
{
col = document.createElement('TD');
col.className = String(c).toLowerCase();
col.innerHTML = cols[c];
row.appendChild(col);
}
col = document.createElement('TD');
col.className = 'icon';
col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" border="0" />' : '';
row.appendChild(col);
if (attop && tbody.rows.length)
tbody.insertBefore(row, tbody.firstChild);
else
tbody.appendChild(row);
this.init_message_row(row);
};
// replace content of row count display
this.set_rowcount = function(text)
{
if (this.gui_objects.countdisplay)
this.gui_objects.countdisplay.innerHTML = text;
// update page navigation buttons
this.set_page_buttons();
};
// replace content of quota display
this.set_quota = function(text)
{
if (this.gui_objects.quotadisplay)
this.gui_objects.quotadisplay.innerHTML = text;
};
// update the mailboxlist
this.set_unread_count = function(mbox, count, set_title)
{
if (!this.gui_objects.mailboxlist)
return false;
var item, reg, text_obj;
mbox = String(mbox).toLowerCase().replace(this.mbox_expression, '');
item = document.getElementById('rcmbx'+mbox);
if (item && item.className && item.className.indexOf('mailbox '+mbox)>=0)
{
// set new text
text_obj = item.firstChild;
reg = /\s+\([0-9]+\)$/i;
if (count && text_obj.innerHTML.match(reg))
text_obj.innerHTML = text_obj.innerHTML.replace(reg, ' ('+count+')');
else if (count)
text_obj.innerHTML += ' ('+count+')';
else
text_obj.innerHTML = text_obj.innerHTML.replace(reg, '');
// set the right classes
this.set_classname(item, 'unread', count>0 ? true : false);
}
// set unread count to window title
reg = /^\([0-9]+\)\s+/i;
if (set_title && count && document.title)
{
var doc_title = String(document.title);
if (count && doc_title.match(reg))
document.title = doc_title.replace(reg, '('+count+') ');
else if (count)
document.title = '('+count+') '+doc_title;
else
document.title = doc_title.replace(reg, '');
}
// remove unread count from window title
else if (document.title)
{
document.title = document.title.replace(reg, '');
}
};
// add row to contacts list
this.add_contact_row = function(cid, cols)
{
if (!this.gui_objects.contactslist || !this.gui_objects.contactslist.tBodies[0])
return false;
var tbody = this.gui_objects.contactslist.tBodies[0];
var rowcount = tbody.rows.length;
var even = rowcount%2;
var row = document.createElement('TR');
row.id = 'rcmrow'+cid;
row.className = 'contact '+(even ? 'even' : 'odd');
if (this.in_selection(cid))
row.className += ' selected';
// add each submitted col
for (var c in cols)
{
col = document.createElement('TD');
col.className = String(c).toLowerCase();
col.innerHTML = cols[c];
row.appendChild(col);
}
tbody.appendChild(row);
this.init_table_row(row, 'contact_rows');
};
/********************************************************/
/********* drag & drop methods *********/
/********************************************************/
this.drag_mouse_move = function(e)
{
if (this.drag_start)
{
if (!this.draglayer)
this.draglayer = new rcube_layer('rcmdraglayer', {x:0, y:0, width:300, vis:0, zindex:2000});
// get subjects of selectedd messages
var names = '';
var c, subject, obj;
for(var n=0; n<this.selection.length; n++)
{
if (n>12) // only show 12 lines
{
names += '...';
break;
}
if (this.message_rows[this.selection[n]].obj)
{
obj = this.message_rows[this.selection[n]].obj;
subject = '';
for(c=0; c<obj.childNodes.length; c++)
if (!subject && obj.childNodes[c].nodeName=='TD' && obj.childNodes[c].firstChild && obj.childNodes[c].firstChild.nodeType==3)
{
subject = obj.childNodes[c].firstChild.data;
names += (subject.length > 50 ? subject.substring(0, 50)+'...' : subject) + '<br />';
}
}
}
this.draglayer.write(names);
this.draglayer.show(1);
}
var pos = this.get_mouse_pos(e);
this.draglayer.move(pos.x+20, pos.y-5);
this.drag_start = false;
this.drag_active = true;
return false;
};
this.drag_mouse_up = function()
{
document.onmousemove = null;
if (this.draglayer && this.draglayer.visible)
this.draglayer.show(0);
this.drag_active = false;
return false;
};
/********************************************************/
/********* remote request methods *********/
/********************************************************/
this.http_sockets = new Array();
// find a non-busy socket or create a new one
this.get_request_obj = function()
{
for (var n=0; n<this.http_sockets.length; n++)
{
if (!this.http_sockets[n].busy)
return this.http_sockets[n];
}
// create a new XMLHTTP object
var i = this.http_sockets.length;
this.http_sockets[i] = new rcube_http_request();
return this.http_sockets[i];
};
// send a http request to the server
this.http_request = function(action, querystring, lock)
{
var request_obj = this.get_request_obj();
querystring += '&_remote=1';
// add timestamp to request url to avoid cacheing problems in Safari
if (bw.safari)
querystring += '&_ts='+(new Date().getTime());
// send request
if (request_obj)
{
// prompt('request', this.env.comm_path+'&_action='+escape(action)+'&'+querystring);
console('HTTP request: '+this.env.comm_path+'&_action='+escape(action)+'&'+querystring);
if (lock)
this.set_busy(true);
request_obj.__lock = lock ? true : false;
request_obj.__action = action;
request_obj.onerror = function(o){ rcube_webmail_client.http_error(o); };
request_obj.oncomplete = function(o){ rcube_webmail_client.http_response(o); };
request_obj.GET(this.env.comm_path+'&_action='+escape(action)+'&'+querystring);
}
};
// handle HTTP response
this.http_response = function(request_obj)
{
var ctype = request_obj.get_header('Content-Type');
if (ctype){
ctype = String(ctype).toLowerCase();
var ctype_array=ctype.split(";");
ctype = ctype_array[0];
}
- if (request_obj.__lock)
- this.set_busy(false);
+ this.set_busy(false);
console(request_obj.get_text());
// if we get javascript code from server -> execute it
if (request_obj.get_text() && (ctype=='text/javascript' || ctype=='application/x-javascript'))
eval(request_obj.get_text());
// process the response data according to the sent action
switch (request_obj.__action)
{
case 'delete':
case 'moveto':
if (this.env.action=='show')
this.command('list');
break;
case 'list':
if (this.env.messagecount)
this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox));
case 'expunge':
this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false);
break;
}
request_obj.reset();
};
// handle HTTP request errors
this.http_error = function(request_obj)
{
alert('Error sending request: '+request_obj.url);
if (request_obj.__lock)
this.set_busy(false);
request_obj.reset();
request_obj.__lock = false;
};
// use an image to send a keep-alive siganl to the server
this.send_keep_alive = function()
{
var d = new Date();
this.http_request('keep-alive', '_t='+d.getTime());
};
// send periodic request to check for recent messages
this.check_for_recent = function()
{
+ this.set_busy(true, 'checkingmail');
var d = new Date();
this.http_request('check-recent', '_t='+d.getTime());
};
/********************************************************/
/********* helper methods *********/
/********************************************************/
// check if we're in show mode or if we have a unique selection
// and return the message uid
this.get_single_uid = function()
{
return this.env.uid ? this.env.uid : (this.selection.length==1 ? this.selection[0] : null);
};
// same as above but for contacts
this.get_single_cid = function()
{
return this.env.cid ? this.env.cid : (this.selection.length==1 ? this.selection[0] : null);
};
/* deprecated methods
// check if Shift-key is pressed on event
this.check_shiftkey = function(e)
{
if(!e && window.event)
e = window.event;
if(bw.linux && bw.ns4 && e.modifiers)
return true;
else if((bw.ns4 && e.modifiers & Event.SHIFT_MASK) || (e && e.shiftKey))
return true;
else
return false;
}
// check if Shift-key is pressed on event
this.check_ctrlkey = function(e)
{
if(!e && window.event)
e = window.event;
if(bw.linux && bw.ns4 && e.modifiers)
return true;
else if (bw.mac)
return this.check_shiftkey(e);
else if((bw.ns4 && e.modifiers & Event.CTRL_MASK) || (e && e.ctrlKey))
return true;
else
return false;
}
*/
// returns modifier key (constants defined at top of file)
this.get_modifier = function(e)
{
var opcode = 0;
e = e || window.event;
if (bw.mac && e)
{
opcode += (e.metaKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
return opcode;
}
if (e)
{
opcode += (e.ctrlKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
return opcode;
}
if (e.cancelBubble)
{
e.cancelBubble = true;
e.returnValue = false;
}
else if (e.preventDefault)
e.preventDefault();
}
this.get_mouse_pos = function(e)
{
if(!e) e = window.event;
var mX = (e.pageX) ? e.pageX : e.clientX;
var mY = (e.pageY) ? e.pageY : e.clientY;
if(document.body && document.all)
{
mX += document.body.scrollLeft;
mY += document.body.scrollTop;
}
return { x:mX, y:mY };
};
this.get_caret_pos = function(obj)
{
if (typeof(obj.selectionEnd)!='undefined')
return obj.selectionEnd;
else if (document.selection && document.selection.createRange)
{
var range = document.selection.createRange();
if (range.parentElement()!=obj)
return 0;
var gm = range.duplicate();
if (obj.tagName=='TEXTAREA')
gm.moveToElementText(obj);
else
gm.expand('textedit');
gm.setEndPoint('EndToStart', range);
var p = gm.text.length;
return p<=obj.value.length ? p : -1;
}
else
return obj.value.length;
};
this.set_caret2start = function(obj)
{
if (obj.createTextRange)
{
var range = obj.createTextRange();
range.collapse(true);
range.select();
}
else if (obj.setSelectionRange)
obj.setSelectionRange(0,0);
obj.focus();
};
// set all fields of a form disabled
this.lock_form = function(form, lock)
{
if (!form || !form.elements)
return;
var type;
for (var n=0; n<form.elements.length; n++)
{
type = form.elements[n];
if (type=='hidden')
continue;
form.elements[n].disabled = lock;
}
};
} // end object rcube_webmail
// class for HTTP requests
function rcube_http_request()
{
this.url = '';
this.busy = false;
this.xmlhttp = null;
// reset object properties
this.reset = function()
{
// set unassigned event handlers
this.onloading = function(){ };
this.onloaded = function(){ };
this.oninteractive = function(){ };
this.oncomplete = function(){ };
this.onabort = function(){ };
this.onerror = function(){ };
this.url = '';
this.busy = false;
this.xmlhttp = null;
}
// create HTMLHTTP object
this.build = function()
{
if (window.XMLHttpRequest)
this.xmlhttp = new XMLHttpRequest();
else if (window.ActiveXObject)
this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
else
{
}
}
// sedn GET request
this.GET = function(url)
{
this.build();
if (!this.xmlhttp)
{
this.onerror(this);
return false;
}
var ref = this;
this.url = url;
this.busy = true;
this.xmlhttp.onreadystatechange = function(){ ref.xmlhttp_onreadystatechange(); };
this.xmlhttp.open('GET', url);
this.xmlhttp.send(null);
};
this.POST = function(url, a_param)
{
// not implemented yet
};
// handle onreadystatechange event
this.xmlhttp_onreadystatechange = function()
{
if(this.xmlhttp.readyState == 1)
this.onloading(this);
else if(this.xmlhttp.readyState == 2)
this.onloaded(this);
else if(this.xmlhttp.readyState == 3)
this.oninteractive(this);
else if(this.xmlhttp.readyState == 4)
{
if(this.xmlhttp.status == 0)
this.onabort(this);
else if(this.xmlhttp.status == 200)
this.oncomplete(this);
else
this.onerror(this);
this.busy = false;
}
}
// getter method for HTTP headers
this.get_header = function(name)
{
return this.xmlhttp.getResponseHeader(name);
};
this.get_text = function()
{
return this.xmlhttp.responseText;
};
this.get_xml = function()
{
return this.xmlhttp.responseXML;
};
this.reset();
} // end class rcube_http_request
function console(str)
{
if (document.debugform && document.debugform.console)
document.debugform.console.value += str+'\n--------------------------------------\n';
}
// set onload handler
window.onload = function(e)
{
if (window.rcube_webmail_client)
rcube_webmail_client.init();
};
diff --git a/program/localization/cn/labels.inc b/program/localization/cn/labels.inc
index bf7773457..62208fe63 100644
--- a/program/localization/cn/labels.inc
+++ b/program/localization/cn/labels.inc
@@ -1,203 +1,204 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/cn/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Simplified-chinese utf-8 by winman 2006/02/19 |
| Author: winman rong <winman.rong@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['username'] = '用户名';
$labels['password'] = '密码';
$labels['server'] = '服务器';
$labels['login'] = '登录';
// taskbar
$labels['logout'] = '退出';
$labels['mail'] = '电子邮件';
$labels['settings'] = '个人设置';
$labels['addressbook'] = '地址薄';
// mailbox names
$labels['inbox'] = '收件箱';
$labels['drafts'] = '草稿';
$labels['sent'] = '发件箱';
$labels['trash'] = '垃圾桶';
$labels['drafts'] = '草稿';
$labels['junk'] = '垃圾邮件';
// message listing
$labels['subject'] = '邮件标题';
$labels['from'] = '发件人';
$labels['to'] = '接收人';
$labels['cc'] = '副本';
$labels['bcc'] = '密送';
$labels['replyto'] = '回复地址';
$labels['date'] = '日期';
$labels['size'] = '文件大小';
$labels['priority'] = '优先级';
$labels['organization'] = '团体';
// aliases
$labels['reply-to'] = $labels['回复到'];
$labels['mailboxlist'] = '文件夹';
$labels['messagesfromto'] = 'Messages $from to $to of $count';
$labels['messagenrof'] = 'Message $nr of $count';
$labels['moveto'] = '移动到...';
$labels['download'] = '下载';
$labels['filename'] = '文件名称';
$labels['filesize'] = '文件大小';
$labels['preferhtml'] = '以HTML格式显示';
$labels['htmlmessage'] = 'HTML格式邮件';
$labels['prettydate'] = 'Pretty dates';
$labels['addtoaddressbook'] = '加到地址薄';
// weekdays short
$labels['sun'] = '星期日';
$labels['mon'] = '星期一';
$labels['tue'] = '星期二';
$labels['wed'] = '星期三';
$labels['thu'] = '星期四';
$labels['fri'] = '星期五';
$labels['sat'] = '星期六';
// weekdays long
$labels['sunday'] = '星期日';
$labels['monday'] = '星期一';
$labels['tuesday'] = '星期二';
$labels['wednesday'] = '星期三';
$labels['thursday'] = '星期四';
$labels['friday'] = '星期五';
$labels['saturday'] = '星期六';
$labels['today'] = '今天';
// toolbar buttons
+$labels['checkmail'] = '检查新消息';
$labels['writenewmessage'] = '写新邮件';
$labels['replytomessage'] = '回复邮件';
$labels['forwardmessage'] = '转发邮件';
$labels['deletemessage'] = '把邮件移动到垃圾桶';
$labels['printmessage'] = '打印邮件';
$labels['previousmessages'] = '上一封邮件';
$labels['nextmessages'] = '下一封邮件';
$labels['backtolist'] = '返回收件箱';
$labels['viewsource'] = '显示源代码';
$labels['select'] = '选择';
$labels['all'] = '全部';
$labels['none'] = '不选';
$labels['unread'] = '没读过的';
$labels['compact'] = 'Compact';
$labels['empty'] = '空的';
$labels['purge'] = '清除';
$labels['quota'] = '空间使用';
// message compose
$labels['compose'] = '写新邮件';
$labels['savemessage'] = '保存这份草稿';
$labels['sendmessage'] = '立刻发送邮件';
$labels['addattachment'] = '添加附件';
$labels['attachments'] = '附件';
$labels['upload'] = '上传';
$labels['close'] = '关闭';
$labels['low'] = '低';
$labels['lowest'] = '最低';
$labels['normal'] = '正常';
$labels['high'] = '高';
$labels['highest'] = '最高';
$labels['nosubject'] = '(没有主题)';
$labels['showimages'] = '显示图片';
// address boook
$labels['name'] = '显示名字';
$labels['firstname'] = '名';
$labels['surname'] = '姓';
$labels['email'] = '电子邮件';
$labels['addcontact'] = '增加新联系人';
$labels['editcontact'] = '编辑联系信息';
$labels['edit'] = '编辑';
$labels['cancel'] = '取消';
$labels['save'] = '保存';
$labels['delete'] = '删除';
$labels['newcontact'] = '建立新的联系信息';
$labels['addcontact'] = '将联系人添加到地址薄';
$labels['deletecontact'] = '删除选择的联系信息';
$labels['composeto'] = '给所选择的联系人发送邮件';
$labels['contactsfromto'] = 'Contacts $from to $to of $count';
$labels['print'] = '打印';
$labels['export'] = '导出';
// LDAP search
$labels['ldapsearch'] = 'LDAP 目录搜索';
$labels['ldappublicsearchname'] = '联系人名字';
$labels['ldappublicsearchtype'] = '精确匹配?';
$labels['ldappublicserverselect'] = '选择服务器';
$labels['ldappublicsearchfield'] = 'Search on';
$labels['ldappublicsearchform'] = 'Look for a contact';
$labels['ldappublicsearch'] = '搜索';
// settings
$labels['settingsfor'] = '设置';
$labels['preferences'] = '参数选择';
$labels['userpreferences'] = '用户参数';
$labels['editpreferences'] = '编辑用户参数';
$labels['identities'] = '发件人身份';
$labels['manageidentities'] = '管理发件人资料';
$labels['newidentity'] = '建立新身份';
$labels['newitem'] = 'New item';
$labels['edititem'] = 'Edit item';
$labels['setdefault'] = '设置为默认';
$labels['language'] = '语言';
$labels['timezone'] = '时区';
$labels['pagesize'] = '每页行数';
$labels['signature'] = '签名';
$labels['folder'] = '文件夹';
$labels['folders'] = '文件夹';
$labels['foldername'] = '文件夹名称';
$labels['subscribed'] = '显示与否';
$labels['create'] = '创建';
$labels['createfolder'] = '建立新文件夹';
$labels['deletefolder'] = '删除文件夹';
$labels['managefolders'] = '管理文件夹';
$labels['sortby'] = 'Sort by';
$labels['sortasc'] = '由小到大排列';
$labels['sortdesc'] = '由大到小排列';
?>
\ No newline at end of file
diff --git a/program/localization/cn/messages.inc b/program/localization/cn/messages.inc
index edbe707f9..8ce103bff 100644
--- a/program/localization/cn/messages.inc
+++ b/program/localization/cn/messages.inc
@@ -1,97 +1,99 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/cn/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Simplified-chinese utf-8 by winman 2006/02/19 |
| Author: winman rong <winman.rong@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = '登录失败';
$messages['cookiesdisabled'] = '你的浏览器目前关闭了cookies,请打开cookies再试';
$messages['sessionerror'] = '当前 session 无效或者超时';
$messages['imaperror'] = '不能连接IMAP服务器';
$messages['nomessagesfound'] = '没有邮件在这个邮箱里';
$messages['loggedout'] = '成功结束当前会话. 再见!';
$messages['mailboxempty'] = '邮箱是空的';
$messages['loading'] = '读取...';
$messages['loadingdata'] = '读取数据...';
+$messages['checkingmail'] = '检查新消息...';
+
$messages['sendingmessage'] = '正在发送邮件...';
$messages['messagesent'] = '邮件发送成功';
$messages['savingmessage'] = '挽救消息...';
$messages['messagesaved'] = '消息被保存对草稿';
$messages['successfullysaved'] = '保存成功';
$messages['addedsuccessfully'] = '联系信息成功增加到地址薄';
$messages['contactexists'] = '这个邮件地址已经存在';
$messages['blockedimages'] = '为了保障你的私隐, 阻挡了这个邮件里的图片.';
$messages['encryptedmessage'] = '这是个加密的邮件因此不能显示. 抱歉!';
$messages['nocontactsfound'] = '没有发现联系人';
$messages['sendingfailed'] = '邮件发送失败';
$messages['errorsaving'] = '当发生错误时保存信息';
$messages['errormoving'] = '移动邮件出错';
$messages['errordeleting'] = '删除邮件出错';
$messages['deletecontactconfirm'] = '你确定要删除所选择的联系人信息吗?';
$messages['deletefolderconfirm'] = '你确定要删除此文件夹吗?';
$messages['purgefolderconfirm'] = '你确定要删除此文件夹里所有邮件吗?';
$messages['formincomplete'] = '表格没有填写完全';
$messages['noemailwarning'] = '请输入有效的电子邮件地址';
$messages['nonamewarning'] = '请输入名字';
$messages['nopagesizewarning'] = '请输入行数';
$messages['norecipientwarning'] = '请输入至少一个收件人地址';
$messages['nosubjectwarning'] = '邮件主题还没输入. 你想现在输入吗?';
$messages['nobodywarning'] = '邮件没写内容,确定发送吗?';
$messages['notsentwarning'] = '邮件没有发送. 你要取消这封邮件吗?';
$messages['noldapserver'] = '请选择要搜索的LDAP服务器';
$messages['nocontactsreturned'] = '没有联系人信息';
$messages['nosearchname'] = '请输入一个联系人名字或者电子邮件地址';
?>
\ No newline at end of file
diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc
index 9141564c0..2b73ed0b5 100644
--- a/program/localization/de_CH/labels.inc
+++ b/program/localization/de_CH/labels.inc
@@ -1,215 +1,216 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/de_CH/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
| Corrections: Alexander Stiebing <ja.stiebing[NOSPAM]@web.de> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page // Login-Seite
$labels['welcome'] = 'Willkommen bei $product';
$labels['username'] = 'Benutzername';
$labels['password'] = 'Passwort';
$labels['server'] = 'Server';
$labels['login'] = 'Login';
// taskbar // Aktionsleiste
$labels['logout'] = 'Logout';
$labels['mail'] = 'E-Mail';
$labels['settings'] = 'Einstellungen';
$labels['addressbook'] = 'Adressbuch';
// mailbox names // E-Mail-Ordnernamen
$labels['inbox'] = 'Posteingang';
$labels['drafts'] = 'Entwürfe';
$labels['sent'] = 'Gesendet';
$labels['trash'] = 'Gelöscht';
$labels['junk'] = 'Junk';
// message listing // Nachrichtenliste
$labels['subject'] = 'Betreff';
$labels['from'] = 'Absender';
$labels['to'] = 'Empfänger';
$labels['cc'] = 'Kopie (CC)';
$labels['bcc'] = 'Blind-Kopie';
$labels['replyto'] = 'Antwort an';
$labels['date'] = 'Datum';
$labels['size'] = 'Grösse';
$labels['priority'] = 'Priorität';
$labels['organization'] = 'Organisation';
// aliases // [Platzhalter]
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Ordner';
$labels['messagesfromto'] = 'Nachrichten $from bis $to von $count';
$labels['messagenrof'] = 'Nachricht $nr von $count';
$labels['moveto'] = 'Verschieben nach...';
$labels['download'] = 'Download';
$labels['filename'] = 'Dateiname';
$labels['filesize'] = 'Dateigrösse';
$labels['preferhtml'] = 'HTML bevorzugen';
$labels['htmlmessage'] = 'HTML Nachricht';
$labels['prettydate'] = 'Kurze Datumsanzeige';
$labels['addtoaddressbook'] = 'Ins Adressbuch übernehmen';
// weekdays short // Wochentage (Abkürzungen)
$labels['sun'] = 'So';
$labels['mon'] = 'Mo';
$labels['tue'] = 'Di';
$labels['wed'] = 'Mi';
$labels['thu'] = 'Do';
$labels['fri'] = 'Fr';
$labels['sat'] = 'Sa';
// weekdays long // Wochentage (normal)
$labels['sunday'] = 'Sonntag';
$labels['monday'] = 'Montag';
$labels['tuesday'] = 'Dienstag';
$labels['wednesday'] = 'Mittwoch';
$labels['thursday'] = 'Donnerstag';
$labels['friday'] = 'Freitag';
$labels['saturday'] = 'Samstag';
$labels['today'] = 'Heute';
// toolbar buttons // Symbolleisten-Tipps
+$labels['checkmail'] = 'Überprüfung auf neue Anzeigen';
$labels['writenewmessage'] = 'Neue Nachricht schreiben';
$labels['replytomessage'] = 'Antwort verfassen';
$labels['replytoallmessage'] = 'Antwort an Absender und alle Empfänger';
$labels['forwardmessage'] = 'Nachricht weiterleiten';
$labels['deletemessage'] = 'In den Papierkorb verschieben';
$labels['printmessage'] = 'Diese Nachricht drucken';
$labels['previousmessages'] = 'Vorherige Nachrichten anzeigen';
$labels['nextmessages'] = 'Weitere Nachrichten anzeigen';
$labels['backtolist'] = 'Zurück zur Liste';
$labels['select'] = 'Auswählen';
$labels['all'] = 'Alle';
$labels['none'] = 'Keine';
$labels['unread'] = 'Ungelesene';
$labels['compact'] = 'Packen';
$labels['empty'] = 'Leeren';
$labels['purge'] = 'Aufräumen';
$labels['quota'] = 'Verwendeter Speicherplatz';
$labels['unknown'] = 'unbekannt';
$labels['unlimited'] = 'unlimitiert';
$labels['quicksearch'] = 'Schnellsuche';
$labels['resetsearch'] = 'Löschen';
// message compose // Nachrichten erstellen
$labels['compose'] = 'Neue Nachricht verfassen';
$labels['savemessage'] = 'Nachricht speichern';
$labels['sendmessage'] = 'Nachricht jetzt senden';
$labels['addattachment'] = 'Datei anfügen';
$labels['charset'] = 'Zeichensatz';
$labels['returnreceipt'] = 'Empfangsbestätigung';
$labels['checkspelling'] = 'Rechtschreibung prüfen';
$labels['resumeediting'] = 'Bearbeitung fortzetzen';
$labels['revertto'] = 'Zurück zu';
$labels['attachments'] = 'Anhänge';
$labels['upload'] = 'Hochladen';
$labels['close'] = 'Schliessen';
$labels['low'] = 'Niedrig';
$labels['lowest'] = 'Niedrigste';
$labels['normal'] = 'Normal';
$labels['high'] = 'Hoch';
$labels['highest'] = 'Höchste';
$labels['nosubject'] = '(kein Betreff)';
$labels['showimages'] = 'Bilder anzeigen';
// address book // Adressbuch
$labels['name'] = 'Anzeigename';
$labels['firstname'] = 'Vorname';
$labels['surname'] = 'Nachname';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Kontakt hinzufügen';
$labels['editcontact'] = 'Kontakt bearbeiten';
$labels['edit'] = 'Bearbeiten';
$labels['cancel'] = 'Abbrechen';
$labels['save'] = 'Speichern';
$labels['delete'] = 'Löschen';
$labels['newcontact'] = 'Neuen Kontakt erfassen';
$labels['deletecontact'] = 'Gewählte Kontakte löschen';
$labels['composeto'] = 'Nachricht verfassen';
$labels['contactsfromto'] = 'Kontakte $from bis $to von $count';
$labels['print'] = 'Drucken';
$labels['export'] = 'Exportieren';
$labels['previouspage'] = 'Eine Seite zurück';
$labels['nextpage'] = 'Nächste Seite';
// LDAP search
$labels['ldapsearch'] = 'LDAP Verzeichnis-Suche';
$labels['ldappublicsearchname'] = 'Kontakt-Name';
$labels['ldappublicsearchtype'] = 'Genaue Übereinstimmung';
$labels['ldappublicserverselect'] = 'Server-Auswahl';
$labels['ldappublicsearchfield'] = 'Suche in';
$labels['ldappublicsearchform'] = 'Adressen suchen';
$labels['ldappublicsearch'] = 'Suchen';
// settings // Einstellungen
$labels['settingsfor'] = 'Einstellungen für';
$labels['preferences'] = 'Einstellungen';
$labels['userpreferences'] = 'Benutzereinstellungen';
$labels['editpreferences'] = 'Einstellungen bearbeiten';
$labels['identities'] = 'Absender';
$labels['manageidentities'] = 'Absender für dieses Konto verwalten';
$labels['newidentity'] = 'Neuer Absender';
$labels['newitem'] = 'Neuer Eintrag';
$labels['edititem'] = 'Eintrag bearbeiten';
$labels['setdefault'] = 'Als Standard';
$labels['language'] = 'Sprache';
$labels['timezone'] = 'Zeitzone';
$labels['pagesize'] = 'Einträge pro Seite';
$labels['signature'] = 'Signatur';
$labels['dstactive'] = 'Sommerzeit';
$labels['folder'] = 'Ordner';
$labels['folders'] = 'Ordner';
$labels['foldername'] = 'Ordnername';
$labels['subscribed'] = 'Abonniert';
$labels['create'] = 'Erstellen';
$labels['createfolder'] = 'Neuen Ordner erstellen';
$labels['deletefolder'] = 'Ordner löschen';
$labels['managefolders'] = 'Ordner verwalten';
$labels['sortby'] = 'Sortieren nach';
$labels['sortasc'] = 'aufsteigend sortieren';
$labels['sortdesc'] = 'absteigend sortieren';
?>
\ No newline at end of file
diff --git a/program/localization/de_CH/messages.inc b/program/localization/de_CH/messages.inc
index 57c1513a2..0484b5ded 100644
--- a/program/localization/de_CH/messages.inc
+++ b/program/localization/de_CH/messages.inc
@@ -1,104 +1,106 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/de_CH/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Login fehlgeschlagen';
$messages['cookiesdisabled'] = 'Ihr Browser akzeptiert keine Cookies';
$messages['sessionerror'] = 'Ihre Session ist ungültig oder abgelaufen';
$messages['imaperror'] = 'Keine Verbindung zum IMAP Server';
$messages['nomessagesfound'] = 'Keine Nachrichten in diesem Ordner';
$messages['loggedout'] = 'Sie haben Ihre Session erfolgreich beendet. Auf Wiedersehen!';
$messages['mailboxempty'] = 'Ordner ist leer';
$messages['loading'] = $messages['loadingdata'] = 'Daten werden geladen...';
+$messages['checkingmail'] = 'Überprüfung auf neue Anzeigen...';
+
$messages['sendingmessage'] = 'Nachricht wird gesendet...';
$messages['messagesent'] = 'Nachricht erfolgreich gesendet';
$messages['savingmessage'] = 'Nachricht wird gespeichert...';
$messages['messagesaved'] = 'Nachricht als Entwurf gespeichert';
$messages['successfullysaved'] = 'Erfolgreich gespeichert';
$messages['addedsuccessfully'] = 'Kontakt zum Adressbuch hinzugefügt';
$messages['contactexists'] = 'Es existiert bereits ein Eintrag mit dieser E-Mail-Adresse';
$messages['blockedimages'] = 'Um Ihre Privatsphäre zur schützen, wurden externe Bilder blockiert.';
$messages['encryptedmessage'] = 'Dies ist eine verschlüsselte Nachricht und kann leider nicht angezeigt werden.';
$messages['nocontactsfound'] = 'Keine Kontakte gefunden';
$messages['sendingfailed'] = 'Versand der Nachricht fehlgeschlagen';
$messages['errorsaving'] = 'Beim Speichern ist ein Fehler aufgetreten';
$messages['errormoving'] = 'Nachricht konnte nicht verschoben werden';
$messages['errordeleting'] = 'Nachricht konnte nicht gelöscht werden';
$messages['deletecontactconfirm'] = 'Wollen Sie die ausgewählten Kontakte wirklich löschen';
$messages['deletefolderconfirm'] = 'Wollen Sie diesen Ordner wirklich löschen?';
$messages['purgefolderconfirm'] = 'Wollen Sie diesen Ordner wirklich leeren?';
$messages['formincomplete'] = 'Das Formular wurde nicht vollständig ausgefüllt';
$messages['noemailwarning'] = 'Bitte geben Sie eine gültige E-Mail-Adresse ein';
$messages['nonamewarning'] = 'Bitte geben Sie einen Namen ein';
$messages['nopagesizewarning'] = 'Bitte geben Sie eine Einträge pro Seite ein';
$messages['norecipientwarning'] = 'Bitte geben Sie mindestens einen Empfänger an';
$messages['nosubjectwarning'] = 'Die Betreffzeile ist leer. Möchten Sie jetzt einen Betreff eingeben?';
$messages['nobodywarning'] = 'Diese Nachricht ohne Inhalt senden?';
$messages['notsentwarning'] = 'Ihre Nachricht wurde nicht gesendet. Wollen Sie die Nachricht verwerfen?';
$messages['noldapserver'] = 'Bitte wählen Sie einen LDAP-Server aus';
$messages['nocontactsreturned'] = 'Es wurden keine Kontakte gefunden';
$messages['nosearchname'] = 'Bitte geben Sie einen Namen oder eine E-Mail-Adresse ein';
$messages['searchsuccessful'] = '$nr Nachrichten gefunden';
$messages['searchnomatch'] = 'Keine Treffer';
$messages['searching'] = 'Suche...';
$messages['checking'] = 'Prüfe...';
$messages['nospellerrors'] = 'Keine Rechtschreibfehler gefunden';
?>
\ No newline at end of file
diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc
index ac74b304a..1aab071e4 100644
--- a/program/localization/de_DE/labels.inc
+++ b/program/localization/de_DE/labels.inc
@@ -1,216 +1,217 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/de_DE/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
| de_DE translation: Stephan Diehl <info@sd-edv.de> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page // Login-Seite
$labels['welcome'] = 'Willkommen bei $product';
$labels['username'] = 'Benutzername';
$labels['password'] = 'Passwort';
$labels['server'] = 'Server';
$labels['login'] = 'Anmelden';
// taskbar // Aktionsleiste
$labels['logout'] = 'Abmelden';
$labels['mail'] = 'E-Mail';
$labels['settings'] = 'Einstellungen';
$labels['addressbook'] = 'Adressbuch';
// mailbox names // E-Mail-Ordnernamen
$labels['inbox'] = 'Posteingang';
$labels['drafts'] = 'Entwürfe';
$labels['sent'] = 'Gesendet';
$labels['trash'] = 'Gelöscht';
$labels['junk'] = 'Spam';
// message listing // Nachrichtenliste
$labels['subject'] = 'Betreff';
$labels['from'] = 'Absender';
$labels['to'] = 'Empfänger';
$labels['cc'] = 'Kopie (CC)';
$labels['bcc'] = 'Blind-Kopie';
$labels['replyto'] = 'Antwort an';
$labels['date'] = 'Datum';
$labels['size'] = 'Größe';
$labels['priority'] = 'Priorität';
$labels['organization'] = 'Organisation';
// aliases // [Platzhalter]
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Ordner';
$labels['messagesfromto'] = 'Nachrichten $from bis $to von $count';
$labels['messagenrof'] = 'Nachricht $nr von $count';
$labels['moveto'] = 'Verschieben nach...';
$labels['download'] = 'Download';
$labels['filename'] = 'Dateiname';
$labels['filesize'] = 'Dateigröße';
$labels['preferhtml'] = 'HTML bevorzugen';
$labels['htmlmessage'] = 'HTML Nachricht';
$labels['prettydate'] = 'Kurze Datumsanzeige';
$labels['addtoaddressbook'] = 'Ins Adressbuch übernehmen';
// weekdays short // Wochentage (Abkürzungen)
$labels['sun'] = 'So';
$labels['mon'] = 'Mo';
$labels['tue'] = 'Di';
$labels['wed'] = 'Mi';
$labels['thu'] = 'Do';
$labels['fri'] = 'Fr';
$labels['sat'] = 'Sa';
// weekdays long // Wochentage (normal)
$labels['sunday'] = 'Sonntag';
$labels['monday'] = 'Montag';
$labels['tuesday'] = 'Dienstag';
$labels['wednesday'] = 'Mittwoch';
$labels['thursday'] = 'Donnerstag';
$labels['friday'] = 'Freitag';
$labels['saturday'] = 'Samstag';
$labels['today'] = 'Heute';
// toolbar buttons // Symbolleisten-Tipps
+$labels['checkmail'] = 'Überprüfung auf neue Anzeigen';
$labels['writenewmessage'] = 'Neue Nachricht schreiben';
$labels['replytomessage'] = 'Antwort verfassen';
$labels['replytoallmessage'] = 'Antwort an Absender und alle Empfänger';
$labels['forwardmessage'] = 'Nachricht weiterleiten';
$labels['deletemessage'] = 'In den Papierkorb verschieben';
$labels['printmessage'] = 'Diese Nachricht drucken';
$labels['previousmessages'] = 'Vorherige Nachrichten anzeigen';
$labels['nextmessages'] = 'Weitere Nachrichten anzeigen';
$labels['backtolist'] = 'Zurück zur Liste';
$labels['select'] = 'Auswählen';
$labels['all'] = 'Alle';
$labels['none'] = 'Keine';
$labels['unread'] = 'Ungelesene';
$labels['compact'] = 'Packen';
$labels['empty'] = 'Leeren';
$labels['purge'] = 'Bereinigen';
$labels['quota'] = 'Verwendeter Speicherplatz';
$labels['unknown'] = 'unbekannt';
$labels['unlimited'] = 'unlimitiert';
$labels['quicksearch'] = 'Schnellsuche';
$labels['resetsearch'] = 'Löschen';
// message compose // Nachrichten erstellen
$labels['compose'] = 'Neue Nachricht verfassen';
$labels['savemessage'] = 'Nachricht speichern';
$labels['sendmessage'] = 'Nachricht jetzt senden';
$labels['addattachment'] = 'Datei anfügen';
$labels['charset'] = 'Zeichensatz';
$labels['returnreceipt'] = 'Empfangsbestätigung';
$labels['checkspelling'] = 'Rechtschreibung prüfen';
$labels['resumeediting'] = 'Bearbeitung fortzetzen';
$labels['revertto'] = 'Zurück zu';
$labels['attachments'] = 'Anhänge';
$labels['upload'] = 'Hochladen';
$labels['close'] = 'Schließen';
$labels['low'] = 'Niedrig';
$labels['lowest'] = 'Niedrigste';
$labels['normal'] = 'Normal';
$labels['high'] = 'Hoch';
$labels['highest'] = 'Höchste';
$labels['nosubject'] = '(kein Betreff)';
$labels['showimages'] = 'Bilder anzeigen';
// address book // Adressbuch
$labels['name'] = 'Anzeigename';
$labels['firstname'] = 'Vorname';
$labels['surname'] = 'Nachname';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Kontakt hinzufügen';
$labels['editcontact'] = 'Kontakt bearbeiten';
$labels['edit'] = 'Bearbeiten';
$labels['cancel'] = 'Abbrechen';
$labels['save'] = 'Speichern';
$labels['delete'] = 'Löschen';
$labels['newcontact'] = 'Neuen Kontakt erfassen';
$labels['deletecontact'] = 'Gewählte Kontakte löschen';
$labels['composeto'] = 'Nachricht verfassen';
$labels['contactsfromto'] = 'Kontakte $from bis $to von $count';
$labels['print'] = 'Drucken';
$labels['export'] = 'Exportieren';
$labels['previouspage'] = 'Eine Seite zurück';
$labels['nextpage'] = 'Nächste Seite';
// LDAP search
$labels['ldapsearch'] = 'LDAP Verzeichnis-Suche';
$labels['ldappublicsearchname'] = 'Kontakt-Name';
$labels['ldappublicsearchtype'] = 'Genaue Übereinstimmung';
$labels['ldappublicserverselect'] = 'Server-Auswahl';
$labels['ldappublicsearchfield'] = 'Suche in';
$labels['ldappublicsearchform'] = 'Adressen suchen';
$labels['ldappublicsearch'] = 'Suchen';
// settings // Einstellungen
$labels['settingsfor'] = 'Einstellungen für';
$labels['preferences'] = 'Einstellungen';
$labels['userpreferences'] = 'Benutzereinstellungen';
$labels['editpreferences'] = 'Einstellungen bearbeiten';
$labels['identities'] = 'Absender';
$labels['manageidentities'] = 'Absender für dieses Konto verwalten';
$labels['newidentity'] = 'Neuer Absender';
$labels['newitem'] = 'Neuer Eintrag';
$labels['edititem'] = 'Eintrag bearbeiten';
$labels['setdefault'] = 'Als Standard';
$labels['language'] = 'Sprache';
$labels['timezone'] = 'Zeitzone';
$labels['pagesize'] = 'Einträge pro Seite';
$labels['signature'] = 'Signatur';
$labels['dstactive'] = 'Sommerzeit';
$labels['folder'] = 'Ordner';
$labels['folders'] = 'Ordner';
$labels['foldername'] = 'Ordnername';
$labels['subscribed'] = 'Abonniert';
$labels['create'] = 'Erstellen';
$labels['createfolder'] = 'Neuen Ordner erstellen';
$labels['deletefolder'] = 'Ordner löschen';
$labels['managefolders'] = 'Ordner verwalten';
$labels['sortby'] = 'Sortieren nach';
$labels['sortasc'] = 'aufsteigend sortieren';
$labels['sortdesc'] = 'absteigend sortieren';
?>
diff --git a/program/localization/de_DE/messages.inc b/program/localization/de_DE/messages.inc
index 622cd0d7d..f084b167b 100644
--- a/program/localization/de_DE/messages.inc
+++ b/program/localization/de_DE/messages.inc
@@ -1,105 +1,107 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/de_DE/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
| de_DE translation: Stephan Diehl <info@sd-edv.de> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Anmelden fehlgeschlagen';
$messages['cookiesdisabled'] = 'Ihr Browser akzeptiert keine Cookies';
$messages['sessionerror'] = 'Ihre Session ist ungültig oder abgelaufen';
$messages['imaperror'] = 'Keine Verbindung zum IMAP Server';
$messages['nomessagesfound'] = 'Keine Nachrichten in diesem Ordner';
$messages['loggedout'] = 'Sie haben Ihre Session erfolgreich beendet. Auf Wiedersehen!';
$messages['mailboxempty'] = 'Ordner ist leer';
$messages['loading'] = $messages['loadingdata'] = 'Daten werden geladen...';
+$messages['checkingmail'] = 'Überprüfung auf neue Anzeigen...';
+
$messages['sendingmessage'] = 'Nachricht wird gesendet...';
$messages['messagesent'] = 'Nachricht erfolgreich gesendet';
$messages['savingmessage'] = 'Nachricht wird gespeichert...';
$messages['messagesaved'] = 'Nachricht als Entwurf gespeichert';
$messages['successfullysaved'] = 'Erfolgreich gespeichert';
$messages['addedsuccessfully'] = 'Kontakt zum Adressbuch hinzugefügt';
$messages['contactexists'] = 'Es existiert bereits ein Eintrag mit dieser E-Mail-Adresse';
$messages['blockedimages'] = 'Um Ihre Privatsphäre zur schützen, wurden externe Bilder blockiert.';
$messages['encryptedmessage'] = 'Dies ist eine verschlüsselte Nachricht und kann leider nicht angezeigt werden.';
$messages['nocontactsfound'] = 'Keine Kontakte gefunden';
$messages['sendingfailed'] = 'Versand der Nachricht fehlgeschlagen';
$messages['errorsaving'] = 'Beim Speichern ist ein Fehler aufgetreten';
$messages['errormoving'] = 'Nachricht konnte nicht verschoben werden';
$messages['errordeleting'] = 'Nachricht konnte nicht gelöscht werden';
$messages['deletecontactconfirm'] = 'Wollen Sie die ausgewählten Kontakte wirklich löschen';
$messages['deletefolderconfirm'] = 'Wollen Sie diesen Ordner wirklich löschen?';
$messages['purgefolderconfirm'] = 'Wollen Sie diesen Ordner wirklich leeren?';
$messages['formincomplete'] = 'Das Formular wurde nicht vollständig ausgefüllt';
$messages['noemailwarning'] = 'Bitte geben Sie eine gültige E-Mail-Adresse ein';
$messages['nonamewarning'] = 'Bitte geben Sie einen Namen ein';
$messages['nopagesizewarning'] = 'Bitte geben Sie eine Einträge pro Seite ein';
$messages['norecipientwarning'] = 'Bitte geben Sie mindestens einen Empfänger an';
$messages['nosubjectwarning'] = 'Die Betreffzeile ist leer. Möchten Sie jetzt einen Betreff eingeben?';
$messages['nobodywarning'] = 'Diese Nachricht ohne Inhalt senden?';
$messages['notsentwarning'] = 'Ihre Nachricht wurde nicht gesendet. Wollen Sie die Nachricht verwerfen?';
$messages['noldapserver'] = 'Bitte wählen Sie einen LDAP-Server aus';
$messages['nocontactsreturned'] = 'Es wurden keine Kontakte gefunden';
$messages['nosearchname'] = 'Bitte geben Sie einen Namen oder eine E-Mail-Adresse ein';
$messages['searchsuccessful'] = '$nr Nachrichten gefunden';
$messages['searchnomatch'] = 'Keine Treffer';
$messages['searching'] = 'Suche...';
$messages['checking'] = 'Prüfe...';
$messages['nospellerrors'] = 'Keine Rechtschreibfehler gefunden';
?>
\ No newline at end of file
diff --git a/program/localization/el/labels.inc b/program/localization/el/labels.inc
index 37b42c1ef..ff99364b3 100755
--- a/program/localization/el/labels.inc
+++ b/program/localization/el/labels.inc
@@ -1,183 +1,184 @@
<?php
/*
+------------------------------------------------------------------------------+
| language/el/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+------------------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+------------------------------------------------------------------------------+
| Greek Translation: Panormitis Petrou <panormitis@gmx.net> |
+------------------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['username'] = 'Όνομα χρήστη';
$labels['password'] = 'Κωδικός πρόσβασης';
$labels['server'] = 'Διακομιστής';
$labels['login'] = 'Είσοδος';
// taskbar
$labels['logout'] = 'Αποσύνδεση';
$labels['mail'] = 'E-Mail';
$labels['settings'] = 'Προσωπικές ρυθμίσεις';
$labels['addressbook'] = 'Βιβλίο διευθύνσεων';
// mailbox names
$labels['inbox'] = 'Εισερχόμενα';
$labels['drafts'] = 'Σχέδια';
$labels['sent'] = 'Απεσταλμένα';
$labels['trash'] = 'Κάδος αχρήστων';
$labels['drafts'] = 'Προσχέδια';
$labels['junk'] = '’χρηστα';
// message listing
$labels['subject'] = 'Θέμα';
$labels['nosubject'] = '(χωρίς θέμα)';
$labels['from'] = 'Αποστολέας';
$labels['to'] = 'Παραλήπτης';
$labels['cc'] = 'Κοινοποίηση';
$labels['bcc'] = 'Κρυφή κοινοποίηση';
$labels['replyto'] = 'Απάντηση προς';
$labels['replytoallmessage'] = 'Απάντηση προς τον αποστολέα και προς όλους τους παραλήπτες';
$labels['date'] = 'Ημερομηνία';
$labels['size'] = 'Μέγεθος';
$labels['priority'] = 'Προτεραιότητα';
$labels['organization'] = 'Οργανισμός';
$labels['sortby'] = 'Ταξινόμηση κατά';
$labels['sortasc'] = 'Αύξουσα ταξινόμηση';
$labels['sortdesc'] = 'Φθίνουσα ταξινόμηση';
// aliases
$labels['reply-to'] = $labels['Απάντηση προς'];
$labels['mailboxlist'] = 'Φάκελοι';
$labels['messagesfromto'] = 'Μηνύματα $from έως $to από $count';
$labels['messagenrof'] = 'Μήνυμα $nr από $count';
$labels['moveto'] = 'Μετακίνηση σε...';
$labels['download'] = 'Λήψη';
$labels['filename'] = 'Όνομα αρχείου';
$labels['filesize'] = 'Μέγεθος αρχείου';
$labels['preferhtml'] = 'Προτιμάται HTML';
$labels['htmlmessage'] = 'Μήνυμα HTML';
$labels['prettydate'] = 'Μορφοποιημένες ημερομηνίες';
$labels['addtoaddressbook'] = 'Προσθήκη στο βιβλίο διευθύνσεων';
// weekdays short
$labels['sun'] = 'Κυρ';
$labels['mon'] = 'Δευ';
$labels['tue'] = 'Τρι';
$labels['wed'] = 'Τετ';
$labels['thu'] = 'Πεμ';
$labels['fri'] = 'Παρ';
$labels['sat'] = 'Σαβ';
// weekdays long
$labels['sunday'] = 'Κυριακή';
$labels['monday'] = 'Δευτέρα';
$labels['tuesday'] = 'Τρίτη';
$labels['wednesday'] = 'Τετάρτη';
$labels['thursday'] = 'Πέμπτη';
$labels['friday'] = 'Παρασκευή';
$labels['saturday'] = 'Σάββατο';
$labels['today'] = 'Σήμερα';
// toolbar buttons
+$labels['checkmail'] = 'Έλεγχος για τα νέα μηνύματα';
$labels['writenewmessage'] = 'Δημιουργία νέου μηνύματος';
$labels['replytomessage'] = 'Απάντηση μηνύματος';
$labels['forwardmessage'] = 'Προώθηση μηνύματος';
$labels['deletemessage'] = 'Μεταφορά του μηνύματος στον κάδο αχρήστων';
$labels['printmessage'] = 'Εκτύπωση μηνύματος';
$labels['previousmessages'] = 'Εμφάνιση προηγουμένων μηνυμάτων';
$labels['nextmessages'] = 'Εμφάνιση επομένων μηνυμάτων';
$labels['backtolist'] = 'Επιστροφή στη λίστα μηνυμάτων';
$labels['viewsource'] = 'Προβολή προέλευσης';
$labels['select'] = 'Επιλογή';
$labels['all'] = 'Όλα';
$labels['none'] = 'Κανένα';
$labels['unread'] = 'Αδιάβαστα';
// message compose
$labels['compose'] = 'Σύνθεση μηνύματος';
$labels['savemessage'] = 'Εκτός από αυτό το σχέδιο';
$labels['sendmessage'] = 'Αποστολή του μηνύματος τώρα';
$labels['addattachment'] = 'Επισύναψη αρχείου';
$labels['attachments'] = 'Συνημμένα';
$labels['upload'] = 'Αποστολή';
$labels['close'] = 'Κλείσιμο';
$labels['low'] = 'Χαμηλή';
$labels['lowest'] = 'Χαμηλότατη';
$labels['normal'] = 'Κανονική';
$labels['high'] = 'Υψηλή';
$labels['highest'] = 'Ύψιστη';
$labels['showimages'] = 'Εμφάνιση εικόνων';
// address boook
$labels['name'] = 'Εμφάνιση ονόματος';
$labels['firstname'] = 'Όνομα';
$labels['surname'] = 'Επώνυμο';
$labels['email'] = 'Διεύθυνση e-mail';
$labels['addcontact'] = 'Προσθήκη νέας επαφής';
$labels['editcontact'] = 'Επεξεργασία επαφής';
$labels['edit'] = 'Επεξεργασία';
$labels['cancel'] = '’κυρο';
$labels['save'] = 'Αποθήκευση';
$labels['delete'] = 'Διαγραφή';
$labels['newcontact'] = 'Δημιουργία νέας κάρτας επαφής';
$labels['deletecontact'] = 'Διαγραφή επιλεγμένων επαφών';
$labels['composeto'] = 'Σύνθεση μηνύματος προς';
$labels['contactsfromto'] = 'Επαφές $from έως $to από $count';
$labels['print'] = 'Εκτύπωση';
$labels['export'] = 'Εξαγωγή';
// settings
$labels['settingsfor'] = 'Ρυθμίσεις για';
$labels['preferences'] = 'Προτιμήσεις';
$labels['userpreferences'] = 'Προτιμήσεις χρήστη';
$labels['editpreferences'] = 'Επεξεργασία προτιμήσεων χρήστη';
$labels['identities'] = 'Ταυτότητες';
$labels['manageidentities'] = 'Διαχείριση ταυτοτήτων αυτού του λογαριασμού';
$labels['newidentity'] = 'Νέα ταυτότητα';
$labels['newitem'] = 'Νέο αντικείμενο';
$labels['edititem'] = 'Επεξεργασία αντικειμένου';
$labels['setdefault'] = 'Ορισμός προεπιλογών';
$labels['language'] = 'Γλώσσα';
$labels['timezone'] = 'Ζώνη ώρας';
$labels['pagesize'] = 'Γραμμές ανά σελίδα';
$labels['folders'] = 'Φάκελοι';
$labels['foldername'] = 'Όνομα φακέλου';
$labels['subscribed'] = 'Εγγεγραμμένοι φάκελοι';
$labels['create'] = 'Δημιουργία';
$labels['createfolder'] = 'Δημιουργία νέου φακέλου';
$labels['deletefolder'] = 'Διαγραφή φακέλου';
$labels['managefolders'] = 'Διαχείριση φακέλων';
?>
\ No newline at end of file
diff --git a/program/localization/el/messages.inc b/program/localization/el/messages.inc
index 0d01054b0..c3612be46 100755
--- a/program/localization/el/messages.inc
+++ b/program/localization/el/messages.inc
@@ -1,84 +1,86 @@
<?php
/*
+------------------------------------------------------------------------------+
| language/el/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+------------------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+------------------------------------------------------------------------------+
| Greek Translation: Panormitis Petrou <panormitis@gmx.net> |
+------------------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Η είσοδος απέτυχε';
$messages['cookiesdisabled'] = 'Ο φυλλομετρητής σας δεν υποστηρίζει cookies';
$messages['sessionerror'] = 'Η σύνοδος σας δεν είναι έγκυρη ή έχει λήξει';
$messages['imaperror'] = 'Η σύνδεση με τον διακομιστή IMAP απέτυχε';
$messages['nomessagesfound'] = 'Δεν βρέθηκαν μηνύματα σε αυτό το γραμματοκιβώτιο';
$messages['loggedout'] = 'Έχετε αποσυνδεθεί επιτυχώς. Αντίο!';
$messages['mailboxempty'] = 'Το γραμματοκιβώτιο είναι άδειο';
$messages['loading'] = 'Φόρτωση...';
$messages['loadingdata'] = 'Φόρτωση δεδομένων...';
+$messages['checkingmail'] = 'Έλεγχος για τα νέα μηνύματα...';
+
$messages['sendingmessage'] = 'Αποστολή μηνύματος...';
$messages['messagesent'] = 'Το μήνυμα στάλθηκε επιτυχώς';
$messages['savingmessage'] = 'Μήνυμα αποταμίευσης...';
$messages['messagesaved'] = 'Μήνυμα που σώζεται στα σχέδια';
$messages['successfullysaved'] = 'Αποθηκεύτηκε επιτυχώς';
$messages['addedsuccessfully'] = 'Η επαφή προστέθηκε επιτυχώς στο βιβλίο διευθύνσεων';
$messages['contactexists'] = 'Υπάρχει ήδη επαφή με αυτή τη διεύθυνση e-mail';
$messages['blockedimages'] = 'Για τη δική σας προστασία, έχουν μπλοκαριστεί οι απομακρυσμένες εικόνες που έχει αυτό το μήνυμα.';
$messages['encryptedmessage'] = 'Αυτό είναι ένα κρυπτογραφημένο μήνυμα και δεν μπορεί να εμφανιστεί. Συγνώμη!';
$messages['noemailwarning'] = 'Παρακαλώ εισάγετε μια έγκυρη διεύθυνση e-mail';
$messages['nonamewarning'] = 'Παρακαλώ εισάγετε ένα όνομα';
$messages['nopagesizewarning'] = 'Παρακαλώ εισάγετε ένα μέγεθος σελίδας';
$messages['formincomplete'] = 'Η φόρμα δεν συμπληρώθηκε τελείως';
$messages['norecipientwarning'] = 'Παρακαλώ εισάγετε τουλάχιστον έναν παραλήπτη';
$messages['nosubjectwarning'] = 'Το πεδίο "Θέμα" είναι άδειο. Θέλετε να το πληκτρολογήσετε τώρα;';
$messages['nobodywarning'] = 'Θέλετε να στείλετε αυτό το μήνυμα χωρίς κείμενο';
$messages['nocontactsfound'] = 'Δεν βρέθηκαν επαφές';
$messages['sendingfailed'] = 'Η αποστολή του μηνύματος απέτυχε';
$messages['errorsaving'] = 'Εμφανίστηκε ένα σφάλμα κατά την αποθήκευση';
$messages['errormoving'] = 'Το μήνυμα δεν μπόρεσε να μετακινηθεί';
$messages['errordeleting'] = 'Το μήνυμα δεν μπόρεσε να διαγραφτεί';
?>
\ No newline at end of file
diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc
index 3365f926c..fc7a93f28 100644
--- a/program/localization/en_GB/labels.inc
+++ b/program/localization/en_GB/labels.inc
@@ -1,203 +1,204 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/en_GB/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Weiran Zhang (weiran@weiran.co.uk) |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['welcome'] = 'Welcome to $product';
$labels['username'] = 'Username';
$labels['password'] = 'Password';
$labels['server'] = 'Server';
$labels['login'] = 'Login';
// taskbar
$labels['logout'] = 'Logout';
$labels['mail'] = 'E-Mail';
$labels['settings'] = 'Personal Settings';
$labels['addressbook'] = 'Address Book';
// mailbox names
$labels['inbox'] = 'Inbox';
$labels['drafts'] = 'Drafts';
$labels['sent'] = 'Sent';
$labels['trash'] = 'Deleted Items';
$labels['drafts'] = 'Drafts';
$labels['junk'] = 'Junk';
// message listing
$labels['subject'] = 'Subject';
$labels['from'] = 'Sender';
$labels['to'] = 'Recipient';
$labels['cc'] = 'Copy';
$labels['bcc'] = 'Bcc';
$labels['replyto'] = 'Reply-To';
$labels['date'] = 'Date';
$labels['size'] = 'Size';
$labels['priority'] = 'Priority';
$labels['organization'] = 'Organisation';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Folders';
$labels['messagesfromto'] = 'Messages $from to $to of $count';
$labels['messagenrof'] = 'Message $nr of $count';
$labels['moveto'] = 'move to...';
$labels['download'] = 'download';
$labels['filename'] = 'File name';
$labels['filesize'] = 'File size';
$labels['preferhtml'] = 'Prefer HTML';
$labels['htmlmessage'] = 'HTML Message';
$labels['prettydate'] = 'Pretty dates';
$labels['addtoaddressbook'] = 'Add to address book';
// weekdays short
$labels['sun'] = 'Sun';
$labels['mon'] = 'Mon';
$labels['tue'] = 'Tue';
$labels['wed'] = 'Wed';
$labels['thu'] = 'Thu';
$labels['fri'] = 'Fri';
$labels['sat'] = 'Sat';
// weekdays long
$labels['sunday'] = 'Sunday';
$labels['monday'] = 'Monday';
$labels['tuesday'] = 'Tuesday';
$labels['wednesday'] = 'Wednesday';
$labels['thursday'] = 'Thursday';
$labels['friday'] = 'Friday';
$labels['saturday'] = 'Saturday';
$labels['today'] = 'Today';
// toolbar buttons
+$labels['checkmail'] = 'Check for new messages';
$labels['writenewmessage'] = 'Create a new message';
$labels['replytomessage'] = 'Reply to the message';
$labels['replytoallmessage'] = 'Reply to sender and all recipients';
$labels['forwardmessage'] = 'Forward the message';
$labels['deletemessage'] = 'Move message to trash';
$labels['printmessage'] = 'Print this message';
$labels['previousmessages'] = 'Show previous set of messages';
$labels['nextmessages'] = 'Show next set of messages';
$labels['backtolist'] = 'Back to message list';
$labels['viewsource'] = 'Show source';
$labels['select'] = 'Select';
$labels['all'] = 'All';
$labels['none'] = 'None';
$labels['unread'] = 'Unread';
$labels['compact'] = 'Compact';
$labels['empty'] = 'Empty';
$labels['purge'] = 'Purge';
$labels['quota'] = 'Disk usage';
// message compose
$labels['compose'] = 'Compose a message';
$labels['savemessage'] = 'Save this draft';
$labels['sendmessage'] = 'Send the message now';
$labels['addattachment'] = 'Attach a file';
$labels['charset'] = 'Charset';
$labels['attachments'] = 'Attachments';
$labels['upload'] = 'Upload';
$labels['close'] = 'Close';
$labels['low'] = 'Low';
$labels['lowest'] = 'Lowest';
$labels['normal'] = 'Normal';
$labels['high'] = 'High';
$labels['highest'] = 'Highest';
$labels['nosubject'] = '(no subject)';
$labels['showimages'] = 'Display images';
// address boook
$labels['name'] = 'Display name';
$labels['firstname'] = 'First name';
$labels['surname'] = 'Last name';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Add new contact';
$labels['editcontact'] = 'Edit contact';
$labels['edit'] = 'Edit';
$labels['cancel'] = 'Cancel';
$labels['save'] = 'Save';
$labels['delete'] = 'Delete';
$labels['newcontact'] = 'Create new contact card';
$labels['addcontact'] = 'Add selected contact to your addressbook';
$labels['deletecontact'] = 'Delete selected contacts';
$labels['composeto'] = 'Compose mail to';
$labels['contactsfromto'] = 'Contacts $from to $to of $count';
$labels['print'] = 'Print';
$labels['export'] = 'Export';
// LDAP search
$labels['ldapsearch'] = 'LDAP directory search';
$labels['ldappublicsearchname'] = 'Contact name';
$labels['ldappublicsearchtype'] = 'Exact match?';
$labels['ldappublicserverselect'] = 'Select servers';
$labels['ldappublicsearchfield'] = 'Search on';
$labels['ldappublicsearchform'] = 'Look for a contact';
$labels['ldappublicsearch'] = 'Search';
// settings
$labels['settingsfor'] = 'Settings for';
$labels['preferences'] = 'Preferences';
$labels['userpreferences'] = 'User preferences';
$labels['editpreferences'] = 'Edit user preferences';
$labels['identities'] = 'Identities';
$labels['manageidentities'] = 'Manage identities for this account';
$labels['newidentity'] = 'New identity';
$labels['newitem'] = 'New item';
$labels['edititem'] = 'Edit item';
$labels['setdefault'] = 'Set default';
$labels['language'] = 'Language';
$labels['timezone'] = 'Time zone';
$labels['pagesize'] = 'Rows per page';
$labels['signature'] = 'Signature';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folders';
$labels['foldername'] = 'Folder name';
$labels['subscribed'] = 'Subscribed';
$labels['create'] = 'Create';
$labels['createfolder'] = 'Create new folder';
$labels['deletefolder'] = 'Delete folder';
$labels['managefolders'] = 'Manage folders';
$labels['sortby'] = 'Sort by';
$labels['sortasc'] = 'Sort ascending';
$labels['sortdesc'] = 'Sort descending';
?>
diff --git a/program/localization/en_GB/messages.inc b/program/localization/en_GB/messages.inc
index de4e90114..262e30007 100644
--- a/program/localization/en_GB/messages.inc
+++ b/program/localization/en_GB/messages.inc
@@ -1,91 +1,93 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/en_GB/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Weiran Zhang (weiran@weiran.co.uk) |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Login failed';
$messages['cookiesdisabled'] = 'Your browser does not accept cookies';
$messages['sessionerror'] = 'Your session is invalid or expired';
$messages['imaperror'] = 'Connection to IMAP server failed';
$messages['nomessagesfound'] = 'No messages found in this mailbox';
$messages['loggedout'] = 'You have successfully terminated the session. Good bye!';
$messages['mailboxempty'] = 'Mailbox is empty';
$messages['loading'] = 'Loading...';
$messages['loadingdata'] = 'Loading data...';
+$messages['checkingmail'] = 'Checking for new messages...';
+
$messages['messagesent'] = 'Message sent successfully';
$messages['savingmessage'] = 'Saving message...';
$messages['messagesaved'] = 'Message saved to Drafts';
$messages['successfullysaved'] = 'Successfully saved';
$messages['addedsuccessfully'] = 'Contact added successfully to address book';
$messages['contactexists'] = 'A contact with this e-mail address already exists';
$messages['blockedimages'] = 'To protect your privacy, remote images are blocked in this message.';
$messages['encryptedmessage'] = 'This is an encrypted message and can not be displayed. Sorry!';
$messages['nocontactsfound'] = 'No contacts found';
$messages['sendingfailed'] = 'Failed to send message';
$messages['errorsaving'] = 'An error occured while saving';
$messages['errormoving'] = 'Could not move the message';
$messages['errordeleting'] = 'Could not delete the message';
$messages['deletecontactconfirm'] = 'Do you really want to delete the selected contact(s)?';
$messages['deletefolderconfirm'] = 'Do you really want to delete this folder?';
$messages['formincomplete'] = 'The form was not completely filled out';
$messages['noemailwarning'] = 'Please enter a valid email address';
$messages['nonamewarning'] = 'Please enter a name';
$messages['nopagesizewarning'] = 'Please enter a page size';
$messages['norecipientwarning'] = 'Please enter at least one recipient';
$messages['nosubjectwarning'] = 'The "Subject" field is empty. Would you like to enter one now?';
$messages['nobodywarning'] = 'Send this message without text?';
$messages['notsentwarning'] = 'Message has not been sent. Do you want to discard your message?';
$messages['noldapserver'] = 'Please select an ldap server to search';
$messages['nocontactsreturned'] = 'No contacts were found';
$messages['nosearchname'] = 'Please enter a contact name or email address';
?>
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index c5cbaa453..436dacfd0 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -1,218 +1,221 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/en_US/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['welcome'] = 'Welcome to $product';
$labels['username'] = 'Username';
$labels['password'] = 'Password';
$labels['server'] = 'Server';
$labels['login'] = 'Login';
// taskbar
$labels['logout'] = 'Logout';
$labels['mail'] = 'E-Mail';
$labels['settings'] = 'Personal Settings';
$labels['addressbook'] = 'Address Book';
// mailbox names
$labels['inbox'] = 'Inbox';
$labels['drafts'] = 'Drafts';
$labels['sent'] = 'Sent';
$labels['trash'] = 'Trash';
$labels['junk'] = 'Junk';
// message listing
$labels['subject'] = 'Subject';
$labels['from'] = 'Sender';
$labels['to'] = 'Recipient';
$labels['cc'] = 'Copy';
$labels['bcc'] = 'Bcc';
$labels['replyto'] = 'Reply-To';
$labels['date'] = 'Date';
$labels['size'] = 'Size';
$labels['priority'] = 'Priority';
$labels['organization'] = 'Organization';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Folders';
$labels['messagesfromto'] = 'Messages $from to $to of $count';
$labels['messagenrof'] = 'Message $nr of $count';
$labels['moveto'] = 'move to...';
$labels['download'] = 'download';
$labels['filename'] = 'File name';
$labels['filesize'] = 'File size';
$labels['preferhtml'] = 'Prefer HTML';
$labels['htmlmessage'] = 'HTML Message';
$labels['prettydate'] = 'Pretty dates';
$labels['addtoaddressbook'] = 'Add to address book';
// weekdays short
$labels['sun'] = 'Sun';
$labels['mon'] = 'Mon';
$labels['tue'] = 'Tue';
$labels['wed'] = 'Wed';
$labels['thu'] = 'Thu';
$labels['fri'] = 'Fri';
$labels['sat'] = 'Sat';
// weekdays long
$labels['sunday'] = 'Sunday';
$labels['monday'] = 'Monday';
$labels['tuesday'] = 'Tuesday';
$labels['wednesday'] = 'Wednesday';
$labels['thursday'] = 'Thursday';
$labels['friday'] = 'Friday';
$labels['saturday'] = 'Saturday';
$labels['today'] = 'Today';
// toolbar buttons
+$labels['checkmail'] = 'Check for new messages';
$labels['writenewmessage'] = 'Create a new message';
$labels['replytomessage'] = 'Reply to the message';
$labels['replytoallmessage'] = 'Reply to sender and all recipients';
$labels['forwardmessage'] = 'Forward the message';
$labels['deletemessage'] = 'Move message to trash';
$labels['printmessage'] = 'Print this message';
$labels['previousmessages'] = 'Show previous set of messages';
$labels['nextmessages'] = 'Show next set of messages';
$labels['backtolist'] = 'Back to message list';
$labels['viewsource'] = 'Show source';
$labels['select'] = 'Select';
$labels['all'] = 'All';
$labels['none'] = 'None';
$labels['unread'] = 'Unread';
$labels['compact'] = 'Compact';
$labels['empty'] = 'Empty';
$labels['purge'] = 'Purge';
$labels['quota'] = 'Disk usage';
$labels['unknown'] = 'unknown';
$labels['unlimited'] = 'unlimited';
$labels['quicksearch'] = 'Quick search';
$labels['resetsearch'] = 'Reset search';
// message compose
$labels['compose'] = 'Compose a message';
$labels['savemessage'] = 'Save this draft';
$labels['sendmessage'] = 'Send the message now';
$labels['addattachment'] = 'Attach a file';
$labels['charset'] = 'Charset';
$labels['returnreceipt'] = 'Return receipt';
$labels['checkspelling'] = 'Check spelling';
$labels['resumeediting'] = 'Resume editing';
$labels['revertto'] = 'Revert to';
$labels['attachments'] = 'Attachments';
$labels['upload'] = 'Upload';
$labels['close'] = 'Close';
$labels['low'] = 'Low';
$labels['lowest'] = 'Lowest';
$labels['normal'] = 'Normal';
$labels['high'] = 'High';
$labels['highest'] = 'Highest';
$labels['nosubject'] = '(no subject)';
$labels['showimages'] = 'Display images';
// address boook
$labels['name'] = 'Display name';
$labels['firstname'] = 'First name';
$labels['surname'] = 'Last name';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Add new contact';
$labels['editcontact'] = 'Edit contact';
$labels['edit'] = 'Edit';
$labels['cancel'] = 'Cancel';
$labels['save'] = 'Save';
$labels['delete'] = 'Delete';
$labels['newcontact'] = 'Create new contact card';
$labels['addcontact'] = 'Add selected contact to your addressbook';
$labels['deletecontact'] = 'Delete selected contacts';
$labels['composeto'] = 'Compose mail to';
$labels['contactsfromto'] = 'Contacts $from to $to of $count';
$labels['print'] = 'Print';
$labels['export'] = 'Export';
$labels['previouspage'] = 'Show previous set';
$labels['nextpage'] = 'Show next set';
// LDAP search
$labels['ldapsearch'] = 'LDAP directory search';
$labels['ldappublicsearchname'] = 'Contact name';
$labels['ldappublicsearchtype'] = 'Exact match?';
$labels['ldappublicserverselect'] = 'Select servers';
$labels['ldappublicsearchfield'] = 'Search on';
$labels['ldappublicsearchform'] = 'Look for a contact';
$labels['ldappublicsearch'] = 'Search';
// settings
$labels['settingsfor'] = 'Settings for';
$labels['preferences'] = 'Preferences';
$labels['userpreferences'] = 'User preferences';
$labels['editpreferences'] = 'Edit user preferences';
$labels['identities'] = 'Identities';
$labels['manageidentities'] = 'Manage identities for this account';
$labels['newidentity'] = 'New identity';
$labels['newitem'] = 'New item';
$labels['edititem'] = 'Edit item';
$labels['setdefault'] = 'Set default';
$labels['language'] = 'Language';
$labels['timezone'] = 'Time zone';
$labels['pagesize'] = 'Rows per page';
$labels['signature'] = 'Signature';
$labels['dstactive'] = 'Daylight savings';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folders';
$labels['foldername'] = 'Folder name';
$labels['subscribed'] = 'Subscribed';
$labels['create'] = 'Create';
$labels['createfolder'] = 'Create new folder';
+$labels['rename'] = 'Rename';
+$labels['renamefolder'] = 'Rename existing folder';
$labels['deletefolder'] = 'Delete folder';
$labels['managefolders'] = 'Manage folders';
$labels['sortby'] = 'Sort by';
$labels['sortasc'] = 'Sort ascending';
$labels['sortdesc'] = 'Sort descending';
?>
diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc
index d4f3643ae..a5ffc091c 100644
--- a/program/localization/en_US/messages.inc
+++ b/program/localization/en_US/messages.inc
@@ -1,106 +1,108 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/en/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Login failed';
$messages['cookiesdisabled'] = 'Your browser does not accept cookies';
$messages['sessionerror'] = 'Your session is invalid or expired';
$messages['imaperror'] = 'Connection to IMAP server failed';
$messages['nomessagesfound'] = 'No messages found in this mailbox';
$messages['loggedout'] = 'You have successfully terminated the session. Good bye!';
$messages['mailboxempty'] = 'Mailbox is empty';
$messages['loading'] = 'Loading...';
$messages['loadingdata'] = 'Loading data...';
+$messages['checkingmail'] = 'Checking for new messages...';
+
$messages['sendingmessage'] = 'Sending message...';
$messages['messagesent'] = 'Message sent successfully';
$messages['savingmessage'] = 'Saving message...';
$messages['messagesaved'] = 'Message saved to Drafts';
$messages['successfullysaved'] = 'Successfully saved';
$messages['addedsuccessfully'] = 'Contact added successfully to address book';
$messages['contactexists'] = 'A contact with this e-mail address already exists';
$messages['blockedimages'] = 'To protect your privacy, remote images are blocked in this message.';
$messages['encryptedmessage'] = 'This is an encrypted message and can not be displayed. Sorry!';
$messages['nocontactsfound'] = 'No contacts found';
$messages['sendingfailed'] = 'Failed to send message';
$messages['errorsaving'] = 'An error occured while saving';
$messages['errormoving'] = 'Could not move the message';
$messages['errordeleting'] = 'Could not delete the message';
$messages['deletecontactconfirm'] = 'Do you really want to delete the selected contact(s)?';
$messages['deletefolderconfirm'] = 'Do you really want to delete this folder?';
$messages['purgefolderconfirm'] = 'Do you really want to delete all messages in this folder?';
$messages['formincomplete'] = 'The form was not completely filled out';
$messages['noemailwarning'] = 'Please enter a valid email address';
$messages['nonamewarning'] = 'Please enter a name';
$messages['nopagesizewarning'] = 'Please enter a page size';
$messages['norecipientwarning'] = 'Please enter at least one recipient';
$messages['nosubjectwarning'] = 'The "Subject" field is empty. Would you like to enter one now?';
$messages['nobodywarning'] = 'Send this message without text?';
$messages['notsentwarning'] = 'Message has not been sent. Do you want to discard your message?';
$messages['noldapserver'] = 'Please select an ldap server to search';
$messages['nocontactsreturned'] = 'No contacts were found';
$messages['nosearchname'] = 'Please enter a contact name or email address';
$messages['searchsuccessful'] = '$nr messages found';
$messages['searchnomatch'] = 'Search returned no matches';
$messages['searching'] = 'Searching...';
$messages['checking'] = 'Checking...';
$messages['nospellerrors'] = 'No spelling errors found';
?>
diff --git a/program/localization/es/labels.inc b/program/localization/es/labels.inc
index 1b648d5c1..3b28244b0 100644
--- a/program/localization/es/labels.inc
+++ b/program/localization/es/labels.inc
@@ -1,214 +1,215 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/es/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: David Grajal Blanco <dgrabla@gmail.com> |
| http://david.grajal.net |
+-----------------------------------------------------------------------+
| Changelog: |
| - 6/2/2006 Translations of new features and improvements) |
| - 17/9/2005 First release |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['username'] = 'Nombre de usuario';
$labels['password'] = 'Contraseña';
$labels['server'] = 'Servidor';
$labels['login'] = 'Entrar';
// taskbar
$labels['logout'] = 'Cerrar sesión';
$labels['mail'] = 'E-Mail';
$labels['settings'] = 'Configuración';
$labels['addressbook'] = 'Contactos';
// mailbox names
$labels['inbox'] = 'Entrada';
$labels['drafts'] = 'Bosquejos';
$labels['sent'] = 'Enviados';
$labels['trash'] = 'Papelera';
$labels['drafts'] = 'Borradores';
$labels['junk'] = 'Basura';
// message listing
$labels['subject'] = 'Asunto';
$labels['from'] = 'Remitente';
$labels['to'] = 'Destinatario';
$labels['cc'] = 'CC';
$labels['bcc'] = 'BCC';
$labels['replyto'] = 'Responder';
$labels['date'] = 'Fecha';
$labels['size'] = 'Tamaño';
$labels['priority'] = 'Prioridad';
$labels['organization'] = 'Organización';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Carpetas';
$labels['messagesfromto'] = 'Mensajes desde $from a $to de $count';
$labels['messagenrof'] = 'Mensaje $nr de $count';
$labels['moveto'] = 'mover a...';
$labels['download'] = 'descargar';
$labels['filename'] = 'Nombre del fichero';
$labels['filesize'] = 'Tamaño del fichero';
$labels['preferhtml'] = 'Prefiero HTML';
$labels['htmlmessage'] = 'Mensaje HTML';
$labels['addtoaddressbook'] = 'Añadir a contactos';
// weekdays short
$labels['sun'] = 'D';
$labels['mon'] = 'L';
$labels['tue'] = 'M';
$labels['wed'] = 'X';
$labels['thu'] = 'J';
$labels['fri'] = 'V';
$labels['sat'] = 'S';
// weekdays long
$labels['sunday'] = 'Domingo';
$labels['monday'] = 'Lunes';
$labels['tuesday'] = 'Martes';
$labels['wednesday'] = 'Miercoles';
$labels['thursday'] = 'Jueves';
$labels['friday'] = 'Viernes';
$labels['saturday'] = 'Sábado';
$labels['today'] = 'Hoy';
// toolbar buttons
+$labels['checkmail'] = 'Comprobación para saber si hay nuevos mensajes';
$labels['writenewmessage'] = 'Crear nuevo mensaje';
$labels['replytomessage'] = 'Responder al mensaje';
$labels['forwardmessage'] = 'Reenviar mensaje';
$labels['deletemessage'] = 'Move message to trash';
$labels['printmessage'] = 'Imprimir este mensaje';
$labels['previousmessages'] = 'Mostrar mensajes anteriores';
$labels['nextmessages'] = 'Mostrar mensajes siguientes';
$labels['backtolist'] = 'Volver a la lista de mensajes';
$labels['viewsource'] = 'Mostrar código';
$labels['select'] = 'Seleccionar';
$labels['all'] = 'Todos';
$labels['none'] = 'Ninguno';
$labels['unread'] = 'No leidos';
$labels['compact'] = 'Compactar';
$labels['empty'] = 'Vaciar';
$labels['purge'] = 'Eliminar';
$labels['quota'] = 'Uso de disco';
// message compose
$labels['compose'] = 'Escribir un mensaje';
$labels['savemessage'] = 'Excepto este bosquejo';
$labels['sendmessage'] = 'Enviar ahora el mensaje';
$labels['addattachment'] = 'Añadir un fichero';
$labels['charset'] = 'Codigo';
$labels['attachments'] = 'Adjuntos';
$labels['upload'] = 'Subir';
$labels['close'] = 'Cerrar';
$labels['low'] = 'Bajo';
$labels['lowest'] = 'Bajísimo';
$labels['normal'] = 'Normal';
$labels['high'] = 'Alto';
$labels['highest'] = 'Altísimo';
$labels['showimages'] = 'Mostrar imágenes';
$labels['nosubject'] = '(sin asunto)';
$labels['showimages'] = 'Mostrar imágenes';
// address boook
$labels['name'] = 'Nombre completo';
$labels['firstname'] = 'Nombre';
$labels['surname'] = 'Apellido';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Añadir nuevo contacto';
$labels['editcontact'] = 'Editar contacto';
$labels['edit'] = 'Editar';
$labels['cancel'] = 'Cancelar';
$labels['save'] = 'Salvar';
$labels['delete'] = 'Eliminar';
$labels['newcontact'] = 'Crear nuevo contacto';
$labels['deletecontact'] = 'Eliminar contactos seleccionados';
$labels['composeto'] = 'Redactar correo a';
$labels['contactsfromto'] = 'Contactos $from a $to de $count';
$labels['print'] = 'Imprimir';
$labels['export'] = 'Exportar';
// LDAP search
$labels['ldapsearch'] = 'Búsqueda en el directorio LDAP';
$labels['ldappublicsearchname'] = 'Nombre';
$labels['ldappublicsearchtype'] = '¿Búsqueda exacta?';
$labels['ldappublicserverselect'] = 'Elegir servidores';
$labels['ldappublicsearchfield'] = 'Buscando';
$labels['ldappublicsearchform'] = 'Buscar un contacto';
$labels['ldappublicsearch'] = 'Buscar';
// settings
$labels['settingsfor'] = 'Configuración para';
$labels['preferences'] = 'Preferencias';
$labels['userpreferences'] = 'Preferencias de usuario';
$labels['editpreferences'] = 'Editar preferencias de usuario';
$labels['identities'] = 'Identidades';
$labels['manageidentities'] = 'Gestionar identidades para esta cuenta';
$labels['newidentity'] = 'Nueva identidad';
$labels['newitem'] = 'Nuevo';
$labels['edititem'] = 'Editar';
$labels['setdefault'] = 'Seleccionar opción por defecto';
$labels['language'] = 'Idioma';
$labels['timezone'] = 'Zona horaria';
$labels['pagesize'] = 'Filas por página';
$labels['signature'] = 'Firma';
$labels['folder'] = 'Carpeta';
$labels['folders'] = 'Carpetas';
$labels['foldername'] = 'Nombre de carpeta';
$labels['subscribed'] = 'Suscribirse';
$labels['create'] = 'Crear';
$labels['createfolder'] = 'Crear nueva carpeta';
$labels['deletefolder'] = 'Eliminar carpeta';
$labels['managefolders'] = 'Gestionar carpetas';
$labels['sortby'] = 'Ordenar por';
$labels['sortasc'] = 'Orden ascendente';
$labels['sortdesc'] = 'Orden descendente';
$labels['prettydate'] = 'Formato de fecha';
$labels['replytoallmessage'] = 'Responder al emisor y a todos los destinatarios';
?>
diff --git a/program/localization/es/messages.inc b/program/localization/es/messages.inc
index 551ee75dd..675bc8498 100644
--- a/program/localization/es/messages.inc
+++ b/program/localization/es/messages.inc
@@ -1,102 +1,104 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/es/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: David Grajal Blanco <dgrabla@gmail.com> |
| http://david.grajal.net |
+-----------------------------------------------------------------------+
| Changelog: |
| - 6/2/2006 Translations of new features and improvements |
| - 17/9/2005 First release |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Contraseña incorrecta';
$messages['cookiesdisabled'] = 'Su navegador no acepta cookies';
$messages['sessionerror'] = 'Su sesión no existe o ha expirado';
$messages['imaperror'] = 'Fallo de conexión con el servidor IMAP';
$messages['nomessagesfound'] = 'No se han encontrado mensajes en este buzón';
$messages['loggedout'] = 'Ha cerrado la sesión. ¡Hasta pronto!';
$messages['mailboxempty'] = 'El buzón esta vacio';
$messages['loading'] = 'Cargando...';
$messages['loadingdata'] = 'Cargando datos...';
+$messages['checkingmail'] = 'Comprobación para saber si hay nuevos mensajes...';
+
$messages['sendingmessage'] = 'Enviando mensaje...';
$messages['messagesent'] = 'Mensaje enviado correctamente';
$messages['savingmessage'] = 'Mensaje del ahorro...';
$messages['messagesaved'] = 'Mensaje ahorrado a los bosquejos';
$messages['successfullysaved'] = 'guardado correctamente';
$messages['addedsuccessfully'] = 'Contacto añadido correctamente a la libreta de direcciones';
$messages['contactexists'] = 'Ya existe un contacto con esta dirección de correo';
$messages['blockedimages'] = 'Para proteger su privacidad, las imágenes externas han sido bloqueadas en este mensaje';
$messages['encryptedmessage'] = 'Este es un mensaje cifrado y no puede ser mostrado. ¡Lo siento!';
$messages['nocontactsfound'] = 'No hay contactos';
$messages['sendingfailed'] = 'Error al enviar mensaje';
$messages['errorsaving'] = 'Ocurrió un error mientras se guardaba';
$messages['errormoving'] = 'No se ha podido mover el mensaje';
$messages['errordeleting'] = 'No se ha podido eliminar el mensaje';
$messages['deletecontactconfirm'] = '¿Realmente quiere eliminar los contactos seleccionados?';
$messages['deletefolderconfirm'] = '¿Esta seguro de que quiere eliminar esta carpeta?';
$messages['purgefolderconfirm'] = '¿Esta seguro de que quiere eliminar todos los mensajes de esta carpeta?';
$messages['formincomplete'] = 'No han sido rellenados todos los campos del formulario';
$messages['noemailwarning'] = 'Por favor, introduzca un email válido';
$messages['nonamewarning'] = 'Por favor, introduzca su nombre';
$messages['nopagesizewarning'] = 'Por favor, introduzca un tamaño de página';
$messages['norecipientwarning'] = 'Por favor, introduzca al menos un destinatario';
$messages['nosubjectwarning'] = 'El campo "asunto" esta vacio. ¿Desea introducir el campo "asunto" al mensaje?';
$messages['nobodywarning'] = '¿Quiere enviar este mensaje sin texto?';
$messages['notsentwarning'] = 'El mensaje no ha sido enviado. ¿Desea descartar su mensaje?';
$messages['noldapserver'] = 'Por favor, seleccione un servidor LDAP para buscar';
$messages['nocontactsreturned'] = 'No se han encontrado contactos';
$messages['nosearchname'] = 'Por favor, introduzca un nombre o la dirección email';
?>
diff --git a/program/localization/fr/labels.inc b/program/localization/fr/labels.inc
index 27a4f50dc..2fb2d6e83 100644
--- a/program/localization/fr/labels.inc
+++ b/program/localization/fr/labels.inc
@@ -1,205 +1,206 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/fr/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: aldweb <info@aldweb.com>, Pierre HAEGELI <pierre@haegeli.net> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['welcome'] = 'Bienvenue à $product';
$labels['username'] = 'ID utilisateur';
$labels['password'] = 'Mot de passe';
$labels['server'] = 'Serveur';
$labels['login'] = 'Connexion';
// taskbar
$labels['logout'] = 'Quitter';
$labels['mail'] = 'e-Mail';
$labels['settings'] = 'Préférences';
$labels['addressbook'] = 'Carnet d\'adresses';
// mailbox names
$labels['inbox'] = 'Boîte de réception';
$labels['drafts'] = 'Ébauches';
$labels['sent'] = 'Messages envoyés';
$labels['trash'] = 'Corbeille';
$labels['drafts'] = 'Brouillons';
$labels['junk'] = 'A trier';
// message listing
$labels['subject'] = 'Objet';
$labels['from'] = 'De';
$labels['to'] = 'A';
$labels['cc'] = 'Cc';
$labels['bcc'] = 'Cci';
$labels['replyto'] = 'Répondre à';
$labels['date'] = 'Date';
$labels['size'] = 'Taille';
$labels['priority'] = 'Priorité';
$labels['organization'] = 'Organisation';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Dossiers';
$labels['messagesfromto'] = 'Messages $from à $to sur $count';
$labels['messagenrof'] = 'Message $nr sur $count';
$labels['moveto'] = 'Déplacer vers...';
$labels['download'] = 'Télécharger';
$labels['filename'] = 'Nom du fichier';
$labels['filesize'] = 'Taille du fichier';
$labels['preferhtml'] = 'Préférer HTML';
$labels['htmlmessage'] = 'Message HTML';
$labels['prettydate'] = 'Belles dates';
$labels['addtoaddressbook'] = 'Ajouter au carnet d\'adresses';
// weekdays short
$labels['sun'] = 'Dim';
$labels['mon'] = 'Lun';
$labels['tue'] = 'Mar';
$labels['wed'] = 'Mer';
$labels['thu'] = 'Jeu';
$labels['fri'] = 'Ven';
$labels['sat'] = 'Sam';
// weekdays long
$labels['sunday'] = 'Dimanche';
$labels['monday'] = 'Lundi';
$labels['tuesday'] = 'Mardi';
$labels['wednesday'] = 'Mercredi';
$labels['thursday'] = 'Jeudi';
$labels['friday'] = 'Vendredi';
$labels['saturday'] = 'Samedi';
$labels['today'] = 'Aujourd\'hui';
// toolbar buttons
+$labels['checkmail'] = 'Vérification les nouveaux messages';
$labels['writenewmessage'] = 'Créer un nouveau message';
$labels['replytomessage'] = 'Répondre au message';
$labels['replytoallmessage'] = 'Répondre à tous';
$labels['forwardmessage'] = 'Transmettre le message';
$labels['deletemessage'] = 'Déplacer le message dans la corbeille';
$labels['printmessage'] = 'Imprimer ce message';
$labels['previousmessages'] = 'Voir les messages précédents';
$labels['nextmessages'] = 'Voir les messages suivants';
$labels['backtolist'] = 'Retourner à la liste des messages';
$labels['viewsource'] = 'Voir le code source';
$labels['select'] = 'Sélectionner';
$labels['all'] = 'Tous';
$labels['none'] = 'Aucun';
$labels['unread'] = 'Non lus';
$labels['compact'] = 'Compresser';
$labels['empty'] = 'Vider';
$labels['purge'] = 'Purger';
$labels['quota'] = 'Utilisation Disque';
// message compose
$labels['compose'] = 'Composer un nouveau message';
$labels['savemessage'] = 'Économiser cette ébauche';
$labels['sendmessage'] = 'Envoyer le message maintenant';
$labels['addattachment'] = 'Joindre un fichier';
$labels['charset'] = 'Encodage';
$labels['attachments'] = 'Fichiers joints';
$labels['upload'] = 'Joindre';
$labels['close'] = 'Fermer';
$labels['low'] = 'Basse';
$labels['lowest'] = 'La plus basse';
$labels['normal'] = 'Normale';
$labels['high'] = 'Elevée';
$labels['highest'] = 'La plus élevée';
$labels['nosubject'] = '(pas de sujet)';
$labels['showimages'] = 'Montrer les images';
// address boook
$labels['name'] = 'Nom à afficher';
$labels['firstname'] = 'Prénom';
$labels['surname'] = 'Nom';
$labels['email'] = 'e-Mail';
$labels['addcontact'] = 'Ajouter un nouveau contact';
$labels['editcontact'] = 'Editer le contact';
$labels['edit'] = 'Editer';
$labels['cancel'] = 'Annuler';
$labels['save'] = 'Sauvegarder';
$labels['delete'] = 'Supprimer';
$labels['newcontact'] = 'Créer un nouveau contact';
$labels['addcontact'] = 'Ajouter le contact sélectionné à votre Carnet d\'adresses';
$labels['deletecontact'] = 'Supprimer les contacts sélectionnés';
$labels['composeto'] = 'Ecrire un message à';
$labels['contactsfromto'] = 'Contacts $from à $to sur $count';
$labels['print'] = 'Imprimer';
$labels['export'] = 'Exporter';
// LDAP search
$labels['ldapsearch'] = 'Recherche dans répertoires LDAP';
$labels['ldappublicsearchname'] = 'Nom du contact';
$labels['ldappublicsearchtype'] = 'Correspondance exacte ?';
$labels['ldappublicserverselect'] = 'Sélectionnez les serveurs';
$labels['ldappublicsearchfield'] = 'Recherche sur';
$labels['ldappublicsearchform'] = 'Chercher un contact';
$labels['ldappublicsearch'] = 'Recherche';
// settings
$labels['settingsfor'] = 'Paramètres pour';
$labels['preferences'] = 'Préférences';
$labels['userpreferences'] = 'Préférences utilisateur';
$labels['editpreferences'] = 'Editer les préférences utilisateur';
$labels['identities'] = 'Identités';
$labels['manageidentities'] = 'Gérer les identités pour ce compte';
$labels['newidentity'] = 'Nouvelle identité';
$labels['newitem'] = 'Nouvel élément';
$labels['edititem'] = 'Editer l\'élément';
$labels['setdefault'] = 'Paramètres par défaut';
$labels['language'] = 'Langue';
$labels['timezone'] = 'Fuseau horaire';
$labels['pagesize'] = 'Nombre de lignes par page';
$labels['signature'] = 'Signature';
$labels['folder'] = 'Dossier';
$labels['folders'] = 'Dossiers';
$labels['foldername'] = 'Nom du dossier';
$labels['subscribed'] = 'Abonné';
$labels['create'] = 'Créer';
$labels['createfolder'] = 'Créer un nouveau dossier';
$labels['deletefolder'] = 'Supprimer le dossier';
$labels['managefolders'] = 'Gérer les dossiers';
$labels['sortby'] = 'Trier par';
$labels['sortasc'] = 'Tri ascendant';
$labels['sortdesc'] = 'Tri descendant';
?>
\ No newline at end of file
diff --git a/program/localization/fr/messages.inc b/program/localization/fr/messages.inc
index b8c2475ce..b0847107e 100644
--- a/program/localization/fr/messages.inc
+++ b/program/localization/fr/messages.inc
@@ -1,95 +1,97 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/fr/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: aldweb <info@aldweb.com>, Pierre HAEGELI <pierre@haegeli.net> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Erreur de connexion';
$messages['cookiesdisabled'] = 'Votre navigateur n\'accepte pas les cookies';
$messages['sessionerror'] = 'Votre session n\'est pas valide ou a expiré';
$messages['imaperror'] = 'Erreur de connexion au serveur IMAP';
$messages['nomessagesfound'] = 'Aucun message trouvé dans cette boîte aux lettres';
$messages['loggedout'] = 'Vous venez de vous déconnecter avec succès. Au revoir !';
$messages['mailboxempty'] = 'Boîte aux lettres vide';
$messages['loading'] = 'Chargement en cours...';
$messages['loadingdata'] = 'Chargement des données en cours...';
+$messages['checkingmail'] = 'Vérification les nouveaux messages...';
+
$messages['sendingmessage'] = 'Message en cours d\'envoi...';
$messages['messagesent'] = 'Message envoyé';
$messages['savingmessage'] = 'Message d\'économie...';
$messages['messagesaved'] = 'Message sauvé aux ébauches';
$messages['successfullysaved'] = 'Sauvegarde effectuée';
$messages['addedsuccessfully'] = 'Contact ajouté dans le carnet d\'adresses';
$messages['contactexists'] = 'Un contact avec cette adresse e-Mail existe déjà';
$messages['blockedimages'] = 'Afin de préserver votre vie privée, les images distantes ont été bloquées dans ce message.';
$messages['encryptedmessage'] = 'Ceci est un message crypté et il ne peut pas être affiché. Désolé !';
$messages['nocontactsfound'] = 'Aucun contact trouvé';
$messages['sendingfailed'] = 'Le message n\'a pas été envoyé';
$messages['errorsaving'] = 'Une erreur est apparue pendant la sauvegarde';
$messages['errormoving'] = 'Impossible de déplacer le message';
$messages['errordeleting'] = 'Impossible d\'effacer le message';
$messages['deletecontactconfirm'] = 'Voulez-vous vraiment effacer les contacts sélectionnés ?';
$messages['deletefolderconfirm'] = 'Voulez-vous vraiment effacer ce dossier ?';
$messages['purgefolderconfirm'] = 'Voulez-vous vraiment effacer tous les messages dans ce dossier ?';
$messages['formincomplete'] = 'Le formulaire n\'a pas été entièrement rempli';
$messages['noemailwarning'] = 'Entrez une adresse e-Mail valide SVP';
$messages['nonamewarning'] = 'Entrez un nom SVP';
$messages['nopagesizewarning'] = 'Entrez une taille de page SVP';
$messages['norecipientwarning'] = 'Entrez au moins un destinataire SVP';
$messages['nosubjectwarning'] = 'Le champ "Objet" est vide. Souhaitez-vous le compléter maintenant ?';
$messages['nobodywarning'] = 'Envoyer ce message sans texte ?';
$messages['notsentwarning'] = 'Le message n\'a pas été envoyé. Voulez-vous abandonner ce message ?';
$messages['noldapserver'] = 'Choisissez un serveur ldap pour la recherche';
$messages['nocontactsreturned'] = 'Aucun contact trouvé';
$messages['nosearchname'] = 'Entrez un nom ou une adresse e-Mail de contact';
?>
diff --git a/program/localization/it/labels.inc b/program/localization/it/labels.inc
index b2d272685..0a080eafb 100644
--- a/program/localization/it/labels.inc
+++ b/program/localization/it/labels.inc
@@ -1,205 +1,206 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/it/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Paolo Asperti <paolo@asperti.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['welcome'] = 'Benvenuto a $product';
$labels['username'] = 'Utente';
$labels['password'] = 'Password';
$labels['server'] = 'Server';
$labels['login'] = 'Entra';
// taskbar
$labels['logout'] = 'Esci';
$labels['mail'] = 'E-Mail';
$labels['settings'] = 'Impostazioni';
$labels['addressbook'] = 'Rubrica';
// mailbox names
$labels['inbox'] = 'Posta in arrivo';
$labels['drafts'] = 'Brutte copie';
$labels['sent'] = 'Inviata';
$labels['trash'] = 'Cestino';
$labels['drafts'] = 'Bozze';
$labels['junk'] = 'Spam';
// message listing
$labels['subject'] = 'Oggetto';
$labels['from'] = 'Mittente';
$labels['to'] = 'Destinatario';
$labels['cc'] = 'Cc';
$labels['bcc'] = 'Ccn';
$labels['replyto'] = 'Rispondi a';
$labels['date'] = 'Data';
$labels['size'] = 'Dimensione';
$labels['priority'] = 'Priorità';
$labels['organization'] = 'Società';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Cartelle';
$labels['messagesfromto'] = 'Messaggi da $from a $to di $count';
$labels['messagenrof'] = 'Messaggio $nr di $count';
$labels['moveto'] = 'sposta...';
$labels['download'] = 'download';
$labels['filename'] = 'Nome file';
$labels['filesize'] = 'Dimensione file';
$labels['preferhtml'] = 'Preferisci HTML';
$labels['htmlmessage'] = 'Messaggio HTML';
$labels['prettydate'] = 'Date più leggibili';
$labels['addtoaddressbook'] = 'Aggiungi alla rubrica';
// weekdays short
$labels['sun'] = 'Dom';
$labels['mon'] = 'Lun';
$labels['tue'] = 'Mar';
$labels['wed'] = 'Mer';
$labels['thu'] = 'Gio';
$labels['fri'] = 'Ven';
$labels['sat'] = 'Sab';
// weekdays long
$labels['sunday'] = 'Domenica';
$labels['monday'] = 'Lunedì';
$labels['tuesday'] = 'Martedì';
$labels['wednesday'] = 'Mercoledì';
$labels['thursday'] = 'Giovedì';
$labels['friday'] = 'Venerdì';
$labels['saturday'] = 'Sabato';
$labels['today'] = 'Oggi';
// toolbar buttons
+$labels['checkmail'] = 'Controllando per vedere se c'è nuovi messaggi';
$labels['writenewmessage'] = 'Scrivi un nuovo messaggio';
$labels['replytomessage'] = 'Rispondi al messaggio';
$labels['replytoallmessage'] = 'Rispondi a tutti';
$labels['forwardmessage'] = 'Inoltra il messaggio';
$labels['deletemessage'] = 'Sposta il messaggio nel cestino';
$labels['printmessage'] = 'Stampa il messaggio';
$labels['previousmessages'] = 'Visualizza messaggi precedenti';
$labels['nextmessages'] = 'Visualizza messaggi successivi';
$labels['backtolist'] = 'Torna alla lista messaggi';
$labels['viewsource'] = 'Visualizza sorgente messaggio';
$labels['select'] = 'Seleziona';
$labels['all'] = 'Tutti';
$labels['none'] = 'Nessuno';
$labels['unread'] = 'Non letti';
$labels['compact'] = 'Compatta';
$labels['empty'] = 'Svuota';
$labels['purge'] = 'Pulisci';
$labels['quota'] = 'Utilizzo spazio';
// message compose
$labels['compose'] = 'Componi un messaggio';
$labels['savemessage'] = 'Risparmi questa brutta copia';
$labels['sendmessage'] = 'Invia il messaggio adesso';
$labels['addattachment'] = 'Allega un file';
$labels['charset'] = 'Set di caratteri';
$labels['attachments'] = 'Allegati';
$labels['upload'] = 'Aggiungi';
$labels['close'] = 'Chiudi';
$labels['low'] = 'Bassa';
$labels['lowest'] = 'Molto bassa';
$labels['normal'] = 'Normale';
$labels['high'] = 'Alta';
$labels['highest'] = 'Molto alta';
$labels['nosubject'] = '(nessun oggetto)';
$labels['showimages'] = 'Visualizza immagini';
// address boook
$labels['name'] = 'Nome visualizzato';
$labels['firstname'] = 'Nome';
$labels['surname'] = 'Cognome';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Aggiungi un nuovo contatto';
$labels['editcontact'] = 'Modifica contatto';
$labels['edit'] = 'Modifica';
$labels['cancel'] = 'Annulla';
$labels['save'] = 'Salva';
$labels['delete'] = 'Elimina';
$labels['newcontact'] = 'Crea un nuovo contatto';
$labels['addcontact'] = 'Aggiungi il contatto selezionato alla rubrica';
$labels['deletecontact'] = 'Elimina i contatti selezionati';
$labels['composeto'] = 'Invia email a';
$labels['contactsfromto'] = 'Contatti da $from a $to di $count';
$labels['print'] = 'Stampa';
$labels['export'] = 'Esporta';
// LDAP search
$labels['ldapsearch'] = 'Cerca su directory LDAP';
$labels['ldappublicsearchname'] = 'Nome contatto';
$labels['ldappublicsearchtype'] = 'Nome esatto';
$labels['ldappublicserverselect'] = 'Scegli server';
$labels['ldappublicsearchfield'] = 'Cerca per';
$labels['ldappublicsearchform'] = 'Cerca un contatto';
$labels['ldappublicsearch'] = 'Cerca';
// settings
$labels['settingsfor'] = 'Impostazioni per ';
$labels['preferences'] = 'Preferenze';
$labels['userpreferences'] = 'Preferenze utente';
$labels['editpreferences'] = 'Modifica le preferenze per l\'utente';
$labels['identities'] = 'Identità';
$labels['manageidentities'] = 'Gestisci le identità per questo account';
$labels['newidentity'] = 'Nuova identità';
$labels['newitem'] = 'Nuovo elemento';
$labels['edititem'] = 'Modifica elemento';
$labels['setdefault'] = 'Imposta predefinita';
$labels['language'] = 'Lingua';
$labels['timezone'] = 'Fuso orario';
$labels['pagesize'] = 'Righe per pagina';
$labels['signature'] = 'Firma';
$labels['folder'] = 'Cartella';
$labels['folders'] = 'Cartelle';
$labels['foldername'] = 'Nome cartella';
$labels['subscribed'] = 'Sottoscritta';
$labels['create'] = 'Crea';
$labels['createfolder'] = 'Crea una nuova cartella';
$labels['deletefolder'] = 'Cancella la cartella';
$labels['managefolders'] = 'Gestione cartelle';
$labels['sortby'] = 'Ordina per';
$labels['sortasc'] = 'Ordinamento ascendente';
$labels['sortdesc'] = 'Ordinamento discendente';
?>
\ No newline at end of file
diff --git a/program/localization/it/messages.inc b/program/localization/it/messages.inc
index 7afec1ca9..ae3c81819 100644
--- a/program/localization/it/messages.inc
+++ b/program/localization/it/messages.inc
@@ -1,96 +1,98 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/it/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Paolo Asperti <paolo@asperti.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Impossibile accedere. Utente o password non corretti';
$messages['cookiesdisabled'] = 'Il tuo browser non accetta i cookies';
$messages['sessionerror'] = 'Sessione non valida o scaduta';
$messages['imaperror'] = 'Impossibile connettersi al server IMAP';
$messages['nomessagesfound'] = 'Nessun messaggio trovato in questa cartella';
$messages['loggedout'] = 'Sessione chiusa correttamente. Arrivederci!';
$messages['mailboxempty'] = 'Cartella vuota';
$messages['loading'] = 'Caricamento...';
$messages['loadingdata'] = 'Caricamento dati...';
+$messages['checkingmail'] = 'Controllando per vedere se c'è nuovi messaggi...';
+
$messages['sendingmessage'] = 'Invio messaggio in corso...';
$messages['messagesent'] = 'Messaggio inviato correttamente';
$messages['savingmessage'] = 'Messaggio di Saving...';
$messages['messagesaved'] = 'Messaggio conservato alle brutte copie';
$messages['successfullysaved'] = 'Salvato correttamente';
$messages['addedsuccessfully'] = 'Contatto aggiunto alla rubrica';
$messages['contactexists'] = 'Esiste già un contatto con questo indirizzo e-mail';
$messages['blockedimages'] = 'Per proteggere la tua privacy, le immagini remote di questo messaggio sono state bloccate.';
$messages['encryptedmessage'] = 'Questo messaggio é cifrato e non può essere visualizzato';
$messages['nocontactsfound'] = 'Nessun contatto inviato';
$messages['sendingfailed'] = 'Impossibile inviare il messaggio';
$messages['errorsaving'] = 'Impossibile salvare';
$messages['errormoving'] = 'Impossibile spostare il messaggio';
$messages['errordeleting'] = 'Impossibile cancellare il messaggio';
$messages['deletecontactconfirm'] = 'Vuoi veramente cancellare i contatti selezionati?';
$messages['deletefolderconfirm'] = 'Vuoi veramente cancellare questa cartella?';
$messages['purgefolderconfirm'] = 'Vuoi veramente cancellare tutti i messaggi in questa cartella?';
$messages['formincomplete'] = 'Per favore, compila tutti i campi';
$messages['noemailwarning'] = 'Per favore, immetti un indirizzo e-mail valido';
$messages['nonamewarning'] = 'Per favore, immetti un nome';
$messages['nopagesizewarning'] = 'Per favore, immetti il numero di righe per pagina';
$messages['norecipientwarning'] = 'Per favore, immetti almeno un contatto';
$messages['nosubjectwarning'] = 'L\'oggetto é vuoto. Vuoi inserirne uno adesso?';
$messages['nobodywarning'] = 'Inviare il messaggio senza testo?';
$messages['notsentwarning'] = 'Il messaggio non é stato inviato. Vuoi veramente annullare questo messaggio?';
$messages['noldapserver'] = 'Per favore, scegli un server LDAP in cui ricercare';
$messages['nocontactsreturned'] = 'Nessun contatto trovato';
$messages['nosearchname'] = 'Per favore, immetti un nome o un indirizzo e-mail';
?>
\ No newline at end of file
diff --git a/program/localization/ja/labels.inc b/program/localization/ja/labels.inc
index 11a50aeed..3732185a1 100644
--- a/program/localization/ja/labels.inc
+++ b/program/localization/ja/labels.inc
@@ -1,204 +1,205 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/ja/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Tadashi Jokagi <elf2000@users.sourceforge.net> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['welcome'] = 'Welcome to Roundcube|Mail';
$labels['username'] = 'ユーザー名';
$labels['password'] = 'パスワード';
$labels['server'] = 'サーバー';
$labels['login'] = 'ログイン';
// taskbar
$labels['logout'] = 'ログアウト';
$labels['mail'] = '電子メール';
$labels['settings'] = '個人設定';
$labels['addressbook'] = 'アドレス帳';
// mailbox names
$labels['inbox'] = '受信箱';
$labels['drafts'] = '草案';
$labels['sent'] = '送信箱';
$labels['trash'] = 'ごみ箱';
$labels['drafts'] = '草稿';
$labels['junk'] = 'ジャンク';
// message listing
$labels['subject'] = '件名';
$labels['from'] = '送信者';
$labels['to'] = '受信者';
$labels['cc'] = 'コピー';
$labels['bcc'] = 'Bcc';
$labels['replyto'] = '返信先';
$labels['date'] = '日付';
$labels['size'] = '容量';
$labels['priority'] = '優先度';
$labels['organization'] = '所属';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Folders';
$labels['messagesfromto'] = '表示中のメッセージ: $from から $to(全メッセージ: $count)';
$labels['messagenrof'] = '全メッセージ: $count 現在のメッセージ:$nr';
$labels['moveto'] = '選択したフォルダーに移動する...';
$labels['download'] = 'ダウンロード';
$labels['filename'] = 'ファイル名';
$labels['filesize'] = 'ファイルサイズ';
$labels['preferhtml'] = 'Prefer HTML';
$labels['htmlmessage'] = 'HTML メッセージ';
$labels['prettydate'] = '簡潔な日付';
$labels['addtoaddressbook'] = 'アドレス帳に追加する';
// weekdays short
$labels['sun'] = '日';
$labels['mon'] = '月';
$labels['tue'] = '火';
$labels['wed'] = '水';
$labels['thu'] = '木';
$labels['fri'] = '金';
$labels['sat'] = '土';
// weekdays long
$labels['sunday'] = '日曜日';
$labels['monday'] = '月曜日';
$labels['tuesday'] = '火曜日';
$labels['wednesday'] = '水曜日';
$labels['thursday'] = '木曜日';
$labels['friday'] = '金曜日';
$labels['saturday'] = '土曜日';
$labels['today'] = '今日';
// toolbar buttons
+$labels['checkmail'] = '新しいメッセージがあるように確認';
$labels['writenewmessage'] = '新規メッセージを作成する';
$labels['replytomessage'] = 'メッセージを返信する';
$labels['replytoallmessage'] = '送信者とすべての受信者に返信する';
$labels['forwardmessage'] = 'メッセージを転送する';
$labels['deletemessage'] = 'ごみ箱にメッセージを移動する';
$labels['printmessage'] = 'このメッセージを印刷する';
$labels['previousmessages'] = '前のメッセージセットを表示する';
$labels['nextmessages'] = '次のメッセージセットを表示する';
$labels['backtolist'] = 'メッセージ一覧に戻る';
$labels['viewsource'] = 'ソースを表示する';
$labels['select'] = '選択';
$labels['all'] = 'すべて';
$labels['none'] = 'なし';
$labels['unread'] = '未読';
$labels['compact'] = 'コンパクト';
$labels['empty'] = '空';
$labels['purge'] = '破棄';
$labels['quota'] = 'ディスク使用量';
// message compose
$labels['compose'] = 'メッセージを作成する';
$labels['savemessage'] = 'この草案を救いなさい';
$labels['sendmessage'] = 'メッセージを今すぐ送信する';
$labels['addattachment'] = 'ファイルを添付する';
$labels['charset'] = '文字エンコード';
$labels['attachments'] = '添付ファイル';
$labels['upload'] = 'アップロード';
$labels['close'] = '閉じる';
$labels['low'] = '低い';
$labels['lowest'] = '最低';
$labels['normal'] = '通常';
$labels['high'] = '高い';
$labels['highest'] = '最高';
$labels['nosubject'] = '(件名なし)';
$labels['showimages'] = '画像を表示する';
// address boook
$labels['name'] = '表示名';
$labels['firstname'] = '名前';
$labels['surname'] = '苗字';
$labels['email'] = '電子メールアドレス';
$labels['addcontact'] = '新規連絡先を追加する';
$labels['editcontact'] = '連絡先を編集する';
$labels['edit'] = '編集する';
$labels['cancel'] = '取り消し';
$labels['save'] = '保存する';
$labels['delete'] = '削除する';
$labels['newcontact'] = '新規連絡カードを作成する';
$labels['addcontact'] = '選択した連絡先をアドレス帳に追加する';
$labels['deletecontact'] = '選択した連絡先を削除する';
$labels['composeto'] = '次にメールを作成する:';
$labels['contactsfromto'] = '連絡先 $from から $to (合計: $count)';
$labels['print'] = '印刷する';
$labels['export'] = 'エクスポートする';
// LDAP search
$labels['ldapsearch'] = 'LDAP ディレクトリ検索';
$labels['ldappublicsearchname'] = '連絡先名';
$labels['ldappublicsearchtype'] = '正確に一致?';
$labels['ldappublicserverselect'] = 'サーバー選択';
$labels['ldappublicsearchfield'] = 'Search on';
$labels['ldappublicsearchform'] = 'Look for a contact';
$labels['ldappublicsearch'] = '検索する';
// settings
$labels['settingsfor'] = '次の設定:';
$labels['preferences'] = 'プリファレンス';
$labels['userpreferences'] = 'ユーザープリファレンス';
$labels['editpreferences'] = 'ユーザープリファレンスを編集する';
$labels['identities'] = '個人情報';
$labels['manageidentities'] = 'このアカウントの個人情報管理';
$labels['newidentity'] = '新規個人情報';
$labels['newitem'] = '新規項目';
$labels['edititem'] = '項目を編集する';
$labels['setdefault'] = 'デフォルトの設定';
$labels['language'] = '言語';
$labels['timezone'] = 'タイムゾーン';
$labels['pagesize'] = 'ページ辺りの行数';
$labels['signature'] = '署名';
$labels['folder'] = 'フォルダー';
$labels['folders'] = 'フォルダー一覧';
$labels['foldername'] = 'フォルダー名';
$labels['subscribed'] = '購読済';
$labels['create'] = '作成';
$labels['createfolder'] = '新規フォルダーを作成する';
$labels['deletefolder'] = 'フォルダーを削除する';
$labels['managefolders'] = 'フォルダー管理';
$labels['sortby'] = 'ソート基準';
$labels['sortasc'] = '昇順ソート';
$labels['sortdesc'] = '降順ソート';
?>
\ No newline at end of file
diff --git a/program/localization/ja/messages.inc b/program/localization/ja/messages.inc
index 3dcca721a..4847bd41d 100644
--- a/program/localization/ja/messages.inc
+++ b/program/localization/ja/messages.inc
@@ -1,95 +1,97 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/ja/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Tadashi Jokagi <elf2000@users.sourceforge.net> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'ログインに失敗しました。';
$messages['cookiesdisabled'] = 'ブラウザーが Cookie を認めていません。';
$messages['sessionerror'] = 'セッションが正しくないか期限切れです。';
$messages['imaperror'] = 'IMAP サーバーへの接続に失敗しました。';
$messages['nomessagesfound'] = 'このメールボックスでメッセージは見つかりません。';
$messages['loggedout'] = 'セッションの切断に成功しました。さようなら!';
$messages['mailboxempty'] = 'メールボックスは空です。';
$messages['loading'] = '読み込み中...';
$messages['loadingdata'] = 'データを読み込み中です...';
+$messages['checkingmail'] = '新しいメッセージがあるように確認...';
+
$messages['sendingmessage'] = 'メッセージの送信中です...';
$messages['messagesent'] = 'メッセージの送信に成功しました。';
$messages['savingmessage'] = 'セービングメッセージ...';
$messages['messagesaved'] = 'メッセージは草案に救った';
$messages['successfullysaved'] = '保存に成功しました。';
$messages['addedsuccessfully'] = '連絡先をアドレス帳への追加に成功しました。';
$messages['contactexists'] = 'この電子メールアドレスはアドレス帳に既に存在します。';
$messages['blockedimages'] = 'プライバシを保護するために、このメッセージのリモート画像はブロックされました。';
$messages['encryptedmessage'] = 'これは暗号化されたメッセージで表示することができません。ごめんなさい!';
$messages['nocontactsfound'] = '連絡先が見つかりません。';
$messages['sendingfailed'] = 'メッセージの送信に失敗しました。';
$messages['errorsaving'] = '保存中にエラーが発生しました。';
$messages['errormoving'] = 'メッセージの移動ができません。';
$messages['errordeleting'] = 'メッセージの削除ができません。';
$messages['deletecontactconfirm'] = '本当に選択した連絡先を削除しますか?';
$messages['deletefolderconfirm'] = '本当にこのフォルダーを削除しますか?';
$messages['purgefolderconfirm'] = '本当にこのフォルダーのすべてのメッセージを削除しますか?';
$messages['formincomplete'] = 'フォームは完全に埋められていません。';
$messages['noemailwarning'] = '有効な電子メールアドレスを入力してください';
$messages['nonamewarning'] = '名前を入力してください';
$messages['nopagesizewarning'] = 'ページサイズを入力してください';
$messages['norecipientwarning'] = '少なくとも 1 つ受信者を入力してください';
$messages['nosubjectwarning'] = '項目「件名」が空です。今入力しますか?';
$messages['nobodywarning'] = 'テキストの無いメッセージを送信しますか?';
$messages['notsentwarning'] = 'メッセージは送信されませんでした。メッセージを破棄したいですか?';
$messages['noldapserver'] = '検索する LDAP サーバーを選択してください';
$messages['nocontactsreturned'] = '連絡先が見つかりません';
$messages['nosearchname'] = '連絡先名か電子メールアドレスを入力してください';
?>
\ No newline at end of file
diff --git a/program/localization/pt_BR/labels.inc b/program/localization/pt_BR/labels.inc
index a396b6492..1b9e641e6 100644
--- a/program/localization/pt_BR/labels.inc
+++ b/program/localization/pt_BR/labels.inc
@@ -1,203 +1,204 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/pt_BR/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Anderson S. Ferreira <anderson@cnpm.embrapa.br> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// Página de loginOnthaal aan $product
$labels['username'] = 'Usuário';
$labels['password'] = 'Senha';
$labels['server'] = 'Servidor';
$labels['login'] = 'Entrar';
// taskbar
$labels['logout'] = 'Sair';
$labels['mail'] = 'E-mail';
$labels['settings'] = 'Configurações pessoais';
$labels['addressbook'] = 'Catálogo de endereços';
// Nome das pastas de correio
$labels['inbox'] = 'Caixa de entrada';
$labels['drafts'] = 'Esboços';
$labels['sent'] = 'Enviados';
$labels['trash'] = 'Lixeira';
$labels['drafts'] = 'Rascunhos';
$labels['junk'] = 'Junk';
// message listing
$labels['subject'] = 'Assunto';
$labels['from'] = 'Remetente';
$labels['to'] = 'Para';
$labels['cc'] = 'Cópia';
$labels['bcc'] = 'Bcc';
$labels['replyto'] = 'Responder para';
$labels['date'] = 'Data';
$labels['size'] = 'Tamanho';
$labels['priority'] = 'Prioridade';
$labels['organization'] = 'Organização';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Pastas';
$labels['messagesfromto'] = 'Mensagens $from - $to de $count';
$labels['messagenrof'] = 'Mensagem $nr de $count';
$labels['moveto'] = 'mover para...';
$labels['download'] = 'download';
$labels['filename'] = 'Arquivo';
$labels['filesize'] = 'Tamanho';
$labels['preferhtml'] = 'Prefere HTML';
$labels['htmlmessage'] = 'Mensagem HTML';
$labels['prettydate'] = 'Formatar datas';
$labels['addtoaddressbook'] = 'Incluir no catálogo de endereços';
// Dias da semana abreviados
$labels['sun'] = 'Dom';
$labels['mon'] = 'Seg';
$labels['tue'] = 'Ter';
$labels['wed'] = 'Qua';
$labels['thu'] = 'Qui';
$labels['fri'] = 'Sex';
$labels['sat'] = 'Sáb';
// Dias da semana completos
$labels['sunday'] = 'Domingo';
$labels['monday'] = 'Segunda-feira';
$labels['tuesday'] = 'Terça-feira';
$labels['wednesday'] = 'Quarta-feira';
$labels['thursday'] = 'Quinta-feira';
$labels['friday'] = 'Sexta-feira';
$labels['saturday'] = 'Sábado';
$labels['today'] = 'Hoje';
// toolbar buttons
+$labels['checkmail'] = 'Verificar para ver se há mensagens novas';
$labels['writenewmessage'] = 'Criar nova mensagem';
$labels['replytomessage'] = 'Responder';
$labels['replytoallmessage'] = 'Responder para todos';
$labels['forwardmessage'] = 'Encaminhar';
$labels['deletemessage'] = 'Mover para lixeira';
$labels['printmessage'] = 'Imprimir';
$labels['previousmessages'] = 'Anterior';
$labels['nextmessages'] = 'Próximo';
$labels['backtolist'] = 'Voltar';
$labels['viewsource'] = 'Exibir código fonte';
$labels['select'] = 'Selecionar';
$labels['all'] = 'Todas';
$labels['none'] = 'Nenhuma';
$labels['unread'] = 'Não lidas';
$labels['compact'] = 'Compactar';
$labels['empty'] = 'Vazio';
$labels['purge'] = 'Apagar';
$labels['quota'] = 'Utilização';
// message compose
$labels['compose'] = 'Escrever mensagem';
$labels['savemessage'] = 'Excepto este esboço';
$labels['sendmessage'] = 'Enviar';
$labels['addattachment'] = 'Anexar';
$labels['charset'] = 'Charset';
$labels['attachments'] = 'Anexos';
$labels['upload'] = 'Upload';
$labels['close'] = 'Fechar';
$labels['low'] = 'Mais baixo';
$labels['lowest'] = 'Baixo';
$labels['normal'] = 'Normal';
$labels['high'] = 'Alta';
$labels['highest'] = 'Mais alta';
$labels['nosubject'] = '(no assunto)';
$labels['showimages'] = 'Exibir imagens';
// address boook
$labels['name'] = 'Nome completo';
$labels['firstname'] = 'Primeiro nome';
$labels['surname'] = 'Sobrenome';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Incluir novo contato';
$labels['editcontact'] = 'Editar contato';
$labels['edit'] = 'Editar';
$labels['cancel'] = 'Cancelar';
$labels['save'] = 'Salvar';
$labels['delete'] = 'Apagar';
$labels['newcontact'] = 'Criar novo contato';
$labels['addcontact'] = 'Incluir contato selecionado ao catálogo de endereços';
$labels['deletecontact'] = 'Apagar contatos selecionados';
$labels['composeto'] = 'Escrever mensagem para';
$labels['contactsfromto'] = 'Contatos $from - $to of $count';
$labels['print'] = 'Imprimir';
$labels['export'] = 'Exportar';
// LDAP search
$labels['ldapsearch'] = 'Pesquisa no diretório LDAP';
$labels['ldappublicsearchname'] = 'Nome do contado';
$labels['ldappublicsearchtype'] = 'Pesquisa exata?';
$labels['ldappublicserverselect'] = 'Selecionar servidores';
$labels['ldappublicsearchfield'] = 'Pesquisar em';
$labels['ldappublicsearchform'] = 'Procurar por um contato';
$labels['ldappublicsearch'] = 'Pesquisar';
// settings
$labels['settingsfor'] = 'Configurações para';
$labels['preferences'] = 'Preferências';
$labels['userpreferences'] = 'Preferências do usuário';
$labels['editpreferences'] = 'Editar preferências do usuário';
$labels['identities'] = 'Identidades';
$labels['manageidentities'] = 'Gerenciar identidades para essa conta';
$labels['newidentity'] = 'Nova identidade';
$labels['newitem'] = 'Novo item';
$labels['edititem'] = 'Editar item';
$labels['setdefault'] = 'Padrão';
$labels['language'] = 'Idioma';
$labels['timezone'] = 'Time zone';
$labels['pagesize'] = 'Linhas por página';
$labels['signature'] = 'Assinatura';
$labels['folder'] = 'Pasta';
$labels['folders'] = 'Pastas';
$labels['foldername'] = 'Nome da pasta';
$labels['subscribed'] = 'Assinado';
$labels['create'] = 'Criar';
$labels['createfolder'] = 'Criar nova pasta';
$labels['deletefolder'] = 'Apagar pasta';
$labels['managefolders'] = 'Gerenciar pastas';
$labels['sortby'] = 'Ordenado por';
$labels['sortasc'] = 'Ascendente';
$labels['sortdesc'] = 'Descendente';
?>
\ No newline at end of file
diff --git a/program/localization/pt_BR/messages.inc b/program/localization/pt_BR/messages.inc
index ae3b70270..fb33bcf47 100644
--- a/program/localization/pt_BR/messages.inc
+++ b/program/localization/pt_BR/messages.inc
@@ -1,91 +1,93 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/pt_BR/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Anderson S. Ferreira <anderson@cnpm.embrapa.br> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Falha no login';
$messages['cookiesdisabled'] = 'Seu navegador não suporta cookies';
$messages['sessionerror'] = 'A sessão do seu navegador é inválida ou expirou';
$messages['imaperror'] = 'A conexão com o servidor IMAP falhou';
$messages['nomessagesfound'] = 'Nenhuma mensagem foi encontrada na caixa postal';
$messages['loggedout'] = 'Sua sessão foi finalizada com sucesso. Até breve!';
$messages['mailboxempty'] = 'A caixa postal está vazia';
$messages['loadingdata'] = 'Carregando informações...';
+$messages['checkingmail'] = 'Verificar para ver se há mensagens novas...';
+
$messages['messagesent'] = 'Mensagem enviada';
$messages['savingmessage'] = 'Mensagem do Saving...';
$messages['messagesaved'] = 'Mensagem conservada aos esboços';
$messages['successfullysaved'] = 'Salvo com sucesso';
$messages['addedsuccessfully'] = 'Contato incluído com sucesso';
$messages['contactexists'] = 'Um contato com esse e-mail já existe';
$messages['blockedimages'] = 'Para proteger sua privacidade, as imagens desta mensagem foram bloqueadas';
$messages['encryptedmessage'] = 'Esta mensagem está criptografada e não pode ser exibida. Desculpe.';
$messages['nocontactsfound'] = 'Nenhum contato encontrado';
$messages['sendingfailed'] = 'Falha no envio da mensagem';
$messages['errorsaving'] = 'Um erro ocorreu durante o salvamento';
$messages['errormoving'] = 'Não foi possível mover a mensagem';
$messages['errordeleting'] = 'Não foi possível apagar a mensagem';
$messages['deletecontactconfirm'] = 'Deseja realmente excluir os contatos selecionados?';
$messages['deletefolderconfirm'] = 'Deseja realmente excluir esta pasta?';
$messages['purgefolderconfirm'] = 'Deseja realmente excluir todas mensagens desta pasta';
$messages['formincomplete'] = 'Os campos não foram completamente preenchidos';
$messages['noemailwarning'] = 'Por favor, informe um endereço de e-mail válido';
$messages['nonamewarning'] = 'Por favor, informe o nome';
$messages['nopagesizewarning'] = 'Por favor, informe o tamanho da página';
$messages['norecipientwarning'] = 'Por favor, informe pelo menos um destinatário';
$messages['nosubjectwarning'] = 'O campo assunto não foi informado. Deseja incluí-lo agora?';
$messages['nobodywarning'] = 'Enviar a mensagem se texto?';
$messages['notsentwarning'] = 'A mensegem não foi enviada, deseja excluí-la?';
$messages['noldapserver'] = 'Por favor, selecione um servidor LDAP para a pesquisa';
$messages['nocontactsreturned'] = 'Nenhum contato foi encontrado';
$messages['nosearchname'] = 'Por favor, informe o nome do contado ou seu endereço de e-mail';
?>
\ No newline at end of file
diff --git a/program/localization/pt_PT/labels.inc b/program/localization/pt_PT/labels.inc
index e69221001..2a26c544f 100644
--- a/program/localization/pt_PT/labels.inc
+++ b/program/localization/pt_PT/labels.inc
@@ -1,202 +1,203 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/pt_PT/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
+-----------------------------------------------------------------------+
| Author: Pedro M. Gouveia <pbodymind@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// Página de login
$labels['username'] = 'Utilizador';
$labels['password'] = 'Senha';
$labels['server'] = 'Servidor';
$labels['login'] = 'Entrar';
// taskbar
$labels['logout'] = 'Sair';
$labels['mail'] = 'E-mail';
$labels['settings'] = 'Configurações pessoais';
$labels['addressbook'] = 'Catálogo de endereços';
// Nome das pastas de correio
$labels['inbox'] = 'Caixa de entrada';
$labels['drafts'] = 'Esboços';
$labels['sent'] = 'Enviados';
$labels['trash'] = 'Lixeira';
$labels['drafts'] = 'Rascunhos';
$labels['junk'] = 'Spam';
// message listing
$labels['subject'] = 'Assunto';
$labels['from'] = 'Remetente';
$labels['to'] = 'Para';
$labels['cc'] = 'Cc';
$labels['bcc'] = 'Bcc';
$labels['replyto'] = 'Responder para';
$labels['date'] = 'Data';
$labels['size'] = 'Tamanho';
$labels['priority'] = 'Prioridade';
$labels['organization'] = 'Organização';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Pastas';
$labels['messagesfromto'] = 'Mensagens de $from para $to $count';
$labels['messagenrof'] = 'Mensagem $nr de $count';
$labels['moveto'] = 'mover para...';
$labels['download'] = 'download';
$labels['filename'] = 'Arquivo';
$labels['filesize'] = 'Tamanho';
$labels['preferhtml'] = 'Prefere HTML';
$labels['htmlmessage'] = 'Mensagem HTML';
$labels['prettydate'] = 'Formatar datas';
$labels['addtoaddressbook'] = 'Incluir no catálogo de endereços';
// Dias da semana abreviados
$labels['sun'] = 'Dom';
$labels['mon'] = 'Seg';
$labels['tue'] = 'Ter';
$labels['wed'] = 'Qua';
$labels['thu'] = 'Qui';
$labels['fri'] = 'Sex';
$labels['sat'] = 'Sáb';
// Dias da semana completos
$labels['sunday'] = 'Domingo';
$labels['monday'] = 'Segunda-feira';
$labels['tuesday'] = 'Terça-feira';
$labels['wednesday'] = 'Quarta-feira';
$labels['thursday'] = 'Quinta-feira';
$labels['friday'] = 'Sexta-feira';
$labels['saturday'] = 'Sábado';
$labels['today'] = 'Hoje';
// toolbar buttons
+$labels['checkmail'] = 'Verificar para ver se há mensagens novas';
$labels['writenewmessage'] = 'Criar nova mensagem';
$labels['replytomessage'] = 'Responder';
$labels['replytoallmessage'] = 'Responder para todos';
$labels['forwardmessage'] = 'Encaminhar';
$labels['deletemessage'] = 'Mover para lixeira';
$labels['printmessage'] = 'Imprimir';
$labels['previousmessages'] = 'Anterior';
$labels['nextmessages'] = 'Próximo';
$labels['backtolist'] = 'Voltar';
$labels['viewsource'] = 'Exibir código fonte';
$labels['select'] = 'Selecionar';
$labels['all'] = 'Todas';
$labels['none'] = 'Nenhuma';
$labels['unread'] = 'Não lidas';
$labels['compact'] = 'Compactar';
$labels['empty'] = 'Vazio';
$labels['purge'] = 'Apagar';
$labels['quota'] = 'Quota de espaço';
// message compose
$labels['compose'] = 'Escrever mensagem';
$labels['savemessage'] = 'Excepto este esboço';
$labels['sendmessage'] = 'Enviar';
$labels['addattachment'] = 'Anexar';
$labels['charset'] = 'Charset';
$labels['attachments'] = 'Anexos';
$labels['upload'] = 'Upload';
$labels['close'] = 'Fechar';
$labels['low'] = 'Baixo';
$labels['lowest'] = 'Muito Baixo';
$labels['normal'] = 'Normal';
$labels['high'] = 'Alta';
$labels['highest'] = 'Muito alta';
$labels['nosubject'] = '(sem assunto)';
$labels['showimages'] = 'Exibir imagens';
// address boook
$labels['name'] = 'Nome completo';
$labels['firstname'] = 'Primeiro nome';
$labels['surname'] = 'Apelido';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Incluir novo contacto';
$labels['editcontact'] = 'Editar contacto';
$labels['edit'] = 'Editar';
$labels['cancel'] = 'Cancelar';
$labels['save'] = 'Salvar';
$labels['delete'] = 'Apagar';
$labels['newcontact'] = 'Criar novo contacto';
$labels['addcontact'] = 'Adicionar contacto seleccionado ao catálogo de endereços';
$labels['deletecontact'] = 'Apagar contactos seleccionados';
$labels['composeto'] = 'Escrever mensagem para';
$labels['contactsfromto'] = 'Contactos $from - $to de $count';
$labels['print'] = 'Imprimir';
$labels['export'] = 'Exportar';
// LDAP search
$labels['ldapsearch'] = 'Pesquisa no diretório LDAP';
$labels['ldappublicsearchname'] = 'Nome do contacto';
$labels['ldappublicsearchtype'] = 'Pesquisa certa?';
$labels['ldappublicserverselect'] = 'Seleccionar servidores';
$labels['ldappublicsearchfield'] = 'Pesquisar em';
$labels['ldappublicsearchform'] = 'Procurar por contacto';
$labels['ldappublicsearch'] = 'Pesquisar';
// settings
$labels['settingsfor'] = 'Configurações para';
$labels['preferences'] = 'Preferências';
$labels['userpreferences'] = 'Preferências do tilizador';
$labels['editpreferences'] = 'Editar preferências do utilizador';
$labels['identities'] = 'Identidades';
$labels['manageidentities'] = 'Gerenciar identidades para a sua conta';
$labels['newidentity'] = 'Nova identidade';
$labels['newitem'] = 'Novo item';
$labels['edititem'] = 'Editar item';
$labels['setdefault'] = 'Padrão';
$labels['language'] = 'Idioma';
$labels['timezone'] = 'Hora Local';
$labels['pagesize'] = 'Linhas por página';
$labels['signature'] = 'Assinatura';
$labels['folder'] = 'Pasta';
$labels['folders'] = 'Pastas';
$labels['foldername'] = 'Nome da pasta';
$labels['subscribed'] = 'Assinado';
$labels['create'] = 'Criar';
$labels['createfolder'] = 'Criar nova pasta';
$labels['deletefolder'] = 'Apagar pasta';
$labels['managefolders'] = 'Gerenciar pastas';
$labels['sortby'] = 'Ordenado por';
$labels['sortasc'] = 'Ascendente';
$labels['sortdesc'] = 'Descendente';
?>
diff --git a/program/localization/pt_PT/messages.inc b/program/localization/pt_PT/messages.inc
index 377f9659f..b204ea448 100644
--- a/program/localization/pt_PT/messages.inc
+++ b/program/localization/pt_PT/messages.inc
@@ -1,94 +1,96 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/pt_PT/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
+-----------------------------------------------------------------------+
| Author: Pedro M. Gouveia <pbodymind@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Falha no login';
$messages['cookiesdisabled'] = 'O seu navegador não suporta cookies';
$messages['sessionerror'] = 'A sua sessão é inválida ou expirou';
$messages['imaperror'] = 'O servidor IMAP falhou';
$messages['nomessagesfound'] = 'Nenhuma mensagem foi encontrada na caixa postal';
$messages['loggedout'] = 'Sua sessão foi finalizada com sucesso. Até breve!';
$messages['mailboxempty'] = 'A caixa postal está vazia';
$messages['loading'] = 'Carregando...';
$messages['loadingdata'] = 'Carregando Informações...';
+$messages['checkingmail'] = 'Verificar para ver se há mensagens novas...';
+
$messages['sendingmessage'] = 'A enviar mensagem...';
$messages['messagesent'] = 'Mensagem enviada';
$messages['savingmessage'] = 'Mensagem do Saving...';
$messages['messagesaved'] = 'Mensagem conservada aos esboços';
$messages['successfullysaved'] = 'Ficheiro gravado';
$messages['addedsuccessfully'] = 'Contacto adicionado ao catálogo de endereços';
$messages['contactexists'] = 'Um contacto com esse e-mail já existe';
$messages['blockedimages'] = 'Para proteger sua privacidade, as imagens desta mensagem foram bloqueadas';
$messages['encryptedmessage'] = 'Esta mensagem está criptografada e não pode ser exibida. Desculpe.';
$messages['nocontactsfound'] = 'Nenhum contacto encontrado';
$messages['sendingfailed'] = 'Falha no envio da mensagem';
$messages['errorsaving'] = 'Ocorreu um erro a gravar o ficheiro';
$messages['errormoving'] = 'Não foi possível mover a mensagem';
$messages['errordeleting'] = 'Não foi possível apagar a mensagem';
$messages['deletecontactconfirm'] = 'Deseja realmente excluir os contatos seleccionados?';
$messages['deletefolderconfirm'] = 'Deseja realmente excluir esta pasta?';
$messages['purgefolderconfirm'] = 'Deseja realmente excluir todas mensagens desta pasta';
$messages['formincomplete'] = 'Alguns campos não foram preenchidos';
$messages['noemailwarning'] = 'Por favor, insira um endereço de e-mail válido';
$messages['nonamewarning'] = 'Por favor, insira o nome';
$messages['nopagesizewarning'] = 'Por favor, insira o tamanho da página';
$messages['norecipientwarning'] = 'Por favor, informe pelo menos um destinatário';
$messages['nosubjectwarning'] = 'O campo assunto não foi preenchido. Deseja preenche-lo agora?';
$messages['nobodywarning'] = 'Enviar a mensagem sem texto?';
$messages['notsentwarning'] = 'A mensagem não foi enviada, deseja excluí-la?';
$messages['noldapserver'] = 'Por favor, selecione um servidor LDAP para a pesquisa';
$messages['nocontactsreturned'] = 'Nenhum contacto foi encontrado';
$messages['nosearchname'] = 'Por favor, informe o nome do contacto ou o seu endereço de e-mail';
?>
diff --git a/program/localization/ru/labels.inc b/program/localization/ru/labels.inc
index a434b0550..699403708 100755
--- a/program/localization/ru/labels.inc
+++ b/program/localization/ru/labels.inc
@@ -1,214 +1,215 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/ru_RU/labels.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundQube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Maxim Zenin <maxx@webmechanics.ru> |
+-----------------------------------------------------------------------+
$Id$
*/
$labels = array();
// login page
$labels['welcome'] = 'Добро пожаловать в $product';
$labels['username'] = 'Имя пользователя';
$labels['password'] = 'Пароль';
$labels['server'] = 'Сервер';
$labels['login'] = 'Войти';
// taskbar
$labels['logout'] = 'Выход';
$labels['mail'] = 'Почта';
$labels['settings'] = 'Настройки';
$labels['addressbook'] = 'Контакты';
// mailbox names
$labels['inbox'] = 'Входящие';
$labels['drafts'] = 'Проекты';
$labels['sent'] = 'Отправленные';
$labels['trash'] = 'Корзина';
$labels['drafts'] = 'Черновики';
$labels['junk'] = 'СПАМ';
// message listing
$labels['subject'] = 'Тема';
$labels['from'] = 'От';
$labels['to'] = 'Кому';
$labels['cc'] = 'Копия';
$labels['bcc'] = 'Скрытая';
$labels['replyto'] = 'Обратный адрес';
$labels['date'] = 'Дата';
$labels['size'] = 'Размер';
$labels['priority'] = 'Приоритет';
$labels['organization'] = 'Организация';
// aliases
$labels['reply-to'] = $labels['replyto'];
$labels['mailboxlist'] = 'Папки';
$labels['messagesfromto'] = 'Сообщения с $from по $to из $count';
$labels['messagenrof'] = 'Сообщение $nr из $count';
$labels['moveto'] = 'Переместить в...';
$labels['download'] = 'Загрузить';
$labels['filename'] = 'Имя файла';
$labels['filesize'] = 'Размер файла';
$labels['preferhtml'] = 'Предпочитать HTML';
$labels['htmlmessage'] = 'Сообщение HTML';
$labels['prettydate'] = 'Красивые даты';
$labels['addtoaddressbook'] = 'Добавить в контакты';
// weekdays short
$labels['sun'] = 'Вс';
$labels['mon'] = 'Пн';
$labels['tue'] = 'Вт';
$labels['wed'] = 'Ср';
$labels['thu'] = 'Чт';
$labels['fri'] = 'Пт';
$labels['sat'] = 'Сб';
// weekdays long
$labels['sunday'] = 'Воскресенье';
$labels['monday'] = 'Понедельник';
$labels['tuesday'] = 'Вторник';
$labels['wednesday'] = 'Среда';
$labels['thursday'] = 'Четверг';
$labels['friday'] = 'Пятница';
$labels['saturday'] = 'Суббота';
$labels['today'] = 'Сегодня';
// toolbar buttons
+$labels['checkmail'] = 'Проверять для новых сообщений';
$labels['writenewmessage'] = 'Новое сообщение';
$labels['replytomessage'] = 'Ответить';
$labels['replytoallmessage'] = 'Ответить всем';
$labels['forwardmessage'] = 'Переслать';
$labels['deletemessage'] = 'В корзину';
$labels['printmessage'] = 'Печать';
$labels['previousmessages'] = 'Предыдущее';
$labels['nextmessages'] = 'Следующее';
$labels['backtolist'] = 'К списку сообщений';
$labels['viewsource'] = 'Исходный текст';
$labels['select'] = 'Выбрать';
$labels['all'] = 'Все';
$labels['none'] = 'Ничего';
$labels['unread'] = 'Непрочитанные';
$labels['compact'] = 'Сжать';
$labels['empty'] = 'Опустошить';
$labels['purge'] = 'Очистить';
$labels['quota'] = 'Квота';
$labels['unknown'] = 'неизвестно';
$labels['unlimited'] = 'без ограничений';
$labels['quicksearch'] = 'Быстрый поиск';
$labels['resetsearch'] = 'Сброс';
// message compose
$labels['compose'] = 'Написать сообщение';
$labels['savemessage'] = 'За исключением этого проекта';
$labels['sendmessage'] = 'Отправить сейчас';
$labels['addattachment'] = 'Добавить вложение';
$labels['charset'] = 'Кодировка';
$labels['returnreceipt'] = 'Запрос ответа';
$labels['attachments'] = 'Вложения';
$labels['upload'] = 'Загрузить';
$labels['close'] = 'Закрыть';
$labels['low'] = 'Низкий';
$labels['lowest'] = 'Самый низкий';
$labels['normal'] = 'Нормальный';
$labels['high'] = 'Высокий';
$labels['highest'] = 'Самый высокий';
$labels['nosubject'] = '(без темы)';
$labels['showimages'] = 'Показать изображения';
// address boook
$labels['name'] = 'Отображаемое имя';
$labels['firstname'] = 'Имя';
$labels['surname'] = 'Фамилия';
$labels['email'] = 'E-Mail';
$labels['addcontact'] = 'Добавить контакт';
$labels['editcontact'] = 'Редактировать контакт';
$labels['edit'] = 'Правка';
$labels['cancel'] = 'Отмена';
$labels['save'] = 'Сохранить';
$labels['delete'] = 'Удалить';
$labels['newcontact'] = 'Создать новый контакт';
$labels['addcontact'] = 'Добавить выбранные контакты в список контактов';
$labels['deletecontact'] = 'Удалить выбранные контакты';
$labels['composeto'] = 'Создать сообщение для выбранных контактов';
$labels['contactsfromto'] = 'Контакты с $from по $to из $count';
$labels['print'] = 'Печать';
$labels['export'] = 'Экспорт';
$labels['previouspage'] = 'Показать предыдущий';
$labels['nextpage'] = 'Показать следующий';
// LDAP search
$labels['ldapsearch'] = 'Поиск в каталоге LDAP';
$labels['ldappublicsearchname'] = 'Имя';
$labels['ldappublicsearchtype'] = 'Точное совпадение?';
$labels['ldappublicserverselect'] = 'Выбрать сервер';
$labels['ldappublicsearchfield'] = 'искать на';
$labels['ldappublicsearchform'] = 'Искать контакт';
$labels['ldappublicsearch'] = 'Искать';
// settings
$labels['settingsfor'] = 'Настройки для';
$labels['preferences'] = 'Настройки';
$labels['userpreferences'] = 'Настройки пользователя';
$labels['editpreferences'] = 'Редактировать настройки пользователя';
$labels['identities'] = 'Профили';
$labels['manageidentities'] = 'Управление профилями';
$labels['newidentity'] = 'Новый профиль';
$labels['newitem'] = 'Новый';
$labels['edititem'] = 'Правка';
$labels['setdefault'] = 'Использовать по умолчанию';
$labels['language'] = 'Язык';
$labels['timezone'] = 'Часовой пояс';
$labels['pagesize'] = 'Строк на странице';
$labels['signature'] = 'Подпись';
$labels['dstactive'] = 'Перевод часов';
$labels['folder'] = 'Папка';
$labels['folders'] = 'Папки';
$labels['foldername'] = 'Имя папки';
$labels['subscribed'] = 'Подписан';
$labels['create'] = 'Создать';
$labels['createfolder'] = 'Создать новую папку';
$labels['deletefolder'] = 'Удалить папку';
$labels['managefolders'] = 'Управление папками';
$labels['sortby'] = 'Сортировать по';
$labels['sortasc'] = 'Возрастанию';
$labels['sortdesc'] = 'Убыванию';
?>
\ No newline at end of file
diff --git a/program/localization/ru/messages.inc b/program/localization/ru/messages.inc
index 393d24627..0d1f69f8c 100755
--- a/program/localization/ru/messages.inc
+++ b/program/localization/ru/messages.inc
@@ -1,101 +1,103 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/ru_RU/messages.inc |
| |
| Language file of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
+-----------------------------------------------------------------------+
| Author: Maxim Zenin <maxx@webmechanics.ru> |
+-----------------------------------------------------------------------+
$Id$
*/
$messages = array();
$messages['loginfailed'] = 'Неудачная попытка входа';
$messages['cookiesdisabled'] = 'Ваш броузер не принимает cookie';
$messages['sessionerror'] = 'Ваша сессия устарела';
$messages['imaperror'] = 'Неудачное соединение с IMAP сервером';
$messages['nomessagesfound'] = 'Сообщений не найдено';
$messages['loggedout'] = 'Ваша сессия завершена. Всего доброго';
$messages['mailboxempty'] = 'Почтовый ящик пуст';
$messages['loading'] = 'Загрузка...';
$messages['loadingdata'] = 'Загрузка данных...';
+$messages['checkingmail'] = 'Проверять для новых сообщений...';
+
$messages['sendingmessage'] = 'Отправка сообщения...';
$messages['messagesent'] = 'Сообщение отправлено';
$messages['savingmessage'] = 'Сообщение сбережения...';
$messages['messagesaved'] = 'Сообщение сохраненное к проектам';
$messages['successfullysaved'] = 'Сохранено';
$messages['addedsuccessfully'] = 'Контакт добавлен в список контактов';
$messages['contactexists'] = 'Контакт с этим адресом e-mail уже существует';
$messages['blockedimages'] = 'В целях безопасности загрузка изображений заблокирована.';
$messages['encryptedmessage'] = 'Сообщение зашифровано и не может быть показано. Обратитесь к администратору сервера.';
$messages['nocontactsfound'] = 'Контакты не найдены';
$messages['sendingfailed'] = 'Не удалось отправить сообщение';
$messages['errorsaving'] = 'В процессе сохранения произошла ошибка';
$messages['errormoving'] = 'Не удалось переместить сообщение';
$messages['errordeleting'] = 'Не удалось удалить сообщение';
$messages['deletecontactconfirm'] = 'Вы действительно хотите удалить выделенные контакты?';
$messages['deletefolderconfirm'] = 'Вы действительно хотите удалить эту папку?';
$messages['purgefolderconfirm'] = 'Вы действительно хотите удалить все сообщения в этой папке?';
$messages['formincomplete'] = 'Заполнены не все поля';
$messages['noemailwarning'] = 'Пожалуйста, введите корректный адрес электронной почты';
$messages['nonamewarning'] = 'Пожалуйста, введите имя';
$messages['nopagesizewarning'] = 'Пожалуйста, введите размер страницы';
$messages['norecipientwarning'] = 'Пожалуйста, введите имя получателя';
$messages['nosubjectwarning'] = 'Поле "Тема" не заполнено. Хотите заполнить его сейчас?';
$messages['nobodywarning'] = 'Отправить сообщение без текста?';
$messages['notsentwarning'] = 'Сообщение не было отправлено. Вы хотите отказаться от отправки?';
$messages['noldapserver'] = 'Пожалуйста, выберите LDAP сервер для поиска';
$messages['nocontactsreturned'] = 'Контакты не найдены';
$messages['nosearchname'] = 'Пожалуйста, введите имя или адрес E-Mail';
$messages['searchsuccessful'] = 'Найденных сообщений - $nr';
$messages['searchnomatch'] = 'Сообщений не найдено';
$messages['searching'] = 'Поиск...';
?>
\ No newline at end of file
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index 8a563c4c4..e51cbf867 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -1,48 +1,56 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/mail/check_recent.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
- | Check for recent messages |
+ | Check for recent messages, in all mailboxes |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
- $Id$
+ $Id: check_recent.inc 233 2006-06-26 17:31:20Z richs $
*/
$REMOTE_REQUEST = TRUE;
-$mbox_name = $IMAP->get_mailbox_name();
-if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE))
+$a_mailboxes = $IMAP->list_mailboxes();
+
+foreach ($a_mailboxes as $mbox_name)
{
- $count = $IMAP->messagecount();
- $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE);
-
- $commands = sprintf("this.set_unread_count('%s', %d, true);\n", addslashes($mbox_name), $unread_count);
- $commands .= sprintf("this.set_env('messagecount', %d);\n", $count);
- $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
- $commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota());
-
- // add new message headers to list
- $a_headers = array();
- for ($i=$recent_count, $id=$count-$recent_count+1; $i>0; $i--, $id++)
- $a_headers[] = $IMAP->get_headers($id, NULL, FALSE);
-
- $commands .= rcmail_js_message_list($a_headers, TRUE);
+ if ($mbox_name == $IMAP->get_mailbox_name())
+ {
+ if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE))
+ {
+ $count = $IMAP->messagecount();
+ $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE);
+
+ $commands .= sprintf("this.set_unread_count('%s', %d, true);\n", addslashes($mbox_name), $unread_count);
+ $commands .= sprintf("this.set_env('messagecount', %d);\n", $count);
+ $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
+ $commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota());
+
+ // add new message headers to list
+ $a_headers = array();
+ for ($i=$recent_count, $id=$count-$recent_count+1; $i>0; $i--, $id++)
+ $a_headers[] = $IMAP->get_headers($id, NULL, FALSE);
+
+ $commands .= rcmail_js_message_list($a_headers, TRUE);
+ }
+ }
+ else
+ {
+ if ($IMAP->messagecount($mbox_name, 'RECENT'))
+ $commands .= sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_name), $IMAP->messagecount($mbox_name, 'UNSEEN'));
+ }
}
-if (strtoupper($mbox_name)!='INBOX' && $IMAP->messagecount('INBOX', 'RECENT'))
- $commands = sprintf("this.set_unread_count('INBOX', %d);\n", $IMAP->messagecount('INBOX', 'UNSEEN'));
-
-
rcube_remote_response($commands);
?>
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 8eff11c06..eac4e3747 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1,1490 +1,1490 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/mail/func.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Provide webmail functionality and GUI objects |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
require_once('lib/html2text.inc');
require_once('lib/enriched.inc');
$EMAIL_ADDRESS_PATTERN = '/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/i';
if (empty($_SESSION['mbox'])){
$_SESSION['mbox'] = $IMAP->get_mailbox_name();
}
// set imap properties and session vars
if (strlen($_GET['_mbox']))
{
$IMAP->set_mailbox($_GET['_mbox']);
$_SESSION['mbox'] = $_GET['_mbox'];
}
if (strlen($_GET['_page']))
{
$IMAP->set_page($_GET['_page']);
$_SESSION['page'] = $_GET['_page'];
}
// set mailbox to INBOX if not set
if (empty($_SESSION['mbox']))
$_SESSION['mbox'] = $IMAP->get_mailbox_name();
// set default sort col/order to session
if (!isset($_SESSION['sort_col']))
$_SESSION['sort_col'] = $CONFIG['message_sort_col'];
if (!isset($_SESSION['sort_order']))
$_SESSION['sort_order'] = $CONFIG['message_sort_order'];
// define url for getting message parts
if (strlen($_GET['_uid']))
$GET_URL = sprintf('%s&_action=get&_mbox=%s&_uid=%d', $COMM_PATH, $IMAP->get_mailbox_name(), $_GET['_uid']);
// set current mailbox in client environment
$OUTPUT->add_script(sprintf("%s.set_env('mailbox', '%s');", $JS_OBJECT_NAME, $IMAP->get_mailbox_name()));
if ($CONFIG['trash_mbox'])
$OUTPUT->add_script(sprintf("%s.set_env('trash_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['trash_mbox']));
if ($CONFIG['drafts_mbox'])
$OUTPUT->add_script(sprintf("%s.set_env('drafts_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['drafts_mbox']));
// return the mailboxlist in HTML
function rcmail_mailbox_list($attrib)
{
global $IMAP, $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $COMM_PATH;
static $s_added_script = FALSE;
static $a_mailboxes;
// add some labels to client
rcube_add_label('purgefolderconfirm');
// $mboxlist_start = rcube_timer();
$type = $attrib['type'] ? $attrib['type'] : 'ul';
$add_attrib = $type=='select' ? array('style', 'class', 'id', 'name', 'onchange') :
array('style', 'class', 'id');
if ($type=='ul' && !$attrib['id'])
$attrib['id'] = 'rcmboxlist';
// allow the following attributes to be added to the <ul> tag
$attrib_str = create_attrib_string($attrib, $add_attrib);
$out = '<' . $type . $attrib_str . ">\n";
// add no-selection option
if ($type=='select' && $attrib['noselection'])
$out .= sprintf('<option value="0">%s</option>'."\n",
rcube_label($attrib['noselection']));
// get mailbox list
$mbox_name = $IMAP->get_mailbox_name();
// for these mailboxes we have localized labels
$special_mailboxes = array('inbox', 'sent', 'drafts', 'trash', 'junk');
// build the folders tree
if (empty($a_mailboxes))
{
// get mailbox list
$a_folders = $IMAP->list_mailboxes();
$delimiter = $IMAP->get_hierarchy_delimiter();
$a_mailboxes = array();
// rcube_print_time($mboxlist_start, 'list_mailboxes()');
foreach ($a_folders as $folder)
rcmail_build_folder_tree($a_mailboxes, $folder, $delimiter);
}
// var_dump($a_mailboxes);
if ($type=='select')
$out .= rcmail_render_folder_tree_select($a_mailboxes, $special_mailboxes, $mbox_name, $attrib['maxlength']);
else
$out .= rcmail_render_folder_tree_html($a_mailboxes, $special_mailboxes, $mbox_name, $attrib['maxlength']);
// rcube_print_time($mboxlist_start, 'render_folder_tree()');
if ($type=='ul')
$OUTPUT->add_script(sprintf("%s.gui_object('mailboxlist', '%s');", $JS_OBJECT_NAME, $attrib['id']));
return $out . "</$type>";
}
// create a hierarchical array of the mailbox list
function rcmail_build_folder_tree(&$arrFolders, $folder, $delm='/', $path='')
{
$pos = strpos($folder, $delm);
if ($pos !== false)
{
$subFolders = substr($folder, $pos+1);
$currentFolder = substr($folder, 0, $pos);
}
else
{
$subFolders = false;
$currentFolder = $folder;
}
$path .= $currentFolder;
if (!isset($arrFolders[$currentFolder]))
{
$arrFolders[$currentFolder] = array('id' => $path,
'name' => rcube_charset_convert($currentFolder, 'UTF-7'),
'folders' => array());
}
if (!empty($subFolders))
rcmail_build_folder_tree($arrFolders[$currentFolder]['folders'], $subFolders, $delm, $path.$delm);
}
// return html for a structured list <ul> for the mailbox tree
function rcmail_render_folder_tree_html(&$arrFolders, &$special, &$mbox_name, $maxlength, $nestLevel=0)
{
global $JS_OBJECT_NAME, $COMM_PATH, $IMAP, $CONFIG, $OUTPUT;
$idx = 0;
$out = '';
foreach ($arrFolders as $key => $folder)
{
$zebra_class = ($nestLevel*$idx)%2 ? 'even' : 'odd';
$title = '';
$folder_lc = strtolower($folder['id']);
if (in_array($folder_lc, $special))
$foldername = rcube_label($folder_lc);
else
{
$foldername = $folder['name'];
// shorten the folder name to a given length
if ($maxlength && $maxlength>1)
{
$fname = abbrevate_string($foldername, $maxlength);
if ($fname != $foldername)
$title = ' title="'.rep_specialchars_output($foldername, 'html', 'all').'"';
$foldername = $fname;
}
}
// add unread message count display
if ($unread_count = $IMAP->messagecount($folder['id'], 'RECENT', ($folder['id']==$mbox_name)))
$foldername .= sprintf(' (%d)', $unread_count);
// make folder name safe for ids and class names
$folder_css = $class_name = preg_replace('/[^a-z0-9\-_]/', '', $folder_lc);
// set special class for Sent, Drafts, Trash and Junk
if ($folder['id']==$CONFIG['sent_mbox'])
$class_name = 'sent';
else if ($folder['id']==$CONFIG['drafts_mbox'])
$class_name = 'drafts';
else if ($folder['id']==$CONFIG['trash_mbox'])
$class_name = 'trash';
else if ($folder['id']==$CONFIG['junk_mbox'])
$class_name = 'junk';
$out .= sprintf('<li id="rcmbx%s" class="mailbox %s %s%s%s"><a href="%s&_mbox=%s"'.
' onclick="return %s.command(\'list\',\'%s\')"'.
' onmouseup="return %s.mbox_mouse_up(\'%s\')"%s>%s</a>',
$folder_css,
$class_name,
$zebra_class,
$unread_count ? ' unread' : '',
$folder['id']==$mbox_name ? ' selected' : '',
$COMM_PATH,
urlencode($folder['id']),
$JS_OBJECT_NAME,
$folder['id'],
$JS_OBJECT_NAME,
$folder['id'],
$title,
rep_specialchars_output($foldername, 'html', 'all'));
if (!empty($folder['folders']))
$out .= "\n<ul>\n" . rcmail_render_folder_tree_html($folder['folders'], $special, $mbox_name, $maxlength, $nestLevel+1) . "</ul>\n";
$out .= "</li>\n";
$idx++;
}
return $out;
}
// return html for a flat list <select> for the mailbox tree
function rcmail_render_folder_tree_select(&$arrFolders, &$special, &$mbox_name, $maxlength, $nestLevel=0)
{
global $IMAP, $OUTPUT;
$idx = 0;
$out = '';
foreach ($arrFolders as $key=>$folder)
{
$folder_lc = strtolower($folder['id']);
if (in_array($folder_lc, $special))
$foldername = rcube_label($folder_lc);
else
{
$foldername = $folder['name'];
// shorten the folder name to a given length
if ($maxlength && $maxlength>1)
$foldername = abbrevate_string($foldername, $maxlength);
}
$out .= sprintf('<option value="%s">%s%s</option>'."\n",
$folder['id'],
str_repeat('&nbsp;', $nestLevel*4),
rep_specialchars_output($foldername, 'html', 'all'));
if (!empty($folder['folders']))
$out .= rcmail_render_folder_tree_select($folder['folders'], $special, $mbox_name, $maxlength, $nestLevel+1);
$idx++;
}
return $out;
}
// return the message list as HTML table
function rcmail_message_list($attrib)
{
global $IMAP, $CONFIG, $COMM_PATH, $OUTPUT, $JS_OBJECT_NAME;
$skin_path = $CONFIG['skin_path'];
$image_tag = '<img src="%s%s" alt="%s" border="0" />';
// check to see if we have some settings for sorting
$sort_col = $_SESSION['sort_col'];
$sort_order = $_SESSION['sort_order'];
// get message headers
$a_headers = $IMAP->list_headers('', '', $sort_col, $sort_order);
// add id to message list table if not specified
if (!strlen($attrib['id']))
$attrib['id'] = 'rcubemessagelist';
// allow the following attributes to be added to the <table> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
$out = '<table' . $attrib_str . ">\n";
// define list of cols to be displayed
$a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
- $a_sort_cols = array('subject', 'date', 'from', 'to');
+ $a_sort_cols = array('subject', 'date', 'from', 'to', 'size');
// show 'to' instead of from in sent messages
- if (strtolower($IMAP->get_mailbox_name())=='sent' && ($f = array_search('from', $a_show_cols))
+ if (($IMAP->get_mailbox_name()==$CONFIG['sent_mbox'] || $IMAP->get_mailbox_name()==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols))
&& !array_search('to', $a_show_cols))
$a_show_cols[$f] = 'to';
// add col definition
$out .= '<colgroup>';
$out .= '<col class="icon" />';
foreach ($a_show_cols as $col)
$out .= sprintf('<col class="%s" />', $col);
$out .= '<col class="icon" />';
$out .= "</colgroup>\n";
// add table title
$out .= "<thead><tr>\n<td class=\"icon\">&nbsp;</td>\n";
$javascript = '';
foreach ($a_show_cols as $col)
{
// get column name
$col_name = rep_specialchars_output(rcube_label($col));
// make sort links
$sort = '';
if ($IMAP->get_capability('sort') && in_array($col, $a_sort_cols))
{
// have buttons configured
if (!empty($attrib['sortdescbutton']) || !empty($attrib['sortascbutton']))
{
$sort = '&nbsp;&nbsp;';
// asc link
if (!empty($attrib['sortascbutton']))
{
$sort .= rcube_button(array('command' => 'sort',
'prop' => $col.'_ASC',
'image' => $attrib['sortascbutton'],
'align' => 'absmiddle',
'title' => 'sortasc'));
}
// desc link
if (!empty($attrib['sortdescbutton']))
{
$sort .= rcube_button(array('command' => 'sort',
'prop' => $col.'_DESC',
'image' => $attrib['sortdescbutton'],
'align' => 'absmiddle',
'title' => 'sortdesc'));
}
}
// just add a link tag to the header
else
{
$col_name = sprintf('<a href="./#sort" onclick="return %s.command(\'sort\',\'%s\',this)" title="%s">%s</a>',
$JS_OBJECT_NAME,
$col,
rcube_label('sortby'),
$col_name);
}
}
$sort_class = $col==$sort_col ? " sorted$sort_order" : '';
// put it all together
$out .= '<td class="'.$col.$sort_class.'" id="rcmHead'.$col.'">' . "$col_name$sort</td>\n";
}
$out .= '<td class="icon">'.($attrib['attachmenticon'] ? sprintf($image_tag, $skin_path, $attrib['attachmenticon'], '') : '')."</td>\n";
$out .= "</tr></thead>\n<tbody>\n";
// no messages in this mailbox
if (!sizeof($a_headers))
{
$out .= rep_specialchars_output(
sprintf('<tr><td colspan="%d">%s</td></tr>',
sizeof($a_show_cols)+2,
rcube_label('nomessagesfound')));
}
$a_js_message_arr = array();
// create row for each message
foreach ($a_headers as $i => $header) //while (list($i, $header) = each($a_headers))
{
$message_icon = $attach_icon = '';
$js_row_arr = array();
$zebra_class = $i%2 ? 'even' : 'odd';
// set messag attributes to javascript array
if ($header->deleted)
$js_row_arr['deleted'] = true;
if (!$header->seen)
$js_row_arr['unread'] = true;
if ($header->answered)
$js_row_arr['replied'] = true;
// set message icon
if ($attrib['deletedicon'] && $header->deleted)
$message_icon = $attrib['deletedicon'];
else if ($attrib['unreadicon'] && !$header->seen)
$message_icon = $attrib['unreadicon'];
else if ($attrib['repliedicon'] && $header->answered)
$message_icon = $attrib['repliedicon'];
else if ($attrib['messageicon'])
$message_icon = $attrib['messageicon'];
// set attachment icon
if ($attrib['attachmenticon'] && preg_match("/multipart\/m/i", $header->ctype))
$attach_icon = $attrib['attachmenticon'];
$out .= sprintf('<tr id="rcmrow%d" class="message%s%s %s">'."\n",
$header->uid,
$header->seen ? '' : ' unread',
$header->deleted ? ' deleted' : '',
$zebra_class);
$out .= sprintf("<td class=\"icon\">%s</td>\n", $message_icon ? sprintf($image_tag, $skin_path, $message_icon, '') : '');
// format each col
foreach ($a_show_cols as $col)
{
if ($col=='from' || $col=='to')
$cont = rep_specialchars_output(rcmail_address_string($header->$col, 3, $attrib['addicon']));
else if ($col=='subject')
$cont = rep_specialchars_output($IMAP->decode_header($header->$col), 'html', 'all');
else if ($col=='size')
$cont = show_bytes($header->$col);
else if ($col=='date')
$cont = format_date($header->date); //date('m.d.Y G:i:s', strtotime($header->date));
else
$cont = rep_specialchars_output($header->$col, 'html', 'all');
$out .= '<td class="'.$col.'">' . $cont . "</td>\n";
}
$out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : '');
$out .= "</tr>\n";
if (sizeof($js_row_arr))
$a_js_message_arr[$header->uid] = $js_row_arr;
}
// complete message table
$out .= "</tbody></table>\n";
$message_count = $IMAP->messagecount();
// set client env
$javascript .= sprintf("%s.gui_object('mailcontframe', '%s');\n", $JS_OBJECT_NAME, 'mailcontframe');
$javascript .= sprintf("%s.gui_object('messagelist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']);
$javascript .= sprintf("%s.set_env('messagecount', %d);\n", $JS_OBJECT_NAME, $message_count);
$javascript .= sprintf("%s.set_env('current_page', %d);\n", $JS_OBJECT_NAME, $IMAP->list_page);
$javascript .= sprintf("%s.set_env('pagecount', %d);\n", $JS_OBJECT_NAME, ceil($message_count/$IMAP->page_size));
$javascript .= sprintf("%s.set_env('sort_col', '%s');\n", $JS_OBJECT_NAME, $sort_col);
$javascript .= sprintf("%s.set_env('sort_order', '%s');\n", $JS_OBJECT_NAME, $sort_order);
if ($attrib['messageicon'])
$javascript .= sprintf("%s.set_env('messageicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['messageicon']);
if ($attrib['deletedicon'])
$javascript .= sprintf("%s.set_env('deletedicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['deletedicon']);
if ($attrib['unreadicon'])
$javascript .= sprintf("%s.set_env('unreadicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['unreadicon']);
if ($attrib['repliedicon'])
$javascript .= sprintf("%s.set_env('repliedicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['repliedicon']);
if ($attrib['attachmenticon'])
$javascript .= sprintf("%s.set_env('attachmenticon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['attachmenticon']);
$javascript .= sprintf("%s.set_env('messages', %s);", $JS_OBJECT_NAME, array2js($a_js_message_arr));
$OUTPUT->add_script($javascript);
return $out;
}
// return javascript commands to add rows to the message list
function rcmail_js_message_list($a_headers, $insert_top=FALSE)
{
global $CONFIG, $IMAP;
$commands = '';
$a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
// show 'to' instead of from in sent messages
if (strtolower($IMAP->get_mailbox_name())=='sent' && ($f = array_search('from', $a_show_cols))
&& !array_search('to', $a_show_cols))
$a_show_cols[$f] = 'to';
// loop through message headers
for ($n=0; $a_headers[$n]; $n++)
{
$header = $a_headers[$n];
$a_msg_cols = array();
$a_msg_flags = array();
// format each col; similar as in rcmail_message_list()
foreach ($a_show_cols as $col)
{
if ($col=='from' || $col=='to')
$cont = rep_specialchars_output(rcmail_address_string($header->$col, 3));
else if ($col=='subject')
$cont = rep_specialchars_output($IMAP->decode_header($header->$col), 'html', 'all');
else if ($col=='size')
$cont = show_bytes($header->$col);
else if ($col=='date')
$cont = format_date($header->date); //date('m.d.Y G:i:s', strtotime($header->date));
else
$cont = rep_specialchars_output($header->$col, 'html', 'all');
$a_msg_cols[$col] = $cont;
}
$a_msg_flags['deleted'] = $header->deleted ? 1 : 0;
$a_msg_flags['unread'] = $header->seen ? 0 : 1;
$a_msg_flags['replied'] = $header->answered ? 1 : 0;
$commands .= sprintf("this.add_message_row(%s, %s, %s, %b, %b);\n",
$header->uid,
array2js($a_msg_cols),
array2js($a_msg_flags),
preg_match("/multipart\/m/i", $header->ctype),
$insert_top);
}
return $commands;
}
// return code for search function
function rcmail_search_form($attrib)
{
global $OUTPUT, $JS_OBJECT_NAME;
// add some labels to client
rcube_add_label('searching');
$attrib['name'] = '_q';
if (empty($attrib['id']))
$attrib['id'] = 'rcmqsearchbox';
$input_q = new textfield($attrib);
$out = $input_q->show();
$OUTPUT->add_script(sprintf("%s.gui_object('qsearchbox', '%s');",
$JS_OBJECT_NAME,
$attrib['id']));
// add form tag around text field
if (empty($attrib['form']))
$out = sprintf('<form name="rcmqsearchform" action="./" '.
'onsubmit="%s.command(\'search\');return false" style="display:inline;">%s</form>',
$JS_OBJECT_NAME,
$out);
return $out;
}
function rcmail_messagecount_display($attrib)
{
global $IMAP, $OUTPUT, $JS_OBJECT_NAME;
if (!$attrib['id'])
$attrib['id'] = 'rcmcountdisplay';
$OUTPUT->add_script(sprintf("%s.gui_object('countdisplay', '%s');",
$JS_OBJECT_NAME,
$attrib['id']));
// allow the following attributes to be added to the <span> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
$out = '<span' . $attrib_str . '>';
$out .= rcmail_get_messagecount_text();
$out .= '</span>';
return $out;
}
function rcmail_quota_display($attrib)
{
global $IMAP, $OUTPUT, $JS_OBJECT_NAME;
if (!$attrib['id'])
$attrib['id'] = 'rcmquotadisplay';
$OUTPUT->add_script(sprintf("%s.gui_object('quotadisplay', '%s');", $JS_OBJECT_NAME, $attrib['id']));
// allow the following attributes to be added to the <span> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
if (!$IMAP->get_capability('QUOTA'))
$quota_text = rcube_label('unknown');
else if (!($quota_text = $IMAP->get_quota()))
$quota_text = rcube_label('unlimited');
$out = '<span' . $attrib_str . '>';
$out .= $quota_text;
$out .= '</span>';
return $out;
}
function rcmail_get_messagecount_text($count=NULL, $page=NULL)
{
global $IMAP, $MESSAGE;
if (isset($MESSAGE['index']))
{
return rcube_label(array('name' => 'messagenrof',
'vars' => array('nr' => $MESSAGE['index']+1,
'count' => $count!==NULL ? $count : $IMAP->messagecount())));
}
if ($page===NULL)
$page = $IMAP->list_page;
$start_msg = ($page-1) * $IMAP->page_size + 1;
$max = $count!==NULL ? $count : $IMAP->messagecount();
if ($max==0)
$out = rcube_label('mailboxempty');
else
$out = rcube_label(array('name' => 'messagesfromto',
'vars' => array('from' => $start_msg,
'to' => min($max, $start_msg + $IMAP->page_size - 1),
'count' => $max)));
return rep_specialchars_output($out);
}
function rcmail_print_body($part, $safe=FALSE, $plain=FALSE) // $body, $ctype_primary='text', $ctype_secondary='plain', $encoding='7bit', $safe=FALSE, $plain=FALSE)
{
global $IMAP, $REMOTE_OBJECTS, $JS_OBJECT_NAME;
// extract part properties: body, ctype_primary, ctype_secondary, encoding, parameters
extract($part);
$block = $plain ? '%s' : '%s'; //'<div style="display:block;">%s</div>';
$body = $IMAP->mime_decode($body, $encoding);
$body = $IMAP->charset_decode($body, $parameters);
// text/html
if ($ctype_secondary=='html')
{
if (!$safe) // remove remote images and scripts
{
$remote_patterns = array('/(src|background)=(["\']?)([hftps]{3,5}:\/{2}[^"\'\s]+)(\2|\s|>)/Ui',
// '/(src|background)=(["\']?)([\.\/]+[^"\'\s]+)(\2|\s|>)/Ui',
'/(<base.*href=["\']?)([hftps]{3,5}:\/{2}[^"\'\s]+)([^<]*>)/i',
'/(<link.*href=["\']?)([hftps]{3,5}:\/{2}[^"\'\s]+)([^<]*>)/i',
'/url\s*\(["\']?([hftps]{3,5}:\/{2}[^"\'\s]+)["\']?\)/i',
'/url\s*\(["\']?([\.\/]+[^"\'\s]+)["\']?\)/i',
'/<script.+<\/script>/Umis');
$remote_replaces = array('', // '\\1=\\2#\\4',
// '\\1=\\2#\\4',
'',
'', // '\\1#\\3',
'none',
'none',
'');
// set flag if message containes remote obejcts that where blocked
foreach ($remote_patterns as $pattern)
{
if (preg_match($pattern, $body))
{
$REMOTE_OBJECTS = TRUE;
break;
}
}
$body = preg_replace($remote_patterns, $remote_replaces, $body);
}
return sprintf($block, rep_specialchars_output($body, 'html', '', FALSE));
}
// text/enriched
if ($ctype_secondary=='enriched')
{
$body = enriched_to_html($body);
return sprintf($block, rep_specialchars_output($body, 'html'));
}
else
{
// make links and email-addresses clickable
$convert_patterns = $convert_replaces = $replace_strings = array();
$url_chars = 'a-z0-9_\-\+\*\$\/&%=@#:';
$url_chars_within = '\?\.~,!';
$convert_patterns[] = "/([\w]+):\/\/([a-z0-9\-\.]+[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/ie";
$convert_replaces[] = "rcmail_str_replacement('<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>', \$replace_strings)";
$convert_patterns[] = "/([^\/:]|\s)(www\.)([a-z0-9\-]{2,}[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/ie";
$convert_replaces[] = "rcmail_str_replacement('\\1<a href=\"http://\\2\\3\" target=\"_blank\">\\2\\3</a>', \$replace_strings)";
$convert_patterns[] = '/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/ie';
$convert_replaces[] = "rcmail_str_replacement('<a href=\"mailto:\\1\" onclick=\"return $JS_OBJECT_NAME.command(\'compose\',\'\\1\',this)\">\\1</a>', \$replace_strings)";
$body = wordwrap(trim($body), 80);
$body = preg_replace($convert_patterns, $convert_replaces, $body);
// split body into single lines
$a_lines = preg_split('/\r?\n/', $body);
// colorize quoted parts
for($n=0; $n<sizeof($a_lines); $n++)
{
$line = $a_lines[$n];
if ($line{2}=='>')
$color = 'red';
else if ($line{1}=='>')
$color = 'green';
else if ($line{0}=='>')
$color = 'blue';
else
$color = FALSE;
$line = rep_specialchars_output($line, 'html', 'replace', FALSE);
if ($color)
$a_lines[$n] = sprintf('<font color="%s">%s</font>', $color, $line);
else
$a_lines[$n] = $line;
}
// insert the links for urls and mailtos
$body = preg_replace("/##string_replacement\{([0-9]+)\}##/e", "\$replace_strings[\\1]", join("\n", $a_lines));
return sprintf($block, "<pre>\n".$body."\n</pre>");
}
}
// add a string to the replacement array and return a replacement string
function rcmail_str_replacement($str, &$rep)
{
static $count = 0;
$rep[$count] = stripslashes($str);
return "##string_replacement{".($count++)."}##";
}
function rcmail_parse_message($structure, $arg=array(), $recursive=FALSE)
{
global $IMAP;
static $sa_inline_objects = array();
// arguments are: (bool)$prefer_html, (string)$get_url
extract($arg);
$a_attachments = array();
$a_return_parts = array();
$out = '';
$message_ctype_primary = strtolower($structure->ctype_primary);
$message_ctype_secondary = strtolower($structure->ctype_secondary);
// show message headers
if ($recursive && is_array($structure->headers) && isset($structure->headers['subject']))
$a_return_parts[] = array('type' => 'headers',
'headers' => $structure->headers);
// print body if message doesn't have multiple parts
if ($message_ctype_primary=='text')
{
$a_return_parts[] = array('type' => 'content',
'body' => $structure->body,
'ctype_primary' => $message_ctype_primary,
'ctype_secondary' => $message_ctype_secondary,
'parameters' => $structure->ctype_parameters,
'encoding' => $structure->headers['content-transfer-encoding']);
}
// message contains alternative parts
else if ($message_ctype_primary=='multipart' && $message_ctype_secondary=='alternative' && is_array($structure->parts))
{
// get html/plaintext parts
$plain_part = $html_part = $print_part = $related_part = NULL;
foreach ($structure->parts as $p => $sub_part)
{
$sub_ctype_primary = strtolower($sub_part->ctype_primary);
$sub_ctype_secondary = strtolower($sub_part->ctype_secondary);
// check if sub part is
if ($sub_ctype_primary=='text' && $sub_ctype_secondary=='plain')
$plain_part = $p;
else if ($sub_ctype_primary=='text' && $sub_ctype_secondary=='html')
$html_part = $p;
else if ($sub_ctype_primary=='text' && $sub_ctype_secondary=='enriched')
$enriched_part = $p;
else if ($sub_ctype_primary=='multipart' && $sub_ctype_secondary=='related')
$related_part = $p;
}
// parse related part (alternative part could be in here)
if ($related_part!==NULL && $prefer_html)
{
list($parts, $attachmnts) = rcmail_parse_message($structure->parts[$related_part], $arg, TRUE);
$a_return_parts = array_merge($a_return_parts, $parts);
$a_attachments = array_merge($a_attachments, $attachmnts);
}
// print html/plain part
else if ($html_part!==NULL && $prefer_html)
$print_part = $structure->parts[$html_part];
else if ($enriched_part!==NULL)
$print_part = $structure->parts[$enriched_part];
else if ($plain_part!==NULL)
$print_part = $structure->parts[$plain_part];
// show message body
if (is_object($print_part))
$a_return_parts[] = array('type' => 'content',
'body' => $print_part->body,
'ctype_primary' => strtolower($print_part->ctype_primary),
'ctype_secondary' => strtolower($print_part->ctype_secondary),
'parameters' => $print_part->ctype_parameters,
'encoding' => $print_part->headers['content-transfer-encoding']);
// show plaintext warning
else if ($html_part!==NULL)
$a_return_parts[] = array('type' => 'content',
'body' => rcube_label('htmlmessage'),
'ctype_primary' => 'text',
'ctype_secondary' => 'plain');
// add html part as attachment
if ($html_part!==NULL && $structure->parts[$html_part]!==$print_part)
{
$html_part = $structure->parts[$html_part];
$a_attachments[] = array('filename' => rcube_label('htmlmessage'),
'encoding' => $html_part->headers['content-transfer-encoding'],
'mimetype' => 'text/html',
'part_id' => $html_part->mime_id,
'size' => strlen($IMAP->mime_decode($html_part->body, $html_part->headers['content-transfer-encoding'])));
}
}
// message contains multiple parts
else if ($message_ctype_primary=='multipart' && is_array($structure->parts))
{
foreach ($structure->parts as $mail_part)
{
$primary_type = strtolower($mail_part->ctype_primary);
$secondary_type = strtolower($mail_part->ctype_secondary);
// multipart/alternative
if ($primary_type=='multipart') // && ($secondary_type=='alternative' || $secondary_type=='mixed' || $secondary_type=='related'))
{
list($parts, $attachmnts) = rcmail_parse_message($mail_part, $arg, TRUE);
$a_return_parts = array_merge($a_return_parts, $parts);
$a_attachments = array_merge($a_attachments, $attachmnts);
}
// part text/[plain|html] OR message/delivery-status
else if (($primary_type=='text' && ($secondary_type=='plain' || $secondary_type=='html') && $mail_part->disposition!='attachment') ||
($primary_type=='message' && $secondary_type=='delivery-status'))
{
$a_return_parts[] = array('type' => 'content',
'body' => $mail_part->body,
'ctype_primary' => $primary_type,
'ctype_secondary' => $secondary_type,
'parameters' => $mail_part->ctype_parameters,
'encoding' => $mail_part->headers['content-transfer-encoding']);
}
// part message/*
else if ($primary_type=='message')
{
/* don't parse headers here; they're parsed within the recursive call to rcmail_parse_message()
if ($mail_part->parts[0]->headers)
$a_return_parts[] = array('type' => 'headers',
'headers' => $mail_part->parts[0]->headers);
*/
list($parts, $attachmnts) = rcmail_parse_message($mail_part->parts[0], $arg, TRUE);
$a_return_parts = array_merge($a_return_parts, $parts);
$a_attachments = array_merge($a_attachments, $attachmnts);
}
// part is file/attachment
else if ($mail_part->disposition=='attachment' || $mail_part->disposition=='inline' || $mail_part->headers['content-id'] ||
(empty($mail_part->disposition) && ($mail_part->d_parameters['filename'] || $mail_part->ctype_parameters['name'])))
{
if ($message_ctype_secondary=='related' && $mail_part->headers['content-id'])
$sa_inline_objects[] = array('filename' => rcube_imap::decode_mime_string($mail_part->d_parameters['filename']),
'mimetype' => strtolower("$primary_type/$secondary_type"),
'part_id' => $mail_part->mime_id,
'content_id' => preg_replace(array('/^</', '/>$/'), '', $mail_part->headers['content-id']));
else if ($mail_part->d_parameters['filename'])
$a_attachments[] = array('filename' => rcube_imap::decode_mime_string($mail_part->d_parameters['filename']),
'encoding' => strtolower($mail_part->headers['content-transfer-encoding']),
'mimetype' => strtolower("$primary_type/$secondary_type"),
'part_id' => $mail_part->mime_id,
'size' => strlen($IMAP->mime_decode($mail_part->body, $mail_part->headers['content-transfer-encoding'])) /*,
'content' => $mail_part->body */);
else if ($mail_part->ctype_parameters['name'])
$a_attachments[] = array('filename' => rcube_imap::decode_mime_string($mail_part->ctype_parameters['name']),
'encoding' => strtolower($mail_part->headers['content-transfer-encoding']),
'mimetype' => strtolower("$primary_type/$secondary_type"),
'part_id' => $mail_part->mime_id,
'size' => strlen($IMAP->mime_decode($mail_part->body, $mail_part->headers['content-transfer-encoding'])) /*,
'content' => $mail_part->body */);
else if ($mail_part->headers['content-description'])
$a_attachments[] = array('filename' => rcube_imap::decode_mime_string($mail_part->headers['content-description']),
'encoding' => strtolower($mail_part->headers['content-transfer-encoding']),
'mimetype' => strtolower("$primary_type/$secondary_type"),
'part_id' => $mail_part->mime_id,
'size' => strlen($IMAP->mime_decode($mail_part->body, $mail_part->headers['content-transfer-encoding'])) /*,
'content' => $mail_part->body */);
}
}
// if this was a related part try to resolve references
if ($message_ctype_secondary=='related' && sizeof($sa_inline_objects))
{
$a_replace_patters = array();
$a_replace_strings = array();
foreach ($sa_inline_objects as $inline_object)
{
$a_replace_patters[] = 'cid:'.$inline_object['content_id'];
$a_replace_strings[] = sprintf($get_url, $inline_object['part_id']);
}
foreach ($a_return_parts as $i => $return_part)
{
if ($return_part['type']!='content')
continue;
// decode body and replace cid:...
$a_return_parts[$i]['body'] = str_replace($a_replace_patters, $a_replace_strings, $IMAP->mime_decode($return_part['body'], $return_part['encoding']));
$a_return_parts[$i]['encoding'] = '7bit';
}
}
}
// join all parts together
//$out .= join($part_delimiter, $a_return_parts);
return array($a_return_parts, $a_attachments);
}
// return table with message headers
function rcmail_message_headers($attrib, $headers=NULL)
{
global $IMAP, $OUTPUT, $MESSAGE;
static $sa_attrib;
// keep header table attrib
if (is_array($attrib) && !$sa_attrib)
$sa_attrib = $attrib;
else if (!is_array($attrib) && is_array($sa_attrib))
$attrib = $sa_attrib;
if (!isset($MESSAGE))
return FALSE;
// get associative array of headers object
if (!$headers)
$headers = is_object($MESSAGE['headers']) ? get_object_vars($MESSAGE['headers']) : $MESSAGE['headers'];
$header_count = 0;
// allow the following attributes to be added to the <table> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
$out = '<table' . $attrib_str . ">\n";
// show these headers
$standard_headers = array('subject', 'from', 'organization', 'to', 'cc', 'bcc', 'reply-to', 'date');
foreach ($standard_headers as $hkey)
{
if (!$headers[$hkey])
continue;
if ($hkey=='date' && !empty($headers[$hkey]))
$header_value = format_date(strtotime($headers[$hkey]));
else if (in_array($hkey, array('from', 'to', 'cc', 'bcc', 'reply-to')))
$header_value = rep_specialchars_output(rcmail_address_string($IMAP->decode_header($headers[$hkey]), NULL, $attrib['addicon']));
else
$header_value = rep_specialchars_output($IMAP->decode_header($headers[$hkey]), '', 'all');
$out .= "\n<tr>\n";
$out .= '<td class="header-title">'.rep_specialchars_output(rcube_label($hkey)).":&nbsp;</td>\n";
$out .= '<td class="'.$hkey.'" width="90%">'.$header_value."</td>\n</tr>";
$header_count++;
}
$out .= "\n</table>\n\n";
return $header_count ? $out : '';
}
function rcmail_message_body($attrib)
{
global $CONFIG, $OUTPUT, $MESSAGE, $GET_URL, $REMOTE_OBJECTS, $JS_OBJECT_NAME;
if (!is_array($MESSAGE['parts']) && !$MESSAGE['body'])
return '';
if (!$attrib['id'])
$attrib['id'] = 'rcmailMsgBody';
$safe_mode = (bool)$_GET['_safe'];
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
$out = '<div '. $attrib_str . ">\n";
$header_attrib = array();
foreach ($attrib as $attr => $value)
if (preg_match('/^headertable([a-z]+)$/i', $attr, $regs))
$header_attrib[$regs[1]] = $value;
// this is an ecrypted message
// -> create a plaintext body with the according message
if (!sizeof($MESSAGE['parts']) && $MESSAGE['headers']->ctype=='multipart/encrypted')
{
$MESSAGE['parts'][0] = array('type' => 'content',
'ctype_primary' => 'text',
'ctype_secondary' => 'plain',
'body' => rcube_label('encryptedmessage'));
}
if ($MESSAGE['parts'])
{
foreach ($MESSAGE['parts'] as $i => $part)
{
if ($part['type']=='headers')
$out .= rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : NULL, $part['headers']);
else if ($part['type']=='content')
{
if (empty($part['parameters']) || empty($part['parameters']['charset']))
$part['parameters']['charset'] = $MESSAGE['headers']->charset;
// $body = rcmail_print_body($part['body'], $part['ctype_primary'], $part['ctype_secondary'], $part['encoding'], $safe_mode);
$body = rcmail_print_body($part, $safe_mode);
$out .= '<div class="message-part">';
if ($part['ctype_secondary']!='plain')
$out .= rcmail_mod_html_body($body, $attrib['id']);
else
$out .= $body;
$out .= "</div>\n";
}
}
}
else
$out .= $MESSAGE['body'];
$ctype_primary = strtolower($MESSAGE['structure']->ctype_primary);
$ctype_secondary = strtolower($MESSAGE['structure']->ctype_secondary);
// list images after mail body
if (get_boolean($attrib['showimages']) && $ctype_primary=='multipart' && $ctype_secondary=='mixed' &&
sizeof($MESSAGE['attachments']) && !strstr($message_body, '<html') && strlen($GET_URL))
{
foreach ($MESSAGE['attachments'] as $attach_prop)
{
if (strpos($attach_prop['mimetype'], 'image/')===0)
$out .= sprintf("\n<hr />\n<p align=\"center\"><img src=\"%s&_part=%s\" alt=\"%s\" title=\"%s\" /></p>\n",
$GET_URL, $attach_prop['part_id'],
$attach_prop['filename'],
$attach_prop['filename']);
}
}
// tell client that there are blocked remote objects
if ($REMOTE_OBJECTS && !$safe_mode)
$OUTPUT->add_script(sprintf("%s.set_env('blockedobjects', true);", $JS_OBJECT_NAME));
$out .= "\n</div>";
return $out;
}
// modify a HTML message that it can be displayed inside a HTML page
function rcmail_mod_html_body($body, $container_id)
{
// remove any null-byte characters before parsing
$body = preg_replace('/\x00/', '', $body);
$last_style_pos = 0;
$body_lc = strtolower($body);
// find STYLE tags
while (($pos = strpos($body_lc, '<style', $last_style_pos)) && ($pos2 = strpos($body_lc, '</style>', $pos)))
{
$pos2 += 8;
$body_pre = substr($body, 0, $pos);
$styles = substr($body, $pos, $pos2-$pos);
$body_post = substr($body, $pos2, strlen($body)-$pos2);
// replace all css definitions with #container [def]
$styles = rcmail_mod_css_styles($styles, $container_id);
$body = $body_pre . $styles . $body_post;
$last_style_pos = $pos2;
}
// remove SCRIPT tags
foreach (array('script', 'applet', 'object', 'embed', 'iframe') as $tag)
{
while (($pos = strpos($body_lc, '<'.$tag)) && ($pos2 = strpos($body_lc, '</'.$tag.'>', $pos)))
{
$pos2 += 8;
$body = substr($body, 0, $pos) . substr($body, $pos2, strlen($body)-$pos2);
$body_lc = strtolower($body);
}
}
// replace event handlers on any object
$body = preg_replace('/\s(on[a-z]+)=/im', ' __removed=', $body);
// resolve <base href>
$base_reg = '/(<base.*href=["\']?)([hftps]{3,5}:\/{2}[^"\'\s]+)([^<]*>)/i';
if (preg_match($base_reg, $body, $regs))
{
$base_url = $regs[2];
$body = preg_replace('/(src|background|href)=(["\']?)([\.\/]+[^"\'\s]+)(\2|\s|>)/Uie', "'\\1=\"'.make_absolute_url('\\3', '$base_url').'\"'", $body);
$body = preg_replace('/(url\s*\()(["\']?)([\.\/]+[^"\'\)\s]+)(\2)\)/Uie', "'\\1\''.make_absolute_url('\\3', '$base_url').'\')'", $body);
$body = preg_replace($base_reg, '', $body);
}
// add comments arround html and other tags
$out = preg_replace(array('/(<\/?html[^>]*>)/i',
'/(<\/?head[^>]*>)/i',
'/(<title[^>]*>.+<\/title>)/ui',
'/(<\/?meta[^>]*>)/i'),
'<!--\\1-->',
$body);
$out = preg_replace(array('/(<body[^>]*>)/i',
'/(<\/body>)/i'),
array('<div class="rcmBody">',
'</div>'),
$out);
return $out;
}
// replace all css definitions with #container [def]
function rcmail_mod_css_styles($source, $container_id)
{
$a_css_values = array();
$last_pos = 0;
// cut out all contents between { and }
while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos)))
{
$key = sizeof($a_css_values);
$a_css_values[$key] = substr($source, $pos+1, $pos2-($pos+1));
$source = substr($source, 0, $pos+1) . "<<str_replacement[$key]>>" . substr($source, $pos2, strlen($source)-$pos2);
$last_pos = $pos+2;
}
$styles = preg_replace('/(^\s*|,\s*)([a-z0-9\._][a-z0-9\.\-_]*)/im', "\\1#$container_id \\2", $source);
$styles = preg_replace('/<<str_replacement\[([0-9]+)\]>>/e', "\$a_css_values[\\1]", $styles);
// replace body definition because we also stripped off the <body> tag
$styles = preg_replace("/$container_id\s+body/i", "$container_id div.rcmBody", $styles);
return $styles;
}
// return first text part of a message
function rcmail_first_text_part($message_parts)
{
if (!is_array($message_parts))
return FALSE;
$html_part = NULL;
// check all message parts
foreach ($message_parts as $pid => $part)
{
$mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary);
if ($mimetype=='text/plain')
{
$body = rcube_imap::mime_decode($part->body, $part->headers['content-transfer-encoding']);
$body = rcube_imap::charset_decode($body, $part->ctype_parameters);
return $body;
}
else if ($mimetype=='text/html')
{
$html_part = rcube_imap::mime_decode($part->body, $part->headers['content-transfer-encoding']);
$html_part = rcube_imap::charset_decode($html_part, $part->ctype_parameters);
}
}
// convert HTML to plain text
if ($html_part)
{
// remove special chars encoding
$trans = array_flip(get_html_translation_table(HTML_ENTITIES));
$html_part = strtr($html_part, $trans);
// create instance of html2text class
$txt = new html2text($html_part);
return $txt->get_text();
}
return FALSE;
}
// get source code of a specific message and cache it
function rcmail_message_source($uid)
{
global $IMAP, $DB, $CONFIG;
// get message ID if uid is given
$cache_key = $IMAP->mailbox.'.msg';
$cached = $IMAP->get_cached_message($cache_key, $uid, FALSE);
// message is cached in database
if ($cached && !empty($cached->body))
return $cached->body;
if (!$cached)
$headers = $IMAP->get_headers($uid);
else
$headers = &$cached;
// create unique identifier based on message_id
if (!empty($headers->messageID))
$message_id = md5($headers->messageID);
else
$message_id = md5($headers->uid.'@'.$_SESSION['imap_host']);
$temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '');
$cache_dir = $temp_dir.$_SESSION['client_id'];
$cache_path = $cache_dir.'/'.$message_id;
// message is cached in temp dir
if ($CONFIG['enable_caching'] && is_dir($cache_dir) && is_file($cache_path))
{
if ($fp = fopen($cache_path, 'r'))
{
$msg_source = fread($fp, filesize($cache_path));
fclose($fp);
return $msg_source;
}
}
// get message from server
$msg_source = $IMAP->get_raw_body($uid);
// return message source without caching
if (!$CONFIG['enable_caching'])
return $msg_source;
// let's cache the message body within the database
if ($cached && ($CONFIG['db_max_length'] -300) > $headers->size)
{
$DB->query("UPDATE ".get_table_name('messages')."
SET body=?
WHERE user_id=?
AND cache_key=?
AND uid=?",
$msg_source,
$_SESSION['user_id'],
$cache_key,
$uid);
return $msg_source;
}
// create dir for caching
if (!is_dir($cache_dir))
$dir = mkdir($cache_dir);
else
$dir = true;
// attempt to write a file with the message body
if ($dir && ($fp = fopen($cache_path, 'w')))
{
fwrite($fp, $msg_source);
fclose($fp);
}
else
{
raise_error(array('code' => 403, 'type' => 'php', 'line' => __LINE__, 'file' => __FILE__,
'message' => "Failed to write to temp dir"), TRUE, FALSE);
}
return $msg_source;
}
// decode address string and re-format it as HTML links
function rcmail_address_string($input, $max=NULL, $addicon=NULL)
{
global $IMAP, $PRINT_MODE, $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $EMAIL_ADDRESS_PATTERN;
$a_parts = $IMAP->decode_address_list($input);
if (!sizeof($a_parts))
return $input;
$c = count($a_parts);
$j = 0;
$out = '';
foreach ($a_parts as $part)
{
$j++;
if ($PRINT_MODE)
$out .= sprintf('%s &lt;%s&gt;', rep_specialchars_output($part['name']), $part['mailto']);
else if (preg_match($EMAIL_ADDRESS_PATTERN, $part['mailto']))
{
$out .= sprintf('<a href="mailto:%s" onclick="return %s.command(\'compose\',\'%s\',this)" class="rcmContactAddress" title="%s">%s</a>',
$part['mailto'],
$JS_OBJECT_NAME,
$part['mailto'],
$part['mailto'],
rep_specialchars_output($part['name']));
if ($addicon)
$out .= sprintf('&nbsp;<a href="#add" onclick="return %s.command(\'add-contact\',\'%s\',this)" title="%s"><img src="%s%s" alt="add" border="0" /></a>',
$JS_OBJECT_NAME,
urlencode($part['string']),
rcube_label('addtoaddressbook'),
$CONFIG['skin_path'],
$addicon);
}
else
{
if ($part['name'])
$out .= rep_specialchars_output($part['name']);
if ($part['mailto'])
$out .= (strlen($out) ? ' ' : '') . sprintf('&lt;%s&gt;', $part['mailto']);
}
if ($c>$j)
$out .= ','.($max ? '&nbsp;' : ' ');
if ($max && $j==$max && $c>$j)
{
$out .= '...';
break;
}
}
return $out;
}
function rcmail_message_part_controls()
{
global $CONFIG, $IMAP, $MESSAGE;
if (!is_array($MESSAGE) || !is_array($MESSAGE['parts']) || !($_GET['_uid'] && $_GET['_part']) || !$MESSAGE['parts'][$_GET['_part']])
return '';
$part = $MESSAGE['parts'][$_GET['_part']];
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'cellspacing', 'cellpadding', 'border', 'summary'));
$out = '<table '. $attrib_str . ">\n";
$filename = $part->d_parameters['filename'] ? $part->d_parameters['filename'] : $part->ctype_parameters['name'];
$filesize = strlen($IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']));
if ($filename)
{
$out .= sprintf('<tr><td class="title">%s</td><td>%s</td><td>[<a href="./?%s">%s</a>]</tr>'."\n",
rcube_label('filename'),
rep_specialchars_output($filename),
str_replace('_frame=', '_download=', $_SERVER['QUERY_STRING']),
rcube_label('download'));
}
if ($filesize)
$out .= sprintf('<tr><td class="title">%s</td><td>%s</td></tr>'."\n",
rcube_label('filesize'),
show_bytes($filesize));
$out .= "\n</table>";
return $out;
}
function rcmail_message_part_frame($attrib)
{
global $MESSAGE;
$part = $MESSAGE['parts'][$_GET['_part']];
$ctype_primary = strtolower($part->ctype_primary);
$attrib['src'] = './?'.str_replace('_frame=', ($ctype_primary=='text' ? '_show=' : '_preload='), $_SERVER['QUERY_STRING']);
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'src', 'width', 'height'));
$out = '<iframe '. $attrib_str . "></ifame>";
return $out;
}
// create temp dir for attachments
function rcmail_create_compose_tempdir()
{
global $CONFIG;
if ($_SESSION['compose']['temp_dir'])
return $_SESSION['compose']['temp_dir'];
if (!empty($CONFIG['temp_dir']))
$temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '').$_SESSION['compose']['id'];
// create temp-dir for uploaded attachments
if (!empty($CONFIG['temp_dir']) && is_writeable($CONFIG['temp_dir']))
{
mkdir($temp_dir);
$_SESSION['compose']['temp_dir'] = $temp_dir;
}
return $_SESSION['compose']['temp_dir'];
}
// clear message composing settings
function rcmail_compose_cleanup()
{
if (!isset($_SESSION['compose']))
return;
// remove attachment files from temp dir
if (is_array($_SESSION['compose']['attachments']))
foreach ($_SESSION['compose']['attachments'] as $attachment)
@unlink($attachment['path']);
// kill temp dir
if ($_SESSION['compose']['temp_dir'])
@rmdir($_SESSION['compose']['temp_dir']);
unset($_SESSION['compose']);
}
?>
diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index 86b9bb7fe..dd321f0d8 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -1,185 +1,249 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/settings/manage_folders.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Provide functionality to create/delete/rename folders |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
-// init IAMP connection
+// init IMAP connection
rcmail_imap_init(TRUE);
// subscribe to one or more mailboxes
if ($_action=='subscribe')
{
if (strlen($_GET['_mboxes']))
$IMAP->subscribe(array($_GET['_mboxes']));
if ($REMOTE_REQUEST)
rcube_remote_response('// subscribed');
}
// unsubscribe one or more mailboxes
else if ($_action=='unsubscribe')
{
if (strlen($_GET['_mboxes']))
$IMAP->unsubscribe(array($_GET['_mboxes']));
if ($REMOTE_REQUEST)
rcube_remote_response('// unsubscribed');
}
// create a new mailbox
else if ($_action=='create-folder')
{
if (!empty($_GET['_name']))
$create = $IMAP->create_mailbox(trim(get_input_value('_name', RCUBE_INPUT_GET)), TRUE);
if ($create && $REMOTE_REQUEST)
{
$commands = sprintf("this.add_folder_row('%s')", rep_specialchars_output($create, 'js'));
rcube_remote_response($commands);
}
else if (!$create && $REMOTE_REQUEST)
{
$commands = show_message('errorsaving', 'error');
rcube_remote_response($commands);
}
else if (!$create)
show_message('errorsaving', 'error');
}
+// rename a mailbox
+else if ($_action=='rename-folder')
+ {
+ if (!empty($_GET['_folder_oldname']) && !empty($_GET['_folder_newname']))
+ $rename = $IMAP->rename_mailbox(get_input_value('_folder_oldname', RCUBE_INPUT_GET), trim(get_input_value('_folder_newname', RCUBE_INPUT_GET)), TRUE);
+
+ if ($rename && $REMOTE_REQUEST)
+ {
+ $commands = sprintf("this.add_folder_row('%s');", rep_specialchars_output($rename, 'js'));
+ $commands .= sprintf("this.remove_folder_row('%s')", rep_specialchars_output($_GET['_folder_oldname'], 'js'));
+ rcube_remote_response($commands);
+ }
+ else if (!$rename && $REMOTE_REQUEST)
+ {
+ $commands = show_message('errorsaving', 'error');
+ rcube_remote_response($commands);
+ }
+ else if (!$rename)
+ show_message('errorsaving', 'error');
+ }
+
// delete an existing IMAP mailbox
else if ($_action=='delete-folder')
{
if (strlen($_GET['_mboxes']))
$deleted = $IMAP->delete_mailbox(array($_GET['_mboxes']));
if ($REMOTE_REQUEST && $deleted)
rcube_remote_response(sprintf("this.remove_folder_row('%s')", rep_specialchars_output($_GET['_mboxes'], 'js')));
else if ($REMOTE_REQUEST)
{
$commands = show_message('errorsaving', 'error');
rcube_remote_response($commands);
}
}
// build table with all folders listed by server
function rcube_subscription_form($attrib)
{
global $IMAP, $CONFIG, $OUTPUT, $JS_OBJECT_NAME;
list($form_start, $form_end) = get_form_tags($attrib, 'folders');
unset($attrib['form']);
if (!$attrib['id'])
$attrib['id'] = 'rcmSubscriptionlist';
// allow the following attributes to be added to the <table> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
$out = "$form_start\n<table" . $attrib_str . ">\n";
// add table header
$out .= "<thead><tr>\n";
$out .= sprintf('<td>%s</td><td>%s</td><td></td>', rcube_label('foldername'), rcube_label('subscribed'));
$out .= "\n</tr></thead>\n<tbody>\n";
// get folders from server
$a_unsubscribed = $IMAP->list_unsubscribed();
$a_subscribed = $IMAP->list_mailboxes();
$a_js_folders = array();
$checkbox_subscribe = new checkbox(array('name' => '_subscribed[]', 'onclick' => "$JS_OBJECT_NAME.command(this.checked?'subscribe':'unsubscribe',this.value)"));
if ($attrib['deleteicon'])
$button = sprintf('<img src="%s%s" alt="%s" border="0" />', $CONFIG['skin_path'], $attrib['deleteicon'], rcube_label('delete'));
else
$button = rcube_label('delete');
// create list of available folders
foreach ($a_unsubscribed as $i => $folder)
{
+ if ($CONFIG['protect_default_folders'] == TRUE && in_array($folder,$CONFIG['default_imap_folders']))
+ continue;
+
$zebra_class = $i%2 ? 'even' : 'odd';
$folder_js = rep_specialchars_output($folder, 'js');
$a_js_folders['rcmrow'.($i+1)] = $folder_js;
$out .= sprintf('<tr id="rcmrow%d" class="%s"><td>%s</td><td>%s</td><td><a href="#delete" onclick="%s.command(\'delete-folder\',\'%s\')" title="%s">%s</a></td>',
$i+1,
$zebra_class,
rep_specialchars_output(rcube_charset_convert($folder, 'UTF-7', 'UTF-8'), 'html', 'all'),
$checkbox_subscribe->show(in_array($folder, $a_subscribed)?$folder:'', array('value' => $folder)),
$JS_OBJECT_NAME,
$folder_js,
rcube_label('deletefolder'),
$button);
$out .= "</tr>\n";
}
$out .= "</tbody>\n</table>";
$out .= "\n$form_end";
$javascript = sprintf("%s.gui_object('subscriptionlist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']);
$javascript .= sprintf("%s.set_env('subscriptionrows', %s);", $JS_OBJECT_NAME, array2js($a_js_folders));
$OUTPUT->add_script($javascript);
return $out;
}
function rcube_create_folder_form($attrib)
{
global $JS_OBJECT_NAME;
list($form_start, $form_end) = get_form_tags($attrib, 'create-folder');
unset($attrib['form']);
// return the complete edit form as table
$out = "$form_start\n";
$input = new textfield(array('name' => '_folder_name'));
$out .= $input->show();
if (get_boolean($attrib['button']))
{
$button = new input_field(array('type' => 'button',
'value' => rcube_label('create'),
'onclick' => "$JS_OBJECT_NAME.command('create-folder',this.form)"));
$out .= $button->show();
}
$out .= "\n$form_end";
return $out;
}
+function rcube_rename_folder_form($attrib)
+ {
+ global $CONFIG, $IMAP, $JS_OBJECT_NAME;
+
+ list($form_start, $form_end) = get_form_tags($attrib, 'rename-folder');
+ unset($attrib['form']);
+
+ // return the complete edit form as table
+ $out = "$form_start\n";
+
+ $a_unsubscribed = $IMAP->list_unsubscribed();
+ $select_folder = new select(array('name' => '_folder_oldname', 'id' => 'rcmfd_oldfolder'));
+
+ foreach ($a_unsubscribed as $i => $folder)
+ {
+ if ($CONFIG['protect_default_folders'] == TRUE && in_array($folder,$CONFIG['default_imap_folders']))
+ continue;
+
+ $select_folder->add($folder);
+ }
+
+ $out .= $select_folder->show();
+
+ $out .= " to ";
+ $inputtwo = new textfield(array('name' => '_folder_newname'));
+ $out .= $inputtwo->show();
+
+ if (get_boolean($attrib['button']))
+ {
+ $button = new input_field(array('type' => 'button',
+ 'value' => rcube_label('rename'),
+ 'onclick' => "$JS_OBJECT_NAME.command('rename-folder',this.form)"));
+ $out .= $button->show();
+ }
+
+ $out .= "\n$form_end";
+
+ return $out;
+ }
+
// add some labels to client
rcube_add_label('deletefolderconfirm');
parse_template('managefolders');
-?>
\ No newline at end of file
+?>
diff --git a/skins/default/common.css b/skins/default/common.css
index d133bec21..6cec3cf9e 100755
--- a/skins/default/common.css
+++ b/skins/default/common.css
@@ -1,297 +1,298 @@
/***** RoundCube|Mail basic styles *****/
body
{
margin: 8px;
background-color: #F6F6F6; /* #EBEBEB; */
color: #000000;
}
body.iframe
{
margin: 0px;
}
body.extwin
{
margin: 10px;
}
body, td, th, span, div, p, h3
{
font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
th
{
font-weight: normal;
}
h3
{
font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
font-size: 18px;
color: #000000;
}
a, a:active, a:visited
{
color: #000000;
+ outline: none;
}
a.button, a.button:visited, a.tab, a.tab:visited, a.axislist
{
color: #000000;
text-decoration: none;
}
a.tab
{
width: 80px;
display: block;
text-align: center;
}
hr
{
height: 1px;
background-color: #666666;
border-style: none;
}
input, textarea
{
font-size: 9pt;
font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
padding: 1px;
padding-left: 3px;
padding-right: 3px;
background-color: #ffffff;
border: 1px solid #666666;
}
input.button
{
height: 20px;
color: #333333;
font-size: 12px;
padding-left: 8px;
padding-right: 8px;
background: url(images/buttons/bg.gif) repeat-x #f0f0f0;
border: 1px solid #a4a4a4;
}
input.button:hover
{
color: black;
}
img
{
behavior: url('skins/default/pngbehavior.htc');
}
.alttext
{
font-size: 11px;
}
/** common user interface objects */
#header
{
position: absolute;
top: 10px;
left: 20px;
width: 170px;
height: 40px;
z-index: 100;
}
#taskbar
{
position: absolute;
top: 0px;
right: 0px;
width: 600px;
height: 37px;
background: url(images/taskbar.gif) top right no-repeat;
padding: 10px 24px 0px 0px;
text-align: right;
white-space: nowrap;
z-index: 2;
}
#taskbar a,
#taskbar a:active,
#taskbar a:visited
{
font-size: 11px;
color: #666666;
text-decoration: none;
padding: 6px 16px 6px 30px;
background-repeat: no-repeat;
}
#taskbar a:hover
{
color: #333333;
}
a.button-mail
{
background-image: url(images/buttons/mail.gif);
}
a.button-addressbook
{
background-image: url(images/buttons/addressbook.gif);
}
a.button-settings
{
background-image: url(images/buttons/settings.gif);
}
a.button-logout
{
background-image: url(images/buttons/logout.gif);
}
#message
{
position: absolute;
display: none;
top: -1px;
left: 200px;
right: 200px;
z-index: 5000;
opacity: 0.85;
}
#message div
{
width: 400px;
margin: 0px auto;
height: 24px;
min-height: 24px;
padding: 8px 10px 8px 46px;
}
#message div.notice,
#remote-objects-message
{
background: url(images/display/info.png) 6px 3px no-repeat;
background-color: #F7FDCB;
border: 1px solid #C2D071;
}
#message div.error,
#message div.warning
{
background: url(images/display/warning.png) 6px 3px no-repeat;
background-color: #EF9398;
border: 1px solid #DC5757;
}
#message div.confirmation
{
background: url(images/display/confirm.png) 6px 3px no-repeat;
background-color: #A6EF7B;
border: 1px solid #76C83F;
}
#message div.loading
{
background: url(images/display/loading.gif) 6px 3px no-repeat;
background-color: #EBEBEB;
border: 1px solid #CCCCCC;
}
/***** common table settings ******/
table.records-table thead tr td
{
height: 20px;
padding: 0px 4px 0px 4px;
vertical-align: middle;
border-bottom: 1px solid #999999;
color: #333333;
background-color: #EBEBEB;
background-image: url(images/listheader_aqua.gif);
font-size: 11px;
font-weight: bold;
}
table.records-table tbody tr td
{
height: 16px;
padding: 2px 4px 2px 4px;
font-size: 11px;
white-space: nowrap;
border-bottom: 1px solid #EBEBEB;
overflow: hidden;
text-align: left;
}
table.records-table tr
{
background-color: #FFFFFF;
}
table.records-table tr.selected td
{
font-weight: bold;
color: #FFFFFF;
background-color: #CC3333;
}
/***** roundcube webmail pre-defined classes *****/
a.rcmContactAddress
{
text-decoration: none;
}
a.rcmContactAddress:hover
{
text-decoration: underline;
}
#rcmKSearchpane
{
background-color: #F9F9F9;
border: 1px solid #CCCCCC;
}
#rcmKSearchpane ul
{
margin: 0px;
padding: 2px;
list-style-image: none;
list-style-type: none;
}
#rcmKSearchpane ul li
{
height: 16px;
font-size: 11px;
padding-left: 8px;
padding-top: 2px;
padding-right: 8px;
white-space: nowrap;
}
#rcmKSearchpane ul li.selected
{
color: #ffffff;
background-color: #CC3333;
}
diff --git a/skins/default/images/buttons/add_contact_sel.png b/skins/default/images/buttons/add_contact_sel.png
new file mode 100644
index 000000000..effa91ae5
Binary files /dev/null and b/skins/default/images/buttons/add_contact_sel.png differ
diff --git a/skins/default/images/buttons/add_sel.png b/skins/default/images/buttons/add_sel.png
new file mode 100644
index 000000000..a6d8197d8
Binary files /dev/null and b/skins/default/images/buttons/add_sel.png differ
diff --git a/skins/default/images/buttons/attach_sel.png b/skins/default/images/buttons/attach_sel.png
new file mode 100644
index 000000000..81a4700d0
Binary files /dev/null and b/skins/default/images/buttons/attach_sel.png differ
diff --git a/skins/default/images/buttons/back_sel.png b/skins/default/images/buttons/back_sel.png
new file mode 100644
index 000000000..b25acbf2d
Binary files /dev/null and b/skins/default/images/buttons/back_sel.png differ
diff --git a/skins/default/images/buttons/compose_sel.png b/skins/default/images/buttons/compose_sel.png
new file mode 100644
index 000000000..2efd8cb90
Binary files /dev/null and b/skins/default/images/buttons/compose_sel.png differ
diff --git a/skins/default/images/buttons/contacts_sel.png b/skins/default/images/buttons/contacts_sel.png
new file mode 100644
index 000000000..20df77cad
Binary files /dev/null and b/skins/default/images/buttons/contacts_sel.png differ
diff --git a/skins/default/images/buttons/delete_sel.png b/skins/default/images/buttons/delete_sel.png
new file mode 100644
index 000000000..b4c32c151
Binary files /dev/null and b/skins/default/images/buttons/delete_sel.png differ
diff --git a/skins/default/images/buttons/download_sel.png b/skins/default/images/buttons/download_sel.png
new file mode 100644
index 000000000..cfc44b302
Binary files /dev/null and b/skins/default/images/buttons/download_sel.png differ
diff --git a/skins/default/images/buttons/drafts_sel.png b/skins/default/images/buttons/drafts_sel.png
new file mode 100644
index 000000000..34419b833
Binary files /dev/null and b/skins/default/images/buttons/drafts_sel.png differ
diff --git a/skins/default/images/buttons/edit_contact_sel.png b/skins/default/images/buttons/edit_contact_sel.png
new file mode 100644
index 000000000..616d5838e
Binary files /dev/null and b/skins/default/images/buttons/edit_contact_sel.png differ
diff --git a/skins/default/images/buttons/forward_sel.png b/skins/default/images/buttons/forward_sel.png
new file mode 100644
index 000000000..90f67bb57
Binary files /dev/null and b/skins/default/images/buttons/forward_sel.png differ
diff --git a/skins/default/images/buttons/inbox_sel.png b/skins/default/images/buttons/inbox_sel.png
new file mode 100644
index 000000000..89d661e77
Binary files /dev/null and b/skins/default/images/buttons/inbox_sel.png differ
diff --git a/skins/default/images/buttons/next_sel.png b/skins/default/images/buttons/next_sel.png
new file mode 100644
index 000000000..77cb1b106
Binary files /dev/null and b/skins/default/images/buttons/next_sel.png differ
diff --git a/skins/default/images/buttons/previous_sel.png b/skins/default/images/buttons/previous_sel.png
new file mode 100644
index 000000000..d102a5345
Binary files /dev/null and b/skins/default/images/buttons/previous_sel.png differ
diff --git a/skins/default/images/buttons/print_sel.png b/skins/default/images/buttons/print_sel.png
new file mode 100644
index 000000000..0ddaa3162
Binary files /dev/null and b/skins/default/images/buttons/print_sel.png differ
diff --git a/skins/default/images/buttons/reply_sel.png b/skins/default/images/buttons/reply_sel.png
new file mode 100644
index 000000000..76f5eac9e
Binary files /dev/null and b/skins/default/images/buttons/reply_sel.png differ
diff --git a/skins/default/images/buttons/replyall_sel.png b/skins/default/images/buttons/replyall_sel.png
new file mode 100644
index 000000000..483436cd0
Binary files /dev/null and b/skins/default/images/buttons/replyall_sel.png differ
diff --git a/skins/default/images/buttons/send_sel.png b/skins/default/images/buttons/send_sel.png
new file mode 100644
index 000000000..fc3d1337d
Binary files /dev/null and b/skins/default/images/buttons/send_sel.png differ
diff --git a/skins/default/images/buttons/source_sel.png b/skins/default/images/buttons/source_sel.png
new file mode 100644
index 000000000..4749317ff
Binary files /dev/null and b/skins/default/images/buttons/source_sel.png differ
diff --git a/skins/default/images/buttons/spellcheck_sel.png b/skins/default/images/buttons/spellcheck_sel.png
new file mode 100644
index 000000000..8c24d6fae
Binary files /dev/null and b/skins/default/images/buttons/spellcheck_sel.png differ
diff --git a/skins/default/templates/addressbook.html b/skins/default/templates/addressbook.html
index 96b5fbcbe..dcf965604 100644
--- a/skins/default/templates/addressbook.html
+++ b/skins/default/templates/addressbook.html
@@ -1,37 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/addresses.css" />
</head>
<body>
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<div id="abooktoolbar">
-<roundcube:button command="add" imageAct="/images/buttons/add_contact_act.png" imagePas="/images/buttons/add_contact_pas.png" width="32" height="32" title="newcontact" />
-<roundcube:button command="delete" imageAct="/images/buttons/delete_act.png" imagePas="/images/buttons/delete_pas.png" width="32" height="32" title="deletecontact" />
-<roundcube:button command="compose" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="composeto" />
-<roundcube:button command="print" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="print" />
-<roundcube:button command="export" imageAct="/images/buttons/download_act.png" imagePas="/images/buttons/download_pas.png" width="32" height="32" title="export" />
-<roundcube:button command="ldappublicsearch" imageAct="/images/buttons/contacts_act.png" imagePas="/images/buttons/contacts_pas.png" width="32" height="32" title="ldapsearch" />
+<roundcube:button command="add" imageSel="/images/buttons/add_contact_sel.png" imageAct="/images/buttons/add_contact_act.png" imagePas="/images/buttons/add_contact_pas.png" width="32" height="32" title="newcontact" />
+<roundcube:button command="delete" imageSel="/images/buttons/delete_sel.png" imageAct="/images/buttons/delete_act.png" imagePas="/images/buttons/delete_pas.png" width="32" height="32" title="deletecontact" />
+<roundcube:button command="compose" imageSel="/images/buttons/compose_sel.png" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="composeto" />
+<roundcube:button command="print" imageSel="/images/buttons/print_sel.png" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="print" />
+<roundcube:button command="export" imageSel="/images/buttons/download_sel.png" imageAct="/images/buttons/download_act.png" imagePas="/images/buttons/download_pas.png" width="32" height="32" title="export" />
+<roundcube:button command="ldappublicsearch" imageSel="/images/buttons/contacts_sel.png" imageAct="/images/buttons/contacts_act.png" imagePas="/images/buttons/contacts_pas.png" width="32" height="32" title="ldapsearch" />
</div>
<div id="abookcountbar">
-<roundcube:button command="previouspage" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previouspage" />
+<roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previouspage" />
&nbsp;<roundcube:object name="recordsCountDisplay" />&nbsp;
-<roundcube:button command="nextpage" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextpage" />
+<roundcube:button command="nextpage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextpage" />
</div>
<div id="addresslist">
<roundcube:object name="addresslist" id="contacts-table" class="records-table" cellspacing="0" summary="Contacts list" />
</div>
<div id="contacts-box">
<roundcube:object name="addressframe" id="contact-frame" width="100%" height="100%" frameborder="0" src="/watermark.html" />
</div>
</body>
</html>
diff --git a/skins/default/templates/compose.html b/skins/default/templates/compose.html
index 0544d7ab6..ab8b0ced0 100644
--- a/skins/default/templates/compose.html
+++ b/skins/default/templates/compose.html
@@ -1,142 +1,142 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="productname" /> :: <roundcube:label name="compose" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/mail.css" />
<link rel="stylesheet" type="text/css" href="/googiespell.css" />
<script type="text/javascript">
<!--
function rcmail_toggle_display(id)
{
var row, disp;
if (row = document.getElementById(id))
{
disp = (!row.style.display || row.style.display=='none') ? ((document.all && !window.opera) ? 'block' : 'table-row') : 'none';
row.style.display = disp;
}
return false;
}
function rcmail_auto_save()
{
rcmail.command('savedraft','',this);
self.setTimeout('rcmail_auto_save()',300000);
}
self.setTimeout('rcmail_auto_save()',300000);
//-->
</script>
</head>
<body>
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<form name="form" action="./" method="post">
<div id="messagetoolbar">
-<roundcube:button command="list" image="/images/buttons/back_act.png" width="32" height="32" title="backtolist" />
-<roundcube:button command="send" imageAct="/images/buttons/send_act.png" imagePas="/images/buttons/send_pas.png" width="32" height="32" title="sendmessage" />
-<!--<roundcube:button command="contacts" imageAct="/images/buttons/contacts_act.png" imagePas="/images/buttons/contacts_pas.png" width="32" height="32" title="addressbook" />-->
-<roundcube:button command="spellcheck" imageAct="/images/buttons/spellcheck_act.png" imagePas="/images/buttons/spellcheck_pas.png" width="32" height="32" title="checkspelling" />
-<roundcube:button command="add-attachment" imageAct="/images/buttons/attach_act.png" imagePas="/images/buttons/attach_pas.png" width="32" height="32" title="addattachment" />
-<roundcube:button command="savedraft" imageAct="/images/buttons/drafts_act.png" imagePas="/images/buttons/drafts_pas.png" width="32" height="32" title="savemessage" />
+<roundcube:button command="list" image="/images/buttons/back_act.png" imageSel="/images/buttons/back_sel.png" imageAct="/images/buttons/back_act.png" width="32" height="32" title="backtolist" />
+<roundcube:button command="send" imageSel="/images/buttons/send_sel.png" imageAct="/images/buttons/send_act.png" imagePas="/images/buttons/send_pas.png" width="32" height="32" title="sendmessage" />
+<!--<roundcube:button command="contacts" imageSel="/images/buttons/contacts_sel.png" imageAct="/images/buttons/contacts_act.png" imagePas="/images/buttons/contacts_pas.png" width="32" height="32" title="addressbook" />-->
+<roundcube:button command="spellcheck" imageSel="/images/buttons/spellcheck_sel.png" imageAct="/images/buttons/spellcheck_act.png" imagePas="/images/buttons/spellcheck_pas.png" width="32" height="32" title="checkspelling" />
+<roundcube:button command="add-attachment" imageSel="/images/buttons/attach_sel.png" imageAct="/images/buttons/attach_act.png" imagePas="/images/buttons/attach_pas.png" width="32" height="32" title="addattachment" />
+<roundcube:button command="savedraft" imageSel="/images/buttons/drafts_sel.png" imageAct="/images/buttons/drafts_act.png" imagePas="/images/buttons/drafts_pas.png" width="32" height="32" title="savemessage" />
<div id="priority-selector">
<roundcube:label name="priority" />:&nbsp;<roundcube:object name="prioritySelector" form="form" />
</div>
<div id="receipt-selector">
<roundcube:object name="receiptCheckBox" form="form" />&nbsp;<roundcube:label name="returnreceipt" />
</div>
</div>
<div id="compose-container">
<table border="0" cellspacing="0" cellpadding="1" style="width:100%; height:100%;" summary=""><tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" id="compose-headers" summary=""><tr>
<td class="title"><roundcube:label name="from" /></td>
<td><roundcube:object name="composeHeaders" part="from" form="form" tabindex="1" /></td>
</tr><tr>
<td class="title top"><roundcube:label name="to" /></td>
<td><roundcube:object name="composeHeaders" part="to" form="form" cols="80" rows="2" tabindex="2" /></td>
<td class="add-button"><a href="#" onclick="return rcmail_toggle_display('compose-cc')">[Cc]</a><br />
<a href="#" onclick="return rcmail_toggle_display('compose-bcc')">[Bcc]</a><br /></td>
</tr><tr id="compose-cc">
<td class="title top"><roundcube:label name="cc" /></td>
<td><roundcube:object name="composeHeaders" part="cc" form="form" cols="80" rows="2" tabindex="3" /></td>
</tr><tr id="compose-bcc">
<td class="title top"><roundcube:label name="bcc" /></td>
<td><roundcube:object name="composeHeaders" part="bcc" form="form" cols="80" rows="2" tabindex="4" /></td>
</tr><tr id="compose-replyto">
<td class="title top"><roundcube:label name="replyto" /></td>
<td><roundcube:object name="composeHeaders" part="replyto" form="form" size="80" tabindex="5" /></td>
<!-- </tr><tr>
<td><roundcube:object name="composeAttachment" size="20" /></td> -->
</tr><tr>
<td class="title"><roundcube:label name="subject" /></td>
<td><roundcube:object name="composeSubject" id="compose-subject" form="form" tabindex="6" /></td>
</tr></table>
</td>
</tr><tr>
<td style="width:100%; height:95%; vertical-align:top;">
<roundcube:object name="composeBody" id="compose-body" form="form" cols="80" rows="20" wrap="virtual" tabindex="7" /><br />
<roundcube:label name="charset" />:&nbsp;<roundcube:object name="charsetSelector" tabindex="8" />
</td>
</tr></table>
</div>
<div id="compose-attachments">
<div><roundcube:label name="attachments" /></div>
<roundcube:object name="composeAttachmentList" />
-<p><roundcube:button command="add-attachment" imagePas="/images/buttons/add_pas.png" imageAct="/images/buttons/add_act.png" width="23" height="18" title="addattachment" />
+<p><roundcube:button command="add-attachment" imagePas="/images/buttons/add_pas.png" imageSel="/images/buttons/add_sel.png" imageAct="/images/buttons/add_act.png" width="23" height="18" title="addattachment" />
</div>
</form>
<roundcube:object name="composeAttachmentForm" id="attachment-form" />
<script type="text/javascript">
<!--
var cc_field = document.form._cc;
if (cc_field && cc_field.value!='')
rcmail_toggle_display('compose-cc');
//-->
</script>
<!--
<div id="attachment-form">
<roundcube:object name="composeAttachment" size="20" /><br />
<input type="button" value="<roundcube:label name='close' />" onclick="rcmail_show_attachment_form(0)" />
<input type="button" value="<roundcube:label name='send' />" onclick="rcmail.command('send-attachment', this)" />
</div>
-->
</body>
</html>
diff --git a/skins/default/templates/mail.html b/skins/default/templates/mail.html
index 2e8f38b4d..c2e5316eb 100644
--- a/skins/default/templates/mail.html
+++ b/skins/default/templates/mail.html
@@ -1,63 +1,64 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/mail.css" />
</head>
<body>
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<div id="messagetoolbar">
-<roundcube:button command="compose" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" />
-<roundcube:button command="reply" imageAct="/images/buttons/reply_act.png" imagePas="/images/buttons/reply_pas.png" width="32" height="32" title="replytomessage" />
-<roundcube:button command="reply-all" imageAct="/images/buttons/replyall_act.png" imagePas="/images/buttons/replyall_pas.png" width="32" height="32" title="replytoallmessage" />
-<roundcube:button command="forward" imageAct="/images/buttons/forward_act.png" imagePas="/images/buttons/forward_pas.png" width="32" height="32" title="forwardmessage" />
-<roundcube:button command="delete" imageAct="/images/buttons/delete_act.png" imagePas="/images/buttons/delete_pas.png" width="32" height="32" title="deletemessage" />
-<roundcube:button command="print" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="printmessage" />
+<roundcube:button command="checkmail" imageSel="/images/buttons/inbox_sel.png" imageAct="/images/buttons/inbox_act.png" imagePas="/images/buttons/inbox_pas.png" width="32" height="32" title="checkmail" />
+<roundcube:button command="compose" imageSel="/images/buttons/compose_sel.png" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" />
+<roundcube:button command="reply" imageSel="/images/buttons/reply_sel.png" imageAct="/images/buttons/reply_act.png" imagePas="/images/buttons/reply_pas.png" width="32" height="32" title="replytomessage" />
+<roundcube:button command="reply-all" imageSel="/images/buttons/replyall_sel.png" imageAct="/images/buttons/replyall_act.png" imagePas="/images/buttons/replyall_pas.png" width="32" height="32" title="replytoallmessage" />
+<roundcube:button command="forward" imageSel="/images/buttons/forward_sel.png" imageAct="/images/buttons/forward_act.png" imagePas="/images/buttons/forward_pas.png" width="32" height="32" title="forwardmessage" />
+<roundcube:button command="delete" imageSel="/images/buttons/delete_sel.png" imageAct="/images/buttons/delete_act.png" imagePas="/images/buttons/delete_pas.png" width="32" height="32" title="deletemessage" />
+<roundcube:button command="print" imageSel="/images/buttons/print_sel.png" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="printmessage" />
</div>
<div id="quicksearchbar">
<roundcube:object name="searchform" type="search" results="5" id="quicksearchbox" /><roundcube:button command="reset-search" id="searchreset" image="/images/icons/reset.gif" title="resetsearch" />
</div>
<div id="messagecountbar">
-<roundcube:button command="previouspage" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" />
+<roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" />
&nbsp;<roundcube:object name="messageCountDisplay" />&nbsp;
-<roundcube:button command="nextpage" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" />
+<roundcube:button command="nextpage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" />
</div>
<div id="mailboxlist-header"><roundcube:label name="mailboxlist" /></div>
<div id="mailboxlist-container"><roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" /></div>
<div id="mailboxcontrols">
<roundcube:label name="folder" />:&nbsp;
<roundcube:button command="expunge" label="compact" classAct="active" />&nbsp;
<roundcube:button command="purge" label="empty" classAct="active" />&nbsp;
</div>
<div id="mailcontframe">
<roundcube:object name="messages"
id="messagelist"
cellspacing="0"
summary="Message list"
messageIcon="/images/icons/dot.png"
unreadIcon="/images/icons/unread.png"
deletedIcon="/images/icons/deleted.png"
repliedIcon="/images/icons/replied.png"
attachmentIcon="/images/icons/attachment.png" />
</div>
<div id="listcontrols">
<roundcube:label name="select" />:&nbsp;
<roundcube:button command="select-all" label="all" classAct="active" />&nbsp;
<roundcube:button command="select-all" prop="unread" label="unread" classAct="active" />&nbsp;
<roundcube:button command="select-none" label="none" classAct="active" /> &nbsp;&nbsp;&nbsp;
<roundcube:label name="quota" />: <roundcube:object name="quotaDisplay" />
</div>
</body>
</html>
diff --git a/skins/default/templates/managefolders.html b/skins/default/templates/managefolders.html
index e3d6be0e1..a94d73848 100644
--- a/skins/default/templates/managefolders.html
+++ b/skins/default/templates/managefolders.html
@@ -1,38 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/settings.css" />
</head>
<body>
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<roundcube:include file="/includes/settingstabs.html" />
<form name="subscriptionform" action="./" onsubmit="rcmail.command('create-folder');return false;">
<div id="folder-manager">
<roundcube:object name="foldersubscription" form="subscriptionform" id="subscription-table"
cellpadding="1" cellspacing="0" summary="Folder subscription table"
deleteIcon="/images/icons/folder-trash.png" />
<div class="settingsbox">
<div class="boxtitle"><roundcube:label name="createfolder" /></div>
<div class="settingspart">
<roundcube:label name="foldername" />:&nbsp;
<roundcube:object name="createfolder" form="subscriptionform" />
<roundcube:button command="create-folder" type="input" class="button" label="create" />
</div>
</div>
+
+<div class="settingsbox">
+<div class="boxtitle"><roundcube:label name="renamefolder" /></div>
+
+<div class="settingspart">
+<roundcube:label name="foldername" />:&nbsp;
+<roundcube:object name="renamefolder" form="subscriptionform" />
+<roundcube:button command="rename-folder" type="input" class="button" label="rename" />
+</div>
+</div>
+
</div>
</form>
<roundcube:include file="/includes/settingscripts.html" />
</body>
</html>
diff --git a/skins/default/templates/message.html b/skins/default/templates/message.html
index d0540e7df..f802b5a54 100644
--- a/skins/default/templates/message.html
+++ b/skins/default/templates/message.html
@@ -1,42 +1,42 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/mail.css" />
</head>
<body>
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<div id="messagecountbar">
-<roundcube:button command="previousmessage" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" />
+<roundcube:button command="previousmessage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" />
&nbsp;<roundcube:object name="messageCountDisplay" />&nbsp;
-<roundcube:button command="nextmessage" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" />
+<roundcube:button command="nextmessage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" />
</div>
<div id="messagetoolbar">
-<roundcube:button command="list" image="/images/buttons/back_act.png" width="32" height="32" title="backtolist" />
-<roundcube:button command="compose" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" />
-<roundcube:button command="reply" imageAct="/images/buttons/reply_act.png" imagePas="/images/buttons/reply_pas.png" width="32" height="32" title="replytomessage" />
-<roundcube:button command="reply-all" imageAct="/images/buttons/replyall_act.png" imagePas="/images/buttons/replyall_pas.png" width="32" height="32" title="replytoallmessage" />
-<roundcube:button command="forward" imageAct="/images/buttons/forward_act.png" imagePas="/images/buttons/forward_pas.png" width="32" height="32" title="forwardmessage" />
-<roundcube:button command="delete" imageAct="/images/buttons/delete_act.png" imagePas="/images/buttons/delete_pas.png" width="32" height="32" title="deletemessage" />
-<roundcube:button command="print" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="printmessage" />
-<roundcube:button command="viewsource" imageAct="/images/buttons/source_act.png" imagePas="/images/buttons/source_pas.png" width="32" height="32" title="viewsource" />
+<roundcube:button command="list" image="/images/buttons/back_act.png" imageSel="/images/buttons/back_sel.png" imageAct="/images/buttons/back_act.png" width="32" height="32" title="backtolist" />
+<roundcube:button command="compose" imageSel="/images/buttons/compose_sel.png" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" />
+<roundcube:button command="reply" imageSel="/images/buttons/reply_sel.png" imageAct="/images/buttons/reply_act.png" imagePas="/images/buttons/reply_pas.png" width="32" height="32" title="replytomessage" />
+<roundcube:button command="reply-all" imageSel="/images/buttons/replyall_sel.png" imageAct="/images/buttons/replyall_act.png" imagePas="/images/buttons/replyall_pas.png" width="32" height="32" title="replytoallmessage" />
+<roundcube:button command="forward" imageSel="/images/buttons/forward_sel.png" imageAct="/images/buttons/forward_act.png" imagePas="/images/buttons/forward_pas.png" width="32" height="32" title="forwardmessage" />
+<roundcube:button command="delete" imageSel="/images/buttons/delete_sel.png" imageAct="/images/buttons/delete_act.png" imagePas="/images/buttons/delete_pas.png" width="32" height="32" title="deletemessage" />
+<roundcube:button command="print" imageSel="/images/buttons/print_sel.png" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="printmessage" />
+<roundcube:button command="viewsource" imageSel="/images/buttons/source_sel.png" imageAct="/images/buttons/source_act.png" imagePas="/images/buttons/source_pas.png" width="32" height="32" title="viewsource" />
<roundcube:object name="mailboxlist" type="select" noSelection="moveto" maxlength="25" onchange="rcmail.command('moveto', this.options[this.selectedIndex].value)" class="mboxlist" />
</div>
<div id="mailboxlist-header"><roundcube:label name="mailboxlist" /></div>
<div id="mailboxlist-container"><roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" /></div>
<div id="messageframe">
<roundcube:object name="messageHeaders" class="headers-table" cellspacing="0" cellpadding="2" addicon="/images/icons/plus.gif" summary="Message headers" />
<roundcube:object name="messageAttachments" id="attachment-list" />
<roundcube:object name="blockedObjects" id="remote-objects-message" />
<roundcube:object name="messageBody" id="messagebody" showImages="true" />
</div>
</body>
</html>

File Metadata

Mime Type
text/x-diff
Expires
Mon, Aug 17, 8:27 PM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1261608
Default Alt Text
(484 KB)

Event Timeline