]> git.donarmstrong.com Git - roundcube.git/commitdiff
Imported Upstream version 0.1~rc1~dfsg
authorJérémy Bobbio <lunar@debian.org>
Sat, 18 Jun 2011 14:57:50 +0000 (16:57 +0200)
committerJérémy Bobbio <lunar@debian.org>
Sat, 18 Jun 2011 14:57:50 +0000 (16:57 +0200)
164 files changed:
._CHANGELOG [deleted file]
CHANGELOG
INSTALL
README
SQL/mssql.initial.sql [new file with mode: 0755]
SQL/mysql.initial.sql
SQL/mysql.update-0.1a.sql [new file with mode: 0644]
SQL/mysql.update.sql
SQL/mysql5.initial.sql
SQL/postgres.initial.sql
SQL/postgres.update.sql [new file with mode: 0644]
SQL/sqlite.initial.sql
SQL/sqlite.update.sql [new file with mode: 0644]
UPGRADING
bin/html2text.php [new file with mode: 0644]
bin/quotaimg.php [new file with mode: 0644]
config/db.inc.php.dist
config/main.inc.php.dist
index.php
program/blocked.gif [new file with mode: 0644]
program/include/bugs.inc
program/include/main.inc
program/include/rcmail_template.inc [new file with mode: 0644]
program/include/rcube_contacts.inc [new file with mode: 0644]
program/include/rcube_db.inc
program/include/rcube_imap.inc
program/include/rcube_ldap.inc
program/include/rcube_mdb2.inc
program/include/rcube_shared.inc
program/include/rcube_smtp.inc
program/include/session.inc
program/js/app.js
program/js/common.js
program/js/googiespell.js
program/js/list.js [new file with mode: 0644]
program/lib/Mail/mime.php
program/lib/Mail/mimeDecode.php
program/lib/Mail/mimePart.php
program/lib/Net/SMTP.php
program/lib/encoding/ISO-8859-10.map [new file with mode: 0644]
program/lib/encoding/ISO-8859-11.map [new file with mode: 0644]
program/lib/encoding/ISO-8859-13.map [new file with mode: 0644]
program/lib/encoding/ISO-8859-14.map [new file with mode: 0644]
program/lib/encoding/ISO-8859-15.map [new file with mode: 0644]
program/lib/encoding/ISO-8859-16.map [new file with mode: 0644]
program/lib/html2text.inc
program/lib/imap.inc
program/lib/mime.inc
program/lib/rc_mail_mime.inc [new file with mode: 0644]
program/lib/utf7.inc
program/lib/utf8.class.php
program/localization/am/labels.inc [new file with mode: 0755]
program/localization/am/messages.inc [new file with mode: 0755]
program/localization/bg/labels.inc [new file with mode: 0644]
program/localization/bg/messages.inc [new file with mode: 0644]
program/localization/ca/labels.inc [new file with mode: 0644]
program/localization/ca/messages.inc [new file with mode: 0644]
program/localization/cz/labels.inc [new file with mode: 0755]
program/localization/cz/messages.inc [new file with mode: 0755]
program/localization/da/labels.inc [new file with mode: 0644]
program/localization/da/messages.inc [new file with mode: 0644]
program/localization/de_CH/labels.inc
program/localization/de_CH/messages.inc
program/localization/de_DE/labels.inc
program/localization/de_DE/messages.inc
program/localization/en_GB/labels.inc
program/localization/en_GB/messages.inc
program/localization/en_US/labels.inc
program/localization/en_US/messages.inc
program/localization/es/labels.inc
program/localization/es/messages.inc
program/localization/et_EE/labels.inc [new file with mode: 0644]
program/localization/et_EE/messages.inc [new file with mode: 0644]
program/localization/fr/labels.inc
program/localization/fr/messages.inc
program/localization/index.inc
program/localization/it/labels.inc [new file with mode: 0644]
program/localization/it/messages.inc [new file with mode: 0644]
program/localization/lt/labels.inc [new file with mode: 0644]
program/localization/lt/messages.inc [new file with mode: 0644]
program/localization/lv/labels.inc [new file with mode: 0644]
program/localization/lv/messages.inc [new file with mode: 0644]
program/localization/nb_NO/labels.inc [new file with mode: 0644]
program/localization/nb_NO/messages.inc [new file with mode: 0644]
program/localization/nl_NL/labels.inc [new file with mode: 0644]
program/localization/nl_NL/messages.inc [new file with mode: 0644]
program/localization/pt_BR/labels.inc
program/localization/pt_BR/messages.inc
program/localization/pt_PT/labels.inc
program/localization/pt_PT/messages.inc
program/localization/ro/labels.inc [new file with mode: 0644]
program/localization/ro/messages.inc [new file with mode: 0644]
program/localization/ru/labels.inc [new file with mode: 0755]
program/localization/ru/messages.inc [new file with mode: 0755]
program/localization/se/labels.inc [new file with mode: 0644]
program/localization/se/messages.inc [new file with mode: 0644]
program/localization/si/labels.inc [new file with mode: 0644]
program/localization/si/messages.inc [new file with mode: 0644]
program/localization/sk/labels.inc [new file with mode: 0644]
program/localization/sk/messages.inc [new file with mode: 0644]
program/localization/sl/labels.inc [new file with mode: 0755]
program/localization/sl/messages.inc [new file with mode: 0755]
program/localization/zh_TW/labels.inc [new file with mode: 0755]
program/localization/zh_TW/messages.inc [new file with mode: 0755]
program/steps/addressbook/copy.inc [new file with mode: 0644]
program/steps/addressbook/delete.inc
program/steps/addressbook/edit.inc
program/steps/addressbook/func.inc
program/steps/addressbook/ldapsearchform.inc [deleted file]
program/steps/addressbook/list.inc
program/steps/addressbook/mailto.inc [new file with mode: 0644]
program/steps/addressbook/save.inc
program/steps/addressbook/search.inc [new file with mode: 0644]
program/steps/addressbook/show.inc
program/steps/error.inc
program/steps/mail/addcontact.inc
program/steps/mail/check_recent.inc
program/steps/mail/compose.inc
program/steps/mail/folders.inc
program/steps/mail/func.inc
program/steps/mail/get.inc
program/steps/mail/getunread.inc
program/steps/mail/list.inc
program/steps/mail/mark.inc
program/steps/mail/move_del.inc
program/steps/mail/quotadisplay.inc [new file with mode: 0644]
program/steps/mail/rss.inc
program/steps/mail/search.inc
program/steps/mail/sendmail.inc
program/steps/mail/show.inc
program/steps/mail/spell.inc
program/steps/mail/upload.inc
program/steps/mail/viewsource.inc
program/steps/settings/delete_identity.inc
program/steps/settings/edit_identity.inc
program/steps/settings/func.inc
program/steps/settings/identities.inc
program/steps/settings/manage_folders.inc
program/steps/settings/save_identity.inc
program/steps/settings/save_prefs.inc
skins/default/addresses.css
skins/default/common.css
skins/default/images/buttons/first_act.png [new file with mode: 0644]
skins/default/images/buttons/first_pas.png [new file with mode: 0644]
skins/default/images/buttons/first_sel.png [new file with mode: 0644]
skins/default/images/buttons/last_act.png [new file with mode: 0644]
skins/default/images/buttons/last_pas.png [new file with mode: 0644]
skins/default/images/buttons/last_sel.png [new file with mode: 0644]
skins/default/images/dimple.png [new file with mode: 0644]
skins/default/ldapsearchform.css [deleted file]
skins/default/mail.css
skins/default/pngbehavior.htc
skins/default/print.css
skins/default/settings.css
skins/default/templates/addcontact.html
skins/default/templates/addressbook.html
skins/default/templates/compose.html
skins/default/templates/editcontact.html
skins/default/templates/ldappublicsearch.html [deleted file]
skins/default/templates/login.html
skins/default/templates/mail.html
skins/default/templates/message.html
skins/default/templates/messagepreview.html [new file with mode: 0644]
skins/default/templates/showcontact.html

diff --git a/._CHANGELOG b/._CHANGELOG
deleted file mode 100644 (file)
index 429e7b2..0000000
Binary files a/._CHANGELOG and /dev/null differ
index 89fa4442abdd39bbcae86d43949d5c1efabee3ff..2ab885f4bb1abcbfac5ee8723fc211094fd56a6e 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
 CHANGELOG RoundCube Webmail
 ---------------------------
 
-2007/01/15 (thomasb)
+2007/05/18 (thomasb)
 ----------
-- Applied path for wrong HTML message parsing
+- Use HTTP-POST requests for actions that change state
+
+
+2007/05/17 (thomasb)
+----------
+- Updated Catalan, Russian, Portuguese, Slovak and Chinese translations
+- Renamed localization folder for Chinese (Big5)
+- Chanegd Slovenian language code from 'si' to 'sl'
+- Added Sinhala (Sri-Lanka) localization
+- Use global filters and bind username/ for Ldap searches (#1484159)
+- Hide quota display if imap server does not support it
+- Hide address groups if no LDAP servers configured
+- Add link to message subjects (closes #1484257)
+- Better SQL query for contact listing/search (closes #1484369)
+
+
+2007/05/13 (thomasb)
+----------
+- Updated Norwegian (bokmal), Czech, Danish and Portuguese (standard) translation
+- Fixed marking as read in preview pane (closes #1484364)
+- CSS hack to display attachments correctly in IE6
+- Wrap message body text (closes #1484148)
+
+
+2007/05/03 (yllar)
+----------
+- Updated French, Lithuanian, Armenian, Spanish and Italian translations
+
+
+2007/05/01 (thomasb)
+----------
+- Updated German, Euskara, Hungarian, Romanian and Spanish translation
+- Added Hindi and Kurdish localization
+
+
+2007/04/28 (thomasb)
+----------
+- LDAP access is back in address book (closes #1484087)
+- Added search function for contacts
+- New Template parsing and output encoding
+- Fixed bugs #1484119 and #1483978
+
+
+2007/04/08 (thomasb)
+----------
+- Fixed message moving procedure (closes #1484308)
+- Fixed display of multiple attachments (closes #1466563)
+- Fixed check for new messages (closes #1484310)
+- List attachments without filename
+
+
+2007/03/27 (thomasb)
+----------
+- New session authentication: Change sessid cookie when login, authentication with sessauth cookie is now configurable.
+  Should close bugs #1483951 and #1484299
+
+
+2007/03/23 (thomasb)
+----------
+- Correctly translate mailbox names (closes #1484276)
+- Quote e-mail address links (closes #1484300)
+
+
+2007/03/21 (thomasb)
+----------
+- Updated PEAR::Mail_mime package
+- Added Persian localization
+- Updated Catalan and Brazilian Portuguese translations
+- Updated INSTALL manual with a note about database passwords
+- Accept single quotes for HTML attributes when modifying message body (thanks Jason)
+- Sanitize input for new users/identities (thanks Colin Alston)
+
+
+2007/03/19 (thomasb)
+----------
+- Don't download HTML message parts
+- Convert HTML parts to plaintext if 'prefer_html' is off
+- Correctly parse message/rfc822 parts (closes #1484045)
+- Code cleanup
+
+
+2007/03/18 (thomasb)
+----------
+- Also use user_id for unique key in messages table (closes #1484074)
+- Hide contacts drop down on blur (closes #1484203)
+- Make entries in contacts drop down clickable
+- Turn off browser autocompletion on login page
+- Quote <? in text/html message parts
+- Hide border around radio buttons
+- Replaced old JS function calls.
+
+
+2007/03/13 (thomasb)
+----------
+- Applied patch for attachment download by crichardson (closes #1484198)
+- Fixed bug in Postgres DB handling (closes #1484068)
+- Fixed bug of invalid calls to fetchRow() in rcube_db.inc (closes #1484280)
+- Fixed array_merge bug (closes #1484281)
+- Fixed flag for deletion in list view (closes #1484264)
+- Finally support semicolons as recipient separator (closes ##1484251)
+- Fixed message headers (subject) encoding
+
+
+2007/03/04 (tomekp)
+----------
+- check if safe mode is on or not (closes #1484269)
+
+
+2007/03/02 (thomasb)
+----------
+- Show "no subject" in message list if subject is missing (closes #1484243)
+- Solved page caching of message preview (closes #1484153)
+- Only use gzip compression if configured (closes #1484236)
+
+
+2007/02/25 (estadtherr)
+----------
+- Fixed priority selector issue (#1484150)
+- Upgraded to TinyMCE v2.1.0
+
+
+2007/02/21 (thomasb)
+----------
+- Fixed some CSS issues in default skin (closes #1484210 and #1484161)
+- Prevent from double quoting of numeric HTML character references (closes #1484253)
+
+
+2007/02/07 (tomekp)
+----------
+- Updated (bg) translation (Doichin Dokov)
+
+
+2007/02/06 (tomekp)
+----------
+- Updated (pl) translation
+- Updated (pt_BR) translation (Robson F. Ramaldes)
+- Big cleanup in program/localization
+
+
+2007/02/05 (thomasb)
+----------
+- Updated Italian, Slovenian, Greek, Bulgarian, Hungarian and Croatian translation
+
+
+2007/01/07 (estadtherr)
+----------
+- Fixed display of HTML message attachments (closes #1484178)
+
+
+2007/01/07 (thomasb)
+----------
+- Applied patch for preview caching (closes #1484186)
+- Added Thai and Vietnamese localization files
+
+
+2006/12/29 (thomasb)
+----------
+- Added error handling for attachment uploads
+- Use multibyte safe string functions where necessary (closes #1483988)
+- Updated Swiss German localization (de_CH)
 
 
 2006/12/22 (thomasb)
 ----------
-- Applied security fixes for XSS vulnerabilites
+- Applied security patch to validate the submitted host value (by Kees Cook)
+- Applied security patch to validate input values when deleting contacts (by Kees Cook)
+- Applied security patch that sanitizes emoticon paths when attaching them (by Kees Cook)
+- Applied a patch to more aggressively sanitize a HTML message
+- Visualize blocked images in HTML messages
+
+
+2006/12/20 (thomasb)
+----------
+- Fixed wrong message listing when showing search results (closes #1484131)
+- Introduced functions Q() and JQ() as aliases for rep_specialchars_output()
+- Show remote images when opening HTML message part as attachment
+
+
+2006/12/17 (thomasb)
+----------
+- Added patch by Ryan Rittenhouse & David Glick for a resizeable preview pane
+
+
+2006/12/06 (thomasb)
+----------
+- Improve memory usage when sending mail (closes #1484098)
+- Mark messages as read once the preview is loaded (closes #1484132)
+- Include smtp final response in log (closes #1484081)
+
+
+2006/12/04 (thomasb)
+----------
+- Corrected date string in sent message header (closes #1484125)
+- Correclty choose "To" column in sent and draft mailboxes (closes #1483943)
+- Changed srong tooltips for message browse buttons (closes #1483930)
+
+
+2006/12/03 (estadtherr)
+----------
+- Added fix to convert HTML signatures for plain text messages
+- Fixed signature delimeter character to be standard (Bug #1484035)
+
+
+2006/12/01 (thomasb)
+----------
+- Implemented preview pane
+- Fixed XSS vulnerability (Bug #1484109)
+- Remove newlines from mail headers (Bug #1484031)
+- Selection issues when moving/deleting (Bug #1484044)
+- Applied patch of Clement Moulin for imap host auto-selection
+- ISO-encode IMAP password for plaintext login (Bugs #1483977 & #1483886)
+- Fixed folder name encoding in subscription list (Bug #1484113)
+- Fixed JS errors in identity list (Bug #1484120)
+- Show client debug console on debug_level 8
+- Added Serbian translation
+- Updated Spanish and Bulgarian localization
+
+
+2006/11/22 (robin)
+----------
+- Fix a bug introduced with Shift-Del yesterday
+
+
+2006/11/21 (robin)
+----------
+- Add missing nl_NL translations
+- Translate foldernames in folder form (closes #1484113)
+
+
+2006/11/21 (robin)
+----------
+- Added first and last buttons to message list, address book
+  and message detail
+- Pressing Shift-Del bypasses Trash folder
+- Enable purge command for Junk folder
+
+
+2006/11/17 (robin)
+----------
+- Re-initialize message list after shift-select and delete
+
+
+2006/11/16 (robin)
+----------
+- Fixed updating message list after expunge and purge
+- Fetch all aliases if virtuser_query is used instead
+  of only the first one
+
+
+2006/11/11 (estadtherr)
+----------
+- fixed deletion/moving of messages from within "show" page
+
+
+2006/11/09 (thomasb)
+----------
+- Little bugfix in HTML encoding
+- Fixed encoding issues and delete-on-reply problem
+- Corrected template parsing
+
+
+2006/11/07 (estadtherr)
+----------
+- Upgraded to TinyMCE v2.0.8
+- Fixed CSS path for editor popups
+
+2006/09/26 (estadtherr)
+----------
+- Added spellchecker plugin to TinyMCE configuration
+- Fixed HTML/Plain toggle labels
+
+
+2006/09/24 (thomasb)
+----------
+- Partial client re-write with a common list class
+- Re-enabled multi select of contacts (Bug #1484017)
+- Enable contact editing right after creation (Bug #1459641)
+- Updated Hungarian, Estonian and Traditional Chinese localization
+
+
+2006/09/19 (thomasb)
+----------
+- Correct UTF-7 to UTF-8 conversion if mbstring is not available
+
+
+2006/09/13 (estadtherr)
+----------
+- Introduction of TinyMCE HTML editor support for message composition and signatures
+  Note : a new column is added to the "identities" database table
+
+
+2006/09/12 (estadtherr)
+----------
+- Fixed html2text treatment of table headers (Bug #1484020)
+- Fixed IMAP fetch of message body (Bug #1484019)
+
+
+2006/09/08 (thomasb)
+----------
+- Fixed safe_mode problems (Bug #1418381)
+- Fixed wrong header encoding (Bug #1483976)
+
+
+2006/09/07 (thomasb)
+----------
+- Made automatic draft saving configurable
+- Fixed JS bug when renaming folders (Bug #1483989)
+- Don't wait for complete page load when calling JavaScript init()
+- Some improvements to prevent session expiration
+- Prevent from double submit of spell check requests
+
+
+2006/09/01 (thomasb)
+----------
+- Imporoved message parsing and HTML validation
+- Added quota display as image (by Brett Patterson)
+- Corrected creation of a message-id
+- Updated Norwegian (bokmal) localization
+
+
+2006/08/30 (thomasb)
+----------
+- New indentation for quoted message text
+- Improved HTML validity
+
+
+2006/08/28 (estadtherr)
+----------
+- Fixed URL character set (Ticket #1445501)
+- Fixed saving of contact into MySQL from LDAP query results (Ticket #1483820)
+
+
+2006/08/25 (thomasb)
+----------
+- Fixed folder renaming: unsubscribe before rename (Bug #1483920)
+- Finalized new message parsing (+ chaching)
+- Updated SQL scripts and UPGRADING instructions
+
+
+2006/08/23 (thomasb)
+----------
+- Updated Polish, Portuguese, Latvian, Chinese and Japanese localization
+
+
+2006/08/20 (thomasb)
+----------
+- Fixed wrong usage of mbstring (Bug #1462439)
+- Set default spelling language (Ticket #1483938)
+- Added support for Nox Spell Server
+
+
+2006/08/18 (thomasb)
+----------
+- Re-built message parsing (Bug #1327068)
+  Now based on the message structure delivered by the IMAP server.
+- Fixed some XSS and SQL injection issues
+
+
+2006/08/10 (thomasb)
+----------
+- Fixed charset problems with folder renaming
 
 
 2006/08/04 (thomasb)
diff --git a/INSTALL b/INSTALL
index 0c7e7cbbfeb62a9460e44109ad70c651d6ae86b9..ded4f2c06a901c6a074a72a38b0567ae76254a37 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -40,9 +40,9 @@ importing the table layout and granting the proper permissions to the
 roundcube user. Here is an example of that procedure:
 
 # mysql
-> CREATE DATABASE 'roundcubemail';
+> CREATE DATABASE roundcubemail;
 > GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
-        IDENTIFIED BY 'password';
+    IDENTIFIED BY 'password';
 > quit
 # mysql roundcubemail < SQL/mysql.initial.sql
 
@@ -53,13 +53,17 @@ For MySQL version 4.1 and up, it's recommended to create the database for
 RoundCube with utf-8 charset. Here's an example of the init procedure:
 
 # mysql
-> CREATE DATABASE 'roundcubemail' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+> CREATE DATABASE roundcubemail DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
 > GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
-        IDENTIFIED BY 'password';
+    IDENTIFIED BY 'password';
 > quit
 
 # mysql roundcubemail < SQL/mysql5.initial.sql
 
+Note: 'password' is the master password for the roundcube user. It is strongly
+recommended you replace this with a more secure password. Please keep in
+mind: You need to specify this password later in 'config/db.inc.php'.
+
 
 * SQLite
 --------
@@ -97,11 +101,13 @@ CONFIGURATION
 =============
 
 Change the files in config/* according your to environment and your needs.
-Details about the config paramaters can be found in the config files.
+Details about the config parameters can be found in the config files
+or in the wiki: http://trac.roundcube.net/trac.cgi/wiki/Howto_Config
 
 
 UPGRADING
 =========
+
 If you already have a previous version of RoundCube installed,
 please refer to the instructions in UPGRADING guide.
 
diff --git a/README b/README
index e8e065e5fd48c763dd37229171e927d7a0ebe590..f89b21d33fa269709edd489ec15d418b754b9171 100644 (file)
--- a/README
+++ b/README
@@ -1,22 +1,14 @@
 RoundCube Webmail (http://roundcube.net)
 
 
-ATTENTION
----------
-This is just a snapshot of the current CVS repository and is NOT A STABLE
-version of RoundCube. There have been major changes since the latest release
-so please read the update instructions carefully. It's not recommended to
-replace an existing installation of RoundCube with this version. Also using
-a separate database or this installation is highly recommended.
-
-
 Introduction:
 -------------
 RoundCube Webmail is a browser-based multilingual IMAP client with an
-application-like user interface. It provides full functionality you expect from
-an e-mail client, including MIME support, address book, folder manipulation and
-message filters. RoundCube Webmail is written in PHP and requires the MySQL
-database. The user interface is fully skinnable using XHTML and CSS 2.
+application-like user interface. It provides full functionality you expect
+from an e-mail client, including MIME support, address book, folder manipulation,
+message searching and spell checking. RoundCube Webmail is written in PHP and
+requires the MySQL or Postgres database. The user interface is fully skinnable
+using XHTML and CSS 2.
 
 This project is meant to be a modern webmail solution which is easy to
 install/configure and that runs on a standard PHP plus MySQL or Postgres
@@ -28,6 +20,18 @@ The current development skin uses icons designed by Stephen Horlander and Kevin
 Gerich for Mozilla.org.
 
 
+Installation:
+-------------
+For detailed instructions on how to install RoundCube webmail on your server,
+please refer to the INSTALL document in the same directory as this document.
+
+
+Licensing: 
+----------
+This product is distributed under the GPL. Please read through the file
+LICENSE for more information about our license.
+
+
 How it works:
 -------------
 The main authority for the RoundCube access is the IMAP server. If
@@ -41,38 +45,26 @@ will be allowed.
 
 Code Layout:
 ------------
-
 Basic sequence (index.php):
-  - index.php -> load_gui -> parse_template
+  - index.php -> rcmail_load_gui -> new rcmail_template -> rcmail_template::send
   - authentication details in this sequence
 
 Tasks
   - index.php limits tasks to set list
   - can see task in roundcube link when you mouse over it
   - task templates stored in skins/default/templates
-  - templates "roundcube:" tokens that get replaced in parse_template
+  - templates "roundcube:" tokens that get replaced in rcmail_template class
 
 program/include/rcube_shared.inc
   - defines rcube_html_page, class that lays out a roundcube web page
   - defines form control classes
-
-
-Installation:
--------------
-For detailed instructions on how to install RoundCube webmail on your server,
-please refer to the INSTALL document in the same directory as this document.
-
-
-Licensing: 
-----------
-This product is distributed under the GPL. Please read through the file
-LICENSE for more information about our license.
+  - provides common functions
 
 
 Contact:
 --------
 For any bug reports or feature requests please refer to the tracking system
-at sourceforge.net (http://sourceforge.net/tracker/?group_id=139281) or 
+at trac.roundcube.net (http://trac.roundcube.net/trac.cgi/report) or 
 subscribe to our mailing list. See http://www.roundcube.net/?p=mailinglists
 for details.
 
diff --git a/SQL/mssql.initial.sql b/SQL/mssql.initial.sql
new file mode 100755 (executable)
index 0000000..59916e8
--- /dev/null
@@ -0,0 +1,206 @@
+CREATE TABLE [dbo].[cache] (\r
+       [cache_id] [int] IDENTITY (1, 1) NOT NULL ,\r
+       [user_id] [int] NOT NULL ,\r
+       [session_id] [varchar] (32) COLLATE Latin1_General_CI_AI NULL ,\r
+       [cache_key] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [created] [datetime] NOT NULL ,\r
+       [data] [text] COLLATE Latin1_General_CI_AI NOT NULL \r
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\r
+GO\r
+\r
+CREATE TABLE [dbo].[contacts] (\r
+       [contact_id] [int] IDENTITY (1, 1) NOT NULL ,\r
+       [user_id] [int] NOT NULL ,\r
+       [changed] [datetime] NOT NULL ,\r
+       [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [email] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [firstname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [surname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [vcard] [text] COLLATE Latin1_General_CI_AI NULL \r
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\r
+GO\r
+\r
+CREATE TABLE [dbo].[identities] (\r
+       [identity_id] [int] IDENTITY (1, 1) NOT NULL ,\r
+       [user_id] [int] NOT NULL ,\r
+       [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [standard] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [organization] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [email] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [reply-to] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [bcc] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [signature] [text] COLLATE Latin1_General_CI_AI NOT NULL \r
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\r
+GO\r
+\r
+CREATE TABLE [dbo].[messages] (\r
+       [message_id] [int] IDENTITY (1, 1) NOT NULL ,\r
+       [user_id] [int] NOT NULL ,\r
+       [del] [tinyint] NOT NULL ,\r
+       [cache_key] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [created] [datetime] NOT NULL ,\r
+       [idx] [int] NOT NULL ,\r
+       [uid] [int] NOT NULL ,\r
+       [subject] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [from] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [to] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [cc] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [date] [datetime] NOT NULL ,\r
+       [size] [int] NOT NULL ,\r
+       [headers] [text] COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [structure] [text] COLLATE Latin1_General_CI_AI NULL \r
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\r
+GO\r
+\r
+CREATE TABLE [dbo].[session] (\r
+       [sess_id] [varchar] (32) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [created] [datetime] NOT NULL ,\r
+       [changed] [datetime] NULL ,\r
+       [ip] [varchar] (15) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [vars] [text] COLLATE Latin1_General_CI_AI NOT NULL \r
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\r
+GO\r
+\r
+CREATE TABLE [dbo].[users] (\r
+       [user_id] [int] IDENTITY (1, 1) NOT NULL ,\r
+       [username] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [mail_host] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [alias] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [created] [datetime] NOT NULL ,\r
+       [last_login] [datetime] NULL ,\r
+       [language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,\r
+       [preferences] [text] COLLATE Latin1_General_CI_AI NOT NULL \r
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\r
+GO\r
+\r
+ALTER TABLE [dbo].[cache] WITH NOCHECK ADD \r
+        PRIMARY KEY  CLUSTERED \r
+       (\r
+               [cache_id]\r
+       )  ON [PRIMARY] \r
+GO\r
+\r
+ALTER TABLE [dbo].[contacts] WITH NOCHECK ADD \r
+       CONSTRAINT [PK_contacts_contact_id] PRIMARY KEY  CLUSTERED \r
+       (\r
+               [contact_id]\r
+       )  ON [PRIMARY] \r
+GO\r
+\r
+ALTER TABLE [dbo].[identities] WITH NOCHECK ADD \r
+        PRIMARY KEY  CLUSTERED \r
+       (\r
+               [identity_id]\r
+       )  ON [PRIMARY] \r
+GO\r
+\r
+ALTER TABLE [dbo].[messages] WITH NOCHECK ADD \r
+        PRIMARY KEY  CLUSTERED \r
+       (\r
+               [message_id]\r
+       )  ON [PRIMARY] \r
+GO\r
+\r
+ALTER TABLE [dbo].[session] WITH NOCHECK ADD \r
+       CONSTRAINT [PK_session_sess_id] PRIMARY KEY  CLUSTERED \r
+       (\r
+               [sess_id]\r
+       )  ON [PRIMARY] \r
+GO\r
+\r
+ALTER TABLE [dbo].[users] WITH NOCHECK ADD \r
+       CONSTRAINT [PK_users_user_id] PRIMARY KEY  CLUSTERED \r
+       (\r
+               [user_id]\r
+       )  ON [PRIMARY] \r
+GO\r
+\r
+ALTER TABLE [dbo].[cache] ADD \r
+       CONSTRAINT [DF_cache_user_id] DEFAULT ('0') FOR [user_id],\r
+       CONSTRAINT [DF_cache_session_id] DEFAULT (null) FOR [session_id],\r
+       CONSTRAINT [DF_cache_cache_key] DEFAULT ('') FOR [cache_key],\r
+       CONSTRAINT [DF_cache_created] DEFAULT (getdate()) FOR [created]\r
+GO\r
+\r
+ CREATE  INDEX [IX_cache_user_id] ON [dbo].[cache]([user_id]) ON [PRIMARY]\r
+GO\r
+\r
+ CREATE  INDEX [IX_cache_cache_key] ON [dbo].[cache]([cache_key]) ON [PRIMARY]\r
+GO\r
+\r
+ CREATE  INDEX [IX_cache_session_id] ON [dbo].[cache]([session_id]) ON [PRIMARY]\r
+GO\r
+\r
+ALTER TABLE [dbo].[contacts] ADD \r
+       CONSTRAINT [DF_contacts_user_id] DEFAULT (0) FOR [user_id],\r
+       CONSTRAINT [DF_contacts_changed] DEFAULT (getdate()) FOR [changed],\r
+       CONSTRAINT [DF_contacts_del] DEFAULT ('0') FOR [del],\r
+       CONSTRAINT [DF_contacts_name] DEFAULT ('') FOR [name],\r
+       CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email],\r
+       CONSTRAINT [DF_contacts_firstname] DEFAULT ('') FOR [firstname],\r
+       CONSTRAINT [DF_contacts_surname] DEFAULT ('') FOR [surname],\r
+       CONSTRAINT [CK_contacts_del] CHECK ([del] = '1' or [del] = '0')\r
+GO\r
+\r
+ CREATE  INDEX [IX_contacts_user_id] ON [dbo].[contacts]([user_id]) ON [PRIMARY]\r
+GO\r
+\r
+ALTER TABLE [dbo].[identities] ADD \r
+       CONSTRAINT [DF_identities_user] DEFAULT ('0') FOR [user_id],\r
+       CONSTRAINT [DF_identities_del] DEFAULT ('0') FOR [del],\r
+       CONSTRAINT [DF_identities_standard] DEFAULT ('0') FOR [standard],\r
+       CONSTRAINT [DF_identities_name] DEFAULT ('') FOR [name],\r
+       CONSTRAINT [DF_identities_organization] DEFAULT ('') FOR [organization],\r
+       CONSTRAINT [DF_identities_email] DEFAULT ('') FOR [email],\r
+       CONSTRAINT [DF_identities_reply] DEFAULT ('') FOR [reply-to],\r
+       CONSTRAINT [DF_identities_bcc] DEFAULT ('') FOR [bcc],\r
+        CHECK ([standard] = '1' or [standard] = '0'),\r
+        CHECK ([del] = '1' or [del] = '0')\r
+GO\r
+\r
+ CREATE  INDEX [IX_identities_user_id] ON [dbo].[identities]([user_id]) ON [PRIMARY]\r
+GO\r
+\r
+ALTER TABLE [dbo].[messages] ADD \r
+       CONSTRAINT [DF_messages_user_id] DEFAULT (0) FOR [user_id],\r
+       CONSTRAINT [DF_messages_del] DEFAULT (0) FOR [del],\r
+       CONSTRAINT [DF_messages_cache_key] DEFAULT ('') FOR [cache_key],\r
+       CONSTRAINT [DF_messages_created] DEFAULT (getdate()) FOR [created],\r
+       CONSTRAINT [DF_messages_idx] DEFAULT (0) FOR [idx],\r
+       CONSTRAINT [DF_messages_uid] DEFAULT (0) FOR [uid],\r
+       CONSTRAINT [DF_messages_subject] DEFAULT ('') FOR [subject],\r
+       CONSTRAINT [DF_messages_from] DEFAULT ('') FOR [from],\r
+       CONSTRAINT [DF_messages_to] DEFAULT ('') FOR [to],\r
+       CONSTRAINT [DF_messages_cc] DEFAULT ('') FOR [cc],\r
+       CONSTRAINT [DF_messages_date] DEFAULT (getdate()) FOR [date],\r
+       CONSTRAINT [DF_messages_size] DEFAULT (0) FOR [size]\r
+GO\r
+\r
+ CREATE  INDEX [IX_messages_user_id] ON [dbo].[messages]([user_id]) ON [PRIMARY]\r
+GO\r
+\r
+ CREATE  INDEX [IX_messages_cache_key] ON [dbo].[messages]([cache_key]) ON [PRIMARY]\r
+GO\r
+\r
+ CREATE  INDEX [IX_messages_idx] ON [dbo].[messages]([idx]) ON [PRIMARY]\r
+GO\r
+\r
+ CREATE  INDEX [IX_messages_uid] ON [dbo].[messages]([uid]) ON [PRIMARY]\r
+GO\r
+\r
+ALTER TABLE [dbo].[session] ADD \r
+       CONSTRAINT [DF_session_sess_id] DEFAULT ('') FOR [sess_id],\r
+       CONSTRAINT [DF_session_created] DEFAULT (getdate()) FOR [created],\r
+       CONSTRAINT [DF_session_ip] DEFAULT ('') FOR [ip]\r
+GO\r
+\r
+ALTER TABLE [dbo].[users] ADD \r
+       CONSTRAINT [DF_users_username] DEFAULT ('') FOR [username],\r
+       CONSTRAINT [DF_users_mail_host] DEFAULT ('') FOR [mail_host],\r
+       CONSTRAINT [DF_users_alias] DEFAULT ('') FOR [alias],\r
+       CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created],\r
+       CONSTRAINT [DF_users_language] DEFAULT ('en') FOR [language]\r
+GO\r
+\r
index 7546e52da7645ce869106f744fe350c75d73ec69..4a92734d5bc5fee413a1b7060e9495f2f8acf25e 100644 (file)
@@ -1,5 +1,5 @@
 -- RoundCube Webmail initial database structure
--- Version 0.1beta2
+-- Version 0.1-rc1
 -- 
 
 -- --------------------------------------------------------
@@ -58,6 +58,7 @@ CREATE TABLE `identities` (
   `reply-to` varchar(128) NOT NULL default '',
   `bcc` varchar(128) NOT NULL default '',
   `signature` text NOT NULL,
+  `html_signature` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`identity_id`),
   KEY `user_id` (`user_id`)
 );
@@ -116,12 +117,12 @@ CREATE TABLE `messages` (
   `date` datetime NOT NULL default '0000-00-00 00:00:00',
   `size` int(11) unsigned NOT NULL default '0',
   `headers` text NOT NULL,
-  `body` longtext,
+  `structure` text,
   PRIMARY KEY  (`message_id`),
   KEY `user_id` (`user_id`),
-  KEY `cache_key` (`cache_key`),
   KEY `idx` (`idx`),
-  KEY `uid` (`uid`)
+  KEY `uid` (`uid`),
+  UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`)
 );
 
 
diff --git a/SQL/mysql.update-0.1a.sql b/SQL/mysql.update-0.1a.sql
new file mode 100644 (file)
index 0000000..054814a
--- /dev/null
@@ -0,0 +1,51 @@
+-- RoundCube Webmail update script for MySQL databases
+-- Updates from version 0.1-20051007
+
+
+ALTER TABLE `session` ADD `ip` VARCHAR(15) NOT NULL AFTER changed;
+ALTER TABLE `users` ADD `alias` VARCHAR(128) NOT NULL AFTER mail_host;
+
+
+
+-- RoundCube Webmail update script for MySQL databases
+-- Updates from version 0.1-20051021
+
+ALTER TABLE `session` CHANGE `sess_id` `sess_id` VARCHAR(40) NOT NULL;
+
+ALTER TABLE `contacts` CHANGE `del` `del` TINYINT(1) NOT NULL;
+ALTER TABLE `contacts` ADD `changed` DATETIME NOT NULL AFTER `user_id`;
+
+UPDATE `contacts`  SET `del`=0 WHERE `del`=1;
+UPDATE `contacts`  SET `del`=1 WHERE `del`=2;
+
+ALTER TABLE `identities` CHANGE `default` `standard` TINYINT(1) NOT NULL;
+ALTER TABLE `identities` CHANGE `del` `del` TINYINT(1) NOT NULL;
+
+UPDATE `identities`  SET `del`=0 WHERE `del`=1;
+UPDATE `identities`  SET `del`=1 WHERE `del`=2;
+UPDATE `identities`  SET `standard`=0 WHERE `standard`=1;
+UPDATE `identities`  SET `standard`=1 WHERE `standard`=2;
+
+CREATE TABLE `messages` (
+  `message_id` int(11) unsigned NOT NULL auto_increment,
+  `user_id` int(11) unsigned NOT NULL default '0',
+  `del` tinyint(1) NOT NULL default '0',
+  `cache_key` varchar(128) NOT NULL default '',
+  `created` datetime NOT NULL default '0000-00-00 00:00:00',
+  `idx` int(11) unsigned NOT NULL default '0',
+  `uid` int(11) unsigned NOT NULL default '0',
+  `subject` varchar(255) NOT NULL default '',
+  `from` varchar(255) NOT NULL default '',
+  `to` varchar(255) NOT NULL default '',
+  `cc` varchar(255) NOT NULL default '',
+  `date` datetime NOT NULL default '0000-00-00 00:00:00',
+  `size` int(11) unsigned NOT NULL default '0',
+  `headers` text NOT NULL,
+  `structure` text,
+  PRIMARY KEY  (`message_id`),
+  KEY `user_id` (`user_id`),
+  KEY `idx` (`idx`),
+  KEY `uid` (`uid`),
+  UNIQUE `uniqueness` (`cache_key`, `uid`)
+) TYPE=MyISAM;
+
index 7fa296b0bd2a0b3f40d8d00cdc9a874fc19bf0de..b64f407c71a1570b02efd41a5c68b5e4001f3c4b 100644 (file)
@@ -1,57 +1,17 @@
 -- RoundCube Webmail update script for MySQL databases
--- Updates from version 0.1-20051007
-
-
-ALTER TABLE `session` ADD `ip` VARCHAR(15) NOT NULL AFTER changed;
-ALTER TABLE `users` ADD `alias` VARCHAR(128) NOT NULL AFTER mail_host;
-
-
-
--- RoundCube Webmail update script for MySQL databases
--- Updates from version 0.1-20051021
-
-ALTER TABLE `session` CHANGE `sess_id` `sess_id` VARCHAR(40) NOT NULL;
-
-ALTER TABLE `contacts` CHANGE `del` `del` TINYINT(1) NOT NULL;
-ALTER TABLE `contacts` ADD `changed` DATETIME NOT NULL AFTER `user_id`;
-
-UPDATE `contacts`  SET `del`=0 WHERE `del`=1;
-UPDATE `contacts`  SET `del`=1 WHERE `del`=2;
-
-ALTER TABLE `identities` CHANGE `default` `standard` TINYINT(1) NOT NULL;
-ALTER TABLE `identities` CHANGE `del` `del` TINYINT(1) NOT NULL;
-
-UPDATE `identities`  SET `del`=0 WHERE `del`=1;
-UPDATE `identities`  SET `del`=1 WHERE `del`=2;
-UPDATE `identities`  SET `standard`=0 WHERE `standard`=1;
-UPDATE `identities`  SET `standard`=1 WHERE `standard`=2;
-
-CREATE TABLE `messages` (
-  `message_id` int(11) unsigned NOT NULL auto_increment,
-  `user_id` int(11) unsigned NOT NULL default '0',
-  `del` tinyint(1) NOT NULL default '0',
-  `cache_key` varchar(128) NOT NULL default '',
-  `created` datetime NOT NULL default '0000-00-00 00:00:00',
-  `idx` int(11) unsigned NOT NULL default '0',
-  `uid` int(11) unsigned NOT NULL default '0',
-  `subject` varchar(255) NOT NULL default '',
-  `from` varchar(255) NOT NULL default '',
-  `to` varchar(255) NOT NULL default '',
-  `cc` varchar(255) NOT NULL default '',
-  `date` datetime NOT NULL default '0000-00-00 00:00:00',
-  `size` int(11) unsigned NOT NULL default '0',
-  `headers` text NOT NULL,
-  `body` longtext,
-  PRIMARY KEY  (`message_id`),
-  KEY `user_id` (`user_id`),
-  KEY `cache_key` (`cache_key`),
-  KEY `idx` (`idx`),
-  KEY `uid` (`uid`)
-) TYPE=MyISAM;
-
-
-
--- RoundCube Webmail update script for MySQL databases
--- Updates from version 0.1-20051216
-
-ALTER TABLE `messages` ADD `created` DATETIME NOT NULL AFTER `cache_key` ;
+-- Updates from version 0.1-beta and 0.1-beta2
+
+ALTER TABLE `messages`
+  DROP `body`,
+  DROP INDEX `cache_key`,
+  ADD `structure` TEXT,
+  ADD UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`);
+
+ALTER TABLE `identities`
+  ADD `html_signature` tinyint(1) default 0 NOT NULL;
+
+-- Uncomment these lines if you're using MySQL 4.1 or higher
+-- ALTER TABLE `users`
+--  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci,
+--  CHANGE `username` `username` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+--  CHANGE `alias` `alias` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
index 0116468ee6316b7dc097dec7b7dab5998235f75c..0c0dcb199a2fcd990dc8636cd8f374717f3e66be 100644 (file)
@@ -1,6 +1,5 @@
 -- RoundCube Webmail initial database structure
--- Version 0.1beta2
--- 
+-- Version 0.1-rc1
 
 -- --------------------------------------------------------
 
@@ -16,7 +15,7 @@ CREATE TABLE `session` (
  `ip` varchar(15) NOT NULL,
  `vars` text NOT NULL,
  PRIMARY KEY(`sess_id`)
-) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+) TYPE=MYISAM CHARACTER SET ascii COLLATE ascii_general_ci;
 
 
 -- Table structure for table `users`
@@ -29,7 +28,7 @@ CREATE TABLE `users` (
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `language` varchar(5) NOT NULL DEFAULT 'en',
- `preferences` text NOT NULL,
+ `preferences` text NOT NULL DEFAULT '',
  PRIMARY KEY(`user_id`)
 ) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
 
@@ -38,8 +37,9 @@ CREATE TABLE `users` (
 
 CREATE TABLE `messages` (
  `message_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `del` tinyint(1) NOT NULL DEFAULT '0',
- `cache_key` varchar(128) NOT NULL,
+ `cache_key` varchar(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `idx` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
@@ -50,13 +50,12 @@ CREATE TABLE `messages` (
  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `size` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `headers` text NOT NULL,
- `body` longtext,
- `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `structure` text,
  PRIMARY KEY(`message_id`),
- INDEX `cache_key`(`cache_key`),
  INDEX `idx`(`idx`),
  INDEX `uid`(`uid`),
- CONSTRAINT `User_ID_FK_messages` FOREIGN KEY (`user_id`)
+ UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`),
+ CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
@@ -67,15 +66,15 @@ CREATE TABLE `messages` (
 
 CREATE TABLE `cache` (
  `cache_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `session_id` varchar(40),
- `cache_key` varchar(128) NOT NULL,
+ `session_id` varchar(40) CHARACTER SET ascii COLLATE ascii_general_ci,
+ `cache_key` varchar(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `data` longtext NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`cache_id`),
  INDEX `cache_key`(`cache_key`),
  INDEX `session_id`(`session_id`),
- CONSTRAINT `User_ID_FK_cache` FOREIGN KEY (`user_id`)
+ CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
@@ -92,10 +91,10 @@ CREATE TABLE `contacts` (
  `email` varchar(128) NOT NULL,
  `firstname` varchar(128) NOT NULL,
  `surname` varchar(128) NOT NULL,
- `vcard` text NOT NULL,
+ `vcard` text NULL,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`contact_id`),
- CONSTRAINT `User_ID_FK_contacts` FOREIGN KEY (`user_id`)
+ CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
@@ -114,13 +113,14 @@ CREATE TABLE `identities` (
  `reply-to` varchar(128) NOT NULL,
  `bcc` varchar(128) NOT NULL,
  `signature` text NOT NULL,
+ `html_signature` tinyint(1) NOT NULL DEFAULT '0',
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY(`identity_id`),
- CONSTRAINT `User_ID_FK_identities` FOREIGN KEY (`user_id`)
+ CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
 ) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
 
 
-SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
+SET FOREIGN_KEY_CHECKS=1;
index 55e139603af2d6d8c31b8af049b2072f2ddc8b49..bf82b9b5df1d1ec6b72ca30a57f779b4f7e142f3 100755 (executable)
@@ -69,7 +69,8 @@ CREATE TABLE identities (
     email character varying(128) NOT NULL,
     "reply-to" character varying(128),
     bcc character varying(128),
-    signature text
+    signature text,
+    html_signature integer DEFAULT 0 NOT NULL
 );
 
 
@@ -163,6 +164,7 @@ CREATE TABLE "messages" (
     date timestamp with time zone NOT NULL,
     size integer DEFAULT 0 NOT NULL,
     headers text NOT NULL,
-    body text
+    structure text
 );
 
+ALTER TABLE "messages" ADD UNIQUE (user_id, cache_key, uid);
diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql
new file mode 100644 (file)
index 0000000..8f70548
--- /dev/null
@@ -0,0 +1,9 @@
+-- RoundCube Webmail update script for Postres databases
+-- Updates from version 0.1-beta and older
+
+ALTER TABLE "messages" DROP body;
+ALTER TABLE "messages" ADD structure TEXT;
+ALTER TABLE "messages" ADD UNIQUE (user_id, cache_key, uid);
+
+ALTER TABLE "identities" ADD html_signature integer DEFAULT 0 NOT NULL;
+
index ae16a31d8b4e19efb666c9bb5d65257f111d4941..fd2a22f77d67bd38708cdb248f9c8072198b4c6e 100644 (file)
@@ -1,5 +1,5 @@
 -- RoundCube Webmail initial database structure
--- Version 0.1a
+-- Version 0.1-rc1
 -- 
 
 -- --------------------------------------------------------
@@ -58,7 +58,8 @@ CREATE TABLE identities (
   email varchar(128) NOT NULL default '',
   "reply-to" varchar(128) NOT NULL default '',
   bcc varchar(128) NOT NULL default '',
-  signature text NOT NULL default ''
+  signature text NOT NULL default '',
+  html_signature tinyint NOT NULL default '0'
 );
 
 CREATE INDEX ix_identities_user_id ON identities(user_id);
@@ -118,7 +119,7 @@ CREATE TABLE messages (
   date datetime NOT NULL default '0000-00-00 00:00:00',
   size integer NOT NULL default '0',
   headers text NOT NULL,
-  body text
+  structure text
 );
 
 CREATE INDEX ix_messages_user_id ON messages(user_id);
diff --git a/SQL/sqlite.update.sql b/SQL/sqlite.update.sql
new file mode 100644 (file)
index 0000000..e725729
--- /dev/null
@@ -0,0 +1,27 @@
+-- RoundCube Webmail update script for SQLite databases
+-- Updates from version 0.1-beta2 and older
+
+DROP TABLE messages;
+
+CREATE TABLE messages (
+  message_id integer NOT NULL PRIMARY KEY,
+  user_id integer NOT NULL default '0',
+  del tinyint NOT NULL default '0',
+  cache_key varchar(128) NOT NULL default '',
+  created datetime NOT NULL default '0000-00-00 00:00:00',
+  idx integer NOT NULL default '0',
+  uid integer NOT NULL default '0',
+  subject varchar(255) NOT NULL default '',
+  "from" varchar(255) NOT NULL default '',
+  "to" varchar(255) NOT NULL default '',
+  cc varchar(255) NOT NULL default '',
+  date datetime NOT NULL default '0000-00-00 00:00:00',
+  size integer NOT NULL default '0',
+  headers text NOT NULL,
+  structure text
+);
+
+CREATE INDEX ix_messages_user_id ON messages(user_id);
+CREATE INDEX ix_messages_cache_key ON messages(cache_key);
+CREATE INDEX ix_messages_idx ON messages(idx);
+CREATE INDEX ix_messages_uid ON messages(uid);
index bb8b36bab6111b7c6f1132534f71ba84eb900cb2..4f4d0da01abba3d6ce6a9cc8a40b2e79fb97b3f8 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -5,64 +5,78 @@ Follow these instructions if upgrading from a previous version
 of RoundCube Webmail.
 
 
-from versions 0.1-alpha and 0.1-20050811
+from version 1.0-beta2
 ----------------------------------------
-- replace index.php
-- replace all files in folder /program/
-- replace all files in folder /skins/default/
-- run all commands in SQL/*.update.sql or re-initalize database with *.initial.sql
-- add these line to /config/main.inc.php
-  $rcmail_config['trash_mbox'] = 'Trash';
-  $rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
-  $rcmail_config['prefer_html'] = TRUE;
-  $rcmail_config['prettydate'] = TRUE;
-  $rcmail_config['smtp_port'] = 25;
-  $rcmail_config['default_port'] = 143;
-  $rcmail_config['session_lifetime'] = 20;
-  $rcmail_config['skip_deleted'] = FALSE;
-  $rcmail_config['message_sort_col'] = 'date';
-  $rcmail_config['message_sort_order'] = 'DESC';
-  $rcmail_config['log_dir'] = 'logs/';
-  $rcmail_config['temp_dir'] = 'temp/';
-  $rcmail_config['message_cache_lifetime'] = '10d';
-- replace database properties (db_type, db_host, db_user, db_pass, $d_name)
-  in /config/db.inc.php with the following line:
-  $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
-- add these lines to /config/db.inc.php
-  $rcmail_config['db_max_length'] = 512000;
+* replace index.php
+* replace all files in folder /program/
+* replace all files in folder /skins/default/
+* run all commands in SQL/*.update.sql or re-initalize database with *.initial.sql
+* add these lines to /config/main.inc.php
+  $rcmail_config['draft_autosave'] = 300;
+  $rcmail_config['date_today'] = 'H:i';
+* If you have LDAP servers configured, change prop key 'mail_field'
+  to 'email_field' for each server confgured in /config/main.inc.php
 
 
-from version 0.1-20050820
+form version 0.1-beta
 ----------------------------------------
-- replace index.php
-- replace all files in folder /program/
-- replace all files in folder /skins/default/
-- run all commands in SQL/*.update.sql or re-initalize database with *.initial.sql
-- add these line to /config/main.inc.php
-  $rcmail_config['prettydate'] = TRUE;
-  $rcmail_config['smtp_port'] = 25;
-  $rcmail_config['default_port'] = 143;
-  $rcmail_config['session_lifetime'] = 20;
+* replace index.php
+* replace all files in folder /program/
+* replace all files in folder /skins/default/
+* run all commands in SQL/*.update.sql or re-initalize database with *.initial.sql
+* add these line to /config/db.inc.php
+  $rcmail_config['db_persistent'] = TRUE;
+* add these lines to /config/main.inc.php
+  $rcmail_config['drafts_mbox'] = 'Drafts';
+  $rcmail_config['junk_mbox'] = 'Junk';
+  $rcmail_config['product_name'] = 'RoundCube Webmail';
+  $rcmail_config['read_when_deleted'] = TRUE;
+  $rcmail_config['enable_spellcheck'] = TRUE;
+  $rcmail_config['protect_default_folders'] = TRUE;
+  $rcmail_config['draft_autosave'] = 300;
+  $rcmail_config['date_today'] = 'H:i';
+* replace the following line from /config/main.inc.php
+   @include($_SERVER['HTTP_HOST'].'.inc.php');
+  with 
+   $rcmail_config['include_host_config'] = TRUE;
+
+
+
+from version 0.1-20051021
+----------------------------------------
+* replace index.php
+* replace all files in folder /program/
+* replace all files in folder /skins/default/
+* run all commands in SQL/*.update-0.1a.sql or re-initalize database with *.initial.sql
+* add these lines to /config/main.inc.php
   $rcmail_config['skip_deleted'] = FALSE;
   $rcmail_config['message_sort_col'] = 'date';
   $rcmail_config['message_sort_order'] = 'DESC';
   $rcmail_config['log_dir'] = 'logs/';
   $rcmail_config['temp_dir'] = 'temp/';
   $rcmail_config['message_cache_lifetime'] = '10d';
-- replace database properties (db_type, db_host, db_user, db_pass, $d_name)
-  in /config/db.inc.php with the following line:
-  $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
-- add these lines to /config/db.inc.php
+  $rcmail_config['drafts_mbox'] = 'Drafts';
+  $rcmail_config['product_name'] = 'RoundCube Webmail';
+  $rcmail_config['read_when_deleted'] = TRUE;
+  $rcmail_config['enable_spellcheck'] = TRUE;
+* add these lines to /config/db.inc.php
   $rcmail_config['db_max_length'] = 512000;
+  $rcmail_config['db_sequence_user_ids'] = 'user_ids';
+  $rcmail_config['db_sequence_identity_ids'] = 'identity_ids';
+  $rcmail_config['db_sequence_contact_ids'] = 'contact_ids';
+  $rcmail_config['db_sequence_cache_ids'] = 'cache_ids';
+  $rcmail_config['db_sequence_message_ids'] = 'message_ids';
+  $rcmail_config['db_persistent'] = TRUE;
+
 
 
 from version 0.1-20051007
 ----------------------------------------
-- replace index.php
-- replace all files in folder /program/
-- replace all files in folder /skins/default/
-- run all commands in SQL/*.update.sql or re-initalize database with *.initial.sql
-- add these lines to /config/main.inc.php
+* replace index.php
+* replace all files in folder /program/
+* replace all files in folder /skins/default/
+* run all commands in SQL/*.update-0.1a.sql or re-initalize database with *.initial.sql
+* add these lines to /config/main.inc.php
   $rcmail_config['smtp_auth_type'] = '';  // if you need to specify an auth method for SMTP
   $rcmail_config['session_lifetime'] = 20;  // to specify the session lifetime in minutes
   $rcmail_config['skip_deleted'] = FALSE;
@@ -75,7 +89,7 @@ from version 0.1-20051007
   $rcmail_config['product_name'] = 'RoundCube Webmail';
   $rcmail_config['read_when_deleted'] = TRUE;
   $rcmail_config['enable_spellcheck'] = TRUE;
-- add these lines to /config/db.inc.php
+* add these lines to /config/db.inc.php
   $rcmail_config['db_max_length'] = 512000;  
   $rcmail_config['db_sequence_user_ids'] = 'user_ids';
   $rcmail_config['db_sequence_identity_ids'] = 'identity_ids';
@@ -84,50 +98,56 @@ from version 0.1-20051007
   $rcmail_config['db_sequence_message_ids'] = 'message_ids';  
   $rcmail_config['db_persistent'] = TRUE;
 
-from version 0.1-20051021
+
+
+from version 0.1-20050820
 ----------------------------------------
-- replace index.php
-- replace all files in folder /program/
-- replace all files in folder /skins/default/
-- run all commands in SQL/*.update.sql or re-initalize database with *.initial.sql
-- add these lines to /config/main.inc.php
+* replace index.php
+* replace all files in folder /program/
+* replace all files in folder /skins/default/
+* run all commands in SQL/*.update-0.1a.sql or re-initalize database with *.initial.sql
+* add these line to /config/main.inc.php
+  $rcmail_config['prettydate'] = TRUE;
+  $rcmail_config['smtp_port'] = 25;
+  $rcmail_config['default_port'] = 143;
+  $rcmail_config['session_lifetime'] = 20;
   $rcmail_config['skip_deleted'] = FALSE;
   $rcmail_config['message_sort_col'] = 'date';
   $rcmail_config['message_sort_order'] = 'DESC';
   $rcmail_config['log_dir'] = 'logs/';
   $rcmail_config['temp_dir'] = 'temp/';
   $rcmail_config['message_cache_lifetime'] = '10d';
-  $rcmail_config['drafts_mbox'] = 'Drafts';
-  $rcmail_config['product_name'] = 'RoundCube Webmail';
-  $rcmail_config['read_when_deleted'] = TRUE;
-  $rcmail_config['enable_spellcheck'] = TRUE;
-- add these lines to /config/db.inc.php
+* replace database properties (db_type, db_host, db_user, db_pass, $d_name)
+  in /config/db.inc.php with the following line:
+  $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
+* add these lines to /config/db.inc.php
   $rcmail_config['db_max_length'] = 512000;
-  $rcmail_config['db_sequence_user_ids'] = 'user_ids';
-  $rcmail_config['db_sequence_identity_ids'] = 'identity_ids';
-  $rcmail_config['db_sequence_contact_ids'] = 'contact_ids';
-  $rcmail_config['db_sequence_cache_ids'] = 'cache_ids';
-  $rcmail_config['db_sequence_message_ids'] = 'message_ids';
-  $rcmail_config['db_persistent'] = TRUE;
-  
-  
-form version 0.1-beta
+
+
+
+from versions 0.1-alpha and 0.1-20050811
 ----------------------------------------
-- replace index.php
-- replace all files in folder /program/
-- replace all files in folder /skins/default/
-- add these line to /config/db.inc.php
-  $rcmail_config['db_persistent'] = TRUE;
-- add these lines to /config/main.inc.php
-  $rcmail_config['drafts_mbox'] = 'Drafts';
-  $rcmail_config['junk_mbox'] = 'Junk';
-  $rcmail_config['product_name'] = 'RoundCube Webmail';
-  $rcmail_config['read_when_deleted'] = TRUE;
-  $rcmail_config['enable_spellcheck'] = TRUE;
-  $rcmail_config['protect_default_folders'] = TRUE;
-- replace the following line from /config/main.inc.php
-   @include($_SERVER['HTTP_HOST'].'.inc.php');
-  with 
-   $rcmail_config['include_host_config'] = TRUE;
-  
-  
+* replace index.php
+* replace all files in folder /program/
+* replace all files in folder /skins/default/
+* run all commands in SQL/*.update-0.1a.sql or re-initalize database with *.initial.sql
+* add these line to /config/main.inc.php
+  $rcmail_config['trash_mbox'] = 'Trash';
+  $rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
+  $rcmail_config['prefer_html'] = TRUE;
+  $rcmail_config['prettydate'] = TRUE;
+  $rcmail_config['smtp_port'] = 25;
+  $rcmail_config['default_port'] = 143;
+  $rcmail_config['session_lifetime'] = 20;
+  $rcmail_config['skip_deleted'] = FALSE;
+  $rcmail_config['message_sort_col'] = 'date';
+  $rcmail_config['message_sort_order'] = 'DESC';
+  $rcmail_config['log_dir'] = 'logs/';
+  $rcmail_config['temp_dir'] = 'temp/';
+  $rcmail_config['message_cache_lifetime'] = '10d';
+* replace database properties (db_type, db_host, db_user, db_pass, $d_name)
+  in /config/db.inc.php with the following line:
+  $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
+* add these lines to /config/db.inc.php
+  $rcmail_config['db_max_length'] = 512000;
+
diff --git a/bin/html2text.php b/bin/html2text.php
new file mode 100644 (file)
index 0000000..e0e2679
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+require_once('../program/lib/html2text.inc');
+
+$htmlText = $HTTP_RAW_POST_DATA;
+$converter = new html2text($htmlText);
+
+header('Content-Type: text/plain; charset=UTF-8');
+$plaintext = $converter->get_text();
+
+if (function_exists('html_entity_decode'))
+       print html_entity_decode($plaintext, ENT_COMPAT, 'UTF-8');
+else
+       print $plaintext;
+
+?>
\ No newline at end of file
diff --git a/bin/quotaimg.php b/bin/quotaimg.php
new file mode 100644 (file)
index 0000000..47696ef
--- /dev/null
@@ -0,0 +1,169 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/bin/quotaimg.php                                              |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Create a GIF image showing the mailbox quot as bar                  |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Brett Patterson <brett2@umbc.edu>                             |
+ +-----------------------------------------------------------------------+
+
+ $Id:  $
+
+*/
+
+$used  = ((isset($_GET['u']) && !empty($_GET['u'])) || $_GET['u']=='0')?(int)$_GET['u']:'??';
+$quota = ((isset($_GET['q']) && !empty($_GET['q'])) || $_GET['q']=='0')?(int)$_GET['q']:'??';
+$width = empty($_GET['w']) ? 100 : (int)$_GET['w'];
+$height = empty($_GET['h']) ? 14 : (int)$_GET['h'];
+
+function genQuota($used, $total, $width, $height)
+{
+       /**
+        *      Quota Display
+        *
+        *      Modify the following few elements to change the display of the image.
+        *      Modifiable attributes are:
+        *      bool    border  ::      Defines whether you want to show a border around it or not.
+        *      bool    unknown ::      Leave default; Defines whether quota is "unknown"
+        *
+        *      int             height  ::      Defines height of the image
+        *      int             width   ::      Defines width of the image
+        *      int             font    ::      Changes the font size & font used in the GD library.
+        *                                              Available values are from 1 to 5.
+        *      int             padding ::      Changes the offset (in pixels) from the top of the image to
+        *                                              where the top of the text will be aligned.  User greater than
+        *                                              0 to ensure text is off the border.
+        *      array   limit   ::      Holds the integer values of in an associative array as to what
+        *                                              defines the upper and lower levels for quota display.
+        *                                              High - Quota is nearing capacity.
+        *                                              Mid  - Quota is around the middle
+        *                                              Low  - Currently not used.
+        *      array   color   ::      An associative array of strings of comma separated values (R,G,B)
+        *                                              for use in color creation.  Define the RGB values you'd like to 
+        *                                              use.  A list of colors (and their RGB values) can be found here:
+        *                                              http://www.december.com/html/spec/colorcodes.html
+        **/
+
+       $unknown = false;
+       $border = 0;
+
+       $font = 2;
+       $padding = 0;
+
+       $limit['high'] = 70;
+       $limit['mid'] = 45;
+       $limit['low'] = 0;
+
+       // Fill Colors
+       $color['fill']['high'] = '215, 13, 13'; // Near quota fill color
+       $color['fill']['mid'] = '126, 192, 238';// Mid-area of quota fill color
+       $color['fill']['low'] = '147, 225, 100';        // Far from quota fill color
+
+       // Background colors
+       $color['bg']['OL'] = '215, 13, 13';             // Over limit bbackground
+       $color['bg']['Unknown'] = '238, 99, 99';// Unknown background
+       $color['bg']['quota'] = '255, 255, 255';// Normal quota background
+
+       // Misc. Colors
+       $color['border'] = '0, 0, 0';
+       $color['text'] = '102, 102, 102';
+
+
+       /****************************
+        *****  DO NOT EDIT BELOW HERE  *****
+        ****************************/
+
+       if (ereg("^[^0-9?]*$", $used) || ereg("^[^0-9?]*$", $total))
+               return false; 
+
+       if (strpos($used, '?')!==false || strpos($total, '?')!==false && $used != 0)
+               $unknown = true; 
+
+       $im = imagecreate($width, $height);
+
+       if ($border)
+       {
+               list($r, $g, $b) = explode(',', $color['border']);
+               $borderc = imagecolorallocate($im, $r, $g, $b);
+               imageline($im, 0, 0, $width, 0, $borderc);
+               imageline($im, 0, $height-$border, 0, 0, $borderc);
+               imageline($im, $width-1, 0, $width-$border, $height, $borderc);
+               imageline($im, $width, $height-$border, 0, $height-$border, $borderc);
+       }
+               
+       list($r, $g, $b) = explode(',', $color['text']);
+       $text = imagecolorallocate($im, $r, $g, $b);
+
+       if ($unknown)
+       {
+               list($r, $g, $b) = explode(',', $color['bg']['Unknown']);
+               $background = imagecolorallocate($im, $r, $g, $b);
+               imagefilledrectangle($im, 0, 0, $width, $height, $background);
+
+               $string = 'Unknown';
+               $mid = floor(($width-(strlen($string)*imagefontwidth($font)))/2)+1;
+               imagestring($im, $font, $mid, $padding, $string, $text);
+       }
+       else if ($used > $total)
+       {
+               list($r, $g, $b) = explode(',', $color['bg']['OL']);
+               $background = imagecolorallocate($im, $r, $g, $b);
+               imagefilledrectangle($im, 0, 0, $width, $height, $background);
+
+               $string = 'Over Limit';
+               $mid = floor(($width-(strlen($string)*imagefontwidth($font)))/2)+1;
+               imagestring($im, $font, $mid, $padding, $string, $text);
+       }
+       else
+       {
+               list($r, $g, $b) = explode(',', $color['bg']['quota']);
+               $background = imagecolorallocate($im, $r, $b, $g);
+               imagefilledrectangle($im, 0, 0, $width, $height, $background);
+               
+               $quota = ($used==0)?0:(round($used/$total, 2)*100);
+
+               if ($quota >= $limit['high'])
+               {
+                       list($r, $g, $b) = explode(',', $color['fill']['high']);
+                       $fill = imagecolorallocate($im, $r, $g, $b);
+               }
+               elseif($quota >= $limit['mid'])
+               {
+                       list($r, $g, $b) = explode(',', $color['fill']['mid']);
+                       $fill = imagecolorallocate($im, $r, $g, $b);
+               }
+               else // if($quota >= $limit['low'])
+               {
+                       list($r, $g, $b) = explode(',', $color['fill']['low']);
+                       $fill = imagecolorallocate($im, $r, $g, $b);
+               }
+
+               $quota_width = $quota / 100 * $width;
+               imagefilledrectangle($im, $border, 0, $quota, $height-2*$border, $fill);
+
+               $string = $quota.'%';
+               $mid = floor(($width-(strlen($string)*imagefontwidth($font)))/2)+1;
+               imagestring($im, $font, $mid, $padding, $string, $text); // Print percent in black
+       }
+
+       header('Content-Type: image/gif');
+       header("Expires: ".gmdate("D, d M Y H:i:s", mktime()+86400)." GMT");
+       header("Cache-Control: ");
+       header("Pragma: ");
+       
+       imagegif($im);
+       imagedestroy($im);
+}
+
+
+genQuota($used, $quota, $width, $height);
+exit;
+?>
\ No newline at end of file
index f9d3b2dabfbe36621dd6d04223d0082460d2d625..895aa45f23e6a81a25e5bc865fc90b955d4c19df 100644 (file)
@@ -5,7 +5,7 @@
  | Configuration file for database access                                |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
@@ -16,7 +16,7 @@ $rcmail_config = array();
 
 // PEAR database DSN for read/write operations
 // format is db_provider://user:password@host/databse
-// currentyl suported db_providers: mysql, sqlite
+// currentyl suported db_providers: mysql, pgsql, sqlite
 
 $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
 // postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';
index 2f79bd8e8f977037e19bc3c799aa7f34521de7b1..3b8e407c8bceaa33aef91fca05ee08a4bd021c4a 100644 (file)
@@ -5,7 +5,7 @@
  | Main configuration file                                               |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
@@ -97,7 +97,11 @@ $rcmail_config['log_dir'] = 'logs/';
 $rcmail_config['session_lifetime'] = 10;
 
 // check client IP in session athorization
-$rcmail_config['ip_check'] = TRUE;
+$rcmail_config['ip_check'] = false;
+
+// Use an additional frequently changing cookie to athenticate user sessions.
+// There have been problems reported with this feature.
+$rcmail_config['double_auth'] = false;
 
 // this key is used to encrypt the users imap password which is stored
 // in the session record (and the client cookie if remember password is enabled).
@@ -113,8 +117,11 @@ $rcmail_config['date_short'] = 'D H:i';
 // use this format for detailed date/time formatting
 $rcmail_config['date_long'] = 'd.m.Y H:i';
 
+// use this format for today's date display
+$rcmail_config['date_today'] = 'H:i';
+
 // add this user-agent to message headers when sending
-$rcmail_config['useragent'] = 'RoundCube Webmail/0.1b';
+$rcmail_config['useragent'] = 'RoundCube Webmail/0.1-rc1';
 
 // use this name to compose page titles
 $rcmail_config['product_name'] = 'RoundCube Webmail';
@@ -157,10 +164,20 @@ $rcmail_config['read_when_deleted'] = TRUE;
 // 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
+// Make use of the built-in spell checker. It is based on GoogieSpell.
 $rcmail_config['enable_spellcheck'] = TRUE;
 
+// For a locally installed Nox Spell Server, please specify the URI to call it.
+// Get Nox Spell Server from http://orangoo.com/labs/?page_id=72
+// Leave empty to use the Google spell checking service, what means
+// that the message content will be sent to Google in order to check spelling
+$rcmail_config['spellcheck_uri'] = '';
+
+// These languages can be selected for spell checking.
+// Configure as a PHP style hash array: array('en'=>'English', 'de'=>'Deutsch');
+// Leave empty for default set of Google spell check languages
+$rcmail_config['spellcheck_languages'] = NULL;
+
 // 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'] = '';
@@ -173,18 +190,29 @@ $rcmail_config['mail_header_delimiter'] = NULL;
 // like the Verisign example below. if you would like to test, 
 // simply uncomment the Verisign example.
 /** 
- *  example config for Verisign directory
+ * 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);
+ * $rcmail_config['ldap_public']['Verisign'] = array(
+ *  'name'          => 'Verisign.com',
+ *  'hosts'         => array('directory.verisign.com'),
+ *  'port'          => 389,
+ *  'base_dn'       => '',
+ *  'bind_dn'       => '',
+ *  'bind_pass'     => '',
+ *  'search_fields' => array('mail', 'cn'),  // fields to search in
+ *  'name_field'    => 'cn',    // this field represents the contact's name
+ *  'email_field'   => 'mail',  // this field represents the contact's e-mail
+ *  'scope'         => 'sub',   // search mode: sub|base|list
+ *  'filter'        => '',      // will be &'d with search field ex: (status=act)
+ *  'fuzzy_search'  => true);   // server allows wildcard search
  */
 
+// don't allow these settings to be overriden by the user
+$rcmail_config['dont_override'] = array();
+
+// list of configuration option names that need to be available in Javascript.
+$rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_deletion');
+
 // try to load host-specific configuration
 $rcmail_config['include_host_config'] = FALSE;
 
@@ -212,9 +240,8 @@ $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');
-
+// save compose message every 300 seconds (5min)
+$rcmail_config['draft_autosave'] = 300;
 
 // end of config file
 ?>
index 35184ff2218c083f67e3eb52dca943916e91ea7d..c23494bdc2aaf751afb9ae00214cc7ef8c4e2c0d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2,9 +2,9 @@
 /*
  +-----------------------------------------------------------------------+
  | RoundCube Webmail IMAP Client                                         |
- | Version 0.1-beta2                                                     |
+ | Version 0.1-rc1                                                       |
  |                                                                       |
- | Copyright (C) 2005-2006, RoundCube Dev. - Switzerland                 |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | Redistribution and use in source and binary forms, with or without    |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: index.php 429 2006-12-22 22:26:24Z thomasb $
+ $Id: index.php 579 2007-05-18 13:11:22Z thomasb $
 
 */
 
-define('RCMAIL_VERSION', '0.1-beta2');
+// application constants
+define('RCMAIL_VERSION', '0.1-rc1');
+define('RCMAIL_CHARSET', 'UTF-8');
+define('JS_OBJECT_NAME', 'rcmail');
 
 // define global vars
-$CHARSET = 'UTF-8';
 $OUTPUT_TYPE = 'html';
-$JS_OBJECT_NAME = 'rcmail';
 $INSTALL_PATH = dirname(__FILE__);
 $MAIN_TASKS = array('mail','settings','addressbook','logout');
 
@@ -73,7 +74,7 @@ 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);
+if (!ini_get('safe_mode')) @set_time_limit(120);
 
 // include base files
 require_once('include/rcube_shared.inc');
@@ -87,12 +88,6 @@ 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
 $_task = strip_quotes(get_input_value('_task', RCUBE_INPUT_GPC));
@@ -103,8 +98,17 @@ $_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed']));
 if (empty($_task) || !in_array($_task, $MAIN_TASKS))
   $_task = 'mail';
 
-if (!empty($_GET['_remote']))
-  $REMOTE_REQUEST = TRUE;
+
+// set output buffering
+if ($_action != 'get' && $_action != 'viewsource')
+{
+  // use gzip compression if supported
+  if (function_exists('ob_gzhandler') && ini_get('zlib.output_compression'))
+    ob_start('ob_gzhandler');
+  else
+    ob_start();
+}
+
 
 // start session with requested task
 rcmail_startup($_task);
@@ -116,133 +120,136 @@ $SESS_HIDDEN_FIELD = '';
 
 // 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();
+rcmail_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);
-  }
+{
+  raise_error(array(
+    'code' => 603,
+    'type' => 'db',
+    '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'];
+{
+  $host = rcmail_autoselect_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), $_POST['_pass'], $host))
-    {
+  {
+    $OUTPUT->show_message("cookiesdisabled", 'warning');
+  }
+  else if ($_SESSION['temp'] && !empty($_POST['_user']) && isset($_POST['_pass']) &&
+           rcmail_login(get_input_value('_user', RCUBE_INPUT_POST),
+              get_input_value('_pass', RCUBE_INPUT_POST, true, 'ISO-8859-1'), $host))
+  {
+    // create new session ID
+    unset($_SESSION['temp']);
+    sess_regenerate_id();
+
+    // send auth cookie if necessary
+    rcmail_authenticate_session();
+
     // send redirect
     header("Location: $COMM_PATH");
     exit;
-    }
+  }
   else
-    {
-    show_message("loginfailed", 'warning');
+  {
+    $OUTPUT->show_message("loginfailed", 'warning');
     $_SESSION['user_id'] = '';
-    }
   }
+}
 
 // end session
-else if ($_action=='logout' && isset($_SESSION['user_id']))
-  {
-  show_message('loggedout');
+else if (($_task=='logout' || $_action=='logout') && isset($_SESSION['user_id']))
+{
+  $OUTPUT->show_message('loggedout');
   rcmail_kill_session();
-  }
+}
 
 // check session and auth cookie
-else if ($_action!='login' && $_SESSION['user_id'])
+else if ($_action != 'login' && $_SESSION['user_id'] && $_action != 'send')
+{
+  if (!rcmail_authenticate_session())
   {
-  if (!rcmail_authenticate_session() ||
-      ($CONFIG['session_lifetime'] && isset($SESS_CHANGED) && $SESS_CHANGED + $CONFIG['session_lifetime']*60 < mktime()))
-    {
-    $message = show_message('sessionerror', 'error');
+    $OUTPUT->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');
+  {
+    $OUTPUT->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);
-    }
+{
+  if ($OUTPUT->ajax_call)
+    $OUTPUT->remote_response("setTimeout(\"location.href='\"+this.env.comm_path+\"'\", 2000);");
   
   $_task = 'login';
-  }
+}
 
 
 
 // set task and action to client
-$script = sprintf("%s.set_env('task', '%s');", $JS_OBJECT_NAME, $_task);
+$OUTPUT->set_env('task', $_task);
 if (!empty($_action))
-  $script .= sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action);
-
-$OUTPUT->add_script($script);
+  $OUTPUT->set_env('action', $_action);
 
 
 
 // not logged in -> show login page
 if (!$_SESSION['user_id'])
-  {
-  parse_template('login');
+{
+  $OUTPUT->task = 'login';
+  $OUTPUT->send('login');
   exit;
-  }
+}
 
 
 // handle keep-alive signal
 if ($_action=='keep-alive')
-  {
-  rcube_remote_response('');
+{
+  $OUTPUT->reset();
+  $OUTPUT->send('');
   exit;
-  }
-
+}
 
 // include task specific files
 if ($_task=='mail')
-  {
+{
   include_once('program/steps/mail/func.inc');
   
-  if ($_action=='show' || $_action=='print')
+  if ($_action=='show' || $_action=='preview' || $_action=='print')
     include('program/steps/mail/show.inc');
 
   if ($_action=='get')
@@ -278,7 +285,7 @@ if ($_task=='mail')
   if ($_action=='getunread')
     include('program/steps/mail/getunread.inc');
     
-  if ($_action=='list' && isset($_GET['_remote']))
+  if ($_action=='list' && isset($_REQUEST['_remote']))
     include('program/steps/mail/list.inc');
 
    if ($_action=='search')
@@ -289,16 +296,19 @@ if ($_task=='mail')
 
   if ($_action=='rss')
     include('program/steps/mail/rss.inc');
+    
+  if ($_action=='quotadisplay')
+    include('program/steps/mail/quotadisplay.inc');
 
 
   // 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')
@@ -313,17 +323,23 @@ if ($_task=='addressbook')
   if ($_action=='show')
     include('program/steps/addressbook/show.inc');  
 
-  if ($_action=='list' && $_GET['_remote'])
+  if ($_action=='list' && $_REQUEST['_remote'])
     include('program/steps/addressbook/list.inc');
 
-  if ($_action=='ldappublicsearch')
-    include('program/steps/addressbook/ldapsearchform.inc');
-  }
+  if ($_action=='search')
+    include('program/steps/addressbook/search.inc');
+
+  if ($_action=='copy')
+    include('program/steps/addressbook/copy.inc');
+
+  if ($_action=='mailto')
+    include('program/steps/addressbook/mailto.inc');
+}
 
 
 // include task specific files
 if ($_task=='settings')
-  {
+{
   include_once('program/steps/settings/func.inc');
 
   if ($_action=='save-identity')
@@ -345,18 +361,19 @@ if ($_task=='settings')
       $_action=='create-folder' || $_action=='rename-folder' || $_action=='delete-folder')
     include('program/steps/settings/manage_folders.inc');
 
-  }
+}
 
 
 // parse main template
-parse_template($_task);
+$OUTPUT->send($_task);
 
 
 // if we arrive here, something went wrong
-raise_error(array('code' => 404,
-                  'type' => 'php',
-                  'line' => __LINE__,
-                  'file' => __FILE__,
-                  'message' => "Invalid request"), TRUE, TRUE);
+raise_error(array(
+  'code' => 404,
+  'type' => 'php',
+  'line' => __LINE__,
+  'file' => __FILE__,
+  'message' => "Invalid request"), TRUE, TRUE);
                       
 ?>
diff --git a/program/blocked.gif b/program/blocked.gif
new file mode 100644 (file)
index 0000000..7a4aa9f
Binary files /dev/null and b/program/blocked.gif differ
index f1fa72b7adfac268915fcfea7a92bfc555c2f1e7..46384ff728216b463b2d484fc6b27865fb358da5 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: bugs.inc 90 2005-12-11 23:19:48Z roundcube $
+ $Id: bugs.inc 347 2006-09-16 22:58:51Z estadtherr $
 
 */
 
@@ -115,5 +115,4 @@ function log_bug($arg_arr)
     }
   }
 
-
-?>
\ No newline at end of file
+?>
index c594767021355922a22878f57bcbaf2a14f506dc..8a5017b9bf1ff61d7527c35322a96f916b47fb7a 100644 (file)
@@ -5,7 +5,7 @@
  | program/include/main.inc                                              |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev, - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev, - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: main.inc 429 2006-12-22 22:26:24Z thomasb $
+ $Id: main.inc 567 2007-05-17 18:41:24Z thomasb $
 
 */
 
 require_once('lib/des.inc');
 require_once('lib/utf7.inc');
 require_once('lib/utf8.class.php');
+require_once('include/rcmail_template.inc');
 
 
 // define constannts for input reading
@@ -33,46 +34,18 @@ 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;
+  global $sess_id, $sess_user_lang;
+  global $CONFIG, $INSTALL_PATH, $BROWSER, $OUTPUT, $_SESSION, $IMAP, $DB;
 
   // 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'] ? unslashify($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'] = unslashify($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);
-
+  // load configuration
+  $CONFIG = rcmail_load_config();
 
   // set session garbage collecting time according to session_lifetime
   if (!empty($CONFIG['session_lifetime']))
-    ini_set('session.gc_maxlifetime', ($CONFIG['session_lifetime']+2)*60);
-
+    ini_set('session.gc_maxlifetime', ($CONFIG['session_lifetime']) * 120);
 
   // prepare DB connection
   require_once('include/rcube_'.(empty($CONFIG['db_backend']) ? 'db' : $CONFIG['db_backend']).'.inc');
@@ -80,10 +53,9 @@ function rcmail_startup($task='mail')
   $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
-  if (!$DB->is_error())
-    include_once('include/session.inc');
+
+  // use database for storing session data
+  include_once('include/session.inc');
 
   // init session
   session_start();
@@ -93,8 +65,8 @@ function rcmail_startup($task='mail')
   if (!isset($_SESSION['auth_time']))
     {
     $_SESSION['user_lang'] = rcube_language_prop($CONFIG['locale_string']);
-    $_SESSION['auth_time'] = mktime();
-    setcookie('sessauth', rcmail_auth_hash($sess_id, $_SESSION['auth_time']));
+    $_SESSION['auth_time'] = time();
+    $_SESSION['temp'] = true;
     }
 
   // set session vars global
@@ -129,6 +101,44 @@ function rcmail_startup($task='mail')
   }
 
 
+// load roundcube configuration into global var
+function rcmail_load_config()
+  {
+  global $INSTALL_PATH;
+
+  // load config file
+  include_once('config/main.inc.php');
+  $conf = is_array($rcmail_config) ? $rcmail_config : array();
+
+  // load host-specific configuration
+  rcmail_load_host_config($conf);
+
+  $conf['skin_path'] = $conf['skin_path'] ? unslashify($conf['skin_path']) : 'skins/default';
+
+  // load db conf
+  include_once('config/db.inc.php');
+  $conf = array_merge($conf, $rcmail_config);
+
+  if (empty($conf['log_dir']))
+    $conf['log_dir'] = $INSTALL_PATH.'logs';
+  else
+    $conf['log_dir'] = unslashify($conf['log_dir']);
+
+  // set PHP error logging according to config
+  if ($conf['debug_level'] & 1)
+    {
+    ini_set('log_errors', 1);
+    ini_set('error_log', $conf['log_dir'].'/errors');
+    }
+  if ($conf['debug_level'] & 4)
+    ini_set('display_errors', 1);
+  else
+    ini_set('display_errors', 0);
+
+  return $conf;
+  }
+
+
 // load a host-specific config file if configured
 function rcmail_load_host_config(&$config)
   {
@@ -168,16 +178,30 @@ function rcmail_auth_hash($sess_id, $ts)
 // compare the auth hash sent by the client with the local session credentials
 function rcmail_authenticate_session()
   {
-  $now = mktime();
-  $valid = ($_COOKIE['sessauth'] == rcmail_auth_hash(session_id(), $_SESSION['auth_time']));
+  global $CONFIG, $SESS_CLIENT_IP, $SESS_CHANGED;
+  
+  // advanced session authentication
+  if ($CONFIG['double_auth'])
+  {
+    $now = time();
+    $valid = ($_COOKIE['sessauth'] == rcmail_auth_hash(session_id(), $_SESSION['auth_time']) ||
+              $_COOKIE['sessauth'] == rcmail_auth_hash(session_id(), $_SESSION['last_auth']));
 
-  // renew auth cookie every 5 minutes (only for GET requests)
-  if (!$valid || ($_SERVER['REQUEST_METHOD']!='POST' && $now-$_SESSION['auth_time'] > 300))
+    // renew auth cookie every 5 minutes (only for GET requests)
+    if (!$valid || ($_SERVER['REQUEST_METHOD']!='POST' && $now-$_SESSION['auth_time'] > 300))
     {
-    $_SESSION['auth_time'] = $now;
-    setcookie('sessauth', rcmail_auth_hash(session_id(), $now));
+      $_SESSION['last_auth'] = $_SESSION['auth_time'];
+      $_SESSION['auth_time'] = $now;
+      setcookie('sessauth', rcmail_auth_hash(session_id(), $now));
     }
-    
+  }
+  else
+    $valid = $CONFIG['ip_check'] ? $_SERVER['REMOTE_ADDR'] == $SESS_CLIENT_IP : true;
+  
+  // check session filetime
+  if (!empty($CONFIG['session_lifetime']) && isset($SESS_CHANGED) && $SESS_CHANGED + $CONFIG['session_lifetime']*60 < time())
+    $valid = false;
+
   return $valid;
   }
 
@@ -185,7 +209,7 @@ function rcmail_authenticate_session()
 // create IMAP object and connect to server
 function rcmail_imap_init($connect=FALSE)
   {
-  global $CONFIG, $DB, $IMAP;
+  global $CONFIG, $DB, $IMAP, $OUTPUT;
 
   $IMAP = new rcube_imap($DB);
   $IMAP->debug_level = $CONFIG['debug_level'];
@@ -196,7 +220,7 @@ function rcmail_imap_init($connect=FALSE)
   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');
+      $OUTPUT->show_message('imaperror', 'error');
       
     rcmail_set_imap_prop();
     }
@@ -263,8 +287,8 @@ function rcmail_kill_session()
     rcmail_save_user_prefs($a_user_prefs);
     }
 
-  $_SESSION = array();
-  session_destroy();
+  $_SESSION = array('user_lang' => $GLOBALS['sess_user_lang'], 'auth_time' => time(), 'temp' => true);
+  setcookie('sessauth', '-del-', time()-60);
   }
 
 
@@ -337,30 +361,22 @@ function rcube_language_prop($lang, $prop='lang')
   
 
 // init output object for GUI and add common scripts
-function load_gui()
+function rcmail_load_gui()
   {
-  global $CONFIG, $OUTPUT, $COMM_PATH, $JS_OBJECT_NAME, $sess_user_lang;
+  global $CONFIG, $OUTPUT, $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";
+  $OUTPUT = new rcmail_template($CONFIG, $GLOBALS['_task']);
+  $OUTPUT->set_env('comm_path', $GLOBALS['COMM_PATH']);
 
-  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 (is_array($CONFIG['javascript_config']))
+  {
+    foreach ($CONFIG['javascript_config'] as $js_config_var)
+      $OUTPUT->set_env($js_config_var, $CONFIG[$js_config_var]);
   }
-  
+
   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/';
+    $OUTPUT->set_env('framed', true);
 
   // set locale setting
   rcmail_set_locale($sess_user_lang);
@@ -368,49 +384,65 @@ function load_gui()
   // set user-selected charset
   if (!empty($CONFIG['charset']))
     $OUTPUT->set_charset($CONFIG['charset']);
+    
+  // register common UI objects
+  $OUTPUT->add_handlers(array(
+    'loginform' => 'rcmail_login_form',
+    'username'  => 'rcmail_current_username',
+    'message' => 'rcmail_message_container',
+    'charsetselector' => 'rcmail_charset_selector',
+  ));
 
   // add some basic label to client
-  rcube_add_label('loading','checkingmail');
+  if (!$OUTPUT->ajax_call)
+    rcube_add_label('loading');
   }
 
 
 // set localization charset based on the given language
 function rcmail_set_locale($lang)
   {
-  global $OUTPUT, $MBSTRING, $MBSTRING_ENCODING;
+  global $OUTPUT, $MBSTRING;
   static $s_mbstring_loaded = NULL;
   
   // settings for mbstring module (by Tadashi Jokagi)
-  if ($s_mbstring_loaded===NULL)
+  if (is_null($s_mbstring_loaded))
+    $MBSTRING = $s_mbstring_loaded = extension_loaded("mbstring");
+  else
+    $MBSTRING = $s_mbstring_loaded = FALSE;
+    
+  if ($MBSTRING)
+    mb_internal_encoding(RCMAIL_CHARSET);
+
+  $OUTPUT->set_charset(rcube_language_prop($lang, 'charset'));
+  }
+
+
+// auto-select IMAP host based on the posted login information
+function rcmail_autoselect_host()
+  {
+  global $CONFIG;
+  
+  $host = isset($_POST['_host']) ? get_input_value('_host', RCUBE_INPUT_POST) : $CONFIG['default_host'];
+  if (is_array($host))
     {
-    if ($s_mbstring_loaded = extension_loaded("mbstring"))
+    list($user, $domain) = explode('@', get_input_value('_user', RCUBE_INPUT_POST));
+    if (!empty($domain))
       {
-      $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();
+      foreach ($host as $imap_host => $mail_domains)
+        if (is_array($mail_domains) && in_array($domain, $mail_domains))
+          {
+          $host = $imap_host;
+          break;
+          }
       }
-    }
 
-  if ($MBSTRING && function_exists("mb_language"))
-    {
-    if (!@mb_language(strtok($lang, "_")))
-      $MBSTRING = FALSE;   //  unsupport language
+    // take the first entry if $host is still an array
+    if (is_array($host))
+      $host = array_shift($host);
     }
-
-  $OUTPUT->set_charset(rcube_language_prop($lang, 'charset'));
+  
+  return $host;
   }
 
 
@@ -423,26 +455,26 @@ function rcmail_login($user, $pass, $host=NULL)
   if (!$host)
     $host = $CONFIG['default_host'];
 
-   // Validate that selected host is in the list of configured hosts
-   if (is_array($CONFIG['default_host']))
-     {
-     $allowed = FALSE;
-     foreach ($CONFIG['default_host'] as $key => $host_allowed)
-       {
-       if (!is_numeric($key))
-         $host_allowed = $key;
-       if ($host == $host_allowed)
-         {
-         $allowed = TRUE;
-         break;
-         }
-       }
-     if (!$allowed)
-       return FALSE;
-     }
-   else if (!empty($CONFIG['default_host']) && $host != $CONFIG['default_host'])
-     return FALSE;
-       
+  // Validate that selected host is in the list of configured hosts
+  if (is_array($CONFIG['default_host']))
+    {
+    $allowed = FALSE;
+    foreach ($CONFIG['default_host'] as $key => $host_allowed)
+      {
+      if (!is_numeric($key))
+        $host_allowed = $key;
+      if ($host == $host_allowed)
+        {
+        $allowed = TRUE;
+        break;
+        }
+      }
+    if (!$allowed)
+      return FALSE;
+    }
+  else if (!empty($CONFIG['default_host']) && $host != $CONFIG['default_host'])
+    return FALSE;
+
   // parse $host URL
   $a_host = parse_url($host);
   if ($a_host['host'])
@@ -459,12 +491,12 @@ function rcmail_login($user, $pass, $host=NULL)
      Inspired by Marco <P0L0_notspam_binware.org>
   */
   // Check if we need to add domain
-  if ($CONFIG['username_domain'] && !strstr($user, '@'))
+  if (!empty($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'];    
+    else if (is_string($CONFIG['username_domain']))
+      $user .= '@'.$CONFIG['username_domain'];
     }
 
 
@@ -510,7 +542,7 @@ function rcmail_login($user, $pass, $host=NULL)
       
     // update user's record
     $DB->query("UPDATE ".get_table_name('users')."
-                SET    last_login=now()
+                SET    last_login=".$DB->now()."
                 WHERE  user_id=?",
                 $user_id);
     }
@@ -529,6 +561,7 @@ function rcmail_login($user, $pass, $host=NULL)
     $_SESSION['username']  = $user;
     $_SESSION['user_lang'] = $sess_user_lang;
     $_SESSION['password']  = encrypt_passwd($pass);
+    $_SESSION['login_time'] = mktime();
 
     // force reloading complete list of subscribed mailboxes
     rcmail_set_imap_prop();
@@ -555,22 +588,15 @@ function rcmail_create_user($user, $host)
 
   $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']);
+              VALUES (".$DB->now().", ".$DB->now().", ?, ?, ?, ?)",
+              strip_newlines($user),
+              strip_newlines($host),
+              strip_newlines($user_email),
+              $_SESSION['user_lang']);
 
   if ($user_id = $DB->insert_id(get_sequence_name('users')))
     {
-    $mail_domain = $host;
-    if (is_array($CONFIG['mail_domain']))
-      {
-      if (isset($CONFIG['mail_domain'][$host]))
-        $mail_domain = $CONFIG['mail_domain'][$host];
-      }
-    else if (!empty($CONFIG['mail_domain']))
-      $mail_domain = $CONFIG['mail_domain'];
+    $mail_domain = rcmail_mail_domain($host);
    
     if ($user_email=='')
       $user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $mail_domain);
@@ -578,21 +604,28 @@ function rcmail_create_user($user, $host)
     $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];
+    if (!empty($CONFIG['virtuser_query']) &&
+        ($sql_result = $DB->query(preg_replace('/%u/', $user, $CONFIG['virtuser_query']))) &&
+        ($DB->num_rows()>0))
+      while ($sql_arr = $DB->fetch_array($sql_result))
+        {
+        $DB->query("INSERT INTO ".get_table_name('identities')."
+                   (user_id, del, standard, name, email)
+                   VALUES (?, 0, 1, ?, ?)",
+                   $user_id,
+                   strip_newlines($user_name),
+                   preg_replace('/^@/', $user . '@', $sql_arr[0]));
+        }
+    else
+      {
+      // also create new identity records
+      $DB->query("INSERT INTO ".get_table_name('identities')."
+                  (user_id, del, standard, name, email)
+                  VALUES (?, 0, 1, ?, ?)",
+                  $user_id,
+                  strip_newlines($user_name),
+                  strip_newlines($user_email));
       }
-
-    // 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();
@@ -714,44 +747,42 @@ function rcmail_save_user_prefs($a_user_prefs)
 // overwrite action variable  
 function rcmail_overwrite_action($action)
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT;
   $GLOBALS['_action'] = $action;
-
-  $OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $action));  
+  $OUTPUT->set_env('action', $action);
   }
 
 
-function show_message($message, $type='notice', $vars=NULL)
-  {
-  global $OUTPUT, $JS_OBJECT_NAME, $REMOTE_REQUEST;
+/**
+ * Compose an URL for a specific action
+ *
+ * @param string  Request action
+ * @param array   More URL parameters
+ * @param string  Request task (omit if the same)
+ * @return The application URL
+ */
+function rcmail_url($action, $p=array(), $task=null)
+{
+  global $MAIN_TASKS, $COMM_PATH;
+  $qstring = '';
+  $base = $COMM_PATH;
   
-  $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;
+  if ($task && in_array($task, $MAIN_TASKS))
+    $base = ereg_replace('_task=[a-z]+', '_task='.$task, $COMM_PATH);
   
-  else
-    $OUTPUT->add_script(sprintf("%s%s.%s\n",
-                                $framed ? sprintf('if(parent.%s)parent.', $JS_OBJECT_NAME) : '',
-                                $JS_OBJECT_NAME,
-                                $command));
+  if (is_array($p))
+    foreach ($p as $key => $val)
+      $qstring .= '&'.urlencode($key).'='.urlencode($val);
   
-  // console(rcube_label($message));
-  }
+  return $base . ($action ? '&_action='.$action : '') . $qstring;
+}
 
 
-function console($msg, $type=1)
+// @deprecated
+function show_message($message, $type='notice', $vars=NULL)
   {
-  if ($GLOBALS['REMOTE_REQUEST'])
-    print "// $msg\n";
-  else
-    {
-    print $msg;
-    print "\n<hr>\n";
-    }
+  global $OUTPUT;
+  $OUTPUT->show_message($message, $type, $vars);
   }
 
 
@@ -787,43 +818,6 @@ function get_des_key()
   }
 
 
-// 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;
-  }
-
-
-// send correctly formatted response for a request posted to an iframe
-function rcube_iframe_response($js_code='')
-  {
-  global $OUTPUT, $JS_OBJECT_NAME;
-
-  if (!empty($js_code))
-    $OUTPUT->add_script("if(parent.$JS_OBJECT_NAME){\n" . $js_code . "\n}");
-
-  $OUTPUT->write();
-  exit;
-  }
-
-
 // read directory program/localization/ and return a list of available languages
 function rcube_list_languages()
   {
@@ -854,30 +848,33 @@ function rcube_list_languages()
 // add a localized label to the client environment
 function rcube_add_label()
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT;
   
   $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')));  
+    $OUTPUT->command('add_label', $name, rcube_label($name));
   }
 
 
-// remove temp files of a session
-function rcmail_clear_session_temp($sess_id)
+// remove temp files older than two day
+function rcmail_temp_gc()
   {
-  global $CONFIG;
+  $tmp = unslashify($CONFIG['temp_dir']);
+  $expire = mktime() - 172800;  // expire in 48 hours
 
-  $temp_dir = slashify($CONFIG['temp_dir']);
-  $cache_dir = $temp_dir.$sess_id;
-
-  if (is_dir($cache_dir))
+  if ($dir = opendir($tmp))
     {
-    clear_directory($cache_dir);
-    rmdir($cache_dir);
-    }  
+    while (($fname = readdir($dir)) !== false)
+      {
+      if ($fname{0} == '.')
+        continue;
+
+      if (filemtime($tmp.'/'.$fname) < $expire)
+        @unlink($tmp.'/'.$fname);
+      }
+
+    closedir($dir);
+    }
   }
 
 
@@ -898,26 +895,34 @@ function rcmail_message_cache_gc()
   }
 
 
-// convert a string from one charset to another
-// this function is not complete and not tested well
+/**
+ * Convert a string from one charset to another.
+ * Uses mbstring and iconv functions if possible
+ *
+ * @param  string Input string
+ * @param  string Suspected charset of the input string
+ * @param  string Target charset to convert to; defaults to RCMAIL_CHARSET
+ * @return Converted string
+ */
 function rcube_charset_convert($str, $from, $to=NULL)
   {
-  global $MBSTRING, $MBSTRING_ENCODING;
+  global $MBSTRING;
 
   $from = strtoupper($from);
-  $to = $to==NULL ? strtoupper($GLOBALS['CHARSET']) : strtoupper($to);
+  $to = $to==NULL ? strtoupper(RCMAIL_CHARSET) : strtoupper($to);
 
-  if ($from==$to)
+  if ($from==$to || $str=='' || empty($from))
     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);
+
+    // return if convert succeeded
+    if (($out = mb_convert_encoding($str, $to, $from)) != '')
+      return $out;
     }
 
   // convert charset using iconv module  
@@ -928,8 +933,8 @@ function rcube_charset_convert($str, $from, $to=NULL)
 
   // 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 = utf7_to_utf8($str);
+  else if (($from=='ISO-8859-1') && function_exists('utf8_encode'))
     $str = utf8_encode($str);
   else if ($from!='UTF-8')
     {
@@ -939,7 +944,7 @@ function rcube_charset_convert($str, $from, $to=NULL)
 
   // encode string for output
   if ($to=='UTF-7')
-    return UTF7EncodeString($str);
+    return utf8_to_utf7($str);
   else if ($to=='ISO-8859-1' && function_exists('utf8_decode'))
     return utf8_decode($str);
   else if ($to!='UTF-8')
@@ -953,12 +958,19 @@ function rcube_charset_convert($str, $from, $to=NULL)
   }
 
 
-
-// replace specials characters to a specific encoding type
+/**
+ * Replacing specials characters to a specific encoding type
+ *
+ * @param  string  Input string
+ * @param  string  Encoding type: text|html|xml|js|url
+ * @param  string  Replace mode for tags: show|replace|remove
+ * @param  boolean Convert newlines
+ * @return The quoted string
+ */
 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;
+  static $html_encode_arr, $js_rep_table, $xml_rep_table;
 
   if (!$enctype)
     $enctype = $GLOBALS['OUTPUT_TYPE'];
@@ -978,7 +990,6 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
       {
       $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS);        
       unset($html_encode_arr['?']);
-      unset($html_encode_arr['&']);
       }
 
     $ltpos = strpos($str, '<');
@@ -990,41 +1001,39 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
       unset($encode_arr['"']);
       unset($encode_arr['<']);
       unset($encode_arr['>']);
+      unset($encode_arr['&']);
       }
     else if ($mode=='remove')
       $str = strip_tags($str);
-      
-    $out = strtr($str, $encode_arr);
+    
+    // avoid douple quotation of &
+    $out = preg_replace('/&amp;([a-z]{2,5}|#[0-9]{2,4});/', '&\\1;', 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 the replace tables for XML and JS are not yet defined
   if (!$js_rep_table)
     {
-    $js_rep_table = $rtf_rep_table = $xml_rep_table = array();
+    $js_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
+  // encode for XML
   if ($enctype=='xml')
     return strtr($str, $xml_rep_table);
 
@@ -1032,18 +1041,32 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
   if ($enctype=='js')
     {
     if ($OUTPUT->get_charset()!='UTF-8')
-      $str = rcube_charset_convert($str, $GLOBALS['CHARSET'], $OUTPUT->get_charset());
+      $str = rcube_charset_convert($str, RCMAIL_CHARSET, $OUTPUT->get_charset());
       
-    return preg_replace(array("/\r\n/", '/"/', "/([^\\\])'/"), array('\n', '\"', "$1\'"), strtr($str, $js_rep_table));
+    return preg_replace(array("/\r?\n/", "/\r/"), array('\n', '\n'), addslashes(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;
   }
+  
+/**
+ * Quote a given string. Alias function for rep_specialchars_output
+ * @see rep_specialchars_output
+ */
+function Q($str, $mode='strict', $newlines=TRUE)
+  {
+  return rep_specialchars_output($str, 'html', $mode, $newlines);
+  }
+
+/**
+ * Quote a given string. Alias function for rep_specialchars_output
+ * @see rep_specialchars_output
+ */
+function JQ($str)
+  {
+  return rep_specialchars_output($str, 'js');
+  }
 
 
 /**
@@ -1098,14 +1121,19 @@ function strip_quotes($str)
   return preg_replace('/[\'"]/', '', $str);
 }
 
-
-// ************** template parsing and gui functions **************
+/**
+ * Remove new lines characters from given string
+ */
+function strip_newlines($str)
+{
+  return preg_replace('/[\r\n]/', '', $str);
+}
 
 
 // return boolean if a specific template exists
 function template_exists($name)
   {
-  global $CONFIG, $OUTPUT;
+  global $CONFIG;
   $skin_path = $CONFIG['skin_path'];
 
   // check template file
@@ -1113,352 +1141,11 @@ function template_exists($name)
   }
 
 
-// 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)
+// Wrapper for rcmail_template::parse()
+// @deprecated
+function parse_template($name='main', $exit=true)
   {
-  $output = preg_replace('/<roundcube:([-_a-z]+)\s+([^>]+)>/Uie', "rcube_xml_command('\\1', '\\2')", $input);
-  return $output;
-  }
-
-
-function rcube_xml_command($command, $str_attrib, $add_attrib=array())
-  {
-  global $IMAP, $CONFIG, $OUTPUT;
-  
-  $command = strtolower($command);
-  $attrib = parse_attrib_string($str_attrib) + $add_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;
-  
-  // these commands can be called directly via url
-  $a_static_commands = array('compose', 'list');
-  
-  $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'],
-                                $attrib['imagesel'] ? $skin_path.$attrib['imagesel'] : $attrib['classsel'],
-                                $attrib['imageover'] ? $skin_path.$attrib['imageover'] : ''));
-
-    // make valid href to specific buttons
-    if (in_array($attrib['command'], $MAIN_TASKS))
-      $attrib['href'] = htmlentities(ereg_replace('_task=[a-z]+', '_task='.$attrib['command'], $COMM_PATH));
-    else if (in_array($attrib['command'], $a_static_commands))
-      $attrib['href'] = htmlentities($COMM_PATH.'&_action='.$attrib['command']);
-    }
-
-  // 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', '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 '';
+  $GLOBALS['OUTPUT']->parse($name, $exit);
   }
 
 
@@ -1476,12 +1163,11 @@ function rcube_table_output($attrib, $table_data, $a_show_cols, $id_col)
   $table .= "<thead><tr>\n";
 
   foreach ($a_show_cols as $col)
-    $table .= '<td class="'.$col.'">' . rep_specialchars_output(rcube_label($col)) . "</td>\n";
+    $table .= '<td class="'.$col.'">' . Q(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)))
@@ -1493,8 +1179,8 @@ function rcube_table_output($attrib, $table_data, $a_show_cols, $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";
+        $cont = Q($sql_arr[$col]);
+        $table .= '<td class="'.$col.'">' . $cont . "</td>\n";
         }
 
       $table .= "</tr>\n";
@@ -1512,8 +1198,8 @@ function rcube_table_output($attrib, $table_data, $a_show_cols, $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";
+        $cont = Q($row_data[$col]);
+        $table .= '<td class="'.$col.'">' . $cont . "</td>\n";
         }
 
       $table .= "</tr>\n";
@@ -1528,7 +1214,15 @@ function rcube_table_output($attrib, $table_data, $a_show_cols, $id_col)
   }
 
 
-
+/**
+ * Create an edit field for inclusion on a form
+ * 
+ * @param string col field name
+ * @param string value field value
+ * @param array attrib HTML element attributes for field
+ * @param string type HTML element type (default 'text')
+ * @return string HTML field definition
+ */
 function rcmail_get_edit_field($col, $value, $attrib, $type='text')
   {
   $fname = '_'.$col;
@@ -1557,6 +1251,24 @@ function rcmail_get_edit_field($col, $value, $attrib, $type='text')
   }
 
 
+// return the mail domain configured for the given host
+function rcmail_mail_domain($host)
+  {
+  global $CONFIG;
+
+  $domain = $host;
+  if (is_array($CONFIG['mail_domain']))
+    {
+    if (isset($CONFIG['mail_domain'][$host]))
+      $domain = $CONFIG['mail_domain'][$host];
+    }
+  else if (!empty($CONFIG['mail_domain']))
+    $domain = $CONFIG['mail_domain'];
+
+  return $domain;
+  }
+
+
 // compose a valid attribute string for HTML tags
 function create_attrib_string($attrib, $allowed_attribs=array('id', 'class', 'style'))
   {
@@ -1574,12 +1286,12 @@ function create_attrib_string($attrib, $allowed_attribs=array('id', 'class', 'st
 function parse_attrib_string($str)
   {
   $attrib = array();
-  preg_match_all('/\s*([-_a-z]+)=["]([^"]+)["]?/i', stripslashes($str), $regs, PREG_SET_ORDER);
+  preg_match_all('/\s*([-_a-z]+)=(["\'])([^"]+)\2/Ui', stripslashes($str), $regs, PREG_SET_ORDER);
 
   // convert attributes to an associative array (name => value)
   if ($regs)
     foreach ($regs as $attr)
-      $attrib[strtolower($attr[1])] = $attr[2];
+      $attrib[strtolower($attr[1])] = $attr[3];
 
   return $attrib;
   }
@@ -1611,15 +1323,15 @@ function format_date($date, $format=NULL)
   $now = time();  // local time
   $now -= (int)date('Z'); // make GMT time
   $now += ($tz * 3600); // user's time
-  $now_date = getdate();
+  $now_date = getdate($now);
 
   $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)
+  if ($CONFIG['prettydate'] && !$format && $timestamp > $today_limit && $timestamp < $now)
+    return sprintf('%s %s', rcube_label('today'), date($CONFIG['date_today'] ? $CONFIG['date_today'] : 'H:i', $timestamp));
+  else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit && $timestamp < $now)
     $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';
@@ -1656,13 +1368,23 @@ function format_date($date, $format=NULL)
   }
 
 
+function format_email_recipient($email, $name='')
+  {
+  if ($name && $name != $email)
+    return sprintf('%s <%s>', strpos($name, ",") ? '"'.$name.'"' : $name, $email);
+  else
+    return $email;
+  }
+
+
+
 // ************** functions delivering gui objects **************
 
 
 
 function rcmail_message_container($attrib)
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT;
 
   if (!$attrib['id'])
     $attrib['id'] = 'rcmMessageContainer';
@@ -1671,7 +1393,7 @@ function rcmail_message_container($attrib)
   $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]');");
+  $OUTPUT->add_gui_object('message', $attrib['id']);
   
   return $out;
   }
@@ -1712,14 +1434,14 @@ function rcmail_current_username($attrib)
 // return code for the webmail login form
 function rcmail_login_form($attrib)
   {
-  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $SESS_HIDDEN_FIELD;
+  global $CONFIG, $OUTPUT, $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', 'id' => 'rcmloginuser', 'size' => 30));
+  $input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off'));
   $input_pass = new passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'size' => 30));
   $input_action = new hiddenfield(array('name' => '_action', 'value' => 'login'));
     
@@ -1733,14 +1455,22 @@ function rcmail_login_form($attrib)
     $select_host = new select(array('name' => '_host', 'id' => 'rcmloginhost'));
     
     foreach ($CONFIG['default_host'] as $key => $value)
-      $select_host->add($value, (is_numeric($key) ? $value : $key));
+    {
+      if (!is_array($value))
+        $select_host->add($value, (is_numeric($key) ? $value : $key));
+      else
+        {
+        unset($select_host);
+        break;
+        }
+    }
       
-    $fields['host'] = $select_host->show($_POST['_host']);
+    $fields['host'] = isset($select_host) ? $select_host->show($_POST['_host']) : null;
     }
   else if (!strlen($CONFIG['default_host']))
     {
-       $input_host = new textfield(array('name' => '_host', 'id' => 'rcmloginhost', 'size' => 30));
-       $fields['host'] = $input_host->show($_POST['_host']);
+    $input_host = new textfield(array('name' => '_host', 'id' => 'rcmloginhost', 'size' => 30));
+    $fields['host'] = $input_host->show($_POST['_host']);
     }
 
   $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
@@ -1757,7 +1487,7 @@ function rcmail_login_form($attrib)
 
 EOF;
 
-  $OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('loginform', '$form_name');");
+  $OUTPUT->add_gui_object('loginform', $form_name);
   
   $out = <<<EOF
 $form_start
@@ -1818,7 +1548,91 @@ function rcmail_charset_selector($attrib)
   }
 
 
-/****** debugging function ********/
+// return code for search function
+function rcmail_search_form($attrib)
+  {
+  global $OUTPUT;
+
+  // 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_gui_object('qsearchbox', $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;
+  } 
+
+
+/****** debugging functions ********/
+
+
+/**
+ * Print or write debug messages
+ *
+ * @param mixed Debug message or data
+ */
+function console($msg)
+  {
+  if (!is_string($msg))
+    $msg = var_export($msg, true);
+
+  if (!($GLOBALS['CONFIG']['debug_level'] & 4))
+    write_log('console', $msg);
+  else if ($GLOBALS['REMOTE_REQUEST'])
+    print "/*\n $msg \n*/\n";
+  else
+    {
+    print '<div style="background:#eee; border:1px solid #ccc; margin-bottom:3px; padding:6px"><pre>';
+    print $msg;
+    print "</pre></div>\n";
+    }
+  }
+
+
+/**
+ * Append a line to a logfile in the logs directory.
+ * Date will be added automatically to the line.
+ *
+ * @param $name Name of logfile
+ * @param $line Line to append
+ */
+function write_log($name, $line)
+  {
+  global $CONFIG;
+
+  if (!is_string($line))
+    $line = var_export($line, true);
+  
+  $log_entry = sprintf("[%s]: %s\n",
+                 date("d-M-Y H:i:s O", mktime()),
+                 $line);
+                 
+  if (empty($CONFIG['log_dir']))
+    $CONFIG['log_dir'] = $INSTALL_PATH.'logs';
+      
+  // try to open specific log file for writing
+  if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a'))    
+    {
+    fwrite($fp, $log_entry);
+    fclose($fp);
+    }
+  }
+
 
 function rcube_timer()
   {
diff --git a/program/include/rcmail_template.inc b/program/include/rcmail_template.inc
new file mode 100644 (file)
index 0000000..3609bec
--- /dev/null
@@ -0,0 +1,631 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/include/rcmail_template.inc                                   |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2007, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Class to handle HTML page output using a skin template.             |
+ |   Extends rcube_html_page class from rcube_shared.inc                 |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com>                        |
+ +-----------------------------------------------------------------------+
+
+ $Id:  $
+
+*/
+
+require_once('include/rcube_shared.inc');
+
+
+class rcmail_template extends rcube_html_page
+{
+  var $config;
+  var $task = '';
+  var $framed = false;
+  var $ajax_call = false;
+  var $pagetitle = '';
+  var $env = array();
+  var $js_env = array();
+  var $js_commands = array();
+  var $object_handlers = array();
+
+
+  // PHP 5 constructor
+  function __construct(&$config, $task)
+  {
+    parent::__construct();
+    
+    $this->task = $task;
+    $this->config = $config;
+    $this->ajax_call = !empty($_GET['_remote']) || !empty($_POST['_remote']);
+    
+    // add common javascripts
+    if (!$this->ajax_call)
+    {
+      $javascript = "var ".JS_OBJECT_NAME." = new rcube_webmail();";
+
+      // don't wait for page onload. Call init at the bottom of the page (delayed)
+      $javascript_foot = "if (window.call_init)\n call_init('".JS_OBJECT_NAME."');";
+
+      $this->add_script($javascript, 'head_top');
+      $this->add_script($javascript_foot, 'foot');
+      $this->scripts_path = 'program/js/';
+      $this->include_script('common.js');
+      $this->include_script('app.js');
+    }
+  }
+
+  // PHP 4 compatibility
+  function rcmail_template(&$config, $task)
+  {
+    $this->__construct($config, $task);
+  }
+  
+  
+  /**
+   * Set environment variable
+   */
+  function set_env($name, $value, $addtojs=true)
+  {
+    $this->env[$name] = $value;
+    if ($addtojs || isset($this->js_env[$name]))
+      $this->js_env[$name] = $value;
+  }
+
+
+  /**
+   * Set page title variable
+   */
+  function set_pagetitle($title)
+  {
+    $this->pagetitle = $title;
+  }
+
+
+  /**
+   * Register a template object handler
+   *
+   * @param string Object name
+   * @param string Function name to call
+   */
+  function add_handler($obj, $func)
+  {
+    $this->object_handlers[$obj] = $func;
+  }
+
+  /**
+   * Register a list of template object handlers
+   *
+   * @param array Hash array with object=>handler pairs
+   */
+  function add_handlers($arr)
+  {
+    $this->object_handlers = array_merge($this->object_handlers, $arr);
+  }
+
+  /**
+   * Register a GUI object to the client script
+   *
+   * @param string Object name
+   * @param string Object ID
+   */
+  function add_gui_object($obj, $id)
+  {
+    $this->add_script(JS_OBJECT_NAME.".gui_object('$obj', '$id');");
+  }
+
+
+  /**
+   * Call a client method
+   *
+   * @param string Method to call
+   * @param ... Additional arguments
+   */
+  function command()
+  {
+    $this->js_commands[] = func_get_args();
+  }
+
+
+  /**
+   * Invoke display_message command
+   */
+  function show_message($message, $type='notice', $vars=NULL)
+  {
+    $this->command(
+      'display_message',
+      rcube_label(array('name' => $message, 'vars' => $vars)),
+      $type);
+  }
+
+
+  /**
+   * Delete all stored env variables and commands
+   */
+  function reset()
+  {
+    $this->env = array();
+    $this->js_env = array();
+    $this->js_commands = array();
+    $this->object_handlers = array();    
+    parent::reset();
+  }
+
+  /**
+   * Send the request output to the client.
+   * This will either parse a skin tempalte or send an AJAX response
+   *
+   * @param string  Template name
+   * @param boolean True if script should terminate (default)
+   */
+  function send($templ=null, $exit=true)
+  {
+    if ($this->ajax_call)
+      $this->remote_response('', !$exit);
+    else if ($templ != 'iframe')
+      $this->parse($templ, false);
+    else
+    {
+      $this->framed = $templ == 'iframe' ? true : $this->framed;
+      $this->write();
+    }
+    
+    if ($exit)
+      exit;
+  }
+
+
+  /**
+   * Send an AJAX response with executable JS code
+   * 
+   * @param string  Additional JS code
+   * @param boolean True if output buffer should be flushed
+   */
+  function remote_response($add='', $flush=false)
+  {
+    static $s_header_sent = FALSE;
+
+    if (!$s_header_sent)
+    {
+      $s_header_sent = TRUE;
+      send_nocacheing_headers();
+      header('Content-Type: application/x-javascript; charset='.RCMAIL_CHARSET);
+      print '/** ajax response ['.date('d/M/Y h:i:s O')."] **/\n";
+    }
+    
+    // unset default env vars
+    unset($this->js_env['task'], $this->js_env['action'], $this->js_env['comm_path']);
+
+    // send response code
+    print rcube_charset_convert($this->get_js_commands() . $add, RCMAIL_CHARSET, $this->get_charset());
+
+    if ($flush)  // flush the output buffer
+      flush();
+  }
+  
+  
+  /**
+   * @override
+   */
+  function write($template='')
+  {
+    // write all env variables to client
+    $js = $this->framed ? "if(window.parent) {\n" : '';
+    $js .= $this->get_js_commands() . ($this->framed ? ' }' : '');
+    $this->add_script($js, 'head_top');
+
+    // call super method
+    parent::write($template, $this->config['skin_path']);
+  }
+
+
+  /**
+   * Parse a specific skin template and deliver to stdout
+   *
+   * @param string  Template name
+   * @param boolean Exit script
+   */  
+  function parse($name='main', $exit=true)
+  {
+    $skin_path = $this->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' => 501,
+        'type' => 'php',
+        'line' => __LINE__,
+        'file' => __FILE__,
+        'message' => "Error loading template for '$name'"), TRUE, TRUE);
+      return FALSE;
+    }
+
+    // parse for specialtags
+    $output = $this->parse_xml($this->parse_conditions($templ));
+
+    // add debug console
+    if ($this->config['debug_level'] & 8)
+      $this->add_footer('<div style="position:absolute;top:5px;left:5px;width:400px;padding:0.2em;background:white;opacity:0.8;z-index:9000">
+        <a href="#toggle" onclick="con=document.getElementById(\'dbgconsole\');con.style.display=(con.style.display==\'none\'?\'block\':\'none\');return false">console</a>
+        <form action="/" name="debugform"><textarea name="console" id="dbgconsole" rows="20" cols="40" wrap="off" style="display:none;width:400px;border:none;font-size:x-small"></textarea></form></div>');
+
+    $this->write(trim($this->parse_with_globals($output)), $skin_path);
+
+    if ($exit)
+      exit;
+  }
+
+
+  /**
+   * Return executable javascript code for all registered commands
+   * @private
+   */
+  function get_js_commands()
+  {
+    $out = '';
+    if (!$this->framed)
+      $out .= ($this->ajax_call ? 'this' : JS_OBJECT_NAME) . '.set_env('.json_serialize($this->js_env).");\n";
+    
+    foreach ($this->js_commands as $i => $args)
+    {
+      $method = array_shift($args);
+      foreach ($args as $i => $arg)
+        $args[$i] = json_serialize($arg);
+
+      $parent = $this->framed || preg_match('/^parent\./', $method);
+      $out .= sprintf(
+        "%s.%s(%s);\n",
+        $this->ajax_call ? 'this' : ($parent ? 'parent.' : '') . JS_OBJECT_NAME,
+        preg_replace('/^parent\./', '', $method),
+        join(',', $args));
+    }
+    
+    return $out;
+  }
+  
+  /**
+   * Make URLs starting with a slash point to skin directory
+   */
+  function abs_url($str)
+  {
+    return preg_replace('/^\//', $this->config['skin_path'].'/', $str);
+  }
+
+
+
+  /*****  Template parsing methods  *****/
+  
+  /**
+   * Replace all strings ($varname) with the content
+   * of the according global variable.
+   */
+  function parse_with_globals($input)
+  {
+    $GLOBALS['__comm_path'] = $GLOBALS['COMM_PATH'];
+    return preg_replace('/\$(__[a-z0-9_\-]+)/e', '$GLOBALS["\\1"]', $input);
+  }
+  
+  
+  /**
+   * Parse for conditional tags
+   */
+  function parse_conditions($input)
+  {
+    if (($matches = preg_split('/<roundcube:(if|elseif|else|endif)\s+([^>]+)>/is', $input, 2, PREG_SPLIT_DELIM_CAPTURE)) && count($matches)==4)
+    {
+      if (preg_match('/^(else|endif)$/i', $matches[1]))
+        return $matches[0] . $this->parse_conditions($matches[3]);
+      else
+      {
+        $attrib = parse_attrib_string($matches[2]);
+        if (isset($attrib['condition']))
+        {
+          $condmet = $this->check_condition($attrib['condition']);
+          $submatches = preg_split('/<roundcube:(elseif|else|endif)\s+([^>]+)>/is', $matches[3], 2, PREG_SPLIT_DELIM_CAPTURE);
+
+          if ($condmet)
+            $result = $submatches[0] . ($submatches[1] != 'endif' ? preg_replace('/.*<roundcube:endif\s+[^>]+>/Uis', '', $submatches[3], 1) : $submatches[3]);
+          else
+            $result = "<roundcube:$submatches[1] $submatches[2]>" . $submatches[3];
+
+          return $matches[0] . $this->parse_conditions($result);
+        }
+        else
+        {
+          raise_error(array('code' => 500, 'type' => 'php', 'line' => __LINE__, 'file' => __FILE__,
+                            'message' => "Unable to parse conditional tag " . $matches[2]), TRUE, FALSE);
+        }
+      }
+    }
+
+    return $input;
+  }
+
+
+  /**
+   * Determines if a given condition is met
+   *
+   * @return True if condition is valid, False is not
+   */
+  function check_condition($condition)
+  {
+    $condition = preg_replace(
+        array('/session:([a-z0-9_]+)/i', '/config:([a-z0-9_]+)/i', '/env:([a-z0-9_]+)/i', '/request:([a-z0-9_]+)/ie'),
+        array("\$_SESSION['\\1']", "\$this->config['\\1']", "\$this->env['\\1']", "get_input_value('\\1', RCUBE_INPUT_GPC)"),
+        $condition);
+
+    return @eval("return (".$condition.");");
+  }
+
+
+  /**
+   * Search for special tags in input and replace them
+   * with the appropriate content
+   *
+   * @param string Input string to parse
+   * @return Altered input string
+   */
+  function parse_xml($input)
+  {
+    return preg_replace('/<roundcube:([-_a-z]+)\s+([^>]+)>/Uie', "\$this->xml_command('\\1', '\\2')", $input);
+  }
+
+
+  /**
+   * Convert a xml command tag into real content
+   *
+   * @param string Tag command: object,button,label, etc.
+   * @param string Attribute string
+   * @return Tag/Object content string
+   */
+  function xml_command($command, $str_attrib, $add_attrib=array())
+    {
+    $command = strtolower($command);
+    $attrib = parse_attrib_string($str_attrib) + $add_attrib;
+
+    // empty output if required condition is not met
+    if (!empty($attrib['condition']) && !$this->check_condition($attrib['condition']))
+      return '';
+
+    // execute command
+    switch ($command)
+    {
+      // return a button
+      case 'button':
+        if ($attrib['command'])
+          return $this->button($attrib);
+        break;
+
+      // show a label
+      case 'label':
+        if ($attrib['name'] || $attrib['command'])
+          return Q(rcube_label($attrib + array('vars' => array('product' => $this->config['product_name']))));
+        break;
+
+      // include a file 
+      case 'include':
+        $path = realpath($this->config['skin_path'].$attrib['file']);
+        if ($fp = @fopen($path, 'r'))
+        {
+          $incl = fread($fp, filesize($path));
+          fclose($fp);        
+          return $this->parse_xml($incl);
+        }
+        break;
+
+      // return code for a specific application object
+      case 'object':
+        $object = strtolower($attrib['name']);
+
+        // execute object handler function
+        if ($this->object_handlers[$object] && function_exists($this->object_handlers[$object]))
+          return call_user_func($this->object_handlers[$object], $attrib);
+
+        else if ($object=='productname')
+          {
+          $name = !empty($this->config['product_name']) ? $this->config['product_name'] : 'RoundCube Webmail';
+          return Q($name);
+          }
+        else if ($object=='version')
+          {
+          return (string)RCMAIL_VERSION;
+          }
+        else if ($object=='pagetitle')
+          {
+          $task = $this->task;
+          $title = !empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '';
+
+          if (!empty($this->pagetitle))
+            $title .= $this->pagetitle;
+          else if ($task == 'login')
+            $title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name'])));
+          else
+            $title .= ucfirst($task);
+
+          return Q($title);
+          }
+
+        break;
+      }
+
+    return '';
+    }
+
+
+  /**
+   * Create and register a button
+   *
+   * @param array Button attributes
+   * @return HTML button
+   */
+  function button($attrib)
+    {
+    global $CONFIG, $OUTPUT, $BROWSER, $MAIN_TASKS;
+    static $sa_buttons = array();
+    static $s_button_count = 100;
+
+    // these commands can be called directly via url
+    $a_static_commands = array('compose', 'list');
+
+    $skin_path = $this->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'] || $attrib['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'] || $attrib['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'] = Q(rcube_label($attrib['title']));
+    if ($attrib['label'])
+      $attrib['label'] = Q(rcube_label($attrib['label']));
+
+    if ($attrib['alt'])
+      $attrib['alt'] = Q(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'])
+    {
+      $this->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'],
+        $attrib['imagesel'] ? $skin_path.$attrib['imagesel'] : $attrib['classsel'],
+        $attrib['imageover'] ? $skin_path.$attrib['imageover'] : '')
+      );
+
+      // make valid href to specific buttons
+      if (in_array($attrib['command'], $MAIN_TASKS))
+        $attrib['href'] = Q(rcmail_url(null, null, $attrib['command']));
+      else if (in_array($attrib['command'], $a_static_commands))
+        $attrib['href'] = Q(rcmail_url($attrib['command']));
+    }
+
+    // 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', '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;
+  }
+
+}
+
+?>
\ No newline at end of file
diff --git a/program/include/rcube_contacts.inc b/program/include/rcube_contacts.inc
new file mode 100644 (file)
index 0000000..3902e2a
--- /dev/null
@@ -0,0 +1,429 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/include/rcube_contacts.inc                                    |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2006-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Interface to the local address book database                        |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com>                        |
+ +-----------------------------------------------------------------------+
+
+ $Id: rcube_contacts.inc 328 2006-08-30 17:41:21Z thomasb $
+
+*/
+
+class rcube_contacts
+{
+  var $db = null;
+  var $db_name = '';
+  var $user_id = 0;
+  var $filter = null;
+  var $result = null;
+  var $search_fields;
+  var $search_string;
+  var $table_cols = array('name', 'email', 'firstname', 'surname');
+  
+  /** public properties */
+  var $primary_key = 'contact_id';
+  var $readonly = false;
+  var $list_page = 1;
+  var $page_size = 10;
+  var $ready = false;
+
+  
+  /**
+   * Object constructor
+   *
+   * @param object  Instance of the rcube_db class
+   * @param integer User-ID
+   */
+  function __construct($dbconn, $user)
+  {
+    $this->db = $dbconn;
+    $this->db_name = get_table_name('contacts');
+    $this->user_id = $user;
+    $this->ready = $this->db && !$this->db->is_error();
+  }
+
+  /**
+   * PHP 4 object constructor
+   *
+   * @see  rcube_contacts::__construct
+   */
+  function rcube_contacts($dbconn, $user)
+  {
+    $this->__construct($dbconn, $user);
+  }
+
+
+  /**
+   * 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;
+  }
+
+
+  /**
+   * Save a search string for future listings
+   *
+   * @param  string SQL params to use in listing method
+   */
+  function set_search_set($filter)
+  {
+    $this->filter = $filter;
+  }
+  
+  
+  /**
+   * Getter for saved search properties
+   *
+   * @return mixed Search properties used by this class
+   */
+  function get_search_set()
+  {
+    return $this->filter;
+  }
+
+
+  /**
+   * Reset all saved results and search parameters
+   */
+  function reset()
+  {
+    $this->result = null;
+    $this->filter = null;
+    $this->search_fields = null;
+    $this->search_string = null;
+  }
+  
+  
+  /**
+   * List the current set of contact records
+   *
+   * @param  array  List of cols to show
+   * @return array  Indexed list of contact records, each a hash array
+   */
+  function list_records($cols=null, $subset=0)
+  {
+    // count contacts for this user
+    $this->result = $this->count();
+    $sql_result = NULL;
+
+    // get contacts from DB
+    if ($this->result->count)
+    {
+      $start_row = $subset < 0 ? $this->result->first + $this->page_size + $subset : $this->result->first;
+      $length = $subset != 0 ? abs($subset) : $this->page_size;
+      
+      $sql_result = $this->db->limitquery(
+        "SELECT * FROM ".$this->db_name."
+         WHERE  del<>1
+         AND    user_id=?" .
+        ($this->filter ? " AND (".$this->filter.")" : "") .
+        " ORDER BY name",
+        $start_row,
+        $length,
+        $this->user_id);
+    }
+    
+    while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result)))
+    {
+      $sql_arr['ID'] = $sql_arr[$this->primary_key];
+      // make sure we have a name to display
+      if (empty($sql_arr['name']))
+        $sql_arr['name'] = $sql_arr['email'];
+      $this->result->add($sql_arr);
+    }
+    
+    return $this->result;
+  }
+
+
+  /**
+   * Search contacts
+   *
+   * @param array   List of fields to search in
+   * @param string  Search value
+   * @param boolean True if results are requested, False if count only
+   * @return Indexed list of contact records and 'count' value
+   */
+  function search($fields, $value, $select=true)
+  {
+    if (!is_array($fields))
+      $fields = array($fields);
+      
+    $add_where = array();
+    foreach ($fields as $col)
+    {
+      if ($col == 'ID' || $col == $this->primary_key)
+      {
+        $ids = !is_array($value) ? split(',', $value) : $value;
+        $add_where[] = $this->primary_key." IN (".join(',', $ids).")";
+      }
+      else
+        $add_where[] = $this->db->quoteIdentifier($col)." LIKE ".$this->db->quote(strlen($value)>2 ? "%$value%" : "$value%");
+    }
+    
+    if (!empty($add_where))
+    {
+      $this->set_search_set(join(' OR ', $add_where));
+      if ($select)
+        $this->list_records();
+      else
+        $this->result = $this->count();
+    }
+   
+    return $this->result; 
+  }
+
+
+  /**
+   * Count number of available contacts in database
+   *
+   * @return Result array with values for 'count' and 'first'
+   */
+  function count()
+  {
+    // count contacts for this user
+    $sql_result = $this->db->query(
+      "SELECT COUNT(contact_id) AS rows
+       FROM ".$this->db_name."
+       WHERE  del<>1
+       AND    user_id=?".
+       ($this->filter ? " AND (".$this->filter.")" : ""),
+      $this->user_id);
+
+    $sql_arr = $this->db->fetch_assoc($sql_result);
+    return new rcube_result_set($sql_arr['rows'], ($this->list_page-1) * $this->page_size);;
+  }
+
+
+  /**
+   * Return the last result set
+   *
+   * @return Result array or NULL if nothing selected yet
+   */
+  function get_result($as_res=true)
+  {
+    return $this->result;
+  }
+  
+  
+  /**
+   * Get a specific contact record
+   *
+   * @param mixed record identifier(s)
+   * @return Result object with all record fields or False if not found
+   */
+  function get_record($id, $assoc=false)
+  {
+    // return cached result
+    if ($this->result && ($first = $this->result->first()) && $first[$this->primary_key] == $id)
+      return $assoc ? $first : $this->result;
+      
+    $this->db->query(
+      "SELECT * FROM ".$this->db_name."
+       WHERE  contact_id=?
+       AND    user_id=?
+       AND    del<>1",
+      $id,
+      $this->user_id);
+
+    if ($sql_arr = $this->db->fetch_assoc())
+    {
+      $sql_arr['ID'] = $sql_arr[$this->primary_key];
+      $this->result = new rcube_result_set(1);
+      $this->result->add($sql_arr);
+    }
+
+    return $assoc && $sql_arr ? $sql_arr : $this->result;
+  }
+  
+  
+  /**
+   * Create a new contact record
+   *
+   * @param array Assoziative array with save data
+   * @return The created record ID on success, False on error
+   */
+  function insert($save_data, $check=false)
+  {
+    if (is_object($save_data) && is_a($save_data, rcube_result_set))
+      return $this->insert_recset($save_data, $check);
+
+    $insert_id = $existing = false;
+
+    if ($check)
+      $existing = $this->search('email', $save_data['email'], false);
+
+    $a_insert_cols = $a_insert_values = array();
+    foreach ($this->table_cols as $col)
+      if (isset($save_data[$col]))
+      {
+        $a_insert_cols[] = $this->db->quoteIdentifier($col);
+        $a_insert_values[] = $this->db->quote($save_data[$col]);
+      }
+    
+    if (!$existing->count && !empty($a_insert_cols))
+    {
+      $this->db->query(
+        "INSERT INTO ".$this->db_name."
+         (user_id, changed, del, ".join(', ', $a_insert_cols).")
+         VALUES (?, ".$this->db->now().", 0, ".join(', ', $a_insert_values).")",
+        $this->user_id);
+        
+      $insert_id = $this->db->insert_id(get_sequence_name('contacts'));
+    }
+    
+    return $insert_id;
+  }
+
+
+  /**
+   * Insert new contacts for each row in set
+   */
+  function insert_recset($result, $check=false)
+  {
+    $ids = array();
+    while ($row = $result->next())
+    {
+      if ($insert = $this->insert($row, $check))
+        $ids[] = $insert;
+    }
+    return $ids;
+  }
+  
+  
+  /**
+   * Update a specific contact record
+   *
+   * @param mixed Record identifier
+   * @param array Assoziative array with save data
+   * @return True on success, False on error
+   */
+  function update($id, $save_cols)
+  {
+    $updated = false;
+    $write_sql = array();
+    foreach ($this->table_cols as $col)
+      if (isset($save_cols[$col]))
+        $write_sql[] = sprintf("%s=%s", $this->db->quoteIdentifier($col), $this->db->quote($save_cols[$col]));
+
+    if (!empty($write_sql))
+    {
+      $this->db->query(
+        "UPDATE ".$this->db_name."
+         SET    changed=".$this->db->now().", ".join(', ', $write_sql)."
+         WHERE  contact_id=?
+         AND    user_id=?
+         AND    del<>1",
+        $id,
+        $this->user_id);
+
+      $updated = $this->db->affected_rows();
+    }
+    
+    return $updated;
+  }
+  
+  
+  /**
+   * Mark one or more contact records as deleted
+   *
+   * @param array  Record identifiers
+   */
+  function delete($ids)
+  {
+    if (is_array($ids))
+      $ids = join(',', $ids);
+
+    $this->db->query(
+      "UPDATE ".$this->db_name."
+       SET    del=1
+       WHERE  user_id=?
+       AND    contact_id IN (".$ids.")",
+      $this->user_id);
+
+    return $this->db->affected_rows();
+  }
+
+}
+
+
+/**
+ * RoundCube result set class.
+ * Representing an address directory result set.
+ */
+class rcube_result_set
+{
+  var $count = 0;
+  var $first = 0;
+  var $current = 0;
+  var $records = array();
+  
+  function __construct($c=0, $f=0)
+  {
+    $this->count = (int)$c;
+    $this->first = (int)$f;
+  }
+  
+  function rcube_result_set($c=0, $f=0)
+  {
+    $this->__construct($c, $f);
+  }
+  
+  function add($rec)
+  {
+    $this->records[] = $rec;
+  }
+  
+  function iterate()
+  {
+    return $this->records[$this->current++];
+  }
+  
+  function first()
+  {
+    $this->current = 0;
+    return $this->records[$this->current++];
+  }
+  
+  // alias
+  function next()
+  {
+    return $this->iterate();
+  }
+  
+  function seek($i)
+  {
+    $this->current = $i;
+  }
+  
+}
+
+
+?>
\ No newline at end of file
index 8c2abe2b640103d98f73e895d215fc94797d33e4..65104834ae08e30600e0abe1652a0ffc548fa1b7 100755 (executable)
@@ -5,7 +5,7 @@
  | program/include/rcube_db.inc                                          |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -17,7 +17,7 @@
  |         Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_db.inc 262 2006-06-25 09:17:07Z thomasb $
+ $Id: rcube_db.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
@@ -102,7 +102,7 @@ class rcube_db
       $this->db_error = TRUE;
       $this->db_error_msg = $dbh->getMessage();
 
-      raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
+      raise_error(array('code' => 603, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
                         'message' => $this->db_error_msg), TRUE, FALSE);
                         
       return FALSE;
@@ -292,14 +292,17 @@ class rcube_db
     switch($this->db_provider)
       {
       case 'pgsql':
-        // PostgreSQL uses sequences
         $result = &$this->db_handle->getOne("SELECT CURRVAL('$sequence')");
         if (DB::isError($result))
-          {
           raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 
                             'message' => $result->getMessage()), TRUE, FALSE);
-          }
+        return $result;
 
+      case 'mssql':
+        $result = &$this->db_handle->getOne("SELECT @@IDENTITY");
+        if (DB::isError($result))
+          raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 
+                            'message' => $result->getMessage()), TRUE, FALSE);
         return $result;
                 
       case 'mysql': // This is unfortuneate
@@ -307,7 +310,7 @@ class rcube_db
 
       case 'mysqli':
         return mysqli_insert_id($this->db_handle->connection);
-       
+
       case 'sqlite':
         return sqlite_last_insert_rowid($this->db_handle->connection);
 
@@ -357,12 +360,14 @@ class rcube_db
    */
   function _fetch_row($result, $mode)
     {
-    if (DB::isError($result))
+    if (!$result || DB::isError($result))
       {
       raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
                         'message' => $this->db_link->getMessage()), TRUE, FALSE);
       return FALSE;
       }
+      elseif (!is_object($result))
+      return FALSE;
                          
     return $result->fetchRow($mode);
     }
@@ -421,6 +426,25 @@ class rcube_db
     }
 
 
+  /*
+   * Return SQL function for current time and date
+   *
+   * @return string SQL function to use in query
+   * @access public
+   */
+  function now()
+    {
+    switch($this->db_provider)
+      {
+      case 'mssql':
+        return "getdate()";
+
+      default:
+        return "now()";
+      }
+    }
+
+
   /**
    * Return SQL statement to convert a field value into a unix timestamp
    *
@@ -434,7 +458,9 @@ class rcube_db
       {
       case 'pgsql':
         return "EXTRACT (EPOCH FROM $field)";
-        break;
+
+      case 'mssql':
+        return "datediff(s, '1970-01-01 00:00:00', $field)";
 
       default:
         return "UNIX_TIMESTAMP($field)";
@@ -456,7 +482,7 @@ class rcube_db
       case 'mysqli':
       case 'mysql':
       case 'sqlite':
-        return "FROM_UNIXTIME($timestamp)";
+        return sprintf("FROM_UNIXTIME(%d)", $timestamp);
 
       default:
         return date("'Y-m-d H:i:s'", $timestamp);
index 5ce8b1512feef915ee2de52ce5eb8fe1a9437526..a777567f7dc6f87d53aebe1493cf05efa8ec2fc6 100644 (file)
@@ -5,7 +5,7 @@
  | program/include/rcube_imap.inc                                        |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2006, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -16,7 +16,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_imap.inc 293 2006-08-04 13:56:08Z thomasb $
+ $Id: rcube_imap.inc 561 2007-05-17 15:18:12Z thomasb $
 
 */
 
@@ -26,7 +26,6 @@
  */
 require_once('lib/imap.inc');
 require_once('lib/mime.inc');
-require_once('lib/utf7.inc');
 
 
 /**
@@ -36,7 +35,7 @@ require_once('lib/utf7.inc');
  *
  * @package    RoundCube Webmail
  * @author     Thomas Bruederli <roundcube@gmail.com>
- * @version    1.31
+ * @version    1.36
  * @link       http://ilohamail.org
  */
 class rcube_imap
@@ -61,6 +60,10 @@ class rcube_imap
   var $msg_headers = array();
   var $capabilities = array();
   var $skip_deleted = FALSE;
+  var $search_set = NULL;
+  var $search_subject = '';
+  var $search_string = '';
+  var $search_charset = '';
   var $debug_level = 1;
 
 
@@ -133,11 +136,10 @@ class rcube_imap
                        'message' => $GLOBALS['iil_error']), TRUE, FALSE);
       }
 
-    // get account namespace
+    // get server properties
     if ($this->conn)
       {
       $this->_parse_capability($this->conn->capability);
-      iil_C_NameSpace($this->conn);
       
       if (!empty($this->conn->delimiter))
         $this->delimiter = $this->conn->delimiter;
@@ -267,6 +269,36 @@ class rcube_imap
     {
     $this->page_size = (int)$size;
     }
+    
+
+  /**
+   * Save a set of message ids for future message listing methods
+   *
+   * @param  array  List of IMAP fields to search in
+   * @param  string Search string
+   * @param  array  List of message ids or NULL if empty
+   */
+  function set_search_set($subject, $str=null, $msgs=null, $charset=null)
+    {
+    if (is_array($subject) && $str == null && $msgs == null)
+      list($subject, $str, $msgs, $charset) = $subject;
+    if ($msgs != null && !is_array($msgs))
+      $msgs = split(',', $msgs);
+      
+    $this->search_subject = $subject;
+    $this->search_string = $str;
+    $this->search_set = is_array($msgs) ? $msgs : NULL;
+    $this->search_charset = $charset;
+    }
+
+
+  /**
+   * Return the saved search set as hash array
+   */
+  function get_search_set()
+    {
+    return array($this->search_subject, $this->search_string, $this->search_set, $this->search_charset);
+    }
 
 
   /**
@@ -404,6 +436,10 @@ class rcube_imap
 
     if (empty($mailbox))
       $mailbox = $this->mailbox;
+      
+    // count search set
+    if ($this->search_set && $mailbox == $this->mailbox && $mode == 'ALL')
+      return count($this->search_set);
 
     $a_mailbox_cache = $this->get_cache('messagecount');
     
@@ -483,7 +519,11 @@ class rcube_imap
     {
     if (!strlen($mailbox))
       return array();
-      
+
+    // use saved message set
+    if ($this->search_set && $mailbox == $this->mailbox)
+      return $this->_list_header_set($mailbox, $this->search_set, $page, $sort_field, $sort_order);
+
     if ($sort_field!=NULL)
       $this->sort_field = $sort_field;
     if ($sort_order!=NULL)
@@ -494,10 +534,10 @@ class rcube_imap
 
     list($begin, $end) = $this->_get_message_range($max, $page);
 
-       // mailbox is empty
+    // mailbox is empty
     if ($begin >= $end)
       return array();
-
+      
     $headers_sorted = FALSE;
     $cache_key = $mailbox.'.msg';
     $cache_status = $this->check_cache_status($mailbox, $cache_key);
@@ -540,8 +580,9 @@ class rcube_imap
       $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);
+      // delete cached messages with a higher index than $max+1
+      // Changed $max to $max+1 to fix this bug : #1484295
+      $this->clear_message_cache($cache_key, $max + 1);
 
 
       // kick child process to sync cache
@@ -616,14 +657,14 @@ class rcube_imap
     $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 (!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));
+    // 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));
     }
 
 
@@ -710,7 +751,14 @@ class rcube_imap
     }
     
   
-  // return sorted array of message UIDs
+  /**
+   * Return sorted array of message UIDs
+   *
+   * @param string Mailbox to get index from
+   * @param string Sort column
+   * @param string Sort order [ASC, DESC]
+   * @return array Indexed array with message ids
+   */
   function message_index($mbox_name='', $sort_field=NULL, $sort_order=NULL)
     {
     if ($sort_field!=NULL)
@@ -781,7 +829,6 @@ class rcube_imap
       // message in cache at correct position
       if ($cache_index[$id] == $uid)
         {
-// console("$id / $uid: OK");
         unset($cache_index[$id]);
         continue;
         }
@@ -789,21 +836,17 @@ class rcube_imap
       // 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);
@@ -830,15 +873,29 @@ class rcube_imap
   function search($mbox_name='', $criteria='ALL', $str=NULL, $charset=NULL)
     {
     $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
-    if ($str && $criteria)
+
+    // have an array of criterias => execute multiple searches
+    if (is_array($criteria) && $str)
+      {
+      $results = array();
+      foreach ($criteria as $crit)
+        if ($search_result = $this->search($mbox_name, $crit, $str, $charset))
+          $results = array_merge($results, $search_result);
+      
+      $results = array_unique($results);
+      $this->set_search_set($criteria, $str, $results, $charset);
+      return $results;
+      }
+    else if ($str && $criteria)
       {
       $search = (!empty($charset) ? "CHARSET $charset " : '') . sprintf("%s {%d}\r\n%s", $criteria, strlen($str), $str);
       $results = $this->_search_index($mailbox, $search);
 
-      // try search without charset (probably not supported by server)
-      if (empty($results))
-        $results = $this->_search_index($mailbox, "$criteria $str");
+      // try search with ISO charset (should be supported by server)
+      if (empty($results) && !empty($charset) && $charset!='ISO-8859-1')
+        $results = $this->search($mbox_name, $criteria, rcube_charset_convert($str, $charset, 'ISO-8859-1'), 'ISO-8859-1');
       
+      $this->set_search_set($criteria, $str, $results, $charset);
       return $results;
       }
     else
@@ -866,46 +923,322 @@ class rcube_imap
         
     return $a_messages;
     }
+    
+  
+  /**
+   * Refresh saved search set
+   */
+  function refresh_search()
+    {
+    if (!empty($this->search_subject) && !empty($this->search_string))
+      $this->search_set = $this->search('', $this->search_subject, $this->search_string, $this->search_charset);
+      
+    return $this->get_search_set();
+    }
 
 
+  /**
+   * Return message headers object of a specific message
+   *
+   * @param int     Message ID
+   * @param string  Mailbox to read from 
+   * @param boolean True if $id is the message UID
+   * @return object Message headers representation
+   */
   function get_headers($id, $mbox_name=NULL, $is_uid=TRUE)
     {
     $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
+    $uid = $is_uid ? $id : $this->_id2uid($id);
 
     // get cached headers
-    if ($is_uid && ($headers = $this->get_cached_message($mailbox.'.msg', $id)))
+    if ($uid && ($headers = &$this->get_cached_message($mailbox.'.msg', $uid)))
       return $headers;
 
-    $msg_id = $is_uid ? $this->_uid2id($id) : $id;
-    $headers = iil_C_FetchHeader($this->conn, $mailbox, $msg_id);
+    $headers = iil_C_FetchHeader($this->conn, $mailbox, $id, $is_uid);
 
     // write headers cache
     if ($headers)
-      $this->add_message_cache($mailbox.'.msg', $msg_id, $headers);
+      {
+      if ($is_uid)
+        $this->uid_id_map[$mbox_name][$uid] = $headers->id;
+
+      $this->add_message_cache($mailbox.'.msg', $headers->id, $headers);
+      }
 
     return $headers;
     }
 
 
-  function get_body($uid, $part=1)
+  /**
+   * Fetch body structure from the IMAP server and build
+   * an object structure similar to the one generated by PEAR::Mail_mimeDecode
+   *
+   * @param Int Message UID to fetch
+   * @return object Standard object tree or False on failure
+   */
+  function &get_structure($uid)
     {
+    $cache_key = $this->mailbox.'.msg';
+    $headers = &$this->get_cached_message($cache_key, $uid, true);
+
+    // return cached message structure
+    if (is_object($headers) && is_object($headers->structure))
+      return $headers->structure;
+    
+    // resolve message sequence number
     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);
+    $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id); 
+    $structure = iml_GetRawStructureArray($structure_str);
+    $struct = false;
+
+    // parse structure and add headers
+    if (!empty($structure))
+      {
+      $this->_msg_id = $msg_id;
+      $headers = $this->get_headers($msg_id, NULL, FALSE);
+      
+      $struct = &$this->_structure_part($structure);
+      $struct->headers = get_object_vars($headers);
+
+      // don't trust given content-type
+      if (empty($struct->parts) && !empty($struct->headers['ctype']))
+        {
+        $struct->mime_id = '1';
+        $struct->mimetype = strtolower($struct->headers['ctype']);
+        list($struct->ctype_primary, $struct->ctype_secondary) = explode('/', $struct->mimetype);
+        }
+
+      // write structure to cache
+      if ($this->caching_enabled)
+        $this->add_message_cache($cache_key, $msg_id, $headers, $struct);
+      }
+      
+    return $struct;
+    }
+
+  
+  /**
+   * Build message part object
+   *
+   * @access private
+   */
+  function &_structure_part($part, $count=0, $parent='')
+    {
+    $struct = new rcube_message_part;
+    $struct->mime_id = empty($parent) ? (string)$count : "$parent.$count";
+    
+    // multipart
+    if (is_array($part[0]))
+      {
+      $struct->ctype_primary = 'multipart';
+      
+      // find first non-array entry
+      for ($i=1; count($part); $i++)
+        if (!is_array($part[$i]))
+          {
+          $struct->ctype_secondary = strtolower($part[$i]);
+          break;
+          }
+          
+      $struct->mimetype = 'multipart/'.$struct->ctype_secondary;
+
+      $struct->parts = array();
+      for ($i=0, $count=0; $i<count($part); $i++)
+        if (is_array($part[$i]) && count($part[$i]) > 5)
+          $struct->parts[] = $this->_structure_part($part[$i], ++$count, $struct->mime_id);
+          
+      return $struct;
+      }
+    
+    
+    // regular part
+    $struct->ctype_primary = strtolower($part[0]);
+    $struct->ctype_secondary = strtolower($part[1]);
+    $struct->mimetype = $struct->ctype_primary.'/'.$struct->ctype_secondary;
+
+    // read content type parameters
+    if (is_array($part[2]))
+      {
+      $struct->ctype_parameters = array();
+      for ($i=0; $i<count($part[2]); $i+=2)
+        $struct->ctype_parameters[strtolower($part[2][$i])] = $part[2][$i+1];
+        
+      if (isset($struct->ctype_parameters['charset']))
+        $struct->charset = $struct->ctype_parameters['charset'];
+      }
+    
+    // read content encoding
+    if (!empty($part[5]) && $part[5]!='NIL')
+      {
+      $struct->encoding = strtolower($part[5]);
+      $struct->headers['content-transfer-encoding'] = $struct->encoding;
+      }
+    
+    // get part size
+    if (!empty($part[6]) && $part[6]!='NIL')
+      $struct->size = intval($part[6]);
+
+    // read part disposition
+    $di = count($part) - 2;
+    if ((is_array($part[$di]) && count($part[$di]) == 2 && is_array($part[$di][1])) ||
+        (is_array($part[--$di]) && count($part[$di]) == 2))
+      {
+      $struct->disposition = strtolower($part[$di][0]);
+
+      if (is_array($part[$di][1]))
+        for ($n=0; $n<count($part[$di][1]); $n+=2)
+          $struct->d_parameters[strtolower($part[$di][1][$n])] = $part[$di][1][$n+1];
+      }
+      
+    // get child parts
+    if (is_array($part[8]) && $di != 8)
+      {
+      $struct->parts = array();
+      for ($i=0, $count=0; $i<count($part[8]); $i++)
+        if (is_array($part[8][$i]) && count($part[8][$i]) > 5)
+          $struct->parts[] = $this->_structure_part($part[8][$i], ++$count, $struct->mime_id);
+      }
+
+    // get part ID
+    if (!empty($part[3]) && $part[3]!='NIL')
+      {
+      $struct->content_id = $part[3];
+      $struct->headers['content-id'] = $part[3];
+    
+      if (empty($struct->disposition))
+        $struct->disposition = 'inline';
+      }
+
+    // fetch message headers if message/rfc822
+    if ($struct->ctype_primary=='message')
+      {
+      $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER');
+      $struct->headers = $this->_parse_headers($headers);
+      
+      if (is_array($part[8]) && empty($struct->parts))
+        $struct->parts[] = $this->_structure_part($part[8], ++$count, $struct->mime_id);
+      }
+      
+    // normalize filename property
+    if (!empty($struct->d_parameters['filename']))
+      $struct->filename = $this->decode_mime_string($struct->d_parameters['filename']);
+    else if (!empty($struct->ctype_parameters['name']))
+      $struct->filename = $this->decode_mime_string($struct->ctype_parameters['name']);
+    else if (!empty($struct->headers['content-description']))
+      $struct->filename = $this->decode_mime_string($struct->headers['content-description']);
+      
+    return $struct;
+    }
+    
+  
+  /**
+   * Return a flat array with references to all parts, indexed by part numbers
+   *
+   * @param object Message body structure
+   * @return Array with part number -> object pairs
+   */
+  function get_mime_numbers(&$structure)
+    {
+    $a_parts = array();
+    $this->_get_part_numbers($structure, $a_parts);
+    return $a_parts;
+    }
+  
+  
+  /**
+   * Helper method for recursive calls
+   *
+   * @access 
+   */
+  function _get_part_numbers(&$part, &$a_parts)
+    {
+    if ($part->mime_id)
+      $a_parts[$part->mime_id] = &$part;
+      
+    if (is_array($part->parts))
+      for ($i=0; $i<count($part->parts); $i++)
+        $this->_get_part_numbers($part->parts[$i], $a_parts);
+    }
+  
 
-    $encoding = iml_GetPartEncodingCode($structure, $part);
+  /**
+   * Fetch message body of a specific message from the server
+   *
+   * @param  int    Message UID
+   * @param  string Part number
+   * @param  object Part object created by get_structure()
+   * @param  mixed  True to print part, ressource to write part contents in
+   * @return Message/part body if not printed
+   */
+  function &get_message_part($uid, $part=1, $o_part=NULL, $print=NULL)
+    {
+    if (!($msg_id = $this->_uid2id($uid)))
+      return FALSE;
     
-    if ($encoding==3) $body = $this->mime_decode($body, 'base64');
-    else if ($encoding==4) $body = $this->mime_decode($body, 'quoted-printable');
+    // get part encoding if not provided
+    if (!is_object($o_part))
+      {
+      $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id); 
+      $structure = iml_GetRawStructureArray($structure_str);
+      $part_type = iml_GetPartTypeCode($structure, $part);
+      $o_part = new rcube_message_part;
+      $o_part->ctype_primary = $part_type==0 ? 'text' : ($part_type==2 ? 'message' : 'other');
+      $o_part->encoding = strtolower(iml_GetPartEncodingString($structure, $part));
+      $o_part->charset = iml_GetPartCharset($structure, $part);
+      }
+      
+    // TODO: Add caching for message parts
+
+    if ($print)
+      {
+      iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, ($o_part->encoding=='base64'?3:2));
+      $body = TRUE;
+      }
+    else
+      {
+      $body = iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, 1);
+
+      // decode part body
+      if ($o_part->encoding=='base64' || $o_part->encoding=='quoted-printable')
+        $body = $this->mime_decode($body, $o_part->encoding);
+
+      // convert charset (if text or message part)
+      if ($o_part->ctype_primary=='text' || $o_part->ctype_primary=='message')
+        {
+        // assume ISO-8859-1 if no charset specified
+        if (empty($o_part->charset))
+          $o_part->charset = 'ISO-8859-1';
+
+        $body = rcube_charset_convert($body, $o_part->charset);
+        }
+      }
 
     return $body;
     }
 
 
-  function get_raw_body($uid)
+  /**
+   * Fetch message body of a specific message from the server
+   *
+   * @param  int    Message UID
+   * @return Message/part body
+   * @see    ::get_message_part()
+   */
+  function &get_body($uid, $part=1)
+    {
+    return $this->get_message_part($uid, $part);
+    }
+
+
+  /**
+   * Returns the whole message source as string
+   *
+   * @param int  Message UID
+   * @return Message source string
+   */
+  function &get_raw_body($uid)
     {
     if (!($msg_id = $this->_uid2id($uid)))
       return FALSE;
@@ -915,10 +1248,31 @@ class rcube_imap
 
     return $body;    
     }
+    
+
+  /**
+   * Sends the whole message source to stdout
+   *
+   * @param int  Message UID
+   */ 
+  function print_raw_body($uid)
+    {
+    if (!($msg_id = $this->_uid2id($uid)))
+      return FALSE;
+
+       print iil_C_FetchPartHeader($this->conn, $this->mailbox, $msg_id, NULL);
+       flush();
+       iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, NULL, 2);
+    }
 
 
-  // set message flag to one or several messages
-  // possible flags are: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT
+  /**
+   * Set message flag to one or several messages
+   *
+   * @param mixed  Message UIDs as array or as comma-separated string
+   * @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT
+   * @return True on success, False on failure
+   */
   function set_flag($uids, $flag)
     {
     $flag = strtoupper($flag);
@@ -1019,7 +1373,8 @@ class rcube_imap
     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);
+    $iil_move = iil_C_Move($this->conn, join(',', $a_mids), $from_mbox, $to_mbox);
+    $moved = !($iil_move === false || $iil_move < 0);
     
     // send expunge command in order to have the moved message
     // really deleted from the source mailbox
@@ -1029,6 +1384,10 @@ class rcube_imap
       $this->_clear_messagecount($from_mbox);
       $this->_clear_messagecount($to_mbox);
       }
+      
+    // remove message ids from search set
+    if ($moved && $this->search_set && $from_mbox == $this->mailbox)
+      $this->search_set = array_diff($this->search_set, $a_mids);
 
     // update cached message headers
     $cache_key = $from_mbox.'.msg';
@@ -1037,8 +1396,8 @@ class rcube_imap
       $start_index = 100000;
       foreach ($a_uids as $uid)
         {
-        if(($index = array_search($uid, $a_cache_index)) !== FALSE)
-         $start_index = min($index, $start_index);
+        if (($index = array_search($uid, $a_cache_index)) !== FALSE)
+          $start_index = min($index, $start_index);
         }
 
       // clear cache from the lowest index on
@@ -1078,6 +1437,10 @@ class rcube_imap
       $this->_clear_messagecount($mailbox);
       }
 
+    // remove message ids from search set
+    if ($moved && $this->search_set && $mailbox == $this->mailbox)
+      $this->search_set = array_diff($this->search_set, $a_mids);
+
     // remove deleted messages from cache
     $cache_key = $mailbox.'.msg';
     if ($deleted && ($a_cache_index = $this->get_message_cache_index($cache_key)))
@@ -1085,8 +1448,8 @@ class rcube_imap
       $start_index = 100000;
       foreach ($a_uids as $uid)
         {
-        $index = array_search($uid, $a_cache_index);
-        $start_index = min($index, $start_index);
+        if (($index = array_search($uid, $a_cache_index)) !== FALSE)
+          $start_index = min($index, $start_index);
         }
 
       // clear cache from the lowest index on
@@ -1190,12 +1553,8 @@ class rcube_imap
   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 iil_C_GetQuota($this->conn);
+       
     return FALSE;
     }
 
@@ -1231,7 +1590,11 @@ class rcube_imap
 
 
   /**
-   * create a new mailbox on the server and register it in local cache
+   * Create a new mailbox on the server and register it in local cache
+   *
+   * @param string  New mailbox name (as utf-7 string)
+   * @param boolean True if the new mailbox should be subscribed
+   * @param string  Name of the created mailbox, false on error
    */
   function create_mailbox($name, $subscribe=FALSE)
     {
@@ -1240,12 +1603,10 @@ class rcube_imap
     // replace backslashes
     $name = preg_replace('/[\\\]+/', '-', $name);
 
-    $name_enc = UTF7EncodeString($name);
-
     // reduce mailbox name to 100 chars
-    $name_enc = substr($name_enc, 0, 100);
+    $name = substr($name, 0, 100);
 
-    $abs_name = $this->_mod_mailbox($name_enc);
+    $abs_name = $this->_mod_mailbox($name);
     $a_mailbox_cache = $this->get_cache('mailboxes');
 
     if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array_nocase($abs_name, $a_mailbox_cache)))
@@ -1253,14 +1614,18 @@ class rcube_imap
 
     // try to subscribe it
     if ($subscribe)
-      $this->subscribe($name_enc);
+      $this->subscribe($name);
 
     return $result ? $name : FALSE;
     }
 
 
   /**
-   * set a new name to an existing mailbox
+   * Set a new name to an existing mailbox
+   *
+   * @param string Mailbox to rename (as utf-7 string)
+   * @param string New mailbox name (as utf-7 string)
+   * @param string Name of the renames mailbox, false on error
    */
   function rename_mailbox($mbox_name, $new_name)
     {
@@ -1270,22 +1635,34 @@ class rcube_imap
     $name = preg_replace('/[\\\]+/', '-', $new_name);
         
     // encode mailbox name and reduce it to 100 chars
-    $name_enc = substr(UTF7EncodeString($new_name), 0, 100);
+    $name = substr($new_name, 0, 100);
 
     // make absolute path
     $mailbox = $this->_mod_mailbox($mbox_name);
-    $abs_name = $this->_mod_mailbox($name_enc);
+    $abs_name = $this->_mod_mailbox($name);
+    
+    // check if mailbox is subscribed
+    $a_subscribed = $this->_list_mailboxes();
+    $subscribed = in_array($mailbox, $a_subscribed);
     
+    // unsubscribe folder
+    if ($subscribed)
+      iil_C_UnSubscribe($this->conn, $mailbox);
+
     if (strlen($abs_name))
       $result = iil_C_RenameFolder($this->conn, $mailbox, $abs_name);
-    
+
     // clear cache
     if ($result)
       {
       $this->clear_message_cache($mailbox.'.msg');
-      $this->clear_cache('mailboxes');
+      $this->clear_cache('mailboxes');      
       }
 
+    // try to subscribe it
+    if ($result && $subscribed)
+      iil_C_Subscribe($this->conn, $abs_name);
+
     return $result ? $name : FALSE;
     }
 
@@ -1346,6 +1723,10 @@ class rcube_imap
         else
           $this->subscribe($folder);
         }
+      else if (!in_array_nocase($abs_name, $a_folders))
+        {
+        $this->create_mailbox($folder, FALSE);
+        }
       }
     }
 
@@ -1473,7 +1854,7 @@ class rcube_imap
       {
       $this->db->query(
         "UPDATE ".get_table_name('cache')."
-         SET    created=now(),
+         SET    created=".$this->db->now().",
                 data=?
          WHERE  user_id=?
          AND    cache_key=?",
@@ -1487,7 +1868,7 @@ class rcube_imap
       $this->db->query(
         "INSERT INTO ".get_table_name('cache')."
          (created, user_id, cache_key, data)
-         VALUES (now(), ?, ?, ?)",
+         VALUES (".$this->db->now().", ?, ?, ?)",
         $_SESSION['user_id'],
         $key,
         $data);
@@ -1581,18 +1962,16 @@ class rcube_imap
     }
 
 
-  function get_cached_message($key, $uid, $body=FALSE)
+  function &get_cached_message($key, $uid, $struct=false)
     {
     if (!$this->caching_enabled)
       return FALSE;
 
     $internal_key = '__single_msg';
-    if ($this->caching_enabled && (!isset($this->cache[$internal_key][$uid]) || $body))
+    if ($this->caching_enabled && (!isset($this->cache[$internal_key][$uid]) ||
+        ($struct && empty($this->cache[$internal_key][$uid]->structure))))
       {
-      $sql_select = "idx, uid, headers";
-      if ($body)
-        $sql_select .= ", body";
-      
+      $sql_select = "idx, uid, headers" . ($struct ? ", structure" : '');
       $sql_result = $this->db->query(
         "SELECT $sql_select
          FROM ".get_table_name('messages')."
@@ -1602,14 +1981,12 @@ class rcube_imap
         $_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;
+        $this->cache[$internal_key][$uid] = unserialize($sql_arr['headers']);
+        if (is_object($this->cache[$internal_key][$uid]) && !empty($sql_arr['structure']))
+          $this->cache[$internal_key][$uid]->structure = unserialize($sql_arr['structure']);
         }
       }
 
@@ -1622,7 +1999,7 @@ class rcube_imap
     static $sa_message_index = array();
     
     // empty key -> empty array
-    if (empty($key))
+    if (!$this->caching_enabled || empty($key))
       return array();
     
     if (!empty($sa_message_index[$key]) && !$force)
@@ -1645,25 +2022,55 @@ class rcube_imap
     }
 
 
-  function add_message_cache($key, $index, $headers)
+  function add_message_cache($key, $index, $headers, $struct=null)
     {
-    if (!$key || !is_object($headers) || empty($headers->uid))
+    if (!$this->caching_enabled || empty($key) || !is_object($headers) || empty($headers->uid))
       return;
+      
+    // check for an existing record (probly headers are cached but structure not)
+    $sql_result = $this->db->query(
+        "SELECT message_id
+         FROM ".get_table_name('messages')."
+         WHERE  user_id=?
+         AND    cache_key=?
+         AND    uid=?
+         AND    del<>1",
+        $_SESSION['user_id'],
+        $key,
+        $headers->uid);
 
-    $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));
+    // update cache record
+    if ($sql_arr = $this->db->fetch_assoc($sql_result))
+      {
+      $this->db->query(
+        "UPDATE ".get_table_name('messages')."
+         SET   idx=?, headers=?, structure=?
+         WHERE message_id=?",
+        $index,
+        serialize($headers),
+        is_object($struct) ? serialize($struct) : NULL,
+        $sql_arr['message_id']
+        );
+      }
+    else  // insert new record
+      {
+      $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, structure)
+         VALUES (?, 0, ?, ".$this->db->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),
+        is_object($struct) ? serialize($struct) : NULL
+        );
+      }
     }
     
     
@@ -1700,9 +2107,9 @@ class rcube_imap
    * --------------------------------*/
 
   
-  function decode_address_list($input, $max=NULL)
+  function decode_address_list($input, $max=null, $decode=true)
     {
-    $a = $this->_parse_address_list($input);
+    $a = $this->_parse_address_list($input, $decode);
     $out = array();
     
     if (!is_array($a))
@@ -1716,7 +2123,12 @@ class rcube_imap
       $j++;
       $address = $val['address'];
       $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name']));
-      $string = $name!==$address ? sprintf('%s <%s>', strpos($name, ',')!==FALSE ? '"'.$name.'"' : $name, $address) : $address;
+      if ($name && $address && $name != $address)
+        $string = sprintf('%s <%s>', strpos($name, ',')!==FALSE ? '"'.$name.'"' : $name, $address);
+      else if ($address)
+        $string = $address;
+      else if ($name)
+        $string = $name;
       
       $out[$j] = array('name' => $name,
                        'mailto' => $address,
@@ -1734,9 +2146,7 @@ class rcube_imap
     {
     $str = $this->decode_mime_string((string)$input);
     if ($str{0}=='"' && $remove_quotes)
-      {
       $str = str_replace('"', '', $str);
-      }
     
     return $str;
     }
@@ -1747,7 +2157,7 @@ class rcube_imap
    *
    * @access static
    */
-  function decode_mime_string($input, $recursive=false)
+  function decode_mime_string($input, $fallback=null)
     {
     $out = '';
 
@@ -1764,13 +2174,13 @@ class rcube_imap
       $rest = substr($input, $end_pos+2);
 
       $out .= rcube_imap::_decode_mime_string_part($encstr);
-      $out .= rcube_imap::decode_mime_string($rest);
+      $out .= rcube_imap::decode_mime_string($rest, $fallback);
 
       return $out;
       }
       
-    // no encoding information, defaults to what is specified in the class header
-    return rcube_charset_convert($input, 'ISO-8859-1');
+    // no encoding information, use fallback
+    return rcube_charset_convert($input, !empty($fallback) ? $fallback : 'ISO-8859-1');
     }
 
 
@@ -1865,7 +2275,7 @@ class rcube_imap
 
   function _mod_mailbox($mbox_name, $mode='in')
     {
-    if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX')
+    if (empty($mbox_name) || (!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX')
       return $mbox_name;
 
     if (!empty($this->root_dir) && $mode=='in') 
@@ -1902,12 +2312,12 @@ class rcube_imap
 
   function get_id($uid, $mbox_name=NULL) 
     {
-      return $this->_uid2id($uid, $mbox_name);
+      return $this->_uid2id($uid, $this->_mod_mailbox($mbox_name));
     }
   
   function get_uid($id,$mbox_name=NULL)
     {
-      return $this->_id2uid($id, $mbox_name);
+      return $this->_id2uid($id, $this->_mod_mailbox($mbox_name));
     }
 
   function _uid2id($uid, $mbox_name=NULL)
@@ -2040,20 +2450,42 @@ class rcube_imap
     }
 
 
-  function _parse_address_list($str)
+  // split RFC822 header string into an associative array
+  function _parse_headers($headers)
+    {
+    $a_headers = array();
+    $lines = explode("\n", $headers);
+    $c = count($lines);
+    for ($i=0; $i<$c; $i++)
+      {
+      if ($p = strpos($lines[$i], ': '))
+        {
+        $field = strtolower(substr($lines[$i], 0, $p));
+        $value = trim(substr($lines[$i], $p+1));
+        if (!empty($value))
+          $a_headers[$field] = $value;
+        }
+      }
+    
+    return $a_headers;
+    }
+
+
+  function _parse_address_list($str, $decode=true)
     {
-    $a = $this->_explode_quoted_string(',', $str);
+    // remove any newlines and carriage returns before
+    $a = $this->_explode_quoted_string('[,;]', preg_replace( "/[\r\n]/", " ", $str));
     $result = array();
     
     foreach ($a as $key => $val)
       {
-      $val = str_replace("\"<", "\" <", $val);
-      $sub_a = $this->_explode_quoted_string(' ', $this->decode_header($val));
+      $val = preg_replace("/([\"\w])</", "$1 <", $val);
+      $sub_a = $this->_explode_quoted_string(' ', $decode ? $this->decode_header($val) : $val);
       $result[$key]['name'] = '';
 
       foreach ($sub_a as $k => $v)
         {
-        if ((strpos($v, '@') > 0) && (strpos($v, '.') > 0)) 
+        if (strpos($v, '@') > 0)
           $result[$key]['address'] = str_replace('<', '', str_replace('>', '', $v));
         else
           $result[$key]['name'] .= (empty($result[$key]['name'])?'':' ').str_replace("\"",'',stripslashes($v));
@@ -2069,22 +2501,45 @@ class rcube_imap
 
   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]);
+    $result = array();
+    $strlen = strlen($string);
+    for ($q=$p=$i=0; $i < $strlen; $i++)
+    {
+      if ($string{$i} == "\"" && $string{$i-1} != "\\")
+        $q = $q ? false : true;
+      else if (!$q && preg_match("/$delimiter/", $string{$i}))
+      {
+        $result[] = substr($string, $p, $i - $p);
+        $p = $i + 1;
+      }
+    }
     
+    $result[] = substr($string, $p);
     return $result;
     }
   }
 
 
+/**
+ * Class representing a message part
+ */
+class rcube_message_part
+{
+  var $mime_id = '';
+  var $ctype_primary = 'text';
+  var $ctype_secondary = 'plain';
+  var $mimetype = 'text/plain';
+  var $disposition = '';
+  var $filename = '';
+  var $encoding = '8bit';
+  var $charset = '';
+  var $size = 0;
+  var $headers = array();
+  var $d_parameters = array();
+  var $ctype_parameters = array();
+
+}
+
 
 /**
  * rcube_header_sorter
@@ -2225,4 +2680,5 @@ function quoted_printable_encode($input, $line_max=76, $space_conv=false)
   return trim($output);
   }
 
+
 ?>
index 65857b749732fba3fc8cdb52975bf414feda5353..074ca7948bacc7dda8d35381ccf4fb7c003f4192 100644 (file)
  | program/include/rcube_ldap.inc                                        |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2006-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
- |   Manage an LDAP connection                                           |
+ |   Interface to an LDAP address directory                              |
  |                                                                       |
  +-----------------------------------------------------------------------+
- | Author: Jeremy Jongsma <jeremy@jongsma.org>                           |
+ | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_ldap.inc 95 2006-01-08 07:15:44Z justinrandell $
+ $Id: rcube_ldap.inc 563 2007-05-17 15:58:51Z thomasb $
 
 */
 
-require_once("bugs.inc");
-
 class rcube_ldap
-  {
+{
   var $conn;
-  var $host;
-  var $port;
-  var $protocol;
-  var $base_dn;
-  var $bind_dn;
-  var $bind_pass;
-
-  // PHP 5 constructor
-  function __construct()
-    {
-    }
+  var $prop = array();
+  var $fieldmap = array();
+  
+  var $filter = '';
+  var $result = null;
+  var $ldap_result = null;
+  var $sort_col = '';
+  
+  /** public properties */
+  var $primary_key = 'ID';
+  var $readonly = true;
+  var $list_page = 1;
+  var $page_size = 10;
+  var $ready = false;
+  
+  
+  /**
+   * Object constructor
+   *
+   * @param array LDAP connection properties
+   * @param integer User-ID
+   */
+  function __construct($p)
+  {
+    $this->prop = $p;
+    
+    foreach ($p as $prop => $value)
+      if (preg_match('/^(.+)_field$/', $prop, $matches))
+        $this->fieldmap[$matches[1]] = $value;
+    
+    // $this->filter = "(dn=*)";
+    $this->connect();
+  }
 
-  // PHP 4 constructor
-  function rcube_ldap()
-    {
-    $this->__construct();
-    }
+  /**
+   * PHP 4 object constructor
+   *
+   * @see  rcube_ldap::__construct
+   */
+  function rcube_ldap($p)
+  {
+    $this->__construct($p);
+  }
+  
 
-  function connect($hosts, $port=389, $protocol=3)
-    {
+  /**
+   * Establish a connection to the LDAP server
+   */
+  function connect()
+  {
     if (!function_exists('ldap_connect'))
-      raise_error(array("type" => "ldap",
-                        "message" => "No ldap support in this installation of php."),
-                         TRUE);
+      raise_error(array('type' => 'ldap', 'message' => "No ldap support in this installation of PHP"), true);
 
     if (is_resource($this->conn))
-      return TRUE;
+      return true;
     
-    if (!is_array($hosts))
-      $hosts = array($hosts);
+    if (!is_array($this->prop['hosts']))
+      $this->prop['hosts'] = array($this->prop['hosts']);
 
-    foreach ($hosts as $host)
+    foreach ($this->prop['hosts'] as $host)
+    {
+      if ($lc = @ldap_connect($host, $this->prop['port']))
       {
-      if ($lc = @ldap_connect($host, $port))
-        {
-        @ldap_set_option($lc, LDAP_OPT_PROTOCOL_VERSION, $protocol);
-        $this->host = $host;
-        $this->port = $port;
-        $this->protocol = $protocol;
+        ldap_set_option($lc, LDAP_OPT_PROTOCOL_VERSION, $this->prop['port']);
+        $this->prop['host'] = $host;
         $this->conn = $lc;
-        return TRUE;
-        }
+        break;
       }
+    }
     
-    if (!is_resource($this->conn))
-      raise_error(array("type" => "ldap",
-                        "message" => "Could not connect to any LDAP server, tried $host:$port last"),
-                         TRUE);
+    if (is_resource($this->conn))
+    {
+      $this->ready = true;
+      if (!empty($this->prop['bind_dn']) && !empty($this->prop['bind_pass']))
+        $this->ready = $this->bind($this->prop['bind_dn'], $this->prop['bind_pass']);
     }
+    else
+      raise_error(array('type' => 'ldap', 'message' => "Could not connect to any LDAP server, tried $host:{$this->prop[port]} last"), true);
+  }
 
-  function close()
+
+  /**
+   * Bind connection with DN and password
+   */
+  function bind($dn, $pass)
+  {
+    if (!$this->conn)
+      return false;
+    
+    if (@ldap_bind($this->conn, $dn, $pass))
+      return true;
+    else
     {
-    if ($this->conn)
-      {
-      if (@ldap_unbind($this->conn))
-        return TRUE;
-      else
-        raise_error(array("code" => ldap_errno($this->conn),
-                          "type" => "ldap",
-                          "message" => "Could not close connection to LDAP server: ".ldap_error($this->conn)),
-                    TRUE);
-      }
-    return FALSE;
+      raise_error(array(
+        'code' => ldap_errno($this->conn),
+        'type' => 'ldap',
+        'message' => "Bind failed for dn=$dn: ".ldap_error($this->conn)),
+      true);
     }
+    
+    return false;
+  }
 
-  // Merge with connect()?
-  function bind($dn=null, $pass=null)
-    {
+
+  /**
+   * Close connection to LDAP server
+   */
+  function close()
+  {
     if ($this->conn)
-      {
-      if ($dn)
-        if (@ldap_bind($this->conn, $dn, $pass))
-          return TRUE;
-        else
-          raise_error(array("code" => ldap_errno($this->conn),
-                            "type" => "ldap",
-                            "message" => "Bind failed for dn=$dn: ".ldap_error($this->conn)),
-                      TRUE);
-      else
-        if (@ldap_bind($this->conn))
-          return TRUE;
-        else
-          raise_error(array("code" => ldap_errno($this->conn),
-                            "type" => "ldap",
-                            "message" => "Anonymous bind failed: ".ldap_error($this->conn)),
-                      TRUE);
-      }
-    else
-      raise_error(array("type" => "ldap",
-                        "message" => "Attempted bind on nonexistent connection"), TRUE);
-    return FALSE;
-    }
+      @ldap_unbind($this->conn);
+  }
+
+
+  /**
+   * 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;
+  }
 
-  function count($base, $filter=null, $attributes=null, $scope="sub")
+
+  /**
+   * Save a search string for future listings
+   *
+   * @param string ??
+   */
+  function set_search_set($filter)
+  {
+    $this->filter = $filter;
+  }
+  
+  
+  /**
+   * Getter for saved search properties
+   *
+   * @return mixed Search properties used by this class
+   */
+  function get_search_set()
+  {
+    return $this->filter;
+  }
+
+
+  /**
+   * Reset all saved results and search parameters
+   */
+  function reset()
+  {
+    $this->result = null;
+    $this->ldap_result = null;
+    $this->filter = '';
+  }
+  
+  
+  /**
+   * List the current set of contact records
+   *
+   * @param  array  List of cols to show
+   * @return array  Indexed list of contact records, each a hash array
+   */
+  function list_records($cols=null, $subset=0)
+  {
+    // exec LDAP search if no result resource is stored
+    if ($this->conn && !$this->ldap_result)
+      $this->_exec_search();
+    
+    // count contacts for this user
+    $this->result = $this->count();
+    
+    // we have a search result resource
+    if ($this->ldap_result && $this->result->count > 0)
     {
-    if ($this->conn)
-      {
-      if ($scope === 'sub')
-        $sr = @ldap_search($this->conn, $base, $filter, $attributes, 0, $limit);
-      else if ($scope === 'one')
-        $sr = @ldap_list($this->conn, $base, $filter, $attributes, 0, $limit);
-      else if ($scope === 'base')
-        $sr = @ldap_read($this->conn, $base, $filter, $attributes, 0, $limit);
-      if ($sr)
-        return @ldap_count_entries($this->conn, $sr);
-      }
-    else
-      raise_error(array("type" => "ldap",
-                        "message" => "Attempted count search on nonexistent connection"), TRUE);
-    return FALSE;
+      if ($this->sort_col && $this->prop['scope'] !== "base")
+        @ldap_sort($this->conn, $this->ldap_result, $this->sort_col);
+        
+      $entries = ldap_get_entries($this->conn, $this->ldap_result);
+      for ($i = $this->result->first; $i < min($entries['count'], $this->result->first + $this->page_size); $i++)
+        $this->result->add($this->_ldap2result($entries[$i]));
     }
 
-  function search($base, $filter=null, $attributes=null, $scope='sub', $sort=null, $limit=0)
+    return $this->result;
+  }
+
+
+  /**
+   * Search contacts
+   *
+   * @param array   List of fields to search in
+   * @param string  Search value
+   * @param boolean True if results are requested, False if count only
+   * @return Indexed list of contact records and 'count' value
+   */
+  function search($fields, $value, $select=true)
+  {
+    // special treatment for ID-based search
+    if ($fields == 'ID' || $fields == $this->primary_key)
     {
-    if ($this->conn)
-      {
-      if ($scope === 'sub')
-        $sr = @ldap_search($this->conn, $base, $filter, $attributes, 0, $limit);
-      else if ($scope === 'one')
-        $sr = @ldap_list($this->conn, $base, $filter, $attributes, 0, $limit);
-      else if ($scope === 'base')
-        $sr = @ldap_read($this->conn, $base, $filter, $attributes, 0, $limit);
-      if ($sr)
+      $ids = explode(',', $value);
+      $result = new rcube_result_set();
+      foreach ($ids as $id)
+        if ($rec = $this->get_record($id, true))
         {
-        if ($sort && $scope !== "base")
-          {
-          if (is_array($sort))
-            {
-            // Start from the end so first sort field has highest priority
-            $sortfields = array_reverse($sort);
-            foreach ($sortfields as $sortfield)
-              @ldap_sort($this->conn, $sr, $sortfield);
-            }
-          else
-            @ldap_sort($this->conn, $sr, $sort);
-          }
-        return @ldap_get_entries($this->conn, $sr);
+          $result->add($rec);
+          $result->count++;
         }
-      }
-    else
-      raise_error(array("type" => "ldap",
-                        "message" => "Attempted search on nonexistent connection"), TRUE);
-    return FALSE;
+      
+      return $result;
     }
-
-  function add($dn, $object)
+    
+    $filter = '(|';
+    $wc = $this->prop['fuzzy_search'] ? '*' : '';
+    if (is_array($this->prop['search_fields']))
     {
-    if ($this->conn)
-      {
-      if (@ldap_add($this->conn, $dn, $object))
-        return TRUE;
-      else
-        raise_error(array("code" => ldap_errno($this->conn),
-                          "type" => "ldap",
-                          "message" => "Add object failed: ".ldap_error($this->conn)),
-                    TRUE);
-      }
+      foreach ($this->prop['search_fields'] as $k => $field)
+        $filter .= "($field=$wc" . rcube_ldap::quote_string($value) . "$wc)";
+    }
     else
-      raise_error(array("type" => "ldap",
-                        "message" => "Add object faile: no connection"),
-                  TRUE);
-    return FALSE;
+    {
+      foreach ((array)$fields as $field)
+        if ($f = $this->_map_field($field))
+          $filter .= "($f=$wc" . rcube_ldap::quote_string($value) . "$wc)";
     }
+    $filter .= ')';
+    
+    // add general filter to query
+    if (!empty($this->prop['filter']))
+      $filter = '(&'.$this->prop['filter'] . $filter . ')';
 
-  function modify($dn, $object)
-    {
-    if ($this->conn)
-      {
-      if (@ldap_modify($this->conn, $dn, $object))
-        return TRUE;
-      else
-        raise_error(array("code" => ldap_errno($this->conn),
-                          "type" => "ldap",
-                          "message" => "Modify object failed: ".ldap_error($this->conn)),
-                    TRUE);
-      }
+    // set filter string and execute search
+    $this->set_search_set($filter);
+    $this->_exec_search();
+    
+    if ($select)
+      $this->list_records();
     else
-      raise_error(array("type" => "ldap",
-                        "message" => "Modify object failed: no connection"),
-                  TRUE);
-    return FALSE;
-    }
+      $this->result = $this->count();
+   
+    return $this->result; 
+  }
 
-  function rename($dn, $newrdn, $parentdn)
-    {
-    if ($this->protocol < 3)
-      {
-      raise_error(array("type" => "ldap",
-                        "message" => "rename() support requires LDAPv3 or above "),
-                  TRUE);
-      return FALSE;
-      }
 
-    if ($this->conn)
+  /**
+   * Count number of available contacts in database
+   *
+   * @return Result array with values for 'count' and 'first'
+   */
+  function count()
+  {
+    $count = 0;
+    if ($this->conn && $this->ldap_result)
+      $count = ldap_count_entries($this->conn, $this->ldap_result);
+
+    return new rcube_result_set($count, ($this->list_page-1) * $this->page_size);
+  }
+
+
+  /**
+   * Return the last result set
+   *
+   * @return Result array or NULL if nothing selected yet
+   */
+  function get_result()
+  {
+    return $this->result;
+  }
+  
+  
+  /**
+   * Get a specific contact record
+   *
+   * @param mixed record identifier
+   * @return Hash array with all record fields or False if not found
+   */
+  function get_record($dn, $assoc=false)
+  {
+    $res = null;
+    if ($this->conn && $dn)
+    {
+      $this->ldap_result = @ldap_read($this->conn, base64_decode($dn), "(objectclass=*)", array_values($this->fieldmap));
+      $entry = @ldap_first_entry($this->conn, $this->ldap_result);
+      
+      if ($entry && ($rec = ldap_get_attributes($this->conn, $entry)))
       {
-      if (@ldap_rename($this->conn, $dn, $newrdn, $parentdn, TRUE))
-        return TRUE;
-      else
-        raise_error(array("code" => ldap_errno($this->conn),
-                          "type" => "ldap",
-                          "message" => "Rename object failed: ".ldap_error($this->conn)),
-                    TRUE);
+        $res = $this->_ldap2result($rec);
+        $this->result = new rcube_result_set(1);
+        $this->result->add($res);
       }
-    else
-      raise_error(array("type" => "ldap",
-                        "message" => "Rename object failed: no connection"),
-                  TRUE);
-    return FALSE;
     }
 
-  function delete($dn)
+    return $assoc ? $res : $this->result;
+  }
+  
+  
+  /**
+   * Create a new contact record
+   *
+   * @param array Assoziative array with save data
+   * @return The create record ID on success, False on error
+   */
+  function insert($save_cols)
+  {
+    // TODO
+    return false;
+  }
+  
+  
+  /**
+   * Update a specific contact record
+   *
+   * @param mixed Record identifier
+   * @param array Assoziative array with save data
+   * @return True on success, False on error
+   */
+  function update($id, $save_cols)
+  {
+    // TODO    
+    return false;
+  }
+  
+  
+  /**
+   * Mark one or more contact records as deleted
+   *
+   * @param array  Record identifiers
+   */
+  function delete($ids)
+  {
+    // TODO
+    return false;
+  }
+
+
+  /**
+   * Execute the LDAP search based on the stored credentials
+   *
+   * @private
+   */
+  function _exec_search()
+  {
+    if ($this->conn && $this->filter)
     {
-    if ($this->conn)
-      {
-      if (@ldap_delete($this->conn, $dn))
-        return TRUE;
-      else
-        raise_error(array("code" => ldap_errno($this->conn),
-                          "type" => "ldap",
-                          "message" => "Delete object failed: ".ldap_error($this->conn)),
-                    TRUE);
-      }
+      $function = $this->prop['scope'] == 'sub' ? 'ldap_search' : ($this->prop['scope'] == 'base' ? 'ldap_read' : 'ldap_list');
+      $this->ldap_result = $function($this->conn, $this->prop['base_dn'], $this->filter, array_values($this->fieldmap), 0, 0);
+      return true;
+    }
     else
-      raise_error(array("type" => "ldap",
-                        "message" => "Delete object failed: no connection"),
-                  TRUE);
-    return FALSE;
+      return false;
+  }
+  
+  
+  /**
+   * @private
+   */
+  function _ldap2result($rec)
+  {
+    $out = array();
+    
+    if ($rec['dn'])
+      $out[$this->primary_key] = base64_encode($rec['dn']);
+    
+    foreach ($this->fieldmap as $rf => $lf)
+    {
+      if ($rec[$lf]['count'])
+        $out[$rf] = $rec[$lf][0];
     }
-
+    
+    return $out;
+  }
+  
+  
+  /**
+   * @private
+   */
+  function _map_field($field)
+  {
+    return $this->fieldmap[$field];
   }
+  
+  
+  /**
+   * @static
+   */
+  function quote_string($str)
+  {
+    return strtr($str, array('*'=>'\2a', '('=>'\28', ')'=>'\29', '\\'=>'\5c'));
+  }
+
+
+}
 
-// vi: et ts=2 sw=2
-?>
+?>
\ No newline at end of file
index f37c26962ac9a3ec928d79e6c34e8d32a41c91d4..5f81aeadafc87b5077ede80e4b5e8e8a99068cc6 100755 (executable)
@@ -16,7 +16,7 @@
  | Author: Lukas Kahwe Smith <smith@pooteeweet.org>                      |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_mdb2.inc 239 2006-05-18 21:25:11Z roundcube $
+ $Id: rcube_mdb2.inc 420 2006-12-20 14:07:46Z thomasb $
 
 */
 
@@ -59,14 +59,15 @@ class rcube_db
    * @param  string  DSN for read/write operations
    * @param  string  Optional DSN for read only operations
    */
-  function __construct($db_dsnw, $db_dsnr='')
+  function __construct($db_dsnw, $db_dsnr='', $pconn=false)
     {
     if ($db_dsnr=='')
       $db_dsnr=$db_dsnw;
 
     $this->db_dsnw = $db_dsnw;
     $this->db_dsnr = $db_dsnr;
-
+    $this->db_pconn = $pconn;
+    
     $dsn_array = MDB2::parseDSN($db_dsnw);
     $this->db_provider = $dsn_array['phptype'];
     }
@@ -93,7 +94,7 @@ class rcube_db
   function dsn_connect($dsn)
     {
     // Use persistent connections if available
-    $dbh = MDB2::connect($dsn, array('persistent' => TRUE, 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL));
+    $dbh = MDB2::connect($dsn, array('persistent' => $this->db_pconn, 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL));
 
     if (PEAR::isError($dbh))
       {
@@ -103,13 +104,14 @@ class rcube_db
       raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
                         'message' => $dbh->getMessage()), TRUE, FALSE);
       }
-
     else if ($this->db_provider=='sqlite')
       {
       $dsn_array = MDB2::parseDSN($dsn);
       if (!filesize($dsn_array['database']) && !empty($this->sqlite_initials))
         $this->_sqlite_create_database($dbh, $this->sqlite_initials);
       }
+    else
+      $dbh->setCharset('utf8');
 
     return $dbh;
     }
@@ -285,7 +287,7 @@ class rcube_db
     if (!$this->db_handle)
       return FALSE;
 
-    return $result;
+    return $this->_get_result($result);
     }
 
 
@@ -410,6 +412,25 @@ class rcube_db
     }
 
 
+  /**
+   * Return SQL function for current time and date
+   *
+   * @return string SQL function to use in query
+   * @access public
+   */
+  function now()
+    {
+    switch($this->db_provider)
+      {
+      case 'mssql':
+        return "getdate()";
+
+      default:
+        return "now()";
+      }
+    }
+
+
   /**
    * Return SQL statement to convert a field value into a unix timestamp
    *
@@ -425,6 +446,9 @@ class rcube_db
         return "EXTRACT (EPOCH FROM $field)";
         break;
 
+      case 'mssql':
+        return "datediff(s, '1970-01-01 00:00:00', $field)";
+
       default:
         return "UNIX_TIMESTAMP($field)";
       }
index ee95965e3ba6a209c05869b60f842e1cb950ea72..737ebaf98fdb3e3c08284c66a3bbd00f67b0e0ed 100644 (file)
@@ -5,7 +5,7 @@
  | rcube_shared.inc                                                      |
  |                                                                       |
  | This file is part of the RoundCube PHP suite                          |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | CONTENTS:                                                             |
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_shared.inc 288 2006-07-31 22:51:23Z thomasb $
+ $Id: rcube_shared.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
@@ -28,13 +28,15 @@ class rcube_html_page
   
   var $scripts_path = '';
   var $script_files = array();
+  var $external_scripts = array();
   var $scripts = array();
   var $charset = 'ISO-8859-1';
   
   var $script_tag_file = "<script type=\"text/javascript\" src=\"%s%s\"></script>\n";
   var $script_tag      = "<script type=\"text/javascript\">\n<!--\n%s\n\n//-->\n</script>\n";
-  var $default_template = "<html>\n<body></body>\n</html>";
-  
+  var $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>";
+  var $tag_format_external_script = "<script type=\"text/javascript\" src=\"%s\"></script>\n";
+
   var $title = '';
   var $header = '';
   var $footer = '';
@@ -69,15 +71,33 @@ class rcube_html_page
     $this->script_files[$position][] = $file;
     }
     
-  
+  function include_external_script($script_location, $position='head')
+  {
+     if (!is_array($this->external_scripts[$position]))
+     {
+        $this->external_scripts[$position] = array();
+     }
+     
+     $this->external_scripts[$position][] = $script_location;
+  }
+
   function add_script($script, $position='head')
     {
     if (!isset($this->scripts[$position]))
-      $this->scripts[$position] = '';
+      $this->scripts[$position] = "\n".rtrim($script);
+    else
+      $this->scripts[$position] .= "\n".rtrim($script);
+    }
 
-    $this->scripts[$position] .= "\n$script";
+  function add_header($str)
+    {
+    $this->header .= "\n".$str;
     }
 
+  function add_footer($str)
+    {
+    $this->footer .= "\n".$str;
+    }
 
   function set_title($t)
     {
@@ -110,19 +130,21 @@ class rcube_html_page
     $this->script_files = array();
     $this->scripts = array();
     $this->title = '';
+    $this->header = '';
+    $this->footer = '';
     }
 
 
   function write($templ='', $base_path='')
     {
     $output = empty($templ) ? $this->default_template : trim($templ);
-  
+    
     // set default page title
-    if (!strlen($this->title))
+    if (empty($this->title))
       $this->title = 'RoundCube Mail';
   
     // replace specialchars in content
-    $__page_title = rep_specialchars_output($this->title, 'html', 'show', FALSE);
+    $__page_title = Q($this->title, 'show', FALSE);
     $__page_header = $__page_body = $__page_footer = '';
     
     
@@ -139,19 +161,28 @@ class rcube_html_page
       foreach ($this->script_files['head'] as $file)
         $__page_header .= sprintf($this->script_tag_file, $this->scripts_path, $file);
 
-    if (strlen($this->scripts['head']))
-      $__page_header .= sprintf($this->script_tag, $this->scripts['head']);
-          
+    if (is_array($this->external_scripts['head']))
+      foreach ($this->external_scripts['head'] as $xscript)
+        $__page_header .= sprintf($this->tag_format_external_script, $xscript);
+
+    $head_script = $this->scripts['head_top'] . $this->scripts['head'];
+    if (!empty($head_script))
+      $__page_header .= sprintf($this->script_tag, $head_script);
+
+    if (!empty($this->header))
+      $__page_header .= $this->header;
+
     if (is_array($this->script_files['foot']))
       foreach ($this->script_files['foot'] as $file)
         $__page_footer .= sprintf($this->script_tag_file, $this->scripts_path, $file);
 
-    if (strlen($this->scripts['foot']))
+    if (!empty($this->scripts['foot']))
       $__page_footer .= sprintf($this->script_tag, $this->scripts['foot']);
-
+      
+    if (!empty($this->footer))
+      $__page_footer .= $this->footer;
 
     $__page_header .= $this->css->show();
-
   
     // find page header
     if($hpos = strpos(strtolower($output), '</head>'))
@@ -192,8 +223,10 @@ class rcube_html_page
   
   
     // find and add page footer
-    if(($fpos = strpos(strtolower($output), '</body>')) || ($fpos = strpos(strtolower($output), '</html>')))
-      $output = substr($output,0,$fpos) . "$__page_footer\n" . substr($output,$fpos,strlen($output));
+    $output_lc = strtolower($output);
+    if(($fpos = strrstr($output_lc, '</body>')) ||
+       ($fpos = strrstr($output_lc, '</html>')))
+      $output = substr($output, 0, $fpos) . "$__page_footer\n" . substr($output, $fpos);
     else
       $output .= "\n$__page_footer";
   
@@ -202,7 +235,7 @@ class rcube_html_page
     $__page_header = $__page_footer = '';
   
   
-    // correct absolute pathes in images and other tags
+    // correct absolute paths in images and other tags
     $output = preg_replace('/(src|href|background)=(["\']?)(\/[a-z0-9_\-]+)/Ui', "\\1=\\2$base_path\\3", $output);
     $output = str_replace('$__skin_path', $base_path, $output);
   
@@ -701,7 +734,7 @@ class base_form_element
 
       // encode textarea content
       if ($key=='value')
-        $value = rep_specialchars_output($value, 'html', 'replace', FALSE);
+        $value = Q($value, 'strict', FALSE);
 
       // attributes with no value
       if (in_array($key, array('checked', 'multiple', 'disabled', 'selected')))
@@ -854,9 +887,9 @@ class textarea extends base_form_element
     if (isset($this->attrib['value']))
       unset($this->attrib['value']);
 
-    if (strlen($value))
-      $value = rep_specialchars_output($value, 'html', 'replace', FALSE);
-    
+    if (!empty($value) && !isset($this->attrib['mce_editable']))
+      $value = Q($value, 'strict', FALSE);
+
     // return final tag
     return sprintf('<%s%s>%s</%s>%s',
                    $this->_conv_case('textarea', 'tag'),
@@ -985,20 +1018,22 @@ class select extends base_form_element
     
     if (!is_array($select))
       $select = array((string)$select);
-    
+
     foreach ($this->options as $option)
       {
-      $selected = ((strlen($option['value']) && in_array($option['value'], $select, TRUE)) ||
-                   (in_array($option['text'], $select, TRUE))) ? $this->_conv_case(' selected', 'attrib') : '';
-                  
+      $selected = ((isset($option['value']) &&
+                    in_array($option['value'], $select, TRUE)) ||
+                   (in_array($option['text'], $select, TRUE))) ?
+        $this->_conv_case(' selected', 'attrib') : '';
+                   
       $options_str .= sprintf("<%s%s%s>%s</%s>\n",
                              $this->_conv_case('option', 'tag'),
-                             strlen($option['value']) ? sprintf($value_str, $option['value']) : '',
+                             !empty($option['value']) ? sprintf($value_str, Q($option['value'])) : '',
                              $selected, 
-                             rep_specialchars_output($option['text'], 'html', 'replace', FALSE),
+                             Q($option['text'], 'strict', FALSE),
                              $this->_conv_case('option', 'tag'));
       }
-                             
+
     // return final tag
     return sprintf('<%s%s>%s</%s>%s',
                    $this->_conv_case('select', 'tag'),
@@ -1080,7 +1115,7 @@ function rcube_label($attrib)
   $nr = is_numeric($attrib['nr']) ? $attrib['nr'] : 1;
   $vars = isset($attrib['vars']) ? $attrib['vars'] : '';
 
-  $command_name = strlen($attrib['command']) ? $attrib['command'] : NULL;
+  $command_name = !empty($attrib['command']) ? $attrib['command'] : NULL;
   $alias = $attrib['name'] ? $attrib['name'] : ($command_name && $command_label_map[$command_name] ? $command_label_map[$command_name] : '');
 
 
@@ -1171,8 +1206,6 @@ EOF;
     return strtoupper($text);
   else if ($attrib['lowercase'])
     return strtolower($text);
-  else
-    return $text;
 
   return $text;
   }
@@ -1192,89 +1225,113 @@ function send_nocacheing_headers()
 
 
 // send header with expire date 30 days in future
-function send_future_expire_header()
+function send_future_expire_header($offset=2600000)
   {
-  if (!headers_sent())
-    header("Expires: ".gmdate("D, d M Y H:i:s", mktime()+2600000)." GMT");
+  if (headers_sent())
+    return;
+
+  header("Expires: ".gmdate("D, d M Y H:i:s", mktime()+$offset)." GMT");
+  header("Cache-Control: max-age=$offset");
+  header("Pragma: ");
   }
 
 
-// function to convert an array to a javascript array
-function array2js($arr, $type='')
+// check request for If-Modified-Since and send an according response
+function send_modified_header($mdate, $etag=null)
+{
+  if (headers_sent())
+    return;
+    
+  $iscached = false;
+  if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $mdate)
+    $iscached = true;
+  
+  $etag = $etag ? "\"$etag\"" : null;
+  if ($etag && $_SERVER['HTTP_IF_NONE_MATCH'] == $etag)
+    $iscached = true;
+  
+  if ($iscached)
+    header("HTTP/1.x 304 Not Modified");
+  else
+    header("Last-Modified: ".gmdate("D, d M Y H:i:s", $mdate)." GMT");
+  
+  header("Cache-Control: max-age=0");
+  header("Expires: ");
+  header("Pragma: ");
+  
+  if ($etag)
+    header("Etag: $etag");
+  
+  if ($iscached)
+    exit;
+}
+
+
+/**
+ * Convert a variable into a javascript notation string
+ */
+function json_serialize($var)
   {
-  if (!$type)
-    $type = 'mixed';
+    if (is_object($var))
+      $var = get_object_vars($var);
 
-  if (is_array($arr))
+    if (is_array($var))
     {
-    // no items in array
-    if (!sizeof($arr))
-      return 'new Array()';
-    else
+      // empty array
+      if (!sizeof($var))
+        return '[]';
+      else
       {
-      $a_pairs = array();
-      $keys_arr = array_keys($arr);
-      $is_assoc = $have_numeric = 0;
+        $keys_arr = array_keys($var);
+        $is_assoc = $have_numeric = 0;
 
-      for ($i=0; $i<sizeof($keys_arr); ++$i)
+        for ($i=0; $i<sizeof($keys_arr); ++$i)
         {
-        if(is_numeric($keys_arr[$i]))
-          $have_numeric = 1;
-        if (!is_numeric($keys_arr[$i]) || $keys_arr[$i]!=$i)
-          $is_assoc = 1;
-        if($is_assoc && $have_numeric)
-          break;
+          if (is_numeric($keys_arr[$i]))
+            $have_numeric = 1;
+          if (!is_numeric($keys_arr[$i]) || $keys_arr[$i] != $i)
+            $is_assoc = 1;
+          if ($is_assoc && $have_numeric)
+            break;
         }
+        
+        $brackets = $is_assoc ? '{}' : '[]';
+        $pairs = array();
 
-      $previous_was_array = false;
-      while (list($key, $value) = each($arr))
+        foreach ($var as $key => $value)
         {
-        // enclose key with quotes if it is not variable-name conform
-        if (!ereg("^[_a-zA-Z]{1}[_a-zA-Z0-9]*$", $key) /* || is_js_reserved_word($key) */)
-          $key = "'$key'";
-
-        if (!is_array($value))
-          {
-          $value = str_replace("\r\n", '\n', $value);
-          $value = str_replace("\n", '\n', $value);
-          }
-
-        $is_string = false;
-        if (!is_array($value))
-          {
-          if ($type=='string')
-            $is_string = true;
-          else if ((($type=='mixed' && is_numeric($value)) || $type=='int') && strlen($value)<16)   // js interprets numbers with digits >15 as ...e+... 
-            $is_string = FALSE;
-          else
-            $is_string = TRUE;
-          }
-
-        if ($is_string)
-          $value = "'".preg_replace("/(?<!\\\)'/", "\'", $value)."'";
+          // enclose key with quotes if it is not variable-name conform
+          if (!ereg("^[_a-zA-Z]{1}[_a-zA-Z0-9]*$", $key) /* || is_js_reserved_word($key) */)
+            $key = "'$key'";
 
-        $a_pairs[] = sprintf("%s%s",
-                             $is_assoc ? "$key:" : '',
-                             is_array($value) ? array2js($value, $type) : $value);
+          $pairs[] = sprintf("%s%s", $is_assoc ? "$key:" : '', json_serialize($value));
         }
 
-      if ($a_pairs)
-        {
-        if ($is_assoc)
-          $return = '{'.implode(',', $a_pairs).'}';
-        else
-          $return = '['.implode(',', $a_pairs).']';
-        }
-
-      return $return;
+        return $brackets{0} . implode(',', $pairs) . $brackets{1};
       }
     }
-  else
-    return $arr;
+    else if (is_numeric($var) && strval(intval($var)) === strval($var))
+      return $var;
+    else if (is_bool($var))
+      return $var ? '1' : '0';
+    else
+      return "'".JQ($var)."'";
+  
   }
 
+/**
+ * function to convert an array to a javascript array
+ * @deprecated
+ */
+function array2js($arr, $type='')
+  {
+  return json_serialize($arr);
+  }
 
-// similar function as in_array() ut case-insensitive
+
+/**
+ * Similar function as in_array() but case-insensitive
+ */
 function in_array_nocase($needle, $haystack)
   {
   foreach ($haystack as $value)
@@ -1287,8 +1344,9 @@ function in_array_nocase($needle, $haystack)
   }
 
 
-
-// find out if the string content means TRUE or FALSE
+/**
+ * Find out if the string content means TRUE or FALSE
+ */
 function get_boolean($str)
   {
   $str = strtolower($str);
@@ -1299,12 +1357,51 @@ function get_boolean($str)
   }
 
 
-function show_bytes($numbytes)
+// parse a human readable string for a number of bytes
+function parse_bytes($str)
+  {
+  if (is_numeric($str))
+    return intval($str);
+    
+  if (preg_match('/([0-9]+)([a-z])/i', $str, $regs))
+    {
+      $bytes = floatval($regs[1]);
+      switch (strtolower($regs[2]))
+      {
+        case 'g':
+          $bytes *= 1073741824;
+          break;
+        case 'm':
+          $bytes *= 1048576;
+          break;
+        case 'k':
+          $bytes *= 1024;
+          break;
+      }
+    }
+
+  return intval($bytes);
+  }
+    
+// create a human readable string for a number of bytes
+function show_bytes($bytes)
   {
-  if ($numbytes > 1024)
-    return sprintf('%d KB', round($numbytes/1024));
+  if ($bytes > 1073741824)
+    {
+    $gb = $bytes/1073741824;
+    $str = sprintf($gb>=10 ? "%d GB" : "%.1f GB", $gb);
+    }
+  else if ($bytes > 1048576)
+    {
+    $mb = $bytes/1048576;
+    $str = sprintf($mb>=10 ? "%d MB" : "%.1f MB", $mb);
+    }
+  else if ($bytes > 1024)
+    $str = sprintf("%d KB",  round($bytes/1024));
   else
-    return sprintf('%d B', $numbytes);
+    $str = sprintf('%d B', $bytes);
+
+  return $str;
   }
 
 
@@ -1345,17 +1442,63 @@ function make_absolute_url($path, $base_url)
     }
 
 
+// wrapper function for strlen
+function rc_strlen($str)
+  {
+    if (function_exists('mb_strlen'))
+      return mb_strlen($str);
+    else
+      return strlen($str);
+  }
+  
+// wrapper function for strtolower
+function rc_strtolower($str)
+  {
+    if (function_exists('mb_strtolower'))
+      return mb_strtolower($str);
+    else
+      return strtolower($str);
+  }
+
+// wrapper function for substr
+function rc_substr($str, $start, $len=null)
+  {
+  if (function_exists('mb_substr'))
+    return mb_substr($str, $start, $len);
+  else
+    return substr($str, $start, $len);
+  }
+
+// wrapper function for strpos
+function rc_strpos($haystack, $needle, $offset=0)
+  {
+  if (function_exists('mb_strpos'))
+    return mb_strpos($haystack, $needle, $offset);
+  else
+    return strpos($haystack, $needle, $offset);
+  }
+
+// wrapper function for strrpos
+function rc_strrpos($haystack, $needle, $offset=0)
+  {
+  if (function_exists('mb_strrpos'))
+    return mb_strrpos($haystack, $needle, $offset);
+  else
+    return strrpos($haystack, $needle, $offset);
+  }
+
+
 // replace the middle part of a string with ...
 // if it is longer than the allowed length
 function abbrevate_string($str, $maxlength, $place_holder='...')
   {
-  $length = strlen($str);
-  $first_part_length = floor($maxlength/2) - strlen($place_holder);
+  $length = rc_strlen($str);
+  $first_part_length = floor($maxlength/2) - rc_strlen($place_holder);
   
   if ($length > $maxlength)
     {
     $second_starting_location = $length - $maxlength + $first_part_length + 1;
-    $str = substr($str, 0, $first_part_length) . $place_holder . substr($str, $second_starting_location, $length);
+    $str = rc_substr($str, 0, $first_part_length) . $place_holder . rc_substr($str, $second_starting_location, $length);
     }
 
   return $str;
@@ -1414,7 +1557,7 @@ function get_offset_time($offset_str, $factor=1)
       $amount *= 24;
     case 'h':
       $amount *= 60;
-    case 'h':
+    case 'm':
       $amount *= 60;
     case 's':
       $ts += $amount * $factor;
@@ -1424,4 +1567,31 @@ function get_offset_time($offset_str, $factor=1)
   }
 
 
+/**
+ * strrstr
+ *
+ * return the last occurence of a string in another string
+ * @param haystack string string in which to search
+ * @param needle string string for which to search
+ * @return index of needle within haystack, or false if not found
+ */
+function strrstr($haystack, $needle)
+  {
+    $pver = phpversion();
+    if ($pver[0] >= 5)
+      {
+        return strrpos($haystack, $needle);
+      }
+    else
+      {
+        $index = strpos(strrev($haystack), strrev($needle));
+        if($index === false) {
+            return false;
+        }
+        $index = strlen($haystack) - strlen($needle) - $index;
+        return $index;
+      }
+  }
+
+
 ?>
index 5977de5be319dc493ca38170806c96e7cdf9cb3e..99b99e7570aeb4c5520233248e8481f0469a27a3 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_smtp.inc 266 2006-06-26 18:38:03Z thomasb $
+ $Id: rcube_smtp.inc 399 2006-12-06 21:37:37Z thomasb $
 
 */
 
@@ -49,9 +49,9 @@ $SMTP_CONN = null;
  * @return bool  Returns TRUE on success, or FALSE on error
  * @access public
  */
-function smtp_mail($from, $recipients, &$headers, &$body)
+function smtp_mail($from, $recipients, &$headers, &$body, &$response)
   {
-  global $SMTP_CONN, $CONFIG, $SMTP_ERROR;
+  global $SMTP_CONN, $CONFIG;
   $smtp_timeout = null;
   $smtp_host = $CONFIG['smtp_server'];
   $smtp_port = is_numeric($CONFIG['smtp_port']) ? $CONFIG['smtp_port'] : 25;
@@ -85,7 +85,7 @@ function smtp_mail($from, $recipients, &$headers, &$body)
     if (PEAR::isError($result))
       {
       $SMTP_CONN = null;
-      $SMTP_ERROR .= "Connection failed: ".$result->getMessage()."\n";
+      $response[] = "Connection failed: ".$result->getMessage();
       return FALSE;
       }
       
@@ -93,22 +93,22 @@ function smtp_mail($from, $recipients, &$headers, &$body)
     if ($CONFIG['smtp_user'] && $CONFIG['smtp_pass'])
       {
       if (strstr($CONFIG['smtp_user'], '%u'))
-               $smtp_user = str_replace('%u', $_SESSION['username'], $CONFIG['smtp_user']);
+        $smtp_user = str_replace('%u', $_SESSION['username'], $CONFIG['smtp_user']);
       else
-               $smtp_user = $CONFIG['smtp_user'];
+        $smtp_user = $CONFIG['smtp_user'];
 
-         if (strstr($CONFIG['smtp_pass'], '%p'))
-               $smtp_pass = str_replace('%p', decrypt_passwd($_SESSION['password']), $CONFIG['smtp_pass']);
+      if (strstr($CONFIG['smtp_pass'], '%p'))
+        $smtp_pass = str_replace('%p', decrypt_passwd($_SESSION['password']), $CONFIG['smtp_pass']);
       else
-               $smtp_pass = $CONFIG['smtp_pass'];
+        $smtp_pass = $CONFIG['smtp_pass'];
 
-         $smtp_auth_type = empty($CONFIG['smtp_auth_type']) ? NULL : $CONFIG['smtp_auth_type'];
-         $result = $SMTP_CONN->auth($smtp_user, $smtp_pass, $smtp_auth_type);
-         
+      $smtp_auth_type = empty($CONFIG['smtp_auth_type']) ? NULL : $CONFIG['smtp_auth_type'];
+      $result = $SMTP_CONN->auth($smtp_user, $smtp_pass, $smtp_auth_type);
+    
       if (PEAR::isError($result))
         {
         smtp_reset();
-        $SMTP_ERROR .= "Authentication failure: ".$result->getMessage()."\n";
+        $response[] .= "Authentication failure: ".$result->getMessage();
         return FALSE;
         }
       }
@@ -132,7 +132,7 @@ function smtp_mail($from, $recipients, &$headers, &$body)
   else
     {
     smtp_reset();
-    $SMTP_ERROR .= "Invalid message headers\n";
+    $response[] .= "Invalid message headers";
     return FALSE;
     }
 
@@ -140,7 +140,7 @@ function smtp_mail($from, $recipients, &$headers, &$body)
   if (!isset($from))
     {
     smtp_reset();
-    $SMTP_ERROR .= "No From address has been provided\n";
+    $response[] .= "No From address has been provided";
     return FALSE;
     }
 
@@ -149,7 +149,7 @@ function smtp_mail($from, $recipients, &$headers, &$body)
   if (PEAR::isError($SMTP_CONN->mailFrom($from)))
     {
     smtp_reset();
-    $SMTP_ERROR .= "Failed to set sender '$from'\n";
+    $response[] .= "Failed to set sender '$from'";
     return FALSE;
     }
 
@@ -169,21 +169,30 @@ function smtp_mail($from, $recipients, &$headers, &$body)
     if (PEAR::isError($SMTP_CONN->rcptTo($recipient)))
       {
       smtp_reset();
-      $SMTP_ERROR .= "Failed to add recipient '$recipient'\n";
+      $response[] .= "Failed to add recipient '$recipient'";
       return FALSE;
       }
     }
 
 
+  // Concatenate headers and body so it can be passed by reference to SMTP_CONN->data
+  // so preg_replace in SMTP_CONN->quotedata will store a reference instead of a copy. 
+  // We are still forced to make another copy here for a couple ticks so we don't really 
+  // get to save a copy in the method call.
+  $data = $text_headers . "\r\n" . $body;
+
+  // unset old vars to save data and so we can pass into SMTP_CONN->data by reference.
+  unset($text_headers, $body);
+   
   // Send the message's headers and the body as SMTP data.
-  if (PEAR::isError($SMTP_CONN->data("$text_headers\r\n$body")))
+  if (PEAR::isError($SMTP_CONN->data($data)))
     {
     smtp_reset();
-    $SMTP_ERROR .= "Failed to send data\n";
+    $response[] .= "Failed to send data";
     return FALSE;
     }
 
-
+  $response[] = join(': ', $SMTP_CONN->getResponse());
   return TRUE;
   }
 
@@ -318,9 +327,9 @@ function smtp_parse_rfc822($recipients)
   reset($recipients);
   while (list($k, $recipient) = each($recipients))
     {
-       $a = explode(" ", $recipient);
-       while (list($k2, $word) = each($a))
-         {
+  $a = explode(" ", $recipient);
+  while (list($k2, $word) = each($a))
+    {
       if ((strpos($word, "@") > 0) && (strpos($word, "\"")===false))
         {
         $word = ereg_replace('^<|>$', '', trim($word));
@@ -340,13 +349,13 @@ function smtp_explode_quoted_str($delimiter, $string)
     if (($key % 2) == 1) 
       $quotes[$key] = str_replace($delimiter, "_!@!_", $quotes[$key]);
     $string=implode("\"", $quotes);
-       
+  
     $result=explode($delimiter, $string);
     while (list($key, $val) = each($result))
       $result[$key] = str_replace("_!@!_", $delimiter, $result[$key]);
 
   return $result;
-  }    
+  } 
 
 
 ?>
index 822237c47ab87b1e05eb0283d106fa855176d333..81752d7f78ea8818828baa8821ec4521c583ef0d 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: session.inc 132 2006-02-05 15:38:51Z roundcube $
+ $Id: session.inc 521 2007-03-27 09:34:30Z thomasb $
 
 */
 
@@ -36,7 +36,10 @@ function sess_close()
 // read session data
 function sess_read($key)
   {
-  global $DB, $SESS_CHANGED;
+  global $DB, $SESS_CHANGED, $SESS_CLIENT_IP;
+  
+  if ($DB->is_error())
+    return FALSE;
   
   $sql_result = $DB->query("SELECT vars, ip, ".$DB->unixtimestamp('changed')." AS changed
                             FROM ".get_table_name('session')."
@@ -45,7 +48,8 @@ function sess_read($key)
 
   if ($sql_arr = $DB->fetch_assoc($sql_result))
     {
-    $SESS_CHANGED = mktime(); //$sql_arr['changed'];
+    $SESS_CHANGED = $sql_arr['changed'];
+    $SESS_CLIENT_IP = $sql_arr['ip'];
 
     if (strlen($sql_arr['vars']))
       return $sql_arr['vars'];
@@ -59,6 +63,9 @@ function sess_read($key)
 function sess_write($key, $vars)
   {
   global $DB;
+  
+  if ($DB->is_error())
+    return FALSE;
 
   $sql_result = $DB->query("SELECT 1
                             FROM ".get_table_name('session')."
@@ -70,7 +77,7 @@ function sess_write($key, $vars)
     session_decode($vars);
     $DB->query("UPDATE ".get_table_name('session')."
                 SET    vars=?,
-                       changed=now()
+                       changed=".$DB->now()."
                 WHERE  sess_id=?",
                 $vars,
                 $key);
@@ -79,7 +86,7 @@ function sess_write($key, $vars)
     {
     $DB->query("INSERT INTO ".get_table_name('session')."
                 (sess_id, vars, ip, created, changed)
-                VALUES (?, ?, ?, now(), now())",
+                VALUES (?, ?, ?, ".$DB->now().", ".$DB->now().")",
                 $key,
                 $vars,
                 $_SERVER['REMOTE_ADDR']);
@@ -96,6 +103,9 @@ function sess_destroy($key)
   {
   global $DB;
   
+  if ($DB->is_error())
+    return FALSE;
+  
   // delete session entries in cache table
   $DB->query("DELETE FROM ".get_table_name('cache')."
               WHERE  session_id=?",
@@ -105,7 +115,6 @@ function sess_destroy($key)
               WHERE sess_id=?",
               $key);
 
-  rcmail_clear_session_temp($key);
   return TRUE;
   }
 
@@ -115,10 +124,13 @@ function sess_gc($maxlifetime)
   {
   global $DB;
 
+  if ($DB->is_error())
+    return FALSE;
+
   // get all expired sessions  
   $sql_result = $DB->query("SELECT sess_id
                             FROM ".get_table_name('session')."
-                            WHERE ".$DB->unixtimestamp('now()')."-".$DB->unixtimestamp('changed')." > ?",
+                            WHERE ".$DB->unixtimestamp($DB->now())."-".$DB->unixtimestamp('changed')." > ?",
                             $maxlifetime);
                                    
   $a_exp_sessions = array();
@@ -137,17 +149,36 @@ function sess_gc($maxlifetime)
                 WHERE sess_id IN ('".join("','", $a_exp_sessions)."')");
     }
 
-  // remove session specific temp dirs
-  foreach ($a_exp_sessions as $key)
-    rcmail_clear_session_temp($key);
-
   // also run message cache GC
   rcmail_message_cache_gc();
+  rcmail_temp_gc();
 
   return TRUE;
   }
 
 
+function sess_regenerate_id()
+  {
+  $randlen = 32;
+  $randval = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+  $random = "";
+  for ($i=1; $i <= $randlen; $i++)
+    $random .= substr($randval, rand(0,(strlen($randval) - 1)), 1);
+
+  // use md5 value for id or remove capitals from string $randval
+  $random = md5($random);
+
+  // delete old session record
+  sess_destroy(session_id());
+
+  session_id($random);
+  $cookie = session_get_cookie_params();
+  setcookie(session_name(), $random, $cookie['lifetime'], $cookie['path']);
+
+  return true;
+  }
+
+
 // set custom functions for PHP session management
 session_set_save_handler('sess_open', 'sess_close', 'sess_read', 'sess_write', 'sess_destroy', 'sess_gc');
 
index 7622f1f2cd221a4e11470cac5ce37b4a79c59cb7..5ae67104ad4403d480e373f082cb2aca6f1a8a5b 100644 (file)
@@ -3,21 +3,19 @@
  | RoundCube Webmail Client Script                                       |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev, - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev, - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Authors: Thomas Bruederli <roundcube@gmail.com>                       |
  |          Charles McNulty <charles@charlesmcnulty.com>                 |
  +-----------------------------------------------------------------------+
-  $Id: app.js 431 2006-12-23 10:44:16Z thomasb $
+ | Requires: common.js, list.js                                          |
+ +-----------------------------------------------------------------------+
+
+  $Id: app.js 575 2007-05-18 12:35:28Z thomasb $
 */
 
-// Constants
-var CONTROL_KEY = 1;
-var SHIFT_KEY = 2;
-var CONTROL_SHIFT_KEY = 3;
 
 var rcube_webmail_client;
 
@@ -28,19 +26,18 @@ function rcube_webmail()
   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;
+  this.onloads = new Array();
 
-  // create public reference to myself
+  // create protected reference to myself
   rcube_webmail_client = this;
   this.ref = 'rcube_webmail_client';
+  var ref = this;
  
   // webmail client settings
-  this.dblclick_time = 600;
+  this.dblclick_time = 500;
   this.message_time = 5000;
   
-  this.mbox_expression = new RegExp('[^0-9a-z\-_]', 'gi');
+  this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi');
   
   // mimetypes supported by the browser (default settings)
   this.mimetypes = new Array('text/plain', 'text/html', 'text/xml',
@@ -51,13 +48,20 @@ function rcube_webmail()
   // default environment vars
   this.env.keep_alive = 60;        // seconds
   this.env.request_timeout = 180;  // seconds
-  this.env.draft_autosave = 300;   // seconds
+  this.env.draft_autosave = 0;     // seconds
+  this.env.comm_path = './';
+  this.env.bin_path = './bin/';
+  this.env.blankpage = 'program/blank.gif';
 
 
-  // set environment variable
-  this.set_env = function(name, value)
+  // set environment variable(s)
+  this.set_env = function(p, value)
     {
-    this.env[name] = value;
+    if (p != null && typeof(p) == 'object' && !value)
+      for (var n in p)
+        this.env[n] = p[n];
+    else
+      this.env[p] = value;
     };
 
 
@@ -82,30 +86,35 @@ function rcube_webmail()
     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;
     };
-
+  
+  // execute the given script on load
+  this.add_onload = function(f)
+    {
+      this.onloads[this.onloads.length] = f;
+    };
 
   // initialize webmail client
   this.init = function()
     {
+    var p = this;
     this.task = this.env.task;
     
     // check browser
     if (!bw.dom || !bw.xmlhttp_test())
       {
-      location.href = this.env.comm_path+'&_action=error&_code=0x199';
+      this.goto_url('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);
@@ -116,43 +125,73 @@ function rcube_webmail()
     switch (this.task)
       {
       case 'mail':
-        var msg_list_frame = this.gui_objects.mailcontframe;
-        var msg_list = this.gui_objects.messagelist;
-        if (msg_list)
+        if (this.gui_objects.messagelist)
           {
-          msg_list_frame.onmousedown = function(e){return rcube_webmail_client.click_on_list(e);};
-          this.init_messagelist(msg_list);
+          this.message_list = new rcube_list_widget(this.gui_objects.messagelist, {multiselect:true, draggable:true, keyboard:true, dblclick_time:this.dblclick_time});
+          this.message_list.row_init = function(o){ p.init_message_row(o); };
+          this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); });
+          this.message_list.addEventListener('keypress', function(o){ p.msglist_keypress(o); });
+          this.message_list.addEventListener('select', function(o){ p.msglist_select(o); });
+          this.message_list.addEventListener('dragstart', function(o){ p.drag_active = true; });
+          this.message_list.addEventListener('dragend', function(o){ p.drag_active = false; });
+
+          this.message_list.init();
           this.enable_command('toggle_status', true);
+          
+          if (this.gui_objects.mailcontframe)
+            {
+            this.gui_objects.mailcontframe.onmousedown = function(e){ return p.click_on_list(e); };
+            document.onmouseup = function(e){ return p.doc_mouse_up(e); };
+            }
+          else
+            this.message_list.focus();
           }
 
         // enable mail commands
         this.enable_command('list', 'checkmail', 'compose', 'add-contact', 'search', 'reset-search', true);
         
-        if (this.env.action=='show')
+        if (this.env.action=='show' || this.env.action=='preview')
           {
           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);
+            this.enable_command('lastmessage', true);
+            }
           if (this.env.prev_uid)
+            {
             this.enable_command('previousmessage', true);
+            this.enable_command('firstmessage', true);
+            }
+          }
+        
+        // make preview/message frame visible
+        if (this.env.action == 'preview' && this.env.framed && parent.rcmail)
+          {
+          this.enable_command('compose', 'add-contact', false);
+          parent.rcmail.show_contentframe(true);
+          parent.rcmail.mark_message('read', this.env.uid);
           }
 
-        if (this.env.action=='show' && this.env.blockedobjects)
+        if ((this.env.action=='show' || this.env.action=='preview') && 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', 'remove-attachment', 'send', true);
           if (this.env.spellcheck)
-            this.enable_command('spellcheck', true);
+            {
+            this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); };
+            this.set_spellcheck_state('ready');
+            }
           if (this.env.drafts_mailbox)
             this.enable_command('savedraft', true);
           }
-          
+
         if (this.env.messagecount)
           this.enable_command('select-all', 'select-none', 'sort', 'expunge', true);
 
@@ -171,36 +210,53 @@ function rcube_webmail()
         // show printing dialog
         if (this.env.action=='print')
           window.print();
-          
+
         // get unread count for each mailbox
         if (this.gui_objects.mailboxlist)
+        {
+          this.gui_objects.folderlist = 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 (this.gui_objects.contactslist)
+          {
+          this.contact_list = new rcube_list_widget(this.gui_objects.contactslist, {multiselect:true, draggable:true, keyboard:true});
+          this.contact_list.addEventListener('keypress', function(o){ p.contactlist_keypress(o); });
+          this.contact_list.addEventListener('select', function(o){ p.contactlist_select(o); });
+          this.contact_list.addEventListener('dragstart', function(o){ p.drag_active = true; });
+          this.contact_list.addEventListener('dragend', function(o){ p.drag_active = false; });
+          this.contact_list.init();
 
-        if (contacts_list)
-          this.init_contactslist(contacts_list);
-      
-        if (ldap_contacts_list)
-          this.init_ldapsearchlist(ldap_contacts_list);
+          if (this.env.cid)
+            this.contact_list.highlight_row(this.env.cid);
+
+          if (this.gui_objects.contactslist.parentNode)
+            {
+            this.gui_objects.contactslist.parentNode.onmousedown = function(e){ return p.click_on_list(e); };
+            document.onmouseup = function(e){ return p.doc_mouse_up(e); };
+            }
+          else
+            this.contact_list.focus();
+          }
 
         this.set_page_buttons();
-          
+        
+        if (this.env.address_sources && !this.env.address_sources[this.env.source].readonly)
+          this.enable_command('add', true);
+        
         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);
+        else
+          this.enable_command('search', 'reset-search', 'moveto', true);
 
+        this.enable_command('list', true);
         break;
 
 
@@ -215,16 +271,25 @@ function rcube_webmail()
           
         if (this.env.action=='folders')
           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);
+
+        if (this.gui_objects.identitieslist)
+          {
+          this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist, {multiselect:false, draggable:false, keyboard:false});
+          this.identity_list.addEventListener('select', function(o){ p.identity_select(o); });
+          this.identity_list.init();
+          this.identity_list.focus();
+
+          if (this.env.iid)
+            this.identity_list.highlight_row(this.env.iid);
+          }
 
         break;
 
       case 'login':
         var input_user = rcube_find_object('_user');
         var input_pass = rcube_find_object('_pass');
+        if (input_user)
+          input_user.onkeypress = function(e){ return rcmail.login_user_keypress(e); };
         if (input_user && input_user.value=='')
           input_user.focus();
         else if (input_pass)
@@ -241,13 +306,6 @@ function rcube_webmail()
     // 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;
 
@@ -257,167 +315,48 @@ function rcube_webmail()
 
     // start keep-alive interval
     this.start_keepalive();
+    
+    
+    // execute all foreign onload scripts
+    for (var i=0; i<this.onloads.length; i++)
+      {
+      if (typeof(this.onloads[i]) == 'string')
+        eval(this.onloads[i]);
+      else if (typeof(this.onloads[i]) == 'function')
+        this.onloads[i]();
+      }
     };
 
 
   // start interval for keep-alive/recent_check signal
   this.start_keepalive = function()
     {
-    if (this.env.keep_alive && this.task=='mail' && this.gui_objects.messagelist)
-      this._int = setInterval(this.ref+'.check_for_recent()', this.env.keep_alive * 1000);
-    else if (this.env.keep_alive && this.task!='login')
-      this._int = setInterval(this.ref+'.send_keep_alive()', this.env.keep_alive * 1000);    
+    if (this.env.keep_alive && !this.env.framed && this.task=='mail' && this.gui_objects.messagelist)
+      this._int = setInterval(function(){ ref.check_for_recent(); }, this.env.keep_alive * 1000);
+    else if (this.env.keep_alive && !this.env.framed && this.task!='login')
+      this._int = setInterval(function(){ ref.send_keep_alive(); }, this.env.keep_alive * 1000);    
     }
 
 
-  // reset last clicked if user clicks on anything other than the message table
-  this.reset_click = function()
-    {
-    var id;
-    this.in_message_list = false;
-       for (var n=0; n<this.selection.length; n++)
-         {
-      id = this.selection[n];
-      if (this.list_rows[id] && 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++)
+  this.init_message_row = function(row)
+  {
+    var uid = row.uid;
+    if (uid && this.env.messages[uid])
       {
-      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);
-        }
+      row.deleted = this.env.messages[uid].deleted ? true : false;
+      row.unread = this.env.messages[uid].unread ? true : false;
+      row.replied = this.env.messages[uid].replied ? true : false;
       }
 
-    var mbox_li;
-    if (mbox_li = this.get_mailbox_li()) 
-      this.set_classname(mbox_li, 'unfocused', true);
-    
-    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])
+    // set eventhandler to message icon
+    if ((row.icon = row.obj.cells[0].childNodes[0]) && row.icon.nodeName=='IMG')
       {
-                 
-      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;
-        }
+      var p = this;
+      row.icon.id = 'msgicn_'+row.uid;
+      row.icon._row = row.obj;
+      row.icon.onmousedown = function(e) { p.command('toggle_status', this); };
       }
-    };
+  };
 
 
   // init message compose form: set focus and eventhandlers
@@ -434,7 +373,7 @@ function rcube_webmail()
     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);
@@ -452,10 +391,10 @@ function rcube_webmail()
     else if (input_subject && input_subject.value=='')
       input_subject.focus();
     else if (input_message)
-      this.set_caret2start(input_message); // input_message.focus();
-    
+      this.set_caret2start(input_message);
+
     // get summary of all field values
-    this.cmp_hash = this.compose_field_hash();
+    this.compose_field_hash(true);
  
     // start the auto-save timer
     this.auto_save_start();
@@ -463,118 +402,24 @@ function rcube_webmail()
 
   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;
+    var handler = function(e){ return ref.ksearch_keypress(e,this); };
+    var handler2 = function(e){ return ref.ksearch_blur(e,this); };
     
-    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 (obj.addEventListener)
     {
-    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)
+      obj.addEventListener(bw.safari ? 'keydown' : 'keypress', handler, false);
+      obj.addEventListener('blur', handler2, false);
+    }
+    else
     {
-    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};
+      obj.onkeydown = handler;
+      obj.onblur = handler2;
+    }
 
-      // 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); };
-      }
+    obj.setAttribute('autocomplete', 'off');       
     };
 
 
-  // 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        *********/
@@ -618,7 +463,7 @@ function rcube_webmail()
         break;
 
       case 'logout':
-        location.href = this.env.comm_path+'&_action=logout';
+        this.goto_url('logout');
         break;      
 
       // commands to switch task
@@ -636,15 +481,16 @@ function rcube_webmail()
           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
-          // don't know what this is good for (thomasb, 2006/07/25)
-          //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();
+          {
+          if (this.env.search_request<0 || (this.env.search_request && props != this.env.source))
+            this.reset_qsearch();
+
+          this.list_contacts(props);
+          this.enable_command('add', (this.env.address_sources && !this.env.address_sources[props].readonly));
+          }
         break;
 
 
@@ -685,10 +531,18 @@ function rcube_webmail()
         this.list_page('next');
         break;
 
+      case 'lastpage':
+        this.list_page('last');
+        break;
+
       case 'previouspage':
         this.list_page('prev');
         break;
 
+      case 'firstpage':
+        this.list_page('first');
+        break;
+
       case 'expunge':
         if (this.env.messagecount)
           this.expunge_mailbox(this.env.mailbox);
@@ -708,11 +562,8 @@ function rcube_webmail()
           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);
-              }
+            if (this.env.mailbox == this.env.drafts_mailbox)
+              this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
             else
               this.show_message(uid);
             }
@@ -727,18 +578,10 @@ function rcube_webmail()
 
       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');
-            }
+          this.load_contact(0, 'add');
         else if (this.task=='settings')
           {
-          this.clear_selection();
+          this.identity_list.clear_selection();
           this.load_identity(0, 'add-identity');
           }
         break;
@@ -803,7 +646,10 @@ function rcube_webmail()
       // mail task commands
       case 'move':
       case 'moveto':
-        this.move_messages(props);
+        if (this.task == 'mail')
+          this.move_messages(props);
+        else if (this.task == 'addressbook' && this.drag_active)
+          this.copy_contact(null, props);
         break;
         
       case 'toggle_status':
@@ -816,11 +662,11 @@ function rcube_webmail()
         if (props._row.uid)
           {
           uid = props._row.uid;
-          this.dont_select = true;
+          this.message_list.dont_select = true;
           // toggle read/unread
-          if (this.message_rows[uid].deleted) {
-               flag = 'undelete';
-          } else if (!this.message_rows[uid].unread)
+          if (this.message_list.rows[uid].deleted) {
+            flag = 'undelete';
+          } else if (!this.message_list.rows[uid].unread)
             flag = 'unread';
           }
           
@@ -829,44 +675,54 @@ function rcube_webmail()
         
       case 'load-images':
         if (this.env.uid)
-          this.show_message(this.env.uid, true);
+          this.show_message(this.env.uid, true, this.env.action=='preview');
         break;
 
       case 'load-attachment':
-        var url = this.env.comm_path+'&_action=get&_mbox='+this.env.mailbox+'&_uid='+this.env.uid+'&_part='+props.part;
+        var qstring = '_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 (props.mimetype == 'text/html')
+            qstring += '&_safe=1';
+          this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment');
           if (this.attachment_win)
             {
-            setTimeout(this.ref+'.attachment_win.focus()', 10);
+            setTimeout(function(){ ref.attachment_win.focus(); }, 10);
             break;
             }
           }
 
-        location.href = url;
+        this.goto_url('get', qstring+'&_download=1');
         break;
         
       case 'select-all':
-        this.select_all(props);
+        this.message_list.select_all(props);
         break;
 
       case 'select-none':
-        this.clear_selection();
+        this.message_list.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;
+          this.show_message(this.env.next_uid, false, this.env.action=='preview');
+        break;
+
+      case 'lastmessage':
+        if (this.env.last_uid)
+          this.show_message(this.env.last_uid);
         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;
+          this.show_message(this.env.prev_uid, false, this.env.action=='preview');
+        break;
+
+      case 'firstmessage':
+        if (this.env.first_uid)
+          this.show_message(this.env.first_uid);
         break;
       
       case 'checkmail':
@@ -880,58 +736,51 @@ function rcube_webmail()
           {
           var uid;
           if (uid = this.get_single_uid())
-            url += '&_draft_uid='+uid+'&_mbox='+escape(this.env.mailbox);
-          } 
+            url += '&_draft_uid='+uid+'&_mbox='+urlencode(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();
+          // switch to mail compose step directly
+          if (props && props.indexOf('@') > 0)
+          {
+            url = this.get_task_url('mail', url);
+            this.redirect(url + '&_to='+urlencode(props));
+            break;
+          }
           
           // use contact_id passed as command parameter
+          var a_cids = new Array();
           if (props)
             a_cids[a_cids.length] = props;
-            
           // get selected contacts
-          else
+          else if (this.contact_list)
             {
-            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;
-              }
+            var selection = this.contact_list.get_selection();
+            for (var n=0; n<selection.length; n++)
+              a_cids[a_cids.length] = selection[n];
             }
-          if (a_cids.length)
-            url += '&_to='+a_cids.join(',');
-          else
-            break;
             
+          if (a_cids.length)
+            this.http_request('mailto', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source), true);
+
+          break;
           }
         else if (props)
-           url += '&_to='+encodeURIComponent(props);
+           url += '&_to='+urlencode(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;
+        this.redirect(url);
         break;
         
       case 'spellcheck':
-        if (this.env.spellcheck && this.env.spellcheck.spellCheck)
+        if (this.env.spellcheck && this.env.spellcheck.spellCheck && this.spellcheck_ready)
+          {
           this.env.spellcheck.spellCheck(this.env.spellcheck.check_link);
+          this.set_spellcheck_state('checking');
+          }
         break;
 
       case 'savedraft':
@@ -942,7 +791,8 @@ function rcube_webmail()
           break;
 
         // if saving Drafts is disabled in main.inc.php
-        if (!this.env.drafts_mailbox)
+        // or if compose form did not change
+        if (!this.env.drafts_mailbox || this.cmp_hash == this.compose_field_hash())
           break;
 
         this.set_busy(true, 'savingmessage');
@@ -990,38 +840,32 @@ function rcube_webmail()
       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' : '');
-          }
+          this.goto_url('compose', '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(command=='reply-all' ? '&_all=1' : ''), true);
         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);
-          }
+          this.goto_url('compose', '_forward_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
         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' : ''));
+          ref.printwin = window.open(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : ''));
           if (this.printwin)
-            setTimeout(this.ref+'.printwin.focus()', 20);
+            setTimeout(function(){ 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));
+          {
+          ref.sourcewin = window.open(this.env.comm_path+'&_action=viewsource&_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox));
           if (this.sourcewin)
-            setTimeout(this.ref+'.sourcewin.focus()', 20);
+            setTimeout(function(){ ref.sourcewin.focus(); }, 20);
           }
         break;
 
@@ -1029,46 +873,42 @@ function rcube_webmail()
         this.add_contact(props);
         break;
       
-      // mail quicksearch
+      // 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;
+        {
+          this.qsearch(props);
+          break;
+        }
 
       // reset quicksearch        
       case 'reset-search':
         var s = this.env.search_request;
         this.reset_qsearch();
         
-        if (s)
+        if (s && this.env.mailbox)
           this.list_mailbox(this.env.mailbox);
+        else if (s && this.task == 'addressbook')
+          this.list_contacts(this.env.source);
         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;
+        this.goto_url('');
         break;
 
       case 'identities':
-        location.href = this.env.comm_path+'&_action=identities';
+        this.goto_url('identities');
         break;
           
       case 'delete-identity':
         this.delete_identity();
         
       case 'folders':
-        location.href = this.env.comm_path+'&_action=folders';
+        this.goto_url('folders');
         break;
 
       case 'subscribe':
@@ -1128,7 +968,7 @@ function rcube_webmail()
 
       this.display_message(msg, 'loading', true);
       }
-    else if (!a && this.busy)
+    else if (!a)
       this.hide_message();
 
     this.busy = a;
@@ -1143,7 +983,7 @@ function rcube_webmail()
 
     // set timer for requests
     if (a && this.env.request_timeout)
-      this.request_timer = setTimeout(this.ref+'.request_timed_out()', this.env.request_timeout * 1000);
+      this.request_timer = setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000);
     };
 
 
@@ -1167,8 +1007,7 @@ function rcube_webmail()
     if (task=='mail')
       url += '&_mbox=INBOX';
 
-    this.set_busy(true);
-    location.href = url;
+    this.redirect(url);
     };
 
 
@@ -1194,346 +1033,182 @@ function rcube_webmail()
   /*********************************************************/
 
 
-  // onmouseup handler for mailboxlist item
-  this.mbox_mouse_up = function(mbox)
+  this.doc_mouse_up = function(e)
+    {
+    if (this.message_list)
+      this.message_list.blur();
+    else if (this.contact_list)
+      this.contact_list.blur();
+    };
+
+  this.focus_folder = function(id)
+    {
+    var li;
+    if (this.drag_active && this.check_droptarget(id) && (li = this.get_folder_li(id)))
+      this.set_classname(li, 'droptarget', true);
+    }
+
+  this.unfocus_folder = function(id)
+    {
+    var li;
+    if (this.drag_active && (li = this.get_folder_li(id)))
+      this.set_classname(li, 'droptarget', false);
+    }
+
+  // onmouseup handler for folder list item
+  this.folder_mouse_up = function(id)
     {
     if (this.drag_active)
       {
-      this.unfocus_mailbox(mbox);
-      this.command('moveto', mbox);
+      this.unfocus_folder(id);
+      this.command('moveto', id);
       }
-    else
-      this.command('list', mbox);
   
     return false;
     };
 
-
-  // onmousedown-handler of message list row
-  this.drag_row = function(e, id)
+  this.click_on_list = function(e)
     {
-    this.in_selection_before = this.in_selection(id) ? id : false;
+    if (this.message_list)
+      this.message_list.focus();
+    else if (this.contact_list)
+        this.contact_list.focus();
+
+    var mbox_li;
+    if (mbox_li = this.get_folder_li())
+      this.set_classname(mbox_li, 'unfocused', true);
+
+    rcube_event.cancel(e);
+    };
 
-    // 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)
+  this.msglist_select = function(list)
     {
-         var mod_key = this.get_modifier(e);
-         this.select_row(id,mod_key,false);
-    }
-    
-    if (this.selection.length)
+    if (this.preview_timer)
+      clearTimeout(this.preview_timer);
+
+    var selected = list.selection.length==1;
+    if (this.env.mailbox == this.env.drafts_mailbox)
+      {
+      this.enable_command('show', selected);
+      this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false);
+      }
+    else
       {
-      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); };
+      this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected);
+      this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false);
       }
 
-    return false;
+    // start timer for message preview (wait for double click)
+    if (selected && this.env.contentframe)
+      this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, this.dblclick_time + 10);
+    else if (this.env.contentframe)
+      this.show_contentframe(false);
     };
 
 
-  // onmouseup-handler of message list row
-  this.click_row = function(e, id)
+  this.msglist_dbl_click = function(list)
     {
-    var mod_key = this.get_modifier(e);
+      if (this.preview_timer)
+        clearTimeout(this.preview_timer);
 
-    // 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);
+    var uid = list.get_single_selection();
+    if (uid && this.env.mailbox == this.env.drafts_mailbox)
+      this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true);
+    else if (uid)
+      this.show_message(uid, false, 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)
+  this.msglist_keypress = function(list)
     {
-    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)
-       {
-       this.enable_command('show', selected);
-       this.enable_command('delete', 'moveto', 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);
-      }
+    if (list.key_pressed == list.ENTER_KEY)
+      this.command('show');
+    else if (list.key_pressed == list.DELETE_KEY)
+      this.command('delete');
     };
 
 
-// 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.list_rows[this.last_selected])
-         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.msglist_get_preview = function()
+  {
+    var uid = this.get_single_uid();
+    if (uid && this.env.contentframe && !this.drag_active)
+      this.show_message(uid, false, true);
+    else if (this.env.contentframe)
+      this.show_contentframe(false);
   };
   
+  
+  this.check_droptarget = function(id)
+  {
+    if (this.task == 'mail')
+      return (id != this.env.mailbox);
+    else if (this.task == 'addressbook')
+      return (id != this.env.source && this.env.address_sources[id] && !this.env.address_sources[id].readonly);
+  };
 
-  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;    
-    };
 
+  /*********************************************************/
+  /*********     (message) list functionality      *********/
+  /*********************************************************/
 
-  // 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.last_selected = n;
-        this.highlight_row(n, true);
-        }
-      }
-
-    return true;  
-    };
-    
 
   // when user doble-clicks on a row
-  this.show_message = function(id, safe)
+  this.show_message = function(id, safe, preview)
     {
     var add_url = '';
+    var action = preview ? 'preview': 'show';
     var target = window;
-    if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
+    if (preview && 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;
+      var url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url;
+      if (action == 'preview' && String(target.location.href).indexOf(url) >= 0)
+        this.show_contentframe(true);
+      else
+        {
+        this.set_busy(true, 'loading');
+        target.location.href = this.env.comm_path+url;
+        }
       }
     };
 
 
+  this.show_contentframe = function(show)
+    {
+    var frm;
+    if (this.env.contentframe && (frm = rcube_find_object(this.env.contentframe)))
+      {
+      if (!show && window.frames[this.env.contentframe] && frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0)
+        frames[this.env.contentframe].location.href = this.env.blankpage;
+      if (!bw.safari)
+        frm.style.display = show ? 'block' : 'none';
+      }
+      
+    if (!show && this.busy)
+      this.set_busy(false);
+    };
+
 
   // list a specific page
   this.list_page = function(page)
     {
     if (page=='next')
       page = this.env.current_page+1;
+    if (page=='last')
+      page = this.env.pagecount;
     if (page=='prev' && this.env.current_page>1)
       page = this.env.current_page-1;
+    if (page=='first' && this.env.current_page>1)
+      page = 1;
       
     if (page > 0 && page <= this.env.pagecount)
       {
@@ -1542,7 +1217,7 @@ function rcube_webmail()
       if (this.task=='mail')
         this.list_mailbox(this.env.mailbox, page);
       else if (this.task=='addressbook')
-        this.list_contacts(page);
+        this.list_contacts(this.env.source, page);
       }
     };
 
@@ -1560,21 +1235,26 @@ function rcube_webmail()
     // add sort to url if set
     if (sort)
       add_url += '&_sort=' + sort;
+
+    // also send search request to get the right messages
+    if (this.env.search_request)
+      add_url += '&_search='+this.env.search_request;
       
     // 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();
+      if (this.message_list)
+        this.message_list.clear_selection();
+      this.show_contentframe(false);
       }
     
-    // also send search request to get the right messages
-    if (this.env.search_request)
-      add_url += '&_search='+this.env.search_request;
-      
-    this.select_mailbox(mbox);
+    if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort))
+      add_url += '&_refresh=1';
+    
+    this.select_folder(mbox, this.env.mailbox);
+    this.env.mailbox = mbox;
 
     // load message list remotely
     if (this.gui_objects.messagelist)
@@ -1593,7 +1273,7 @@ function rcube_webmail()
     if (mbox)
       {
       this.set_busy(true, 'loading');
-      target.location.href = this.env.comm_path+'&_mbox='+escape(mbox)+(page ? '&_page='+page : '')+add_url;
+      target.location.href = this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+add_url;
       }
     };
 
@@ -1602,47 +1282,15 @@ function rcube_webmail()
   this.list_mailbox_remote = function(mbox, page, add_url)
     {
     // clear message list first
-    this.clear_message_list();
+    this.message_list.clear();
 
     // send request to server
-    var url = '_mbox='+escape(mbox)+(page ? '&_page='+page : '');
+    var url = '_mbox='+urlencode(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;
-    if (table = this.gui_objects.messagelist)
-      {
-      if (table.colgroup)
-        table.removeChild(table.colgroup);
-      if (table.tHead)
-        table.removeChild(table.tHead);
-
-      var colgroup = document.createElement('COLGROUP');
-      var thead = document.createElement('THEAD');
-      table.insertBefore(colgroup, table.tBodies[0]);
-      table.insertBefore(thead, table.tBodies[0]);
-      }
-    };
-
-
   this.expunge_mailbox = function(mbox)
     {
     var lock = false;
@@ -1657,8 +1305,8 @@ function rcube_webmail()
        }
 
     // send request to server
-    var url = '_mbox='+escape(mbox);
-    this.http_request('expunge', url+add_url, lock);
+    var url = '_mbox='+urlencode(mbox);
+    this.http_post('expunge', url+add_url, lock);
     };
 
 
@@ -1679,55 +1327,24 @@ function rcube_webmail()
        }
 
     // send request to server
-    var url = '_mbox='+escape(mbox);
-    this.http_request('purge', url+add_url, lock);
+    var url = '_mbox='+urlencode(mbox);
+    this.http_post('purge', url+add_url, lock);
     return true;
     };
-    
-  this.focus_mailbox = function(mbox)
-    {
-    var mbox_li;
-       if (this.drag_active && mbox != this.env.mailbox && (mbox_li = this.get_mailbox_li(mbox)))
-      this.set_classname(mbox_li, 'droptarget', true);
-    }
-    
-  this.unfocus_mailbox = function(mbox)
-    {
-    var mbox_li;
-       if (this.drag_active && (mbox_li = this.get_mailbox_li(mbox)))
-      this.set_classname(mbox_li, 'droptarget', false);
-    }
+
   
   // 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
+    // exit if current or no mailbox specified or if selection is empty
+    if (!mbox || !this.env.uid || mbox==this.env.mailbox)
       {
-      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);
+      if (!this.message_list || !this.message_list.get_selection().length)
+        return;
       }
-      
+
     var lock = false;
+    var add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');
 
     // show wait message
     if (this.env.action=='show')
@@ -1735,96 +1352,122 @@ function rcube_webmail()
       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);
+    else
+      this.show_contentframe(false);
+
+    this._with_selected_messages('moveto', lock, add_url);
     };
 
-  this.permanently_remove_messages = function() {
-    // exit if no mailbox specified or if selection is empty
-    if (!(this.selection.length || this.env.uid))
-      return;
+  // delete selected messages from the current mailbox
+  this.delete_messages = function()
+    {
+    var selection = this.message_list ? this.message_list.get_selection() : new Array();
     
-    var a_uids = new Array();
+    // exit if no mailbox specified or if selection is empty
+    if (!this.env.uid && !selection.length)
+        return;
 
-    if (this.env.uid)
-      a_uids[a_uids.length] = this.env.uid;
-    else
+    // 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())
       {
-      var id;
-      for (var n=0; n<this.selection.length; n++)
+      // if shift was pressed delete it immediately
+      if (this.message_list && this.message_list.shiftkey)
         {
-        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';
+        if (confirm(this.get_label('deletemessagesconfirm')))
+          this.permanently_remove_messages();
         }
+      else
+        this.move_messages(this.env.trash_mailbox);
       }
-      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"){
+    else if (!this.env.trash_mailbox && this.env.flag_for_deletion)
+      {
+      this.mark_message('delete');
+      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);
+      else if (selection.length == 1)
+        this.message_list.select_next();
       }
     // 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) {
+    else if (!this.env.trash_mailbox) 
       this.permanently_remove_messages();
-    }
-    return;
   };
 
 
+  // delete the selected messages permanently
+  this.permanently_remove_messages = function()
+    {
+    // exit if no mailbox specified or if selection is empty
+    if (!this.env.uid && (!this.message_list || !this.message_list.get_selection().length))
+      return;
+      
+    this.show_contentframe(false);
+    this._with_selected_messages('delete', false, '&_from='+(this.env.action ? this.env.action : ''));
+    };
+
+  // Send a specifc request with UIDs of all selected messages
+  // @private
+  this._with_selected_messages = function(action, lock, add_url)
+    {
+    var a_uids = new Array();
+    if (this.env.uid)
+      a_uids[a_uids.length] = this.env.uid;
+    else
+      {
+      var selection = this.message_list.get_selection();
+      var id;
+      for (var n=0; n<selection.length; n++)
+        {
+        id = selection[n];
+        a_uids[a_uids.length] = id;
+        this.message_list.remove_row(id);
+        }
+
+      this.message_list.select_next();
+      }
+      
+    // also send search request to get the right messages 
+    if (this.env.search_request) 
+      add_url += '&_search='+this.env.search_request;
+
+    // send request to server
+    this.http_post(action, '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock);
+    };
+
+
   // set a specific flag to one or more messages
   this.mark_message = function(flag, uid)
     {
     var a_uids = new Array();
+    var selection = this.message_list ? this.message_list.get_selection() : new Array();
     
     if (uid)
       a_uids[0] = uid;
     else if (this.env.uid)
       a_uids[0] = this.env.uid;
-    else
+    else if (this.message_list)
       {
-      var id;
-      for (var n=0; n<this.selection.length; n++)
+      for (var id, n=0; n<selection.length; n++)
         {
-        id = this.selection[n];
-        a_uids[a_uids.length] = id;
+        id = selection[n];
+        if ((flag=='read' && this.message_list.rows[id].unread) || (flag=='unread' && !this.message_list.rows[id].unread)
+            || (flag=='delete' && !this.message_list.rows[id].deleted) || (flag=='undelete' && this.message_list.rows[id].deleted))
+          a_uids[a_uids.length] = id;
         }
       }
-      switch (flag) {
+    
+    // nothing to do
+    if (!a_uids.length)
+      return;
+      
+    switch (flag)
+      {
         case 'read':
         case 'unread':
-          this.toggle_read_status(flag,a_uids);
+          this.toggle_read_status(flag, a_uids);
           break;
         case 'delete':
         case 'undelete':
@@ -1834,66 +1477,73 @@ function rcube_webmail()
     };
 
   // set class to read/unread
-  this.toggle_read_status = function(flag, a_uids) {
+  this.toggle_read_status = function(flag, a_uids)
+  {
     // mark all message rows as read/unread
     var icn_src;
+    var rows = this.message_list.rows;
     for (var i=0; i<a_uids.length; i++)
       {
       uid = a_uids[i];
-      if (this.message_rows[uid])
+      if (rows[uid])
         {
-        this.message_rows[uid].unread = (flag=='unread' ? true : false);
+        rows[uid].unread = (flag=='unread' ? true : false);
         
-        if (this.message_rows[uid].classname.indexOf('unread')<0 && this.message_rows[uid].unread)
+        if (rows[uid].classname.indexOf('unread')<0 && rows[uid].unread)
           {
-          this.message_rows[uid].classname += ' unread';
-          this.set_classname(this.message_rows[uid].obj, 'unread', true);
+          rows[uid].classname += ' unread';
+          this.set_classname(rows[uid].obj, 'unread', true);
 
           if (this.env.unreadicon)
             icn_src = this.env.unreadicon;
           }
-        else if (!this.message_rows[uid].unread)
+        else if (!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);
+          rows[uid].classname = rows[uid].classname.replace(/\s*unread/, '');
+          this.set_classname(rows[uid].obj, 'unread', false);
 
-          if (this.message_rows[uid].replied && this.env.repliedicon)
+          if (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;
+        if (rows[uid].icon && icn_src)
+          rows[uid].icon.src = icn_src;
         }
       }
-      this.http_request('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
-  }
+      
+    this.http_post('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_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)
-      }
+    var rows = this.message_list.rows;
+    if (a_uids.length==1)
+    {
+      if (rows[a_uids[0]] && 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++) {
+    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) {
+      if (rows[uid]) {
+        if (rows[uid].classname.indexOf('deleted')<0)
+        {
           all_deleted = false;
           break;
         }
@@ -1906,72 +1556,90 @@ function rcube_webmail()
       this.flag_as_deleted(a_uids);
     
     return true;
-  }
+  };
+
 
-  this.flag_as_undeleted = function(a_uids){
+  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;
+    var rows = this.message_list.rows;
       
-    for (var i=0; i<a_uids.length; i++) {
+    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 (rows[uid]) {
+        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 (rows[uid].classname.indexOf('deleted') > 0)
+        {
+          rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, '');
+          this.set_classname(rows[uid].obj, 'deleted', false);
         }
-        if (this.message_rows[uid].unread && this.env.unreadicon)
+        if (rows[uid].unread && this.env.unreadicon)
           icn_src = this.env.unreadicon;
-        else if (this.message_rows[uid].replied && this.env.repliedicon)
+        else if (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;
+        if (rows[uid].icon && icn_src)
+          rows[uid].icon.src = icn_src;
       }
     }
-    this.http_request('mark', '_uid='+a_uids.join(',')+'&_flag=undelete');
+
+    this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag=undelete');
     return true;
-  }
+  };
+
   
-  this.flag_as_deleted = function(a_uids) {
+  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++) {
+    var rows = this.message_list.rows;
+    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 (rows[uid]) {
+        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 (rows[uid].classname.indexOf('deleted')<0) {
+          rows[uid].classname += ' deleted';
+          this.set_classname(rows[uid].obj, 'deleted', true);
         }
-        if (this.message_rows[uid].icon && this.env.deletedicon)
-          this.message_rows[uid].icon.src = this.env.deletedicon;
+        if (rows[uid].icon && this.env.deletedicon)
+          rows[uid].icon.src = this.env.deletedicon;
       }
     }
-    this.http_request('mark', '_uid='+a_uids.join(',')+'&_flag=delete');
+
+    this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag=delete');
     return true;  
-  }
+  };
 
 
-  this.get_mailbox_li = function(mbox)
+  /*********************************************************/
+  /*********           login form methods          *********/
+  /*********************************************************/
+
+  // handler for keyboard events on the _user field
+  this.login_user_keypress = function(e)
+  {
+    var key = rcube_event.get_keycode(e);
+    var elm;
+
+    // enter
+    if ((key==13) && (elm = rcube_find_object('_pass')))
     {
-    if (this.gui_objects.mailboxlist)
-      {
-      mbox = String((mbox ? mbox : this.env.mailbox)).toLowerCase().replace(this.mbox_expression, '');
-      return document.getElementById('rcmbx'+mbox);
-      }
-    
-    return null;
-    };
-    
+      elm.focus();
+      return false;
+    }
+  };
+
 
   /*********************************************************/
   /*********        message compose methods        *********/
@@ -2012,7 +1680,7 @@ function rcube_webmail()
       }
 
     // check for empty body
-    if (input_message.value=='')
+    if ((input_message.value=='')&&(tinyMCE.getContent()==''))
       {
       if (!confirm(this.get_label('nobodywarning')))
         {
@@ -2025,14 +1693,28 @@ function rcube_webmail()
     };
 
 
+  this.set_spellcheck_state = function(s)
+    {
+    this.spellcheck_ready = (s=='check_spelling' || s=='ready');
+    this.enable_command('spellcheck', this.spellcheck_ready);
+    };
+
+
+  this.set_draft_id = function(id)
+    {
+    var f;
+    if (f = rcube_find_object('_draft_saveid'))
+      f.value = id;
+    };
+
   this.auto_save_start = function()
     {
     if (this.env.draft_autosave)
-      this.save_timer = self.setTimeout(this.ref+'.command("savedraft")', this.env.draft_autosave * 1000);
+      this.save_timer = self.setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000);
     };
 
 
-  this.compose_field_hash = function()
+  this.compose_field_hash = function(save)
     {
     // check input fields
     var input_to = rcube_find_object('_to');
@@ -2052,7 +1734,10 @@ function rcube_webmail()
       str += input_subject.value+':';
     if (input_message && input_message.value)
       str += input_message.value;
-
+    
+    if (save)
+      this.cmp_hash = str;
+    
     return str;
     };
     
@@ -2065,35 +1750,71 @@ function rcube_webmail()
     var id = obj.options[obj.selectedIndex].value;
     var input_message = rcube_find_object('_message');
     var message = input_message ? input_message.value : '';
+    var is_html = (rcube_find_object('_is_html').value == '1');
     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])
+  
+    if (!is_html)
       {
-      sig = this.env.signatures[this.env.identity];
-      if (sig.indexOf('--')!=0)
-        sig = '--\n'+sig;
+      // remove the 'old' signature
+      if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity])
+        {
+        sig = this.env.signatures[this.env.identity]['text'];
+        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);
-      }
+        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])
+      // add the new signature string
+      if (this.env.signatures && this.env.signatures[id])
+        {
+        sig = this.env.signatures[id]['text'];
+        if (this.env.signatures[id]['is_html'])
+          {
+          sig = this.env.signatures[id]['plain_text'];
+          }
+        if (sig.indexOf('-- ')!=0)
+          sig = '-- \n'+sig;
+        message += '\n'+sig;
+        }
+      }
+    else
       {
-      sig = this.env.signatures[id];
-      if (sig.indexOf('--')!=0)
-        sig = '--\n'+sig;
-      message += '\n'+sig;
+      var eid = tinyMCE.getEditorId('_message');
+      // editor is a TinyMCE_Control object
+      var editor = tinyMCE.getInstanceById(eid);
+      var msgDoc = editor.getDoc();
+      var msgBody = msgDoc.body;
+
+      if (this.env.signatures && this.env.signatures[id])
+        {
+        // Append the signature as a span within the body
+        var sigElem = msgDoc.getElementById("_rc_sig");
+        if (!sigElem)
+          {
+          sigElem = msgDoc.createElement("span");
+          sigElem.setAttribute("id", "_rc_sig");
+          msgBody.appendChild(sigElem);
+          }
+        if (this.env.signatures[id]['is_html'])
+          {
+          sigElem.innerHTML = this.env.signatures[id]['text'];
+          }
+        else
+          {
+          sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>';
+          }
+        }
       }
 
     if (input_message)
       input_message.value = message;
-      
+
     this.env.identity = id;
     return true;
     };
@@ -2185,7 +1906,7 @@ function rcube_webmail()
     {
     if (!this.gui_objects.attachmentlist)
       return false;
-
+      
     var li = document.createElement('LI');
     li.id = name;
     li.innerHTML = content;
@@ -2207,7 +1928,7 @@ function rcube_webmail()
   this.remove_attachment = function(name)
     {
     if (name)
-      this.http_request('remove-attachment', '_file='+escape(name));
+      this.http_post('remove-attachment', '_file='+urlencode(name));
 
     return true;
     };
@@ -2216,19 +1937,27 @@ function rcube_webmail()
   this.add_contact = function(value)
     {
     if (value)
-      this.http_request('addcontact', '_address='+value);
+      this.http_post('addcontact', '_address='+value);
     
     return true;
     };
 
-  // send remote request to search mail
-  this.qsearch = function(value, mbox)
+  // send remote request to search mail or contacts
+  this.qsearch = function(value)
     {
-    if (value && mbox)
+    if (value != '')
       {
-      this.clear_message_list();
+      if (this.message_list)
+        this.message_list.clear();
+      else if (this.contact_list) {
+        this.contact_list.clear(true);
+        this.show_contentframe(false);
+      }
+
+      // reset vars
+      this.env.current_page = 1;
       this.set_busy(true, 'searching');
-      this.http_request('search', '_search='+value+'&_mbox='+mbox, true);
+      this.http_request('search', '_q='+urlencode(value)+(this.env.mailbox ? '&_mbox='+this.env.mailbox : '')+(this.env.source ? '&_source='+urlencode(this.env.source) : ''), true);
       }
     return true;
     };
@@ -2265,11 +1994,9 @@ function rcube_webmail()
     if (this.ksearch_timer)
       clearTimeout(this.ksearch_timer);
 
-    if (!e)
-      e = window.event;
-      
     var highlight;
-    var key = e.keyCode ? e.keyCode : e.which;
+    var key = rcube_event.get_keycode(e);
+    var mod = rcube_event.get_modifier(e);
 
     switch (key)
       {
@@ -2288,7 +2015,6 @@ function rcube_webmail()
         if (highlight && (next = dir ? highlight.previousSibling : highlight.nextSibling))
           {
           highlight.removeAttribute('id');
-          //highlight.removeAttribute('class');
           this.set_classname(highlight, 'selected', false);
           }
 
@@ -2299,42 +2025,21 @@ function rcube_webmail()
           this.ksearch_selected = next._rcm_id;
           }
 
-        if (e.preventDefault)
-          e.preventDefault();
-        return false;
+        return rcube_event.cancel(e);
 
       case 9:  // tab
-        if(e.shiftKey)
+        if(mod == SHIFT_KEY)
           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
+        // insert selected address and hide ksearch pane
+        this.insert_recipient(this.ksearch_selected);
         this.ksearch_hide();
-      
-        if (e.preventDefault)
-          e.preventDefault();
-        return false;
+
+        return rcube_event.cancel(e);
 
       case 27:  // escape
         this.ksearch_hide();
@@ -2343,13 +2048,37 @@ function rcube_webmail()
       }
 
     // start timer
-    this.ksearch_timer = setTimeout(this.ref+'.ksearch_get_results()', 200);      
+    this.ksearch_timer = setTimeout(function(){ ref.ksearch_get_results(); }, 200);
     this.ksearch_input = obj;
     
     return true;
     };
 
 
+  this.insert_recipient = function(id)
+  {
+    if (!this.env.contacts[id] || !this.ksearch_input)
+      return;
+    
+    // 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[id]+', ';
+    this.ksearch_input.value = pre + insert + end;
+    
+    // set caret to insert pos
+    cpos = p+insert.length;
+    if (this.ksearch_input.setSelectionRange)
+      this.ksearch_input.setSelectionRange(cpos, cpos);
+    
+  };
+
+
   // address search processor
   this.ksearch_get_results = function()
     {
@@ -2415,6 +2144,8 @@ function rcube_webmail()
         {
         li = document.createElement('LI');
         li.innerHTML = a_results[i].replace(/</, '&lt;').replace(/>/, '&gt;');
+        li.onmousedown = function(e){ ref.insert_recipient(this._rcm_id); ref.ksearch_pane.show(0); return rcube_event.cancel(e); };
+        li.style.cursor = 'pointer';
         li._rcm_id = a_result_ids[i];
         ul.appendChild(li);
         }
@@ -2440,9 +2171,6 @@ function rcube_webmail()
         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);
@@ -2481,18 +2209,56 @@ function rcube_webmail()
   /*********************************************************/
 
 
-  this.list_contacts = function(page)
+  this.contactlist_keypress = function(list)
+    {
+      if (list.key_pressed == list.DELETE_KEY)
+        this.command('delete');
+    };
+
+
+  this.contactlist_select = function(list)
+    {
+      if (this.preview_timer)
+        clearTimeout(this.preview_timer);
+
+      var id, frame, ref = this;
+      if (id = list.get_single_selection())
+        this.preview_timer = setTimeout(function(){ ref.load_contact(id, 'show'); }, this.dblclick_time + 10);
+      else if (this.env.contentframe)
+        this.show_contentframe(false);
+
+      this.enable_command('edit', id?true:false);
+      this.enable_command('compose', list.selection.length > 0);
+      this.enable_command('delete', list.selection.length && this.env.address_sources && !this.env.address_sources[this.env.source].readonly);
+
+      return false;
+    };
+
+
+  this.list_contacts = function(src, page)
     {
     var add_url = '';
     var target = window;
     
-    if (page && this.current_page==page)
+    if (!src)
+      src = this.env.source;
+    
+    if (page && this.current_page==page && src == this.env.source)
       return false;
+      
+    if (src != this.env.source)
+      {
+      page = 1;
+      this.env.current_page = page;
+      }
+
+    this.select_folder(src, this.env.source);
+    this.env.source = src;
 
     // load contacts remotely
     if (this.gui_objects.contactslist)
       {
-      this.list_contacts_remote(page);
+      this.list_contacts_remote(src, page);
       return;
       }
 
@@ -2502,25 +2268,31 @@ function rcube_webmail()
       add_url = '&_framed=1';
       }
 
+    // also send search request to get the correct listing
+    if (this.env.search_request)
+      add_url += '&_search='+this.env.search_request;
+
     this.set_busy(true, 'loading');
-    location.href = this.env.comm_path+(page ? '&_page='+page : '')+add_url;
+    target.location.href = this.env.comm_path+(src ? '&_source='+urlencode(src) : '')+(page ? '&_page='+page : '')+add_url;
     };
 
 
   // send remote request to load contacts list
-  this.list_contacts_remote = function(page)
+  this.list_contacts_remote = function(src, 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;
+    // clear message list first
+    this.contact_list.clear(true);
+    this.show_contentframe(false);
+    this.enable_command('delete', 'compose', false);
 
     // send request to server
-    var url = page ? '&_page='+page : '';
+    var url = (src ? '&_source='+urlencode(src) : '') + (page ? '&_page='+page : '');
+    this.env.source = src;
+    
+    // also send search request to get the right messages 
+    if (this.env.search_request) 
+      url += '&_search='+this.env.search_request;
+
     this.set_busy(true, 'loading');
     this.http_request('list', url, true);
     };
@@ -2535,28 +2307,35 @@ function rcube_webmail()
       {
       add_url = '&_framed=1';
       target = window.frames[this.env.contentframe];
-      document.getElementById(this.env.contentframe).style.visibility = 'inherit';
+      this.show_contentframe(true);
       }
     else if (framed)
       return false;
       
-    //if (this.env.framed && add_url=='')
-    
-    //  add_url = '&_framed=1';
-    
-    if (action && (cid || action=='add'))
+    if (action && (cid || action=='add') && !this.drag_active)
       {
       this.set_busy(true);
-      target.location.href = this.env.comm_path+'&_action='+action+'&_cid='+cid+add_url;
+      target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url;
       }
     return true;
     };
 
+  // copy a contact to the specified target (group or directory)
+  this.copy_contact = function(cid, to)
+  {
+    if (!cid)
+      cid = this.contact_list.get_selection().join(',');
+
+    if (to != this.env.source && cid && this.env.address_sources[to] && !this.env.address_sources[to].readonly)
+      this.http_post('copy', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_to='+urlencode(to));
+  };
+
 
   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')))
+    var selection = this.contact_list.get_selection();
+    if (!(selection.length || this.env.cid) || !confirm(this.get_label('deletecontactconfirm')))
       return;
       
     var a_cids = new Array();
@@ -2566,26 +2345,20 @@ function rcube_webmail()
     else
       {
       var id;
-      for (var n=0; n<this.selection.length; n++)
+      for (var n=0; n<selection.length; n++)
         {
-        id = this.selection[n];
+        id = 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';
+        this.contact_list.remove_row(id);
         }
 
       // 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';
-        }
+      if (selection.length == 1)
+        this.show_contentframe(false);
       }
 
     // send request to server
-    this.http_request('delete', '_cid='+a_cids.join(',')+'&_from='+(this.env.action ? this.env.action : ''));
+    this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_from='+(this.env.action ? this.env.action : ''));
     return true;
     };
 
@@ -2593,69 +2366,30 @@ function rcube_webmail()
   // 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 row;
+    if (this.contact_list.rows[cid] && (row = this.contact_list.rows[cid].obj))
       {
-      var frame = window.frames[this.env.contentframe];
+      for (var c=0; c<cols_arr.length; c++)
+        if (row.cells[c])
+          row.cells[c].innerHTML = cols_arr[c];
 
-      // 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 true;
       }
+
     return false;
-    }
-  
+    };
 
 
   /*********************************************************/
   /*********        user settings methods          *********/
   /*********************************************************/
 
+  this.identity_select = function(list)
+    {
+    var id;
+    if (id = list.get_single_selection())
+      this.load_identity(id, 'edit-identity');
+    };
 
   // load contact record
   this.load_identity = function(id, action)
@@ -2681,30 +2415,18 @@ function rcube_webmail()
     };
 
 
-
   this.delete_identity = function(id)
     {
     // exit if no mailbox specified or if selection is empty
-    if (!(this.selection.length || this.env.iid))
+    var selection = this.identity_list.get_selection();
+    if (!(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';
-      }
-*/
+      id = this.env.iid ? this.env.iid : selection[0];
 
     // 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);
+    this.goto_url('delete-identity', '_iid='+id, true);
     return true;
     };
 
@@ -2712,15 +2434,15 @@ function rcube_webmail()
   // tell server to create and subscribe a new mailbox
   this.create_folder = function(name)
     {
-       if (this.edit_folder)
-         this.reset_folder_rename();
+  if (this.edit_folder)
+    this.reset_folder_rename();
 
     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);
+      this.http_post('create-folder', '_name='+urlencode(name), true);
     else if (form.elements['_folder_name'])
       form.elements['_folder_name'].focus();
     };
@@ -2743,7 +2465,7 @@ function rcube_webmail()
       }
 
     if (oldname && newname)
-      this.http_request('rename-folder', '_folder_oldname='+escape(oldname)+'&_folder_newname='+escape(newname));
+      this.http_post('rename-folder', '_folder_oldname='+urlencode(oldname)+'&_folder_newname='+urlencode(newname));
     };
 
 
@@ -2755,17 +2477,17 @@ function rcube_webmail()
     var id = this.get_folder_row_id(folder);
 
     // reset current renaming
-       if (temp = this.edit_folder)
-         {
-         this.reset_folder_rename();
-         if (temp == id)
-           return;
-         }
+  if (temp = this.edit_folder)
+    {
+    this.reset_folder_rename();
+    if (temp == id)
+      return;
+    }
 
     if (id && (row = document.getElementById(id)))
       {
       this.name_input = document.createElement('INPUT');
-      this.name_input.value = this.env.subscriptionrows[id];
+      this.name_input.value = this.env.subscriptionrows[id][1];
       this.name_input.style.width = '100%';
       this.name_input.onkeypress = function(e){ rcmail.name_input_keypress(e); };
       
@@ -2783,8 +2505,8 @@ function rcube_webmail()
   this.reset_folder_rename = function()
     {
     var cell = this.name_input ? this.name_input.parentNode : null;
-    if (cell && this.edit_folder)
-      cell.innerHTML = this.env.subscriptionrows[this.edit_folder];
+    if (cell && this.edit_folder && this.env.subscriptionrows[this.edit_folder])
+      cell.innerHTML = this.env.subscriptionrows[this.edit_folder][1];
       
     this.edit_folder = null;
     };
@@ -2793,14 +2515,14 @@ function rcube_webmail()
   // handler for keyboard events on the input field
   this.name_input_keypress = function(e)
     {
-    var key = document.all ? event.keyCode : document.getElementById ? e.keyCode : 0;
+    var key = rcube_event.get_keycode(e);
 
     // enter
     if (key==13)
       {
       var newname = this.name_input ? this.name_input.value : null;
       if (this.edit_folder && newname)
-        this.http_request('rename-folder', '_folder_oldname='+escape(this.env.subscriptionrows[this.edit_folder])+'&_folder_newname='+escape(newname));        
+        this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname));
       }
     // escape
     else if (key==27)
@@ -2811,16 +2533,16 @@ function rcube_webmail()
   // delete a specific mailbox with all its messages
   this.delete_folder = function(folder)
     {
-       if (this.edit_folder)
-         this.reset_folder_rename();
+  if (this.edit_folder)
+    this.reset_folder_rename();
     
     if (folder)
-      this.http_request('delete-folder', '_mboxes='+escape(folder));
+      this.http_post('delete-folder', '_mboxes='+urlencode(folder));
     };
 
 
   // add a new folder to the subscription list by cloning a folder row
-  this.add_folder_row = function(name, replace)
+  this.add_folder_row = function(name, display_name, replace)
     {
     name = name.replace('\\',"");
     if (!this.gui_objects.subscriptionlist)
@@ -2837,7 +2559,7 @@ function rcube_webmail()
     if (!id || !(refrow = document.getElementById(refid)))
       {
       // Refresh page if we don't have a table row to clone
-      location.href = this.env.comm_path+'&_action=folders';
+      this.goto_url('folders');
       }
     else
       {
@@ -2851,10 +2573,10 @@ function rcube_webmail()
       }
 
     // add to folder/row-ID map
-    this.env.subscriptionrows[row.id] = name;
+    this.env.subscriptionrows[row.id] = [name, display_name];
 
     // set folder name
-    row.cells[0].innerHTML = name;
+    row.cells[0].innerHTML = display_name;
     if (row.cells[1] && row.cells[1].firstChild.tagName=='INPUT')
       {
       row.cells[1].firstChild.value = name;
@@ -2875,17 +2597,18 @@ function rcube_webmail()
         form.elements['_folder_name'].value = ''; 
       }
 
+    this.sort_subscription_list();
     };
 
 
   // replace an existing table row with a new folder line
-  this.replace_folder_row = function(newfolder, oldfolder)
+  this.replace_folder_row = function(oldfolder, newfolder, display_name)
     {
     var id = this.get_folder_row_id(oldfolder);
     var row = document.getElementById(id);
     
     // replace an existing table row (if found)
-    this.add_folder_row(newfolder, row);
+    this.add_folder_row(newfolder, display_name, row);
     this.env.subscriptionrows[id] = null;
     
     // rename folder in rename-folder dropdown
@@ -2896,7 +2619,7 @@ function rcube_webmail()
         {
         if (elm.options[i].value == oldfolder)
           {
-          elm.options[i].text = newfolder;
+          elm.options[i].text = display_name;
           elm.options[i].value = newfolder;
           break;
           }
@@ -2941,7 +2664,7 @@ function rcube_webmail()
     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.http_post('subscribe', '_mboxes='+urlencode(folder));
     };
 
 
@@ -2951,7 +2674,7 @@ function rcube_webmail()
     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.http_post('unsubscribe', '_mboxes='+urlencode(folder));
     };
     
 
@@ -2985,7 +2708,7 @@ function rcube_webmail()
           list_to[index] = new Option(a_folders[n]);
           }
           
-        this.http_request(action, '_mboxes='+escape(a_folders.join(',')));
+        this.http_post(action, '_mboxes='+urlencode(a_folders.join(',')));
         }
       }
       
@@ -2995,7 +2718,7 @@ function rcube_webmail()
   this.get_folder_row_id = function(folder)
     {
     for (var id in this.env.subscriptionrows)
-      if (this.env.subscriptionrows[id]==folder)
+      if (this.env.subscriptionrows[id] && this.env.subscriptionrows[id][0] == folder)
         break;
         
     return id;
@@ -3023,6 +2746,32 @@ function rcube_webmail()
     return new_row;
     };
 
+  // sort subscription folder list
+  this.sort_subscription_list = function()
+    {
+    var index = new Array();
+    var tbody = this.gui_objects.subscriptionlist.tBodies[0];
+    var swapped = false;
+    for (var i = 0; i<(tbody.childNodes.length-1); i++)
+      if (this.env.subscriptionrows[tbody.childNodes[i].id]!=null)
+        index.push(i);
+    for (i = 0; i<(index.length-1); i++)
+      {
+      if (this.env.subscriptionrows[tbody.childNodes[index[i]].id][0]>
+          this.env.subscriptionrows[tbody.childNodes[index[i+1]].id][0])
+        {
+        var swap = tbody.replaceChild(tbody.childNodes[index[i]], tbody.childNodes[index[i+1]]);
+        if (typeof(tbody.childNodes[index[i]]) != 'undefined')
+          tbody.insertBefore(swap, tbody.childNodes[index[i]])
+        else
+          tbody.appendChild(swap);
+        swapped = true;
+        }
+      }
+    if (swapped)
+      this.sort_subscription_list();
+    };
+
 
   /*********************************************************/
   /*********           GUI functionality           *********/
@@ -3033,7 +2782,9 @@ function rcube_webmail()
   this.set_page_buttons = function()
     {
     this.enable_command('nextpage', (this.env.pagecount > this.env.current_page));
+    this.enable_command('lastpage', (this.env.pagecount > this.env.current_page));
     this.enable_command('previouspage', (this.env.current_page > 1));
+    this.enable_command('firstpage', (this.env.current_page > 1));
     }
 
 
@@ -3164,6 +2915,10 @@ function rcube_webmail()
   // display a system message
   this.display_message = function(msg, type, hold)
     {
+    // pass command to parent window
+    if (this.env.framed && parent.rcmail )
+      return parent.rcmail.display_message(msg, type, hold);
+
     this.set_busy(false);
     if (!this.loaded)  // save message in order to display after page loaded
       {
@@ -3189,7 +2944,7 @@ function rcube_webmail()
       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);
+      this.message_timer = setTimeout(function(){ ref.hide_message(); }, this.message_time);
     };
 
 
@@ -3205,38 +2960,37 @@ function rcube_webmail()
 
 
   // mark a mailbox as selected and set environment variable
-  this.select_mailbox = function(mbox)
+  this.select_folder = function(name, old)
+  {
+    if (this.gui_objects.folderlist)
     {
-    if (this.gui_objects.mailboxlist )
-      {
-      var item, reg, text_obj;      
-      var current_li = this.get_mailbox_li();
-      var mbox_li = this.get_mailbox_li(mbox);
+      var current_li, target_li;
       
-      if (current_li)
-        {
+      if ((current_li = this.get_folder_li(old)))
+      {
         this.set_classname(current_li, 'selected', false);
         this.set_classname(current_li, 'unfocused', false);
-        }
-
-      if (mbox_li || this.env.mailbox == mbox)
-        {
-        this.set_classname(mbox_li, 'unfocused', false);
-        this.set_classname(mbox_li, 'selected', true);
-        }
       }
-      
-    // also update mailbox name in window title
-    if (document.title)
+
+      if ((target_li = this.get_folder_li(name)))
       {
-      var doc_title = String(document.title);
-      var reg = new RegExp(this.env.mailbox.toLowerCase(), 'i');
-      if (this.env.mailbox && doc_title.match(reg))
-        document.title = doc_title.replace(reg, mbox).replace(/^\([0-9]+\)\s+/i, '');
+        this.set_classname(target_li, 'unfocused', false);
+        this.set_classname(target_li, 'selected', true);
       }
-    
-    this.env.mailbox = mbox;
-    };
+    }
+  };
+
+  // helper method to find a folder list item
+  this.get_folder_li = function(name)
+  {
+    if (this.gui_objects.folderlist)
+    {
+      name = String(name).replace(this.identifier_expr, '');
+      return document.getElementById('rcmli'+name);
+    }
+
+    return null;
+  };
 
 
   // for reordering column array, Konqueror workaround
@@ -3271,9 +3025,9 @@ function rcube_webmail()
   // 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])
+    if (!this.gui_objects.messagelist || !this.message_list)
       return false;
-    
+
     var tbody = this.gui_objects.messagelist.tBodies[0];
     var rowcount = tbody.rows.length;
     var even = rowcount%2;
@@ -3285,8 +3039,8 @@ function rcube_webmail()
     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))
+
+    if (this.message_list.in_selection(uid))
       row.className += ' selected';
 
     var icon = flags.deleted && this.env.deletedicon ? this.env.deletedicon:
@@ -3312,13 +3066,8 @@ function rcube_webmail()
     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);
+
+    this.message_list.insert_row(row, attop);
     };
 
 
@@ -3333,12 +3082,16 @@ function rcube_webmail()
     };
 
   // replace content of quota display
-   this.set_quota = function(text)
-     {
-     if (this.gui_objects.quotadisplay)
-       this.gui_objects.quotadisplay.innerHTML = text;
+  this.set_quota = function()
+    {
+    if (this.gui_objects.quotadisplay &&
+        this.gui_objects.quotadisplay.attributes.getNamedItem('display') &&
+        this.gui_objects.quotadisplay.attributes.getNamedItem('id'))
+      this.http_request('quotadisplay', '_display='+
+      this.gui_objects.quotadisplay.attributes.getNamedItem('display').nodeValue+
+      '&_id='+this.gui_objects.quotadisplay.attributes.getNamedItem('id').nodeValue, false);
      };
-                            
+
 
   // update the mailboxlist
   this.set_unread_count = function(mbox, count, set_title)
@@ -3350,8 +3103,8 @@ function rcube_webmail()
       set_title = true;
 
     var reg, text_obj;
-    var item = this.get_mailbox_li(mbox);
-    mbox = String(mbox).toLowerCase().replace(this.mbox_expression, '');
+    var item = this.get_folder_li(mbox);
+    mbox = String(mbox).toLowerCase().replace(this.identifier_expr, '');
 
     if (item && item.className && item.className.indexOf('mailbox '+mbox)>=0)
       {
@@ -3387,7 +3140,7 @@ function rcube_webmail()
 
 
   // add row to contacts list
-  this.add_contact_row = function(cid, cols)
+  this.add_contact_row = function(cid, cols, select)
     {
     if (!this.gui_objects.contactslist || !this.gui_objects.contactslist.tBodies[0])
       return false;
@@ -3400,7 +3153,7 @@ function rcube_webmail()
     row.id = 'rcmrow'+cid;
     row.className = 'contact '+(even ? 'even' : 'odd');
     
-    if (this.in_selection(cid))
+    if (this.contact_list.in_selection(cid))
       row.className += ' selected';
 
     // add each submitted col
@@ -3412,73 +3165,21 @@ function rcube_webmail()
       row.appendChild(col);
       }
     
-    tbody.appendChild(row);
-    this.init_table_row(row, 'contact_rows');
+    this.contact_list.insert_row(row);
     };
 
 
-
-  /********************************************************/
-  /*********          drag & drop methods         *********/
-  /********************************************************/
-
-
-  this.drag_mouse_move = function(e)
+  this.toggle_editor = function(checkbox, textElementName)
     {
-    if (this.drag_start)
+    var ischecked = checkbox.checked;
+    if (ischecked)
       {
-      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);
+        tinyMCE.execCommand('mceAddControl', true, textElementName);
+      }
+    else
+      {
+        tinyMCE.execCommand('mceRemoveControl', true, textElementName);
       }
-
-    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;
     };
 
 
@@ -3487,6 +3188,24 @@ function rcube_webmail()
   /*********        remote request methods        *********/
   /********************************************************/
 
+  this.redirect = function(url)
+    {
+    this.set_busy(true);
+    if (this.env.framed && window.parent)
+      parent.location.href = url;
+    else  
+      location.href = url;
+    };
+
+  this.goto_url = function(action, query, lock)
+    {
+    if (lock)
+    this.set_busy(true);
+
+    var querystring = query ? '&'+query : '';
+    this.redirect(this.env.comm_path+'&_action='+action+querystring);
+    };
+
 
   this.http_sockets = new Array();
   
@@ -3511,7 +3230,7 @@ function rcube_webmail()
   this.http_request = function(action, querystring, lock)
     {
     var request_obj = this.get_request_obj();
-    querystring += '&_remote=1';
+    querystring += (querystring ? '&' : '') + '_remote=1';
     
     // add timestamp to request url to avoid cacheing problems in Safari
     if (bw.safari)
@@ -3520,20 +3239,45 @@ function rcube_webmail()
     // 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);
+      console.log('HTTP request: '+this.env.comm_path+'&_action='+action+'&'+querystring);
 
       if (lock)
         this.set_busy(true);
 
+      var rcm = this;
       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);
+      request_obj.onerror = function(o){ ref.http_error(o); };
+      request_obj.oncomplete = function(o){ ref.http_response(o); };
+      request_obj.GET(this.env.comm_path+'&_action='+action+'&'+querystring);
       }
     };
 
+    // send a http POST request to the server
+    this.http_post = function(action, postdata, lock)
+      {
+      var request_obj;
+      if (postdata && typeof(postdata) == 'object')
+        postdata._remote = 1;
+      else
+        postdata += (postdata ? '&' : '') + '_remote=1';
+
+      // send request
+      if (request_obj = this.get_request_obj())
+        {
+        console.log('HTTP POST: '+this.env.comm_path+'&_action='+action);
+
+        if (lock)
+          this.set_busy(true);
+
+        var rcm = this;
+        request_obj.__lock = lock ? true : false;
+        request_obj.__action = action;
+        request_obj.onerror = function(o){ rcm.http_error(o); };
+        request_obj.oncomplete = function(o){ rcm.http_response(o); };
+        request_obj.POST(this.env.comm_path+'&_action='+action, postdata);
+        }
+      };
 
   // handle HTTP response
   this.http_response = function(request_obj)
@@ -3547,7 +3291,7 @@ function rcube_webmail()
 
     this.set_busy(false);
 
-  console(request_obj.get_text());
+    console.log(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'))
@@ -3560,15 +3304,17 @@ function rcube_webmail()
       case 'moveto':
         if (this.env.action=='show')
           this.command('list');
+        else if (this.message_list)
+          this.message_list.init();
         break;
 
       case 'list':
         if (this.env.messagecount)
-          this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox));
+          this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox));
 
       case 'expunge':
         this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false);
-        break;      
+        break;
       }
 
     request_obj.reset();
@@ -3619,91 +3365,16 @@ function rcube_webmail()
   // 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);
+    return this.env.uid ? this.env.uid : (this.message_list ? this.message_list.get_single_selection() : 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);
+    return this.env.cid ? this.env.cid : (this.contact_list ? this.contact_list.get_single_selection() : 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')
@@ -3768,7 +3439,10 @@ function rcube_webmail()
 
 
 
-// class for HTTP requests
+/**
+ * Class for sending HTTP requests
+ * @constructor
+ */
 function rcube_http_request()
   {
   this.url = '';
@@ -3799,14 +3473,17 @@ function rcube_http_request()
     if (window.XMLHttpRequest)
       this.xmlhttp = new XMLHttpRequest();
     else if (window.ActiveXObject)
-      this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+      {
+      try { this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
+      catch(e) { this.xmlhttp = null; }
+      }
     else
       {
       
       }
     }
 
-  // sedn GET request
+  // send GET request
   this.GET = function(url)
     {
     this.build();
@@ -3827,9 +3504,36 @@ function rcube_http_request()
     };
 
 
-  this.POST = function(url, a_param)
+  this.POST = function(url, body, contentType)
+    {
+    // default value for contentType if not provided
+    if (typeof(contentType) == 'undefined')
+      contentType = 'application/x-www-form-urlencoded';
+
+    this.build();
+    
+    if (!this.xmlhttp)
+    {
+       this.onerror(this);
+       return false;
+    }
+    
+    var req_body = body;
+    if (typeof(body) == 'object')
     {
-    // not implemented yet
+      req_body = '';
+      for (var p in body)
+        req_body += (req_body ? '&' : '') + p+'='+urlencode(body[p]);
+    }
+
+    var ref = this;
+    this.url = url;
+    this.busy = true;
+    
+    this.xmlhttp.onreadystatechange = function() { ref.xmlhttp_onreadystatechange(); };
+    this.xmlhttp.open('POST', url, true);
+    this.xmlhttp.setRequestHeader('Content-Type', contentType);
+    this.xmlhttp.send(req_body);
     };
 
 
@@ -3886,17 +3590,10 @@ function rcube_http_request()
   }  // end class rcube_http_request
 
 
-
-function console(str)
+// helper function to call the init method with a delay
+function call_init(o)
   {
-  if (document.debugform && document.debugform.console)
-    document.debugform.console.value += str+'\n--------------------------------------\n';
+  if (window[o] && window[o].init)
+    setTimeout(o+'.init()', 200);
   }
 
-
-// set onload handler
-window.onload = function(e)
-  {
-  if (window.rcube_webmail_client)
-    rcube_webmail_client.init();
-  };
index 20586356854282ec8961f9ac1983ad3e44416a84..1e89be2dce5430e08ea449908e878fcdc397e815 100644 (file)
@@ -3,18 +3,26 @@
  | RoundCube common js library                                           |
  |                                                                       |
  | This file is part of the RoundCube web development suite              |
- | Copyright (C) 2005, RoundCube Dev, - Switzerland                      |
+ | Copyright (C) 2005-2006, RoundCube Dev, - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
  
- $Id: common.js 289 2006-08-02 03:42:08Z cmcnulty $
+ $Id: common.js 543 2007-04-28 18:07:12Z thomasb $
 */
 
+// Constants
+var CONTROL_KEY = 1;
+var SHIFT_KEY = 2;
+var CONTROL_SHIFT_KEY = 3;
 
-// default browsercheck
+
+/**
+ * Default browser check class
+ * @construcotr
+ */
 function roundcube_browser()
   {
   this.ver = parseFloat(navigator.appVersion);
@@ -92,10 +100,127 @@ function roundcube_browser()
   }
 
 
+// static functions for event handling
+var rcube_event = {
+
+ /**
+  * returns the event key code
+  */
+ get_keycode: function(e)
+ {
+   e = e || window.event;
+   return e && e.keyCode ? e.keyCode : (e && e.which ? e.which : 0);
+ },
+
+/**
+ * returns modifier key (constants defined at top of file)
+ */
+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;
+    }
+},
+
+/**
+ * Return absolute mouse position of an event
+ */
+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 };
+},
+
+/**
+ * Add an object method as event listener to a certain element
+ */
+add_listener: function(p)
+{
+  if (!p.object || !p.method)  // not enough arguments
+    return;
+  if (!p.element)
+    p.element = document;
+
+  if (!p.object._rc_events)
+    p.object._rc_events = [];
+  
+  var key = p.event + '*' + p.method;
+  if (!p.object._rc_events[key])
+    p.object._rc_events[key] = function(e){ return p.object[p.method](e); };
+
+  if (p.element.addEventListener)
+    p.element.addEventListener(p.event, p.object._rc_events[key], false);
+  else if (p.element.attachEvent)
+    p.element.attachEvent('on'+p.event, p.object._rc_events[key]);
+  else
+    p.element['on'+p.event] = p.object._rc_events[key];
+},
+
+/**
+ * Remove event listener
+ */
+remove_listener: function(p)
+{
+  if (!p.element)
+    p.element = document;
+
+  var key = p.event + '*' + p.method;
+  if (p.object && p.object._rc_events && p.object._rc_events[key]) {
+    if (p.element.removeEventListener)
+      p.element.removeEventListener(p.event, p.object._rc_events[key], false);
+    else if (p.element.detachEvent)
+      p.element.detachEvent('on'+p.event, p.object._rc_events[key]);
+    else
+      p.element['on'+p.event] = null;
+  }
+},
+
+/**
+ * Prevent event propagation and bubbeling
+ */
+cancel: function(evt)
+{
+  var e = evt ? evt : window.event;
+  if (e.preventDefault)
+    e.preventDefault();
+  if (e.stopPropagation)
+    e.stopPropagation();
+
+  e.cancelBubble = true;
+  e.returnValue = false;
+  return false;
+}
+
+};
 
 
 var rcube_layer_objects = new Array();
 
+
+/**
+ * RoundCube generic layer (floating box) class
+ *
+ * @constructor
+ */
 function rcube_layer(id, attributes)
   {
   this.name = id;
@@ -263,6 +388,7 @@ function rcube_layer(id, attributes)
     }
   }
 
+
 // check if input is a valid email address
 // By Cal Henderson <cal@iamcal.com>
 // http://code.iamcal.com/php/rfc822/
@@ -343,6 +469,13 @@ function find_in_array()
   }
 
 
+// make a string URL safe
+function urlencode(str)
+{
+  return window.encodeURIComponent ? encodeURIComponent(str) : escape(str);
+}
+
+
 // get any type of html objects by id/name
 function rcube_find_object(id, d)
   {
@@ -372,7 +505,7 @@ function rcube_find_object(id, d)
     {
     if(d.layers[id]) obj = d.layers[id];
     for(n=0; !obj && n<d.layers.length; n++)
-      obj = nex_get_object(id, d.layers[n].document);
+      obj = rcube_find_object(id, d.layers[n].document);
     }
 
   return obj;
@@ -383,7 +516,7 @@ function rcube_find_object(id, d)
 function rcube_get_object_pos(obj)
   {
   if(typeof(obj)=='string')
-    obj = nex_get_object(obj);
+    obj = rcube_find_object(obj);
 
   if(!obj) return {x:0, y:0};
 
@@ -401,11 +534,38 @@ function rcube_get_object_pos(obj)
       }
     }
 
-  if(bw.mac && bw.ie5) iX += document.body.leftMargin;
-  if(bw.mac && bw.ie5) iY += document.body.topMargin;
+  //if(bw.mac && bw.ie5) iX += document.body.leftMargin;
+  //if(bw.mac && bw.ie5) iY += document.body.topMargin;
 
   return {x:iX, y:iY};
   }
+
+
+/**
+ * Return the currently applied value of a css property
+ *
+ * @param {Object} html_element  Node reference
+ * @param {String} css_property  Property name to read in Javascript notation (eg. 'textAlign')
+ * @param {String} mozilla_equivalent  Equivalent property name in CSS notation (eg. 'text-align')
+ * @return CSS property value
+ * @type String
+ */
+function get_elements_computed_style(html_element, css_property, mozilla_equivalent)
+  {
+  if (arguments.length==2)
+    mozilla_equivalent = css_property;
+
+  var el = html_element;
+  if (typeof(html_element)=='string')
+    el = rcube_find_object(html_element);
+
+  if (el && el.currentStyle)
+    return el.currentStyle[css_property];
+  else if (el && document.defaultView && document.defaultView.getComputedStyle)
+    return document.defaultView.getComputedStyle(el, null).getPropertyValue(mozilla_equivalent);
+  else
+    return false;
+  }
   
 
 // cookie functions by GoogieSpell
@@ -419,6 +579,8 @@ function setCookie(name, value, expires, path, domain, secure)
   document.cookie = curCookie;
   }
 
+roundcube_browser.prototype.set_cookie = setCookie;
+
 function getCookie(name)
   {
   var dc = document.cookie;
@@ -437,5 +599,28 @@ function getCookie(name)
   return unescape(dc.substring(begin + prefix.length, end));
   }
 
+roundcube_browser.prototype.get_cookie = getCookie;
+
+
+// tiny replacement for Firebox functionality
+function rcube_console()
+{
+  this.box = rcube_find_object('console');
+  
+  this.log = function(msg)
+  {
+    if (this.box)
+      this.box.value += str+'\n--------------------------------------\n';
+  };
+  
+  this.reset = function()
+  {
+    if (this.box)
+      this.box.value = '';
+  };
+}
 
 var bw = new roundcube_browser();
+
+if (!window.console)
+  console = new rcube_console();
index f318e192c8062061bb510d487849d718995575de..aa729318b0986d9d540d54530a3a38b46b8eb2df 100755 (executable)
@@ -301,7 +301,7 @@ var AJS = {
     var onreadystatechange = function () {
       if (req.readyState == 4) {
         try {
-          status = req.status;
+          var status = req.status;
         }
         catch(e) {};
         if(status == 200 || status == 304 || req.responseText == null) {
diff --git a/program/js/list.js b/program/js/list.js
new file mode 100644 (file)
index 0000000..23a9c34
--- /dev/null
@@ -0,0 +1,711 @@
+/*
+ +-----------------------------------------------------------------------+
+ | RoundCube List Widget                                                 |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2006, RoundCube Dev, - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Authors: Thomas Bruederli <roundcube@gmail.com>                       |
+ |          Charles McNulty <charles@charlesmcnulty.com>                 |
+ +-----------------------------------------------------------------------+
+ | Requires: common.js                                                   |
+ +-----------------------------------------------------------------------+
+
+  $Id: list.js 344 2006-09-18 03:49:28Z thomasb $
+*/
+
+
+/**
+ * RoundCube List Widget class
+ * @contructor
+ */
+function rcube_list_widget(list, p)
+  {
+  // static contants
+  this.ENTER_KEY = 13;
+  this.DELETE_KEY = 46;
+  
+  this.list = list ? list : null;
+  this.frame = null;
+  this.rows = [];
+  this.selection = [];
+  
+  this.shiftkey = false;
+
+  this.multiselect = false;
+  this.draggable = false;
+  this.keyboard = false;
+  
+  this.dont_select = false;
+  this.drag_active = false;
+  this.last_selected = 0;
+  this.in_selection_before = false;
+  this.focused = false;
+  this.drag_mouse_start = null;
+  this.dblclick_time = 600;
+  this.row_init = function(){};
+  this.events = { click:[], dblclick:[], select:[], keypress:[], dragstart:[], dragend:[] };
+  
+  // overwrite default paramaters
+  if (p && typeof(p)=='object')
+    for (var n in p)
+      this[n] = p[n];
+  }
+
+
+rcube_list_widget.prototype = {
+
+
+/**
+ * get all message rows from HTML table and init each row
+ */
+init: function()
+{
+  if (this.list && this.list.tBodies[0])
+  {
+    this.rows = new Array();
+
+    var row;
+    for(var r=0; r<this.list.tBodies[0].childNodes.length; r++)
+    {
+      row = this.list.tBodies[0].childNodes[r];
+      while (row && (row.nodeType != 1 || row.style.display == 'none'))
+      {
+        row = row.nextSibling;
+        r++;
+      }
+
+      this.init_row(row);
+    }
+
+    this.frame = this.list.parentNode;
+
+    // set body events
+    if (this.keyboard)
+      rcube_event.add_listener({element:document, event:'keydown', object:this, method:'key_press'});
+  }
+},
+
+
+/**
+ *
+ */
+init_row: function(row)
+{
+  // make references in internal array and set event handlers
+  if (row && String(row.id).match(/rcmrow([a-z0-9\-_=]+)/i))
+  {
+    var p = this;
+    var uid = RegExp.$1;
+    row.uid = uid;
+    this.rows[uid] = {uid:uid, id:row.id, obj:row, classname:row.className};
+
+    // set eventhandlers to table row
+    row.onmousedown = function(e){ return p.drag_row(e, this.uid); };
+    row.onmouseup = function(e){ return p.click_row(e, this.uid); };
+
+    if (document.all)
+      row.onselectstart = function() { return false; };
+
+    this.row_init(this.rows[uid]);
+  }
+},
+
+
+/**
+ *
+ */
+clear: function(sel)
+{
+  var tbody = document.createElement('TBODY');
+  this.list.insertBefore(tbody, this.list.tBodies[0]);
+  this.list.removeChild(this.list.tBodies[1]);
+  this.rows = new Array();
+  
+  if (sel) this.clear_selection();
+},
+
+
+/**
+ * 'remove' message row from list (just hide it)
+ */
+remove_row: function(uid)
+{
+  if (this.rows[uid].obj)
+    this.rows[uid].obj.style.display = 'none';
+
+  this.rows[uid] = null;
+},
+
+
+/**
+ *
+ */
+insert_row: function(row, attop)
+{
+  var tbody = this.list.tBodies[0];
+
+  if (attop && tbody.rows.length)
+    tbody.insertBefore(row, tbody.firstChild);
+  else
+    tbody.appendChild(row);
+
+  this.init_row(row);
+},
+
+
+
+/**
+ * Set focur to the list
+ */
+focus: function(e)
+{
+  this.focused = true;
+  for (var n=0; n<this.selection.length; n++)
+  {
+    id = this.selection[n];
+    if (this.rows[id].obj)
+    {
+      this.set_classname(this.rows[id].obj, 'selected', true);
+      this.set_classname(this.rows[id].obj, 'unfocused', false);
+    }
+  }
+
+  if (e || (e = window.event))
+    rcube_event.cancel(e);
+},
+
+
+/**
+ * remove focus from the list
+ */
+blur: function()
+{
+  var id;
+  this.focused = false;
+  for (var n=0; n<this.selection.length; n++)
+  {
+    id = this.selection[n];
+    if (this.rows[id] && this.rows[id].obj)
+    {
+      this.set_classname(this.rows[id].obj, 'selected', false);
+      this.set_classname(this.rows[id].obj, 'unfocused', true);
+    }
+  }
+},
+
+
+/**
+ * onmousedown-handler of message list row
+ */
+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)
+  {
+    var mod_key = rcube_event.get_modifier(e);
+    this.select_row(id, mod_key, false);
+  }
+
+  if (this.draggable && this.selection.length)
+  {
+    this.drag_start = true;
+       this.drag_mouse_start = rcube_event.get_mouse_pos(e);
+    rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
+    rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
+  }
+
+  return false;
+},
+
+
+/**
+ * onmouseup-handler of message list row
+ */
+click_row: function(e, id)
+{
+  var now = new Date().getTime();
+  var mod_key = rcube_event.get_modifier(e);
+
+  // don't do anything (another action processed before)
+  if (this.dont_select)
+    {
+    this.dont_select = false;
+    return false;
+    }
+    
+  var dblclicked = now - this.rows[id].clicked < this.dblclick_time;
+
+  // unselects currently selected row
+  if (!this.drag_active && this.in_selection_before == id && !dblclicked)
+    this.select_row(id, mod_key, false);
+
+  this.drag_start = false;
+  this.in_selection_before = false;
+
+  // row was double clicked
+  if (this.rows && dblclicked && this.in_selection(id))
+    this.trigger_event('dblclick');
+  else
+    this.trigger_event('click');
+
+  if (!this.drag_active)
+    rcube_event.cancel(e);
+
+  this.rows[id].clicked = now;
+  return false;
+},
+
+
+/**
+ * get next and previous rows that are not hidden
+ */
+get_next_row: function()
+{
+  if (!this.rows)
+    return false;
+
+  var last_selected_row = this.rows[this.last_selected];
+  var new_row = last_selected_row ? last_selected_row.obj.nextSibling : null;
+  while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
+    new_row = new_row.nextSibling;
+
+  return new_row;
+},
+
+get_prev_row: function()
+{
+  if (!this.rows)
+    return false;
+
+  var last_selected_row = this.rows[this.last_selected];
+  var new_row = last_selected_row ? last_selected_row.obj.previousSibling : null;
+  while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
+    new_row = new_row.previousSibling;
+
+  return new_row;
+},
+
+
+// selects or unselects the proper row depending on the modifier key pressed
+select_row: function(id, mod_key, with_mouse)
+{
+  var select_before = this.selection.join(',');
+  if (!this.multiselect)
+    mod_key = 0;
+
+  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;
+    }
+  }
+
+  // trigger event if selection changed
+  if (this.selection.join(',') != select_before)
+    this.trigger_event('select');
+
+  if (this.last_selected != 0 && this.rows[this.last_selected])
+    this.set_classname(this.rows[this.last_selected].obj, 'focused', false);
+
+  this.last_selected = id;
+  this.set_classname(this.rows[id].obj, 'focused', true);        
+},
+
+
+/**
+ * Alias method for select_row
+ */
+select: function(id)
+{
+  this.select_row(id, false);
+  this.scrollto(id);
+},
+
+
+/**
+ * Select row next to the last selected one.
+ * Either below or above.
+ */
+select_next: function()
+{
+  var next_row = this.get_next_row();
+  var prev_row = this.get_prev_row();
+  var new_row = (next_row) ? next_row : prev_row;
+  if (new_row)
+    this.select_row(new_row.uid, false, false);  
+},
+
+
+/**
+ * Perform selection when shift key is pressed
+ */
+shift_select: function(id, control)
+{
+  var from_rowIndex = this.rows[this.shift_start].obj.rowIndex;
+  var to_rowIndex = this.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.rows)
+  {
+    if ((this.rows[n].obj.rowIndex >= i) && (this.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);
+    }
+  }
+},
+
+
+/**
+ * Check if given id is part of the current selection
+ */
+in_selection: function(id)
+{
+  for(var n in this.selection)
+    if (this.selection[n]==id)
+      return true;
+
+  return false;    
+},
+
+
+/**
+ * Select each row in list
+ */
+select_all: function(filter)
+{
+  if (!this.rows || !this.rows.length)
+    return false;
+
+  // reset selection first
+  this.clear_selection();
+
+  for (var n in this.rows)
+  {
+    if (!filter || this.rows[n][filter]==true)
+    {
+      this.last_selected = n;
+      this.highlight_row(n, true);
+    }
+  }
+
+  return true;  
+},
+
+
+/**
+ * Unselect all selected rows
+ */
+clear_selection: function()
+{
+  for(var n=0; n<this.selection.length; n++)
+    if (this.rows[this.selection[n]])
+    {
+      this.set_classname(this.rows[this.selection[n]].obj, 'selected', false);
+      this.set_classname(this.rows[this.selection[n]].obj, 'unfocused', false);
+    }
+
+  this.selection = new Array();    
+},
+
+
+/**
+ * Getter for the selection array
+ */
+get_selection: function()
+{
+  return this.selection;
+},
+
+
+/**
+ * Return the ID if only one row is selected
+ */
+get_single_selection: function()
+{
+  if (this.selection.length == 1)
+    return this.selection[0];
+  else
+    return null;
+},
+
+
+/**
+ * Highlight/unhighlight a row
+ */
+highlight_row: function(id, multiple)
+{
+  if (this.rows[id] && !multiple)
+  {
+    this.clear_selection();
+    this.selection[0] = id;
+    this.set_classname(this.rows[id].obj, 'selected', true)
+  }
+  else if (this.rows[id])
+  {
+    if (!this.in_selection(id))  // select row
+    {
+      this.selection[this.selection.length] = id;
+      this.set_classname(this.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.rows[id].obj, 'selected', false);
+      this.set_classname(this.rows[id].obj, 'unfocused', false);
+    }
+  }
+},
+
+
+/**
+ * Handler for keyboard events
+ */
+key_press: function(e)
+{
+  if (this.focused != true) 
+    return true;
+
+  this.shiftkey = e.shiftKey;
+
+  var keyCode = document.layers ? e.which : document.all ? event.keyCode : document.getElementById ? e.keyCode : 0;
+  var mod_key = rcube_event.get_modifier(e);
+  switch (keyCode)
+  {
+    case 40:
+    case 38: 
+      return this.use_arrow_key(keyCode, mod_key);
+      break;
+
+    default:
+      this.key_pressed = keyCode;
+      this.trigger_event('keypress');
+  }
+  
+  return true;
+},
+
+
+/**
+ * Special handling method for arrow keys
+ */
+use_arrow_key: function(keyCode, mod_key)
+{
+  var new_row;
+  if (keyCode == 40) // down arrow key pressed
+    new_row = this.get_next_row();
+  else if (keyCode == 38) // up arrow key pressed
+    new_row = this.get_prev_row();
+
+  if (new_row)
+  {
+    this.select_row(new_row.uid, mod_key, true);
+    this.scrollto(new_row.uid);
+  }
+
+  return false;
+},
+
+
+/**
+ * Try to scroll the list to make the specified row visible
+ */
+scrollto: function(id)
+{
+  var row = this.rows[id].obj;
+  if (row && this.frame)
+  {
+    var scroll_to = Number(row.offsetTop);
+
+    if (scroll_to < Number(this.frame.scrollTop))
+      this.frame.scrollTop = scroll_to;
+    else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight))
+      this.frame.scrollTop = (scroll_to + Number(row.offsetHeight)) - Number(this.frame.offsetHeight);
+  }
+},
+
+
+/**
+ * Handler for mouse move events
+ */
+drag_mouse_move: function(e)
+{
+  if (this.drag_start)
+  {
+    // check mouse movement, of less than 3 pixels, don't start dragging
+    var m = rcube_event.get_mouse_pos(e);
+    if (!this.drag_mouse_start || (Math.abs(m.x - this.drag_mouse_start.x) < 3 && Math.abs(m.y - this.drag_mouse_start.y) < 3))
+      return false;
+  
+    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, node, subject, obj;
+    for(var n=0; n<this.selection.length; n++)
+    {
+      if (n>12)  // only show 12 lines
+      {
+        names += '...';
+        break;
+      }
+
+      if (this.rows[this.selection[n]].obj)
+      {
+        obj = this.rows[this.selection[n]].obj;
+        subject = '';
+
+        for(c=0; c<obj.childNodes.length; c++)
+          if (obj.childNodes[c].nodeName=='TD' && (node = obj.childNodes[c].firstChild) && (node.nodeType==3 || node.nodeName=='A'))
+          {
+            subject = node.nodeType==3 ? node.data : node.innerHTML;
+            names += (subject.length > 50 ? subject.substring(0, 50)+'...' : subject) + '<br />';
+            break;
+          }
+      }
+    }
+
+    this.draglayer.write(names);
+    this.draglayer.show(1);
+
+    this.drag_active = true;
+    this.trigger_event('dragstart');
+  }
+
+  if (this.drag_active && this.draglayer)
+  {
+    var pos = rcube_event.get_mouse_pos(e);
+    this.draglayer.move(pos.x+20, pos.y-5);
+  }
+
+  this.drag_start = false;
+
+  return false;
+},
+
+
+/**
+ * Handler for mouse up events
+ */
+drag_mouse_up: function(e)
+{
+  document.onmousemove = null;
+
+  if (this.draglayer && this.draglayer.visible)
+    this.draglayer.show(0);
+
+  this.drag_active = false;
+  this.trigger_event('dragend');
+
+  rcube_event.remove_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
+  rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
+
+  return rcube_event.cancel(e);
+},
+
+
+
+/**
+ * set/unset a specific class name
+ */
+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;
+},
+
+
+/**
+ * Setter for object event handlers
+ *
+ * @param {String}   Event name
+ * @param {Function} Handler function
+ * @return Listener ID (used to remove this handler later on)
+ */
+addEventListener: function(evt, handler)
+{
+  if (this.events[evt]) {
+    var handle = this.events[evt].length;
+    this.events[evt][handle] = handler;
+    return handle;
+  }
+  else
+    return false;
+},
+
+
+/**
+ * Removes a specific event listener
+ *
+ * @param {String} Event name
+ * @param {Int}    Listener ID to remove
+ */
+removeEventListener: function(evt, handle)
+{
+  if (this.events[evt] && this.events[evt][handle])
+    this.events[evt][handle] = null;
+},
+
+
+/**
+ * This will execute all registered event handlers
+ * @private
+ */
+trigger_event: function(evt)
+{
+  if (this.events[evt] && this.events[evt].length) {
+    for (var i=0; i<this.events[evt].length; i++)
+      if (typeof(this.events[evt][i]) == 'function')
+        this.events[evt][i](this);
+  }
+}
+
+
+};
+
index 74e481d33ea1911b73e8861a56c099c9fc4f0f15..724fa6d62333d1635f670f04b47b4d2c25480313 100644 (file)
 <?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-// +-----------------------------------------------------------------------+
-// | Copyright (c) 2002-2003  Richard Heyes                                |
-// | Copyright (c) 2003-2005  The PHP Group                                |
-// | All rights reserved.                                                  |
-// |                                                                       |
-// | 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: Richard Heyes <richard@phpguru.org>                           |
-// |         Tomas V.V.Cox <cox@idecnet.com> (port to PEAR)                |
-// +-----------------------------------------------------------------------+
-//
-// $Id: mime.php 260 2006-06-09 16:47:21Z afladmark $
+/**
+ * The Mail_Mime class is used to create MIME E-mail messages
+ *
+ * The Mail_Mime class provides an OO interface to create MIME
+ * enabled email messages. This way you can create emails that
+ * contain plain-text bodies, HTML bodies, attachments, inline
+ * images and specific headers.
+ *
+ * Compatible with PHP versions 4 and 5
+ *
+ * LICENSE: This LICENSE is in the BSD license style.
+ * Copyright (c) 2002-2003, Richard Heyes <richard@phpguru.org>
+ * Copyright (c) 2003-2006, PEAR <pear-group@php.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - 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.
+ * - Neither the name of the authors, nor the names of its contributors 
+ *   may 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.
+ *
+ * @category   Mail
+ * @package    Mail_Mime
+ * @author     Richard Heyes  <richard@phpguru.org>
+ * @author     Tomas V.V. Cox <cox@idecnet.com>
+ * @author     Cipriano Groenendal <cipri@php.net>
+ * @author     Sean Coates <sean@php.net>
+ * @copyright  2003-2006 PEAR <pear-group@php.net>
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version    CVS: $Id: mime.php 514 2007-03-21 09:54:10Z thomasb $
+ * @link       http://pear.php.net/package/Mail_mime
+ * @notes      This class is based on HTML Mime Mail class from
+ *             Richard Heyes <richard@phpguru.org> which was based also
+ *             in the mime_mail.class by Tobias Ratschiller <tobias@dnet.it>
+ *             and Sascha Schumann <sascha@schumann.cx>
+ */
 
+
+/**
+ * require PEAR
+ *
+ * This package depends on PEAR to raise errors.
+ */
 require_once('PEAR.php');
-require_once('Mail/mimePart.php');
 
 /**
- * Mime mail composer class. Can handle: text and html bodies, embedded html
- * images and attachments.
- * Documentation and examples of this class are avaible here:
- * http://pear.php.net/manual/
+ * require Mail_mimePart
  *
- * @notes This class is based on HTML Mime Mail class from
- *   Richard Heyes <richard@phpguru.org> which was based also
- *   in the mime_mail.class by Tobias Ratschiller <tobias@dnet.it> and
- *   Sascha Schumann <sascha@schumann.cx>
+ * Mail_mimePart contains the code required to
+ * create all the different parts a mail can
+ * consist of.
+ */
+require_once('Mail/mimePart.php');
+
+
+/**
+ * The Mail_Mime class provides an OO interface to create MIME
+ * enabled email messages. This way you can create emails that
+ * contain plain-text bodies, HTML bodies, attachments, inline
+ * images and specific headers.
  *
- * @author   Richard Heyes <richard.heyes@heyes-computing.net>
- * @author   Tomas V.V.Cox <cox@idecnet.com>
- * @package  Mail
- * @access   public
+ * @category   Mail
+ * @package    Mail_Mime
+ * @author     Richard Heyes  <richard@phpguru.org>
+ * @author     Tomas V.V. Cox <cox@idecnet.com>
+ * @author     Cipriano Groenendal <cipri@php.net>
+ * @author     Sean Coates <sean@php.net>
+ * @copyright  2003-2006 PEAR <pear-group@php.net>
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/Mail_mime
  */
 class Mail_mime
 {
     /**
      * Contains the plain text part of the email
+     *
      * @var string
+     * @access private
      */
     var $_txtbody;
+
     /**
      * Contains the html part of the email
+     *
      * @var string
+     * @access private
      */
     var $_htmlbody;
+
     /**
      * contains the mime encoded text
+     *
      * @var string
+     * @access private
      */
     var $_mime;
+
     /**
      * contains the multipart content
+     *
      * @var string
+     * @access private
      */
     var $_multipart;
+
     /**
      * list of the attached images
+     *
      * @var array
+     * @access private
      */
     var $_html_images = array();
+
     /**
      * list of the attachements
+     *
      * @var array
+     * @access private
      */
     var $_parts = array();
+
     /**
      * Build parameters
+     *
      * @var array
+     * @access private
      */
     var $_build_params = array();
+
     /**
      * Headers for the mail
+     *
      * @var array
+     * @access private
      */
     var $_headers = array();
+
     /**
      * End Of Line sequence (for serialize)
+     *
      * @var string
+     * @access private
      */
     var $_eol;
 
 
     /**
-     * Constructor function
+     * Constructor function.
+     *
+     * @param string $crlf  what type of linebreak to use.
+     *                       Defaults to "\r\n"
+     * @return void
      *
      * @access public
      */
@@ -125,7 +189,7 @@ class Mail_mime
     }
 
     /**
-     * Wakeup (unserialize) - re-sets EOL constant
+     * wakeup function called by unserialize. It re-sets the EOL constant
      *
      * @access private
      */
@@ -134,6 +198,7 @@ class Mail_mime
         $this->_setEOL($this->_eol);
     }
 
+
     /**
      * Accessor function to set the body text. Body text is used if
      * it's not an html mail being sent or else is used to fill the
@@ -141,12 +206,12 @@ class Mail_mime
      * html should show.
      *
      * @param  string  $data   Either a string or
-     *                         the file name with the contents
+     *                          the file name with the contents
      * @param  bool    $isfile If true the first param should be treated
-     *                         as a file name, else as a string (default)
+     *                          as a file name, else as a string (default)
      * @param  bool    $append If true the text or file is appended to
-     *                         the existing body, else the old body is
-     *                         overwritten
+     *                          the existing body, else the old body is
+     *                          overwritten
      * @return mixed   true on success or PEAR_Error object
      * @access public
      */
@@ -173,13 +238,13 @@ class Mail_mime
     }
 
     /**
-     * Adds a html part to the mail
+     * Adds a html part to the mail.
      *
-     * @param  string  $data   Either a string or the file name with the
-     *                         contents
-     * @param  bool    $isfile If true the first param should be treated
-     *                         as a file name, else as a string (default)
-     * @return mixed   true on success or PEAR_Error object
+     * @param  string  $data   either a string or the file name with the
+     *                          contents
+     * @param  bool    $isfile a flag that determines whether $data is a
+     *                          filename, or a string(false, default)
+     * @return bool    true on success
      * @access public
      */
     function setHTMLBody($data, $isfile = false)
@@ -200,21 +265,21 @@ class Mail_mime
     /**
      * Adds an image to the list of embedded images.
      *
-     * @param  string  $file       The image file name OR image data itself
-     * @param  string  $c_type     The content type
-     * @param  string  $name       The filename of the image.
-     *                             Only use if $file is the image data
-     * @param  bool    $isfilename Whether $file is a filename or not
-     *                             Defaults to true
-     * @return mixed   true on success or PEAR_Error object
+     * @param  string  $file       the image file name OR image data itself
+     * @param  string  $c_type     the content type
+     * @param  string  $name       the filename of the image.
+     *                              Only use if $file is the image data.
+     * @param  bool    $isfile     whether $file is a filename or not.
+     *                              Defaults to true
+     * @return bool                true on success
      * @access public
      */
     function addHTMLImage($file, $c_type='application/octet-stream',
-                          $name = '', $isfilename = true)
+                          $name = '', $isfile = true)
     {
-        $filedata = ($isfilename === true) ? $this->_file2str($file)
+        $filedata = ($isfile === true) ? $this->_file2str($file)
                                            : $file;
-        if ($isfilename === true) {
+        if ($isfile === true) {
             $filename = ($name == '' ? $file : $name);
         } else {
             $filename = $name;
@@ -239,7 +304,7 @@ class Mail_mime
      * @param  string  $c_type      The content type
      * @param  string  $name        The filename of the attachment
      *                              Only use if $file is the contents
-     * @param  bool    $isFilename  Whether $file is a filename or not
+     * @param  bool    $isfile      Whether $file is a filename or not
      *                              Defaults to true
      * @param  string  $encoding    The type of encoding to use.
      *                              Defaults to base64.
@@ -254,13 +319,13 @@ class Mail_mime
      * @access public
      */
     function addAttachment($file, $c_type = 'application/octet-stream',
-                           $name = '', $isfilename = true,
+                           $name = '', $isfile = true,
                            $encoding = 'base64',
                            $disposition = 'attachment', $charset = '')
     {
-        $filedata = ($isfilename === true) ? $this->_file2str($file)
+        $filedata = ($isfile === true) ? $this->_file2str($file)
                                            : $file;
-        if ($isfilename === true) {
+        if ($isfile === true) {
             // Force the name the user supplied, otherwise use $file
             $filename = (!empty($name)) ? $name : $file;
         } else {
@@ -462,7 +527,7 @@ class Mail_mime
         $params['encoding']     = $value['encoding'];
         if ($value['disposition'] != "inline") {
             $fname = array("fname" => $value['name']);
-            $fname_enc = $this->_encodeHeaders($fname);
+            $fname_enc = $this->_encodeHeaders($fname, array('head_charset' => $value['charset'] ? $value['charset'] : 'iso-8859-1'));
             $params['dfilename'] = $fname_enc['fname'];
         }
         if ($value['charset']) {
@@ -781,111 +846,141 @@ class Mail_mime
     /**
      * Encodes a header as per RFC2047
      *
-     * @param  array $input The header data to encode
+     * @param  array $input  The header data to encode
+     * @param  array $params Extra build parameters
      * @return array Encoded data
      * @access private
      */
-    function _encodeHeaders($input)
+    function _encodeHeaders($input, $params = array())
     {
+        
+        $build_params = $this->_build_params;
+        while (list($key, $value) = each($params)) {
+            $build_params[$key] = $value;
+        }
+        
         foreach ($input as $hdr_name => $hdr_value) {
-            if (function_exists('iconv_mime_encode') && preg_match('#[\x80-\xFF]{1}#', $hdr_value)){
-                $imePref = array();
-                if ($this->_build_params['head_encoding'] == 'base64'){
-                    $imePrefs['scheme'] = 'B';
+            $hdr_vals = preg_split("|(\s)|", $hdr_value, -1, PREG_SPLIT_DELIM_CAPTURE);
+            $hdr_value_out="";
+            $previous = "";
+            foreach ($hdr_vals as $hdr_val){
+                if (!trim($hdr_val)){
+                    //whitespace needs to be handled with another string, or it
+                    //won't show between encoded strings. Prepend this to the next item.
+                    $previous .= $hdr_val;
+                    continue;
                 }else{
-                    $imePrefs['scheme'] = 'Q';
-                }
-                $imePrefs['input-charset']  = $this->_build_params['head_charset'];
-                $imePrefs['output-charset'] = $this->_build_params['head_charset'];
-                $hdr_value = iconv_mime_encode($hdr_name, $hdr_value, $imePrefs);
-                $hdr_value = preg_replace("#^{$hdr_name}\:\ #", "", $hdr_value);
-            }elseif (preg_match('#[\x80-\xFF]{1}#', $hdr_value)){
-                //This header contains non ASCII chars and should be encoded.
-                switch ($this->_build_params['head_encoding']) {
-                case 'base64':
-                    //Base64 encoding has been selected.
-                    
-                    //Generate the header using the specified params and dynamicly 
-                    //determine the maximum length of such strings.
-                    //75 is the value specified in the RFC. The -2 is there so 
-                    //the later regexp doesn't break any of the translated chars.
-                    $prefix = '=?' . $this->_build_params['head_charset'] . '?B?';
-                    $suffix = '?=';
-                    $maxLength = 75 - strlen($prefix . $suffix) - 2;
-                    $maxLength1stLine = $maxLength - strlen($hdr_name);
-                    
-                    //Base64 encode the entire string
-                    $hdr_value = base64_encode($hdr_value);
-
-                    //This regexp will break base64-encoded text at every 
-                    //$maxLength but will not break any encoded letters.
-                    $reg1st = "|.{0,$maxLength1stLine}[^\=][^\=]|";
-                    $reg2nd = "|.{0,$maxLength}[^\=][^\=]|";
-                    break;
-                case 'quoted-printable':
-                default:
-                    //quoted-printable encoding has been selected
-                    
-                    //Generate the header using the specified params and dynamicly 
-                    //determine the maximum length of such strings.
-                    //75 is the value specified in the RFC. The -2 is there so 
-                    //the later regexp doesn't break any of the translated chars.
-                    $prefix = '=?' . $this->_build_params['head_charset'] . '?Q?';
-                    $suffix = '?=';
-                    $maxLength = 75 - strlen($prefix . $suffix) - 2;
-                    $maxLength1stLine = $maxLength - strlen($hdr_name);
-                    
-                    //Replace all special characters used by the encoder.
-                    $search  = array("=",   "_",   "?",   " ");
-                    $replace = array("=3D", "=5F", "=3F", "_");
-                    $hdr_value = str_replace($search, $replace, $hdr_value);
-                    
-                    //Replace all extended characters (\x80-xFF) with their
-                    //ASCII values.
-                    $hdr_value = preg_replace(
-                        '#([\x80-\xFF])#e',
-                        '"=" . strtoupper(dechex(ord("\1")))',
-                        $hdr_value
-                    );
-                    //This regexp will break QP-encoded text at every $maxLength
-                    //but will not break any encoded letters.
-                    $reg1st = "|(.{0,$maxLength})[^\=]|";
-                    $reg2nd = "|(.{0,$maxLength})[^\=]|";
-                    break;
+                    $hdr_val = $previous . $hdr_val;
+                    $previous = "";
                 }
-                //Begin with the regexp for the first line.
-                $reg = $reg1st;
-                $output = "";
-                while ($hdr_value) {
-                    //Split translated string at every $maxLength
-                    //But make sure not to break any translated chars.
-                    $found = preg_match($reg, $hdr_value, $matches);
-                    
-                    //After this first line, we need to use a different
-                    //regexp for the first line.
-                    $reg = $reg2nd;
-
-                    //Save the found part and encapsulate it in the
-                    //prefix & suffix. Then remove the part from the
-                    //$hdr_value variable.
-                    if ($found){
-                        $part = $matches[0];
-                        $hdr_value = substr($hdr_value, strlen($matches[0]));
+                if (function_exists('iconv_mime_encode') && preg_match('#[\x80-\xFF]{1}#', $hdr_val)){
+                    $imePref = array();
+                    if ($build_params['head_encoding'] == 'base64'){
+                        $imePrefs['scheme'] = 'B';
                     }else{
-                        $part = $hdr_value;
-                        $hdr_value = "";
+                        $imePrefs['scheme'] = 'Q';
                     }
-                    
-                    //RFC 2047 specifies that any split header should be seperated
-                    //by a CRLF SPACE. 
-                    if ($output){
-                        $output .=  "\r\n ";
+                    $imePrefs['input-charset']  = $build_params['head_charset'];
+                    $imePrefs['output-charset'] = $build_params['head_charset'];
+                    $hdr_val = iconv_mime_encode($hdr_name, $hdr_val, $imePrefs);
+                    $hdr_val = preg_replace("#^{$hdr_name}\:\ #", "", $hdr_val);
+                }elseif (preg_match('#[\x80-\xFF]{1}#', $hdr_val)){
+                    //This header contains non ASCII chars and should be encoded.
+                    switch ($build_params['head_encoding']) {
+                    case 'base64':
+                        //Base64 encoding has been selected.
+                        
+                        //Generate the header using the specified params and dynamicly 
+                        //determine the maximum length of such strings.
+                        //75 is the value specified in the RFC. The first -2 is there so 
+                        //the later regexp doesn't break any of the translated chars.
+                        //The -2 on the first line-regexp is to compensate for the ": "
+                        //between the header-name and the header value
+                        $prefix = '=?' . $build_params['head_charset'] . '?B?';
+                        $suffix = '?=';
+                        $maxLength = 75 - strlen($prefix . $suffix) - 2;
+                        $maxLength1stLine = $maxLength - strlen($hdr_name) - 2;
+                        
+                        //Base64 encode the entire string
+                        $hdr_val = base64_encode($hdr_val);
+                        
+                        //This regexp will break base64-encoded text at every 
+                        //$maxLength but will not break any encoded letters.
+                        $reg1st = "|.{0,$maxLength1stLine}[^\=][^\=]|";
+                        $reg2nd = "|.{0,$maxLength}[^\=][^\=]|";
+                        break;
+                    case 'quoted-printable':
+                    default:
+                        //quoted-printable encoding has been selected
+                        
+                        //Generate the header using the specified params and dynamicly 
+                        //determine the maximum length of such strings.
+                        //75 is the value specified in the RFC. The -2 is there so 
+                        //the later regexp doesn't break any of the translated chars.
+                        //The -2 on the first line-regexp is to compensate for the ": "
+                        //between the header-name and the header value
+                        $prefix = '=?' . $build_params['head_charset'] . '?Q?';
+                        $suffix = '?=';
+                        $maxLength = 75 - strlen($prefix . $suffix) - 2;
+                        $maxLength1stLine = $maxLength - strlen($hdr_name) - 2;
+                        
+                        //Replace all special characters used by the encoder.
+                        $search  = array("=",   "_",   "?",   " ");
+                        $replace = array("=3D", "=5F", "=3F", "_");
+                        $hdr_val = str_replace($search, $replace, $hdr_val);
+                        
+                        //Replace all extended characters (\x80-xFF) with their
+                        //ASCII values.
+                        $hdr_val = preg_replace(
+                            '#([\x80-\xFF])#e',
+                            '"=" . strtoupper(dechex(ord("\1")))',
+                            $hdr_val
+                        );
+                        //This regexp will break QP-encoded text at every $maxLength
+                        //but will not break any encoded letters.
+                        $reg1st = "|(.{0,$maxLength1stLine})[^\=]|";
+                        $reg2nd = "|(.{0,$maxLength})[^\=]|";
+                        break;
                     }
-                    $output .= $prefix . $part . $suffix;
+                    //Begin with the regexp for the first line.
+                    $reg = $reg1st;
+                    //Prevent lins that are just way to short;
+                    if ($maxLength1stLine >1){
+                        $reg = $reg2nd;
+                    }
+                    $output = "";
+                    while ($hdr_val) {
+                        //Split translated string at every $maxLength
+                        //But make sure not to break any translated chars.
+                        $found = preg_match($reg, $hdr_val, $matches);
+                        
+                        //After this first line, we need to use a different
+                        //regexp for the first line.
+                        $reg = $reg2nd;
+                        
+                        //Save the found part and encapsulate it in the
+                        //prefix & suffix. Then remove the part from the
+                        //$hdr_val variable.
+                        if ($found){
+                            $part = $matches[0];
+                            $hdr_val = substr($hdr_val, strlen($matches[0]));
+                        }else{
+                            $part = $hdr_val;
+                            $hdr_val = "";
+                        }
+                        
+                        //RFC 2047 specifies that any split header should be seperated
+                        //by a CRLF SPACE. 
+                        if ($output){
+                            $output .=  "\r\n ";
+                        }
+                        $output .= $prefix . $part . $suffix;
+                    }
+                    $hdr_val = $output;
                 }
-                $hdr_value = $output;
+                $hdr_value_out .= $hdr_val;
             }
-            $input[$hdr_name] = $hdr_value;
+            $input[$hdr_name] = $hdr_value_out;
         }
 
         return $input;
@@ -908,5 +1003,3 @@ class Mail_mime
     
 
 } // End of class
-?>
-
index 283faae044eebfa02247fa7b1a68782aeeb452c4..455ec54f8bba245e691ec67e246b04fa087192c5 100644 (file)
 <?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-// +-----------------------------------------------------------------------+
-// | Copyright (c) 2002-2003  Richard Heyes                                |
-// | Copyright (c) 2003-2005  The PHP Group                                |
-// | All rights reserved.                                                  |
-// |                                                                       |
-// | 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: Richard Heyes <richard@phpguru.org>                           |
-// +-----------------------------------------------------------------------+
+/**
+ * The Mail_mimeDecode class is used to decode mail/mime messages
+ *
+ * This class will parse a raw mime email and return
+ * the structure. Returned structure is similar to
+ * that returned by imap_fetchstructure().
+ *
+ *  +----------------------------- IMPORTANT ------------------------------+
+ *  | Usage of this class compared to native php extensions such as        |
+ *  | mailparse or imap, is slow and may be feature deficient. If available|
+ *  | you are STRONGLY recommended to use the php extensions.              |
+ *  +----------------------------------------------------------------------+
+ *
+ * Compatible with PHP versions 4 and 5
+ *
+ * LICENSE: This LICENSE is in the BSD license style.
+ * Copyright (c) 2002-2003, Richard Heyes <richard@phpguru.org>
+ * Copyright (c) 2003-2006, PEAR <pear-group@php.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - 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.
+ * - Neither the name of the authors, nor the names of its contributors 
+ *   may 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.
+ *
+ * @category   Mail
+ * @package    Mail_Mime
+ * @author     Richard Heyes  <richard@phpguru.org>
+ * @author     George Schlossnagle <george@omniti.com>
+ * @author     Cipriano Groenendal <cipri@php.net>
+ * @author     Sean Coates <sean@php.net>
+ * @copyright  2003-2006 PEAR <pear-group@php.net>
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version    CVS: $Id: mimeDecode.php 514 2007-03-21 09:54:10Z thomasb $
+ * @link       http://pear.php.net/package/Mail_mime
+ */
+
 
+/**
+ * require PEAR
+ *
+ * This package depends on PEAR to raise errors.
+ */
 require_once 'PEAR.php';
 
+
 /**
-*  +----------------------------- IMPORTANT ------------------------------+
-*  | Usage of this class compared to native php extensions such as        |
-*  | mailparse or imap, is slow and may be feature deficient. If available|
-*  | you are STRONGLY recommended to use the php extensions.              |
-*  +----------------------------------------------------------------------+
-*
-* Mime Decoding class
-*
-* This class will parse a raw mime email and return
-* the structure. Returned structure is similar to
-* that returned by imap_fetchstructure().
-*
-* USAGE: (assume $input is your raw email)
-*
-* $decode = new Mail_mimeDecode($input, "\r\n");
-* $structure = $decode->decode();
-* print_r($structure);
-*
-* Or statically:
-*
-* $params['input'] = $input;
-* $structure = Mail_mimeDecode::decode($params);
-* print_r($structure);
-*
-* TODO:
-*  o UTF8: ???
-
-               > 4. We have also found a solution for decoding the UTF-8 
-               > headers. Therefore I made the following function:
-               > 
-               > function decode_utf8($txt) {
-               > $trans=array("Å&#8216;"=>"õ","ű"=>"û","Å\90"=>"Ã&#8226;","Å°"
-               =>"Ã&#8250;");
-               > $txt=strtr($txt,$trans);
-               > return(utf8_decode($txt));
-               > }
-               > 
-               > And I have inserted the following line to the class:
-               > 
-               > if (strtolower($charset)=="utf-8") $text=decode_utf8($text);
-               > 
-               > ... before the following one in the "_decodeHeader" function:
-               > 
-               > $input = str_replace($encoded, $text, $input);
-               > 
-               > This way from now on it can easily decode the UTF-8 headers too.
-
-*
-* @author  Richard Heyes <richard@phpguru.org>
-* @version $Revision: 202 $
-* @package Mail
-*/
+ * The Mail_mimeDecode class is used to decode mail/mime messages
+ *
+ * This class will parse a raw mime email and return the structure.
+ * Returned structure is similar to that returned by imap_fetchstructure().
+ *
+ *  +----------------------------- IMPORTANT ------------------------------+
+ *  | Usage of this class compared to native php extensions such as        |
+ *  | mailparse or imap, is slow and may be feature deficient. If available|
+ *  | you are STRONGLY recommended to use the php extensions.              |
+ *  +----------------------------------------------------------------------+
+ *
+ * @category   Mail
+ * @package    Mail_Mime
+ * @author     Richard Heyes  <richard@phpguru.org>
+ * @author     George Schlossnagle <george@omniti.com>
+ * @author     Cipriano Groenendal <cipri@php.net>
+ * @author     Sean Coates <sean@php.net>
+ * @copyright  2003-2006 PEAR <pear-group@php.net>
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/Mail_mime
+ */
 class Mail_mimeDecode extends PEAR
 {
     /**
      * The raw email to decode
+     *
      * @var    string
+     * @access private
      */
     var $_input;
 
     /**
      * The header part of the input
+     *
      * @var    string
+     * @access private
      */
     var $_header;
 
     /**
      * The body part of the input
+     *
      * @var    string
+     * @access private
      */
     var $_body;
 
     /**
      * If an error occurs, this is used to store the message
+     *
      * @var    string
+     * @access private
      */
     var $_error;
 
     /**
      * Flag to determine whether to include bodies in the
      * returned object.
+     *
      * @var    boolean
+     * @access private
      */
     var $_include_bodies;
 
     /**
      * Flag to determine whether to decode bodies
+     *
      * @var    boolean
+     * @access private
      */
     var $_decode_bodies;
 
     /**
      * Flag to determine whether to decode headers
+     *
      * @var    boolean
+     * @access private
      */
     var $_decode_headers;
 
@@ -834,4 +847,3 @@ class Mail_mimeDecode extends PEAR
     }
 
 } // End of class
-?>
index 1ffdb00002af4212a01bca419ff73b64e2c69f37..f98dee5f9a28748955450ed2f08f55e98ebf6a90 100644 (file)
 <?php
-// +-----------------------------------------------------------------------+
-// | Copyright (c) 2002-2003  Richard Heyes                                     |
-// | All rights reserved.                                                  |
-// |                                                                       |
-// | 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: Richard Heyes <richard@phpguru.org>                           |
-// +-----------------------------------------------------------------------+
-
 /**
-*
-*  Raw mime encoding class
-*
-* What is it?
-*   This class enables you to manipulate and build
-*   a mime email from the ground up.
-*
-* Why use this instead of mime.php?
-*   mime.php is a userfriendly api to this class for
-*   people who aren't interested in the internals of
-*   mime mail. This class however allows full control
-*   over the email.
-*
-* Eg.
-*
-* // Since multipart/mixed has no real body, (the body is
-* // the subpart), we set the body argument to blank.
-*
-* $params['content_type'] = 'multipart/mixed';
-* $email = new Mail_mimePart('', $params);
-*
-* // Here we add a text part to the multipart we have
-* // already. Assume $body contains plain text.
-*
-* $params['content_type'] = 'text/plain';
-* $params['encoding']     = '7bit';
-* $text = $email->addSubPart($body, $params);
-*
-* // Now add an attachment. Assume $attach is
-* the contents of the attachment
-*
-* $params['content_type'] = 'application/zip';
-* $params['encoding']     = 'base64';
-* $params['disposition']  = 'attachment';
-* $params['dfilename']    = 'example.zip';
-* $attach =& $email->addSubPart($body, $params);
-*
-* // Now build the email. Note that the encode
-* // function returns an associative array containing two
-* // elements, body and headers. You will need to add extra
-* // headers, (eg. Mime-Version) before sending.
-*
-* $email = $message->encode();
-* $email['headers'][] = 'Mime-Version: 1.0';
-*
-*
-* Further examples are available at http://www.phpguru.org
-*
-* TODO:
-*  - Set encode() to return the $obj->encoded if encode()
-*    has already been run. Unless a flag is passed to specifically
-*    re-build the message.
-*
-* @author  Richard Heyes <richard@phpguru.org>
-* @version $Revision: 202 $
-* @package Mail
-*/
+ * The Mail_mimePart class is used to create MIME E-mail messages
+ *
+ * This class enables you to manipulate and build a mime email
+ * from the ground up. The Mail_Mime class is a userfriendly api
+ * to this class for people who aren't interested in the internals
+ * of mime mail.
+ * This class however allows full control over the email.
+ *
+ * Compatible with PHP versions 4 and 5
+ *
+ * LICENSE: This LICENSE is in the BSD license style.
+ * Copyright (c) 2002-2003, Richard Heyes <richard@phpguru.org>
+ * Copyright (c) 2003-2006, PEAR <pear-group@php.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - 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.
+ * - Neither the name of the authors, nor the names of its contributors 
+ *   may 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.
+ *
+ * @category   Mail
+ * @package    Mail_Mime
+ * @author     Richard Heyes  <richard@phpguru.org>
+ * @author     Cipriano Groenendal <cipri@php.net>
+ * @author     Sean Coates <sean@php.net>
+ * @copyright  2003-2006 PEAR <pear-group@php.net>
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version    CVS: $Id: mimePart.php 514 2007-03-21 09:54:10Z thomasb $
+ * @link       http://pear.php.net/package/Mail_mime
+ */
+
 
+/**
+ * The Mail_mimePart class is used to create MIME E-mail messages
+ *
+ * This class enables you to manipulate and build a mime email
+ * from the ground up. The Mail_Mime class is a userfriendly api
+ * to this class for people who aren't interested in the internals
+ * of mime mail.
+ * This class however allows full control over the email.
+ *
+ * @category   Mail
+ * @package    Mail_Mime
+ * @author     Richard Heyes  <richard@phpguru.org>
+ * @author     Cipriano Groenendal <cipri@php.net>
+ * @author     Sean Coates <sean@php.net>
+ * @copyright  2003-2006 PEAR <pear-group@php.net>
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/Mail_mime
+ */
 class Mail_mimePart {
 
    /**
     * The encoding type of this part
+    *
     * @var string
+    * @access private
     */
     var $_encoding;
 
    /**
     * An array of subparts
+    *
     * @var array
+    * @access private
     */
     var $_subparts;
 
    /**
     * The output of this part after being built
+    *
     * @var string
+    * @access private
     */
     var $_encoded;
 
    /**
     * Headers for this part
+    *
     * @var array
+    * @access private
     */
     var $_headers;
 
    /**
     * The body of this part (not encoded)
+    *
     * @var string
+    * @access private
     */
     var $_body;
 
@@ -234,7 +224,7 @@ class Mail_mimePart {
 
             $encoded['body'] = '--' . $boundary . MAIL_MIMEPART_CRLF .
                                implode('--' . $boundary . MAIL_MIMEPART_CRLF, $subparts) .
-                               '--' . $boundary.'--' . MAIL_MIMEPART_CRLF;
+                               '--' . $boundary.'--' . MAIL_MIMEPART_CRLF . MAIL_MIMEPART_CRLF;
 
         } else {
             $encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding) . MAIL_MIMEPART_CRLF;
@@ -299,7 +289,7 @@ class Mail_mimePart {
     }
 
     /**
-     * quoteadPrintableEncode()
+     * quotedPrintableEncode()
      *
      * Encodes data to quoted-printable standard.
      *
@@ -318,11 +308,12 @@ class Mail_mimePart {
 
         while(list(, $line) = each($lines)){
 
-            $linlen     = strlen($line);
+            $line    = preg_split('||', $line, -1, PREG_SPLIT_NO_EMPTY);
+            $linlen     = count($line);
             $newline = '';
 
             for ($i = 0; $i < $linlen; $i++) {
-                $char = substr($line, $i, 1);
+                $char = $line[$i];
                 $dec  = ord($char);
 
                 if (($dec == 32) AND ($i == ($linlen - 1))){    // convert space at eol only
@@ -348,4 +339,3 @@ class Mail_mimePart {
         return $output;
     }
 } // End of class
-?>
index fc30dde78bb2e8e9d925aa827da9d2f4364a483e..8612cf6f05b93ab4584d8ea72a2053307fc878cb 100644 (file)
@@ -18,7 +18,7 @@
 // |          Damian Alejandro Fernandez Sosa <damlists@cnba.uba.ar>      |
 // +----------------------------------------------------------------------+
 //
-// $Id: SMTP.php 17 2005-10-03 20:25:31Z roundcube $
+// $Id: SMTP.php 399 2006-12-06 21:37:37Z thomasb $
 
 require_once 'PEAR.php';
 require_once 'Net/Socket.php';
@@ -760,7 +760,7 @@ class Net_SMTP
      * @access public
      * @since  1.0
      */
-    function data($data)
+    function data(&$data)
     {
         /* RFC 1870, section 3, subsection 3 states "a value of zero
          * indicates that no fixed maximum message size is in force".
@@ -784,7 +784,8 @@ class Net_SMTP
             return $error;
         }
 
-        if (PEAR::isError($result = $this->_send($data . "\r\n.\r\n"))) {
+        $data .= "\r\n.\r\n";
+        if (PEAR::isError($result = $this->_send($data))) {
             return $result;
         }
         if (PEAR::isError($error = $this->_parseResponse(250))) {
diff --git a/program/lib/encoding/ISO-8859-10.map b/program/lib/encoding/ISO-8859-10.map
new file mode 100644 (file)
index 0000000..374a42b
--- /dev/null
@@ -0,0 +1,303 @@
+#
+#      Name:             ISO/IEC 8859-10:1998 to Unicode
+#      Unicode version:  3.0
+#      Table version:    1.1
+#      Table format:     Format A
+#      Date:             1999 October 11
+#      Authors:          Ken Whistler <kenw@sybase.com>
+#
+#      Copyright (c) 1999 Unicode, Inc.  All Rights reserved.
+#
+#      This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+#      No claims are made as to fitness for any particular purpose.  No
+#      warranties of any kind are expressed or implied.  The recipient
+#      agrees to determine applicability of information provided.  If this
+#      file has been provided on optical media by Unicode, Inc., the sole
+#      remedy for any claim will be exchange of defective media within 90
+#      days of receipt.
+#
+#      Unicode, Inc. hereby grants the right to freely use the information
+#      supplied in this file in the creation of products supporting the
+#      Unicode Standard, and to make copies of this file in any form for
+#      internal or external distribution as long as this notice remains
+#      attached.
+#
+#      General notes:
+#
+#      This table contains the data the Unicode Consortium has on how
+#       ISO/IEC 8859-10:1998 characters map into Unicode.
+#
+#      Format:  Three tab-separated columns
+#               Column #1 is the ISO/IEC 8859-10 code (in hex as 0xXX)
+#               Column #2 is the Unicode (in hex as 0xXXXX)
+#               Column #3 the Unicode name (follows a comment sign, '#')
+#
+#      The entries are in ISO/IEC 8859-10 order.
+#
+#      Version history
+#      1.0 version new.
+#       1.1 corrected mistake in mapping of 0xA4
+#
+#      Updated versions of this file may be found in:
+#              <ftp://ftp.unicode.org/Public/MAPPINGS/>
+#
+#      Any comments or problems, contact <errata@unicode.org>
+#      Please note that <errata@unicode.org> is an archival address;
+#      notices will be checked, but do not expect an immediate response.
+#
+0x00   0x0000  #       NULL
+0x01   0x0001  #       START OF HEADING
+0x02   0x0002  #       START OF TEXT
+0x03   0x0003  #       END OF TEXT
+0x04   0x0004  #       END OF TRANSMISSION
+0x05   0x0005  #       ENQUIRY
+0x06   0x0006  #       ACKNOWLEDGE
+0x07   0x0007  #       BELL
+0x08   0x0008  #       BACKSPACE
+0x09   0x0009  #       HORIZONTAL TABULATION
+0x0A   0x000A  #       LINE FEED
+0x0B   0x000B  #       VERTICAL TABULATION
+0x0C   0x000C  #       FORM FEED
+0x0D   0x000D  #       CARRIAGE RETURN
+0x0E   0x000E  #       SHIFT OUT
+0x0F   0x000F  #       SHIFT IN
+0x10   0x0010  #       DATA LINK ESCAPE
+0x11   0x0011  #       DEVICE CONTROL ONE
+0x12   0x0012  #       DEVICE CONTROL TWO
+0x13   0x0013  #       DEVICE CONTROL THREE
+0x14   0x0014  #       DEVICE CONTROL FOUR
+0x15   0x0015  #       NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #       SYNCHRONOUS IDLE
+0x17   0x0017  #       END OF TRANSMISSION BLOCK
+0x18   0x0018  #       CANCEL
+0x19   0x0019  #       END OF MEDIUM
+0x1A   0x001A  #       SUBSTITUTE
+0x1B   0x001B  #       ESCAPE
+0x1C   0x001C  #       FILE SEPARATOR
+0x1D   0x001D  #       GROUP SEPARATOR
+0x1E   0x001E  #       RECORD SEPARATOR
+0x1F   0x001F  #       UNIT SEPARATOR
+0x20   0x0020  #       SPACE
+0x21   0x0021  #       EXCLAMATION MARK
+0x22   0x0022  #       QUOTATION MARK
+0x23   0x0023  #       NUMBER SIGN
+0x24   0x0024  #       DOLLAR SIGN
+0x25   0x0025  #       PERCENT SIGN
+0x26   0x0026  #       AMPERSAND
+0x27   0x0027  #       APOSTROPHE
+0x28   0x0028  #       LEFT PARENTHESIS
+0x29   0x0029  #       RIGHT PARENTHESIS
+0x2A   0x002A  #       ASTERISK
+0x2B   0x002B  #       PLUS SIGN
+0x2C   0x002C  #       COMMA
+0x2D   0x002D  #       HYPHEN-MINUS
+0x2E   0x002E  #       FULL STOP
+0x2F   0x002F  #       SOLIDUS
+0x30   0x0030  #       DIGIT ZERO
+0x31   0x0031  #       DIGIT ONE
+0x32   0x0032  #       DIGIT TWO
+0x33   0x0033  #       DIGIT THREE
+0x34   0x0034  #       DIGIT FOUR
+0x35   0x0035  #       DIGIT FIVE
+0x36   0x0036  #       DIGIT SIX
+0x37   0x0037  #       DIGIT SEVEN
+0x38   0x0038  #       DIGIT EIGHT
+0x39   0x0039  #       DIGIT NINE
+0x3A   0x003A  #       COLON
+0x3B   0x003B  #       SEMICOLON
+0x3C   0x003C  #       LESS-THAN SIGN
+0x3D   0x003D  #       EQUALS SIGN
+0x3E   0x003E  #       GREATER-THAN SIGN
+0x3F   0x003F  #       QUESTION MARK
+0x40   0x0040  #       COMMERCIAL AT
+0x41   0x0041  #       LATIN CAPITAL LETTER A
+0x42   0x0042  #       LATIN CAPITAL LETTER B
+0x43   0x0043  #       LATIN CAPITAL LETTER C
+0x44   0x0044  #       LATIN CAPITAL LETTER D
+0x45   0x0045  #       LATIN CAPITAL LETTER E
+0x46   0x0046  #       LATIN CAPITAL LETTER F
+0x47   0x0047  #       LATIN CAPITAL LETTER G
+0x48   0x0048  #       LATIN CAPITAL LETTER H
+0x49   0x0049  #       LATIN CAPITAL LETTER I
+0x4A   0x004A  #       LATIN CAPITAL LETTER J
+0x4B   0x004B  #       LATIN CAPITAL LETTER K
+0x4C   0x004C  #       LATIN CAPITAL LETTER L
+0x4D   0x004D  #       LATIN CAPITAL LETTER M
+0x4E   0x004E  #       LATIN CAPITAL LETTER N
+0x4F   0x004F  #       LATIN CAPITAL LETTER O
+0x50   0x0050  #       LATIN CAPITAL LETTER P
+0x51   0x0051  #       LATIN CAPITAL LETTER Q
+0x52   0x0052  #       LATIN CAPITAL LETTER R
+0x53   0x0053  #       LATIN CAPITAL LETTER S
+0x54   0x0054  #       LATIN CAPITAL LETTER T
+0x55   0x0055  #       LATIN CAPITAL LETTER U
+0x56   0x0056  #       LATIN CAPITAL LETTER V
+0x57   0x0057  #       LATIN CAPITAL LETTER W
+0x58   0x0058  #       LATIN CAPITAL LETTER X
+0x59   0x0059  #       LATIN CAPITAL LETTER Y
+0x5A   0x005A  #       LATIN CAPITAL LETTER Z
+0x5B   0x005B  #       LEFT SQUARE BRACKET
+0x5C   0x005C  #       REVERSE SOLIDUS
+0x5D   0x005D  #       RIGHT SQUARE BRACKET
+0x5E   0x005E  #       CIRCUMFLEX ACCENT
+0x5F   0x005F  #       LOW LINE
+0x60   0x0060  #       GRAVE ACCENT
+0x61   0x0061  #       LATIN SMALL LETTER A
+0x62   0x0062  #       LATIN SMALL LETTER B
+0x63   0x0063  #       LATIN SMALL LETTER C
+0x64   0x0064  #       LATIN SMALL LETTER D
+0x65   0x0065  #       LATIN SMALL LETTER E
+0x66   0x0066  #       LATIN SMALL LETTER F
+0x67   0x0067  #       LATIN SMALL LETTER G
+0x68   0x0068  #       LATIN SMALL LETTER H
+0x69   0x0069  #       LATIN SMALL LETTER I
+0x6A   0x006A  #       LATIN SMALL LETTER J
+0x6B   0x006B  #       LATIN SMALL LETTER K
+0x6C   0x006C  #       LATIN SMALL LETTER L
+0x6D   0x006D  #       LATIN SMALL LETTER M
+0x6E   0x006E  #       LATIN SMALL LETTER N
+0x6F   0x006F  #       LATIN SMALL LETTER O
+0x70   0x0070  #       LATIN SMALL LETTER P
+0x71   0x0071  #       LATIN SMALL LETTER Q
+0x72   0x0072  #       LATIN SMALL LETTER R
+0x73   0x0073  #       LATIN SMALL LETTER S
+0x74   0x0074  #       LATIN SMALL LETTER T
+0x75   0x0075  #       LATIN SMALL LETTER U
+0x76   0x0076  #       LATIN SMALL LETTER V
+0x77   0x0077  #       LATIN SMALL LETTER W
+0x78   0x0078  #       LATIN SMALL LETTER X
+0x79   0x0079  #       LATIN SMALL LETTER Y
+0x7A   0x007A  #       LATIN SMALL LETTER Z
+0x7B   0x007B  #       LEFT CURLY BRACKET
+0x7C   0x007C  #       VERTICAL LINE
+0x7D   0x007D  #       RIGHT CURLY BRACKET
+0x7E   0x007E  #       TILDE
+0x7F   0x007F  #       DELETE
+0x80   0x0080  #       <control>
+0x81   0x0081  #       <control>
+0x82   0x0082  #       <control>
+0x83   0x0083  #       <control>
+0x84   0x0084  #       <control>
+0x85   0x0085  #       <control>
+0x86   0x0086  #       <control>
+0x87   0x0087  #       <control>
+0x88   0x0088  #       <control>
+0x89   0x0089  #       <control>
+0x8A   0x008A  #       <control>
+0x8B   0x008B  #       <control>
+0x8C   0x008C  #       <control>
+0x8D   0x008D  #       <control>
+0x8E   0x008E  #       <control>
+0x8F   0x008F  #       <control>
+0x90   0x0090  #       <control>
+0x91   0x0091  #       <control>
+0x92   0x0092  #       <control>
+0x93   0x0093  #       <control>
+0x94   0x0094  #       <control>
+0x95   0x0095  #       <control>
+0x96   0x0096  #       <control>
+0x97   0x0097  #       <control>
+0x98   0x0098  #       <control>
+0x99   0x0099  #       <control>
+0x9A   0x009A  #       <control>
+0x9B   0x009B  #       <control>
+0x9C   0x009C  #       <control>
+0x9D   0x009D  #       <control>
+0x9E   0x009E  #       <control>
+0x9F   0x009F  #       <control>
+0xA0   0x00A0  #       NO-BREAK SPACE
+0xA1   0x0104  #       LATIN CAPITAL LETTER A WITH OGONEK
+0xA2   0x0112  #       LATIN CAPITAL LETTER E WITH MACRON
+0xA3   0x0122  #       LATIN CAPITAL LETTER G WITH CEDILLA
+0xA4   0x012A  #       LATIN CAPITAL LETTER I WITH MACRON
+0xA5   0x0128  #       LATIN CAPITAL LETTER I WITH TILDE
+0xA6   0x0136  #       LATIN CAPITAL LETTER K WITH CEDILLA
+0xA7   0x00A7  #       SECTION SIGN
+0xA8   0x013B  #       LATIN CAPITAL LETTER L WITH CEDILLA
+0xA9   0x0110  #       LATIN CAPITAL LETTER D WITH STROKE
+0xAA   0x0160  #       LATIN CAPITAL LETTER S WITH CARON
+0xAB   0x0166  #       LATIN CAPITAL LETTER T WITH STROKE
+0xAC   0x017D  #       LATIN CAPITAL LETTER Z WITH CARON
+0xAD   0x00AD  #       SOFT HYPHEN
+0xAE   0x016A  #       LATIN CAPITAL LETTER U WITH MACRON
+0xAF   0x014A  #       LATIN CAPITAL LETTER ENG
+0xB0   0x00B0  #       DEGREE SIGN
+0xB1   0x0105  #       LATIN SMALL LETTER A WITH OGONEK
+0xB2   0x0113  #       LATIN SMALL LETTER E WITH MACRON
+0xB3   0x0123  #       LATIN SMALL LETTER G WITH CEDILLA
+0xB4   0x012B  #       LATIN SMALL LETTER I WITH MACRON
+0xB5   0x0129  #       LATIN SMALL LETTER I WITH TILDE
+0xB6   0x0137  #       LATIN SMALL LETTER K WITH CEDILLA
+0xB7   0x00B7  #       MIDDLE DOT
+0xB8   0x013C  #       LATIN SMALL LETTER L WITH CEDILLA
+0xB9   0x0111  #       LATIN SMALL LETTER D WITH STROKE
+0xBA   0x0161  #       LATIN SMALL LETTER S WITH CARON
+0xBB   0x0167  #       LATIN SMALL LETTER T WITH STROKE
+0xBC   0x017E  #       LATIN SMALL LETTER Z WITH CARON
+0xBD   0x2015  #       HORIZONTAL BAR
+0xBE   0x016B  #       LATIN SMALL LETTER U WITH MACRON
+0xBF   0x014B  #       LATIN SMALL LETTER ENG
+0xC0   0x0100  #       LATIN CAPITAL LETTER A WITH MACRON
+0xC1   0x00C1  #       LATIN CAPITAL LETTER A WITH ACUTE
+0xC2   0x00C2  #       LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0xC3   0x00C3  #       LATIN CAPITAL LETTER A WITH TILDE
+0xC4   0x00C4  #       LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x00C5  #       LATIN CAPITAL LETTER A WITH RING ABOVE
+0xC6   0x00C6  #       LATIN CAPITAL LETTER AE
+0xC7   0x012E  #       LATIN CAPITAL LETTER I WITH OGONEK
+0xC8   0x010C  #       LATIN CAPITAL LETTER C WITH CARON
+0xC9   0x00C9  #       LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x0118  #       LATIN CAPITAL LETTER E WITH OGONEK
+0xCB   0x00CB  #       LATIN CAPITAL LETTER E WITH DIAERESIS
+0xCC   0x0116  #       LATIN CAPITAL LETTER E WITH DOT ABOVE
+0xCD   0x00CD  #       LATIN CAPITAL LETTER I WITH ACUTE
+0xCE   0x00CE  #       LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0xCF   0x00CF  #       LATIN CAPITAL LETTER I WITH DIAERESIS
+0xD0   0x00D0  #       LATIN CAPITAL LETTER ETH (Icelandic)
+0xD1   0x0145  #       LATIN CAPITAL LETTER N WITH CEDILLA
+0xD2   0x014C  #       LATIN CAPITAL LETTER O WITH MACRON
+0xD3   0x00D3  #       LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x00D4  #       LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xD5   0x00D5  #       LATIN CAPITAL LETTER O WITH TILDE
+0xD6   0x00D6  #       LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x0168  #       LATIN CAPITAL LETTER U WITH TILDE
+0xD8   0x00D8  #       LATIN CAPITAL LETTER O WITH STROKE
+0xD9   0x0172  #       LATIN CAPITAL LETTER U WITH OGONEK
+0xDA   0x00DA  #       LATIN CAPITAL LETTER U WITH ACUTE
+0xDB   0x00DB  #       LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xDC   0x00DC  #       LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x00DD  #       LATIN CAPITAL LETTER Y WITH ACUTE
+0xDE   0x00DE  #       LATIN CAPITAL LETTER THORN (Icelandic)
+0xDF   0x00DF  #       LATIN SMALL LETTER SHARP S (German)
+0xE0   0x0101  #       LATIN SMALL LETTER A WITH MACRON
+0xE1   0x00E1  #       LATIN SMALL LETTER A WITH ACUTE
+0xE2   0x00E2  #       LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3   0x00E3  #       LATIN SMALL LETTER A WITH TILDE
+0xE4   0x00E4  #       LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x00E5  #       LATIN SMALL LETTER A WITH RING ABOVE
+0xE6   0x00E6  #       LATIN SMALL LETTER AE
+0xE7   0x012F  #       LATIN SMALL LETTER I WITH OGONEK
+0xE8   0x010D  #       LATIN SMALL LETTER C WITH CARON
+0xE9   0x00E9  #       LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x0119  #       LATIN SMALL LETTER E WITH OGONEK
+0xEB   0x00EB  #       LATIN SMALL LETTER E WITH DIAERESIS
+0xEC   0x0117  #       LATIN SMALL LETTER E WITH DOT ABOVE
+0xED   0x00ED  #       LATIN SMALL LETTER I WITH ACUTE
+0xEE   0x00EE  #       LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF   0x00EF  #       LATIN SMALL LETTER I WITH DIAERESIS
+0xF0   0x00F0  #       LATIN SMALL LETTER ETH (Icelandic)
+0xF1   0x0146  #       LATIN SMALL LETTER N WITH CEDILLA
+0xF2   0x014D  #       LATIN SMALL LETTER O WITH MACRON
+0xF3   0x00F3  #       LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x00F4  #       LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5   0x00F5  #       LATIN SMALL LETTER O WITH TILDE
+0xF6   0x00F6  #       LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x0169  #       LATIN SMALL LETTER U WITH TILDE
+0xF8   0x00F8  #       LATIN SMALL LETTER O WITH STROKE
+0xF9   0x0173  #       LATIN SMALL LETTER U WITH OGONEK
+0xFA   0x00FA  #       LATIN SMALL LETTER U WITH ACUTE
+0xFB   0x00FB  #       LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC   0x00FC  #       LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x00FD  #       LATIN SMALL LETTER Y WITH ACUTE
+0xFE   0x00FE  #       LATIN SMALL LETTER THORN (Icelandic)
+0xFF   0x0138  #       LATIN SMALL LETTER KRA
diff --git a/program/lib/encoding/ISO-8859-11.map b/program/lib/encoding/ISO-8859-11.map
new file mode 100644 (file)
index 0000000..192bd9d
--- /dev/null
@@ -0,0 +1,297 @@
+#
+#      Name:             ISO/IEC 8859-11:2001 to Unicode
+#      Unicode version:  3.2
+#      Table version:    1.0
+#      Table format:     Format A
+#      Date:             2002 October 7
+#      Authors:          Ken Whistler <kenw@sybase.com>
+#
+#      Copyright (c) 2002 Unicode, Inc.  All Rights reserved.
+#
+#      This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+#      No claims are made as to fitness for any particular purpose.  No
+#      warranties of any kind are expressed or implied.  The recipient
+#      agrees to determine applicability of information provided.  If this
+#      file has been provided on optical media by Unicode, Inc., the sole
+#      remedy for any claim will be exchange of defective media within 90
+#      days of receipt.
+#
+#      Unicode, Inc. hereby grants the right to freely use the information
+#      supplied in this file in the creation of products supporting the
+#      Unicode Standard, and to make copies of this file in any form for
+#      internal or external distribution as long as this notice remains
+#      attached.
+#
+#      General notes:
+#
+#      This table contains the data the Unicode Consortium has on how
+#       ISO/IEC 8859-11:2001 characters map into Unicode.
+#
+#      ISO/IEC 8859-11:2001 is equivalent to TIS 620-2533 (1990) with
+#      the addition of 0xA0 NO-BREAK SPACE.
+#
+#      Format:  Three tab-separated columns
+#               Column #1 is the ISO/IEC 8859-11 code (in hex as 0xXX)
+#               Column #2 is the Unicode (in hex as 0xXXXX)
+#               Column #3 the Unicode name (follows a comment sign, '#')
+#
+#      The entries are in ISO/IEC 8859-11 order.
+#
+#      Version history:
+#              2002 October 7  Created
+#
+#      Updated versions of this file may be found in:
+#              <ftp://ftp.unicode.org/Public/MAPPINGS/>
+#
+#      For any comments or problems, please use the Unicode
+#      web contact form at:
+#              http://www.unicode.org/unicode/reporting.html
+#
+0x00   0x0000  #       NULL
+0x01   0x0001  #       START OF HEADING
+0x02   0x0002  #       START OF TEXT
+0x03   0x0003  #       END OF TEXT
+0x04   0x0004  #       END OF TRANSMISSION
+0x05   0x0005  #       ENQUIRY
+0x06   0x0006  #       ACKNOWLEDGE
+0x07   0x0007  #       BELL
+0x08   0x0008  #       BACKSPACE
+0x09   0x0009  #       HORIZONTAL TABULATION
+0x0A   0x000A  #       LINE FEED
+0x0B   0x000B  #       VERTICAL TABULATION
+0x0C   0x000C  #       FORM FEED
+0x0D   0x000D  #       CARRIAGE RETURN
+0x0E   0x000E  #       SHIFT OUT
+0x0F   0x000F  #       SHIFT IN
+0x10   0x0010  #       DATA LINK ESCAPE
+0x11   0x0011  #       DEVICE CONTROL ONE
+0x12   0x0012  #       DEVICE CONTROL TWO
+0x13   0x0013  #       DEVICE CONTROL THREE
+0x14   0x0014  #       DEVICE CONTROL FOUR
+0x15   0x0015  #       NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #       SYNCHRONOUS IDLE
+0x17   0x0017  #       END OF TRANSMISSION BLOCK
+0x18   0x0018  #       CANCEL
+0x19   0x0019  #       END OF MEDIUM
+0x1A   0x001A  #       SUBSTITUTE
+0x1B   0x001B  #       ESCAPE
+0x1C   0x001C  #       FILE SEPARATOR
+0x1D   0x001D  #       GROUP SEPARATOR
+0x1E   0x001E  #       RECORD SEPARATOR
+0x1F   0x001F  #       UNIT SEPARATOR
+0x20   0x0020  #       SPACE
+0x21   0x0021  #       EXCLAMATION MARK
+0x22   0x0022  #       QUOTATION MARK
+0x23   0x0023  #       NUMBER SIGN
+0x24   0x0024  #       DOLLAR SIGN
+0x25   0x0025  #       PERCENT SIGN
+0x26   0x0026  #       AMPERSAND
+0x27   0x0027  #       APOSTROPHE
+0x28   0x0028  #       LEFT PARENTHESIS
+0x29   0x0029  #       RIGHT PARENTHESIS
+0x2A   0x002A  #       ASTERISK
+0x2B   0x002B  #       PLUS SIGN
+0x2C   0x002C  #       COMMA
+0x2D   0x002D  #       HYPHEN-MINUS
+0x2E   0x002E  #       FULL STOP
+0x2F   0x002F  #       SOLIDUS
+0x30   0x0030  #       DIGIT ZERO
+0x31   0x0031  #       DIGIT ONE
+0x32   0x0032  #       DIGIT TWO
+0x33   0x0033  #       DIGIT THREE
+0x34   0x0034  #       DIGIT FOUR
+0x35   0x0035  #       DIGIT FIVE
+0x36   0x0036  #       DIGIT SIX
+0x37   0x0037  #       DIGIT SEVEN
+0x38   0x0038  #       DIGIT EIGHT
+0x39   0x0039  #       DIGIT NINE
+0x3A   0x003A  #       COLON
+0x3B   0x003B  #       SEMICOLON
+0x3C   0x003C  #       LESS-THAN SIGN
+0x3D   0x003D  #       EQUALS SIGN
+0x3E   0x003E  #       GREATER-THAN SIGN
+0x3F   0x003F  #       QUESTION MARK
+0x40   0x0040  #       COMMERCIAL AT
+0x41   0x0041  #       LATIN CAPITAL LETTER A
+0x42   0x0042  #       LATIN CAPITAL LETTER B
+0x43   0x0043  #       LATIN CAPITAL LETTER C
+0x44   0x0044  #       LATIN CAPITAL LETTER D
+0x45   0x0045  #       LATIN CAPITAL LETTER E
+0x46   0x0046  #       LATIN CAPITAL LETTER F
+0x47   0x0047  #       LATIN CAPITAL LETTER G
+0x48   0x0048  #       LATIN CAPITAL LETTER H
+0x49   0x0049  #       LATIN CAPITAL LETTER I
+0x4A   0x004A  #       LATIN CAPITAL LETTER J
+0x4B   0x004B  #       LATIN CAPITAL LETTER K
+0x4C   0x004C  #       LATIN CAPITAL LETTER L
+0x4D   0x004D  #       LATIN CAPITAL LETTER M
+0x4E   0x004E  #       LATIN CAPITAL LETTER N
+0x4F   0x004F  #       LATIN CAPITAL LETTER O
+0x50   0x0050  #       LATIN CAPITAL LETTER P
+0x51   0x0051  #       LATIN CAPITAL LETTER Q
+0x52   0x0052  #       LATIN CAPITAL LETTER R
+0x53   0x0053  #       LATIN CAPITAL LETTER S
+0x54   0x0054  #       LATIN CAPITAL LETTER T
+0x55   0x0055  #       LATIN CAPITAL LETTER U
+0x56   0x0056  #       LATIN CAPITAL LETTER V
+0x57   0x0057  #       LATIN CAPITAL LETTER W
+0x58   0x0058  #       LATIN CAPITAL LETTER X
+0x59   0x0059  #       LATIN CAPITAL LETTER Y
+0x5A   0x005A  #       LATIN CAPITAL LETTER Z
+0x5B   0x005B  #       LEFT SQUARE BRACKET
+0x5C   0x005C  #       REVERSE SOLIDUS
+0x5D   0x005D  #       RIGHT SQUARE BRACKET
+0x5E   0x005E  #       CIRCUMFLEX ACCENT
+0x5F   0x005F  #       LOW LINE
+0x60   0x0060  #       GRAVE ACCENT
+0x61   0x0061  #       LATIN SMALL LETTER A
+0x62   0x0062  #       LATIN SMALL LETTER B
+0x63   0x0063  #       LATIN SMALL LETTER C
+0x64   0x0064  #       LATIN SMALL LETTER D
+0x65   0x0065  #       LATIN SMALL LETTER E
+0x66   0x0066  #       LATIN SMALL LETTER F
+0x67   0x0067  #       LATIN SMALL LETTER G
+0x68   0x0068  #       LATIN SMALL LETTER H
+0x69   0x0069  #       LATIN SMALL LETTER I
+0x6A   0x006A  #       LATIN SMALL LETTER J
+0x6B   0x006B  #       LATIN SMALL LETTER K
+0x6C   0x006C  #       LATIN SMALL LETTER L
+0x6D   0x006D  #       LATIN SMALL LETTER M
+0x6E   0x006E  #       LATIN SMALL LETTER N
+0x6F   0x006F  #       LATIN SMALL LETTER O
+0x70   0x0070  #       LATIN SMALL LETTER P
+0x71   0x0071  #       LATIN SMALL LETTER Q
+0x72   0x0072  #       LATIN SMALL LETTER R
+0x73   0x0073  #       LATIN SMALL LETTER S
+0x74   0x0074  #       LATIN SMALL LETTER T
+0x75   0x0075  #       LATIN SMALL LETTER U
+0x76   0x0076  #       LATIN SMALL LETTER V
+0x77   0x0077  #       LATIN SMALL LETTER W
+0x78   0x0078  #       LATIN SMALL LETTER X
+0x79   0x0079  #       LATIN SMALL LETTER Y
+0x7A   0x007A  #       LATIN SMALL LETTER Z
+0x7B   0x007B  #       LEFT CURLY BRACKET
+0x7C   0x007C  #       VERTICAL LINE
+0x7D   0x007D  #       RIGHT CURLY BRACKET
+0x7E   0x007E  #       TILDE
+0x7F   0x007F  #       DELETE
+0x80   0x0080  #       <control>
+0x81   0x0081  #       <control>
+0x82   0x0082  #       <control>
+0x83   0x0083  #       <control>
+0x84   0x0084  #       <control>
+0x85   0x0085  #       <control>
+0x86   0x0086  #       <control>
+0x87   0x0087  #       <control>
+0x88   0x0088  #       <control>
+0x89   0x0089  #       <control>
+0x8A   0x008A  #       <control>
+0x8B   0x008B  #       <control>
+0x8C   0x008C  #       <control>
+0x8D   0x008D  #       <control>
+0x8E   0x008E  #       <control>
+0x8F   0x008F  #       <control>
+0x90   0x0090  #       <control>
+0x91   0x0091  #       <control>
+0x92   0x0092  #       <control>
+0x93   0x0093  #       <control>
+0x94   0x0094  #       <control>
+0x95   0x0095  #       <control>
+0x96   0x0096  #       <control>
+0x97   0x0097  #       <control>
+0x98   0x0098  #       <control>
+0x99   0x0099  #       <control>
+0x9A   0x009A  #       <control>
+0x9B   0x009B  #       <control>
+0x9C   0x009C  #       <control>
+0x9D   0x009D  #       <control>
+0x9E   0x009E  #       <control>
+0x9F   0x009F  #       <control>
+0xA0   0x00A0  #       NO-BREAK SPACE
+0xA1   0x0E01  #       THAI CHARACTER KO KAI
+0xA2   0x0E02  #       THAI CHARACTER KHO KHAI
+0xA3   0x0E03  #       THAI CHARACTER KHO KHUAT
+0xA4   0x0E04  #       THAI CHARACTER KHO KHWAI
+0xA5   0x0E05  #       THAI CHARACTER KHO KHON
+0xA6   0x0E06  #       THAI CHARACTER KHO RAKHANG
+0xA7   0x0E07  #       THAI CHARACTER NGO NGU
+0xA8   0x0E08  #       THAI CHARACTER CHO CHAN
+0xA9   0x0E09  #       THAI CHARACTER CHO CHING
+0xAA   0x0E0A  #       THAI CHARACTER CHO CHANG
+0xAB   0x0E0B  #       THAI CHARACTER SO SO
+0xAC   0x0E0C  #       THAI CHARACTER CHO CHOE
+0xAD   0x0E0D  #       THAI CHARACTER YO YING
+0xAE   0x0E0E  #       THAI CHARACTER DO CHADA
+0xAF   0x0E0F  #       THAI CHARACTER TO PATAK
+0xB0   0x0E10  #       THAI CHARACTER THO THAN
+0xB1   0x0E11  #       THAI CHARACTER THO NANGMONTHO
+0xB2   0x0E12  #       THAI CHARACTER THO PHUTHAO
+0xB3   0x0E13  #       THAI CHARACTER NO NEN
+0xB4   0x0E14  #       THAI CHARACTER DO DEK
+0xB5   0x0E15  #       THAI CHARACTER TO TAO
+0xB6   0x0E16  #       THAI CHARACTER THO THUNG
+0xB7   0x0E17  #       THAI CHARACTER THO THAHAN
+0xB8   0x0E18  #       THAI CHARACTER THO THONG
+0xB9   0x0E19  #       THAI CHARACTER NO NU
+0xBA   0x0E1A  #       THAI CHARACTER BO BAIMAI
+0xBB   0x0E1B  #       THAI CHARACTER PO PLA
+0xBC   0x0E1C  #       THAI CHARACTER PHO PHUNG
+0xBD   0x0E1D  #       THAI CHARACTER FO FA
+0xBE   0x0E1E  #       THAI CHARACTER PHO PHAN
+0xBF   0x0E1F  #       THAI CHARACTER FO FAN
+0xC0   0x0E20  #       THAI CHARACTER PHO SAMPHAO
+0xC1   0x0E21  #       THAI CHARACTER MO MA
+0xC2   0x0E22  #       THAI CHARACTER YO YAK
+0xC3   0x0E23  #       THAI CHARACTER RO RUA
+0xC4   0x0E24  #       THAI CHARACTER RU
+0xC5   0x0E25  #       THAI CHARACTER LO LING
+0xC6   0x0E26  #       THAI CHARACTER LU
+0xC7   0x0E27  #       THAI CHARACTER WO WAEN
+0xC8   0x0E28  #       THAI CHARACTER SO SALA
+0xC9   0x0E29  #       THAI CHARACTER SO RUSI
+0xCA   0x0E2A  #       THAI CHARACTER SO SUA
+0xCB   0x0E2B  #       THAI CHARACTER HO HIP
+0xCC   0x0E2C  #       THAI CHARACTER LO CHULA
+0xCD   0x0E2D  #       THAI CHARACTER O ANG
+0xCE   0x0E2E  #       THAI CHARACTER HO NOKHUK
+0xCF   0x0E2F  #       THAI CHARACTER PAIYANNOI
+0xD0   0x0E30  #       THAI CHARACTER SARA A
+0xD1   0x0E31  #       THAI CHARACTER MAI HAN-AKAT
+0xD2   0x0E32  #       THAI CHARACTER SARA AA
+0xD3   0x0E33  #       THAI CHARACTER SARA AM
+0xD4   0x0E34  #       THAI CHARACTER SARA I
+0xD5   0x0E35  #       THAI CHARACTER SARA II
+0xD6   0x0E36  #       THAI CHARACTER SARA UE
+0xD7   0x0E37  #       THAI CHARACTER SARA UEE
+0xD8   0x0E38  #       THAI CHARACTER SARA U
+0xD9   0x0E39  #       THAI CHARACTER SARA UU
+0xDA   0x0E3A  #       THAI CHARACTER PHINTHU
+0xDF   0x0E3F  #       THAI CURRENCY SYMBOL BAHT
+0xE0   0x0E40  #       THAI CHARACTER SARA E
+0xE1   0x0E41  #       THAI CHARACTER SARA AE
+0xE2   0x0E42  #       THAI CHARACTER SARA O
+0xE3   0x0E43  #       THAI CHARACTER SARA AI MAIMUAN
+0xE4   0x0E44  #       THAI CHARACTER SARA AI MAIMALAI
+0xE5   0x0E45  #       THAI CHARACTER LAKKHANGYAO
+0xE6   0x0E46  #       THAI CHARACTER MAIYAMOK
+0xE7   0x0E47  #       THAI CHARACTER MAITAIKHU
+0xE8   0x0E48  #       THAI CHARACTER MAI EK
+0xE9   0x0E49  #       THAI CHARACTER MAI THO
+0xEA   0x0E4A  #       THAI CHARACTER MAI TRI
+0xEB   0x0E4B  #       THAI CHARACTER MAI CHATTAWA
+0xEC   0x0E4C  #       THAI CHARACTER THANTHAKHAT
+0xED   0x0E4D  #       THAI CHARACTER NIKHAHIT
+0xEE   0x0E4E  #       THAI CHARACTER YAMAKKAN
+0xEF   0x0E4F  #       THAI CHARACTER FONGMAN
+0xF0   0x0E50  #       THAI DIGIT ZERO
+0xF1   0x0E51  #       THAI DIGIT ONE
+0xF2   0x0E52  #       THAI DIGIT TWO
+0xF3   0x0E53  #       THAI DIGIT THREE
+0xF4   0x0E54  #       THAI DIGIT FOUR
+0xF5   0x0E55  #       THAI DIGIT FIVE
+0xF6   0x0E56  #       THAI DIGIT SIX
+0xF7   0x0E57  #       THAI DIGIT SEVEN
+0xF8   0x0E58  #       THAI DIGIT EIGHT
+0xF9   0x0E59  #       THAI DIGIT NINE
+0xFA   0x0E5A  #       THAI CHARACTER ANGKHANKHU
+0xFB   0x0E5B  #       THAI CHARACTER KHOMUT
diff --git a/program/lib/encoding/ISO-8859-13.map b/program/lib/encoding/ISO-8859-13.map
new file mode 100644 (file)
index 0000000..cd11b53
--- /dev/null
@@ -0,0 +1,299 @@
+#
+#      Name:             ISO/IEC 8859-13:1998  to Unicode
+#      Unicode version:  3.0
+#      Table version:    1.0
+#      Table format:     Format A
+#      Date:             1999 July 27
+#      Authors:          Ken Whistler <kenw@sybase.com>
+#
+#      Copyright (c) 1998 - 1999 Unicode, Inc.  All Rights reserved.
+#
+#      This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+#      No claims are made as to fitness for any particular purpose.  No
+#      warranties of any kind are expressed or implied.  The recipient
+#      agrees to determine applicability of information provided.  If this
+#      file has been provided on optical media by Unicode, Inc., the sole
+#      remedy for any claim will be exchange of defective media within 90
+#      days of receipt.
+#
+#      Unicode, Inc. hereby grants the right to freely use the information
+#      supplied in this file in the creation of products supporting the
+#      Unicode Standard, and to make copies of this file in any form for
+#      internal or external distribution as long as this notice remains
+#      attached.
+#
+#      General notes:
+#
+#      This table contains the data the Unicode Consortium has on how
+#       ISO/IEC 8859-13:1998 characters map into Unicode.
+#
+#      Format:  Three tab-separated columns
+#               Column #1 is the ISO/IEC 8859-13 code (in hex as 0xXX)
+#               Column #2 is the Unicode (in hex as 0xXXXX)
+#               Column #3 the Unicode name (follows a comment sign, '#')
+#
+#      The entries are in ISO/IEC 8859-13 order.
+#
+#      Updated versions of this file may be found in:
+#              <ftp://ftp.unicode.org/Public/MAPPINGS/>
+#
+#      Any comments or problems, contact <errata@unicode.org>
+#      Please note that <errata@unicode.org> is an archival address;
+#      notices will be checked, but do not expect an immediate response.
+#
+0x00   0x0000  #       NULL
+0x01   0x0001  #       START OF HEADING
+0x02   0x0002  #       START OF TEXT
+0x03   0x0003  #       END OF TEXT
+0x04   0x0004  #       END OF TRANSMISSION
+0x05   0x0005  #       ENQUIRY
+0x06   0x0006  #       ACKNOWLEDGE
+0x07   0x0007  #       BELL
+0x08   0x0008  #       BACKSPACE
+0x09   0x0009  #       HORIZONTAL TABULATION
+0x0A   0x000A  #       LINE FEED
+0x0B   0x000B  #       VERTICAL TABULATION
+0x0C   0x000C  #       FORM FEED
+0x0D   0x000D  #       CARRIAGE RETURN
+0x0E   0x000E  #       SHIFT OUT
+0x0F   0x000F  #       SHIFT IN
+0x10   0x0010  #       DATA LINK ESCAPE
+0x11   0x0011  #       DEVICE CONTROL ONE
+0x12   0x0012  #       DEVICE CONTROL TWO
+0x13   0x0013  #       DEVICE CONTROL THREE
+0x14   0x0014  #       DEVICE CONTROL FOUR
+0x15   0x0015  #       NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #       SYNCHRONOUS IDLE
+0x17   0x0017  #       END OF TRANSMISSION BLOCK
+0x18   0x0018  #       CANCEL
+0x19   0x0019  #       END OF MEDIUM
+0x1A   0x001A  #       SUBSTITUTE
+0x1B   0x001B  #       ESCAPE
+0x1C   0x001C  #       FILE SEPARATOR
+0x1D   0x001D  #       GROUP SEPARATOR
+0x1E   0x001E  #       RECORD SEPARATOR
+0x1F   0x001F  #       UNIT SEPARATOR
+0x20   0x0020  #       SPACE
+0x21   0x0021  #       EXCLAMATION MARK
+0x22   0x0022  #       QUOTATION MARK
+0x23   0x0023  #       NUMBER SIGN
+0x24   0x0024  #       DOLLAR SIGN
+0x25   0x0025  #       PERCENT SIGN
+0x26   0x0026  #       AMPERSAND
+0x27   0x0027  #       APOSTROPHE
+0x28   0x0028  #       LEFT PARENTHESIS
+0x29   0x0029  #       RIGHT PARENTHESIS
+0x2A   0x002A  #       ASTERISK
+0x2B   0x002B  #       PLUS SIGN
+0x2C   0x002C  #       COMMA
+0x2D   0x002D  #       HYPHEN-MINUS
+0x2E   0x002E  #       FULL STOP
+0x2F   0x002F  #       SOLIDUS
+0x30   0x0030  #       DIGIT ZERO
+0x31   0x0031  #       DIGIT ONE
+0x32   0x0032  #       DIGIT TWO
+0x33   0x0033  #       DIGIT THREE
+0x34   0x0034  #       DIGIT FOUR
+0x35   0x0035  #       DIGIT FIVE
+0x36   0x0036  #       DIGIT SIX
+0x37   0x0037  #       DIGIT SEVEN
+0x38   0x0038  #       DIGIT EIGHT
+0x39   0x0039  #       DIGIT NINE
+0x3A   0x003A  #       COLON
+0x3B   0x003B  #       SEMICOLON
+0x3C   0x003C  #       LESS-THAN SIGN
+0x3D   0x003D  #       EQUALS SIGN
+0x3E   0x003E  #       GREATER-THAN SIGN
+0x3F   0x003F  #       QUESTION MARK
+0x40   0x0040  #       COMMERCIAL AT
+0x41   0x0041  #       LATIN CAPITAL LETTER A
+0x42   0x0042  #       LATIN CAPITAL LETTER B
+0x43   0x0043  #       LATIN CAPITAL LETTER C
+0x44   0x0044  #       LATIN CAPITAL LETTER D
+0x45   0x0045  #       LATIN CAPITAL LETTER E
+0x46   0x0046  #       LATIN CAPITAL LETTER F
+0x47   0x0047  #       LATIN CAPITAL LETTER G
+0x48   0x0048  #       LATIN CAPITAL LETTER H
+0x49   0x0049  #       LATIN CAPITAL LETTER I
+0x4A   0x004A  #       LATIN CAPITAL LETTER J
+0x4B   0x004B  #       LATIN CAPITAL LETTER K
+0x4C   0x004C  #       LATIN CAPITAL LETTER L
+0x4D   0x004D  #       LATIN CAPITAL LETTER M
+0x4E   0x004E  #       LATIN CAPITAL LETTER N
+0x4F   0x004F  #       LATIN CAPITAL LETTER O
+0x50   0x0050  #       LATIN CAPITAL LETTER P
+0x51   0x0051  #       LATIN CAPITAL LETTER Q
+0x52   0x0052  #       LATIN CAPITAL LETTER R
+0x53   0x0053  #       LATIN CAPITAL LETTER S
+0x54   0x0054  #       LATIN CAPITAL LETTER T
+0x55   0x0055  #       LATIN CAPITAL LETTER U
+0x56   0x0056  #       LATIN CAPITAL LETTER V
+0x57   0x0057  #       LATIN CAPITAL LETTER W
+0x58   0x0058  #       LATIN CAPITAL LETTER X
+0x59   0x0059  #       LATIN CAPITAL LETTER Y
+0x5A   0x005A  #       LATIN CAPITAL LETTER Z
+0x5B   0x005B  #       LEFT SQUARE BRACKET
+0x5C   0x005C  #       REVERSE SOLIDUS
+0x5D   0x005D  #       RIGHT SQUARE BRACKET
+0x5E   0x005E  #       CIRCUMFLEX ACCENT
+0x5F   0x005F  #       LOW LINE
+0x60   0x0060  #       GRAVE ACCENT
+0x61   0x0061  #       LATIN SMALL LETTER A
+0x62   0x0062  #       LATIN SMALL LETTER B
+0x63   0x0063  #       LATIN SMALL LETTER C
+0x64   0x0064  #       LATIN SMALL LETTER D
+0x65   0x0065  #       LATIN SMALL LETTER E
+0x66   0x0066  #       LATIN SMALL LETTER F
+0x67   0x0067  #       LATIN SMALL LETTER G
+0x68   0x0068  #       LATIN SMALL LETTER H
+0x69   0x0069  #       LATIN SMALL LETTER I
+0x6A   0x006A  #       LATIN SMALL LETTER J
+0x6B   0x006B  #       LATIN SMALL LETTER K
+0x6C   0x006C  #       LATIN SMALL LETTER L
+0x6D   0x006D  #       LATIN SMALL LETTER M
+0x6E   0x006E  #       LATIN SMALL LETTER N
+0x6F   0x006F  #       LATIN SMALL LETTER O
+0x70   0x0070  #       LATIN SMALL LETTER P
+0x71   0x0071  #       LATIN SMALL LETTER Q
+0x72   0x0072  #       LATIN SMALL LETTER R
+0x73   0x0073  #       LATIN SMALL LETTER S
+0x74   0x0074  #       LATIN SMALL LETTER T
+0x75   0x0075  #       LATIN SMALL LETTER U
+0x76   0x0076  #       LATIN SMALL LETTER V
+0x77   0x0077  #       LATIN SMALL LETTER W
+0x78   0x0078  #       LATIN SMALL LETTER X
+0x79   0x0079  #       LATIN SMALL LETTER Y
+0x7A   0x007A  #       LATIN SMALL LETTER Z
+0x7B   0x007B  #       LEFT CURLY BRACKET
+0x7C   0x007C  #       VERTICAL LINE
+0x7D   0x007D  #       RIGHT CURLY BRACKET
+0x7E   0x007E  #       TILDE
+0x7F   0x007F  #       DELETE
+0x80   0x0080  #       <control>
+0x81   0x0081  #       <control>
+0x82   0x0082  #       <control>
+0x83   0x0083  #       <control>
+0x84   0x0084  #       <control>
+0x85   0x0085  #       <control>
+0x86   0x0086  #       <control>
+0x87   0x0087  #       <control>
+0x88   0x0088  #       <control>
+0x89   0x0089  #       <control>
+0x8A   0x008A  #       <control>
+0x8B   0x008B  #       <control>
+0x8C   0x008C  #       <control>
+0x8D   0x008D  #       <control>
+0x8E   0x008E  #       <control>
+0x8F   0x008F  #       <control>
+0x90   0x0090  #       <control>
+0x91   0x0091  #       <control>
+0x92   0x0092  #       <control>
+0x93   0x0093  #       <control>
+0x94   0x0094  #       <control>
+0x95   0x0095  #       <control>
+0x96   0x0096  #       <control>
+0x97   0x0097  #       <control>
+0x98   0x0098  #       <control>
+0x99   0x0099  #       <control>
+0x9A   0x009A  #       <control>
+0x9B   0x009B  #       <control>
+0x9C   0x009C  #       <control>
+0x9D   0x009D  #       <control>
+0x9E   0x009E  #       <control>
+0x9F   0x009F  #       <control>
+0xA0   0x00A0  #       NO-BREAK SPACE
+0xA1   0x201D  #       RIGHT DOUBLE QUOTATION MARK
+0xA2   0x00A2  #       CENT SIGN
+0xA3   0x00A3  #       POUND SIGN
+0xA4   0x00A4  #       CURRENCY SIGN
+0xA5   0x201E  #       DOUBLE LOW-9 QUOTATION MARK
+0xA6   0x00A6  #       BROKEN BAR
+0xA7   0x00A7  #       SECTION SIGN
+0xA8   0x00D8  #       LATIN CAPITAL LETTER O WITH STROKE
+0xA9   0x00A9  #       COPYRIGHT SIGN
+0xAA   0x0156  #       LATIN CAPITAL LETTER R WITH CEDILLA
+0xAB   0x00AB  #       LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #       NOT SIGN
+0xAD   0x00AD  #       SOFT HYPHEN
+0xAE   0x00AE  #       REGISTERED SIGN
+0xAF   0x00C6  #       LATIN CAPITAL LETTER AE
+0xB0   0x00B0  #       DEGREE SIGN
+0xB1   0x00B1  #       PLUS-MINUS SIGN
+0xB2   0x00B2  #       SUPERSCRIPT TWO
+0xB3   0x00B3  #       SUPERSCRIPT THREE
+0xB4   0x201C  #       LEFT DOUBLE QUOTATION MARK
+0xB5   0x00B5  #       MICRO SIGN
+0xB6   0x00B6  #       PILCROW SIGN
+0xB7   0x00B7  #       MIDDLE DOT
+0xB8   0x00F8  #       LATIN SMALL LETTER O WITH STROKE
+0xB9   0x00B9  #       SUPERSCRIPT ONE
+0xBA   0x0157  #       LATIN SMALL LETTER R WITH CEDILLA
+0xBB   0x00BB  #       RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x00BC  #       VULGAR FRACTION ONE QUARTER
+0xBD   0x00BD  #       VULGAR FRACTION ONE HALF
+0xBE   0x00BE  #       VULGAR FRACTION THREE QUARTERS
+0xBF   0x00E6  #       LATIN SMALL LETTER AE
+0xC0   0x0104  #       LATIN CAPITAL LETTER A WITH OGONEK
+0xC1   0x012E  #       LATIN CAPITAL LETTER I WITH OGONEK
+0xC2   0x0100  #       LATIN CAPITAL LETTER A WITH MACRON
+0xC3   0x0106  #       LATIN CAPITAL LETTER C WITH ACUTE
+0xC4   0x00C4  #       LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x00C5  #       LATIN CAPITAL LETTER A WITH RING ABOVE
+0xC6   0x0118  #       LATIN CAPITAL LETTER E WITH OGONEK
+0xC7   0x0112  #       LATIN CAPITAL LETTER E WITH MACRON
+0xC8   0x010C  #       LATIN CAPITAL LETTER C WITH CARON
+0xC9   0x00C9  #       LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x0179  #       LATIN CAPITAL LETTER Z WITH ACUTE
+0xCB   0x0116  #       LATIN CAPITAL LETTER E WITH DOT ABOVE
+0xCC   0x0122  #       LATIN CAPITAL LETTER G WITH CEDILLA
+0xCD   0x0136  #       LATIN CAPITAL LETTER K WITH CEDILLA
+0xCE   0x012A  #       LATIN CAPITAL LETTER I WITH MACRON
+0xCF   0x013B  #       LATIN CAPITAL LETTER L WITH CEDILLA
+0xD0   0x0160  #       LATIN CAPITAL LETTER S WITH CARON
+0xD1   0x0143  #       LATIN CAPITAL LETTER N WITH ACUTE
+0xD2   0x0145  #       LATIN CAPITAL LETTER N WITH CEDILLA
+0xD3   0x00D3  #       LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x014C  #       LATIN CAPITAL LETTER O WITH MACRON
+0xD5   0x00D5  #       LATIN CAPITAL LETTER O WITH TILDE
+0xD6   0x00D6  #       LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x00D7  #       MULTIPLICATION SIGN
+0xD8   0x0172  #       LATIN CAPITAL LETTER U WITH OGONEK
+0xD9   0x0141  #       LATIN CAPITAL LETTER L WITH STROKE
+0xDA   0x015A  #       LATIN CAPITAL LETTER S WITH ACUTE
+0xDB   0x016A  #       LATIN CAPITAL LETTER U WITH MACRON
+0xDC   0x00DC  #       LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x017B  #       LATIN CAPITAL LETTER Z WITH DOT ABOVE
+0xDE   0x017D  #       LATIN CAPITAL LETTER Z WITH CARON
+0xDF   0x00DF  #       LATIN SMALL LETTER SHARP S (German)
+0xE0   0x0105  #       LATIN SMALL LETTER A WITH OGONEK
+0xE1   0x012F  #       LATIN SMALL LETTER I WITH OGONEK
+0xE2   0x0101  #       LATIN SMALL LETTER A WITH MACRON
+0xE3   0x0107  #       LATIN SMALL LETTER C WITH ACUTE
+0xE4   0x00E4  #       LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x00E5  #       LATIN SMALL LETTER A WITH RING ABOVE
+0xE6   0x0119  #       LATIN SMALL LETTER E WITH OGONEK
+0xE7   0x0113  #       LATIN SMALL LETTER E WITH MACRON
+0xE8   0x010D  #       LATIN SMALL LETTER C WITH CARON
+0xE9   0x00E9  #       LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x017A  #       LATIN SMALL LETTER Z WITH ACUTE
+0xEB   0x0117  #       LATIN SMALL LETTER E WITH DOT ABOVE
+0xEC   0x0123  #       LATIN SMALL LETTER G WITH CEDILLA
+0xED   0x0137  #       LATIN SMALL LETTER K WITH CEDILLA
+0xEE   0x012B  #       LATIN SMALL LETTER I WITH MACRON
+0xEF   0x013C  #       LATIN SMALL LETTER L WITH CEDILLA
+0xF0   0x0161  #       LATIN SMALL LETTER S WITH CARON
+0xF1   0x0144  #       LATIN SMALL LETTER N WITH ACUTE
+0xF2   0x0146  #       LATIN SMALL LETTER N WITH CEDILLA
+0xF3   0x00F3  #       LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x014D  #       LATIN SMALL LETTER O WITH MACRON
+0xF5   0x00F5  #       LATIN SMALL LETTER O WITH TILDE
+0xF6   0x00F6  #       LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x00F7  #       DIVISION SIGN
+0xF8   0x0173  #       LATIN SMALL LETTER U WITH OGONEK
+0xF9   0x0142  #       LATIN SMALL LETTER L WITH STROKE
+0xFA   0x015B  #       LATIN SMALL LETTER S WITH ACUTE
+0xFB   0x016B  #       LATIN SMALL LETTER U WITH MACRON
+0xFC   0x00FC  #       LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x017C  #       LATIN SMALL LETTER Z WITH DOT ABOVE
+0xFE   0x017E  #       LATIN SMALL LETTER Z WITH CARON
+0xFF   0x2019  #       RIGHT SINGLE QUOTATION MARK
diff --git a/program/lib/encoding/ISO-8859-14.map b/program/lib/encoding/ISO-8859-14.map
new file mode 100644 (file)
index 0000000..73e9855
--- /dev/null
@@ -0,0 +1,301 @@
+#
+#      Name:             ISO/IEC 8859-14:1998 to Unicode
+#      Unicode version:  3.0
+#      Table version:    1.0
+#      Table format:     Format A
+#      Date:             1999 July 27
+#      Authors:          Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/>
+#                        Ken Whistler <kenw@sybase.com>
+#
+#      Copyright (c) 1998 - 1999 Unicode, Inc.  All Rights reserved.
+#
+#      This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+#      No claims are made as to fitness for any particular purpose.  No
+#      warranties of any kind are expressed or implied.  The recipient
+#      agrees to determine applicability of information provided.  If this
+#      file has been provided on optical media by Unicode, Inc., the sole
+#      remedy for any claim will be exchange of defective media within 90
+#      days of receipt.
+#
+#      Unicode, Inc. hereby grants the right to freely use the information
+#      supplied in this file in the creation of products supporting the
+#      Unicode Standard, and to make copies of this file in any form for
+#      internal or external distribution as long as this notice remains
+#      attached.
+#
+#      General notes:
+#
+#      This table contains the data the Unicode Consortium has on how
+#       ISO/IEC 8859-14:1998 characters map into Unicode.
+#
+#      Format:  Three tab-separated columns
+#               Column #1 is the ISO/IEC 8859-14 code (in hex as 0xXX)
+#               Column #2 is the Unicode (in hex as 0xXXXX)
+#               Column #3 the Unicode name (follows a comment sign, '#')
+#
+#      The entries are in ISO/IEC 8859-14 order.
+#
+#      Updated versions of this file may be found in:
+#              <ftp://ftp.unicode.org/Public/MAPPINGS/>
+#
+#      Any comments or problems, contact <errata@unicode.org>
+#      Please note that <errata@unicode.org> is an archival address;
+#      notices will be checked, but do not expect an immediate response.
+#
+0x00   0x0000  #       NULL
+0x01   0x0001  #       START OF HEADING
+0x02   0x0002  #       START OF TEXT
+0x03   0x0003  #       END OF TEXT
+0x04   0x0004  #       END OF TRANSMISSION
+0x05   0x0005  #       ENQUIRY
+0x06   0x0006  #       ACKNOWLEDGE
+0x07   0x0007  #       BELL
+0x08   0x0008  #       BACKSPACE
+0x09   0x0009  #       HORIZONTAL TABULATION
+0x0A   0x000A  #       LINE FEED
+0x0B   0x000B  #       VERTICAL TABULATION
+0x0C   0x000C  #       FORM FEED
+0x0D   0x000D  #       CARRIAGE RETURN
+0x0E   0x000E  #       SHIFT OUT
+0x0F   0x000F  #       SHIFT IN
+0x10   0x0010  #       DATA LINK ESCAPE
+0x11   0x0011  #       DEVICE CONTROL ONE
+0x12   0x0012  #       DEVICE CONTROL TWO
+0x13   0x0013  #       DEVICE CONTROL THREE
+0x14   0x0014  #       DEVICE CONTROL FOUR
+0x15   0x0015  #       NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #       SYNCHRONOUS IDLE
+0x17   0x0017  #       END OF TRANSMISSION BLOCK
+0x18   0x0018  #       CANCEL
+0x19   0x0019  #       END OF MEDIUM
+0x1A   0x001A  #       SUBSTITUTE
+0x1B   0x001B  #       ESCAPE
+0x1C   0x001C  #       FILE SEPARATOR
+0x1D   0x001D  #       GROUP SEPARATOR
+0x1E   0x001E  #       RECORD SEPARATOR
+0x1F   0x001F  #       UNIT SEPARATOR
+0x20   0x0020  #       SPACE
+0x21   0x0021  #       EXCLAMATION MARK
+0x22   0x0022  #       QUOTATION MARK
+0x23   0x0023  #       NUMBER SIGN
+0x24   0x0024  #       DOLLAR SIGN
+0x25   0x0025  #       PERCENT SIGN
+0x26   0x0026  #       AMPERSAND
+0x27   0x0027  #       APOSTROPHE
+0x28   0x0028  #       LEFT PARENTHESIS
+0x29   0x0029  #       RIGHT PARENTHESIS
+0x2A   0x002A  #       ASTERISK
+0x2B   0x002B  #       PLUS SIGN
+0x2C   0x002C  #       COMMA
+0x2D   0x002D  #       HYPHEN-MINUS
+0x2E   0x002E  #       FULL STOP
+0x2F   0x002F  #       SOLIDUS
+0x30   0x0030  #       DIGIT ZERO
+0x31   0x0031  #       DIGIT ONE
+0x32   0x0032  #       DIGIT TWO
+0x33   0x0033  #       DIGIT THREE
+0x34   0x0034  #       DIGIT FOUR
+0x35   0x0035  #       DIGIT FIVE
+0x36   0x0036  #       DIGIT SIX
+0x37   0x0037  #       DIGIT SEVEN
+0x38   0x0038  #       DIGIT EIGHT
+0x39   0x0039  #       DIGIT NINE
+0x3A   0x003A  #       COLON
+0x3B   0x003B  #       SEMICOLON
+0x3C   0x003C  #       LESS-THAN SIGN
+0x3D   0x003D  #       EQUALS SIGN
+0x3E   0x003E  #       GREATER-THAN SIGN
+0x3F   0x003F  #       QUESTION MARK
+0x40   0x0040  #       COMMERCIAL AT
+0x41   0x0041  #       LATIN CAPITAL LETTER A
+0x42   0x0042  #       LATIN CAPITAL LETTER B
+0x43   0x0043  #       LATIN CAPITAL LETTER C
+0x44   0x0044  #       LATIN CAPITAL LETTER D
+0x45   0x0045  #       LATIN CAPITAL LETTER E
+0x46   0x0046  #       LATIN CAPITAL LETTER F
+0x47   0x0047  #       LATIN CAPITAL LETTER G
+0x48   0x0048  #       LATIN CAPITAL LETTER H
+0x49   0x0049  #       LATIN CAPITAL LETTER I
+0x4A   0x004A  #       LATIN CAPITAL LETTER J
+0x4B   0x004B  #       LATIN CAPITAL LETTER K
+0x4C   0x004C  #       LATIN CAPITAL LETTER L
+0x4D   0x004D  #       LATIN CAPITAL LETTER M
+0x4E   0x004E  #       LATIN CAPITAL LETTER N
+0x4F   0x004F  #       LATIN CAPITAL LETTER O
+0x50   0x0050  #       LATIN CAPITAL LETTER P
+0x51   0x0051  #       LATIN CAPITAL LETTER Q
+0x52   0x0052  #       LATIN CAPITAL LETTER R
+0x53   0x0053  #       LATIN CAPITAL LETTER S
+0x54   0x0054  #       LATIN CAPITAL LETTER T
+0x55   0x0055  #       LATIN CAPITAL LETTER U
+0x56   0x0056  #       LATIN CAPITAL LETTER V
+0x57   0x0057  #       LATIN CAPITAL LETTER W
+0x58   0x0058  #       LATIN CAPITAL LETTER X
+0x59   0x0059  #       LATIN CAPITAL LETTER Y
+0x5A   0x005A  #       LATIN CAPITAL LETTER Z
+0x5B   0x005B  #       LEFT SQUARE BRACKET
+0x5C   0x005C  #       REVERSE SOLIDUS
+0x5D   0x005D  #       RIGHT SQUARE BRACKET
+0x5E   0x005E  #       CIRCUMFLEX ACCENT
+0x5F   0x005F  #       LOW LINE
+0x60   0x0060  #       GRAVE ACCENT
+0x61   0x0061  #       LATIN SMALL LETTER A
+0x62   0x0062  #       LATIN SMALL LETTER B
+0x63   0x0063  #       LATIN SMALL LETTER C
+0x64   0x0064  #       LATIN SMALL LETTER D
+0x65   0x0065  #       LATIN SMALL LETTER E
+0x66   0x0066  #       LATIN SMALL LETTER F
+0x67   0x0067  #       LATIN SMALL LETTER G
+0x68   0x0068  #       LATIN SMALL LETTER H
+0x69   0x0069  #       LATIN SMALL LETTER I
+0x6A   0x006A  #       LATIN SMALL LETTER J
+0x6B   0x006B  #       LATIN SMALL LETTER K
+0x6C   0x006C  #       LATIN SMALL LETTER L
+0x6D   0x006D  #       LATIN SMALL LETTER M
+0x6E   0x006E  #       LATIN SMALL LETTER N
+0x6F   0x006F  #       LATIN SMALL LETTER O
+0x70   0x0070  #       LATIN SMALL LETTER P
+0x71   0x0071  #       LATIN SMALL LETTER Q
+0x72   0x0072  #       LATIN SMALL LETTER R
+0x73   0x0073  #       LATIN SMALL LETTER S
+0x74   0x0074  #       LATIN SMALL LETTER T
+0x75   0x0075  #       LATIN SMALL LETTER U
+0x76   0x0076  #       LATIN SMALL LETTER V
+0x77   0x0077  #       LATIN SMALL LETTER W
+0x78   0x0078  #       LATIN SMALL LETTER X
+0x79   0x0079  #       LATIN SMALL LETTER Y
+0x7A   0x007A  #       LATIN SMALL LETTER Z
+0x7B   0x007B  #       LEFT CURLY BRACKET
+0x7C   0x007C  #       VERTICAL LINE
+0x7D   0x007D  #       RIGHT CURLY BRACKET
+0x7E   0x007E  #       TILDE
+0x7F   0x007F  #       DELETE
+0x80   0x0080  #       <control>
+0x81   0x0081  #       <control>
+0x82   0x0082  #       <control>
+0x83   0x0083  #       <control>
+0x84   0x0084  #       <control>
+0x85   0x0085  #       <control>
+0x86   0x0086  #       <control>
+0x87   0x0087  #       <control>
+0x88   0x0088  #       <control>
+0x89   0x0089  #       <control>
+0x8A   0x008A  #       <control>
+0x8B   0x008B  #       <control>
+0x8C   0x008C  #       <control>
+0x8D   0x008D  #       <control>
+0x8E   0x008E  #       <control>
+0x8F   0x008F  #       <control>
+0x90   0x0090  #       <control>
+0x91   0x0091  #       <control>
+0x92   0x0092  #       <control>
+0x93   0x0093  #       <control>
+0x94   0x0094  #       <control>
+0x95   0x0095  #       <control>
+0x96   0x0096  #       <control>
+0x97   0x0097  #       <control>
+0x98   0x0098  #       <control>
+0x99   0x0099  #       <control>
+0x9A   0x009A  #       <control>
+0x9B   0x009B  #       <control>
+0x9C   0x009C  #       <control>
+0x9D   0x009D  #       <control>
+0x9E   0x009E  #       <control>
+0x9F   0x009F  #       <control>
+0xA0   0x00A0  #       NO-BREAK SPACE
+0xA1   0x1E02  #       LATIN CAPITAL LETTER B WITH DOT ABOVE
+0xA2   0x1E03  #       LATIN SMALL LETTER B WITH DOT ABOVE
+0xA3   0x00A3  #       POUND SIGN
+0xA4   0x010A  #       LATIN CAPITAL LETTER C WITH DOT ABOVE
+0xA5   0x010B  #       LATIN SMALL LETTER C WITH DOT ABOVE
+0xA6   0x1E0A  #       LATIN CAPITAL LETTER D WITH DOT ABOVE
+0xA7   0x00A7  #       SECTION SIGN
+0xA8   0x1E80  #       LATIN CAPITAL LETTER W WITH GRAVE
+0xA9   0x00A9  #       COPYRIGHT SIGN
+0xAA   0x1E82  #       LATIN CAPITAL LETTER W WITH ACUTE
+0xAB   0x1E0B  #       LATIN SMALL LETTER D WITH DOT ABOVE
+0xAC   0x1EF2  #       LATIN CAPITAL LETTER Y WITH GRAVE
+0xAD   0x00AD  #       SOFT HYPHEN
+0xAE   0x00AE  #       REGISTERED SIGN
+0xAF   0x0178  #       LATIN CAPITAL LETTER Y WITH DIAERESIS
+0xB0   0x1E1E  #       LATIN CAPITAL LETTER F WITH DOT ABOVE
+0xB1   0x1E1F  #       LATIN SMALL LETTER F WITH DOT ABOVE
+0xB2   0x0120  #       LATIN CAPITAL LETTER G WITH DOT ABOVE
+0xB3   0x0121  #       LATIN SMALL LETTER G WITH DOT ABOVE
+0xB4   0x1E40  #       LATIN CAPITAL LETTER M WITH DOT ABOVE
+0xB5   0x1E41  #       LATIN SMALL LETTER M WITH DOT ABOVE
+0xB6   0x00B6  #       PILCROW SIGN
+0xB7   0x1E56  #       LATIN CAPITAL LETTER P WITH DOT ABOVE
+0xB8   0x1E81  #       LATIN SMALL LETTER W WITH GRAVE
+0xB9   0x1E57  #       LATIN SMALL LETTER P WITH DOT ABOVE
+0xBA   0x1E83  #       LATIN SMALL LETTER W WITH ACUTE
+0xBB   0x1E60  #       LATIN CAPITAL LETTER S WITH DOT ABOVE
+0xBC   0x1EF3  #       LATIN SMALL LETTER Y WITH GRAVE
+0xBD   0x1E84  #       LATIN CAPITAL LETTER W WITH DIAERESIS
+0xBE   0x1E85  #       LATIN SMALL LETTER W WITH DIAERESIS
+0xBF   0x1E61  #       LATIN SMALL LETTER S WITH DOT ABOVE
+0xC0   0x00C0  #       LATIN CAPITAL LETTER A WITH GRAVE
+0xC1   0x00C1  #       LATIN CAPITAL LETTER A WITH ACUTE
+0xC2   0x00C2  #       LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0xC3   0x00C3  #       LATIN CAPITAL LETTER A WITH TILDE
+0xC4   0x00C4  #       LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x00C5  #       LATIN CAPITAL LETTER A WITH RING ABOVE
+0xC6   0x00C6  #       LATIN CAPITAL LETTER AE
+0xC7   0x00C7  #       LATIN CAPITAL LETTER C WITH CEDILLA
+0xC8   0x00C8  #       LATIN CAPITAL LETTER E WITH GRAVE
+0xC9   0x00C9  #       LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x00CA  #       LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+0xCB   0x00CB  #       LATIN CAPITAL LETTER E WITH DIAERESIS
+0xCC   0x00CC  #       LATIN CAPITAL LETTER I WITH GRAVE
+0xCD   0x00CD  #       LATIN CAPITAL LETTER I WITH ACUTE
+0xCE   0x00CE  #       LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0xCF   0x00CF  #       LATIN CAPITAL LETTER I WITH DIAERESIS
+0xD0   0x0174  #       LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+0xD1   0x00D1  #       LATIN CAPITAL LETTER N WITH TILDE
+0xD2   0x00D2  #       LATIN CAPITAL LETTER O WITH GRAVE
+0xD3   0x00D3  #       LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x00D4  #       LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xD5   0x00D5  #       LATIN CAPITAL LETTER O WITH TILDE
+0xD6   0x00D6  #       LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x1E6A  #       LATIN CAPITAL LETTER T WITH DOT ABOVE
+0xD8   0x00D8  #       LATIN CAPITAL LETTER O WITH STROKE
+0xD9   0x00D9  #       LATIN CAPITAL LETTER U WITH GRAVE
+0xDA   0x00DA  #       LATIN CAPITAL LETTER U WITH ACUTE
+0xDB   0x00DB  #       LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xDC   0x00DC  #       LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x00DD  #       LATIN CAPITAL LETTER Y WITH ACUTE
+0xDE   0x0176  #       LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+0xDF   0x00DF  #       LATIN SMALL LETTER SHARP S
+0xE0   0x00E0  #       LATIN SMALL LETTER A WITH GRAVE
+0xE1   0x00E1  #       LATIN SMALL LETTER A WITH ACUTE
+0xE2   0x00E2  #       LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3   0x00E3  #       LATIN SMALL LETTER A WITH TILDE
+0xE4   0x00E4  #       LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x00E5  #       LATIN SMALL LETTER A WITH RING ABOVE
+0xE6   0x00E6  #       LATIN SMALL LETTER AE
+0xE7   0x00E7  #       LATIN SMALL LETTER C WITH CEDILLA
+0xE8   0x00E8  #       LATIN SMALL LETTER E WITH GRAVE
+0xE9   0x00E9  #       LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x00EA  #       LATIN SMALL LETTER E WITH CIRCUMFLEX
+0xEB   0x00EB  #       LATIN SMALL LETTER E WITH DIAERESIS
+0xEC   0x00EC  #       LATIN SMALL LETTER I WITH GRAVE
+0xED   0x00ED  #       LATIN SMALL LETTER I WITH ACUTE
+0xEE   0x00EE  #       LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF   0x00EF  #       LATIN SMALL LETTER I WITH DIAERESIS
+0xF0   0x0175  #       LATIN SMALL LETTER W WITH CIRCUMFLEX
+0xF1   0x00F1  #       LATIN SMALL LETTER N WITH TILDE
+0xF2   0x00F2  #       LATIN SMALL LETTER O WITH GRAVE
+0xF3   0x00F3  #       LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x00F4  #       LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5   0x00F5  #       LATIN SMALL LETTER O WITH TILDE
+0xF6   0x00F6  #       LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x1E6B  #       LATIN SMALL LETTER T WITH DOT ABOVE
+0xF8   0x00F8  #       LATIN SMALL LETTER O WITH STROKE
+0xF9   0x00F9  #       LATIN SMALL LETTER U WITH GRAVE
+0xFA   0x00FA  #       LATIN SMALL LETTER U WITH ACUTE
+0xFB   0x00FB  #       LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC   0x00FC  #       LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x00FD  #       LATIN SMALL LETTER Y WITH ACUTE
+0xFE   0x0177  #       LATIN SMALL LETTER Y WITH CIRCUMFLEX
+0xFF   0x00FF  #       LATIN SMALL LETTER Y WITH DIAERESIS
+
diff --git a/program/lib/encoding/ISO-8859-15.map b/program/lib/encoding/ISO-8859-15.map
new file mode 100644 (file)
index 0000000..ab2f32f
--- /dev/null
@@ -0,0 +1,303 @@
+#
+#      Name:             ISO/IEC 8859-15:1999 to Unicode
+#      Unicode version:  3.0
+#      Table version:    1.0
+#      Table format:     Format A
+#      Date:             1999 July 27
+#      Authors:          Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/>
+#                        Ken Whistler <kenw@sybase.com>
+#
+#      Copyright (c) 1998 - 1999 Unicode, Inc.  All Rights reserved.
+#
+#      This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+#      No claims are made as to fitness for any particular purpose.  No
+#      warranties of any kind are expressed or implied.  The recipient
+#      agrees to determine applicability of information provided.  If this
+#      file has been provided on optical media by Unicode, Inc., the sole
+#      remedy for any claim will be exchange of defective media within 90
+#      days of receipt.
+#
+#      Unicode, Inc. hereby grants the right to freely use the information
+#      supplied in this file in the creation of products supporting the
+#      Unicode Standard, and to make copies of this file in any form for
+#      internal or external distribution as long as this notice remains
+#      attached.
+#
+#      General notes:
+#
+#      This table contains the data the Unicode Consortium has on how
+#       ISO/IEC 8859-15:1999 characters map into Unicode.
+#
+#      Format:  Three tab-separated columns
+#               Column #1 is the ISO/IEC 8859-15 code (in hex as 0xXX)
+#               Column #2 is the Unicode (in hex as 0xXXXX)
+#               Column #3 the Unicode name (follows a comment sign, '#')
+#
+#      The entries are in ISO/IEC 8859-15 order.
+#
+#      Version history
+#
+#      Updated versions of this file may be found in:
+#              <ftp://ftp.unicode.org/Public/MAPPINGS/>
+#
+#      Any comments or problems, contact <errata@unicode.org>
+#      Please note that <errata@unicode.org> is an archival address;
+#      notices will be checked, but do not expect an immediate response.
+#
+0x00   0x0000  #       NULL
+0x01   0x0001  #       START OF HEADING
+0x02   0x0002  #       START OF TEXT
+0x03   0x0003  #       END OF TEXT
+0x04   0x0004  #       END OF TRANSMISSION
+0x05   0x0005  #       ENQUIRY
+0x06   0x0006  #       ACKNOWLEDGE
+0x07   0x0007  #       BELL
+0x08   0x0008  #       BACKSPACE
+0x09   0x0009  #       HORIZONTAL TABULATION
+0x0A   0x000A  #       LINE FEED
+0x0B   0x000B  #       VERTICAL TABULATION
+0x0C   0x000C  #       FORM FEED
+0x0D   0x000D  #       CARRIAGE RETURN
+0x0E   0x000E  #       SHIFT OUT
+0x0F   0x000F  #       SHIFT IN
+0x10   0x0010  #       DATA LINK ESCAPE
+0x11   0x0011  #       DEVICE CONTROL ONE
+0x12   0x0012  #       DEVICE CONTROL TWO
+0x13   0x0013  #       DEVICE CONTROL THREE
+0x14   0x0014  #       DEVICE CONTROL FOUR
+0x15   0x0015  #       NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #       SYNCHRONOUS IDLE
+0x17   0x0017  #       END OF TRANSMISSION BLOCK
+0x18   0x0018  #       CANCEL
+0x19   0x0019  #       END OF MEDIUM
+0x1A   0x001A  #       SUBSTITUTE
+0x1B   0x001B  #       ESCAPE
+0x1C   0x001C  #       FILE SEPARATOR
+0x1D   0x001D  #       GROUP SEPARATOR
+0x1E   0x001E  #       RECORD SEPARATOR
+0x1F   0x001F  #       UNIT SEPARATOR
+0x20   0x0020  #       SPACE
+0x21   0x0021  #       EXCLAMATION MARK
+0x22   0x0022  #       QUOTATION MARK
+0x23   0x0023  #       NUMBER SIGN
+0x24   0x0024  #       DOLLAR SIGN
+0x25   0x0025  #       PERCENT SIGN
+0x26   0x0026  #       AMPERSAND
+0x27   0x0027  #       APOSTROPHE
+0x28   0x0028  #       LEFT PARENTHESIS
+0x29   0x0029  #       RIGHT PARENTHESIS
+0x2A   0x002A  #       ASTERISK
+0x2B   0x002B  #       PLUS SIGN
+0x2C   0x002C  #       COMMA
+0x2D   0x002D  #       HYPHEN-MINUS
+0x2E   0x002E  #       FULL STOP
+0x2F   0x002F  #       SOLIDUS
+0x30   0x0030  #       DIGIT ZERO
+0x31   0x0031  #       DIGIT ONE
+0x32   0x0032  #       DIGIT TWO
+0x33   0x0033  #       DIGIT THREE
+0x34   0x0034  #       DIGIT FOUR
+0x35   0x0035  #       DIGIT FIVE
+0x36   0x0036  #       DIGIT SIX
+0x37   0x0037  #       DIGIT SEVEN
+0x38   0x0038  #       DIGIT EIGHT
+0x39   0x0039  #       DIGIT NINE
+0x3A   0x003A  #       COLON
+0x3B   0x003B  #       SEMICOLON
+0x3C   0x003C  #       LESS-THAN SIGN
+0x3D   0x003D  #       EQUALS SIGN
+0x3E   0x003E  #       GREATER-THAN SIGN
+0x3F   0x003F  #       QUESTION MARK
+0x40   0x0040  #       COMMERCIAL AT
+0x41   0x0041  #       LATIN CAPITAL LETTER A
+0x42   0x0042  #       LATIN CAPITAL LETTER B
+0x43   0x0043  #       LATIN CAPITAL LETTER C
+0x44   0x0044  #       LATIN CAPITAL LETTER D
+0x45   0x0045  #       LATIN CAPITAL LETTER E
+0x46   0x0046  #       LATIN CAPITAL LETTER F
+0x47   0x0047  #       LATIN CAPITAL LETTER G
+0x48   0x0048  #       LATIN CAPITAL LETTER H
+0x49   0x0049  #       LATIN CAPITAL LETTER I
+0x4A   0x004A  #       LATIN CAPITAL LETTER J
+0x4B   0x004B  #       LATIN CAPITAL LETTER K
+0x4C   0x004C  #       LATIN CAPITAL LETTER L
+0x4D   0x004D  #       LATIN CAPITAL LETTER M
+0x4E   0x004E  #       LATIN CAPITAL LETTER N
+0x4F   0x004F  #       LATIN CAPITAL LETTER O
+0x50   0x0050  #       LATIN CAPITAL LETTER P
+0x51   0x0051  #       LATIN CAPITAL LETTER Q
+0x52   0x0052  #       LATIN CAPITAL LETTER R
+0x53   0x0053  #       LATIN CAPITAL LETTER S
+0x54   0x0054  #       LATIN CAPITAL LETTER T
+0x55   0x0055  #       LATIN CAPITAL LETTER U
+0x56   0x0056  #       LATIN CAPITAL LETTER V
+0x57   0x0057  #       LATIN CAPITAL LETTER W
+0x58   0x0058  #       LATIN CAPITAL LETTER X
+0x59   0x0059  #       LATIN CAPITAL LETTER Y
+0x5A   0x005A  #       LATIN CAPITAL LETTER Z
+0x5B   0x005B  #       LEFT SQUARE BRACKET
+0x5C   0x005C  #       REVERSE SOLIDUS
+0x5D   0x005D  #       RIGHT SQUARE BRACKET
+0x5E   0x005E  #       CIRCUMFLEX ACCENT
+0x5F   0x005F  #       LOW LINE
+0x60   0x0060  #       GRAVE ACCENT
+0x61   0x0061  #       LATIN SMALL LETTER A
+0x62   0x0062  #       LATIN SMALL LETTER B
+0x63   0x0063  #       LATIN SMALL LETTER C
+0x64   0x0064  #       LATIN SMALL LETTER D
+0x65   0x0065  #       LATIN SMALL LETTER E
+0x66   0x0066  #       LATIN SMALL LETTER F
+0x67   0x0067  #       LATIN SMALL LETTER G
+0x68   0x0068  #       LATIN SMALL LETTER H
+0x69   0x0069  #       LATIN SMALL LETTER I
+0x6A   0x006A  #       LATIN SMALL LETTER J
+0x6B   0x006B  #       LATIN SMALL LETTER K
+0x6C   0x006C  #       LATIN SMALL LETTER L
+0x6D   0x006D  #       LATIN SMALL LETTER M
+0x6E   0x006E  #       LATIN SMALL LETTER N
+0x6F   0x006F  #       LATIN SMALL LETTER O
+0x70   0x0070  #       LATIN SMALL LETTER P
+0x71   0x0071  #       LATIN SMALL LETTER Q
+0x72   0x0072  #       LATIN SMALL LETTER R
+0x73   0x0073  #       LATIN SMALL LETTER S
+0x74   0x0074  #       LATIN SMALL LETTER T
+0x75   0x0075  #       LATIN SMALL LETTER U
+0x76   0x0076  #       LATIN SMALL LETTER V
+0x77   0x0077  #       LATIN SMALL LETTER W
+0x78   0x0078  #       LATIN SMALL LETTER X
+0x79   0x0079  #       LATIN SMALL LETTER Y
+0x7A   0x007A  #       LATIN SMALL LETTER Z
+0x7B   0x007B  #       LEFT CURLY BRACKET
+0x7C   0x007C  #       VERTICAL LINE
+0x7D   0x007D  #       RIGHT CURLY BRACKET
+0x7E   0x007E  #       TILDE
+0x7F   0x007F  #       DELETE
+0x80   0x0080  #       <control>
+0x81   0x0081  #       <control>
+0x82   0x0082  #       <control>
+0x83   0x0083  #       <control>
+0x84   0x0084  #       <control>
+0x85   0x0085  #       <control>
+0x86   0x0086  #       <control>
+0x87   0x0087  #       <control>
+0x88   0x0088  #       <control>
+0x89   0x0089  #       <control>
+0x8A   0x008A  #       <control>
+0x8B   0x008B  #       <control>
+0x8C   0x008C  #       <control>
+0x8D   0x008D  #       <control>
+0x8E   0x008E  #       <control>
+0x8F   0x008F  #       <control>
+0x90   0x0090  #       <control>
+0x91   0x0091  #       <control>
+0x92   0x0092  #       <control>
+0x93   0x0093  #       <control>
+0x94   0x0094  #       <control>
+0x95   0x0095  #       <control>
+0x96   0x0096  #       <control>
+0x97   0x0097  #       <control>
+0x98   0x0098  #       <control>
+0x99   0x0099  #       <control>
+0x9A   0x009A  #       <control>
+0x9B   0x009B  #       <control>
+0x9C   0x009C  #       <control>
+0x9D   0x009D  #       <control>
+0x9E   0x009E  #       <control>
+0x9F   0x009F  #       <control>
+0xA0   0x00A0  #       NO-BREAK SPACE
+0xA1   0x00A1  #       INVERTED EXCLAMATION MARK
+0xA2   0x00A2  #       CENT SIGN
+0xA3   0x00A3  #       POUND SIGN
+0xA4   0x20AC  #       EURO SIGN
+0xA5   0x00A5  #       YEN SIGN
+0xA6   0x0160  #       LATIN CAPITAL LETTER S WITH CARON
+0xA7   0x00A7  #       SECTION SIGN
+0xA8   0x0161  #       LATIN SMALL LETTER S WITH CARON
+0xA9   0x00A9  #       COPYRIGHT SIGN
+0xAA   0x00AA  #       FEMININE ORDINAL INDICATOR
+0xAB   0x00AB  #       LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x00AC  #       NOT SIGN
+0xAD   0x00AD  #       SOFT HYPHEN
+0xAE   0x00AE  #       REGISTERED SIGN
+0xAF   0x00AF  #       MACRON
+0xB0   0x00B0  #       DEGREE SIGN
+0xB1   0x00B1  #       PLUS-MINUS SIGN
+0xB2   0x00B2  #       SUPERSCRIPT TWO
+0xB3   0x00B3  #       SUPERSCRIPT THREE
+0xB4   0x017D  #       LATIN CAPITAL LETTER Z WITH CARON
+0xB5   0x00B5  #       MICRO SIGN
+0xB6   0x00B6  #       PILCROW SIGN
+0xB7   0x00B7  #       MIDDLE DOT
+0xB8   0x017E  #       LATIN SMALL LETTER Z WITH CARON
+0xB9   0x00B9  #       SUPERSCRIPT ONE
+0xBA   0x00BA  #       MASCULINE ORDINAL INDICATOR
+0xBB   0x00BB  #       RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x0152  #       LATIN CAPITAL LIGATURE OE
+0xBD   0x0153  #       LATIN SMALL LIGATURE OE
+0xBE   0x0178  #       LATIN CAPITAL LETTER Y WITH DIAERESIS
+0xBF   0x00BF  #       INVERTED QUESTION MARK
+0xC0   0x00C0  #       LATIN CAPITAL LETTER A WITH GRAVE
+0xC1   0x00C1  #       LATIN CAPITAL LETTER A WITH ACUTE
+0xC2   0x00C2  #       LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0xC3   0x00C3  #       LATIN CAPITAL LETTER A WITH TILDE
+0xC4   0x00C4  #       LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x00C5  #       LATIN CAPITAL LETTER A WITH RING ABOVE
+0xC6   0x00C6  #       LATIN CAPITAL LETTER AE
+0xC7   0x00C7  #       LATIN CAPITAL LETTER C WITH CEDILLA
+0xC8   0x00C8  #       LATIN CAPITAL LETTER E WITH GRAVE
+0xC9   0x00C9  #       LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x00CA  #       LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+0xCB   0x00CB  #       LATIN CAPITAL LETTER E WITH DIAERESIS
+0xCC   0x00CC  #       LATIN CAPITAL LETTER I WITH GRAVE
+0xCD   0x00CD  #       LATIN CAPITAL LETTER I WITH ACUTE
+0xCE   0x00CE  #       LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0xCF   0x00CF  #       LATIN CAPITAL LETTER I WITH DIAERESIS
+0xD0   0x00D0  #       LATIN CAPITAL LETTER ETH
+0xD1   0x00D1  #       LATIN CAPITAL LETTER N WITH TILDE
+0xD2   0x00D2  #       LATIN CAPITAL LETTER O WITH GRAVE
+0xD3   0x00D3  #       LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x00D4  #       LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xD5   0x00D5  #       LATIN CAPITAL LETTER O WITH TILDE
+0xD6   0x00D6  #       LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x00D7  #       MULTIPLICATION SIGN
+0xD8   0x00D8  #       LATIN CAPITAL LETTER O WITH STROKE
+0xD9   0x00D9  #       LATIN CAPITAL LETTER U WITH GRAVE
+0xDA   0x00DA  #       LATIN CAPITAL LETTER U WITH ACUTE
+0xDB   0x00DB  #       LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xDC   0x00DC  #       LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x00DD  #       LATIN CAPITAL LETTER Y WITH ACUTE
+0xDE   0x00DE  #       LATIN CAPITAL LETTER THORN
+0xDF   0x00DF  #       LATIN SMALL LETTER SHARP S
+0xE0   0x00E0  #       LATIN SMALL LETTER A WITH GRAVE
+0xE1   0x00E1  #       LATIN SMALL LETTER A WITH ACUTE
+0xE2   0x00E2  #       LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3   0x00E3  #       LATIN SMALL LETTER A WITH TILDE
+0xE4   0x00E4  #       LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x00E5  #       LATIN SMALL LETTER A WITH RING ABOVE
+0xE6   0x00E6  #       LATIN SMALL LETTER AE
+0xE7   0x00E7  #       LATIN SMALL LETTER C WITH CEDILLA
+0xE8   0x00E8  #       LATIN SMALL LETTER E WITH GRAVE
+0xE9   0x00E9  #       LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x00EA  #       LATIN SMALL LETTER E WITH CIRCUMFLEX
+0xEB   0x00EB  #       LATIN SMALL LETTER E WITH DIAERESIS
+0xEC   0x00EC  #       LATIN SMALL LETTER I WITH GRAVE
+0xED   0x00ED  #       LATIN SMALL LETTER I WITH ACUTE
+0xEE   0x00EE  #       LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF   0x00EF  #       LATIN SMALL LETTER I WITH DIAERESIS
+0xF0   0x00F0  #       LATIN SMALL LETTER ETH
+0xF1   0x00F1  #       LATIN SMALL LETTER N WITH TILDE
+0xF2   0x00F2  #       LATIN SMALL LETTER O WITH GRAVE
+0xF3   0x00F3  #       LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x00F4  #       LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5   0x00F5  #       LATIN SMALL LETTER O WITH TILDE
+0xF6   0x00F6  #       LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x00F7  #       DIVISION SIGN
+0xF8   0x00F8  #       LATIN SMALL LETTER O WITH STROKE
+0xF9   0x00F9  #       LATIN SMALL LETTER U WITH GRAVE
+0xFA   0x00FA  #       LATIN SMALL LETTER U WITH ACUTE
+0xFB   0x00FB  #       LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC   0x00FC  #       LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x00FD  #       LATIN SMALL LETTER Y WITH ACUTE
+0xFE   0x00FE  #       LATIN SMALL LETTER THORN
+0xFF   0x00FF  #       LATIN SMALL LETTER Y WITH DIAERESIS
+
diff --git a/program/lib/encoding/ISO-8859-16.map b/program/lib/encoding/ISO-8859-16.map
new file mode 100644 (file)
index 0000000..c0dcf0d
--- /dev/null
@@ -0,0 +1,299 @@
+#
+#      Name:             ISO/IEC 8859-16:2001 to Unicode
+#      Unicode version:  3.0
+#      Table version:    1.0
+#      Table format:     Format A
+#      Date:             2001 July 26
+#      Authors:          Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/>
+#
+#      Copyright (c) 1999-2001 Unicode, Inc.  All Rights reserved.
+#
+#      This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+#      No claims are made as to fitness for any particular purpose.  No
+#      warranties of any kind are expressed or implied.  The recipient
+#      agrees to determine applicability of information provided.  If this
+#      file has been provided on optical media by Unicode, Inc., the sole
+#      remedy for any claim will be exchange of defective media within 90
+#      days of receipt.
+#
+#      Unicode, Inc. hereby grants the right to freely use the information
+#      supplied in this file in the creation of products supporting the
+#      Unicode Standard, and to make copies of this file in any form for
+#      internal or external distribution as long as this notice remains
+#      attached.
+#
+#      General notes:
+#
+#      This table contains the data the Unicode Consortium has on how
+#       ISO/IEC 8859-16:2001 characters map into Unicode.
+#
+#      Format:  Three tab-separated columns
+#               Column #1 is the ISO/IEC 8859-16 code (in hex as 0xXX)
+#               Column #2 is the Unicode (in hex as 0xXXXX)
+#               Column #3 the Unicode name (follows a comment sign, '#')
+#
+#      The entries are in ISO/IEC 8859-16 order.
+#
+#      Updated versions of this file may be found in:
+#              <ftp://ftp.unicode.org/Public/MAPPINGS/>
+#
+#      Any comments or problems, contact <errata@unicode.org>
+#      Please note that <errata@unicode.org> is an archival address;
+#      notices will be checked, but do not expect an immediate response.
+#
+0x00   0x0000  #       NULL
+0x01   0x0001  #       START OF HEADING
+0x02   0x0002  #       START OF TEXT
+0x03   0x0003  #       END OF TEXT
+0x04   0x0004  #       END OF TRANSMISSION
+0x05   0x0005  #       ENQUIRY
+0x06   0x0006  #       ACKNOWLEDGE
+0x07   0x0007  #       BELL
+0x08   0x0008  #       BACKSPACE
+0x09   0x0009  #       HORIZONTAL TABULATION
+0x0A   0x000A  #       LINE FEED
+0x0B   0x000B  #       VERTICAL TABULATION
+0x0C   0x000C  #       FORM FEED
+0x0D   0x000D  #       CARRIAGE RETURN
+0x0E   0x000E  #       SHIFT OUT
+0x0F   0x000F  #       SHIFT IN
+0x10   0x0010  #       DATA LINK ESCAPE
+0x11   0x0011  #       DEVICE CONTROL ONE
+0x12   0x0012  #       DEVICE CONTROL TWO
+0x13   0x0013  #       DEVICE CONTROL THREE
+0x14   0x0014  #       DEVICE CONTROL FOUR
+0x15   0x0015  #       NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #       SYNCHRONOUS IDLE
+0x17   0x0017  #       END OF TRANSMISSION BLOCK
+0x18   0x0018  #       CANCEL
+0x19   0x0019  #       END OF MEDIUM
+0x1A   0x001A  #       SUBSTITUTE
+0x1B   0x001B  #       ESCAPE
+0x1C   0x001C  #       FILE SEPARATOR
+0x1D   0x001D  #       GROUP SEPARATOR
+0x1E   0x001E  #       RECORD SEPARATOR
+0x1F   0x001F  #       UNIT SEPARATOR
+0x20   0x0020  #       SPACE
+0x21   0x0021  #       EXCLAMATION MARK
+0x22   0x0022  #       QUOTATION MARK
+0x23   0x0023  #       NUMBER SIGN
+0x24   0x0024  #       DOLLAR SIGN
+0x25   0x0025  #       PERCENT SIGN
+0x26   0x0026  #       AMPERSAND
+0x27   0x0027  #       APOSTROPHE
+0x28   0x0028  #       LEFT PARENTHESIS
+0x29   0x0029  #       RIGHT PARENTHESIS
+0x2A   0x002A  #       ASTERISK
+0x2B   0x002B  #       PLUS SIGN
+0x2C   0x002C  #       COMMA
+0x2D   0x002D  #       HYPHEN-MINUS
+0x2E   0x002E  #       FULL STOP
+0x2F   0x002F  #       SOLIDUS
+0x30   0x0030  #       DIGIT ZERO
+0x31   0x0031  #       DIGIT ONE
+0x32   0x0032  #       DIGIT TWO
+0x33   0x0033  #       DIGIT THREE
+0x34   0x0034  #       DIGIT FOUR
+0x35   0x0035  #       DIGIT FIVE
+0x36   0x0036  #       DIGIT SIX
+0x37   0x0037  #       DIGIT SEVEN
+0x38   0x0038  #       DIGIT EIGHT
+0x39   0x0039  #       DIGIT NINE
+0x3A   0x003A  #       COLON
+0x3B   0x003B  #       SEMICOLON
+0x3C   0x003C  #       LESS-THAN SIGN
+0x3D   0x003D  #       EQUALS SIGN
+0x3E   0x003E  #       GREATER-THAN SIGN
+0x3F   0x003F  #       QUESTION MARK
+0x40   0x0040  #       COMMERCIAL AT
+0x41   0x0041  #       LATIN CAPITAL LETTER A
+0x42   0x0042  #       LATIN CAPITAL LETTER B
+0x43   0x0043  #       LATIN CAPITAL LETTER C
+0x44   0x0044  #       LATIN CAPITAL LETTER D
+0x45   0x0045  #       LATIN CAPITAL LETTER E
+0x46   0x0046  #       LATIN CAPITAL LETTER F
+0x47   0x0047  #       LATIN CAPITAL LETTER G
+0x48   0x0048  #       LATIN CAPITAL LETTER H
+0x49   0x0049  #       LATIN CAPITAL LETTER I
+0x4A   0x004A  #       LATIN CAPITAL LETTER J
+0x4B   0x004B  #       LATIN CAPITAL LETTER K
+0x4C   0x004C  #       LATIN CAPITAL LETTER L
+0x4D   0x004D  #       LATIN CAPITAL LETTER M
+0x4E   0x004E  #       LATIN CAPITAL LETTER N
+0x4F   0x004F  #       LATIN CAPITAL LETTER O
+0x50   0x0050  #       LATIN CAPITAL LETTER P
+0x51   0x0051  #       LATIN CAPITAL LETTER Q
+0x52   0x0052  #       LATIN CAPITAL LETTER R
+0x53   0x0053  #       LATIN CAPITAL LETTER S
+0x54   0x0054  #       LATIN CAPITAL LETTER T
+0x55   0x0055  #       LATIN CAPITAL LETTER U
+0x56   0x0056  #       LATIN CAPITAL LETTER V
+0x57   0x0057  #       LATIN CAPITAL LETTER W
+0x58   0x0058  #       LATIN CAPITAL LETTER X
+0x59   0x0059  #       LATIN CAPITAL LETTER Y
+0x5A   0x005A  #       LATIN CAPITAL LETTER Z
+0x5B   0x005B  #       LEFT SQUARE BRACKET
+0x5C   0x005C  #       REVERSE SOLIDUS
+0x5D   0x005D  #       RIGHT SQUARE BRACKET
+0x5E   0x005E  #       CIRCUMFLEX ACCENT
+0x5F   0x005F  #       LOW LINE
+0x60   0x0060  #       GRAVE ACCENT
+0x61   0x0061  #       LATIN SMALL LETTER A
+0x62   0x0062  #       LATIN SMALL LETTER B
+0x63   0x0063  #       LATIN SMALL LETTER C
+0x64   0x0064  #       LATIN SMALL LETTER D
+0x65   0x0065  #       LATIN SMALL LETTER E
+0x66   0x0066  #       LATIN SMALL LETTER F
+0x67   0x0067  #       LATIN SMALL LETTER G
+0x68   0x0068  #       LATIN SMALL LETTER H
+0x69   0x0069  #       LATIN SMALL LETTER I
+0x6A   0x006A  #       LATIN SMALL LETTER J
+0x6B   0x006B  #       LATIN SMALL LETTER K
+0x6C   0x006C  #       LATIN SMALL LETTER L
+0x6D   0x006D  #       LATIN SMALL LETTER M
+0x6E   0x006E  #       LATIN SMALL LETTER N
+0x6F   0x006F  #       LATIN SMALL LETTER O
+0x70   0x0070  #       LATIN SMALL LETTER P
+0x71   0x0071  #       LATIN SMALL LETTER Q
+0x72   0x0072  #       LATIN SMALL LETTER R
+0x73   0x0073  #       LATIN SMALL LETTER S
+0x74   0x0074  #       LATIN SMALL LETTER T
+0x75   0x0075  #       LATIN SMALL LETTER U
+0x76   0x0076  #       LATIN SMALL LETTER V
+0x77   0x0077  #       LATIN SMALL LETTER W
+0x78   0x0078  #       LATIN SMALL LETTER X
+0x79   0x0079  #       LATIN SMALL LETTER Y
+0x7A   0x007A  #       LATIN SMALL LETTER Z
+0x7B   0x007B  #       LEFT CURLY BRACKET
+0x7C   0x007C  #       VERTICAL LINE
+0x7D   0x007D  #       RIGHT CURLY BRACKET
+0x7E   0x007E  #       TILDE
+0x7F   0x007F  #       DELETE
+0x80   0x0080  #       <control>
+0x81   0x0081  #       <control>
+0x82   0x0082  #       <control>
+0x83   0x0083  #       <control>
+0x84   0x0084  #       <control>
+0x85   0x0085  #       <control>
+0x86   0x0086  #       <control>
+0x87   0x0087  #       <control>
+0x88   0x0088  #       <control>
+0x89   0x0089  #       <control>
+0x8A   0x008A  #       <control>
+0x8B   0x008B  #       <control>
+0x8C   0x008C  #       <control>
+0x8D   0x008D  #       <control>
+0x8E   0x008E  #       <control>
+0x8F   0x008F  #       <control>
+0x90   0x0090  #       <control>
+0x91   0x0091  #       <control>
+0x92   0x0092  #       <control>
+0x93   0x0093  #       <control>
+0x94   0x0094  #       <control>
+0x95   0x0095  #       <control>
+0x96   0x0096  #       <control>
+0x97   0x0097  #       <control>
+0x98   0x0098  #       <control>
+0x99   0x0099  #       <control>
+0x9A   0x009A  #       <control>
+0x9B   0x009B  #       <control>
+0x9C   0x009C  #       <control>
+0x9D   0x009D  #       <control>
+0x9E   0x009E  #       <control>
+0x9F   0x009F  #       <control>
+0xA0   0x00A0  #       NO-BREAK SPACE
+0xA1   0x0104  #       LATIN CAPITAL LETTER A WITH OGONEK
+0xA2   0x0105  #       LATIN SMALL LETTER A WITH OGONEK
+0xA3   0x0141  #       LATIN CAPITAL LETTER L WITH STROKE
+0xA4   0x20AC  #       EURO SIGN
+0xA5   0x201E  #       DOUBLE LOW-9 QUOTATION MARK
+0xA6   0x0160  #       LATIN CAPITAL LETTER S WITH CARON
+0xA7   0x00A7  #       SECTION SIGN
+0xA8   0x0161  #       LATIN SMALL LETTER S WITH CARON
+0xA9   0x00A9  #       COPYRIGHT SIGN
+0xAA   0x0218  #       LATIN CAPITAL LETTER S WITH COMMA BELOW
+0xAB   0x00AB  #       LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC   0x0179  #       LATIN CAPITAL LETTER Z WITH ACUTE
+0xAD   0x00AD  #       SOFT HYPHEN
+0xAE   0x017A  #       LATIN SMALL LETTER Z WITH ACUTE
+0xAF   0x017B  #       LATIN CAPITAL LETTER Z WITH DOT ABOVE
+0xB0   0x00B0  #       DEGREE SIGN
+0xB1   0x00B1  #       PLUS-MINUS SIGN
+0xB2   0x010C  #       LATIN CAPITAL LETTER C WITH CARON
+0xB3   0x0142  #       LATIN SMALL LETTER L WITH STROKE
+0xB4   0x017D  #       LATIN CAPITAL LETTER Z WITH CARON
+0xB5   0x201D  #       RIGHT DOUBLE QUOTATION MARK
+0xB6   0x00B6  #       PILCROW SIGN
+0xB7   0x00B7  #       MIDDLE DOT
+0xB8   0x017E  #       LATIN SMALL LETTER Z WITH CARON
+0xB9   0x010D  #       LATIN SMALL LETTER C WITH CARON
+0xBA   0x0219  #       LATIN SMALL LETTER S WITH COMMA BELOW
+0xBB   0x00BB  #       RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC   0x0152  #       LATIN CAPITAL LIGATURE OE
+0xBD   0x0153  #       LATIN SMALL LIGATURE OE
+0xBE   0x0178  #       LATIN CAPITAL LETTER Y WITH DIAERESIS
+0xBF   0x017C  #       LATIN SMALL LETTER Z WITH DOT ABOVE
+0xC0   0x00C0  #       LATIN CAPITAL LETTER A WITH GRAVE
+0xC1   0x00C1  #       LATIN CAPITAL LETTER A WITH ACUTE
+0xC2   0x00C2  #       LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0xC3   0x0102  #       LATIN CAPITAL LETTER A WITH BREVE
+0xC4   0x00C4  #       LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5   0x0106  #       LATIN CAPITAL LETTER C WITH ACUTE
+0xC6   0x00C6  #       LATIN CAPITAL LETTER AE
+0xC7   0x00C7  #       LATIN CAPITAL LETTER C WITH CEDILLA
+0xC8   0x00C8  #       LATIN CAPITAL LETTER E WITH GRAVE
+0xC9   0x00C9  #       LATIN CAPITAL LETTER E WITH ACUTE
+0xCA   0x00CA  #       LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+0xCB   0x00CB  #       LATIN CAPITAL LETTER E WITH DIAERESIS
+0xCC   0x00CC  #       LATIN CAPITAL LETTER I WITH GRAVE
+0xCD   0x00CD  #       LATIN CAPITAL LETTER I WITH ACUTE
+0xCE   0x00CE  #       LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0xCF   0x00CF  #       LATIN CAPITAL LETTER I WITH DIAERESIS
+0xD0   0x0110  #       LATIN CAPITAL LETTER D WITH STROKE
+0xD1   0x0143  #       LATIN CAPITAL LETTER N WITH ACUTE
+0xD2   0x00D2  #       LATIN CAPITAL LETTER O WITH GRAVE
+0xD3   0x00D3  #       LATIN CAPITAL LETTER O WITH ACUTE
+0xD4   0x00D4  #       LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xD5   0x0150  #       LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+0xD6   0x00D6  #       LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7   0x015A  #       LATIN CAPITAL LETTER S WITH ACUTE
+0xD8   0x0170  #       LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+0xD9   0x00D9  #       LATIN CAPITAL LETTER U WITH GRAVE
+0xDA   0x00DA  #       LATIN CAPITAL LETTER U WITH ACUTE
+0xDB   0x00DB  #       LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xDC   0x00DC  #       LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD   0x0118  #       LATIN CAPITAL LETTER E WITH OGONEK
+0xDE   0x021A  #       LATIN CAPITAL LETTER T WITH COMMA BELOW
+0xDF   0x00DF  #       LATIN SMALL LETTER SHARP S
+0xE0   0x00E0  #       LATIN SMALL LETTER A WITH GRAVE
+0xE1   0x00E1  #       LATIN SMALL LETTER A WITH ACUTE
+0xE2   0x00E2  #       LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3   0x0103  #       LATIN SMALL LETTER A WITH BREVE
+0xE4   0x00E4  #       LATIN SMALL LETTER A WITH DIAERESIS
+0xE5   0x0107  #       LATIN SMALL LETTER C WITH ACUTE
+0xE6   0x00E6  #       LATIN SMALL LETTER AE
+0xE7   0x00E7  #       LATIN SMALL LETTER C WITH CEDILLA
+0xE8   0x00E8  #       LATIN SMALL LETTER E WITH GRAVE
+0xE9   0x00E9  #       LATIN SMALL LETTER E WITH ACUTE
+0xEA   0x00EA  #       LATIN SMALL LETTER E WITH CIRCUMFLEX
+0xEB   0x00EB  #       LATIN SMALL LETTER E WITH DIAERESIS
+0xEC   0x00EC  #       LATIN SMALL LETTER I WITH GRAVE
+0xED   0x00ED  #       LATIN SMALL LETTER I WITH ACUTE
+0xEE   0x00EE  #       LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF   0x00EF  #       LATIN SMALL LETTER I WITH DIAERESIS
+0xF0   0x0111  #       LATIN SMALL LETTER D WITH STROKE
+0xF1   0x0144  #       LATIN SMALL LETTER N WITH ACUTE
+0xF2   0x00F2  #       LATIN SMALL LETTER O WITH GRAVE
+0xF3   0x00F3  #       LATIN SMALL LETTER O WITH ACUTE
+0xF4   0x00F4  #       LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5   0x0151  #       LATIN SMALL LETTER O WITH DOUBLE ACUTE
+0xF6   0x00F6  #       LATIN SMALL LETTER O WITH DIAERESIS
+0xF7   0x015B  #       LATIN SMALL LETTER S WITH ACUTE
+0xF8   0x0171  #       LATIN SMALL LETTER U WITH DOUBLE ACUTE
+0xF9   0x00F9  #       LATIN SMALL LETTER U WITH GRAVE
+0xFA   0x00FA  #       LATIN SMALL LETTER U WITH ACUTE
+0xFB   0x00FB  #       LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC   0x00FC  #       LATIN SMALL LETTER U WITH DIAERESIS
+0xFD   0x0119  #       LATIN SMALL LETTER E WITH OGONEK
+0xFE   0x021B  #       LATIN SMALL LETTER T WITH COMMA BELOW
+0xFF   0x00FF  #       LATIN SMALL LETTER Y WITH DIAERESIS
index 82a254e562fa9a5f36e7681f4fa83c2d957641a9..7d7d9d1f4826a7f9442e56433f06d4e6a43a11db 100644 (file)
@@ -112,7 +112,7 @@ class html2text
         "/[\n\t]+/",                             // Newlines and tabs
         '/<script[^>]*>.*?<\/script>/i',         // <script>s -- which strip_tags supposedly has problems with
         //'/<!-- .* -->/',                         // Comments -- which strip_tags might have problem a with
-        '/<a href="([^"]+)"[^>]*>(.+?)<\/a>/ie', // <a href="">
+        '/<a [^>]*href=("|\')([^"\']+)\1[^>]*>(.+?)<\/a>/ie', // <a href="">
         '/<h[123][^>]*>(.+?)<\/h[123]>/ie',      // H1 - H3
         '/<h[456][^>]*>(.+?)<\/h[456]>/ie',      // H4 - H6
         '/<p[^>]*>/i',                           // <P>
@@ -126,19 +126,18 @@ class html2text
         '/(<table[^>]*>|<\/table>)/i',           // <table> and </table>
         '/(<tr[^>]*>|<\/tr>)/i',                 // <tr> and </tr>
         '/<td[^>]*>(.+?)<\/td>/i',               // <td> and </td>
-        '/<th[^>]*>(.+?)<\/th>/i',               // <th> and </th>
+        '/<th[^>]*>(.+?)<\/th>/ie',              // <th> and </th>
         '/&nbsp;/i',
         '/&quot;/i',
         '/&gt;/i',
         '/&lt;/i',
-        '/&amp;/i',
+        '/&(amp|#38);/i',
         '/&copy;/i',
         '/&trade;/i',
         '/&#8220;/',
         '/&#8221;/',
         '/&#8211;/',
-        '/&#8217;/',
-        '/&#38;/',
+        '/&#(8217|39);/',
         '/&#169;/',
         '/&#8482;/',
         '/&#151;/',
@@ -161,11 +160,11 @@ class html2text
         '',                                     // Non-legal carriage return
         ' ',                                    // Newlines and tabs
         '',                                     // <script>s -- which strip_tags supposedly has problems with
-        //'',                                     // Comments -- which strip_tags might have problem a with
-        '$this->_build_link_list("\\1", "\\2")', // <a href="">
+        //'',                                  // Comments -- which strip_tags might have problem a with
+        '$this->_build_link_list("\\2", "\\3")', // <a href="">
         "strtoupper(\"\n\n\\1\n\n\")",          // H1 - H3
-        "ucwords(\"\n\n\\1\n\n\")",             // H4 - H6
-        "\n\n\t",                               // <P>
+        "ucwords(\"\n\n\\1\n\")",               // H4 - H6
+        "\n\n",                                 // <P>
         "\n",                                   // <br>
         'strtoupper("\\1")',                    // <b>
         '_\\1_',                                // <i>
@@ -188,7 +187,6 @@ class html2text
         '"',
         '-',
         "'",
-        '&',
         '(c)',
         '(tm)',
         '--',
@@ -234,6 +232,15 @@ class html2text
      *  @see _build_link_list()
      */
     var $_link_list = array();
+    
+    /**
+     * Boolean flag, true if a table of link URLs should be listed after the text.
+     * 
+     * @var boolean $_do_links
+     * @access private
+     * @see html2text()
+     */
+    var $_do_links = true;
 
     /**
      *  Constructor.
@@ -244,15 +251,17 @@ class html2text
      *
      *  @param string $source HTML content
      *  @param boolean $from_file Indicates $source is a file to pull content from
+     *  @param boolean $do_link_table indicate whether a table of link URLs is desired
      *  @access public
      *  @return void
      */
-    function html2text( $source = '', $from_file = false )
+    function html2text( $source = '', $from_file = false, $produce_link_table = true )
     {
         if ( !empty($source) ) {
             $this->set_html($source, $from_file);
         }
         $this->set_base_url();
+        $this->_do_links = $produce_link_table;
     }
 
     /**
@@ -411,6 +420,8 @@ class html2text
     */
     function _build_link_list($link, $display)
       {
+      if (! $this->_do_links) return $display;
+
       $link_lc = strtolower($link);
       
       if (substr($link_lc, 0, 7) == 'http://' || substr($link_lc, 0, 8) == 'https://' || substr($link_lc, 0, 7) == 'mailto:')
index 2c07f3409ac2ffc5aed115a4d65db2dbc31e2230..6bc47a198332a69da598f83afd8542688a169905 100644 (file)
@@ -39,6 +39,7 @@
                - Added BCC and REFERENCE to the list of headers to fetch in iil_C_FetchHeaders()
                - Leave messageID unchanged in iil_C_FetchHeaders()
                - Avoid stripslahes in iil_Connect()
+               - Escape quotes and backslashes in iil_C_Login()
                - Added patch to iil_SortHeaders() by Richard Green
                - Removed <br> from error messages (better for logging)
                - Added patch to iil_C_Sort() enabling UID SORT commands
@@ -46,6 +47,7 @@
                - Casting date parts in iil_StrToTime() to avoid mktime() warnings
                - Also acceppt LIST responses in iil_C_ListSubscribed()
                - Sanity check of $message_set in iil_C_FetchHeaders(), iil_C_FetchHeaderIndex(), iil_C_FetchThreadHeaders()
+               - Implemented UID FETCH in iil_C_FetchHeaders()
                - Removed some debuggers (echo ...)
 
 ********************************************************/
@@ -224,8 +226,9 @@ function iil_C_Authenticate(&$conn, $user, $pass, $encChallenge){
 
 function iil_C_Login(&$conn, $user, $password){
 
+    $password = strtr($password, array('"'=>'\\"', '\\' => '\\\\'));  
     fputs($conn->fp, "a001 LOGIN $user \"$password\"\r\n");
-               
+
        do{
            $line = iil_ReadReply($conn->fp);
        }while(!iil_StartsWith($line, "a001 "));
@@ -1195,7 +1198,7 @@ function iil_IndexThreads(&$tree){
        return $t_index;
 }
 
-function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
+function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false){
        global $IMAP_USE_INTERNAL_DATE;
        
        $c=0;
@@ -1231,7 +1234,8 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
 
        /* FETCH date,from,subject headers */
        $key="fh".($c++);
-       $request=$key." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCE)])\r\n";
+       $prefix=$uidfetch?" UID":"";
+       $request=$key.$prefix." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCE)])\r\n";
 
        if (!fputs($fp, $request)) return false;
        do{
@@ -1309,7 +1313,7 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
                Sample reply line: "* 3 FETCH (UID 2417 RFC822.SIZE 2730 FLAGS (\Seen \Deleted))"
        */
        $command_key="fh".($c++);
-       $request= $command_key." FETCH $message_set (UID RFC822.SIZE FLAGS INTERNALDATE)\r\n";
+       $request= $command_key.$prefix." FETCH $message_set (UID RFC822.SIZE FLAGS INTERNALDATE)\r\n";
        if (!fputs($fp, $request)) return false;
        do{
                $line=chop(iil_ReadLine($fp, 200));
@@ -1401,10 +1405,10 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
 }
 
 
-function iil_C_FetchHeader(&$conn, $mailbox, $id){
+function iil_C_FetchHeader(&$conn, $mailbox, $id, $uidfetch=false){
        $fp = $conn->fp;
-       $a=iil_C_FetchHeaders($conn, $mailbox, $id);
-       if (is_array($a)) return $a[$id];
+       $a=iil_C_FetchHeaders($conn, $mailbox, $id, $uidfetch);
+       if (is_array($a)) return array_shift($a);
        else return false;
 }
 
@@ -1885,7 +1889,7 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part, $mode){
                 $remaining = $bytes - $received;
                 $line = iil_ReadLine($fp, 1024);
                 $len = strlen($line);
-                if ($len > $remaining) substr($line, 0, $remaining);
+                if ($len > $remaining) $line = substr($line, 0, $remaining);
                 $received += strlen($line);
                 if ($mode==1) $result .= chop($line)."\n";
                 else if ($mode==2){ echo chop($line)."\n"; flush(); }
index ad6561ed78f3540cae7811bad6b565e2bf131765..75c2d40d9f1c77376ba53013a06bd67be4fb9667 100644 (file)
@@ -108,7 +108,7 @@ function iml_GetPartArray($a, $part){
                }
                //echo "s - part: $part rest: $rest array: ".implode(" ", $a)."<br>\n";
                if (is_array($a[$part-1])) return $a[$part-1];
-               else return false;
+               else return $a;
        }else if (($part==0) || (empty($part))){
                return $a;
        }
diff --git a/program/lib/rc_mail_mime.inc b/program/lib/rc_mail_mime.inc
new file mode 100644 (file)
index 0000000..12d80bb
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/lib/rc_mime.inc                                               |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2007, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Extend PEAR:Mail_mime class and override encodeHeaders method       |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com>                        |
+ +-----------------------------------------------------------------------+
+
+ $Id: sendmail.inc 506 2007-03-14 00:39:51Z thomasb $
+
+*/
+
+// require Mail_mime class 1.4.0
+require_once('Mail/mime.php');
+
+
+class rc_mail_mime extends Mail_mime
+{
+  
+  /**
+   * Adds an image to the list of embedded images.
+   *
+   * @param  string  $file       The image file name OR image data itself
+   * @param  string  $c_type     The content type
+   * @param  string  $name       The filename of the image.
+   *                             Only use if $file is the image data
+   * @param  bool    $isfilename Whether $file is a filename or not
+   *                             Defaults to true
+   * @param  string  $contentid  Desired Content-ID of MIME part
+   *                             Defaults to generated unique ID
+   * @return mixed   true on success or PEAR_Error object
+   * @access public
+   */
+  function addHTMLImage($file, $c_type='application/octet-stream', $name = '', $isfilename = true, $contentid = '')
+  {
+    $filedata = ($isfilename === true) ? $this->_file2str($file) : $file;
+    if ($isfilename === true)
+      $filename = ($name == '' ? $file : $name);
+    else
+      $filename = $name;
+
+    if (PEAR::isError($filedata))
+        return $filedata;
+
+    if ($contentid == '')
+       $contentid = md5(uniqid(time()));
+
+    $this->_html_images[] = array(
+      'body'   => $filedata,
+      'name'   => $filename,
+      'c_type' => $c_type,
+      'cid'    => $contentid
+    );
+
+    return true;
+  }
+
+  
+  /**
+  * returns the HTML body portion of the message
+  * @return string HTML body of the message
+  * @access public
+  */
+  function getHTMLBody()
+  {
+     return $this->_htmlbody;
+  }
+  
+  
+  /**
+   * Encodes a header as per RFC2047
+   *
+   * @param  array $input The header data to encode
+   * @param  array $params Extra build parameters
+   * @return array Encoded data
+   * @access private
+   * @override
+   */
+  function _encodeHeaders($input, $params = array())
+  {
+    $maxlen = 73;
+    $params += $this->_build_params;
+    
+    foreach ($input as $hdr_name => $hdr_value)
+    {
+      // if header contains e-mail addresses
+      if (preg_match('/\s<.+@[a-z0-9\-\.]+\.[a-z]+>/U', $hdr_value))
+        $chunks = $this->_explode_quoted_string(',', $hdr_value);
+      else
+        $chunks = array($hdr_value);
+
+      $hdr_value = '';
+      $line_len = 0;
+
+      foreach ($chunks as $i => $value)
+      {
+        $value = trim($value);
+
+        //This header contains non ASCII chars and should be encoded.
+        if (preg_match('#[\x80-\xFF]{1}#', $value))
+        {
+          $suffix = '';
+          // Don't encode e-mail address
+          if (preg_match('/(.+)\s(<.+@[a-z0-9\-\.]+>)$/Ui', $value, $matches))
+          {
+            $value = $matches[1];
+            $suffix = ' '.$matches[2];
+          }
+
+          switch ($params['head_encoding'])
+          {
+            case 'base64':
+            // Base64 encoding has been selected.
+            $mode = 'B';
+            $encoded = base64_encode($value);
+            break;
+
+            case 'quoted-printable':
+            default:
+            // quoted-printable encoding has been selected
+            $mode = 'Q';
+            $encoded = preg_replace('/([\x2C\x3F\x80-\xFF])/e', "'='.sprintf('%02X', ord('\\1'))", $value);
+            // replace spaces with _
+            $encoded = str_replace(' ', '_', $encoded);
+          }
+
+          $value = '=?' . $params['head_charset'] . '?' . $mode . '?' . $encoded . '?=' . $suffix;
+        }
+
+        // add chunk to output string by regarding the header maxlen
+        $len = strlen($value);
+        if ($line_len + $len < $maxlen)
+        {
+          $hdr_value .= ($i>0?', ':'') . $value;
+          $line_len += $len + ($i>0?2:0);
+        }
+        else
+        {
+          $hdr_value .= ($i>0?', ':'') . "\n " . $value;
+          $line_len = $len;
+        }
+      }
+
+      $input[$hdr_name] = $hdr_value;
+    }
+
+    return $input;
+  }
+
+
+  function _explode_quoted_string($delimiter, $string)
+  {
+    $result = array();
+    $strlen = strlen($string);
+    for ($q=$p=$i=0; $i < $strlen; $i++)
+    {
+      if ($string{$i} == "\"" && $string{$i-1} != "\\")
+        $q = $q ? false : true;
+      else if (!$q && $string{$i} == $delimiter)
+      {
+        $result[] = substr($string, $p, $i - $p);
+        $p = $i + 1;
+      }
+    }
+    
+    $result[] = substr($string, $p);
+    return $result;
+  }
+
+}
+
+?>
\ No newline at end of file
index a887958cf67534c25b53f6047538033dff5175fe..9ea5f6db5aac185ce2c05e3826581250841f48a2 100644 (file)
 <?php
-//
-//
-//      utf7.inc - Routines to encode bytes to UTF7 and decode UTF7 strings
-//
-//      Copyright (C)  1999, 2002  Ziberex and Torben Rybner
-//
-//
-//      Version 1.01    2002-06-08      19:00
-//
-//      - Adapted for use in IlohaMail (modified UTF-7 decoding)
-//      - Converted from C to PHP4
-//
-//
-//      Version 1.00    1999-09-03      19:00
-//
-//      - Encodes bytes to UTF7 strings
-//          *OutString = '\0';
-//          StartBase64Encode();
-//          for (CP = InString;  *CP;  CP++)
-//            strcat(OutString, Base64Encode(*CP));
-//          strcat(OutString, StopBase64Encode());
-//      - Decodes Base64 strings to bytes
-//          StartBase64Decode();
-//          for (CP1 = InString, CP2 = OutString;  *CP1 && (*CP1 != '=');  CP1++)
-//            CP2 += Base64Decode(*CP1, CP2);
-//          StopBase64Decode();
-//
 
-$BASE64LENGTH              =  60;
-
-$BASE64DECODE_NO_DATA      = -1;
-$BASE64DECODE_EMPTY_DATA   = -2;
-$BASE64DECODE_INVALID_DATA = -3;
-
-
-//
-//
-//      Used for conversion to UTF7
-//
-$_ToUTF7 = array
-(
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
- 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
- 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', ','
-);
-
-//
-//
-//      Used for conversion from UTF7
-//      (0x80 => Illegal, 0x40 => CR/LF)
-//
-$_FromUTF7 = array
-(
-  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,       // 00 - 07 - Ctrl -
-  0x80, 0x80, 0x40, 0x80, 0x80, 0x40, 0x80, 0x80,       // 08 - 0F - Ctrl -
-  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,       // 10 - 17 - Ctrl -
-  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,       // 18 - 1F - Ctrl -
-  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,       // 20 - 27  !"#$%&'
-  0x80, 0x80, 0x80, 0x3E, 0x3F, 0x80, 0x80, 0x3F,       // 28 - 2F ()*+,-./
-  0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,       // 30 - 37 01234567
-  0x3C, 0x3D, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80,       // 38 - 3F 89:;<=>?
-  0x80, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,       // 40 - 47 @ABCDEFG
-  0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,       // 48 - 4F HIJKLMNO
-  0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,       // 50 - 57 PQRSTUVW
-  0x17, 0x18, 0x19, 0x80, 0x80, 0x80, 0x80, 0x80,       // 58 - 5F XYZ[\]^_
-  0x80, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,       // 60 - 67 `abcdefg
-  0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,       // 68 - 6F hijklmno
-  0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,       // 70 - 77 pqrstuvw
-  0x31, 0x32, 0x33, 0x80, 0x80, 0x80, 0x80, 0x80,       // 78 - 7F xyz{|}~
-);
-
-
-//
-//
-//      UTF7EncodeInit:
-//
-//      Start the encoding of bytes
-//
-function UTF7EncodeInit(&$Context)
-{
-  $Context[ "Data" ]  = "";
-  $Context[ "Count" ] = 0;
-  $Context[ "Pos" ]   = 0;
-  $Context[ "State" ] = 0;
-} // UTF7EncodeInit
-
-
-//
-//
-//      UTF7EncodeByte:
-//
-//      Encodes one byte to UTF7
-//
-function UTF7EncodeByte(&$Context, $Byte)
-{
-  global $_ToUTF7;
-
-  $Byte = ord($Byte);
-  switch ($Context[ "State" ])
-  {
-    case 0:
-      // Convert into a byte
-      $Context[ "Data" ] = $_ToUTF7[ $Byte >> 2 ];
-      $Context[ "Pos" ]++;
-      // Save residue for next converted byte
-      $Context[ "Residue" ] = ($Byte & 0x03) << 4;
-      // This is the first byte in this line
-      $Context[ "Count" ] = 1;
-      // Next state is 1
-      $Context[ "State" ] = 1;
-      break;
-    case 1:
-      // Convert into a byte
-      $Context[ "Data" ] .= $_ToUTF7[ $Context[ "Residue" ] | ($Byte >> 4) ];
-      $Context[ "Pos" ]++;
-      // Save residue for next converted byte
-      $Context[ "Residue" ] = ($Byte & 0x0F) << 2;
-      // Bumb byte counter
-      $Context[ "Count" ]++;
-      // Next state is 2
-      $Context[ "State" ] = 2;
-      break;
-    case 2:
-      // Convert into a byte
-      $Context[ "Data" ] .= $_ToUTF7[ $Context[ "Residue" ] | ($Byte >> 6) ];
-      $Context[ "Pos" ]++;
-      // Residue fits precisely into the next byte
-      $Context[ "Data" ] .= $_ToUTF7[ $Byte & 0x3F ];
-      $Context[ "Pos" ]++;
-      // Bumb byte counter
-      $Context[ "Count" ]++;
-      // Next state is 3
-      $Context[ "State" ] = 3;
-      break;
-
-    case 3:
-      // Convert into a byte
-      $Context[ "Data" ] .= $_ToUTF7[ $Byte >> 2 ];
-      $Context[ "Pos" ]++;
-      // Save residue for next converted byte
-      $Context[ "Residue" ] = ($Byte & 0x03) << 4;
-      // Bumb byte counter
-      $Context[ "Count" ]++;
-      // Next state is 1
-      $Context[ "State" ] = 1;
-      break;
-    default:
-      // printf("Internal error in UTF7Encode: State is %d\n", $Context[ "State" ]);
-      // exit(1);
-      break;
-  }
-} // UTF7EncodeByte
-
-
-//
-//
-//      UTF7EncodeFinal:
-//
-//      Terminates the encoding of bytes
-//
-function UTF7EncodeFinal(&$Context)
-{
-  if ($Context[ "State" ] == 0)
-    return "";
-  if ($Context[ "State" ] != 3)
-    UTF7EncodeByte($Context, "\0");
-  return $Context[ "Data" ];
-} // UTF7EncodeFinal
-
-
-//
-//
-//      UTF7EncodeString
-//
-//      Encodes a string to modified UTF-7 format
-//
-function UTF7EncodeString($String)
+/*
+ *  Copyright (C) 2000 Edmund Grimley Evans <edmundo@rano.org>
+ * 
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ * 
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  Translated from C to PHP by Thomas Bruederli <roundcube@gmail.com>
+ */ 
+
+
+/**
+ * Convert the data ($str) from RFC 2060's UTF-7 to UTF-8.
+ * If input data is invalid, return the original input string.
+ * RFC 2060 obviously intends the encoding to be unique (see
+ * point 5 in section 5.1.3), so we reject any non-canonical
+ * form, such as &ACY- (instead of &-) or &AMA-&AMA- (instead
+ * of &AMAAwA-).
+ */
+function utf7_to_utf8($str)
 {
-  // Not during encoding, yet
-  $Encoding = false;
-  // Go through the string
-  for ($I = 0;  $I < strlen($String);  $I++)
+  $Index_64 = array(
+      -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+      -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+      -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, 63,-1,-1,-1,
+      52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1,
+      -1, 0, 1, 2,  3, 4, 5, 6,  7, 8, 9,10, 11,12,13,14,
+      15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+      -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+      41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+  );
+
+  $u7len = strlen($str);
+  $p = $err = '';
+
+  for ($i=0; $u7len > 0; $i++, $u7len--)
   {
-    $Ch = substr($String, $I, 1);
-    if (ord($Ch) > 0x7F)
+    $u7 = $str{$i};
+    if ($u7 == '&')
     {
-      if (! $Encoding)
+      $i++;
+      $u7len--;
+      $u7 = $str{$i};
+      
+      if ($u7len && $u7 == '-')
       {
-        $RetVal .= "&";
-        $Encoding = true;
-        // Initialise UTF7 context
-        UTF7EncodeInit($Context);
+        $p .= '&';
+        continue;
       }
-      UTF7EncodeByte($Context, "\0");
-      UTF7EncodeByte($Context, $Ch);
-    }
-    elseif ($Ch == "&")
-    {
-      if (! $Encoding)
-      {
-        $RetVal .= "&";
-        $Encoding = true;
-        // Initialise UTF7 context
-        UTF7EncodeInit($Context);
-      }
-      else
+
+      $ch = 0;
+      $k = 10;
+      for (; $u7len > 0; $i++, $u7len--)
       {
-        UTF7EncodeByte($Context, "\0");
-        UTF7EncodeByte($Context, $Ch);
+        $u7 = $str{$i};
+
+        if ((ord($u7) & 0x80) || ($b = $Index_64[ord($u7)]) == -1)
+          break;
+
+        if ($k > 0)
+        {
+          $ch |= $b << $k;
+          $k -= 6;
+        }
+        else
+        {
+          $ch |= $b >> (-$k);
+          if ($ch < 0x80)
+          {
+            /* Printable US-ASCII */
+            if (0x20 <= $ch && $ch < 0x7f)
+              return $err;
+           $p .= chr($ch);
+          }
+          else if ($ch < 0x800)
+          {
+            $p .= chr(0xc0 | ($ch >> 6));
+            $p .= chr(0x80 | ($ch & 0x3f));
+          }
+          else
+          {
+            $p .= chr(0xe0 | ($ch >> 12));
+            $p .= chr(0x80 | (($ch >> 6) & 0x3f));
+            $p .= chr(0x80 | ($ch & 0x3f));
+          }
+
+          $ch = ($b << (16 + $k)) & 0xffff;
+          $k += 10;
+        }
       }
+
+      /* Non-zero or too many extra bits */
+      if ($ch || $k < 6)
+        return $err;
+        
+      /* BASE64 not properly terminated */
+      if (!$u7len || $u7 != '-')
+        return $err;
+        
+      /* Adjacent BASE64 sections */
+      if ($u7len > 2 && $str{$i+1} == '&' && $str{$i+2} != '-')
+        return $err;
     }
+    /* Not printable US-ASCII */
+    else if (ord($u7) < 0x20 || ord($u7) >= 0x7f)
+      return $err;
     else
-    {
-      if ($Encoding)
-      {
-        $RetVal .= UTF7EncodeFinal($Context) . "-$Ch";
-        $Encoding = false;
-      }
-      else
-        $RetVal .= $Ch;
-    }
+      $p .= $u7;
   }
-  if ($Encoding)
-    $RetVal .= UTF7EncodeFinal($Context) . "-";
-  return $RetVal;
-} // UTF7EncodeString
-
 
-//
-//
-//      UTF7DecodeInit:
-//
-//      Start the decoding of bytes
-//
-function UTF7DecodeInit(&$Context)
-{
-  $Context[ "Data" ]  = "";
-  $Context[ "State" ] = 0;
-  $Context[ "Pos" ]   = 0;
-} // UTF7DecodeInit
+  return $p;
+}
 
 
-//
-//
-//      UTF7DecodeByte:
-//
-//      Decodes one character from UTF7
-//
-function UTF7DecodeByte(&$Context, $Byte)
+/**
+ * Convert the data ($str) from UTF-8 to RFC 2060's UTF-7.
+ * Unicode characters above U+FFFF are replaced by U+FFFE.
+ * If input data is invalid, return an empty string.
+ */
+function utf8_to_utf7($str)
 {
-  global $BASE64DECODE_INVALID_DATA;
-  global $_FromUTF7;
-
-  // Restore bits
-  $Byte = $_FromUTF7[ ord($Byte) ];
-  // Ignore carriage returns and linefeeds
-  if ($Byte == 0x40)
-    return "";
-  // Invalid byte - Tell caller!
-  if ($Byte == 0x80)
-    $Context[ "Count" ] = $BASE64DECODE_INVALID_DATA;
-  switch ($Context[ "State" ])
+  $B64Chars = array(
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
+    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
+    'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+    't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
+    '8', '9', '+', ','
+  );
+
+  $u8len = strlen($str);
+  $base64 = $i = 0;
+  $p = $err = '';
+
+  while ($u8len)
   {
-    case 0:
-      // Save residue
-      $Context[ "Residue" ] = $Byte;
-      // Initialise count
-      $Context[ "Count" ] = 0;
-      // Next state
-      $Context[ "State" ] = 1;
-      break;
-
-    case 1:
-      // Store byte
-      $Context[ "Data" ] .= chr(($Context[ "Residue" ] << 2) | ($Byte >> 4));
-      $Context[ "Pos" ]++;
-      // Update count
-      $Context[ "Count" ]++;
-      // Save residue
-      $Context[ "Residue" ] = $Byte;
-      // Next state
-      $Context[ "State" ] = 2;
-      break;
-
-    case 2:
-      // Store byte
-      $Context[ "Data" ] .= chr(($Context[ "Residue" ] << 4) | ($Byte >> 2));
-      $Context[ "Pos" ]++;
-      // Update count
-      $Context[ "Count" ]++;
-      // Save residue
-      $Context[ "Residue" ] = $Byte;
-      // Next state
-      $Context[ "State" ] = 3;
-      break;
-
-    case 3:
-      // Store byte
-      $Context[ "Data" ] .= chr(($Context[ "Residue" ] << 6) | $Byte);
-      $Context[ "Pos" ]++;
-      // Update count
-      $Context[ "Count" ]++;
-      // Next state
-      $Context[ "State" ] = 4;
-      break;
+    $u8 = $str{$i};
+    $c = ord($u8);
+    
+    if ($c < 0x80)
+    {
+      $ch = $c;
+      $n = 0;
+    }
+    else if ($c < 0xc2)
+      return $err;
+    else if ($c < 0xe0)
+    {
+      $ch = $c & 0x1f;
+      $n = 1;
+    }
+    else if ($c < 0xf0)
+    {
+      $ch = $c & 0x0f;
+      $n = 2;
+    }
+    else if ($c < 0xf8)
+    {
+      $ch = $c & 0x07;
+      $n = 3;
+    }
+    else if ($c < 0xfc)
+    {
+      $ch = $c & 0x03;
+      $n = 4;
+    }
+    else if ($c < 0xfe)
+    {
+      $ch = $c & 0x01;
+      $n = 5;
+    }
+    else
+      return $err;
 
-    case 4:
-      // Save residue
-      $Context[ "Residue" ] = $Byte;
-      // Next state
-      $Context[ "State" ] = 1;
-      break;
-  }
-} // UTF7DecodeByte
+    $i++;
+    $u8len--;
 
+    if ($n > $u8len)
+      return $err;
 
-//
-//
-//      UTF7DecodeFinal:
-//
-//      Decodes one character from UTF7
-//
-function UTF7DecodeFinal(&$Context)
-{
-  // Buffer not empty - Return remainder!
-  if ($Context[ "Count" ])
-  {
-    $Context[ "Pos" ] = 0;
-    $Context[ "State" ] = 0;
-    return $Context[ "Data" ];
-  }
-  return "";
-} // UTF7DecodeFinal
-
-
-//
-//
-//      UTF7DecodeString
-//
-//      Converts a string encoded in modified UTF-7 encoding
-//      to ISO 8859-1.
-//      OBS: Works only for valid ISO 8859-1 characters in the
-//      encoded data
-//
-function UTF7DecodeString($String)
-{
-  $Decoding = false;
-  for ($I = 0;  $I < strlen($String);  $I++)
-  {
-    $Ch = substr($String, $I, 1);
-    if ($Decoding)
+    for ($j=0; $j < $n; $j++)
     {
-      if ($Ch == "-")
-      {
-        $RetVal .= UTF7DecodeFinal($Context);
-        $Decoding = false;
-      }
-      else
-        UTF7DecodeByte($Context, $Ch);
+      $o = ord($str{$i+$j});
+      if (($o & 0xc0) != 0x80)
+        return $err;
+      $ch = ($ch << 6) | ($o & 0x3f);
     }
-    elseif ($Ch == "&")
+    
+    if ($n > 1 && !($ch >> ($n * 5 + 1)))
+      return $err;
+    
+    $i += $n;
+    $u8len -= $n;
+
+    if ($ch < 0x20 || $ch >= 0x7f)
     {
-      if (($I < strlen($String) - 1) && (substr($String, $I + 1, 1) == "-"))
+      if (!$base64)
       {
-        $RetVal .= $Ch;
-        $I++;
+        $p .= '&';
+        $base64 = 1;
+        $b = 0;
+        $k = 10;
       }
-      else
+      if ($ch & ~0xffff)
+        $ch = 0xfffe;
+      
+      $p .= $B64Chars[($b | $ch >> $k)];
+      $k -= 6;
+      for (; $k >= 0; $k -= 6)
+        $p .= $B64Chars[(($ch >> $k) & 0x3f)];
+
+      $b = ($ch << (-$k)) & 0x3f;
+      $k += 16;
+    }
+    else
+    {
+      if ($base64)
       {
-        UTF7DecodeInit($Context);
-        $Decoding = true;
+        if ($k > 10)
+          $p .= $B64Chars[$b];
+        $p .= '-';
+        $base64 = 0;
       }
+      
+      $p .= chr($ch);
+      if (chr($ch) == '&')
+        $p .= '-';
     }
-    else
-      $RetVal .= $Ch;
   }
-  return str_replace("\0", "", $RetVal);
-} // UTF7DecodeString
+
+  if ($base64)
+  {
+    if ($k > 10)
+      $p .= $B64Chars[$b];
+    $p .= '-';
+  }
+
+  return $p;
+}
+
 ?>
index c0bd0a73beeb17d06b57e486003cea2cafe3925d..3371c25a80c72fca74b6282faed1a1d39dbc0eb9 100644 (file)
@@ -50,7 +50,13 @@ $utf8_maps = array(
   "ISO-8859-1" => UTF8_MAP_DIR . "/ISO-8859-1.map",
   "ISO-8859-2" => UTF8_MAP_DIR . "/ISO-8859-2.map",
   "ISO-8859-3" => UTF8_MAP_DIR . "/ISO-8859-3.map",
-  "ISO-8859-4" => UTF8_MAP_DIR . "/ISO-8859-4.map");
+  "ISO-8859-4" => UTF8_MAP_DIR . "/ISO-8859-4.map",
+  "ISO-8859-5" => UTF8_MAP_DIR . "/ISO-8859-5.map",
+  "ISO-8859-6" => UTF8_MAP_DIR . "/ISO-8859-6.map",
+  "ISO-8859-7" => UTF8_MAP_DIR . "/ISO-8859-7.map",
+  "ISO-8859-8" => UTF8_MAP_DIR . "/ISO-8859-8.map",
+  "ISO-8859-9" => UTF8_MAP_DIR . "/ISO-8859-9.map"
+  );
 
 //Error constants
 define("ERR_OPEN_MAP_FILE","ERR_OPEN_MAP_FILE");
diff --git a/program/localization/am/labels.inc b/program/localization/am/labels.inc
new file mode 100755 (executable)
index 0000000..b25a2cd
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/am/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Vahan Yerkanian <vahan@arminco.com>                           |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 552 2007-05-03 20:48:00Z yllar $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Բարի գալուստ $product';
+$labels['username'] = 'Օգտվող';
+$labels['password'] = 'Գաղտնաբառ';
+$labels['server'] = 'Սերվեր';
+$labels['login'] = 'Մուտք';
+$labels['logout'] = 'Ելք';
+$labels['mail'] = 'Էլ–փոստ';
+$labels['settings'] = 'Նախասիրություններ';
+$labels['addressbook'] = 'Հասցեներ';
+$labels['inbox'] = 'Փոստարկղ';
+$labels['drafts'] = 'Սևագրեր';
+$labels['sent'] = 'Ուղարկված';
+$labels['trash'] = 'Աղբարկղ';
+$labels['junk'] = 'Թափոն';
+$labels['subject'] = 'Վերնագիր';
+$labels['from'] = 'Ուղարկող';
+$labels['to'] = 'Ստացող';
+$labels['cc'] = 'Cc';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Reply-To';
+$labels['date'] = 'Ամսաթիվ';
+$labels['size'] = 'Չափ';
+$labels['priority'] = 'Առավելություն';
+$labels['organization'] = 'Կազմակերպություն';
+$labels['reply-to'] = 'Reply-To';
+$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'] = 'Հիշել հասցեն';
+$labels['sun'] = 'Կիր';
+$labels['mon'] = 'Երկ';
+$labels['tue'] = 'Երք';
+$labels['wed'] = 'Չրք';
+$labels['thu'] = 'Հնգ';
+$labels['fri'] = 'Ուրբ';
+$labels['sat'] = 'Շբթ';
+$labels['sunday'] = 'Կիրակի';
+$labels['monday'] = 'Երկուշաբթի';
+$labels['tuesday'] = 'Երեքշաբթի';
+$labels['wednesday'] = 'Չորեքշաբթի';
+$labels['thursday'] = 'Հինգշաբթի';
+$labels['friday'] = 'Ուրբաթ';
+$labels['saturday'] = 'Շաբաթ';
+$labels['today'] = 'Այսօր';
+$labels['checkmail'] = 'Ստուգել նոր նամակները';
+$labels['writenewmessage'] = 'Նոր նամակ';
+$labels['replytomessage'] = 'Պատասխանել նամակին';
+$labels['replytoallmessage'] = 'Պատասխանել բոլորին';
+$labels['forwardmessage'] = 'Փոխանցել նամակը';
+$labels['deletemessage'] = 'Ջնջել նամակը';
+$labels['printmessage'] = 'Տպել';
+$labels['previousmessage'] = 'Ցուցադրել նախորդ նամակը';
+$labels['previousmessages'] = 'Ցուցադրել նախորդ նամակները';
+$labels['firstmessage'] = 'Ցուցադրել առաջին նամակը';
+$labels['firstmessages'] = 'Ցուցադրել առաջին էջը';
+$labels['nextmessage'] = 'Ցուցադրել հաջորդ նամակը';
+$labels['nextmessages'] = 'Ցուցադրել հաջորդ նամակները';
+$labels['lastmessage'] = 'Ցուցադրել վերջին նամակը';
+$labels['lastmessages'] = 'Ցուցադրել վերջին էջը';
+$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'] = 'Վերսկսել որոնումը';
+$labels['compose'] = 'Գրել նամակ';
+$labels['sendmessage'] = 'Ուղարկել';
+$labels['savemessage'] = 'Հիշել որպես սևագիր';
+$labels['addattachment'] = 'Կցել ֆայլ';
+$labels['charset'] = 'Տառաշար';
+$labels['editortype'] = 'Խմբագրի տիպը';
+$labels['returnreceipt'] = 'Ստացման հավաստագիր';
+$labels['checkspelling'] = 'Ստուգել ուղագրությունը';
+$labels['resumeediting'] = 'Շարունակել խմբագրումը';
+$labels['revertto'] = 'Վերականգնել';
+$labels['attachments'] = 'Կցումներ';
+$labels['upload'] = 'Բեռնել';
+$labels['close'] = 'Փակել';
+$labels['low'] = 'Ցածր';
+$labels['lowest'] = 'Նվազագույն';
+$labels['normal'] = 'Նորմալ';
+$labels['high'] = 'Կարևոր';
+$labels['highest'] = 'Կարևորագույն';
+$labels['nosubject'] = '(առանց վերնագրի)';
+$labels['showimages'] = 'Ցուցադրել նկարները';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Պարզ տեքստ';
+$labels['name'] = 'Մականուն';
+$labels['firstname'] = 'Անուն';
+$labels['surname'] = 'Ազգանուն';
+$labels['email'] = 'Էկ–փոստ';
+$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'] = 'Արտահանել';
+$labels['previouspage'] = 'Ցուցադրել նախորդ էջը';
+$labels['firstpage'] = 'Ցուցադրել առաջին էջը';
+$labels['nextpage'] = 'Ցուցադրել հաջորդ էջը';
+$labels['lastpage'] = 'Ցուցադրել վերջին էջը';
+$labels['groups'] = 'Խմբեր';
+$labels['personaladrbook'] = 'Անձնական հասցեներ';
+$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['htmleditor'] = 'Ստեղծել HTML նամակներ';
+$labels['htmlsignature'] = 'HTML ստորագրություն';
+$labels['previewpane'] = 'Ցուցադրել պատուհանը';
+$labels['autosavedraft'] = 'Սևագրի ավտոմատ գրանցում';
+$labels['everynminutes'] = 'ամեն $n րոպեն';
+$labels['never'] = 'երբեք';
+$labels['folder'] = 'Դարակ';
+$labels['folders'] = 'Դարակներ';
+$labels['foldername'] = 'Դարակի անուն';
+$labels['subscribed'] = 'Բաժանորդագրված';
+$labels['create'] = 'Ստեղծել';
+$labels['createfolder'] = 'Բացել նոր դարակ';
+$labels['rename'] = 'Վերանվանել';
+$labels['renamefolder'] = 'Վերանվանել դարակը';
+$labels['deletefolder'] = 'Ջնջել դարակը';
+$labels['managefolders'] = 'Կարգավորել դարակները';
+$labels['sortby'] = 'Դասավորել';
+$labels['sortasc'] = 'ըստ աճման';
+$labels['sortdesc'] = 'ըստ նվազման';
+
+?>
\ No newline at end of file
diff --git a/program/localization/am/messages.inc b/program/localization/am/messages.inc
new file mode 100755 (executable)
index 0000000..70a9ce7
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/am/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Vahan Yerkanian <vahan@arminco.com>                           |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 552 2007-05-03 20:48:00Z yllar $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Մուտքը ձախողվեց';
+$messages['cookiesdisabled'] = 'Сookies–ների ապահովվումը բացակայում է';
+$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['contactnotfound'] = 'Որոնվող հասցեն չգտնվեց';
+$messages['sendingfailed'] = 'Նամակի ուղարկումը ձախողվեց';
+$messages['errorsaving'] = 'Գրանցման սխալ';
+$messages['errormoving'] = 'Նամակի տեղափոխման ձախողում';
+$messages['errordeleting'] = 'Նամակի ջնջման ձախողում';
+$messages['deletecontactconfirm'] = 'Ուզու՞մ էք ջնջել նշված անձերին';
+$messages['deletemessagesconfirm'] = 'Ուզու՞մ էք ջնջել նշված նամակները';
+$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'] = 'Մուտքագրեք հասցեատեր կամ էլ. հասցե';
+$messages['searchsuccessful'] = 'Գտնվեց $nr նամակ';
+$messages['searchnomatch'] = 'Համապատասխան նամակներ չգտնվեցին';
+$messages['searching'] = 'Որոնում...';
+$messages['checking'] = 'Ստուգում…';
+$messages['nospellerrors'] = 'Ուղագրական սխալներ չկան';
+$messages['folderdeleted'] = 'Դարակը ջնջվեց';
+$messages['deletedsuccessfully'] = 'Ջնջված է';
+$messages['converting'] = 'Նամակի ձևավորման հեռացում…';
+$messages['messageopenerror'] = 'Նամակի բեռնվումը սերվերից ձախողվեց';
+$messages['fileuploaderror'] = 'Ֆայլի կցումն ձախողվեց';
+$messages['filesizeerror'] = 'Ֆայլի չափը գերազանցում է մաքսիմալը՝ $size';
+$messages['copysuccess'] = '$nr հասցեների կրկնօրինակումը ավարտված է';
+$messages['copyerror'] = 'Հասցեների կրկնօրինակումը ձախողվեց';
+$messages['sourceisreadonly'] = 'Այս հասցեն պաշտպանված է';
+$messages['errorsavingcontact'] = 'Հասցեի գրանցումն ձախողվեց';
+
+?>
\ No newline at end of file
diff --git a/program/localization/bg/labels.inc b/program/localization/bg/labels.inc
new file mode 100644 (file)
index 0000000..0899121
--- /dev/null
@@ -0,0 +1,180 @@
+<?php\r
+\r
+/*\r
+\r
+ +-----------------------------------------------------------------------+\r
+ | language/bg/labels.inc                                                |\r
+ |                                                                       |\r
+ | Language file of the RoundCube Webmail client                         |\r
+ | Copyright (C) 2005-2007 RoundCube Dev. - Switzerland                  |\r
+ | Licensed under the GNU GPL                                            |\r
+ |                                                                       |\r
+ +-----------------------------------------------------------------------+\r
+ | Author: Todor Dragnev <todor.dragnev@gmail.com>                       |\r
+ +-----------------------------------------------------------------------+\r
+\r
+ @version $Id$\r
+\r
+*/\r
+\r
+$labels = array();\r
+$labels['welcome'] = 'Добре дошли в $product';\r
+$labels['username'] = 'Потребител';\r
+$labels['password'] = 'Парола';\r
+$labels['server'] = 'Сървър';\r
+$labels['login'] = 'Вход';\r
+$labels['logout'] = 'Изход';\r
+$labels['mail'] = 'Кутия';\r
+$labels['settings'] = 'Настройки';\r
+$labels['addressbook'] = 'Адреси';\r
+$labels['inbox'] = 'Входящи';\r
+$labels['drafts'] = 'Чернови';\r
+$labels['sent'] = 'Изпратени';\r
+$labels['trash'] = 'Кошче';\r
+$labels['junk'] = 'Спам';\r
+$labels['subject'] = 'Заглавие';\r
+$labels['from'] = 'От';\r
+$labels['to'] = 'Получател';\r
+$labels['cc'] = 'Копие до';\r
+$labels['bcc'] = 'Скрито копие до';\r
+$labels['replyto'] = 'Отговор на';\r
+$labels['date'] = 'Дата';\r
+$labels['size'] = 'Размер';\r
+$labels['priority'] = 'Приоритет';\r
+$labels['organization'] = 'Организация';\r
+$labels['reply-to'] = 'Отговор на';\r
+$labels['mailboxlist'] = 'Папки';\r
+$labels['messagesfromto'] = 'Съобщения $from до $to от $count';\r
+$labels['messagenrof'] = 'Съобщение $nr от $count';\r
+$labels['moveto'] = 'премести в...';\r
+$labels['download'] = 'изтегли';\r
+$labels['filename'] = 'Име на файла';\r
+$labels['filesize'] = 'Размер на файла';\r
+$labels['preferhtml'] = 'Показвай първо HTML версия';\r
+$labels['htmlmessage'] = 'HTML съобщение';\r
+$labels['prettydate'] = 'Кратки дати';\r
+$labels['addtoaddressbook'] = 'Добави в адресната книга';\r
+$labels['sun'] = 'Нед';\r
+$labels['mon'] = 'Пон';\r
+$labels['tue'] = 'Вто';\r
+$labels['wed'] = 'Сря';\r
+$labels['thu'] = 'Чет';\r
+$labels['fri'] = 'Пет';\r
+$labels['sat'] = 'Съб';\r
+$labels['sunday'] = 'Неделя';\r
+$labels['monday'] = 'Понеделник';\r
+$labels['tuesday'] = 'Вторник';\r
+$labels['wednesday'] = 'Сряда';\r
+$labels['thursday'] = 'Четвъртък';\r
+$labels['friday'] = 'Петък';\r
+$labels['saturday'] = 'Събота';\r
+$labels['today'] = 'Днес';\r
+$labels['checkmail'] = 'Провери за нови писма';\r
+$labels['writenewmessage'] = 'Създай ново писмо';\r
+$labels['replytomessage'] = 'Отговори на писмото';\r
+$labels['replytoallmessage'] = 'Отговори до всички получатели';\r
+$labels['forwardmessage'] = 'Препрати писмото';\r
+$labels['deletemessage'] = 'Премести писмото в кошчето';\r
+$labels['printmessage'] = 'Разпечатай писмото';\r
+$labels['previousmessage'] = 'Предно писмо';\r
+$labels['previousmessages'] = 'Предна страница';\r
+$labels['firstmessage'] = 'Първо писмо';\r
+$labels['firstmessages'] = 'Първа страница';\r
+$labels['nextmessage'] = 'Следващо писмо';\r
+$labels['nextmessages'] = 'Следваща страница';\r
+$labels['lastmessage'] = 'Последно писмо';\r
+$labels['lastmessages'] = 'Последна страница';\r
+$labels['backtolist'] = 'Обратно към списъка';\r
+$labels['viewsource'] = 'Виж кода';\r
+$labels['select'] = 'Избери';\r
+$labels['all'] = 'Всички';\r
+$labels['none'] = 'Нищо';\r
+$labels['unread'] = 'Нови';\r
+$labels['compact'] = 'Свий';\r
+$labels['empty'] = 'Изпразни';\r
+$labels['purge'] = 'Изчисти';\r
+$labels['quota'] = 'Използвано място';\r
+$labels['unknown'] = 'няма информация';\r
+$labels['unlimited'] = 'няма ограничение';\r
+$labels['quicksearch'] = 'Бързо търсене';\r
+$labels['resetsearch'] = 'Изчисти търсенето и покажи всички писма';\r
+$labels['compose'] = 'Ново писмо';\r
+$labels['sendmessage'] = 'Изпрати писмото';\r
+$labels['savemessage'] = 'Запиши в Чернови';\r
+$labels['addattachment'] = 'Прикачи файл';\r
+$labels['charset'] = 'Charset';\r
+$labels['editortype'] = 'Вид редактор';\r
+$labels['returnreceipt'] = 'Обратна разписка';\r
+$labels['checkspelling'] = 'Проверка на правописа';\r
+$labels['resumeediting'] = 'Продължи черновата';\r
+$labels['revertto'] = 'Върни се към';\r
+$labels['attachments'] = 'Прикачени файлове';\r
+$labels['upload'] = 'Качи';\r
+$labels['close'] = 'Затвори';\r
+$labels['low'] = '**';\r
+$labels['lowest'] = '*';\r
+$labels['normal'] = '***';\r
+$labels['high'] = '****';\r
+$labels['highest'] = '*****';\r
+$labels['nosubject'] = '(няма заглавие)';\r
+$labels['showimages'] = 'Виж изображенията';\r
+$labels['htmltoggle'] = 'HTML';\r
+$labels['plaintoggle'] = 'тесктов';\r
+$labels['name'] = 'Прякор';\r
+$labels['firstname'] = 'Име';\r
+$labels['surname'] = 'Фамилия';\r
+$labels['email'] = 'E-Mail';\r
+$labels['addcontact'] = 'Добави';\r
+$labels['editcontact'] = 'Редактирай';\r
+$labels['edit'] = 'Редактирай';\r
+$labels['cancel'] = 'Отказ';\r
+$labels['save'] = 'Запиши';\r
+$labels['delete'] = 'Изтрии';\r
+$labels['newcontact'] = 'Нов контакт';\r
+$labels['deletecontact'] = 'Изтрии маркираните контакти';\r
+$labels['composeto'] = 'Напиши писмо до';\r
+$labels['contactsfromto'] = 'Контакти $from до $to от $count';\r
+$labels['print'] = 'Разпечатай';\r
+$labels['export'] = 'Експорт';\r
+$labels['previouspage'] = 'Предна страница';\r
+$labels['firstpage'] = 'Първа страница';\r
+$labels['nextpage'] = 'Следваща страница';\r
+$labels['lastpage'] = 'Последна страница';\r
+$labels['groups'] = 'Групи';\r
+$labels['personaladrbook'] = 'Лични адреси';\r
+$labels['settingsfor'] = 'Настройки за';\r
+$labels['preferences'] = 'Настройки';\r
+$labels['userpreferences'] = 'Потребителски настройки';\r
+$labels['editpreferences'] = 'Редактирай потребителските настройки';\r
+$labels['identities'] = 'Самоличност';\r
+$labels['manageidentities'] = 'Промяна на самоличностите за този акаунт';\r
+$labels['newidentity'] = 'Нова самоличност';\r
+$labels['newitem'] = 'Нова самоличност';\r
+$labels['edititem'] = 'Редактиране на самоличност';\r
+$labels['setdefault'] = 'По подразбиране';\r
+$labels['language'] = 'Език';\r
+$labels['timezone'] = 'Часова зона';\r
+$labels['pagesize'] = 'Редове на страница';\r
+$labels['signature'] = 'Подпис';\r
+$labels['dstactive'] = 'Маркирай при лятно време';\r
+$labels['htmleditor'] = 'Писане на HTML съобщения';\r
+$labels['htmlsignature'] = 'HTML подпис';\r
+$labels['previewpane'] = 'Панел за преглед';\r
+$labels['autosavedraft'] = 'Автоматично записвай чернова';\r
+$labels['everynminutes'] = 'всеки $n минути';\r
+$labels['never'] = 'никога';\r
+$labels['folder'] = 'Папка';\r
+$labels['folders'] = 'Папки';\r
+$labels['foldername'] = 'Име на папката';\r
+$labels['subscribed'] = 'Използвай';\r
+$labels['create'] = 'Създай';\r
+$labels['createfolder'] = 'Направи нова папка';\r
+$labels['rename'] = 'Преименувай';\r
+$labels['renamefolder'] = 'Преименувай папката';\r
+$labels['deletefolder'] = 'Изтрий';\r
+$labels['managefolders'] = 'Настройки на папките';\r
+$labels['sortby'] = 'Сортирай по';\r
+$labels['sortasc'] = 'Сортирай възходящо';\r
+$labels['sortdesc'] = 'Сортирай низходящо';\r
+\r
+?>
\ No newline at end of file
diff --git a/program/localization/bg/messages.inc b/program/localization/bg/messages.inc
new file mode 100644 (file)
index 0000000..bcdf61e
--- /dev/null
@@ -0,0 +1,77 @@
+<?php\r
+\r
+/*\r
+\r
+ +-----------------------------------------------------------------------+\r
+ | language/bg/messages.inc                                              |\r
+ |                                                                       |\r
+ | Language file of the RoundCube Webmail client                         |\r
+ | Copyright (C) 2005-2007 RoundCube Dev. - Switzerland                  |\r
+ | Licensed under the GNU GPL                                            |\r
+ |                                                                       |\r
+ +-----------------------------------------------------------------------+\r
+ | Author: Todor Dragnev <todor.dragnev@gmail.com>                       |\r
+ +-----------------------------------------------------------------------+\r
+\r
+ @version $Id$\r
+\r
+*/\r
+\r
+$messages = array();\r
+$messages['loginfailed'] = 'Вход неуспешен';\r
+$messages['cookiesdisabled'] = 'Вашия браузър не приема cookies';\r
+$messages['sessionerror'] = 'Невалидна или изтекла сесия';\r
+$messages['imaperror'] = 'Свързване към IMAP сървъра е неуспешно';\r
+$messages['nomessagesfound'] = 'Няма съобщения';\r
+$messages['loggedout'] = 'Довиждане!';\r
+$messages['mailboxempty'] = 'Папката е празна';\r
+$messages['loading'] = 'Зареждане...';\r
+$messages['loadingdata'] = 'Зареждане на данни...';\r
+$messages['checkingmail'] = 'Проверка за нови писма...';\r
+$messages['sendingmessage'] = 'Изпращане на писмото...';\r
+$messages['messagesent'] = 'Писмото е изпратено успешно';\r
+$messages['savingmessage'] = 'Записване на писмото...';\r
+$messages['messagesaved'] = 'Писмото е записано в Чернови';\r
+$messages['successfullysaved'] = 'Записано';\r
+$messages['addedsuccessfully'] = 'Контакта е добавен в адресната книга';\r
+$messages['contactexists'] = 'Контакт с този e-mail адрес вече същестува';\r
+$messages['blockedimages'] = 'С оглед на Вашата сигурност, изображенията в това писмо са блокирани .';\r
+$messages['encryptedmessage'] = 'Това е кодирано писмо и не може да бъде показано. Съжаляваме!';\r
+$messages['nocontactsfound'] = 'Няма контакти';\r
+$messages['contactnotfound'] = 'Исканият контакт не е намерен';\r
+$messages['sendingfailed'] = 'Изпращането неуспешно';\r
+$messages['errorsaving'] = 'Възникна грешка при записването';\r
+$messages['errormoving'] = 'Писмото не може да бъде преместено';\r
+$messages['errordeleting'] = 'Писмото не може да бъде изтрито';\r
+$messages['deletecontactconfirm'] = 'Искате ли да изтриете маркираните контакти?';\r
+$messages['deletemessagesconfirm'] = 'Искате ли да изтриете маркираните съобщения?';\r
+$messages['deletefolderconfirm'] = 'Искате ли да изтриете тази папка?';\r
+$messages['purgefolderconfirm'] = 'Искате ли да изтриете всички писма в тази папка?';\r
+$messages['formincomplete'] = 'Не сте попълнили всички полета';\r
+$messages['noemailwarning'] = 'Моля въведете валиден e-mail адрес';\r
+$messages['nonamewarning'] = 'Моля въведете име';\r
+$messages['nopagesizewarning'] = 'Въведете брой редове на страница';\r
+$messages['norecipientwarning'] = 'Въведете поне един получател';\r
+$messages['nosubjectwarning'] = 'Полето "Заглавие" е празно. Искате ли да въведете ново заглавие?';\r
+$messages['nobodywarning'] = 'Изпрати това писмо без текст?';\r
+$messages['notsentwarning'] = 'Писмото не е изпратено. Искате ли да бъде унищожено?';\r
+$messages['noldapserver'] = 'Изберете LDAP сървър за търсене';\r
+$messages['nocontactsreturned'] = 'Не са намерени контакти';\r
+$messages['nosearchname'] = 'Моля въведете Име на контакта или e-mail адрес';\r
+$messages['searchsuccessful'] = '$nr намерени писма';\r
+$messages['searchnomatch'] = 'Търсенето не откри съвпадения';\r
+$messages['searching'] = 'Търсене...';\r
+$messages['checking'] = 'Проверка...';\r
+$messages['nospellerrors'] = 'Не са открити правописни грешки';\r
+$messages['folderdeleted'] = 'Папката е изтрита';\r
+$messages['deletedsuccessfully'] = 'Изтриването е успешно';\r
+$messages['converting'] = 'Премахване форматирането на писмото...';\r
+$messages['messageopenerror'] = 'Писмото не може да бъде заредено от сървъра';\r
+$messages['fileuploaderror'] = 'Грешка при прикачването на файла';\r
+$messages['filesizeerror'] = 'Прикаченият файл надвишава лимита от $size';\r
+$messages['copysuccess'] = 'Успешно копирани $nr адреса';\r
+$messages['copyerror'] = 'Грешка при копирането на адресите';\r
+$messages['sourceisreadonly'] = 'Този източник на адреси е само за четене';\r
+$messages['errorsavingcontact'] = 'Грешка при записването на адреса';\r
+\r
+?>
\ No newline at end of file
diff --git a/program/localization/ca/labels.inc b/program/localization/ca/labels.inc
new file mode 100644 (file)
index 0000000..7046bdb
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/ca/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Miguel Canteras i Cañizares <miguel@canteras.org>             |
+ |         Simo <sim6@graciasensefils.net>                               |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 560 2007-05-17 15:01:26Z thomasb $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Benvingut a $product';
+$labels['username'] = 'Nom d\'usuari';
+$labels['password'] = 'Contrasenya';
+$labels['server'] = 'Servidor';
+$labels['login'] = 'Entrar';
+$labels['logout'] = 'Tancar sessió';
+$labels['mail'] = 'E-Mail';
+$labels['settings'] = 'Configuració';
+$labels['addressbook'] = 'Contactes';
+$labels['inbox'] = 'Entrada';
+$labels['drafts'] = 'Esborranys';
+$labels['sent'] = 'Enviats';
+$labels['trash'] = 'Paperera';
+$labels['junk'] = 'Correu brossa';
+$labels['subject'] = 'Assumpte';
+$labels['from'] = 'Remitent';
+$labels['to'] = 'Destinatari';
+$labels['cc'] = 'CC';
+$labels['bcc'] = 'BCC';
+$labels['replyto'] = 'Respondre a';
+$labels['date'] = 'Data';
+$labels['size'] = 'Grandària';
+$labels['priority'] = 'Prioritat';
+$labels['organization'] = 'Organització';
+$labels['reply-to'] = 'Respondre a';
+$labels['mailboxlist'] = 'Carpetes';
+$labels['messagesfromto'] = 'Missatges des de $from a $to de $count';
+$labels['messagenrof'] = 'Missatge $nr de $count';
+$labels['moveto'] = 'moure a...';
+$labels['download'] = 'descarregar';
+$labels['filename'] = 'Nom del fitxer';
+$labels['filesize'] = 'Grandaria de fitxer';
+$labels['preferhtml'] = 'Preferisc HTML';
+$labels['htmlmessage'] = 'Missatge HTML';
+$labels['prettydate'] = 'Dates curtes';
+$labels['addtoaddressbook'] = 'Afegir a contactes';
+$labels['sun'] = 'DM';
+$labels['mon'] = 'DL';
+$labels['tue'] = 'DM';
+$labels['wed'] = 'DC';
+$labels['thu'] = 'DJ';
+$labels['fri'] = 'DV';
+$labels['sat'] = 'DS';
+$labels['sunday'] = 'Diumenge';
+$labels['monday'] = 'Dilluns';
+$labels['tuesday'] = 'Dimarts';
+$labels['wednesday'] = 'Dimecres';
+$labels['thursday'] = 'Dijous';
+$labels['friday'] = 'Divendres';
+$labels['saturday'] = 'Dissabte';
+$labels['today'] = 'Avui';
+$labels['checkmail'] = 'Recupera missatges nous';
+$labels['writenewmessage'] = 'Crear nou missatge';
+$labels['replytomessage'] = 'Respondre al missatge';
+$labels['replytoallmessage'] = 'Respondre al remitent i a tots els destinataris';
+$labels['forwardmessage'] = 'Reenviar missatge';
+$labels['deletemessage'] = 'Moure missatge a la paperera';
+$labels['printmessage'] = 'Imprimir aquest missatge';
+$labels['previousmessage'] = 'Mostrar el missatge anterior';
+$labels['previousmessages'] = 'Mostrar missatges anteriors';
+$labels['firstmessage'] = 'Mostrar el primer missatge';
+$labels['firstmessages'] = 'Mostrar els primers missatges';
+$labels['nextmessage'] = 'Mostrar el missatge següent';
+$labels['nextmessages'] = 'Mostrar missatges següents';
+$labels['lastmessage'] = 'Mostrar l\'últim missatge';
+$labels['lastmessages'] = 'Mostrar els últims missatges';
+$labels['backtolist'] = 'Tornar a la llista de missatges';
+$labels['viewsource'] = 'Visualitza el codi font';
+$labels['select'] = 'Seleccionar';
+$labels['all'] = 'Tots';
+$labels['none'] = 'Cap';
+$labels['unread'] = 'No llegits';
+$labels['compact'] = 'Compacta';
+$labels['empty'] = 'Buida';
+$labels['purge'] = 'Purga';
+$labels['quota'] = 'Utilització de disc';
+$labels['unknown'] = 'desconegut';
+$labels['unlimited'] = 'il·limitat';
+$labels['quicksearch'] = 'Cerca ràpida';
+$labels['resetsearch'] = 'Neteja cerca';
+$labels['compose'] = 'Escriure un missatge';
+$labels['sendmessage'] = 'Enviar ara el missatge';
+$labels['savemessage'] = 'Desa aquest esborrany';
+$labels['addattachment'] = 'Afegir un fitxer';
+$labels['charset'] = 'Codificació de caràcters';
+$labels['editortype'] = 'Tipus d\'editor';
+$labels['returnreceipt'] = 'Confirmació de recepció';
+$labels['checkspelling'] = 'Comprova l\'ortografia';
+$labels['resumeediting'] = 'Continua l\'edició';
+$labels['revertto'] = 'Tornar a';
+$labels['attachments'] = 'Adjunts';
+$labels['upload'] = 'Afegir';
+$labels['close'] = 'Cancel·lar';
+$labels['low'] = 'Baixa';
+$labels['lowest'] = 'Molt baixa';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Alta';
+$labels['highest'] = 'Molt alta';
+$labels['nosubject'] = '(sense assumpte)';
+$labels['showimages'] = 'Mostra imatges';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Text pla';
+$labels['name'] = 'Nom a mostrar';
+$labels['firstname'] = 'Nom';
+$labels['surname'] = 'Cognom';
+$labels['email'] = 'E-Mail';
+$labels['addcontact'] = 'Afegir nou contacte';
+$labels['editcontact'] = 'Editar contacte';
+$labels['edit'] = 'Editar';
+$labels['cancel'] = 'Cancel·lar';
+$labels['save'] = 'Desar';
+$labels['delete'] = 'Suprimir';
+$labels['newcontact'] = 'Crear nou contacte';
+$labels['deletecontact'] = 'Suprimir contactes seleccionats';
+$labels['composeto'] = 'Redactar correu per a';
+$labels['contactsfromto'] = 'Contactes $from a $to de $count';
+$labels['print'] = 'Imprimeix';
+$labels['export'] = 'Exportar';
+$labels['previouspage'] = 'Mostrar anteriors';
+$labels['firstpage'] = 'Mostrar primers';
+$labels['nextpage'] = 'Mostrar següents';
+$labels['lastpage'] = 'Mostrar últims';
+$labels['groups'] = 'Grups';
+$labels['personaladrbook'] = 'Llibreta d\'adreces';
+$labels['settingsfor'] = 'Configuració per a';
+$labels['preferences'] = 'Preferències';
+$labels['userpreferences'] = 'Preferències d\'usuari';
+$labels['editpreferences'] = 'Editar preferències d\'usuari';
+$labels['identities'] = 'Identitats';
+$labels['manageidentities'] = 'Gestionar identitats per a aquest compte';
+$labels['newidentity'] = 'Nova identitat';
+$labels['newitem'] = 'Nou';
+$labels['edititem'] = 'Editar';
+$labels['setdefault'] = 'Seleccionar opció per defecte';
+$labels['language'] = 'Idioma';
+$labels['timezone'] = 'Zona horària';
+$labels['pagesize'] = 'Files per pàgina';
+$labels['signature'] = 'Signatura';
+$labels['dstactive'] = 'Horari d\'estiu';
+$labels['htmleditor'] = 'Escriure missatges HTML';
+$labels['htmlsignature'] = 'Signatura HTML';
+$labels['previewpane'] = 'Mostrar el panell de previsualització';
+$labels['autosavedraft'] = 'Desar esborrany automàticament';
+$labels['everynminutes'] = 'cada $n minuts';
+$labels['never'] = 'mai';
+$labels['folder'] = 'Carpeta';
+$labels['folders'] = 'Carpetes';
+$labels['foldername'] = 'Nom de carpeta';
+$labels['subscribed'] = 'Subscriure\'s';
+$labels['create'] = 'Crear';
+$labels['createfolder'] = 'Crear nova carpeta';
+$labels['rename'] = 'Canvia el nom';
+$labels['renamefolder'] = 'Canvia el nom de la carpeta';
+$labels['deletefolder'] = 'Suprimir carpeta';
+$labels['managefolders'] = 'Gestionar carpetes';
+$labels['sortby'] = 'Ordena per';
+$labels['sortasc'] = 'Ordena ascendentment';
+$labels['sortdesc'] = 'Ordena descendentment';
+
+?>
diff --git a/program/localization/ca/messages.inc b/program/localization/ca/messages.inc
new file mode 100644 (file)
index 0000000..c5f8b17
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/ca/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Miguel Canteras i Cañizares <miguel@canteras.org>             |
+ |         Simo <sim6@graciasensefils.net>                               |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 560 2007-05-17 15:01:26Z thomasb $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Contrasenya incorrecta';
+$messages['cookiesdisabled'] = 'El seu navegador no accepta cookies';
+$messages['sessionerror'] = 'La seva sessió no existeix o ha expirat';
+$messages['imaperror'] = 'Error de conexió amb el servidor IMAP';
+$messages['nomessagesfound'] = 'No s\'han trobat missatges en aquesta bústia';
+$messages['loggedout'] = 'Ha tancat la sessió. Fins aviat!';
+$messages['mailboxempty'] = 'La bústia està buida';
+$messages['loading'] = 'Carregant...';
+$messages['loadingdata'] = 'Carregant dades...';
+$messages['checkingmail'] = 'Cercant nous missatges...';
+$messages['sendingmessage'] = 'Enviant missatge...';
+$messages['messagesent'] = 'Missatge enviat correctament';
+$messages['savingmessage'] = 'Desant missatge...';
+$messages['messagesaved'] = 'Missatge desat a Esborranys';
+$messages['successfullysaved'] = 'Desat correctament';
+$messages['addedsuccessfully'] = 'Contacte afegit correctament a la llibreta d\'adreces';
+$messages['contactexists'] = 'Ja hi ha un contacte amb aquesta adreça de correu';
+$messages['blockedimages'] = 'Per a protegir la seva privacitat, les imatges remotes han sigut bloquejades en aquest missatge';
+$messages['encryptedmessage'] = 'Aquest és un missatge xifrat i no pot ser mostrat. Ho sento!';
+$messages['nocontactsfound'] = 'No hi ha contactes';
+$messages['contactnotfound'] = 'No s\'ha trobat el contacte solicitat';
+$messages['sendingfailed'] = 'Error enviant missatge';
+$messages['errorsaving'] = 'Va ocórrer un error mentres es desava';
+$messages['errormoving'] = 'No s\'ha pogut moure el missatge';
+$messages['errordeleting'] = 'No s\'ha pogut eliminar el missatge';
+$messages['deletecontactconfirm'] = 'Realment vol suprimir el(s) contacte(s) selecionat(s)?';
+$messages['deletemessagesconfirm'] = 'Realment vol suprimir el(s) missatge(s) selecionat(s)?';
+$messages['deletefolderconfirm'] = 'Realment vol suprimir aquesta carpeta?';
+$messages['purgefolderconfirm'] = 'Realment vol suprimir tots els missatges d\'aquesta carpeta?';
+$messages['formincomplete'] = 'El formulari no ha sigut emplenat totalment';
+$messages['noemailwarning'] = 'Introdueixi una direcció email vàlida';
+$messages['nonamewarning'] = 'Introdueixi un nom';
+$messages['nopagesizewarning'] = 'Introdueixi un tamany de pàgina';
+$messages['norecipientwarning'] = 'Introdueixi al menys un destinatari';
+$messages['nosubjectwarning'] = 'El camp "Assumpte" eatà buit. Vol introduir un ara?';
+$messages['nobodywarning'] = 'Vol enviar aquest missatge sense text?';
+$messages['notsentwarning'] = 'El missatge no s\'ha enviat. Vol descartar el seu missatge?';
+$messages['noldapserver'] = 'Seleccioni un servidor ldap per a cercar';
+$messages['nocontactsreturned'] = 'No s\'han trobat contactes';
+$messages['nosearchname'] = 'Introdueixi un nom de contacte o una direcció email';
+$messages['searchsuccessful'] = '$nr missatges trobats';
+$messages['searchnomatch'] = 'No s\'ha trobat cap coincidència';
+$messages['searching'] = 'Cercant...';
+$messages['checking'] = 'Comprovant...';
+$messages['nospellerrors'] = 'No s\'han trobat errors d\'ortografia';
+$messages['folderdeleted'] = 'Carpeta eliminada correctament';
+$messages['deletedsuccessfully'] = 'Eliminat correctament';
+$messages['converting'] = 'Treient format del missatge...';
+$messages['messageopenerror'] = 'No s\'ha pogut carregar el missatge del servidor';
+$messages['fileuploaderror'] = 'Pujada de fitxer fallida';
+$messages['filesizeerror'] = 'El fitxer pujat excedeix la grandària màxima de $size';
+$messages['copysuccess'] = 'S\'ha copiat $nr adreces correctament';
+$messages['copyerror'] = 'No s\'ha pogut copiar cap adreça';
+$messages['sourceisreadonly'] = 'Aquesta adreça és només de lectura.';
+$messages['errorsavingcontact'] = 'No s\'ha pogut guardar l\'adreça de contacte';
+
+?>
\ No newline at end of file
diff --git a/program/localization/cz/labels.inc b/program/localization/cz/labels.inc
new file mode 100755 (executable)
index 0000000..a690e52
--- /dev/null
@@ -0,0 +1,244 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/cz/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | All rights reserved.                                                  |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Martin Mrajca <martin@moonlake.cz>                            |
+ |        joe <joe@humlak.cz>                                            |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 553 2007-05-13 16:31:19Z thomasb $
+
+*/
+
+$labels = array();
+
+// login page
+$labels['username']  = 'Uživatel';
+$labels['password']  = 'Heslo';
+$labels['server']    = 'Server';
+$labels['login']     = 'Přihlásit';
+
+// taskbar
+$labels['logout']   = 'Odhlásit';
+$labels['mail']     = 'E-mail';
+$labels['settings'] = 'Osobní nastavení';
+$labels['addressbook'] = 'Adresář';
+
+// mailbox names
+$labels['inbox']  = 'Příchozí pošta';
+$labels['sent']   = 'Odeslané';
+$labels['trash']  = 'Koš';
+$labels['drafts'] = 'Rozepsané';
+$labels['junk']   = 'Nevyžádaná pošta';
+
+// message listing
+$labels['subject'] = 'Předmět';
+$labels['from']    = 'Odesílatel';
+$labels['to']      = 'Adresát';
+$labels['cc']      = 'Kopie';
+$labels['bcc']     = 'Slepá';
+$labels['replyto'] = 'Odpověď na';
+$labels['date']    = 'Datum';
+$labels['size']    = 'Velikost';
+$labels['priority'] = 'Priorita';
+$labels['organization'] = 'Organizace';
+
+// aliases
+$labels['reply-to'] = $labels['replyto'];
+
+$labels['mailboxlist'] = 'Složky';
+$labels['messagesfromto'] = 'Zprávy $from až $to z celkem $count';
+$labels['messagenrof'] = 'Zpráva $nr z $count';
+
+$labels['moveto']   = 'přesunout do...';
+$labels['download'] = 'stáhnout';
+
+$labels['filename'] = 'Jméno přílohy';
+$labels['filesize'] = 'Velikost přílohy';
+
+$labels['preferhtml'] = 'Upřednostňovat HTML zobrazení';
+$labels['htmlmessage'] = 'HTML zpráva';
+$labels['prettydate'] = 'Hezčí datum';
+
+$labels['addtoaddressbook'] = 'Přidat do adresáře';
+
+// weekdays short
+$labels['sun'] = 'Ne';
+$labels['mon'] = 'Po';
+$labels['tue'] = 'Út';
+$labels['wed'] = 'St';
+$labels['thu'] = 'Čt';
+$labels['fri'] = 'Pá';
+$labels['sat'] = 'So';
+
+// weekdays long
+$labels['sunday']    = 'Neděle';
+$labels['monday']    = 'Pondělí';
+$labels['tuesday']   = 'Úterý';
+$labels['wednesday'] = 'Středa';
+$labels['thursday']  = 'Čtvrtek';
+$labels['friday']    = 'Pátek';
+$labels['saturday']  = 'Sobota';
+
+$labels['today'] = 'Dnes';
+
+// toolbar buttons
+$labels['writenewmessage']  = 'Vytvořit novou zprávu';
+$labels['replytomessage']   = 'Odpovědět odesílateli';
+$labels['replytoallmessage'] = 'Odpovědět všem';
+$labels['forwardmessage']   = 'Předat zprávu';
+$labels['deletemessage']    = 'Přesunout do koše';
+$labels['printmessage']     = 'Vytisknout zprávu';
+$labels['previousmessages'] = 'Zobrazit předchozí zprávy';
+$labels['nextmessages']     = 'Zobrazit další zprávy';
+$labels['backtolist']       = 'Zpět do seznamu zpráv';
+$labels['viewsource']       = 'Zobrazit zdroj';
+
+$labels['select'] = 'Vybrat';
+$labels['all'] = 'Vše';
+$labels['none'] = 'Nic';
+$labels['unread'] = 'Nepřečtené';
+
+// message compose
+$labels['compose']  = 'Napsat zprávu';
+$labels['sendmessage']  = 'Odeslat zprávu nyní';
+$labels['addattachment']  = 'Přidat přílohu';
+
+$labels['attachments'] = 'Přílohy';
+$labels['upload'] = 'Nahrát';
+$labels['close']  = 'Zavřít';
+
+$labels['low']     = 'Nízká';
+$labels['lowest']  = 'Nejnižší';
+$labels['normal']  = 'Normální';
+$labels['high']    = 'Vysoká';
+$labels['highest'] = 'Nejvyšší';
+
+$labels['showimages'] = 'Zobrazit obrázky';
+
+
+// address boook
+$labels['name']      = 'Zobrazit jméno';
+$labels['firstname'] = 'Jméno';
+$labels['surname']   = 'Příjmení';
+$labels['email']     = 'E-mail';
+
+$labels['addcontact'] = 'Přidat kontakt';
+$labels['editcontact'] = 'Upravit kontakt';
+
+$labels['edit']   = 'Upravit';
+$labels['cancel'] = 'Konec';
+$labels['save']   = 'Uložit';
+$labels['delete'] = 'Smazat';
+
+$labels['newcontact']     = 'Vytvořit nový kontakt';
+$labels['deletecontact']  = 'Smazat vybrané kontakty';
+$labels['composeto']      = 'Poslat e-mail';
+$labels['contactsfromto'] = 'Kontakty $from až $to z celkem $count';
+$labels['print']          = 'Tisk';
+$labels['export']         = 'Export';
+
+
+// settings
+$labels['settingsfor']  = 'Nastavení pro';
+
+$labels['preferences']  = 'Vlastnosti';
+$labels['userpreferences']  = 'Vlastnosti uživatele';
+$labels['editpreferences']  = 'Upravit vlastnosti uživatele';
+
+$labels['identities']  = 'Profily';
+$labels['manageidentities']  = 'Spravovat profily u tohoto účtu';
+$labels['newidentity']  = 'Nový profil';
+
+$labels['newitem']  = 'Nová položka';
+$labels['edititem']  = 'Upravit položku';
+
+$labels['setdefault']  = 'Nastavit výchozí';
+$labels['language']  = 'Jazyk';
+$labels['timezone']  = 'Časová zóna';
+$labels['pagesize']  = 'Řádků na stránku';
+
+$labels['folders']  = 'Složky';
+$labels['folder']  = 'Složka';
+$labels['foldername']  = 'Jméno složky';
+$labels['subscribed']  = 'Vybráno';
+$labels['create']  = 'Vytvořit';
+$labels['createfolder']  = 'Vytvořit novou složku';
+$labels['deletefolder']  = 'Smazat složku';
+$labels['managefolders']  = 'Spravovat složky';
+
+$labels['compact'] = 'Kompaktní';
+$labels['empty'] = 'Prázdný';
+$labels['purge'] = 'Vyprázdnit';
+$labels['quota'] = 'Využití schránky';
+
+$labels['sortby']   = 'Seřadit podle';
+$labels['sortdesc'] = 'Seřadit sestupně';
+$labels['sortasc']  = 'Seřadit vzestupně';
+
+$labels['nosubject']  = '(bez predmetu)';
+$labels['signature'] = 'Podpis';
+$labels['charset']  = 'Znaková sada';
+
+$labels['ldapsearch'] = 'Hledat v LDAP adresáři';
+$labels['ldappublicsearchname']    = 'Jméno kontaktu';
+$labels['ldappublicsearchtype'] = 'Doslovné znění?';
+$labels['ldappublicserverselect'] = 'Zvolit servery';
+$labels['ldappublicsearchfield'] = 'Hledat na';
+$labels['ldappublicsearchform'] = 'Hledat kontakt';
+$labels['ldappublicsearch'] = 'Hledat';
+
+$labels['welcome'] = 'Vítejte v $product';
+
+$labels['unknown'] = 'neznámý';
+$labels['unlimited'] = 'neomezený';
+$labels['dstactive'] = 'Letní čas';
+
+$labels['previouspage'] = 'Předchozí';
+$labels['nextpage']     = 'Další';
+
+$labels['returnreceipt'] = 'Doručenka';
+
+$labels['checkmail'] = 'Zkontrolovat nové zprávy';
+$labels['checkspelling'] = 'Zkontrolovat pravopis';
+$labels['resumeediting'] = 'Pokračovat v úpravách';
+$labels['revertto'] = 'Přejít na';
+
+$labels['savemessage']  = 'Uložit do rozepsaných';
+$labels['rename'] = 'Přejmenovat';
+$labels['renamefolder'] = 'Přejmenovat složku';
+
+$labels['description'] = 'Popis';
+
+$labels['previousmessage']  = 'Zobrazit předchozí zprávu';
+$labels['firstmessage']     = 'Zobrazit první zprávu';
+$labels['firstmessages']    = 'Zobrazit první zprávy';
+$labels['nextmessage']      = 'Zobrazit další zprávu';
+$labels['lastmessage']      = 'Zobrazit poslední zprávu';
+$labels['lastmessages']     = 'Zobrazit poslední zprávy';
+$labels['quicksearch']  = 'Rychlé vyhledávání';
+$labels['resetsearch']  = 'Zrušit vyhledávání';
+$labels['editortype'] = 'Typ editoru zpráv';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Prostý text';
+$labels['firstpage']  = 'Zobrazit první zprávy';
+$labels['lastpage']   = 'Zobrazit poslední zprávy';
+$labels['groups'] = 'Skupiny';
+$labels['personaladrbook'] = 'Osobní kontakty';
+$labels['htmleditor'] = 'Vytvářet HTML zprávy';
+$labels['htmlsignature'] = 'HTML podpis';
+$labels['previewpane'] = 'Zobrazit panel náhledu';
+$labels['autosavedraft']  = 'Automaticky uložit rozepsané zprávy';
+$labels['everynminutes']  = 'každých $n minut';
+$labels['never']  = 'nikdy';
+
+
+?>
diff --git a/program/localization/cz/messages.inc b/program/localization/cz/messages.inc
new file mode 100755 (executable)
index 0000000..106f3df
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/cz/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | All rights reserved.                                                  |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Martin Mrajca <martin@moonlake.cz>                            |
+ |        joe <joe@humlak.cz>                                            |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 553 2007-05-13 16:31:19Z thomasb $
+
+*/
+
+$messages = array();
+
+$messages['loginfailed']  = 'Přihlášení selhalo';
+$messages['cookiesdisabled'] = 'Váš prohlížeč nepodporuje cookies, které jsou pro přihlášení nezbytné';
+$messages['sessionerror'] = 'Vaše přihlášení je neplatné nebo vypršelo';
+$messages['imaperror'] = 'Připojení na IMAP server selhalo';
+$messages['nomessagesfound'] = 'Ve schránce nebyla nalezena žádná zpráva';
+$messages['loggedout'] = 'Byli jste úspěšně odhlášeni. Nashledanou!';
+$messages['mailboxempty'] = 'Schránka je prázdná';
+$messages['loadingdata'] = 'Načítám data...';
+$messages['messagesent'] = 'Zpráva byla odeslána';
+$messages['successfullysaved'] = 'Uloženo';
+$messages['addedsuccessfully'] = 'Kontakt byl úspěšně přidán do adresáře';
+$messages['contactexists'] = 'Kontakt se zadanou e-mailovou adresou již existuje';
+$messages['blockedimages'] = 'Z bezpečnostních důvodů byly zablokovány obrázky ve zprávě.';
+$messages['encryptedmessage'] = 'Tato zpráva je zašifrovaná a nelze ji zobrazit.';
+$messages['nocontactsfound'] = 'Nemáte žádné kontakty';
+$messages['sendingfailed'] = 'Odesílání zprávy selhalo';
+$messages['errorsaving'] = 'Vyskytla se chyba při ukládání';
+$messages['errormoving'] = 'Nemohu přesunout zprávu';
+$messages['errordeleting'] = 'Nemohu smazat zprávu';
+$messages['loading'] = 'Načítám...';
+$messages['sendingmessage'] = 'Odesílám zprávu...';
+$messages['noemailwarning'] = 'Zadejte, prosím, platnou adresu';
+$messages['nonamewarning']  = 'Zadejte, prosím, jméno';
+$messages['nopagesizewarning'] = 'Zadejte, prosím, velikost stránky';
+$messages['formincomplete']    = 'Formulář nebyl korektně vyplněn';
+$messages['norecipientwarning'] = 'Zadejte, prosím, alespoň jednoho příjemce';
+$messages['nosubjectwarning']  = 'Předmět nebyl vyplňen. Přejete si jej zadat nyní?';
+$messages['nobodywarning'] = 'Opravdu chtete odeslat prázdnou zprávu?';
+$messages['deletefolderconfirm']  = 'Chcete opravdu smazat tento adresář?';
+$messages['notsentwarning'] = 'Zpráva nebyla odeslána. Přejete si zprávu zahodit?';
+$messages['noldapserver'] = 'Zvolte, prosím, LDAP server k hledání';
+$messages['nocontactsreturned'] = 'Nebyly nalezeny žádné kontakty';
+$messages['nosearchname'] = 'Zadejte, prosím, jméno nebo e-mail kontaktu';
+$messages['checking'] = 'Kontroluji...';
+$messages['nospellerrors'] = 'Nebyly nalezeny žádné chyby';
+$messages['checkingmail'] = 'Kontroluji nové zprávy...';
+$messages['savingmessage'] = 'Ukládám zprávu...';
+$messages['messagesaved'] = 'Zpráva uložena do Rozepsané';
+$messages['folderdeleted'] = 'Složka byla úspěšně vymazána';
+
+$messages['contactnotfound'] = 'Požadovaný kontakt nebyl nalezen.';
+$messages['deletecontactconfirm']  = 'Opravdu chcete smazat označené kontakty?';
+$messages['deletemessagesconfirm'] = 'Opravdu chcete smazat označené zprávy?';
+$messages['purgefolderconfirm']  = 'Opravdu chcete smazat všechny zprávy v této složce?';
+$messages['searchsuccessful'] = '$nr zpráv nalezeno';
+$messages['searchnomatch'] = 'Nenalezena žádná zpráva';
+$messages['searching'] = 'Vyhledávám...';
+$messages['deletedsuccessfully'] = "Úspěšně smazáno";
+$messages['converting'] = 'Odstranuji formátování ze zprávy...';
+$messages['messageopenerror'] = 'Nemohu načíst zprávu ze serveru';
+$messages['fileuploaderror'] = 'Nahrávání souboru selhalo';
+$messages['filesizeerror'] = 'Soubor přesáhl maximální velikost $size';
+$messages['copysuccess'] = 'Úspěšně zkopírováno $nr adres';
+$messages['copyerror'] = 'Nemohu zkopírovat žádnou adresu';
+$messages['sourceisreadonly'] = 'Tento zdroj adres je pouze pro čtení';
+$messages['errorsavingcontact'] = 'Nemohu uložit adresu kontaktu';
+
+?>
diff --git a/program/localization/da/labels.inc b/program/localization/da/labels.inc
new file mode 100644 (file)
index 0000000..923733b
--- /dev/null
@@ -0,0 +1,182 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/da/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | All rights reserved.                                                  |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Martin Moeller <martin@liga.dk>                               |
+ |         Jesper R. Meyer <jrm@upthere.dk>                              |
+ |         Søren Aggeboe <soren@aggeboe.dk>                              |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 553 2007-05-13 16:31:19Z thomasb $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Velkommen til $product';
+$labels['username'] = 'Brugernavn';
+$labels['password'] = 'Adgangskode';
+$labels['server'] = 'Server';
+$labels['login'] = 'Log på';
+$labels['logout'] = 'Log af';
+$labels['mail'] = 'Email';
+$labels['settings'] = 'Personlige indstillinger';
+$labels['addressbook'] = 'Adressebog';
+$labels['inbox'] = 'Indbakke';
+$labels['drafts'] = 'Kladder';
+$labels['sent'] = 'Sendt post';
+$labels['trash'] = 'Skrald';
+$labels['junk'] = 'Ragelse';
+$labels['subject'] = 'Emne';
+$labels['from'] = 'Afsender';
+$labels['to'] = 'Modtager';
+$labels['cc'] = 'Kopi til';
+$labels['bcc'] = 'BCC';
+$labels['replyto'] = 'Svar til';
+$labels['date'] = 'Dato';
+$labels['size'] = 'Størrelse';
+$labels['priority'] = 'Prioritet';
+$labels['organization'] = 'Organisation';
+$labels['reply-to'] = 'Svar til';
+$labels['mailboxlist'] = 'Mapper';
+$labels['messagesfromto'] = 'Beskeder $from til $to af $count';
+$labels['messagenrof'] = 'Besked $nr af $count';
+$labels['moveto'] = 'flyt til...';
+$labels['download'] = 'download';
+$labels['filename'] = 'Filnavn';
+$labels['filesize'] = 'Filstørrelse';
+$labels['preferhtml'] = 'Foretræk HTML';
+$labels['htmlmessage'] = 'HTML-besked';
+$labels['prettydate'] = 'Pæn datovisning';
+$labels['addtoaddressbook'] = 'Tilføj til adressebogen';
+$labels['sun'] = 'Søn';
+$labels['mon'] = 'Man';
+$labels['tue'] = 'Tir';
+$labels['wed'] = 'Ons';
+$labels['thu'] = 'Tor';
+$labels['fri'] = 'Fre';
+$labels['sat'] = 'Lør';
+$labels['sunday'] = 'Søndag';
+$labels['monday'] = 'Mandag';
+$labels['tuesday'] = 'Tirsdag';
+$labels['wednesday'] = 'Onsdag';
+$labels['thursday'] = 'Torsdag';
+$labels['friday'] = 'Fredag';
+$labels['saturday'] = 'Lørdag';
+$labels['today'] = 'I dag';
+$labels['checkmail'] = 'Se efter nye beskeder';
+$labels['writenewmessage'] = 'Skriv en ny besked';
+$labels['replytomessage'] = 'Svar på denne besked';
+$labels['replytoallmessage'] = 'Svar til alle modtagere';
+$labels['forwardmessage'] = 'Videresend denne besked';
+$labels['deletemessage'] = 'Flyt beskeden til skrald';
+$labels['printmessage'] = 'Udskriv denne besked';
+$labels['previousmessage'] = 'Vis forrige besked';
+$labels['previousmessages'] = 'Vis forrige sæt beskeder';
+$labels['firstmessage'] = 'Vis første besked';
+$labels['firstmessages'] = 'Vis første sæt beskeder';
+$labels['nextmessage'] = 'Vis næste besked';
+$labels['nextmessages'] = 'Vis næste sæt beskeder';
+$labels['lastmessage'] = 'Vis sidste besked';
+$labels['lastmessages'] = 'Vis sidste sæt beskeder';
+$labels['backtolist'] = 'Tilbage til beskedlisten';
+$labels['viewsource'] = 'Vis rå besked';
+$labels['select'] = 'Vælg';
+$labels['all'] = 'Alle';
+$labels['none'] = 'Ingen';
+$labels['unread'] = 'Ulæste';
+$labels['compact'] = 'Ryd op';
+$labels['empty'] = 'Tøm';
+$labels['purge'] = 'Udrens';
+$labels['quota'] = 'Disk forbrug';
+$labels['unknown'] = 'ukendt';
+$labels['unlimited'] = 'ubegrænset';
+$labels['quicksearch'] = 'Hurtigsøgning';
+$labels['resetsearch'] = 'Nulstil søgning';
+$labels['compose'] = 'Forfat en besked';
+$labels['sendmessage'] = 'Send beskeden nu';
+$labels['savemessage'] = 'Gem denne kladde';
+$labels['addattachment'] = 'Vedhæft en fil';
+$labels['charset'] = 'Tegnsæt';
+$labels['editortype'] = 'Tekstbehandler';
+$labels['returnreceipt'] = 'Anmod om kvittering';
+$labels['checkspelling'] = 'Stavekontrol';
+$labels['resumeediting'] = 'Genoptag redigering';
+$labels['revertto'] = 'Vend tilbage til';
+$labels['attachments'] = 'Vedhæftninger';
+$labels['upload'] = 'Upload';
+$labels['close'] = 'Luk';
+$labels['low'] = 'Lav';
+$labels['lowest'] = 'Lavest';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Høj';
+$labels['highest'] = 'Højest';
+$labels['nosubject'] = '(intet emne)';
+$labels['showimages'] = 'Vis billeder';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Almindelig tekst';
+$labels['name'] = 'Vist navn';
+$labels['firstname'] = 'Fornavn';
+$labels['surname'] = 'Efternavn';
+$labels['email'] = 'Email';
+$labels['addcontact'] = 'Tilføj en ny kontakt';
+$labels['editcontact'] = 'Redigér kontakt';
+$labels['edit'] = 'Redigér';
+$labels['cancel'] = 'Afbryd';
+$labels['save'] = 'Gem';
+$labels['delete'] = 'Slet';
+$labels['newcontact'] = 'Opret nyt kontaktkort';
+$labels['deletecontact'] = 'Slet valgte kontakter';
+$labels['composeto'] = 'Skriv brev til';
+$labels['contactsfromto'] = 'Kontakter $from til $to af $count';
+$labels['print'] = 'Print';
+$labels['export'] = 'Eksport';
+$labels['previouspage'] = 'Vis forrige sæt';
+$labels['firstpage'] = 'Vis første sæt';
+$labels['nextpage'] = 'Vis næste sæt';
+$labels['lastpage'] = 'Vis sidste sæt';
+$labels['groups'] = 'Grupper';
+$labels['personaladrbook'] = 'Personlige Adresser';
+$labels['settingsfor'] = 'Indstillinger for';
+$labels['preferences'] = 'Præferencer';
+$labels['userpreferences'] = 'Brugerpræferencer';
+$labels['editpreferences'] = 'Redigér brugerpræferencer';
+$labels['identities'] = 'Identiteter';
+$labels['manageidentities'] = 'Styr identiteterne for denne konto';
+$labels['newidentity'] = 'Ny identitet';
+$labels['newitem'] = 'Nyt punkt';
+$labels['edititem'] = 'Redigér punkt';
+$labels['setdefault'] = 'Sæt standard';
+$labels['language'] = 'Sprog';
+$labels['timezone'] = 'Tidszone';
+$labels['pagesize'] = 'Rækker per side';
+$labels['signature'] = 'Signatur';
+$labels['dstactive'] = 'Sommertid';
+$labels['htmleditor'] = 'Skriv HTML-besked';
+$labels['htmlsignature'] = 'HTML-signatur';
+$labels['previewpane'] = 'Forhåndsvisning';
+$labels['autosavedraft'] = 'Gem kladde automatisk';
+$labels['everynminutes'] = 'hver $n. minut';
+$labels['never'] = 'aldrig';
+$labels['folder'] = 'Mapper';
+$labels['folders'] = 'Mapper';
+$labels['foldername'] = 'Mappenavn';
+$labels['subscribed'] = 'Abonneret';
+$labels['create'] = 'Opret';
+$labels['createfolder'] = 'Opret ny mappe';
+$labels['rename'] = 'Omdøb';
+$labels['renamefolder'] = 'Omdøb mappe';
+$labels['deletefolder'] = 'Slet mappe';
+$labels['managefolders'] = 'Administrér mapper';
+$labels['sortby'] = 'Sortér efter';
+$labels['sortasc'] = 'Ældste først';
+$labels['sortdesc'] = 'Nyeste først';
+
+?>
diff --git a/program/localization/da/messages.inc b/program/localization/da/messages.inc
new file mode 100644 (file)
index 0000000..6d14f8e
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/da/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | All rights reserved.                                                  |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author : Martin Moeller <martin@liga.dk>                              |
+ |         Jesper R. Meyer <jesper@upthere.dk>                           |
+ |         Søren Aggeboe <soren@aggeboe.dk>                              |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 553 2007-05-13 16:31:19Z thomasb $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Det lykkedes ikke at logge på';
+$messages['cookiesdisabled'] = 'Din browser accepterer ikke cookies';
+$messages['sessionerror'] = 'Din session er ugyldig eller udløbet';
+$messages['imaperror'] = 'Forbindelse til IMAP serveren fejlede';
+$messages['nomessagesfound'] = 'Der blev ikke fundet nogen beskeder i denne postkasse';
+$messages['loggedout'] = 'Du er nu logget af webmail. Farvel så længe!';
+$messages['mailboxempty'] = 'Postkassen er tom!';
+$messages['loading'] = 'Indlæser...';
+$messages['loadingdata'] = 'Indlæser data...';
+$messages['checkingmail'] = 'Tjekker for nye beskeder...';
+$messages['sendingmessage'] = 'Sender besked...';
+$messages['messagesent'] = 'Beskeden blev sendt korrekt';
+$messages['savingmessage'] = 'Gemmer besked...';
+$messages['messagesaved'] = 'Beskeden er gemt i kladdemappen';
+$messages['successfullysaved'] = 'Det lykkedes at gemme';
+$messages['addedsuccessfully'] = 'Kontakten blev tilføjet adressebogen';
+$messages['contactexists'] = 'Der er allerede en kontakt med denne email adresse';
+$messages['blockedimages'] = 'For at beskytte dit privatliv er billeder fra internetservere blokeret i denne besked.';
+$messages['encryptedmessage'] = 'Beskeden er krypteret og kan ikke vises. Beklager!';
+$messages['nocontactsfound'] = 'Ingen kontakter blev fundet';
+$messages['contactnotfound'] = 'Den søgte kontakt blev ikke fundet';
+$messages['sendingfailed'] = 'Kunne ikke sende beskeden';
+$messages['errorsaving'] = 'Der opstod en fejl ved lagring af data';
+$messages['errormoving'] = 'Kunne ikke flytte beskeden';
+$messages['errordeleting'] = 'Kunne ikke slette beskeden';
+$messages['deletecontactconfirm'] = 'Vil du virkelig slette den/de valgte kontakt(er)?';
+$messages['deletemessagesconfirm'] = 'Vil du virkelig slette den/de valgte besked(er)?';
+$messages['deletefolderconfirm'] = 'Vil du virkelig slette den vagte mappe';
+$messages['purgefolderconfirm'] = 'Vil du virkelig slette alle beskeder i denne mappe?';
+$messages['formincomplete'] = 'Formularen var ikke fuldstændig fyldt ud';
+$messages['noemailwarning'] = 'Indtast venligst en gyldig email adresse';
+$messages['nonamewarning'] = 'Angiv venligst et navn';
+$messages['nopagesizewarning'] = 'Angiv sidestørrelsen';
+$messages['norecipientwarning'] = 'Indtast mindst én modtager';
+$messages['nosubjectwarning'] = '\'Emne\'-feltet er tomt. Kunne du tænke dig at skrive et nu?';
+$messages['nobodywarning'] = 'Send denne besked uden tekst?';
+$messages['notsentwarning'] = 'Beskeden er ikke blevet sendt. Vil du kassere din besked?';
+$messages['noldapserver'] = 'Vælg venligst hvilken LDAP-server der skal søges i';
+$messages['nocontactsreturned'] = 'Ingen kontakter blev fundet';
+$messages['nosearchname'] = 'Indtast venligst en kontakts navn eller email adresse';
+$messages['searchsuccessful'] = 'Fandt $nr beskeder';
+$messages['searchnomatch'] = 'Søgningen fandt ingen beskeder';
+$messages['searching'] = 'Søger...';
+$messages['checking'] = 'Tjekker...';
+$messages['nospellerrors'] = 'Ingen stavefejl fundet';
+$messages['folderdeleted'] = 'Mappen blev slettet korrekt';
+$messages['deletedsuccessfully'] = 'Slettet korrekt';
+$messages['converting'] = 'Fjerner formatering fra besked...';
+$messages['messageopenerror'] = 'Beskeden kunne ikke hentes fra serveren';
+$messages['fileuploaderror'] = 'Den indsatte fil fejlede';
+$messages['filesizeerror'] = 'Den indsatte fil fylder mere end det maksimale på $size';
+$messages['copysuccess'] = 'Det lykkedes at kopiere $nr adresser';
+$messages['copyerror'] = 'Kunne ikke kopiere adresserne';
+$messages['sourceisreadonly'] = 'Denne adressekilde er kun til læsning';
+$messages['errorsavingcontact'] = 'Kunne ikke gemme kontakt adressen';
+
+?>
index 49069d651a42ce8dbb6039cbefe23a2f5957b8cc..0456ff272731a6f5b3c9331177a3df06bd5c7ad8 100644 (file)
@@ -1,11 +1,12 @@
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/de_CH/labels.inc                                             |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
@@ -13,7 +14,7 @@
  | Corrections: Alexander Stiebing <ja.stiebing[NOSPAM]@web.de>          |
  +-----------------------------------------------------------------------+
 
$Id: labels.inc 282 2006-07-25 22:11:50Z thomasb $
@version $Id: labels.inc 549 2007-05-01 18:53:56Z thomasb $
 
 */
 
@@ -98,9 +99,16 @@ $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['previousmessage']  = 'Vorherige Nachricht anzeigen';
 $labels['previousmessages'] = 'Vorherige Nachrichten anzeigen';
+$labels['firstmessage']     = 'Die erste Nachricht anzeigen';
+$labels['firstmessages']    = 'Die ersten Nachrichten anzeigen';
+$labels['nextmessage']      = 'Nächste Nachricht anzeigen';
 $labels['nextmessages']     = 'Weitere Nachrichten anzeigen';
+$labels['lastmessage']      = 'Die letzte Nachricht anzeigen';
+$labels['lastmessages']     = 'Die letzten Nachrichten anzeigen';
 $labels['backtolist']       = 'Zurück zur Liste';
+$labels['viewsource']       = 'Quelltext anzeigen';
 
 $labels['select'] = 'Auswählen';
 $labels['all']    = 'Alle';
@@ -125,6 +133,7 @@ $labels['savemessage']  = 'Nachricht speichern';
 $labels['sendmessage']  = 'Nachricht jetzt senden';
 $labels['addattachment']  = 'Datei anfügen';
 $labels['charset']  = 'Zeichensatz';
+$labels['editortype'] = 'Editor-Typ';
 $labels['returnreceipt'] = 'Empfangsbestätigung';
 
 $labels['checkspelling'] = 'Rechtschreibung prüfen';
@@ -144,6 +153,9 @@ $labels['highest'] = 'Höchste';
 $labels['nosubject']  = '(kein Betreff)';
 $labels['showimages'] = 'Bilder anzeigen';
 
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Klartext';
+
 
 // address book // Adressbuch
 $labels['name']      = 'Anzeigename';
@@ -167,17 +179,13 @@ $labels['print']          = 'Drucken';
 $labels['export']         = 'Exportieren';
 
 $labels['previouspage']   = 'Eine Seite zurück';
+$labels['firstpage']      = 'Erste Seite';
 $labels['nextpage']       = 'Nächste Seite';
+$labels['lastpage']      = 'Letzte Seite';
 
-// LDAP search
-$labels['ldapsearch'] = 'LDAP Verzeichnis-Suche';
+$labels['groups'] = 'Gruppen';
+$labels['personaladrbook'] = 'Persönliches Adressbuch';
 
-$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';
@@ -199,6 +207,13 @@ $labels['timezone']  = 'Zeitzone';
 $labels['pagesize']  = 'Einträge pro Seite';
 $labels['signature'] = 'Signatur';
 $labels['dstactive']  = 'Sommerzeit';
+$labels['htmleditor'] = 'HTML-Nachrichten verfassen';
+$labels['htmlsignature'] = 'HTML-Signatur';
+$labels['previewpane'] = 'Nachrichtenvorschau anzeigen';
+
+$labels['autosavedraft']  = 'Entwurf autom. speichern';
+$labels['everynminutes']  = 'alle $n Minuten';
+$labels['never']  = 'nie';
 
 $labels['folder']  = 'Ordner';
 $labels['folders']  = 'Ordner';
index 89bf714ea6753725959ce14dabaca2c1765fbc54..48a959105904566c50251f6c9bdaa9744e4f44ab 100644 (file)
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/de_CH/messages.inc                                           |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
$Id: messages.inc 285 2006-07-30 19:38:06Z thomasb $
@version $Id: messages.inc 549 2007-05-01 18:53:56Z thomasb $
 
 */
 
 $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 Nachrichten...';
-
 $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['contactnotfound'] = 'Die gewählte Adresse wurde nicht 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['deletemessagesconfirm'] = 'Wollen Sie die ausgewählten Nachrichten 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';
-
 $messages['folderdeleted'] = 'Ordner erfolgreich gelöscht';
-
+$messages['deletedsuccessfully'] = "Erfolgreich gelöscht";
+$messages['converting'] = 'Entferne Formatierungen...';
+$messages['messageopenerror'] = 'Die Nachricht konnte nicht vom Server geladen werden';
+$messages['fileuploaderror'] = 'Der Dateiupload ist fehlgeschlagen';
+$messages['filesizeerror'] = 'Die Datei überschreitet die maximale Grösse von $size';
+
+$messages['copysuccess'] = '$nr Adressen erfolgreich kopiert';
+$messages['copyerror'] = 'Die Adressen konnten nicht kopiert werden';
+$messages['sourceisreadonly'] = 'Das Adressverzeichnis kann nicht verändert werden';
+$messages['errorsavingcontact'] = 'Die Änderungen konnten nicht gespeichert werden';
 
 ?>
\ No newline at end of file
index 9865ab2685880d4112bd1620a2a4c965408a3ecf..c29841f2b13c8169d6be00f7d2328d0f5db5b2fc 100644 (file)
@@ -1,77 +1,59 @@
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/de_DE/labels.inc                                             |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
- | Author:      Thomas Bruederli <roundcube@gmail.com>                   |
- +-----------------------------------------------------------------------+
- | de_DE translation: Stephan Diehl <info@sd-edv.de>                     |
+ | Author: Stephan Diehl <info@sd-edv.de>                                |
  +-----------------------------------------------------------------------+
 
$Id: labels.inc 282 2006-07-25 22:11:50Z thomasb $
@version $Id: labels.inc 549 2007-05-01 18:53:56Z thomasb $
 
 */
 
 $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['welcome'] = 'Willkommen bei $product';
+$labels['username'] = 'Benutzername';
+$labels['password'] = 'Passwort';
+$labels['server'] = 'Server';
+$labels['login'] = 'Anmelden';
+$labels['logout'] = 'Abmelden';
+$labels['mail'] = 'E-Mail';
 $labels['settings'] = 'Einstellungen';
 $labels['addressbook'] = 'Adressbuch';
-
-// mailbox names // E-Mail-Ordnernamen
-$labels['inbox']  = 'Posteingang';
+$labels['inbox'] = 'Posteingang';
 $labels['drafts'] = 'Entwürfe';
-$labels['sent']   = 'Gesendet';
-$labels['trash']  = 'Gelöscht';
-$labels['junk']   = 'Spam';
-
-// message listing // Nachrichtenliste
+$labels['sent'] = 'Gesendet';
+$labels['trash'] = 'Gelöscht';
+$labels['junk'] = 'Spam';
 $labels['subject'] = 'Betreff';
-$labels['from']    = 'Absender';
-$labels['to']      = 'Empfänger';
-$labels['cc']      = 'Kopie (CC)';
-$labels['bcc']     = 'Blind-Kopie';
+$labels['from'] = 'Absender';
+$labels['to'] = 'Empfänger';
+$labels['cc'] = 'Kopie';
+$labels['bcc'] = 'Blindkopie';
 $labels['replyto'] = 'Antwort an';
-$labels['date']    = 'Datum';
-$labels['size']    = 'Größe';
+$labels['date'] = 'Datum';
+$labels['size'] = 'Größe';
 $labels['priority'] = 'Priorität';
 $labels['organization'] = 'Organisation';
-
-// aliases // [Platzhalter]
-$labels['reply-to'] = $labels['replyto'];
-
+$labels['reply-to'] = 'Antwort an';
 $labels['mailboxlist'] = 'Ordner';
 $labels['messagesfromto'] = 'Nachrichten $from bis $to von $count';
 $labels['messagenrof'] = 'Nachricht $nr von $count';
-
-$labels['moveto']   = 'Verschieben nach...';
+$labels['moveto'] = 'Verschieben nach...';
 $labels['download'] = 'Download';
-
 $labels['filename'] = 'Dateiname';
 $labels['filesize'] = 'Dateigröße';
-
-$labels['preferhtml'] = 'HTML bevorzugen';
-$labels['htmlmessage'] = 'HTML Nachricht';
+$labels['preferhtml'] = 'HTML anzeigen';
+$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';
@@ -79,141 +61,120 @@ $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['sunday'] = 'Sonntag';
+$labels['monday'] = 'Montag';
+$labels['tuesday'] = 'Dienstag';
 $labels['wednesday'] = 'Mittwoch';
-$labels['thursday']  = 'Donnerstag';
-$labels['friday']    = 'Freitag';
-$labels['saturday']  = 'Samstag';
-
+$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['checkmail'] = 'Auf neue Nachrichten überprüfen';
+$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['forwardmessage'] = 'Nachricht weiterleiten';
+$labels['deletemessage'] = 'Nachricht in den Papierkorb verschieben';
+$labels['printmessage'] = 'Diese Nachricht drucken';
+$labels['previousmessage'] = 'Vorherige Nachricht anzeigen';
 $labels['previousmessages'] = 'Vorherige Nachrichten anzeigen';
-$labels['nextmessages']     = 'Weitere Nachrichten anzeigen';
-$labels['backtolist']       = 'Zurück zur Liste';
-
+$labels['firstmessage'] = 'Die erste Nachricht anzeigen';
+$labels['firstmessages'] = 'Die ersten Nachrichten anzeigen';
+$labels['nextmessage'] = 'Nächste Nachricht anzeigen';
+$labels['nextmessages'] = 'Weitere Nachrichten anzeigen';
+$labels['lastmessage'] = 'Die letzte Nachricht anzeigen';
+$labels['lastmessages'] = 'Die letzten Nachrichten anzeigen';
+$labels['backtolist'] = 'Zurück zur Liste';
+$labels['viewsource'] = 'Quelltext anzeigen';
 $labels['select'] = 'Auswählen';
-$labels['all']    = 'Alle';
-$labels['none']   = 'Keine';
+$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['quota'] = 'Speicherplatz';
+$labels['unknown'] = 'unbekannt';
+$labels['unlimited'] = 'unbegrenzt';
+$labels['quicksearch'] = 'Schnellsuche';
+$labels['resetsearch'] = 'Suche zurücksetzen';
+$labels['compose'] = 'Neue Nachricht verfassen';
+$labels['sendmessage'] = 'Nachricht jetzt senden';
+$labels['savemessage'] = 'Nachricht speichern';
+$labels['addattachment'] = 'Datei anfügen';
+$labels['charset'] = 'Zeichensatz';
+$labels['editortype'] = 'Editor Typ';
 $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['close'] = 'Schließen';
+$labels['low'] = 'Niedrig';
+$labels['lowest'] = 'Niedrigste';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Hoch';
 $labels['highest'] = 'Höchste';
-
-$labels['nosubject']  = '(kein Betreff)';
+$labels['nosubject'] = '(kein Betreff)';
 $labels['showimages'] = 'Bilder anzeigen';
-
-
-// address book // Adressbuch
-$labels['name']      = 'Anzeigename';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Nur-Text';
+$labels['name'] = 'Anzeigename';
 $labels['firstname'] = 'Vorname';
-$labels['surname']   = 'Nachname';
-$labels['email']     = 'E-Mail';
-
+$labels['surname'] = 'Nachname';
+$labels['email'] = 'E-Mail';
 $labels['addcontact'] = 'Kontakt hinzufügen';
 $labels['editcontact'] = 'Kontakt bearbeiten';
-
-$labels['edit']   = 'Bearbeiten';
+$labels['edit'] = 'Bearbeiten';
 $labels['cancel'] = 'Abbrechen';
-$labels['save']   = 'Speichern';
+$labels['save'] = 'Speichern';
 $labels['delete'] = 'Löschen';
-
-$labels['newcontact']     = 'Neuen Kontakt erfassen';
-$labels['deletecontact']  = 'Gewählte Kontakte löschen';
-$labels['composeto']      = 'Nachricht verfassen';
+$labels['newcontact'] = 'Neuen Kontakt erstellen';
+$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['print'] = 'Drucken';
+$labels['export'] = 'Exportieren';
+$labels['previouspage'] = 'Seite zurück';
+$labels['firstpage'] = 'Erste Seite';
+$labels['nextpage'] = 'Nächste Seite';
+$labels['lastpage'] = 'Letzte Seite';
+$labels['groups'] = 'Gruppen';
+$labels['personaladrbook'] = 'Persönliches Adressbuch';
+$labels['settingsfor'] = 'Einstellungen für';
+$labels['preferences'] = 'Einstellungen';
+$labels['userpreferences'] = 'Benutzereinstellungen';
+$labels['editpreferences'] = 'Benutzereinstellungen 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['dstactive'] = 'Sommerzeit';
+$labels['htmleditor'] = 'HTML-Nachrichten erstellen';
+$labels['htmlsignature'] = 'HTML-Signatur';
+$labels['previewpane'] = 'Vorschaufenster anzeigen';
+$labels['autosavedraft'] = 'Entwurf automatisch speichern';
+$labels['everynminutes'] = 'alle $n Minuten';
+$labels['never'] = 'nie';
+$labels['folder'] = 'Ordner';
+$labels['folders'] = 'Ordner';
+$labels['foldername'] = 'Ordnername';
+$labels['subscribed'] = 'Abonniert';
+$labels['create'] = 'Erstellen';
+$labels['createfolder'] = 'Neuen Ordner erstellen';
 $labels['rename'] = 'Umbenennen';
 $labels['renamefolder'] = 'Ordner umbenennen';
-$labels['deletefolder']  = 'Ordner löschen';
-$labels['managefolders']  = 'Ordner verwalten';
-
+$labels['deletefolder'] = 'Ordner löschen';
+$labels['managefolders'] = 'Ordner verwalten';
 $labels['sortby'] = 'Sortieren nach';
-$labels['sortasc']  = 'aufsteigend sortieren';
-$labels['sortdesc'] = 'absteigend sortieren';
+$labels['sortasc'] = 'Aufsteigend sortieren';
+$labels['sortdesc'] = 'Absteigend sortieren';
 
-?>
+?>
\ No newline at end of file
index 347d898a9296641f018a6076e5be4ab2fa7ee722..f742eaea382b788a3f8a77ded6c4561248e89a95 100644 (file)
-<?php
+<?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/de_DE/messages.inc                                           |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
- | Author: Thomas Bruederli <roundcube@gmail.com>                        |
- +-----------------------------------------------------------------------+
- | de_DE translation: Stephan Diehl <info@sd-edv.de>                     |
+ | Author: Stephan Diehl <info@sd-edv.de>                                |
  +-----------------------------------------------------------------------+
 
$Id: messages.inc 285 2006-07-30 19:38:06Z thomasb $
@version $Id: messages.inc 557 2007-05-15 06:41:32Z yllar $
 
 */
 
 $messages = array();
-
-$messages['loginfailed']  = 'Anmelden fehlgeschlagen';
-
+$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['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['loading'] = 'Lade...';
+$messages['loadingdata'] = 'Daten werden geladen...';
 $messages['checkingmail'] = 'Überprüfung auf neue Nachrichten...';
-
 $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['encryptedmessage'] = 'Dies ist eine verschlüsselte Nachricht und kann leider nicht angezeigt werden. Sorry!';
 $messages['nocontactsfound'] = 'Keine Kontakte gefunden';
-
-$messages['sendingfailed'] = 'Versand der Nachricht fehlgeschlagen';
-
+$messages['contactnotfound'] = 'Der angeforderte Kontakt wurde nicht gefunden';
+$messages['sendingfailed'] = 'Versenden 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['deletecontactconfirm'] = 'Wollen Sie die ausgewählten Kontakte wirklich löschen?';
+$messages['deletemessagesconfirm'] = 'Wollen Sie die ausgewählten Nachrichten 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 die Einträge pro Seite an';
 $messages['norecipientwarning'] = 'Bitte geben Sie mindestens einen Empfänger an';
-
-$messages['nosubjectwarning']  = 'Die Betreffzeile ist leer. Möchten Sie jetzt einen Betreff eingeben?';
-
+$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';
-
 $messages['folderdeleted'] = 'Ordner erfolgreich gelöscht';
+$messages['deletedsuccessfully'] = 'Erfolgreich gelöscht';
+$messages['converting'] = 'Entferne Formatierung der Nachricht...';
+$messages['messageopenerror'] = 'Die Nachricht konnte nicht vom Server geladen werden';
+$messages['fileuploaderror'] = 'Hochladen der Datei fehlgeschlagen';
+$messages['filesizeerror'] = 'Die hochzuladende Datei überschreitet die Maximalgröße von $size';
+$messages['copysuccess'] = '$nr Adressen erfolgreich kopiert';
+$messages['copyerror'] = 'Die Adressen konnten nicht kopiert werden';
+$messages['sourceisreadonly'] = 'Das Adressverzeichnis kann nicht verändert werden';
+$messages['errorsavingcontact'] = 'Die Änderungen konnten nicht gespeichert werden';
 
 ?>
\ No newline at end of file
index 9d4e76bc1f5df50aee083dc43a6e410b7b380ffb..83e204a58a83d5c30e9af9b9b4b48f1727e6301d 100644 (file)
@@ -1,18 +1,19 @@
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/en_GB/labels.inc                                             |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Weiran Zhang (weiran@weiran.co.uk)                            |
  +-----------------------------------------------------------------------+
 
$Id: labels.inc 296 2006-08-06 15:53:41Z thomasb $
@version $Id: labels.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
@@ -157,15 +158,6 @@ $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';
@@ -200,4 +192,4 @@ $labels['sortby'] = 'Sort by';
 $labels['sortasc']  = 'Sort ascending';
 $labels['sortdesc'] = 'Sort descending';
 
-?>
+?>
\ No newline at end of file
index 875df4f6e1323a0cf3c0716b457278c2252ac25e..cc31bf28e64b7880af41d971b3967d9cabb21649 100644 (file)
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/en_GB/messages.inc                                           |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Weiran Zhang (weiran@weiran.co.uk)                            |
  +-----------------------------------------------------------------------+
 
$Id: messages.inc 285 2006-07-30 19:38:06Z thomasb $
@version $Id: messages.inc 466 2007-02-06 09:17:01Z tomekp $
 
 */
 
 $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';
-
 $messages['searchsuccessful'] = '$nr messages found';
-
 $messages['searchnomatch'] = 'Search returned no matches';
-
 $messages['searching'] = 'Searching...';
-
 $messages['checking'] = 'Checking...';
-
 $messages['nospellerrors'] = 'No spelling errors found';
-
 $messages['folderdeleted'] = 'Folder successfully deleted';
 
-
-?>
+?>
\ No newline at end of file
index 8f51769a87128228c3bc1fe2e39d6575dddb8d56..b24ac0e7c104b110bb85a12ed88642d12b2edc16 100644 (file)
@@ -1,18 +1,19 @@
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/en_US/labels.inc                                             |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
$Id: labels.inc 296 2006-08-06 15:53:41Z thomasb $
@version $Id: labels.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
@@ -63,7 +64,7 @@ $labels['download'] = 'download';
 $labels['filename'] = 'File name';
 $labels['filesize'] = 'File size';
 
-$labels['preferhtml'] = 'Prefer HTML';
+$labels['preferhtml'] = 'Display HTML';
 $labels['htmlmessage'] = 'HTML Message';
 $labels['prettydate'] = 'Pretty dates';
 
@@ -97,8 +98,14 @@ $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['previousmessage']  = 'Show the previous message';
 $labels['previousmessages'] = 'Show previous set of messages';
+$labels['firstmessage']     = 'Show the first message';
+$labels['firstmessages']    = 'Show first set of messages';
+$labels['nextmessage']      = 'Show the next message';
 $labels['nextmessages']     = 'Show next set of messages';
+$labels['lastmessage']      = 'Show the last message';
+$labels['lastmessages']     = 'Show last set of messages';
 $labels['backtolist']       = 'Back to message list';
 $labels['viewsource']       = 'Show source';
 
@@ -120,16 +127,17 @@ $labels['resetsearch']  = 'Reset search';
 
 
 // message compose
-$labels['compose']  = 'Compose a message';
+$labels['compose']        = 'Compose a message';
+$labels['sendmessage']    = 'Send the message now';
 $labels['savemessage']  = 'Save this draft';
-$labels['sendmessage']  = 'Send the message now';
 $labels['addattachment']  = 'Attach a file';
-$labels['charset']  = 'Charset';
-$labels['returnreceipt'] = 'Return receipt';
+$labels['charset']        = 'Charset';
+$labels['editortype']     = 'Editor type';
+$labels['returnreceipt']  = 'Return receipt';
 
 $labels['checkspelling'] = 'Check spelling';
 $labels['resumeediting'] = 'Resume editing';
-$labels['revertto'] = 'Revert to';
+$labels['revertto']      = 'Revert to';
 
 $labels['attachments'] = 'Attachments';
 $labels['upload'] = 'Upload';
@@ -144,6 +152,9 @@ $labels['highest'] = 'Highest';
 $labels['nosubject']  = '(no subject)';
 $labels['showimages'] = 'Display images';
 
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Plain text';
+
 
 // address boook
 $labels['name']      = 'Display name';
@@ -167,18 +178,12 @@ $labels['print']          = 'Print';
 $labels['export']         = 'Export';
 
 $labels['previouspage']   = 'Show previous set';
+$labels['firstpage']      = 'Show first set';
 $labels['nextpage']       = 'Show next set';
+$labels['lastpage']       = 'Show last 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';
+$labels['groups'] = 'Groups';
+$labels['personaladrbook'] = 'Personal Addresses';
 
 
 // settings
@@ -201,6 +206,13 @@ $labels['timezone']  = 'Time zone';
 $labels['pagesize']  = 'Rows per page';
 $labels['signature'] = 'Signature';
 $labels['dstactive']  = 'Daylight savings';
+$labels['htmleditor'] = 'Compose HTML messages';
+$labels['htmlsignature'] = 'HTML signature';
+$labels['previewpane'] = 'Show preview pane';
+
+$labels['autosavedraft']  = 'Automatically save draft';
+$labels['everynminutes']  = 'every $n minutes';
+$labels['never']  = 'never';
 
 $labels['folder']  = 'Folder';
 $labels['folders']  = 'Folders';
@@ -217,4 +229,4 @@ $labels['sortby'] = 'Sort by';
 $labels['sortasc']  = 'Sort ascending';
 $labels['sortdesc'] = 'Sort descending';
 
-?>
+?>
\ No newline at end of file
index ada229cb9a242ffc24f4ea9ed7716fc160e84219..587c71a4fef4f117de7b51f8fe63bcfd63cfa900 100644 (file)
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/en/messages.inc                                              |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
$Id: messages.inc 285 2006-07-30 19:38:06Z thomasb $
@version $Id: messages.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
 $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['contactnotfound'] = 'The requested contact was not 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['deletemessagesconfirm'] = 'Do you really want to delete the selected message(s)?';
 $messages['deletefolderconfirm']  = 'Do you really want to delete this folder?';
-
 $messages['purgefolderconfirm']  = 'Do you really want to delete all messages in this folder?';
-
 $messages['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';
-
 $messages['folderdeleted'] = 'Folder successfully deleted';
-
+$messages['deletedsuccessfully'] = "Successfully deleted";
+$messages['converting'] = 'Removing formatting from message...';
+$messages['messageopenerror'] = 'Could not load message from server';
+$messages['fileuploaderror'] = 'File upload failed';
+$messages['filesizeerror'] = 'The uploaded file exceeds the maximum size of $size';
+
+$messages['copysuccess'] = 'Successfully copied $nr addresses';
+$messages['copyerror'] = 'Could not copy any addresses';
+$messages['sourceisreadonly'] = 'This address source is read only';
+$messages['errorsavingcontact'] = 'Could not save the contact address';
 
 ?>
index dde603324dbb3f2afc43583376c31d52229aa597..0c4cdb915a48ac5d36ec8273a912ba4487ab418d 100644 (file)
@@ -1,80 +1,62 @@
-<?php
+<?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/es/labels.inc                                                |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
- | Author: David Grajal Blanco <dgrabla@gmail.com>                       |
+ | Author: Javier Smaldone <javier@smaldone.com.ar>                      |
+ |         http://www.smaldone.com.ar                                    |
+ |         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.inc 282 2006-07-25 22:11:50Z thomasb $
@version $Id: labels.inc 552 2007-05-03 20:48:00Z yllar $
 
 */
 
 $labels = array();
-
-// login page
-$labels['welcome']   = 'Bienvenido a $product';
-$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['welcome'] = 'Bienvenido a $product';
+$labels['username'] = 'Nombre de usuario';
+$labels['password'] = 'Contraseña';
+$labels['server'] = 'Servidor';
+$labels['login'] = 'Entrar';
+$labels['logout'] = 'Cerrar sesión';
+$labels['mail'] = 'Correo';
 $labels['settings'] = 'Configuración';
 $labels['addressbook'] = 'Contactos';
-
-// mailbox names
-$labels['inbox']  = 'Entrada';
+$labels['inbox'] = 'Entrada';
 $labels['drafts'] = 'Borradores';
-$labels['sent']   = 'Enviados';
-$labels['trash']  = 'Papelera';
-$labels['junk']   = 'Basura';
-
-// message listing
+$labels['sent'] = 'Enviados';
+$labels['trash'] = 'Papelera';
+$labels['junk'] = 'Basura';
 $labels['subject'] = 'Asunto';
-$labels['from']    = 'Remitente';
-$labels['to']      = 'Destinatario';
-$labels['cc']      = 'Copia';
-$labels['bcc']     = 'Bcc';
+$labels['from'] = 'Remitente';
+$labels['to'] = 'Destinatario';
+$labels['cc'] = 'Copia';
+$labels['bcc'] = 'Bcc';
 $labels['replyto'] = 'Responder';
-$labels['date']    = 'Fecha';
-$labels['size']    = 'Tamaño';
+$labels['date'] = 'Fecha';
+$labels['size'] = 'Tamaño';
 $labels['priority'] = 'Prioridad';
 $labels['organization'] = 'Organización';
-
-// aliases
-$labels['reply-to'] = $labels['replyto'];
-
-$labels['mailboxlist'] = 'Carpetas';
+$labels['reply-to'] = 'Responder';
+$labels['mailboxlist'] = 'Bandejas';
 $labels['messagesfromto'] = 'Mensajes desde $from a $to de $count';
 $labels['messagenrof'] = 'Mensaje $nr de $count';
-
-$labels['moveto']   = 'mover a...';
+$labels['moveto'] = 'mover a...';
 $labels['download'] = 'descargar';
-
-$labels['filename'] = 'Nombre del fichero';
-$labels['filesize'] = 'Tamaño del fichero';
-
+$labels['filename'] = 'Nombre del archivo';
+$labels['filesize'] = 'Tamaño del archivo';
 $labels['preferhtml'] = 'Prefiero HTML';
 $labels['htmlmessage'] = 'Mensaje HTML';
 $labels['prettydate'] = 'Fecha detallada';
-
 $labels['addtoaddressbook'] = 'Añadir a contactos';
-
-// weekdays short
 $labels['sun'] = 'Dom';
 $labels['mon'] = 'Lun';
 $labels['tue'] = 'Mar';
@@ -82,144 +64,120 @@ $labels['wed'] = 'Mie';
 $labels['thu'] = 'Jue';
 $labels['fri'] = 'Vie';
 $labels['sat'] = 'Sáb';
-
-// 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['sunday'] = 'Domingo';
+$labels['monday'] = 'Lunes';
+$labels['tuesday'] = 'Martes';
+$labels['wednesday'] = 'Miércoles';
+$labels['thursday'] = 'Jueves';
+$labels['friday'] = 'Viernes';
+$labels['saturday'] = 'Sábado';
 $labels['today'] = 'Hoy';
-
-// toolbar buttons
-$labels['checkmail']        = 'Revisar si hay nuevos mensajes';
-$labels['writenewmessage']  = 'Crear nuevo mensaje';
-$labels['replytomessage']   = 'Responder al mensaje';
+$labels['checkmail'] = 'Revisar si hay nuevos mensajes';
+$labels['writenewmessage'] = 'Crear nuevo mensaje';
+$labels['replytomessage'] = 'Responder mensaje';
 $labels['replytoallmessage'] = 'Responder al emisor y a todos los destinatarios';
-$labels['forwardmessage']   = 'Reenviar mensaje';
-$labels['deletemessage']    = 'Mover mensaje a la papelera';
-$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['forwardmessage'] = 'Reenviar mensaje';
+$labels['deletemessage'] = 'Mover mensaje a la papelera';
+$labels['printmessage'] = 'Imprimir este mensaje';
+$labels['previousmessage'] = 'Mostrar mensaje anterior';
+$labels['previousmessages'] = 'Mostrar grupo anterior de mensajes';
+$labels['firstmessage'] = 'Mostrar primer mensaje';
+$labels['firstmessages'] = 'Mostrar primer grupo de mensajes';
+$labels['nextmessage'] = 'Mostrar siguente mensaje';
+$labels['nextmessages'] = 'Mostrar siguente grupo de mensajes';
+$labels['lastmessage'] = 'Mostrar último mensaje';
+$labels['lastmessages'] = 'Mostrar último grupo de mensajes';
+$labels['backtolist'] = 'Volver a la lista de mensajes';
+$labels['viewsource'] = 'Mostrar código';
+$labels['select'] = 'Elija';
 $labels['all'] = 'Todos';
 $labels['none'] = 'Ninguno';
-$labels['unread'] = 'No leidos';
-
-$labels['compact'] = 'Compactar';
-$labels['empty'] = 'Vaciar';
+$labels['unread'] = 'Sin leer';
+$labels['compact'] = 'Compacta';
+$labels['empty'] = 'Vacia';
 $labels['purge'] = 'Eliminar';
-
 $labels['quota'] = 'Uso de disco';
-$labels['unknown']  = 'desconocido';
-$labels['unlimited']  = 'sin límite';
-
-$labels['quicksearch']  = 'Búsqueda rápida';
-$labels['resetsearch']  = 'Reajustar la búsqueda';
-
-
-// message compose
-$labels['compose']  = 'Escribir un mensaje';
-$labels['savemessage']  = 'Almacenar como borrador';
-$labels['sendmessage']  = 'Enviar ahora el mensaje';
-$labels['addattachment']  = 'Añadir un fichero';
-$labels['charset']  = 'Codigo';
-$labels['returnreceipt'] = 'Recibo de entrega';
-
-$labels['checkspelling'] = 'Revisar la ortografía';
-$labels['resumeediting'] = 'Continuar el editaje';
+$labels['unknown'] = 'desconocido';
+$labels['unlimited'] = 'sin límite';
+$labels['quicksearch'] = 'Búsqueda rápida';
+$labels['resetsearch'] = 'Reajustar la búsqueda';
+$labels['compose'] = 'Escribir un mensaje';
+$labels['sendmessage'] = 'Enviar ahora el mensaje';
+$labels['savemessage'] = 'Guardar como borrador';
+$labels['addattachment'] = 'Añadir un archivo';
+$labels['charset'] = 'Codificación';
+$labels['editortype'] = 'Tipo de editor';
+$labels['returnreceipt'] = 'Acuse de recibo';
+$labels['checkspelling'] = 'Revisar ortografía';
+$labels['resumeediting'] = 'Continuar edición';
 $labels['revertto'] = 'Revertir a';
-
 $labels['attachments'] = 'Adjuntos';
 $labels['upload'] = 'Subir';
-$labels['close']  = 'Cerrar';
-
-$labels['low']     = 'Bajo';
-$labels['lowest']  = 'Bajísimo';
-$labels['normal']  = 'Normal';
-$labels['high']    = 'Alto';
+$labels['close'] = 'Cerrar';
+$labels['low'] = 'Bajo';
+$labels['lowest'] = 'Bajísimo';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Alto';
 $labels['highest'] = 'Altísimo';
-
-
-$labels['nosubject']  = '(sin asunto)';
+$labels['nosubject'] = '(sin asunto)';
 $labels['showimages'] = 'Mostrar imágenes';
-
-
-// address boook
-$labels['name']      = 'Nombre completo';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Texto';
+$labels['name'] = 'Nombre completo';
 $labels['firstname'] = 'Nombre';
-$labels['surname']   = 'Apellido';
-$labels['email']     = 'E-Mail';
-
-$labels['edit']   = 'Editar';
+$labels['surname'] = 'Apellido';
+$labels['email'] = 'Correo';
+$labels['addcontact'] = 'Añadir nuevo contacto';
+$labels['editcontact'] = 'Editar contacto';
+$labels['edit'] = 'Editar';
 $labels['cancel'] = 'Cancelar';
-$labels['save']   = 'Almacenar';
+$labels['save'] = 'Guardar';
 $labels['delete'] = 'Eliminar';
-
-$labels['newcontact']     = 'Crear nuevo contacto';
-$labels['addcontact']     = 'Añadir nuevo contacto';
-$labels['editcontact']    = 'Editar contacto';
-$labels['deletecontact']  = 'Eliminar contactos seleccionados';
-$labels['composeto']      = 'Redactar correo a';
+$labels['newcontact'] = 'Crear nuevo contacto';
+$labels['deletecontact'] = 'Eliminar contactos seleccionados';
+$labels['composeto'] = 'Enviar mensaje a';
 $labels['contactsfromto'] = 'Contactos $from a $to de $count';
-$labels['print']          = 'Imprimir';
-$labels['export']         = 'Exportar';
-
-$labels['previouspage']   = 'Mostrar grupo anterior';
-$labels['nextpage']       = 'Mostrar grupo siguiente';
-
-// 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['print'] = 'Imprimir';
+$labels['export'] = 'Exportar';
+$labels['previouspage'] = 'Mostrar grupo anterior';
+$labels['firstpage'] = 'Mostrar primer grupo';
+$labels['nextpage'] = 'Mostrar grupo siguiente';
+$labels['lastpage'] = 'Mostrar último grupo';
+$labels['groups'] = 'Grupos';
+$labels['personaladrbook'] = 'Direcciones personales';
+$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['dstactive']  = 'Cambio de horario';
-
-$labels['folder']  = 'Carpeta';
-$labels['folders']  = 'Carpetas';
-$labels['foldername']  = 'Nombre de carpeta';
-$labels['subscribed']  = 'Suscribirse';
-$labels['create']  = 'Crear';
-$labels['createfolder']  = 'Crear nueva carpeta';
+$labels['dstactive'] = 'Cambio de horario';
+$labels['htmleditor'] = 'Componer mensaje en HTML';
+$labels['htmlsignature'] = 'Firma HTML';
+$labels['previewpane'] = 'Mostrar vista preliminar';
+$labels['autosavedraft'] = 'Guardar borrador automáticamente';
+$labels['everynminutes'] = 'cada $n minutos';
+$labels['never'] = 'nunca';
+$labels['folder'] = 'Bandeja';
+$labels['folders'] = 'Bandejas';
+$labels['foldername'] = 'Nombre de bandeja';
+$labels['subscribed'] = 'Suscribipta';
+$labels['create'] = 'Crear';
+$labels['createfolder'] = 'Crear nueva bandeja';
 $labels['rename'] = 'Renombrar';
-$labels['renamefolder'] = 'Renombrar carpeta';
-$labels['deletefolder']  = 'Eliminar carpeta';
-$labels['managefolders']  = 'Gestionar carpetas';
-
+$labels['renamefolder'] = 'Renombrar bandeja';
+$labels['deletefolder'] = 'Eliminar bandeja';
+$labels['managefolders'] = 'Administrar bandejas';
 $labels['sortby'] = 'Ordenar por';
-$labels['sortasc']  = 'Orden ascendente';
+$labels['sortasc'] = 'Orden ascendente';
 $labels['sortdesc'] = 'Orden descendente';
 
 ?>
\ No newline at end of file
index ff21785a9a90c40414f45202c35c078c538d0569..c3370e43110f778b0ff470921b1be5a39a6b8c35 100644 (file)
-<?php
+<?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/es/messages.inc                                              |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, 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                                            |
+ | Author: Javier Smaldone <javier@smaldone.com.ar>                      |
+ |         David Grajal Blanco <dgrabla@gmail.com>                       |
+ |         Lito Jornero <jornero@gmail.com>                              |
  +-----------------------------------------------------------------------+
 
-
- $Id: messages.inc 282 2006-07-25 22:11:50Z thomasb $
+ @version $Id: messages.inc 552 2007-05-03 20:48:00Z yllar $
 
 */
 
 $messages = array();
-
-
-$messages['loginfailed']  = 'Contraseña incorrecta';
-
+$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['imaperror'] = 'Error de conexión con el servidor IMAP';
+$messages['nomessagesfound'] = 'No se han encontrado mensajes en esta casilla';
 $messages['loggedout'] = 'Ha cerrado la sesión. ¡Hasta pronto!';
-
-$messages['mailboxempty'] = 'El buzón esta vacio';
-
+$messages['mailboxempty'] = 'La casilla está vacía';
 $messages['loading'] = 'Cargando...';
-
 $messages['loadingdata'] = 'Cargando datos...';
-
-$messages['checkingmail'] = 'Verificar si hay nuevos mensajes...';
-
+$messages['checkingmail'] = 'Verificando si hay nuevos mensajes...';
 $messages['sendingmessage'] = 'Enviando mensaje...';
-
 $messages['messagesent'] = 'Mensaje enviado correctamente';
-
 $messages['savingmessage'] = 'Guardar mensaje...';
-
-$messages['messagesaved'] = 'Mensaje guardado en los bosquejos';
-
+$messages['messagesaved'] = 'Mensaje guardado en borradores';
 $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['contactnotfound'] = 'El contacto solicitado no existe';
 $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['deletecontactconfirm'] = '¿Realmente quiere eliminar los contactos seleccionados?';
+$messages['deletemessagesconfirm'] = '¿Realmente quiere eliminar los mensajes seleccionados?';
+$messages['deletefolderconfirm'] = '¿Está seguro de que quiere eliminar esta carpeta?';
+$messages['purgefolderconfirm'] = '¿Está seguro de que quiere eliminar todos los mensajes de esta carpeta?';
+$messages['formincomplete'] = 'No se han llenado todos los campos del formulario';
+$messages['noemailwarning'] = 'Por favor, introduzca un e-mail 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 redactarlo en este momento?';
-
+$messages['nosubjectwarning'] = 'El campo "Asunto" esta vacío. ¿Desea completarlo en este momento?';
 $messages['nobodywarning'] = '¿Quiere enviar este mensaje sin texto?';
-
 $messages['notsentwarning'] = 'El mensaje no ha sido enviado. ¿Desea descartar su mensaje?';
-
 $messages['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';
-
-$messages['searchsuccessful'] = 'Se encontró $nr mensajes';
-
-$messages['searchnomatch'] = 'La busqueda no obtuvo resultados';
-
+$messages['nosearchname'] = 'Por favor, introduzca un nombre o la dirección de e-mail';
+$messages['searchsuccessful'] = 'Se encontraron $nr mensajes';
+$messages['searchnomatch'] = 'La búsqueda no obtuvo resultados';
 $messages['searching'] = 'Buscando...';
-
 $messages['checking'] = 'Revisando...';
-
-$messages['nospellerrors'] = 'No se encontró errores ortográficos';
+$messages['nospellerrors'] = 'No se encontraron errores ortográficos';
+$messages['folderdeleted'] = 'Carpeta eliminada exitosamente';
+$messages['deletedsuccessfully'] = 'Eliminado exitosamente';
+$messages['converting'] = 'Removiendo el formato del mensaje...';
+$messages['messageopenerror'] = 'No puedo descargar el mensaje del servidor';
+$messages['fileuploaderror'] = 'Fallo en la subida de ficheros';
+$messages['filesizeerror'] = 'El fichero excede el tamaño maximo ($size)';
+$messages['copysuccess'] = '$nr direcciones copiadas con éxito';
+$messages['copyerror'] = 'No se pudo copiar ninguna dirección';
+$messages['sourceisreadonly'] = 'Esta dirección es de sólo-lectura';
+$messages['errorsavingcontact'] = 'No se pudo guardar la dirección de contacto';
 
 ?>
\ No newline at end of file
diff --git a/program/localization/et_EE/labels.inc b/program/localization/et_EE/labels.inc
new file mode 100644 (file)
index 0000000..0c21873
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/et_EE/labels.inc                                             |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Üllar Pajus <yllar.pajus@gmail.com>                           |
+ +-----------------------------------------------------------------------+
+
+ @version $Id$
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Teretulemast kasutama $product';
+$labels['username'] = 'Kasutajanimi';
+$labels['password'] = 'Parool';
+$labels['server'] = 'Server';
+$labels['login'] = 'Logi sisse';
+$labels['logout'] = 'Logi välja';
+$labels['mail'] = 'Postkast';
+$labels['settings'] = 'Seaded';
+$labels['addressbook'] = 'Aadressiraamat';
+$labels['inbox'] = 'Sissetulevad';
+$labels['drafts'] = 'Mustandid';
+$labels['sent'] = 'Saadetud';
+$labels['trash'] = 'Prügikast';
+$labels['junk'] = 'Rämps';
+$labels['subject'] = 'Pealkiri';
+$labels['from'] = 'Saatja';
+$labels['to'] = 'Saaja';
+$labels['cc'] = 'Koopia';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Vastus aadressile';
+$labels['date'] = 'Kuupäev';
+$labels['size'] = 'Suurus';
+$labels['priority'] = 'Tähtsus';
+$labels['organization'] = 'Organisatsioon';
+$labels['reply-to'] = 'Vastus aadressile';
+$labels['mailboxlist'] = 'Kaustad';
+$labels['messagesfromto'] = 'Kirjed $from kuni $to, kokku $count';
+$labels['messagenrof'] = 'Kiri $nr, kokku $count';
+$labels['moveto'] = 'liiguta kausta...';
+$labels['download'] = 'lae arvutisse';
+$labels['filename'] = 'Faili nimi';
+$labels['filesize'] = 'Faili suurus';
+$labels['preferhtml'] = 'Eelista HTMLi';
+$labels['htmlmessage'] = 'HTML kirjad';
+$labels['prettydate'] = 'Kenad kuupäevad';
+$labels['addtoaddressbook'] = 'Lisa aadressiraamatusse';
+$labels['sun'] = 'P';
+$labels['mon'] = 'E';
+$labels['tue'] = 'T';
+$labels['wed'] = 'K';
+$labels['thu'] = 'N';
+$labels['fri'] = 'R';
+$labels['sat'] = 'L';
+$labels['sunday'] = 'Pühapäev';
+$labels['monday'] = 'Esmaspäev';
+$labels['tuesday'] = 'Teisipäev';
+$labels['wednesday'] = 'Kolmapäev';
+$labels['thursday'] = 'Neljapäev';
+$labels['friday'] = 'Reede';
+$labels['saturday'] = 'Laupäev';
+$labels['today'] = 'Täna';
+$labels['checkmail'] = 'Kontrolli uusi kirju';
+$labels['writenewmessage'] = 'Kirjuta uus kiri';
+$labels['replytomessage'] = 'Vasta kirjale';
+$labels['replytoallmessage'] = 'Vasta saatjale ja teistele kirja saanutele';
+$labels['forwardmessage'] = 'Edasta see kiri';
+$labels['deletemessage'] = 'Liiguta kiri prügikasti';
+$labels['printmessage'] = 'Trüki kiri';
+$labels['previousmessage'] = 'Näita eelmist kirja';
+$labels['previousmessages'] = 'Näita eelmisi kirju';
+$labels['firstmessage'] = 'Näita esimest kirja';
+$labels['firstmessages'] = 'Näita esimest kirjade komplekti';
+$labels['nextmessage'] = 'Näita järgmist kirja';
+$labels['nextmessages'] = 'Näita järgmisi kirju';
+$labels['lastmessage'] = 'Näita viimast kirja';
+$labels['lastmessages'] = 'Näita viimast kirjade komplekti';
+$labels['backtolist'] = 'Tagasi kirjade nimekirja';
+$labels['viewsource'] = 'Näita lähtekoodi';
+$labels['select'] = 'Vali';
+$labels['all'] = 'kõik';
+$labels['none'] = 'mitte midagi';
+$labels['unread'] = 'mitte loetud';
+$labels['compact'] = 'Tihenda';
+$labels['empty'] = 'Tühjenda';
+$labels['purge'] = 'Puhasta';
+$labels['quota'] = 'Ketta kasutus';
+$labels['unknown'] = 'teadmata';
+$labels['unlimited'] = 'piiramatu';
+$labels['quicksearch'] = 'Kiirotsing';
+$labels['resetsearch'] = 'Lähtesta otsing';
+$labels['compose'] = 'Koosta kiri';
+$labels['sendmessage'] = 'Saada kiri kohe';
+$labels['savemessage'] = 'Salvesta see mustand';
+$labels['addattachment'] = 'Lisa fail';
+$labels['charset'] = 'Märgistik';
+$labels['editortype'] = 'Redaktori tüüp';
+$labels['returnreceipt'] = 'Kättesaamiskinnitus';
+$labels['checkspelling'] = 'Kontrolli õigekirja';
+$labels['resumeediting'] = 'Jätka muutmist';
+$labels['revertto'] = 'Muuda tagasi';
+$labels['attachments'] = 'Manused';
+$labels['upload'] = 'Kinnita manus';
+$labels['close'] = 'Sulge';
+$labels['low'] = 'Madal';
+$labels['lowest'] = 'Madalaim';
+$labels['normal'] = 'Tavaline';
+$labels['high'] = 'Kõrge';
+$labels['highest'] = 'Kõrgeim';
+$labels['nosubject'] = '(teema puudub)';
+$labels['showimages'] = 'Näita pilte';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Lihttekst';
+$labels['name'] = 'Näidatav nimi';
+$labels['firstname'] = 'Eesnimi';
+$labels['surname'] = 'Perekonnanimi';
+$labels['email'] = 'E-Mail';
+$labels['addcontact'] = 'Uue kontakti lisamine';
+$labels['editcontact'] = 'Muuda kontakti';
+$labels['edit'] = 'Muuda';
+$labels['cancel'] = 'Katkesta';
+$labels['save'] = 'Salvesta';
+$labels['delete'] = 'Kustuta';
+$labels['newcontact'] = 'Uue sissekande loomine';
+$labels['deletecontact'] = 'Kustuta märgistatud kontaktid';
+$labels['composeto'] = 'Kirjuta kiri';
+$labels['contactsfromto'] = 'Kirjed $from kuni $to, kokku $count';
+$labels['print'] = 'Trüki';
+$labels['export'] = 'Ekspordi';
+$labels['previouspage'] = 'Näita eelmist lehte';
+$labels['firstpage'] = 'Näita esimest komplekti';
+$labels['nextpage'] = 'Näita järgmist lehte';
+$labels['lastpage'] = 'Näita viimast komplekti';
+$labels['groups'] = 'Grupid';
+$labels['personaladrbook'] = 'Isiklikud aadressid';
+$labels['settingsfor'] = 'Kasutajaeelistused kontole';
+$labels['preferences'] = 'Eelistused';
+$labels['userpreferences'] = 'Kasutaja eelistused';
+$labels['editpreferences'] = 'Muuda kasutaja eelistusi';
+$labels['identities'] = 'Identiteedid';
+$labels['manageidentities'] = 'Halda selle konto identiteete';
+$labels['newidentity'] = 'Uus identiteet';
+$labels['newitem'] = 'Uus sissekanne';
+$labels['edititem'] = 'Muuda sissekannet';
+$labels['setdefault'] = 'Muuda vaikeseadeks';
+$labels['language'] = 'Keel';
+$labels['timezone'] = 'Ajatsoon';
+$labels['pagesize'] = 'Ridu lehe kohta';
+$labels['signature'] = 'Allkiri';
+$labels['dstactive'] = 'Suveaeg';
+$labels['htmleditor'] = 'Kasuta HTML redaktorit';
+$labels['htmlsignature'] = 'HTML allkiri';
+$labels['previewpane'] = 'Näita eelvaate akent';
+$labels['autosavedraft'] = 'Salvesta mustandid automaatselt';
+$labels['everynminutes'] = 'iga $n minuti tagant';
+$labels['never'] = 'mitte kunagi';
+$labels['folder'] = 'Kaust';
+$labels['folders'] = 'Kaustad';
+$labels['foldername'] = 'Kausta nimi';
+$labels['subscribed'] = 'Näitan';
+$labels['create'] = 'Loo';
+$labels['createfolder'] = 'Uue kausta loomine';
+$labels['rename'] = 'Nimeta ümber';
+$labels['renamefolder'] = 'Nimeta olemasolev kaust ümber';
+$labels['deletefolder'] = 'Kustuta kaust';
+$labels['managefolders'] = 'Halda kaustu';
+$labels['sortby'] = 'Järjesta';
+$labels['sortasc'] = 'Järjesta kasvavalt';
+$labels['sortdesc'] = 'Järjesta kahanevalt';
+
+?>
diff --git a/program/localization/et_EE/messages.inc b/program/localization/et_EE/messages.inc
new file mode 100644 (file)
index 0000000..6d216f8
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/et_EE/messages.inc                                           |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Üllar Pajus <yllar.pajus@gmail.com>                           |
+ +-----------------------------------------------------------------------+
+
+ @version $Id$
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Sisselogimine ebaõnnestus';
+$messages['cookiesdisabled'] = 'Sinu veebilehitseja ei võta präänikuid vastu';
+$messages['sessionerror'] = 'Sinu sessioon on aegunud või vigane';
+$messages['imaperror'] = 'Ei õnnestunud IMAP serveriga ühendust luua';
+$messages['nomessagesfound'] = 'Postkast paistab tühi olevat';
+$messages['loggedout'] = 'Sinu sessioon on edukalt lõpetatud. Nägemiseni!';
+$messages['mailboxempty'] = 'Postkast on tühi';
+$messages['loading'] = 'Laadimine...';
+$messages['loadingdata'] = 'Andmete laadimine...';
+$messages['checkingmail'] = 'Uute kirjade kontrollimine...';
+$messages['sendingmessage'] = 'Kirja saatmine...';
+$messages['messagesent'] = 'Kiri edukalt saadetud';
+$messages['savingmessage'] = 'Kirja salvestamine...';
+$messages['messagesaved'] = 'Kiri salvestatud Mustanditesse';
+$messages['successfullysaved'] = 'Edukalt salvestatud';
+$messages['addedsuccessfully'] = 'Kontakt lisati edukalt aadressiraamatusse';
+$messages['contactexists'] = 'Sama e-maili aadressiga kontakt on juba olemas';
+$messages['blockedimages'] = 'Sinu privaatsuse kaitsmiseks on selles kirjas välised pildid blokeeritud.';
+$messages['encryptedmessage'] = 'See on krüpteeritud kiri ja kahjuks pole seda võimalik näidata. Andestust!';
+$messages['nocontactsfound'] = 'Ei leitud ühtegi kontakti';
+$messages['contactnotfound'] = 'Otsitud kontakti ei leitud';
+$messages['sendingfailed'] = 'Kirja saatmine ebaõnnestus';
+$messages['errorsaving'] = 'Salvestamise ajal ilmnes viga';
+$messages['errormoving'] = 'Ei suutnud seda kirja liigutada';
+$messages['errordeleting'] = 'Ei suutnud seda kirja kustutada';
+$messages['deletecontactconfirm'] = 'Soovid valitud kontaktid kustutada ?';
+$messages['deletemessagesconfirm'] = 'Soovid valitud kirja(d) kustutada ?';
+$messages['deletefolderconfirm'] = 'Soovid selle kataloogi kindlasti kustutada ?';
+$messages['purgefolderconfirm'] = 'Soovid sellest kaustast kõik kirjad kustutada ?';
+$messages['formincomplete'] = 'Vormi kõik väljad ei ole täidetud';
+$messages['noemailwarning'] = 'Palun sisesta toimiv e-maili aadress';
+$messages['nonamewarning'] = 'Palun sisesta nimi';
+$messages['nopagesizewarning'] = 'Palun sisesta lehekülje suurus';
+$messages['norecipientwarning'] = 'Palun sisesta vähemalt üks kirjasaaja';
+$messages['nosubjectwarning'] = 'Väli "Pealkiri" on tühi. Soovid selle ära täita ?';
+$messages['nobodywarning'] = 'Saadan selle kirja ilma tekstita ?';
+$messages['notsentwarning'] = 'Kirja ei suudetud saata. Soovid selle ära visata ?';
+$messages['noldapserver'] = 'Palun vali otsinguks LDAPi server';
+$messages['nocontactsreturned'] = 'Ühtegi kontakti ei leitud';
+$messages['nosearchname'] = 'Palun sisesta kontakti nimi või e-maili aadress';
+$messages['searchsuccessful'] = 'Leiti $nr kirja';
+$messages['searchnomatch'] = 'Otsingule vastavaid kirju ei leitud';
+$messages['searching'] = 'Otsimine...';
+$messages['checking'] = 'Kontrollimine...';
+$messages['nospellerrors'] = 'Õigekirja vigu ei leitud';
+$messages['folderdeleted'] = 'Kausta kustutamine õnnestus';
+$messages['deletedsuccessfully'] = 'Edukalt kustutatud';
+$messages['converting'] = 'Kirjast vorminduse eemaldamine...';
+$messages['messageopenerror'] = 'Kirjade serverist laadimine ebaõnnestus';
+$messages['fileuploaderror'] = 'Faili üleslaadimine ebaõnnestus';
+$messages['filesizeerror'] = 'Üleslaetava faili suurus ületab maksimaalse suuruse $size';
+$messages['copysuccess'] = '$nr aadressi edukalt kopeeritud';
+$messages['copyerror'] = 'Ühegi aadressi kopeerimine ei õnnestunud ';
+$messages['sourceisreadonly'] = 'Aadressi asukohas puuduvad kirjutusõigused';
+$messages['errorsavingcontact'] = 'Kontakti aadressi salvestamine ebaõnnestus';
+
+?>
index 9e95f297d539a0f4b1e7e57b65e842a42580019c..d7b6df20fad315406a42f6440a8633329b370f75 100644 (file)
@@ -1,75 +1,60 @@
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/fr/labels.inc                                                |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
- | Author: aldweb <info@aldweb.com>, Pierre HAEGELI <pierre@haegeli.net> |
+ | Author: aldweb <info@aldweb.com>                                      |
+ |         Pierre HAEGELI <pierre@haegeli.net>                           |
  +-----------------------------------------------------------------------+
 
$Id: labels.inc 220 2006-06-12 17:33:21Z roundcube $
@version $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['welcome'] = 'Bienvenue à $product';
+$labels['username'] = 'ID utilisateur';
+$labels['password'] = 'Mot de passe';
+$labels['server'] = 'Serveur';
+$labels['login'] = 'Connexion';
+$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['sent']   = 'Messages envoyés';
-$labels['trash']  = 'Corbeille';
+$labels['inbox'] = 'Messages reçus';
 $labels['drafts'] = 'Brouillons';
-$labels['junk']   = 'A trier';
-
-// message listing
+$labels['sent'] = 'Messages envoyés';
+$labels['trash'] = 'Corbeille';
+$labels['junk'] = 'Indésirables';
 $labels['subject'] = 'Objet';
-$labels['from']    = 'De';
-$labels['to']      = 'A';
-$labels['cc']      = 'Cc';
-$labels['bcc']     = 'Cci';
+$labels['from'] = 'De';
+$labels['to'] = 'A';
+$labels['cc'] = 'Cc';
+$labels['bcc'] = 'Cci';
 $labels['replyto'] = 'Répondre à';
-$labels['date']    = 'Date';
-$labels['size']    = 'Taille';
+$labels['date'] = 'Date';
+$labels['size'] = 'Taille';
 $labels['priority'] = 'Priorité';
 $labels['organization'] = 'Organisation';
-
-// aliases
-$labels['reply-to'] = $labels['replyto'];
-
+$labels['reply-to'] = 'Répondre à';
 $labels['mailboxlist'] = 'Dossiers';
 $labels['messagesfromto'] = 'Messages $from à $to sur $count';
 $labels['messagenrof'] = 'Message $nr sur $count';
-
-$labels['moveto']   = 'Déplacer vers...';
+$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'] = 'Affichage réduit des dates';
-
 $labels['addtoaddressbook'] = 'Ajouter au carnet d\'adresses';
-
-// weekdays short
 $labels['sun'] = 'Dim';
 $labels['mon'] = 'Lun';
 $labels['tue'] = 'Mar';
@@ -77,145 +62,120 @@ $labels['wed'] = 'Mer';
 $labels['thu'] = 'Jeu';
 $labels['fri'] = 'Ven';
 $labels['sat'] = 'Sam';
-
-// weekdays long
-$labels['sunday']    = 'Dimanche';
-$labels['monday']    = 'Lundi';
-$labels['tuesday']   = 'Mardi';
+$labels['sunday'] = 'Dimanche';
+$labels['monday'] = 'Lundi';
+$labels['tuesday'] = 'Mardi';
 $labels['wednesday'] = 'Mercredi';
-$labels['thursday']  = 'Jeudi';
-$labels['friday']    = 'Vendredi';
-$labels['saturday']  = 'Samedi';
-
+$labels['thursday'] = 'Jeudi';
+$labels['friday'] = 'Vendredi';
+$labels['saturday'] = 'Samedi';
 $labels['today'] = 'Aujourd\'hui';
-
-// toolbar buttons
 $labels['checkmail'] = 'Vérification des nouveaux messages';
-$labels['writenewmessage']  = 'Créer un nouveau message';
-$labels['replytomessage']   = 'Répondre au message';
+$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['forwardmessage'] = 'Transmettre le message';
+$labels['deletemessage'] = 'Déplacer le message dans la corbeille';
+$labels['printmessage'] = 'Imprimer ce message';
+$labels['previousmessage'] = 'Voir le message précédent';
 $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['firstmessage'] = 'Voir le premier message';
+$labels['firstmessages'] = 'Voir la première page de messages';
+$labels['nextmessage'] = 'Voir le message suivant';
+$labels['nextmessages'] = 'Voir les messages suivants';
+$labels['lastmessage'] = 'Voir le dernier message';
+$labels['lastmessages'] = 'Voir la dernière page de messages';
+$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['compact'] = 'Compact';
 $labels['empty'] = 'Vider';
 $labels['purge'] = 'Purger';
-
 $labels['quota'] = 'Utilisation Disque';
 $labels['unknown'] = 'inconnue';
 $labels['unlimited'] = 'illimitée';
-
-$labels['quicksearch']  = 'Recherche rapide';
-$labels['resetsearch']  = 'Réinitialiser la recherche';
-
-
-// message compose
-$labels['compose']  = 'Composer un nouveau message';
-$labels['savemessage']  = 'Sauvegarder ce brouillon';
-$labels['sendmessage']  = 'Envoyer le message maintenant';
-$labels['addattachment']  = 'Joindre un fichier';
-$labels['charset']  = 'Encodage';
+$labels['quicksearch'] = 'Recherche rapide';
+$labels['resetsearch'] = 'Réinitialiser la recherche';
+$labels['compose'] = 'Composer un nouveau message';
+$labels['sendmessage'] = 'Envoyer le message maintenant';
+$labels['savemessage'] = 'Sauvegarder ce brouillon';
+$labels['addattachment'] = 'Joindre un fichier';
+$labels['charset'] = 'Encodage';
+$labels['editortype'] = 'Type d\'éditeur';
 $labels['returnreceipt'] = 'Accusé de réception';
-
 $labels['checkspelling'] = 'Vérifier l\'orthographe';
 $labels['resumeediting'] = 'Retourner à l\'édition';
 $labels['revertto'] = 'Revenir à';
-
 $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['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['nosubject'] = '(pas de sujet)';
 $labels['showimages'] = 'Montrer les images';
-
-
-// address boook
-$labels['name']      = 'Nom à afficher';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'texte brut';
+$labels['name'] = 'Nom à afficher';
 $labels['firstname'] = 'Prénom';
-$labels['surname']   = 'Nom';
-$labels['email']     = 'e-Mail';
-
-$labels['addcontact'] = 'Ajouter un nouveau contact';
+$labels['surname'] = 'Nom';
+$labels['email'] = 'e-Mail';
+$labels['addcontact'] = 'Ajouter le contact sélectionné à votre Carnet d\'adresses';
 $labels['editcontact'] = 'Editer le contact';
-
-$labels['edit']   = 'Editer';
+$labels['edit'] = 'Editer';
 $labels['cancel'] = 'Annuler';
-$labels['save']   = 'Sauvegarder';
+$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['newcontact'] = 'Créer un nouveau contact';
+$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';
-
+$labels['print'] = 'Imprimer';
+$labels['export'] = 'Exporter';
 $labels['previouspage'] = 'Montrer page précédente';
-$labels['nextpage']     = 'Montrer page suivante';
-
-
-// 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['firstpage'] = 'Voir la première page';
+$labels['nextpage'] = 'Montrer page suivante';
+$labels['lastpage'] = 'Voir la dernière page';
+$labels['groups'] = 'Groupes';
+$labels['personaladrbook'] = 'Adresses personnelle';
+$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['dstactive'] = 'Heure d\'été';
-
-$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['htmleditor'] = 'Composer un message au format HTML';
+$labels['htmlsignature'] = 'Signature HTML';
+$labels['previewpane'] = 'Afficher le panneau d\'aperçu';
+$labels['autosavedraft'] = 'Sauvegarde automatique des brouillons';
+$labels['everynminutes'] = 'toutes les $n minutes';
+$labels['never'] = 'jamais';
+$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['rename'] = 'Renommer';
 $labels['renamefolder'] = 'Renommer le dossier';
-$labels['deletefolder']  = 'Supprimer le dossier';
-$labels['managefolders']  = 'Gérer les dossiers';
-
+$labels['deletefolder'] = 'Supprimer le dossier';
+$labels['managefolders'] = 'Gérer les dossiers';
 $labels['sortby'] = 'Trier par';
-$labels['sortasc']  = 'Tri ascendant';
+$labels['sortasc'] = 'Tri ascendant';
 $labels['sortdesc'] = 'Tri descendant';
 
-?>
+?>
\ No newline at end of file
index 0b14ec3cf813e7a3eecb81bea88770677d29debb..dfe2a0850b19c0daa0fc801320d5eebe4b305fea 100644 (file)
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/fr/messages.inc                                              |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
- | Author: aldweb <info@aldweb.com>, Pierre HAEGELI <pierre@haegeli.net> |
+ | Author: aldweb <info@aldweb.com>                                      |
+ |         Pierre HAEGELI <pierre@haegeli.net>                           |
  +-----------------------------------------------------------------------+
 
$Id: messages.inc 139 2006-06-12 17:32:27Z roundcube $
@version $Id$
 
 */
 
 $messages = array();
-
-$messages['loginfailed']  = 'Erreur de connexion';
-
+$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 des nouveaux messages ...';
-
 $messages['sendingmessage'] = 'Message en cours d\'envoi...';
-
 $messages['messagesent'] = 'Message envoyé';
-
 $messages['savingmessage'] = 'Sauvegarde du message...';
-
 $messages['messagesaved'] = 'Message sauvegardé dans Brouillons';
-
 $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['contactnotfound'] = 'Le contact demandé n\'a pas été 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['deletecontactconfirm'] = 'Voulez-vous vraiment effacer les contacts sélectionnés ?';
+$messages['deletemessagesconfirm'] = 'Voulez-vous vraiment supprimer le(s) message(s) séléctionné(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['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['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';
-
 $messages['searchsuccessful'] = '$nr messages trouvés';
-
 $messages['searchnomatch'] = 'Aucun résultat trouvé';
-
 $messages['searching'] = 'En cours de recherche...';
-
 $messages['checking'] = 'Vérification...';
-
 $messages['nospellerrors'] = 'Aucune faute trouvée';
-
 $messages['folderdeleted'] = 'Dossier effacé';
-
-
-?>
+$messages['deletedsuccessfully'] = 'Supprimé(s) avec succès';
+$messages['converting'] = 'Suppression du formattage ...';
+$messages['messageopenerror'] = 'Impossible de charger le message du serveur';
+$messages['fileuploaderror'] = 'Transfert du fichier echoué';
+$messages['filesizeerror'] = 'Transfert du fichier a atteint la taille maximale de $size';
+$messages['copysuccess'] = 'Succés de la copie des $nr adresses';
+$messages['copyerror'] = 'Ne peut pas copier les adresses';
+$messages['sourceisreadonly'] = 'Cette adresse source est en lecture seule';
+$messages['errorsavingcontact'] = 'Ne peut pas enregistrer l\'adresse du contact';
+
+?>
\ No newline at end of file
index 249c972fb965a1057bd71f4e61322bb64574e750..bab4810a74e36b4852aa27d7ceeea13297a9025f 100644 (file)
@@ -16,7 +16,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: index.inc 258 2006-06-02 18:16:48Z thomasb $
+ $Id: index.inc 560 2007-05-17 15:01:26Z thomasb $
  
  */
  
        'am'    => 'Armenian',
        'bg'    => 'Bulgarian',
        'bs_BA' => 'Bosnian (Bosanski)',
-       'tw'    => 'Chinese (BIG5)',
-       'cn'    => 'Chinese (GB2312)',
-       'cz'    => 'Czech',
+       'zh_TW' => 'Chinese (BIG5)',
+       'zh_CN' => 'Chinese (GB2312)',
        'ca'    => 'Català',
+       'cz'    => 'Czech',
        'da'    => 'Dansk',
        'de_DE' => 'Deutsch (Deutsch)',
        'de_CH' => 'Deutsch (Schweiz)',
        'fr'    => 'Français', 
        'ga'    => 'Galician',
        'el'    => 'Greek',
-       'hr'    => 'Hrvatski',
+       'hi'    => 'Hindi',
+       'hr'    => 'Hrvatski',
        'hu'    => 'Hungarian',
+       'id_ID' => 'Indonesian',
        'it'    => 'Italiano',
        'ja'    => 'Japanese (日本語)',
        'kr'    => 'Korean',
+       'kur_KU' => 'Kurdish (Kurmancî)',
        'lv'    => 'Latvian',
        'lt'    => 'Lithuanian',
        'nl_NL' => 'Nederlands',
        'ru'    => 'Russian',
        'fi'    => 'Suomi',
        'se'    => 'Svenska',
-       'si'    => 'Slovenian',
+       'si'    => 'Sinhala',
+       'sl'    => 'Slovenian',
        'sk'    => 'Slovak',
+       'sr_latin' => 'Serbian Latin',
+       'sr_cyrillic' => 'Serbian Cyrillic',
        'tr'    => 'Turkish',
+       'th'    => 'Thai',
        'vn'    => 'Vietnamese'
 );
 
 $rcube_language_aliases = array(
        'ee' => 'et_EE',
        'bs' => 'bs_BA',
+  'cn' => 'zh_CN',
        'de' => 'de_DE',
        'en' => 'en_US',
        'nl' => 'nl_NL',
        'no' => 'nn_NO',
-       'pt' => 'pt_PT'
+       'pt' => 'pt_PT',
+  'tw' => 'zh_TW'
 );
 
 $rcube_charsets = array();
 
 
-?>
\ No newline at end of file
+?>
diff --git a/program/localization/it/labels.inc b/program/localization/it/labels.inc
new file mode 100644 (file)
index 0000000..8324c1f
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/it/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Andrej Mocilnik <amocilnik@dotcom.ts.it>                      |
+ |         Yusef Maali <contact@yusefmaali.net>                          |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 552 2007-05-03 20:48:00Z yllar $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Benvenuto in $product';
+$labels['username'] = 'Utente';
+$labels['password'] = 'Password';
+$labels['server'] = 'Server';
+$labels['login'] = 'Entra';
+$labels['logout'] = 'Esci';
+$labels['mail'] = 'E-Mail';
+$labels['settings'] = 'Impostazioni';
+$labels['addressbook'] = 'Rubrica';
+$labels['inbox'] = 'Posta in arrivo';
+$labels['drafts'] = 'Bozze';
+$labels['sent'] = 'Inviata';
+$labels['trash'] = 'Cestino';
+$labels['junk'] = 'Spam';
+$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à';
+$labels['reply-to'] = 'Rispondi a';
+$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';
+$labels['sun'] = 'Dom';
+$labels['mon'] = 'Lun';
+$labels['tue'] = 'Mar';
+$labels['wed'] = 'Mer';
+$labels['thu'] = 'Gio';
+$labels['fri'] = 'Ven';
+$labels['sat'] = 'Sab';
+$labels['sunday'] = 'Domenica';
+$labels['monday'] = 'Lunedì';
+$labels['tuesday'] = 'Martedì';
+$labels['wednesday'] = 'Mercoledì';
+$labels['thursday'] = 'Giovedì';
+$labels['friday'] = 'Venerdì';
+$labels['saturday'] = 'Sabato';
+$labels['today'] = 'Oggi';
+$labels['checkmail'] = 'Controlla 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['previousmessage'] = 'Visualizza il messaggio precedente';
+$labels['previousmessages'] = 'Visualizza messaggi precedenti';
+$labels['firstmessage'] = 'Visualizza il primo messaggio';
+$labels['firstmessages'] = 'Visualizza il primo set di messaggi';
+$labels['nextmessage'] = 'Visualizza il messaggio successivo';
+$labels['nextmessages'] = 'Visualizza messaggi successivi';
+$labels['lastmessage'] = 'Visualizza l\'ultimo messaggio';
+$labels['lastmessages'] = 'Visualizza l\'ultimo set di messaggi';
+$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';
+$labels['unknown'] = 'sconosciuto';
+$labels['unlimited'] = 'illimitato';
+$labels['quicksearch'] = 'Ricerca veloce';
+$labels['resetsearch'] = 'Annulla ricerca';
+$labels['compose'] = 'Scrivi un messaggio';
+$labels['sendmessage'] = 'Invia il messaggio adesso';
+$labels['savemessage'] = 'Salva come bozza';
+$labels['addattachment'] = 'Allega un file';
+$labels['charset'] = 'Set di caratteri';
+$labels['editortype'] = 'Tipo editor';
+$labels['returnreceipt'] = 'Ricevuta di ritorno';
+$labels['checkspelling'] = 'Controlla ortografia';
+$labels['resumeediting'] = 'Torna al messaggio';
+$labels['revertto'] = 'Ripristina';
+$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';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Testo semplice';
+$labels['name'] = 'Nome visualizzato';
+$labels['firstname'] = 'Nome';
+$labels['surname'] = 'Cognome';
+$labels['email'] = 'E-Mail';
+$labels['addcontact'] = 'Aggiungi il contatto selezionato alla rubrica';
+$labels['editcontact'] = 'Modifica contatto';
+$labels['edit'] = 'Modifica';
+$labels['cancel'] = 'Annulla';
+$labels['save'] = 'Salva';
+$labels['delete'] = 'Elimina';
+$labels['newcontact'] = 'Crea un nuovo contatto';
+$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';
+$labels['previouspage'] = 'Pagina precedente';
+$labels['firstpage'] = 'Prima pagina';
+$labels['nextpage'] = 'Pagina successiva';
+$labels['lastpage'] = 'Ultima pagina';
+$labels['groups'] = 'Gruppi';
+$labels['personaladrbook'] = 'Indirizzi Personali';
+$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['dstactive'] = 'Gestione ora legale / ora solare';
+$labels['htmleditor'] = 'Scrivi i messaggi in HTML';
+$labels['htmlsignature'] = 'Firma in HTML';
+$labels['previewpane'] = 'Mostra l\'anteprima';
+$labels['autosavedraft'] = 'Salva le bozze automaticamente';
+$labels['everynminutes'] = 'ogni $n minuti';
+$labels['never'] = 'mai';
+$labels['folder'] = 'Cartella';
+$labels['folders'] = 'Cartelle';
+$labels['foldername'] = 'Nome cartella';
+$labels['subscribed'] = 'Sottoscritta';
+$labels['create'] = 'Crea';
+$labels['createfolder'] = 'Crea una nuova cartella';
+$labels['rename'] = 'Rinomina';
+$labels['renamefolder'] = 'Rinomina cartella';
+$labels['deletefolder'] = 'Cancella la cartella';
+$labels['managefolders'] = 'Gestione cartelle';
+$labels['sortby'] = 'Ordina per';
+$labels['sortasc'] = 'Ordinamento crescente';
+$labels['sortdesc'] = 'Ordinamento decrescente';
+
+?>
\ No newline at end of file
diff --git a/program/localization/it/messages.inc b/program/localization/it/messages.inc
new file mode 100644 (file)
index 0000000..b00cfaa
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/it/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Andrej Mocilnik <amocilnik@dotcom.ts.it>                      |
+ |         Yusef Maali <contact@yusefmaali.net>                          |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 552 2007-05-03 20:48:00Z yllar $
+
+*/
+
+$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'] = 'Controllo nuovi messaggi...';
+$messages['sendingmessage'] = 'Invio messaggio in corso...';
+$messages['messagesent'] = 'Messaggio inviato correttamente';
+$messages['savingmessage'] = 'Salvataggio messaggio...';
+$messages['messagesaved'] = 'Messaggio salvato nelle bozze';
+$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 trovato';
+$messages['contactnotfound'] = 'Il contatto richiesto non è stato trovato';
+$messages['sendingfailed'] = 'Impossibile inviare il messaggio';
+$messages['errorsaving'] = 'Impossibile salvare';
+$messages['errormoving'] = 'Impossibile spostare il messaggio';
+$messages['errordeleting'] = 'Impossibile cancellare il messaggio';
+$messages['deletecontactconfirm'] = 'Sei sicuro di voler cancellare i contatti selezionati?';
+$messages['deletemessagesconfirm'] = 'Sei sicuro di voler cancellare i messaggi selezionati?';
+$messages['deletefolderconfirm'] = 'Sei sicuro di voler cancellare la cartella selezionata?';
+$messages['purgefolderconfirm'] = 'Sei sicuro di voler 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 inserirlo 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';
+$messages['searchsuccessful'] = '$nr messaggi trovati';
+$messages['searchnomatch'] = 'La ricerca non ha dato nessun risultato';
+$messages['searching'] = 'Ricerca...';
+$messages['checking'] = 'Controllo...';
+$messages['nospellerrors'] = 'Nessun errore ortografico trovato';
+$messages['folderdeleted'] = 'Cartella eliminata';
+$messages['deletedsuccessfully'] = 'Eliminato con successo';
+$messages['converting'] = 'Rimozione della formattazione dal messaggio...';
+$messages['messageopenerror'] = 'Impossibile caricare il messaggio dal server';
+$messages['fileuploaderror'] = 'Errore durante il caricamento del file';
+$messages['filesizeerror'] = 'Il file da caricare supera il limite massimo di $size';
+$messages['copysuccess'] = 'Copiati $nr indirizzi';
+$messages['copyerror'] = 'Impossibile copiare gli indirizzi';
+$messages['sourceisreadonly'] = 'La rubrica è in sola lettura';
+$messages['errorsavingcontact'] = 'Impossibile salvare il contatto';
+
+?>
\ No newline at end of file
diff --git a/program/localization/lt/labels.inc b/program/localization/lt/labels.inc
new file mode 100644 (file)
index 0000000..bb603ff
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/lt/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Martynas Bendorius <martynas@e-vaizdas.net>                   |
+ +-----------------------------------------------------------------------+'
+
+ @version $Id: labels.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Sveiki atvykę į $product';
+$labels['username'] = 'Vartotojas';
+$labels['password'] = 'Slaptažodis';
+$labels['server'] = 'Serveris';
+$labels['login'] = 'Prisijungti';
+$labels['logout'] = 'Atsijungti';
+$labels['mail'] = 'El. paštas';
+$labels['settings'] = 'Nustatymai';
+$labels['addressbook'] = 'Adresų knyga';
+$labels['inbox'] = 'Gauti';
+$labels['drafts'] = 'Juodraščiai';
+$labels['sent'] = 'Išsiųsti';
+$labels['trash'] = 'Šiukšliadėžė';
+$labels['junk'] = 'Nereikalingi';
+$labels['subject'] = 'Tema';
+$labels['from'] = 'Siuntėjas';
+$labels['to'] = 'Gavėjas';
+$labels['cc'] = 'Kopija';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Atsakyti į';
+$labels['date'] = 'Data';
+$labels['size'] = 'Dydis';
+$labels['priority'] = 'Svarbumas';
+$labels['organization'] = 'Organizacija';
+$labels['reply-to'] = 'Atsakyti į';
+$labels['mailboxlist'] = 'Aplankai';
+$labels['messagesfromto'] = 'Laiškai nuo $from iki $to iš $count';
+$labels['messagenrof'] = 'Laiškas $nr iš $count';
+$labels['moveto'] = 'perkelti į ...';
+$labels['download'] = 'parsisiųsti';
+$labels['filename'] = 'Bylos vardas';
+$labels['filesize'] = 'Bylos dydis';
+$labels['preferhtml'] = 'Rodyti HTML';
+$labels['htmlmessage'] = 'HTML Laiškas';
+$labels['prettydate'] = 'Gražios datos';
+$labels['addtoaddressbook'] = 'Įtraukti į adresų knygą';
+$labels['sun'] = 'Sek';
+$labels['mon'] = 'Pir';
+$labels['tue'] = 'Ant';
+$labels['wed'] = 'Tre';
+$labels['thu'] = 'Ket';
+$labels['fri'] = 'Pen';
+$labels['sat'] = 'Šeš';
+$labels['sunday'] = 'Sekmadienis';
+$labels['monday'] = 'Pirmadienis';
+$labels['tuesday'] = 'Antradienis';
+$labels['wednesday'] = 'Trečiadienis';
+$labels['thursday'] = 'Ketvirtadienis';
+$labels['friday'] = 'Penktadienis';
+$labels['saturday'] = 'Šeštadienis';
+$labels['today'] = 'Šiandien';
+$labels['checkmail'] = 'Tikrinti ar nėra naujų laiškų';
+$labels['writenewmessage'] = 'Rašyti naują laišką';
+$labels['replytomessage'] = 'Atsakyti į lašką';
+$labels['replytoallmessage'] = 'Atsakyti visiems';
+$labels['forwardmessage'] = 'Persiųsti laišką';
+$labels['deletemessage'] = 'Ištrinti laišką';
+$labels['printmessage'] = 'Atspausdinti laišką';
+$labels['previousmessage'] = 'Rodyti ankstesnį laišką';
+$labels['previousmessages'] = 'Rodyti ankstesius laiškus';
+$labels['firstmessage'] = 'Rodyti pirmąjį laišką';
+$labels['firstmessages'] = 'Rodyti pirmuosius laiškus';
+$labels['nextmessage'] = 'Rodyti tolesnį laišką';
+$labels['nextmessages'] = 'Rodyti tolesnius laiškus';
+$labels['lastmessage'] = 'Rodyti paskutinį laišką';
+$labels['lastmessages'] = 'Rodyti paskutinius laiškus';
+$labels['backtolist'] = 'Grižti į laiškų sarašą';
+$labels['viewsource'] = 'Rodyti šaltinį';
+$labels['select'] = 'Pažymėti';
+$labels['all'] = 'Visus';
+$labels['none'] = 'Nieko';
+$labels['unread'] = 'Neskaitytas';
+$labels['compact'] = 'Suspausti';
+$labels['empty'] = 'Ištuštinti';
+$labels['purge'] = 'Išvalyti';
+$labels['quota'] = 'Disko naudojimas';
+$labels['unknown'] = 'nežinomas';
+$labels['unlimited'] = 'neribotas';
+$labels['quicksearch'] = 'Greita paieška';
+$labels['resetsearch'] = 'Atšaukti paiešką';
+$labels['compose'] = 'Rašyti nauja laiška';
+$labels['sendmessage'] = 'Išsiųsti laiską';
+$labels['savemessage'] = 'Išsaugoti šį juodraštį';
+$labels['addattachment'] = 'Prisegti bylą';
+$labels['charset'] = 'Koduotė';
+$labels['editortype'] = 'Redagavimo tipas';
+$labels['returnreceipt'] = 'Atgalinis gavėjas';
+$labels['checkspelling'] = 'Tikrinti rašybą';
+$labels['resumeediting'] = 'Tęsti redagavimą';
+$labels['revertto'] = 'Atstatyti į';
+$labels['attachments'] = 'Prisegtos bylos';
+$labels['upload'] = 'Įkelti';
+$labels['close'] = 'Uždaryti';
+$labels['low'] = 'Žemas';
+$labels['lowest'] = 'Žemiausias';
+$labels['normal'] = 'Normalus';
+$labels['high'] = 'Aukštas';
+$labels['highest'] = 'Aukščiausias';
+$labels['nosubject'] = '(nėra temos)';
+$labels['showimages'] = 'Rodyti paveikslėlius';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Paprastas tekstas';
+$labels['name'] = 'Rodomas vardas';
+$labels['firstname'] = 'Vardas';
+$labels['surname'] = 'Pavardė';
+$labels['email'] = 'El. paštas';
+$labels['addcontact'] = 'Pridėti kontaktą';
+$labels['editcontact'] = 'Redaguoti kontaktą';
+$labels['edit'] = 'Redaguoti';
+$labels['cancel'] = 'Atšaukti';
+$labels['save'] = 'Išsaugoti';
+$labels['delete'] = 'Ištrinti';
+$labels['newcontact'] = 'Sukurti naują kontaktą';
+$labels['deletecontact'] = 'Ištrinti pažymėtus kontaktus';
+$labels['composeto'] = 'Rašyti laišką';
+$labels['contactsfromto'] = 'Kontaktai nuo $from iki $to iš $count';
+$labels['print'] = 'Atspausdinti';
+$labels['export'] = 'Eksportuoti';
+$labels['previouspage'] = 'Rodyti ankstesnį puslapį';
+$labels['firstpage'] = 'Rodyti pirmąjį puslapį';
+$labels['nextpage'] = 'Rodyti tolesnį puslapį';
+$labels['lastpage'] = 'Rodyti paskutinį puslapį';
+$labels['groups'] = 'Grupės';
+$labels['personaladrbook'] = 'Asmeniniai adresai';
+$labels['settingsfor'] = 'Nustatymai';
+$labels['preferences'] = 'Nustatymai';
+$labels['userpreferences'] = 'Vartotojo nustatymai';
+$labels['editpreferences'] = 'Redaguoti vartotojo nustatymus';
+$labels['identities'] = 'Tapatybės';
+$labels['manageidentities'] = 'Tvarkyti tapatybes šiai sąskaitai';
+$labels['newidentity'] = 'Nauja tapatybė';
+$labels['newitem'] = 'Naujas įrašas';
+$labels['edititem'] = 'Redaguoti įrašą';
+$labels['setdefault'] = 'Nustatyti pagrindiniu';
+$labels['language'] = 'Kalba';
+$labels['timezone'] = 'Laiko juosta';
+$labels['pagesize'] = 'Eilučių skaičius puslapyje';
+$labels['signature'] = 'Parašas';
+$labels['dstactive'] = 'Vasaros/Žiemos laikas';
+$labels['htmleditor'] = 'Kurti HTML laiškus';
+$labels['htmlsignature'] = 'HTML parašas';
+$labels['previewpane'] = 'Rodyti peržiūros lauką';
+$labels['autosavedraft'] = 'Automatiškai išsaugoti juodraščius';
+$labels['everynminutes'] = 'kas $n minutes(-ių)';
+$labels['never'] = 'niekada';
+$labels['folder'] = 'Aplankas';
+$labels['folders'] = 'Aplankai';
+$labels['foldername'] = 'Aplanko vardas';
+$labels['subscribed'] = 'Užsakytas';
+$labels['create'] = 'Sukurti';
+$labels['createfolder'] = 'Sukurti naują aplanką';
+$labels['rename'] = 'Pervadinti';
+$labels['renamefolder'] = 'Pervadinti aplanką';
+$labels['deletefolder'] = 'Ištrinti aplanką';
+$labels['managefolders'] = 'Tvarkyti aplankus';
+$labels['sortby'] = 'Rikiuoti pagal';
+$labels['sortasc'] = 'Rikiuoti didėjančia tvarka';
+$labels['sortdesc'] = 'Rikiuoti mažėjančia tvarka';
+
+?>
diff --git a/program/localization/lt/messages.inc b/program/localization/lt/messages.inc
new file mode 100644 (file)
index 0000000..13e8865
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/lt/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Martynas Bendorius <martynas@e-vaizdas.net>                   |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Prisijungti nepavyko';
+$messages['cookiesdisabled'] = 'Jūsų naršyklė nepriima slapukų';
+$messages['sessionerror'] = 'Jūsų sesija negaliojanti';
+$messages['imaperror'] = 'Nepavyko prisijungti prie IMAP serverio';
+$messages['nomessagesfound'] = 'Šioje pašto dėžutėje laiškų nėra ';
+$messages['loggedout'] = 'Jus sėkmingai atsijungėte. Viso gero!';
+$messages['mailboxempty'] = 'Pašto dėžutė tuščia';
+$messages['loading'] = 'Įkeliama...';
+$messages['loadingdata'] = 'Įkeliami duomenys...';
+$messages['checkingmail'] = 'Tikrinama ar nėra naujų pranešimų...';
+$messages['sendingmessage'] = 'Siunčiamas laiškas...';
+$messages['messagesent'] = 'Laiškas sėkmingai nusiųstas';
+$messages['savingmessage'] = 'Išsaugomas laiškas...';
+$messages['messagesaved'] = 'Laiškas išsaugotas į Juodraščius';
+$messages['successfullysaved'] = 'Sėkmingai išsaugota';
+$messages['addedsuccessfully'] = 'Kontaktas sėkmingai įtrauktas į adresų knygą';
+$messages['contactexists'] = 'Kontaktas, turintis šį el. pašto adresą, jau egzistuoja';
+$messages['blockedimages'] = 'Saugant jūsų privatumą su laišku neatsiųsti paveikslėliai nerodomi';
+$messages['encryptedmessage'] = 'Apgailestaujame, tačiau šis laiškas užšifruotas ir negali būti parodytas.';
+$messages['nocontactsfound'] = 'Kontaktų nerasta';
+$messages['contactnotfound'] = 'Reikalautas kontaktas nerastas';
+$messages['sendingfailed'] = 'Laiško išsiųsti nepavyko';
+$messages['errorsaving'] = 'Išsaugant įvyko klaida';
+$messages['errormoving'] = 'Laiško perkelti nepavyko';
+$messages['errordeleting'] = 'Laiško ištrinti nepavyko';
+$messages['deletecontactconfirm'] = 'Ar jūs tikrai norite ištrinti pasirinktą(-us) kontaktą(-us)?';
+$messages['deletemessagesconfirm'] = 'Ar jūs tikrai norite ištrinti pasirinktą(-us) žinutę(-es)?';
+$messages['deletefolderconfirm'] = 'Ar jūs tikrai norite ištrinti šį aplanką?';
+$messages['purgefolderconfirm'] = 'Ar jūs tikrai norite ištrinti visus laiškus, esančius šiame aplanke?';
+$messages['formincomplete'] = 'Šios formos laukai yra nepilnai užpildyti';
+$messages['noemailwarning'] = 'Prašome įvesti teisingą el. pašto adresą';
+$messages['nonamewarning'] = 'Prašome įvesti vardą';
+$messages['nopagesizewarning'] = 'Prašome įvesti puslapio dydį';
+$messages['norecipientwarning'] = 'Prašome įvesti bent vieną gavėją';
+$messages['nosubjectwarning'] = 'Temos laukelis tuščias. Ar norite temą įvesti dabar?';
+$messages['nobodywarning'] = 'Išsiųsti šį laišką be teksto?';
+$messages['notsentwarning'] = 'Laiškas neišsiųstas. Ar jūs tikrai norite jo atsikratyti?';
+$messages['noldapserver'] = 'Prašome pasirinkti LDAP serverį paieškai';
+$messages['nocontactsreturned'] = 'Kontaktas(-ai) nerastas(-i)';
+$messages['nosearchname'] = 'Prašom įvesti vardą arba el. pašto adresą';
+$messages['searchsuccessful'] = 'Surasta $nr žinučių';
+$messages['searchnomatch'] = 'Rezultatų nerasta';
+$messages['searching'] = 'Ieškoma...';
+$messages['checking'] = 'Tikrinama...';
+$messages['nospellerrors'] = 'Rašybos klaidų nerasta';
+$messages['folderdeleted'] = 'Aplankas sėkmingai ištrintas';
+$messages['deletedsuccessfully'] = 'Sėkmingai ištrintas';
+$messages['converting'] = 'Pašalinamas laiško formatavimas...';
+$messages['messageopenerror'] = 'Nepavyko įkelti laišką iš serverio';
+$messages['fileuploaderror'] = 'Nepavyko įkelti bylos';
+$messages['filesizeerror'] = 'Įkelta byla viršija maksimalų vietos limitą — $size';
+$messages['copysuccess'] = 'Sėkmingai nukopijuoti $nr adresai';
+$messages['copyerror'] = 'Adresų kopijuoti negalima';
+$messages['sourceisreadonly'] = 'Šis adreso šaltinis yra tik skaitymui';
+$messages['errorsavingcontact'] = 'Kontakto adreso išsaugoti negalima';
+
+?>
diff --git a/program/localization/lv/labels.inc b/program/localization/lv/labels.inc
new file mode 100644 (file)
index 0000000..54716a2
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/lv/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Rudolfs Osins <dev.random@gmail.com>                          |
+ | Updated for 0.1-rc1: Mikelis Zalais <mik@prog.lv>                     |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Esiet laipni lūgti $product';
+$labels['username'] = 'Lietotājvārds';
+$labels['password'] = 'Parole';
+$labels['server'] = 'Serveris';
+$labels['login'] = 'Pieslēgties';
+$labels['logout'] = 'Atslēgties';
+$labels['mail'] = 'E-pasts';
+$labels['settings'] = 'Personīgie iestatījumi';
+$labels['addressbook'] = 'Adrešu grāmata';
+$labels['inbox'] = 'Ienākošās';
+$labels['drafts'] = 'Uzmetumi';
+$labels['sent'] = 'Nosūtītās';
+$labels['trash'] = 'Miskaste';
+$labels['junk'] = 'Mēstules';
+$labels['subject'] = 'Temats';
+$labels['from'] = 'No';
+$labels['to'] = 'Kam';
+$labels['cc'] = 'Kopija';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Atbildēt uz';
+$labels['date'] = 'Datums';
+$labels['size'] = 'Izmērs';
+$labels['priority'] = 'Prioritāte';
+$labels['organization'] = 'Organizācija';
+$labels['reply-to'] = 'Atbildēt uz';
+$labels['mailboxlist'] = 'Mapes';
+$labels['messagesfromto'] = 'Vēstules $from līdz $to no $count';
+$labels['messagenrof'] = '$nr. vēstule  no $count';
+$labels['moveto'] = 'pārvietot uz...';
+$labels['download'] = 'lejupielādēt';
+$labels['filename'] = 'Faila nosaukums';
+$labels['filesize'] = 'Faila izmērs';
+$labels['preferhtml'] = 'Dot priekšroku HTML';
+$labels['htmlmessage'] = 'HTML vēstule';
+$labels['prettydate'] = '"Skaists" datums';
+$labels['addtoaddressbook'] = 'Pievienot adrešu grāmatai';
+$labels['sun'] = 'Sv';
+$labels['mon'] = 'P';
+$labels['tue'] = 'O';
+$labels['wed'] = 'T';
+$labels['thu'] = 'C';
+$labels['fri'] = 'P';
+$labels['sat'] = 'Se';
+$labels['sunday'] = 'Svētdiena';
+$labels['monday'] = 'Pirmdiena';
+$labels['tuesday'] = 'Otrdiena';
+$labels['wednesday'] = 'Trešdiena';
+$labels['thursday'] = 'Ceturtdiena';
+$labels['friday'] = 'Piektdiena';
+$labels['saturday'] = 'Sestdiena';
+$labels['today'] = 'Šodien';
+$labels['checkmail'] = 'Pārbaudīt pastu';
+$labels['writenewmessage'] = 'Rakstīt jaunu vēstuli';
+$labels['replytomessage'] = 'Atbildēt uz vēstuli';
+$labels['replytoallmessage'] = 'Atbildēt sūtītājam un visiem saņēmējiem';
+$labels['forwardmessage'] = 'Pārsūtīt vēstuli';
+$labels['deletemessage'] = 'Pārvietot vēstuli uz miskasti';
+$labels['printmessage'] = 'Izdrukāt šo vēstuli';
+$labels['previousmessage'] = 'Parādīt iepriekšējo vēstuli';
+$labels['previousmessages'] = 'Parādīt iepriekšējo vēstuļu kopu';
+$labels['firstmessage'] = 'Parādīt pirmo vēstuli';
+$labels['firstmessages'] = 'Parādīt pirmo vēstuļu kopu';
+$labels['nextmessage'] = 'Parādīt nākamo vēstuli';
+$labels['nextmessages'] = 'Parādīt nākamo vēstuļu kopu';
+$labels['lastmessage'] = 'Parādīt pēdējo vēstuli';
+$labels['lastmessages'] = 'Parādīt pēdējo vēstuļu kopu';
+$labels['backtolist'] = 'Atpakaļ uz vēstuļu sarakstu';
+$labels['viewsource'] = 'Rādīt pirmtekstu';
+$labels['select'] = 'Iezīmēt';
+$labels['all'] = 'Visas';
+$labels['none'] = 'Nevienu';
+$labels['unread'] = 'Nelasītās';
+$labels['compact'] = 'Saspiest';
+$labels['empty'] = 'Iztukšot';
+$labels['purge'] = 'Iztīrīt';
+$labels['quota'] = 'Kvota';
+$labels['unknown'] = 'nezināms';
+$labels['unlimited'] = 'neierobežots';
+$labels['quicksearch'] = 'Ārtā meklēšana';
+$labels['resetsearch'] = 'Atstatīt meklēšanu';
+$labels['compose'] = 'Rakstīt vēstuli';
+$labels['sendmessage'] = 'Sūtīt vēstuli';
+$labels['savemessage'] = 'Saglabāt uzmetumu';
+$labels['addattachment'] = 'Pievienot failu';
+$labels['charset'] = 'Rakstzīmju kopa';
+$labels['editortype'] = 'Redaktora tips';
+$labels['returnreceipt'] = 'Saņemšanas apstiprinājums';
+$labels['checkspelling'] = 'Pārbaudīt pareizrakstību';
+$labels['resumeediting'] = 'Turpināt rediģēšanu';
+$labels['revertto'] = 'Atgriezt uz';
+$labels['attachments'] = 'Pielikumi';
+$labels['upload'] = 'Augšupielādēt';
+$labels['close'] = 'Aizvērt';
+$labels['low'] = 'Zema';
+$labels['lowest'] = 'Zemākā';
+$labels['normal'] = 'Normāla';
+$labels['high'] = 'Augsta';
+$labels['highest'] = 'Augstākā';
+$labels['nosubject'] = '(no subject)';
+$labels['showimages'] = 'Rādīt attēlus';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Vienkāršs teksts';
+$labels['name'] = 'Uzrādītais vārds';
+$labels['firstname'] = 'Vārds';
+$labels['surname'] = 'Uzvārds';
+$labels['email'] = 'E-pasts';
+$labels['addcontact'] = 'Pievienot iezīmēto ierakstu adrešu grāmatai';
+$labels['editcontact'] = 'Rediģēt adrešu grāmatas ierakstu';
+$labels['edit'] = 'Rediģēt';
+$labels['cancel'] = 'Atcelt';
+$labels['save'] = 'Saglabāt';
+$labels['delete'] = 'Dzēst';
+$labels['newcontact'] = 'Izveidot jaunu ierakstu adrešu grāmatā';
+$labels['deletecontact'] = 'Dzēst iezīmētos ierakstus';
+$labels['composeto'] = 'Rakstīt vēstuli';
+$labels['contactsfromto'] = 'Ieraksti $from līdz $to no $count';
+$labels['print'] = 'Drukāt';
+$labels['export'] = 'Eksportēt';
+$labels['previouspage'] = 'Parādīt iepriekšējo kopu';
+$labels['firstpage'] = 'Parādīt pirmo kopu';
+$labels['nextpage'] = 'Parādīt nākamo kopu';
+$labels['lastpage'] = 'Parādīt pēdējo kopu';
+$labels['groups'] = 'Grupas';
+$labels['personaladrbook'] = 'Personīgās adreses';
+$labels['settingsfor'] = 'Iestatījumi';
+$labels['preferences'] = 'Preferences';
+$labels['userpreferences'] = 'Lietotāja preferences';
+$labels['editpreferences'] = 'Rediģēt lietotāja preferences';
+$labels['identities'] = 'Identitātes';
+$labels['manageidentities'] = 'Rediģēt šī konta identitātes';
+$labels['newidentity'] = 'Jauna identitāte';
+$labels['newitem'] = 'Jauns';
+$labels['edititem'] = 'Rediģēt';
+$labels['setdefault'] = 'Uzlikt kā noklusēto';
+$labels['language'] = 'Valoda';
+$labels['timezone'] = 'Laika zona';
+$labels['pagesize'] = 'Rindas lapā';
+$labels['signature'] = 'Paraksts';
+$labels['dstactive'] = 'Vasaras/ziemas laiks';
+$labels['htmleditor'] = 'Rakstīt HTML vēstules';
+$labels['htmlsignature'] = 'HTML paraksts';
+$labels['previewpane'] = 'Rādīt priekšskatījuma paneli';
+$labels['autosavedraft'] = 'Automātiski saglabāt uzmetumu';
+$labels['everynminutes'] = 'katras $n minūtes';
+$labels['never'] = 'nekad';
+$labels['folder'] = 'Mape';
+$labels['folders'] = 'Mapes';
+$labels['foldername'] = 'Mapes nosaukums';
+$labels['subscribed'] = 'Abonētās';
+$labels['create'] = 'Izveidot';
+$labels['createfolder'] = 'Izveidot jaunu mapi';
+$labels['rename'] = 'Pārsaukt';
+$labels['renamefolder'] = 'Pārsaukt mapi';
+$labels['deletefolder'] = 'Dzēst mapi';
+$labels['managefolders'] = 'Rediģēt mapes';
+$labels['sortby'] = 'Kārtot pēc';
+$labels['sortasc'] = 'Kārtot augošā secībā';
+$labels['sortdesc'] = 'Kārtot dilstošā secībā';
+
+?>
\ No newline at end of file
diff --git a/program/localization/lv/messages.inc b/program/localization/lv/messages.inc
new file mode 100644 (file)
index 0000000..753961b
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/lv/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Rudolfs Osins <dev.random@gmail.com>                          |
+ | Updated for 0.1-rc1: Mikelis Zalais <mik@prog.lv>                     |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Neizdevās pieslēgties';
+$messages['cookiesdisabled'] = 'Jūsu pārlūkprogramma neatbalsta sīkdatnes (cookies)';
+$messages['sessionerror'] = 'Jūsu sessija ir beigusies';
+$messages['imaperror'] = 'Neizdevās pieslēgties IMAP serverim';
+$messages['nomessagesfound'] = 'Šajā pastkastē nav vēstuļu';
+$messages['loggedout'] = 'Jūs esat veiksmīgi atslēdzies';
+$messages['mailboxempty'] = 'Pastkaste tukša';
+$messages['loading'] = 'Notiek ielāde...';
+$messages['loadingdata'] = 'Tiek ielādēti dati...';
+$messages['checkingmail'] = 'Notiek pasta pārbaude...';
+$messages['sendingmessage'] = 'Tiek sūtīta vēstule...';
+$messages['messagesent'] = 'Vēstule nosūtīta veiksmīgi';
+$messages['savingmessage'] = 'Vēstule tiek saglabāta...';
+$messages['messagesaved'] = 'Vēstule saglabāta pie uzmetumiem';
+$messages['successfullysaved'] = 'Saglabāts veiksmīgi';
+$messages['addedsuccessfully'] = 'Ieraksts veiksmīgi pievienots adrešu grāmatai';
+$messages['contactexists'] = 'Ieraksts ar šādu e-pasta adresi jau eksistē';
+$messages['blockedimages'] = 'Drošības nolūkos attēli, kas tiek ielādēti no cita servera, šajā vēstulē ir bloķēti';
+$messages['encryptedmessage'] = 'Šī ir šifrēta vēstule un diemžēl nevar tikt parādīta';
+$messages['nocontactsfound'] = 'Ieraksti netika atrasti';
+$messages['contactnotfound'] = 'Prasītais kontakts nav atrasts';
+$messages['sendingfailed'] = 'Vēstule netika nosūtīta';
+$messages['errorsaving'] = 'Saglabājot vēstuli notikusi kļūme, vēstule netika saglabāta';
+$messages['errormoving'] = 'Vēstule netika pārvietota';
+$messages['errordeleting'] = 'Vēstule netika dzēsta';
+$messages['deletecontactconfirm'] = 'Vai tiešām vēlaties dzēst iezīmēto(ās) kontaktpersonas?';
+$messages['deletemessagesconfirm'] = 'Vai tiešām vēlaties dzēst iezīmēto(ās) vēstules?';
+$messages['deletefolderconfirm'] = 'Vai tiešām vēlaties dzēst šo mapi?';
+$messages['purgefolderconfirm'] = 'Vai tiešām vēlaties dzēst visas vēstules, kas atrodas šajā mapē?';
+$messages['formincomplete'] = 'Formulārs nav pilnībā aizpildīts';
+$messages['noemailwarning'] = 'Lūdzu ievadiet pareizu e-pasta adresi';
+$messages['nonamewarning'] = 'Lūdzu ievadiet vārdu';
+$messages['nopagesizewarning'] = 'Lūdzu ievadiet lapas izmēru';
+$messages['norecipientwarning'] = 'Lūdzu ievadiet vismaz vienu saņēmēju';
+$messages['nosubjectwarning'] = 'Lauks "temats" ir tukšs. Vai vēlaties to aizpildīt tagad?';
+$messages['nobodywarning'] = 'Sūtīt vēstuli bez satura teksta?';
+$messages['notsentwarning'] = 'Vēstule netika nosūtīta. Vai vēlaties atmest savu vēstuli?';
+$messages['noldapserver'] = 'Lūdzu izvēlaties LDAP serveri';
+$messages['nocontactsreturned'] = 'Neviena kontaktpersona netika atrasta';
+$messages['nosearchname'] = 'Lūdzu ievadiet kontaktpersonas vārdu vai e-pasta adresi';
+$messages['searchsuccessful'] = 'Atrastas $nr vēstules';
+$messages['searchnomatch'] = 'Meklēšanā nekas netika atrasts';
+$messages['searching'] = 'Notiek meklēšana...';
+$messages['checking'] = 'Notiek pārbaude...';
+$messages['nospellerrors'] = 'Netika atrastas pareizrakstības kļudas';
+$messages['folderdeleted'] = 'Mape veiksmīgi izdzēsta';
+$messages['deletedsuccessfully'] = 'Veiksmīgi izdzēsts';
+$messages['converting'] = 'Tiek novākts vēstules formatējums...';
+$messages['messageopenerror'] = 'Nevarēja ielādēt vēstuli no servera';
+$messages['fileuploaderror'] = 'Neizdevās ielādēt failu';
+$messages['filesizeerror'] = 'Ielādētais fails pārsniedz pieļaujamo $size apjomu';
+$messages['copysuccess'] = 'Veiksmīgi nokopētas $nr vēstules';
+$messages['copyerror'] = 'Nevarēja nokopēt nevienu adresi';
+$messages['sourceisreadonly'] = 'Adreses avots ir lasīšanas režīmā tikai';
+$messages['errorsavingcontact'] = 'Nevarēja saglabāt kontakta adreses';
+
+?>
\ No newline at end of file
diff --git a/program/localization/nb_NO/labels.inc b/program/localization/nb_NO/labels.inc
new file mode 100644 (file)
index 0000000..1b46546
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/nb_NO/labels.inc                                             |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | All rights reserved.                                                  |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Kjetil Waage - Nextline AS <kjetil@nextline.no>               |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 553 2007-05-13 16:31:19Z thomasb $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Velkommen til $product';
+$labels['username'] = 'Brukernavn:';
+$labels['password'] = 'Passord:';
+$labels['server'] = 'Server';
+$labels['login'] = 'Logg på';
+$labels['logout'] = 'Logg ut';
+$labels['mail'] = 'E-post';
+$labels['settings'] = 'Personlige innstillinger';
+$labels['addressbook'] = 'Adressebok';
+$labels['inbox'] = 'Innboks';
+$labels['drafts'] = 'Kladder';
+$labels['sent'] = 'Sendt post';
+$labels['trash'] = 'Søppel';
+$labels['junk'] = 'Junk';
+$labels['subject'] = 'Emne';
+$labels['from'] = 'Avsender';
+$labels['to'] = 'Mottaker';
+$labels['cc'] = 'Kopi til';
+$labels['bcc'] = 'BCC';
+$labels['replyto'] = 'Svar til';
+$labels['date'] = 'Dato';
+$labels['size'] = 'Størrelse';
+$labels['priority'] = 'Prioritet';
+$labels['organization'] = 'Organisasjon';
+$labels['reply-to'] = 'Svar til';
+$labels['mailboxlist'] = 'Mapper';
+$labels['messagesfromto'] = 'Meldinger $from til $to av $count';
+$labels['messagenrof'] = 'Meldinger $nr av $count';
+$labels['moveto'] = 'flytt til...';
+$labels['download'] = 'last ned';
+$labels['filename'] = 'Filnavn';
+$labels['filesize'] = 'Filstørrelse';
+$labels['preferhtml'] = 'Foretrekk HTML';
+$labels['htmlmessage'] = 'HTML besked';
+$labels['prettydate'] = 'Pen datovisning';
+$labels['addtoaddressbook'] = 'Tilføy til adresseboken';
+$labels['sun'] = 'Søn';
+$labels['mon'] = 'Man';
+$labels['tue'] = 'Tir';
+$labels['wed'] = 'Ons';
+$labels['thu'] = 'Tor';
+$labels['fri'] = 'Fre';
+$labels['sat'] = 'Lør';
+$labels['sunday'] = 'Søndag';
+$labels['monday'] = 'Mandag';
+$labels['tuesday'] = 'Tirsdag';
+$labels['wednesday'] = 'Onsdag';
+$labels['thursday'] = 'Torsdag';
+$labels['friday'] = 'Fredag';
+$labels['saturday'] = 'Lørdag';
+$labels['today'] = 'I dag';
+$labels['checkmail'] = 'Sjekk for nye beskjeder';
+$labels['writenewmessage'] = 'Opprett en ny e-post';
+$labels['replytomessage'] = 'Svar på denne e-post';
+$labels['replytoallmessage'] = 'Svar til alle mottakere';
+$labels['forwardmessage'] = 'Videresend denne e-post';
+$labels['deletemessage'] = 'Flytt e-posten til søppel';
+$labels['printmessage'] = 'Skriv ut denne e-post';
+$labels['previousmessage'] = 'Vis forrige melding';
+$labels['previousmessages'] = 'Vis forrige side';
+$labels['firstmessage'] = 'Vis første meldingen';
+$labels['firstmessages'] = 'Vis første side med meldinger';
+$labels['nextmessage'] = 'Vis neste melding';
+$labels['nextmessages'] = 'Vis neste side';
+$labels['lastmessage'] = 'Vis siste melding';
+$labels['lastmessages'] = 'Vis siste side med meldinger';
+$labels['backtolist'] = 'Tilbake til e-postlisten';
+$labels['viewsource'] = 'Vis kilde';
+$labels['select'] = 'Velg';
+$labels['all'] = 'Alle';
+$labels['none'] = 'Ingen';
+$labels['unread'] = 'Uleste';
+$labels['compact'] = 'Rydd opp';
+$labels['empty'] = 'Tøm';
+$labels['purge'] = 'Tøm';
+$labels['quota'] = 'Disk forbruk';
+$labels['unknown'] = 'ukjent';
+$labels['unlimited'] = 'ubegrenset';
+$labels['quicksearch'] = 'Hurtigsøk';
+$labels['resetsearch'] = 'Nullstill søk';
+$labels['compose'] = 'Lag ny e-post';
+$labels['sendmessage'] = 'Send e-posten';
+$labels['savemessage'] = 'Lagre kladd';
+$labels['addattachment'] = 'Vedlegg';
+$labels['charset'] = 'Tegnsett';
+$labels['editortype'] = 'Format';
+$labels['returnreceipt'] = 'Be om kvittering';
+$labels['checkspelling'] = 'Stavekontroll';
+$labels['resumeediting'] = 'Fortsett redigering';
+$labels['revertto'] = 'Tilbake til';
+$labels['attachments'] = 'Vedlegg';
+$labels['upload'] = 'Last opp';
+$labels['close'] = 'Lukk';
+$labels['low'] = 'Lav';
+$labels['lowest'] = 'Lavest';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Høy';
+$labels['highest'] = 'Høyest';
+$labels['nosubject'] = '(ingen emne)';
+$labels['showimages'] = 'Vis bilder';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Ren tekst';
+$labels['name'] = 'Vist navn';
+$labels['firstname'] = 'Fornavn';
+$labels['surname'] = 'Etternavn';
+$labels['email'] = 'E-post';
+$labels['addcontact'] = 'Legg til en ny kontakt';
+$labels['editcontact'] = 'Rediger kontakt';
+$labels['edit'] = 'Rediger';
+$labels['cancel'] = 'Avbryt';
+$labels['save'] = 'Lagre';
+$labels['delete'] = 'Slett';
+$labels['newcontact'] = 'Opprett ny kontakt';
+$labels['deletecontact'] = 'Slett valgte kontakter';
+$labels['composeto'] = 'Skriv e-post til';
+$labels['contactsfromto'] = 'Kontakter $from til $to av $count';
+$labels['print'] = 'Skriv ut';
+$labels['export'] = 'Eksportere';
+$labels['previouspage'] = 'Vis forrige sett';
+$labels['firstpage'] = 'Vis første sett';
+$labels['nextpage'] = 'Vis neste sett';
+$labels['lastpage'] = 'Vis siste sett';
+$labels['groups'] = 'Grupper';
+$labels['personaladrbook'] = 'Egne adresser';
+$labels['settingsfor'] = 'Innstillinger for';
+$labels['preferences'] = 'Oppsett';
+$labels['userpreferences'] = 'Brukeroppsett';
+$labels['editpreferences'] = 'Rediger brukeroppsett';
+$labels['identities'] = 'Identiteter';
+$labels['manageidentities'] = 'Administrer identitetene for denne kontoen';
+$labels['newidentity'] = 'Ny identitet';
+$labels['newitem'] = 'Nytt punkt';
+$labels['edititem'] = 'Rediger punkt';
+$labels['setdefault'] = 'Sett standard';
+$labels['language'] = 'Språk';
+$labels['timezone'] = 'Tidssone';
+$labels['pagesize'] = 'Linjer per side';
+$labels['signature'] = 'Signatur';
+$labels['dstactive'] = 'Sommertid';
+$labels['htmleditor'] = 'Bruk HTML editor';
+$labels['htmlsignature'] = 'HTML signatur';
+$labels['previewpane'] = 'Forhåndsvisning';
+$labels['autosavedraft'] = 'Autolagring av utkast';
+$labels['everynminutes'] = 'Hver $n minutt';
+$labels['never'] = 'Aldri';
+$labels['folder'] = 'Mappe';
+$labels['folders'] = 'Mapper';
+$labels['foldername'] = 'Mappenavn';
+$labels['subscribed'] = 'Abonnere';
+$labels['create'] = 'Opprett';
+$labels['createfolder'] = 'Lag ny mappe';
+$labels['rename'] = 'Endre navn';
+$labels['renamefolder'] = 'Endre navn på mappe';
+$labels['deletefolder'] = 'Slett mappe';
+$labels['managefolders'] = 'Rediger mapper';
+$labels['sortby'] = 'Sorter etter';
+$labels['sortasc'] = 'Eldste først';
+$labels['sortdesc'] = 'Nyeste først';
+
+?>
\ No newline at end of file
diff --git a/program/localization/nb_NO/messages.inc b/program/localization/nb_NO/messages.inc
new file mode 100644 (file)
index 0000000..0da3335
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/nb_NO/messages.inc                                           |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | All rights reserved.                                                  |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Kjetil Waage - Nextline AS <kjetil@nextline.no>               |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 553 2007-05-13 16:31:19Z thomasb $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Mislykket pålogging';
+$messages['cookiesdisabled'] = 'Din nettleser aksepterer ikke cookies';
+$messages['sessionerror'] = 'Din session er ugyldig eller utløpt';
+$messages['imaperror'] = 'Forbindelsen til IMAP serveren sviktet';
+$messages['nomessagesfound'] = 'Det ble ikke funnet noen beskjeder i denne postkassen';
+$messages['loggedout'] = 'Du er logget av webmail. Ha det bra!';
+$messages['mailboxempty'] = 'Postkassen er tom!';
+$messages['loading'] = 'Laster...';
+$messages['loadingdata'] = 'Laster data...';
+$messages['checkingmail'] = 'Sjekker for nye beskjeder...';
+$messages['sendingmessage'] = 'Sender beskjed...';
+$messages['messagesent'] = 'Beskjeden ble sendt uten feil';
+$messages['savingmessage'] = 'Lagrer beskjed...';
+$messages['messagesaved'] = 'Beskjed er lagret i "kladder" mappen';
+$messages['successfullysaved'] = 'Lagret';
+$messages['addedsuccessfully'] = 'Kontakten ble tilføyd i adresseboken';
+$messages['contactexists'] = 'Der er allerede en kontakt med denne e-post adressen';
+$messages['blockedimages'] = 'Bilder fra eksterne servere er blokkert i denne e-posten.';
+$messages['encryptedmessage'] = 'Dette er en krypteret beskjed og kan ikke vises. Beklager!';
+$messages['nocontactsfound'] = 'Ingen kontakter ble funnet';
+$messages['contactnotfound'] = 'Den forespurte kontakten ble ikke funnet';
+$messages['sendingfailed'] = 'Kunne ikke sende e-posten';
+$messages['errorsaving'] = 'Det oppstod en feil ved lagring av data';
+$messages['errormoving'] = 'Kunne ikke flytte beskjeden';
+$messages['errordeleting'] = 'Kunne ikke slette beskjeden';
+$messages['deletecontactconfirm'] = 'Vil du virkelig slette valgte kontakt(er)?';
+$messages['deletemessagesconfirm'] = 'Vil du virkelig slette valgte meldingen(e)?';
+$messages['deletefolderconfirm'] = 'Vil du virkelig slette denne mappen?';
+$messages['purgefolderconfirm'] = 'Vil du virkelig slette alle meldingene i denne mappen?';
+$messages['formincomplete'] = 'Skjemaet var ikke fullstendig fylt ut';
+$messages['noemailwarning'] = 'Skriv inn en gyldig e-post adresse';
+$messages['nonamewarning'] = 'Angi et navn';
+$messages['nopagesizewarning'] = 'Angi sidestørrelsen';
+$messages['norecipientwarning'] = 'Skriv inn minst en mottaker';
+$messages['nosubjectwarning'] = '"Emne" feltet er tomt. Vil du skrive det inn nå?';
+$messages['nobodywarning'] = 'Send denne e-post uten tekst?';
+$messages['notsentwarning'] = 'E-posten ble ikke sendt. Vil du slette meldingen?';
+$messages['noldapserver'] = 'Venligst velg hvilken LDAP server det skal søkes i';
+$messages['nocontactsreturned'] = 'Ingen kontakter ble funnet';
+$messages['nosearchname'] = 'Venligst skriv inn kontaktens navn eller e-post adresse';
+$messages['searchsuccessful'] = '$nr meldinger funnet';
+$messages['searchnomatch'] = 'Søket ga ingen resultater';
+$messages['searching'] = 'Søker...';
+$messages['checking'] = 'Sjekker...';
+$messages['nospellerrors'] = 'Ingen stavefeil funnet';
+$messages['folderdeleted'] = 'Mappe slettet';
+$messages['deletedsuccessfully'] = 'Slettet';
+$messages['converting'] = 'Fjerner formatering fra meldingen...';
+$messages['messageopenerror'] = 'Kunne ikke laste meldingen fra server';
+$messages['fileuploaderror'] = 'Opplasting feilet';
+$messages['filesizeerror'] = 'Filen overstiger maksimum tillatt filstørrelse ($size)';
+$messages['copysuccess'] = '$nr adresser ble kopiert';
+$messages['copyerror'] = 'Kunne ikke kopiere';
+$messages['sourceisreadonly'] = 'Denne adressekilden er skrivebeskyttet';
+$messages['errorsavingcontact'] = 'Kunne ikke lagre adressen';
+
+?>
\ No newline at end of file
diff --git a/program/localization/nl_NL/labels.inc b/program/localization/nl_NL/labels.inc
new file mode 100644 (file)
index 0000000..6345429
--- /dev/null
@@ -0,0 +1,240 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/nl_NL/labels.inc                                             |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Mark Moses <mark@katmoda.com>                                 |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 558 2007-05-15 06:53:08Z robin $
+
+*/
+
+$labels = array();
+
+// login page
+$labels['welcome']   = 'Welkom bij $product';
+$labels['username']  = 'Gebruikersnaam';
+$labels['password']  = 'Wachtwoord';
+$labels['server']    = 'Server';
+$labels['login']     = 'Login';
+
+// taskbar
+$labels['logout']   = 'Uitloggen';
+$labels['mail']     = 'E-Mail';
+$labels['settings'] = 'Persoonlijke Instellingen';
+$labels['addressbook'] = 'Adresboek';
+
+// mailbox names
+$labels['inbox']  = 'Postvak IN';
+$labels['drafts'] = 'Concepten';
+$labels['sent']   = 'Verzonden';
+$labels['trash']  = 'Prullenbak';
+$labels['junk']   = 'SPAM';
+
+// message listing
+$labels['subject'] = 'Onderwerp';
+$labels['from']    = 'Afzender';
+$labels['to']      = 'Ontvanger';
+$labels['cc']      = 'kopie';
+$labels['bcc']     = 'Bcc';
+$labels['replyto'] = 'Antwoord-aan';
+$labels['date']    = 'Datum';
+$labels['size']    = 'Grootte';
+$labels['priority'] = 'Prioriteit';
+$labels['organization'] = 'Organisatie';
+
+// aliases
+$labels['reply-to'] = $labels['replyto'];
+
+$labels['mailboxlist'] = 'Mappen';
+$labels['messagesfromto'] = 'Bericht $from t/m $to van $count';
+$labels['messagenrof'] = 'Bericht $nr van $count';
+
+$labels['moveto']   = 'verplaats naar...';
+$labels['download'] = 'download';
+
+$labels['filename'] = 'Bestandsnaam';
+$labels['filesize'] = 'Bestandsgrootte';
+
+$labels['preferhtml'] = 'Prefereer HTML';
+$labels['htmlmessage'] = 'HTML Bericht';
+$labels['prettydate'] = 'Opgemaakte data';
+
+$labels['addtoaddressbook'] = 'Toevoegen aan adresboek';
+
+// weekdays short
+$labels['sun'] = 'Zo';
+$labels['mon'] = 'Ma';
+$labels['tue'] = 'Di';
+$labels['wed'] = 'Wo';
+$labels['thu'] = 'Do';
+$labels['fri'] = 'Vr';
+$labels['sat'] = 'Za';
+
+// weekdays long
+$labels['sunday']    = 'Zondag';
+$labels['monday']    = 'Maandag';
+$labels['tuesday']   = 'Dinsdag';
+$labels['wednesday'] = 'Woensdag';
+$labels['thursday']  = 'Donderdag';
+$labels['friday']    = 'Vrijdag';
+$labels['saturday']  = 'Zaterdag';
+
+$labels['today'] = 'Vandaag';
+
+// toolbar buttons
+$labels['checkmail']        = 'Controleer op nieuwe berichten';
+$labels['writenewmessage']  = 'Nieuw bericht';
+$labels['replytomessage']   = 'Beantwoord het bericht';
+$labels['replytoallmessage'] = 'Beantwoord alle ontvangers';
+$labels['forwardmessage']   = 'Bericht doorsturen';
+$labels['deletemessage']    = 'Verplaats het bericht naar de prullenbak';
+$labels['printmessage']     = 'Dit bericht afdrukken';
+$labels['previousmessage']  = 'Toon het vorige bericht';
+$labels['previousmessages'] = 'Toon vorige lijst met berichten';
+$labels['firstmessage']     = 'Toon het eerste bericht';
+$labels['firstmessages']    = 'Toon eerste lijst met berichten';
+$labels['nextmessage']      = 'Toon het volgende bericht';
+$labels['nextmessages']     = 'Toon volgende lijst met berichten';
+$labels['lastmessage']      = 'Toon het laatste bericht';
+$labels['lastmessages']     = 'Toon laatste lijst met berichten';
+$labels['backtolist']       = 'Terug naar berichtenoverzicht';
+$labels['viewsource']       = 'Toon bron';
+
+$labels['select'] = 'Selecteer';
+$labels['all'] = 'Allemaal';
+$labels['none'] = 'Geen';
+$labels['unread'] = 'Ongelezen';
+
+$labels['compact'] = 'Compact';
+$labels['empty'] = 'Legen';
+$labels['purge'] = 'Purge';
+
+$labels['quota'] = 'Schijfruimte gebruik';
+$labels['unknown']  = 'onbekend';
+$labels['unlimited']  = 'onbeperkt';
+
+$labels['quicksearch']  = 'Snel zoeken';
+$labels['resetsearch']  = 'Reset zoekopdracht';
+
+// message compose
+$labels['compose']  = 'Maak een bericht';
+$labels['savemessage']  = 'Bewaar als concept';
+$labels['sendmessage']  = 'Verstuur het bericht nu';
+$labels['addattachment']  = 'Voeg een bijlage toe';
+$labels['charset']  = 'karakterset';
+$labels['editortype']     = 'Opmaak';
+$labels['returnreceipt'] = 'Ontvangstbevestiging';
+
+$labels['checkspelling'] = 'Check spelling';
+$labels['resumeediting'] = 'Doorgaan met opstellen';
+$labels['revertto'] = 'Wijzig terug in';
+
+$labels['attachments'] = 'Bijlages';
+$labels['upload'] = 'Toevoegen';
+$labels['close']  = 'Sluit';
+
+$labels['low']     = 'Laag';
+$labels['lowest']  = 'Laagste';
+$labels['normal']  = 'Normaal';
+$labels['high']    = 'Hoog';
+$labels['highest'] = 'Hoogste';
+
+$labels['nosubject']  = '(geen onderwerp)';
+$labels['showimages'] = 'Toon afbeeldingen';
+
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Gewone tekst';
+
+// address boook
+$labels['name']      = 'Naam';
+$labels['firstname'] = 'Voornaam';
+$labels['surname']   = 'Achternaam';
+$labels['email']     = 'E-Mail';
+
+$labels['addcontact'] = 'Nieuw contactpersoon toevoegen';
+$labels['editcontact'] = 'Contactpersoon wijzigen';
+
+$labels['edit']   = 'Wijzig';
+$labels['cancel'] = 'Annuleer';
+$labels['save']   = 'Opslaan';
+$labels['delete'] = 'Verwijder';
+
+$labels['newcontact']     = 'Voeg een nieuwe contactpersoon toe';
+$labels['addcontact']     = 'Voeg geselecteerde contacten toe aan het adresboek';
+$labels['deletecontact']  = 'Verwijder geselecteerde contacten';
+$labels['composeto']      = 'Stuur een bericht naar';
+$labels['contactsfromto'] = 'Contacten $from t/m $to van $count';
+$labels['print']          = 'Afdrukken';
+$labels['export']         = 'Exporteren';
+
+$labels['previouspage']   = 'Vorige pagina';
+$labels['firstpage']      = 'Eerste pagina';
+$labels['nextpage']       = 'Volgende pagina';
+$labels['lastpage']       = 'Laatste pagina';
+
+$labels['groups']          = 'Groepen';
+$labels['personaladrbook'] = 'Persoonlijk Adresboek';
+
+// LDAP search
+$labels['ldapsearch'] = 'LDAP adresboek zoeken';
+
+$labels['ldappublicsearchname']    = 'Naam van contactpersoon';
+$labels['ldappublicsearchtype'] = 'Precies matchen?';
+$labels['ldappublicserverselect'] = 'Selecteer servers';
+$labels['ldappublicsearchfield'] = 'Zoek op';
+$labels['ldappublicsearchform'] = 'Zoek een contactpersoon';
+$labels['ldappublicsearch'] = 'Zoek';
+
+// settings
+$labels['settingsfor']  = 'Instellingen voor';
+
+$labels['preferences']  = 'Instellingen';
+$labels['userpreferences']  = 'Gebruikers instellingen';
+$labels['editpreferences']  = 'Wijzig gebruikers instellingen';
+
+$labels['identities']  = 'Identititeiten';
+$labels['manageidentities']  = 'Beheer identiteiten voor dit account';
+$labels['newidentity']  = 'Identiteit toevoegen';
+
+$labels['newitem']  = 'Nieuw item';
+$labels['edititem']  = 'Wijzig item';
+
+$labels['setdefault']  = 'Stel als standaard in';
+$labels['language']  = 'Taal';
+$labels['timezone']  = 'Tijdszone';
+$labels['pagesize']  = 'Rijen per pagina';
+$labels['signature'] = 'Onderschrift';
+$labels['dstactive']  = 'Zomertijd';
+$labels['htmleditor'] = 'Maak HTML berichten aan';
+$labels['htmlsignature'] = 'HTML onderschrift';
+$labels['previewpane'] = 'Toon voorbeeldvenster';
+
+$labels['autosavedraft']  = 'Concept automatisch opslaan';
+$labels['everynminutes']  = 'iedere $n minuten';
+$labels['never']  = 'nooit';
+
+$labels['folder']  = 'Map';
+$labels['folders']  = 'Mappen';
+$labels['foldername']  = 'Mapnaam';
+$labels['subscribed']  = 'Geabonneerd';
+$labels['create']  = 'Nieuw';
+$labels['createfolder']  = 'Maak nieuwe map';
+$labels['rename'] = 'Wijzig naam';
+$labels['renamefolder'] = 'Wijzig mapnaam';
+$labels['deletefolder']  = 'Verwijder map';
+$labels['managefolders']  = 'Beheer mappen';
+
+$labels['sortby'] = 'Sorteer op';
+$labels['sortasc']  = 'Sorteer oplopend';
+$labels['sortdesc'] = 'Sorteer aflopend';
+
+?>
diff --git a/program/localization/nl_NL/messages.inc b/program/localization/nl_NL/messages.inc
new file mode 100644 (file)
index 0000000..3420c6d
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/nl_NL/messages.inc                                           |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Mark Moses <mark@katmoda.com>                                 |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 558 2007-05-15 06:53:08Z robin $
+
+*/
+
+$messages = array();
+$messages['loginfailed']  = 'Inloggen mislukt';
+$messages['cookiesdisabled'] = 'De browser accepteert geen cookies';
+$messages['sessionerror'] = 'De sessie is verlopen of ongeldig';
+$messages['imaperror'] = 'Connectie met IMAP server mislukt';
+$messages['nomessagesfound'] = 'Geen berichten gevonden in deze e-mailbox';
+$messages['loggedout'] = 'Succesvol uitgelogd. Tot ziens!';
+$messages['mailboxempty'] = 'Mailbox is leeg';
+$messages['loading'] = 'Laden...';
+$messages['loadingdata'] = 'Bezig met laden van data...';
+$messages['checkingmail'] = 'Controleren op nieuwe berichten...';
+$messages['sendingmessage'] = 'Bezig met bericht versturen...';
+$messages['messagesent'] = 'Bericht succesvol verstuurd';
+$messages['savingmessage'] = 'Bezig met bericht opslaan...';
+$messages['messagesaved'] = 'Bericht bewaard als concept';
+$messages['successfullysaved'] = 'Succesvol opgeslagen';
+$messages['addedsuccessfully'] = 'Contact is succesvol toegevoegd aan het adresboek';
+$messages['contactexists'] = 'Er bestaat al een contactpersoon met dit e-mailadres';
+$messages['blockedimages'] = 'Uit privacyoverwegingen zijn niet bijgevoegde afbeeldingen geblokkeerd in dit bericht.';
+$messages['encryptedmessage'] = 'Dit is een gecodeerd bericht en kan niet weergegeven worden. Excuses!';
+$messages['nocontactsfound'] = 'Geen contactpersonen gevonden';
+$messages['contactnotfound'] = 'Contactpersoon niet gevonden';
+$messages['sendingfailed'] = 'Verzenden van bericht is mislukt';
+$messages['errorsaving'] = 'Er is een fout opgetreden tijdens het opslaan';
+$messages['errormoving'] = 'Kan het bericht niet verplaatsen';
+$messages['errordeleting'] = 'Kan het bericht niet verwijderen';
+$messages['deletecontactconfirm']  = 'Weet u zeker dat u de geselecteerde contactperso(o)n/en wilt verwijderen?';
+$messages['deletemessagesconfirm'] = 'Weet u zeker dat u de geselecteerde bericht(en) wilt verwijderen?';
+$messages['deletefolderconfirm']  = 'Weet u zeker dat u deze map wilt verwijderen?';
+$messages['purgefolderconfirm']  = 'Weet u zeker dat u alle berichten in deze map wilt verwijderen?';
+$messages['formincomplete'] = 'Het formulier was niet volledig ingevuld';
+$messages['noemailwarning'] = 'Geef een geldig e-mailadres op';
+$messages['nonamewarning']  = 'Vul een naam in';
+$messages['nopagesizewarning'] = 'Geef een paginagrootte op';
+$messages['norecipientwarning'] = 'Geef teminste een ontvanger op';
+$messages['nosubjectwarning']  = 'Het veld: \'onderwerp\' is leeg. Wilt u nu alsnog een onderwerp opgeven?';
+$messages['nobodywarning'] = 'Dit bericht zonder inhoud versturen?';
+$messages['notsentwarning'] = 'Bericht is niet verstuurd. Weet u zeker dat u het niet wilt bewaren?';
+$messages['noldapserver'] = 'Geef een LDAP adresboek server op om te doorzoeken';
+$messages['nocontactsreturned'] = 'Er zijn geen contactpersonen gevonden';
+$messages['nosearchname'] = 'Geef de naam of e-mail op van de contactpersoon';
+$messages['searchsuccessful'] = '$nr berichten gevonden';
+$messages['searchnomatch'] = 'Zoekopdracht heeft geen resultaten opgeleverd';
+$messages['searching'] = 'Bezig met zoeken...';
+$messages['checking'] = 'Controleren...';
+$messages['nospellerrors'] = 'Geen spelfouten gevonden';
+$messages['folderdeleted'] = 'Map successvol verwijderd';
+$messages['deletedsuccessfully'] = 'Successvol verwijderd';
+$messages['converting'] = 'Opmaak van bericht verwijderen...';
+$messages['messageopenerror'] = 'Kan het bericht niet van de server laden';
+$messages['fileuploaderror'] = 'Bestand versturen mislukt';
+$messages['filesizeerror'] = 'Het bestand overschrijdt de maximum grootte van $size';
+$messages['copysuccess'] = '$nr adressen succesvol gekopieerd';
+$messages['copyerror'] = 'Kan geen adressen kopieren';
+$messages['sourceisreadonly'] = 'Het adres kan niet worden opgeslagen';
+$messages['errorsavingcontact'] = 'Kan het ontvanger-adres niet opslaan';
+
+?>
index bac16680ec98b71681f089e5937fa0232e9f0486..c8fe960530aaf6da36b5cc65b0ed9684be7ee2a9 100644 (file)
@@ -5,70 +5,56 @@
  | language/pt_BR/labels.inc                                             |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundQube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Anderson S. Ferreira <anderson@cnpm.embrapa.br>               |
+ | Updated by: Robson F. Ramaldes <rframaldes@gmail.com>                 |
+ | Updated by: Alessandro Lenzi <alessandro@mistymountain.com.br>        |
  +-----------------------------------------------------------------------+
 
- $Id: labels.inc 296 2006-08-06 15:53:41Z thomasb $
+ $Id: labels.inc 559 2007-05-17 14:33:01Z thomasb $
 
 */
 
 $labels = array();
-
-// Página de login
-$labels['username']  = 'Usuário';
-$labels['password']  = 'Senha';
-$labels['server']    = 'Servidor';
-$labels['login']     = 'Entrar';
-
-// taskbar
-$labels['logout']   = 'Sair';
-$labels['mail']     = 'E-mail';
+$labels['welcome'] = 'Bem Vindo ao $product';
+$labels['username'] = 'Usuário';
+$labels['password'] = 'Senha';
+$labels['server'] = 'Servidor';
+$labels['login'] = 'Entrar';
+$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['sent']   = 'Enviados';
-$labels['trash']  = 'Lixeira';
+$labels['inbox'] = 'Caixa de entrada';
 $labels['drafts'] = 'Rascunhos';
-$labels['junk']   = 'Junk';
-
-// message listing
+$labels['sent'] = 'Enviados';
+$labels['trash'] = 'Lixeira';
+$labels['junk'] = 'Junk';
 $labels['subject'] = 'Assunto';
-$labels['from']    = 'Remetente';
-$labels['to']      = 'Para';
-$labels['cc']      = 'Cópia';
-$labels['bcc']     = 'Bcc';
+$labels['from'] = 'Remetente';
+$labels['to'] = 'Para';
+$labels['cc'] = 'Cópia';
+$labels['bcc'] = 'Bcc';
 $labels['replyto'] = 'Responder para';
-$labels['date']    = 'Data';
-$labels['size']    = 'Tamanho';
+$labels['date'] = 'Data';
+$labels['size'] = 'Tamanho';
 $labels['priority'] = 'Prioridade';
 $labels['organization'] = 'Organização';
-
-// aliases
-$labels['reply-to'] = $labels['replyto'];
-
+$labels['reply-to'] = 'Responder para';
 $labels['mailboxlist'] = 'Pastas';
 $labels['messagesfromto'] = 'Mensagens $from - $to de $count';
 $labels['messagenrof'] = 'Mensagem $nr de $count';
-
-$labels['moveto']   = 'mover para...';
+$labels['moveto'] = 'mover para...';
 $labels['download'] = 'download';
-
 $labels['filename'] = 'Arquivo';
 $labels['filesize'] = 'Tamanho';
-
-$labels['preferhtml'] = 'Prefere HTML';
+$labels['preferhtml'] = 'Preferir 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';
@@ -76,150 +62,120 @@ $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['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['thursday'] = 'Quinta-feira';
+$labels['friday'] = 'Sexta-feira';
+$labels['saturday'] = 'Sábado';
 $labels['today'] = 'Hoje';
-
-// toolbar buttons
-$labels['writenewmessage']  = 'Criar nova mensagem';
-$labels['replytomessage']   = 'Responder';
+$labels['checkmail'] = 'Verificar se há novas mensagens';
+$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['forwardmessage'] = 'Encaminhar';
+$labels['deletemessage'] = 'Mover para lixeira';
+$labels['printmessage'] = 'Imprimir';
+$labels['previousmessage'] = 'Mensagem Anterior';
+$labels['previousmessages'] = 'Página Anterior';
+$labels['firstmessage'] = 'Primeira Mensagem';
+$labels['firstmessages'] = 'Primeira Página';
+$labels['nextmessage'] = 'Próxima Mensagem';
+$labels['nextmessages'] = 'Próxima Página';
+$labels['lastmessage'] = 'Ultima Mensagem';
+$labels['lastmessages'] = 'Ultima Página';
+$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['sendmessage']  = 'Enviar';
-$labels['addattachment']  = 'Anexar';
-$labels['charset']  = 'Charset';
-
+$labels['unknown'] = 'desconhecido';
+$labels['unlimited'] = 'sem limitação';
+$labels['quicksearch'] = 'Pesquisa Rápida';
+$labels['resetsearch'] = 'Limpar';
+$labels['compose'] = 'Escrever mensagem';
+$labels['sendmessage'] = 'Enviar';
+$labels['savemessage'] = 'Salvar Rascunho';
+$labels['addattachment'] = 'Anexar';
+$labels['charset'] = 'Codificação';
+$labels['editortype'] = 'Tipo';
+$labels['returnreceipt'] = 'Receber Confirmação';
+$labels['checkspelling'] = 'Verificar Ortografia';
+$labels['resumeediting'] = 'Continuar';
+$labels['revertto'] = 'Reverter para';
 $labels['attachments'] = 'Anexos';
-$labels['upload'] = 'Upload';
-$labels['close']  = 'Fechar';
-
-$labels['low']     = 'Mais baixo';
-$labels['lowest']  = 'Baixo';
-$labels['normal']  = 'Normal';
-$labels['high']    = 'Alta';
+$labels['upload'] = 'Enviar';
+$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['nosubject'] = '(sem assunto)';
 $labels['showimages'] = 'Exibir imagens';
-
-
-// address boook
-$labels['name']      = 'Nome completo';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Texto Puro';
+$labels['name'] = 'Nome completo';
 $labels['firstname'] = 'Primeiro nome';
-$labels['surname']   = 'Sobrenome';
-$labels['email']     = 'E-Mail';
-
+$labels['surname'] = 'Sobrenome';
+$labels['email'] = 'E-Mail';
 $labels['addcontact'] = 'Incluir novo contato';
 $labels['editcontact'] = 'Editar contato';
-
-$labels['edit']   = 'Editar';
+$labels['edit'] = 'Editar';
 $labels['cancel'] = 'Cancelar';
-$labels['save']   = 'Salvar';
+$labels['save'] = 'Salvar';
 $labels['delete'] = 'Apagar';
-
-$labels['newcontact']     = 'Criar novo contato';
-$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['newcontact'] = 'Criar novo contato';
+$labels['deletecontact'] = 'Apagar contatos selecionados';
+$labels['composeto'] = 'Escrever mensagem para';
+$labels['contactsfromto'] = 'Contatos de $from à $to de $count';
+$labels['print'] = 'Imprimir';
+$labels['export'] = 'Exportar';
+$labels['previouspage'] = 'Página Anterior';
+$labels['firstpage'] = 'Primeira Página ';
+$labels['nextpage'] = 'Próxima Página';
+$labels['lastpage'] = 'Última Página';
+$labels['groups'] = 'Grupos';
+$labels['personaladrbook'] = 'Endereços Pessoais';
+$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 esta conta';
+$labels['newidentity'] = 'Nova identidade';
+$labels['newitem'] = 'Novo item';
+$labels['edititem'] = 'Editar item';
+$labels['setdefault'] = 'Padrão';
+$labels['language'] = 'Idioma';
+$labels['timezone'] = 'Fuso Horário';
+$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['dstactive'] = 'Horário de Verão';
+$labels['htmleditor'] = 'Criar mensagens em HTML';
+$labels['htmlsignature'] = 'Assinatura em HTML';
+$labels['previewpane'] = 'Exibir Pré-Vizualização';
+$labels['autosavedraft'] = 'Salvar Rascunho automaticamente';
+$labels['everynminutes'] = 'a cada $n minutos';
+$labels['never'] = 'nunca';
+$labels['folder'] = 'Pasta';
+$labels['folders'] = 'Pastas';
+$labels['foldername'] = 'Nome da pasta';
+$labels['subscribed'] = 'Assinado';
+$labels['create'] = 'Criar';
+$labels['createfolder'] = 'Criar nova pasta';
+$labels['rename'] = 'Renomear';
+$labels['renamefolder'] = 'Renomear Pasta';
+$labels['deletefolder'] = 'Apagar pasta';
+$labels['managefolders'] = 'Gerenciar pastas';
 $labels['sortby'] = 'Ordenado por';
-$labels['sortasc']  = 'Ascendente';
+$labels['sortasc'] = 'Ascendente';
 $labels['sortdesc'] = 'Descendente';
 
-// New labels since 0.1beta
-
-$labels['welcome'] = 'Bem-vindo ao $product';
-
-$labels['unknown'] = 'Desconhecido';
-$labels['unlimited'] = 'Ilimitado';
-$labels['dstactive'] = 'Horário de verão';
-
-$labels['previouspage'] = 'Exibir página anterior';
-$labels['nextpage']     = 'Exibir próxima página';
-
-$labels['returnreceipt'] = 'Confirmação de leitura';
-
-$labels['checkmail'] = 'Verificando novas mensagens';
-$labels['checkspelling'] = 'Verificando ortografia';
-$labels['resumeediting'] = 'Continuar a edição';
-$labels['revertto'] = 'Reverter para';
-
-$labels['savemessage']  = 'Salvar rascunho';
-$labels['rename'] = 'Renomear';
-$labels['renamefolder'] = 'Renomear pasta';
-
-// I use an additional description field - this might be used somewhere else
-$labels['description'] = 'Descrição';
-
-?>
+?>
\ No newline at end of file
index a1d29725c6ec60f706418925bcdd4e3691d3b3be..68b0d574001a076324857a28c0f021c323b367b8 100644 (file)
@@ -5,96 +5,74 @@
  | language/pt_BR/messages.inc                                           |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Anderson S. Ferreira <anderson@cnpm.embrapa.br>               |
+ | Updated by: Robson F. Ramaldes <rframaldes@gmail.com>                 |
+ | Updated by: Alessandro Lenzi <alessandro@mistymountain.com.br>        |
  +-----------------------------------------------------------------------+
 
- $Id: messages.inc 296 2006-08-06 15:53:41Z thomasb $
+ $Id: messages.inc 559 2007-05-17 14:33:01Z thomasb $
 
 */
 
 $messages = array();
-
-$messages['loginfailed']  = 'Falha no login';
-
+$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['loading'] = 'Carregando...';
 $messages['loadingdata'] = 'Carregando informações...';
-
+$messages['checkingmail'] = 'Verificando se há novas mensagens...';
+$messages['sendingmessage'] = 'Enviando...';
 $messages['messagesent'] = 'Mensagem enviada';
-
+$messages['savingmessage'] = 'Salvando Mensagem...';
+$messages['messagesaved'] = 'Rascunho Salvo';
 $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['contactnotfound'] = 'O contato solicitado não foi 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['deletecontactconfirm'] = 'Deseja realmente excluir os contatos selecionados?';
+$messages['deletemessagesconfirm'] = 'Deseja realmente excluir a(s) mensagem(s) selecionadas?';
+$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['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['nosubjectwarning'] = 'O campo assunto não foi informado. Deseja incluí-lo agora?';
+$messages['nobodywarning'] = 'Enviar a mensagem sem 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';
-
-// New messages since 0.1beta
+$messages['searchsuccessful'] = '$nr mensagens encontradas';
+$messages['searchnomatch'] = 'A pesquisa não encontrou resultados';
+$messages['searching'] = 'Pesquisando...';
 $messages['checking'] = 'Verificando...';
-
-$messages['nospellerrors'] = 'Nenhum erro ortográfico foi encontrado';
-
-$messages['checkingmail'] = 'Verificando novas mensagens...';
-
-$messages['savingmessage'] = 'Salvando a mensagem...';
-
-$messages['messagesaved'] = 'Mensagem salva como rascunho';
-
-$messages['folderdeleted'] = 'Pasta excluida com sucesso';
-
-?>
+$messages['nospellerrors'] = 'Nenhum erro ortográfico encontrado';
+$messages['folderdeleted'] = 'Pasta excluída com sucesso';
+$messages['deletedsuccessfully'] = 'Excluído com sucesso';
+$messages['converting'] = 'Removendo formatação da Mensagem...';
+$messages['messageopenerror'] = 'Não foi possível carregar a mensagem do servidor';
+$messages['fileuploaderror'] = 'Falha ao enviar o arquivo';
+$messages['filesizeerror'] = 'O Arquivo enviado excede o tamanho máximo de $size';
+$messages['copysuccess'] = '$nr endereços copiados com sucesso';
+$messages['copyerror'] = 'Não foi possível copiar quaisquer endereços';
+$messages['sourceisreadonly'] = 'Esta fonte de endereços é somente leitura';
+$messages['errorsavingcontact'] = 'Não foi possível salvar o endereço de contato';
+
+?>
\ No newline at end of file
index 5d1784a0313dc1965b6a735fb18e88e98eca5443..f0978e4f6a76103e802ea5a1afdc0771c54d54f5 100644 (file)
@@ -1,74 +1,61 @@
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/pt_PT/labels.inc                                             |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
+ |                                                                       |
  +-----------------------------------------------------------------------+
- | Author: Pedro M. Gouveia <pbodymind@gmail.com>                           |
+ | Authors: Sergio Rocha <sergio.rocha@makeitsimple.pt>                  |
+ |          João Vale <jpvale@gmail.com>                                 |
+ |          Fernando Silva <fernando.silva@openquest.pt>                 |
  +-----------------------------------------------------------------------+
$Id: labels.inc 267 2006-06-27 21:56:44Z richs $
+
@version $Id: labels.inc 562 2007-05-17 15:22:33Z thomasb $
 
 */
 
 $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['welcome'] = 'Bem-vindo ao $product';
+$labels['username'] = 'Utilizador';
+$labels['password'] = 'Senha';
+$labels['server'] = 'Servidor';
+$labels['login'] = 'Entrar';
+$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['addressbook'] = 'Lista de Contactos';
+$labels['inbox'] = 'Caixa de entrada';
 $labels['drafts'] = 'Rascunhos';
-$labels['junk']   = 'Spam';
-
-// message listing
+$labels['sent'] = 'Enviados';
+$labels['trash'] = 'Lixeira';
+$labels['junk'] = 'Junk';
 $labels['subject'] = 'Assunto';
-$labels['from']    = 'Remetente';
-$labels['to']      = 'Para';
-$labels['cc']      = 'Cc';
-$labels['bcc']     = 'Bcc';
+$labels['from'] = 'Remetente';
+$labels['to'] = 'Para';
+$labels['cc'] = 'Cópia';
+$labels['bcc'] = 'Bcc';
 $labels['replyto'] = 'Responder para';
-$labels['date']    = 'Data';
-$labels['size']    = 'Tamanho';
+$labels['date'] = 'Data';
+$labels['size'] = 'Tamanho';
 $labels['priority'] = 'Prioridade';
 $labels['organization'] = 'Organização';
-
-// aliases
-$labels['reply-to'] = $labels['replyto'];
-
+$labels['reply-to'] = 'Responder para';
 $labels['mailboxlist'] = 'Pastas';
-$labels['messagesfromto'] = 'Mensagens de $from para $to $count';
+$labels['messagesfromto'] = 'Mensagens $from - $to de $count';
 $labels['messagenrof'] = 'Mensagem $nr de $count';
-
-$labels['moveto']   = 'mover para...';
-$labels['download'] = 'download';
-
-$labels['filename'] = 'Arquivo';
+$labels['moveto'] = 'mover para...';
+$labels['download'] = 'descarregar';
+$labels['filename'] = 'Ficheiro';
 $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['addtoaddressbook'] = 'Adicionar à lista de contactos';
 $labels['sun'] = 'Dom';
 $labels['mon'] = 'Seg';
 $labels['tue'] = 'Ter';
@@ -76,128 +63,120 @@ $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['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['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['checkmail'] = 'Verificar novas mensagens';
+$labels['writenewmessage'] = 'Criar nova mensagem';
+$labels['replytomessage'] = 'Responder';
+$labels['replytoallmessage'] = 'Responder a todos';
+$labels['forwardmessage'] = 'Encaminhar';
+$labels['deletemessage'] = 'Mover para lixeira';
+$labels['printmessage'] = 'Imprimir';
+$labels['previousmessage'] = 'Mensagem anterior';
+$labels['previousmessages'] = 'Página anterior';
+$labels['firstmessage'] = 'Primeira mensagem';
+$labels['firstmessages'] = 'Primeira página';
+$labels['nextmessage'] = 'Próxima mensagem';
+$labels['nextmessages'] = 'Próxima página';
+$labels['lastmessage'] = 'Última mensagem';
+$labels['lastmessages'] = 'Última página';
+$labels['backtolist'] = 'Voltar';
+$labels['viewsource'] = 'Mostrar código fonte';
+$labels['select'] = 'Seleccionar';
 $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['quota'] = 'Utilização';
+$labels['unknown'] = 'desconhecido';
+$labels['unlimited'] = 'ilimitado';
+$labels['quicksearch'] = 'Pesquisa rápida';
+$labels['resetsearch'] = 'Limpar pesquisa';
+$labels['compose'] = 'Escrever mensagem';
+$labels['sendmessage'] = 'Enviar';
+$labels['savemessage'] = 'Salvar rascunho';
+$labels['addattachment'] = 'Anexar';
+$labels['charset'] = 'Charset';
+$labels['editortype'] = 'Tipo de editor';
+$labels['returnreceipt'] = 'Confirmação de leitura';
+$labels['checkspelling'] = 'Verificar ortografia';
+$labels['resumeediting'] = 'Continuar a edição';
+$labels['revertto'] = 'Reverter para';
 $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['upload'] = 'Puxar';
+$labels['close'] = 'Fechar';
+$labels['low'] = 'Baixa';
+$labels['lowest'] = 'Mais baixa';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Alta';
+$labels['highest'] = 'Mais alta';
+$labels['nosubject'] = '(sem assunto)';
 $labels['showimages'] = 'Exibir imagens';
-
-
-// address boook
-$labels['name']      = 'Nome completo';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Texto simples';
+$labels['name'] = 'Nome completo';
 $labels['firstname'] = 'Primeiro nome';
-$labels['surname']   = 'Apelido';
-$labels['email']     = 'E-Mail';
-
-$labels['addcontact'] = 'Incluir novo contacto';
+$labels['surname'] = 'Apelido';
+$labels['email'] = 'E-Mail';
+$labels['addcontact'] = 'Criar novo contacto';
 $labels['editcontact'] = 'Editar contacto';
-
-$labels['edit']   = 'Editar';
+$labels['edit'] = 'Editar';
 $labels['cancel'] = 'Cancelar';
-$labels['save']   = 'Salvar';
+$labels['save'] = 'Gravar';
 $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['newcontact'] = 'Criar novo contacto';
+$labels['deletecontact'] = 'Apagar contactos selecionados';
+$labels['composeto'] = 'Escrever mensagem para';
+$labels['contactsfromto'] = 'Contactos $from - $to of $count';
+$labels['print'] = 'Imprimir';
+$labels['export'] = 'Exportar';
+$labels['previouspage'] = 'Exibir página anterior';
+$labels['firstpage'] = 'Exibir primeira página';
+$labels['nextpage'] = 'Exibir próxima página';
+$labels['lastpage'] = 'Exibir última página';
+$labels['groups'] = 'Grupos';
+$labels['personaladrbook'] = 'Endereços pessoais';
+$labels['settingsfor'] = 'Configurações para';
+$labels['preferences'] = 'Preferências';
+$labels['userpreferences'] = 'Preferências do utilizador';
+$labels['editpreferences'] = 'Editar preferências do utilizador';
+$labels['identities'] = 'Identidades';
+$labels['manageidentities'] = 'Gerir identidades para esta conta';
+$labels['newidentity'] = 'Nova identidade';
+$labels['newitem'] = 'Novo item';
+$labels['edititem'] = 'Editar item';
+$labels['setdefault'] = 'Marcar por omissão';
+$labels['language'] = 'Idioma';
+$labels['timezone'] = 'Fuso horário';
+$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['dstactive'] = 'Horário de verão';
+$labels['htmleditor'] = 'Escrever mensagens em HTML';
+$labels['htmlsignature'] = 'Assinatura em HTML';
+$labels['previewpane'] = 'Mostrar pré-visualização';
+$labels['autosavedraft'] = 'Salvar rascunho automaticamente';
+$labels['everynminutes'] = 'a cada $n minutos';
+$labels['never'] = 'nunca';
+$labels['folder'] = 'Pasta';
+$labels['folders'] = 'Pastas';
+$labels['foldername'] = 'Nome da pasta';
+$labels['subscribed'] = 'Subscrito';
+$labels['create'] = 'Criar';
+$labels['createfolder'] = 'Criar nova pasta';
+$labels['rename'] = 'Renomear';
+$labels['renamefolder'] = 'Renomear pasta';
+$labels['deletefolder'] = 'Apagar pasta';
+$labels['managefolders'] = 'Gerir pastas';
 $labels['sortby'] = 'Ordenado por';
-$labels['sortasc']  = 'Ascendente';
+$labels['sortasc'] = 'Ascendente';
 $labels['sortdesc'] = 'Descendente';
 
 ?>
index 407b1c657ab91e9f69a1379322381513892584e5..de14f366584c0178f7d21f9f35ca1e94fafcc3e3 100644 (file)
@@ -1,96 +1,78 @@
 <?php
 
 /*
+
  +-----------------------------------------------------------------------+
  | language/pt_PT/messages.inc                                           |
  |                                                                       |
  | Language file of the RoundCube Webmail client                         |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
+ |                                                                       |
  +-----------------------------------------------------------------------+
- | Author: Pedro M. Gouveia <pbodymind@gmail.com>                           |
+ | Authors: Sergio Rocha <sergio.rocha@makeitsimple.pt>                  |
+ |          João Vale <jpvale@gmail.com>                                 |
  +-----------------------------------------------------------------------+
 
$Id: messages.inc 267 2006-06-27 21:56:44Z richs $
@version $Id: messages.inc 562 2007-05-17 15:22:33Z thomasb $
+
 */
 
 $messages = array();
-
-$messages['loginfailed']  = 'Falha no login';
-
+$messages['loginfailed'] = 'Erro ao entrar';
 $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['sessionerror'] = 'A sessão do seu navegador é inválida ou expirou';
+$messages['imaperror'] = 'A ligação ao servidor IMAP falhou';
+$messages['nomessagesfound'] = 'Nenhuma mensagem encontrada na caixa de entrada';
+$messages['loggedout'] = 'A sua sessão foi finalizada com sucesso. Até breve!';
+$messages['mailboxempty'] = 'A caixa de entrada está vazia';
+$messages['loading'] = 'A carregar...';
+$messages['loadingdata'] = 'A carregar informações...';
+$messages['checkingmail'] = 'Verificando novas mensagens...';
+$messages['sendingmessage'] = 'Enviando mensagem...';
+$messages['messagesent'] = 'Mensagem enviada com sucesso';
+$messages['savingmessage'] = 'A gravar a mensagem...';
+$messages['messagesaved'] = 'Mensagem gravada como rascunho';
+$messages['successfullysaved'] = 'Gravado com sucesso';
+$messages['addedsuccessfully'] = 'Contacto adicionado com sucesso';
+$messages['contactexists'] = 'Já existe um contacto com esse e-mail';
 $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['encryptedmessage'] = 'Esta mensagem está encriptada e não pode ser exibida. Desculpe.';
 $messages['nocontactsfound'] = 'Nenhum contacto encontrado';
-
+$messages['contactnotfound'] = 'O contacto especificado não foi encontrado';
 $messages['sendingfailed'] = 'Falha no envio da mensagem';
-
-$messages['errorsaving'] = 'Ocorreu um erro a gravar o ficheiro';
-
+$messages['errorsaving'] = 'Ocorreu um erro a gravar';
 $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['deletecontactconfirm'] = 'Deseja realmente apagar o(s) contacto(s) selecionado(s)?';
+$messages['deletemessagesconfirm'] = 'Deseja realmente apagar a(s) mensagem(ns) selecionada(s)?';
+$messages['deletefolderconfirm'] = 'Deseja realmente apagar esta pasta?';
+$messages['purgefolderconfirm'] = 'Deseja realmente apagar todas mensagens desta pasta?';
+$messages['formincomplete'] = 'Os campos não foram completamente preenchidos';
+$messages['noemailwarning'] = 'Por favor escreva um endereço de e-mail válido';
+$messages['nonamewarning'] = 'Por favor escreva o nome';
+$messages['nopagesizewarning'] = 'Por favor escreva o tamanho da página';
+$messages['norecipientwarning'] = 'Por favor escreva pelo menos um destinatário';
+$messages['nosubjectwarning'] = 'O campo "Assunto" não foi preenchido. Deseja incluí-lo agora?';
 $messages['nobodywarning'] = 'Enviar a mensagem sem texto?';
-
-$messages['notsentwarning'] = 'A mensagem não foi enviada, deseja excluí-la?';
-
-$messages['noldapserver'] = 'Por favor, selecione um servidor LDAP para a pesquisa';
-
+$messages['notsentwarning'] = 'A mensagem não foi enviada, deseja apagá-la?';
+$messages['noldapserver'] = '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';
+$messages['nosearchname'] = 'Por favor, escreva o nome do contacto ou seu endereço de e-mail';
+$messages['searchsuccessful'] = '$nr mensagens encontradas';
+$messages['searchnomatch'] = 'Pesquisa não devolveu resultados';
+$messages['searching'] = 'Pesquisando...';
+$messages['checking'] = 'A verificar...';
+$messages['nospellerrors'] = 'Nenhum erro ortográfico foi encontrado';
+$messages['folderdeleted'] = 'Pasta apagada com sucesso';
+$messages['deletedsuccessfully'] = 'Apagado com sucesso';
+$messages['converting'] = 'Removendo formatação da mensagem...';
+$messages['messageopenerror'] = 'Não foi possível carregar mensagem';
+$messages['fileuploaderror'] = 'Falha ao puxar o ficheiro';
+$messages['filesizeerror'] = 'O ficheiro excede o tamanho máximo de $size';
+$messages['copysuccess'] = 'Foram copiados $nr endereços com sucesso';
+$messages['copyerror'] = 'Não foi possível copiar os endereços';
+$messages['sourceisreadonly'] = 'Esta fonte de endereços é só de leitura';
+$messages['errorsavingcontact'] = 'Não foi possível guardar o endereço de contacto';
 
 ?>
diff --git a/program/localization/ro/labels.inc b/program/localization/ro/labels.inc
new file mode 100644 (file)
index 0000000..0712c42
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/ro/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Daniel Anechitoaie - danieLs  <daniels@safereaction.ro>       |
+ |         Ispas Dorin <dorinxp2004@yahoo.com>                           |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 550 2007-05-01 19:07:56Z thomasb $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Bine ati venit la $product';
+$labels['username'] = 'Utilizator';
+$labels['password'] = 'Parola';
+$labels['server'] = 'Server';
+$labels['login'] = 'Autentificare';
+$labels['logout'] = 'Deconectare';
+$labels['mail'] = 'E-Mail';
+$labels['settings'] = 'Setari Personale';
+$labels['addressbook'] = 'Agenda';
+$labels['inbox'] = 'Primite';
+$labels['drafts'] = 'Ciorne';
+$labels['sent'] = 'Trimise';
+$labels['trash'] = 'Gunoi';
+$labels['junk'] = 'Junk';
+$labels['subject'] = 'Subiect';
+$labels['from'] = 'Expeditor';
+$labels['to'] = 'Destinatar';
+$labels['cc'] = 'Copie';
+$labels['bcc'] = 'Bcc';
+$labels['replyto'] = 'Raspunde-La';
+$labels['date'] = 'Data';
+$labels['size'] = 'Marime';
+$labels['priority'] = 'Prioritate';
+$labels['organization'] = 'Organizatie';
+$labels['reply-to'] = 'Raspunde-La';
+$labels['mailboxlist'] = 'Dosare';
+$labels['messagesfromto'] = 'Mesaje de la $from pana la $to din $count';
+$labels['messagenrof'] = '$nr mesaje din $count';
+$labels['moveto'] = 'muta in...';
+$labels['download'] = 'descarca';
+$labels['filename'] = 'Nume fisier';
+$labels['filesize'] = 'Marime fisier';
+$labels['preferhtml'] = 'Prefer HTML';
+$labels['htmlmessage'] = 'Mesaj HTML';
+$labels['prettydate'] = 'Data formatata';
+$labels['addtoaddressbook'] = 'Adauga in agenda';
+$labels['sun'] = 'Dum';
+$labels['mon'] = 'Lun';
+$labels['tue'] = 'Mar';
+$labels['wed'] = 'Mie';
+$labels['thu'] = 'Joi';
+$labels['fri'] = 'Vin';
+$labels['sat'] = 'Sam';
+$labels['sunday'] = 'Duminica';
+$labels['monday'] = 'Luni';
+$labels['tuesday'] = 'Marti';
+$labels['wednesday'] = 'Miercuri';
+$labels['thursday'] = 'Joi';
+$labels['friday'] = 'Vineri';
+$labels['saturday'] = 'Sambata';
+$labels['today'] = 'Astazi';
+$labels['checkmail'] = 'Verifica pentru mesaje noi';
+$labels['writenewmessage'] = 'Creaza mesaj nou';
+$labels['replytomessage'] = 'Raspunde la mesaj';
+$labels['replytoallmessage'] = 'Raspunde la toti';
+$labels['forwardmessage'] = 'Trimite mesajul mai departe';
+$labels['deletemessage'] = 'Trimmite mesajul la gunoi';
+$labels['printmessage'] = 'Listeaza mesajul';
+$labels['previousmessage'] = 'Afiseaza mesajul anterior';
+$labels['previousmessages'] = 'Afiseaza setul anterior de mesaje';
+$labels['firstmessage'] = 'Afiseaza primul mesaj';
+$labels['firstmessages'] = 'Afiseaza primul set de mesaje';
+$labels['nextmessage'] = 'Afiseaza urmatorul mesaj';
+$labels['nextmessages'] = 'Afiseaza setul urmator de mesaje';
+$labels['lastmessage'] = 'Afiseaza ultimul mesaj';
+$labels['lastmessages'] = 'Afiseaza ultimul set de mesaje';
+$labels['backtolist'] = 'Inapoi la lista cu mesaje';
+$labels['viewsource'] = 'Afiseaza sursa';
+$labels['select'] = 'Selecteaza';
+$labels['all'] = 'Toate';
+$labels['none'] = 'Nici unul';
+$labels['unread'] = 'Necitite';
+$labels['compact'] = 'Compreseaza';
+$labels['empty'] = 'Goleste';
+$labels['purge'] = 'Curata';
+$labels['quota'] = 'Spatiu folosit';
+$labels['unknown'] = 'necunoscut';
+$labels['unlimited'] = 'nelimitat';
+$labels['quicksearch'] = 'Cautare rapida';
+$labels['resetsearch'] = 'Resetare cautare';
+$labels['compose'] = 'Compune mesaj';
+$labels['sendmessage'] = 'Trimite mesaj';
+$labels['savemessage'] = 'Salveaza aceasta ciorna';
+$labels['addattachment'] = 'Ataseaza fisier';
+$labels['charset'] = 'Set de caractere';
+$labels['editortype'] = 'Tip de editor';
+$labels['returnreceipt'] = 'Returneaza confirmare';
+$labels['checkspelling'] = 'Verifica ortografie';
+$labels['resumeediting'] = 'Reia editarea';
+$labels['revertto'] = 'Revina la';
+$labels['attachments'] = 'Atasamente';
+$labels['upload'] = 'Incarca';
+$labels['close'] = 'Inchide';
+$labels['low'] = 'Mica';
+$labels['lowest'] = 'Cea mai mica';
+$labels['normal'] = 'Normala';
+$labels['high'] = 'Mare';
+$labels['highest'] = 'Cea mai mare';
+$labels['nosubject'] = '(fara subiect)';
+$labels['showimages'] = 'Afiseaza imagini';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Text simplu';
+$labels['name'] = 'Nume de afisat';
+$labels['firstname'] = 'Nume';
+$labels['surname'] = 'Prenume';
+$labels['email'] = 'E-Mail';
+$labels['addcontact'] = 'Adauga contactul selectat in agenda';
+$labels['editcontact'] = 'Modifica contact';
+$labels['edit'] = 'Editeaza';
+$labels['cancel'] = 'Renunta';
+$labels['save'] = 'Salveaza';
+$labels['delete'] = 'Sterge';
+$labels['newcontact'] = 'Creaza contact nou';
+$labels['deletecontact'] = 'Sterge contactul selectat';
+$labels['composeto'] = 'Compune e-mail pentru';
+$labels['contactsfromto'] = 'Contacte de la $from pana la $to din $count';
+$labels['print'] = 'Listeaza';
+$labels['export'] = 'Exporta';
+$labels['previouspage'] = 'Pagina anterioara';
+$labels['firstpage'] = 'Arata primul set';
+$labels['nextpage'] = 'Pagina urmatoare';
+$labels['lastpage'] = 'Arata ultimul set';
+$labels['groups'] = 'Grupuri';
+$labels['personaladrbook'] = 'Adrese personale';
+$labels['settingsfor'] = 'Setari pentru';
+$labels['preferences'] = 'Preferinte';
+$labels['userpreferences'] = 'Preferinte utilizator';
+$labels['editpreferences'] = 'Modifica preferinte utilizator';
+$labels['identities'] = 'Identitati';
+$labels['manageidentities'] = 'Administreaza identitati pentru acest cont';
+$labels['newidentity'] = 'Identitate noua';
+$labels['newitem'] = 'Item nou';
+$labels['edititem'] = 'Editeaza item';
+$labels['setdefault'] = 'Seteaza implicit';
+$labels['language'] = 'Limba';
+$labels['timezone'] = 'Fus orar';
+$labels['pagesize'] = 'Randuri pe pagina';
+$labels['signature'] = 'Semnatura';
+$labels['dstactive'] = 'Daylight savings';
+$labels['htmleditor'] = 'Scrie mesaje HTML';
+$labels['htmlsignature'] = 'Semnatura HTML';
+$labels['previewpane'] = 'Arata preview';
+$labels['autosavedraft'] = 'Salveaza ciorna automat';
+$labels['everynminutes'] = 'fiecare $n minute';
+$labels['never'] = 'niciodata';
+$labels['folder'] = 'Dosar';
+$labels['folders'] = 'Dosare';
+$labels['foldername'] = 'Nume dosar';
+$labels['subscribed'] = 'Inscris';
+$labels['create'] = 'Creaza';
+$labels['createfolder'] = 'Creaza dosar nou';
+$labels['rename'] = 'Redenumeste';
+$labels['renamefolder'] = 'Redenumeste dosar';
+$labels['deletefolder'] = 'Sterge dosar';
+$labels['managefolders'] = 'Administreaza dosare';
+$labels['sortby'] = 'Sorteaza dupa';
+$labels['sortasc'] = 'Sorteaza ascendent';
+$labels['sortdesc'] = 'Sorteaza descendent';
+
+?>
\ No newline at end of file
diff --git a/program/localization/ro/messages.inc b/program/localization/ro/messages.inc
new file mode 100644 (file)
index 0000000..9e8f6ec
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/ro/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Daniel Anechitoaie - danieLs <daniels@safereaction.ro>        |
+ |         Ispas Dorin <dorinxp2004@yahoo.com>                           |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 550 2007-05-01 19:07:56Z thomasb $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Autentificare esuata';
+$messages['cookiesdisabled'] = 'Browserul dumneavoastra nu accepta cookies';
+$messages['sessionerror'] = 'Sesiunea dumneavoastra este invalida sau a expirat';
+$messages['imaperror'] = 'Conectarea la serverul IMAP a esuat';
+$messages['nomessagesfound'] = 'Nu a fost gasit niciun mesaj in aceasta casuta postala';
+$messages['loggedout'] = 'Sesiune incheiata cu succes. La revedere!';
+$messages['mailboxempty'] = 'Casuta postala este goala';
+$messages['loading'] = 'Se incarca...';
+$messages['loadingdata'] = 'Se incarca informatiile...';
+$messages['checkingmail'] = 'Verifica pentru mesaje noi...';
+$messages['sendingmessage'] = 'Trimitere mesaj...';
+$messages['messagesent'] = 'Mesajul a fost trimis cu succes!';
+$messages['savingmessage'] = 'Salvare mesaj...';
+$messages['messagesaved'] = 'Mesajul a fost salvat in Ciorne';
+$messages['successfullysaved'] = 'Salvarea s-a efectuat cu succes';
+$messages['addedsuccessfully'] = 'Contactul a fost adaugat cu succes in agenda';
+$messages['contactexists'] = 'Mai exista un contact cu aceasta adresa de e-mail';
+$messages['blockedimages'] = 'Pentru a va proteja intimitatea imaginile externe au fost blocate.';
+$messages['encryptedmessage'] = 'Acesta este un mesaj criptat si nu poate fi afisat. Ne pare rau.';
+$messages['nocontactsfound'] = 'Nu s-a gasit niciun contact';
+$messages['contactnotfound'] = 'Contactul solicitat nu a fost gasit.';
+$messages['sendingfailed'] = 'Nu s-a reusit trimiterea mesajului';
+$messages['errorsaving'] = 'A intervenit o eroare in timp ce se efectua salvarea';
+$messages['errormoving'] = 'Nu s-a putut muta mesajul';
+$messages['errordeleting'] = 'Nu s-a putut sterge mesajul';
+$messages['deletecontactconfirm'] = 'Sunteti sigur ca doriti sa stergeti contactul(ele) selectate?';
+$messages['deletemessagesconfirm'] = 'Chiar doriti sa stergeti mesajele selectate ?';
+$messages['deletefolderconfirm'] = 'Sunteti sigur ca doriti sa stergeti acest dosar?';
+$messages['purgefolderconfirm'] = 'Sunteti sigur ca doriti sa stergeti toate mesajele din acest dosar?';
+$messages['formincomplete'] = 'Formularul nu a fost completat corect';
+$messages['noemailwarning'] = 'Va rugam introduceti o adresa de e-mail valida';
+$messages['nonamewarning'] = 'Va rugam introduceti un nume';
+$messages['nopagesizewarning'] = 'Va rugam introduceti marimea paginii';
+$messages['norecipientwarning'] = 'Va rugam introduceti cel putin un destinatar';
+$messages['nosubjectwarning'] = 'Mesajul nu are subiect. Vreti sa introduceti unul acum?';
+$messages['nobodywarning'] = 'Trimiteti acest mesaj fara text?';
+$messages['notsentwarning'] = 'Mesajul nu a fost trimis. Vreti sa renuntatati la el?';
+$messages['noldapserver'] = 'Va rugam alegeti un server ldap pentru cautare';
+$messages['nocontactsreturned'] = 'Nu s-a gasit niciun contact';
+$messages['nosearchname'] = 'Va rugam introduceti un nume de contact sau adresa de e-mail';
+$messages['searchsuccessful'] = '$nr mesaje gasite';
+$messages['searchnomatch'] = 'Cautarea nu a returnat niciun rezultat';
+$messages['searching'] = 'Se cauta...';
+$messages['checking'] = 'Se verifica...';
+$messages['nospellerrors'] = 'Nu s-a gasit nicio greseala de ortografie';
+$messages['folderdeleted'] = 'Dosarul a fost sters cu succes';
+$messages['deletedsuccessfully'] = 'Mesaj sters cu succes !';
+$messages['converting'] = 'Resetez mesajul la parametrii initiali';
+$messages['messageopenerror'] = 'Nu am putut incarca mesajul din server';
+$messages['fileuploaderror'] = 'Incarcarea pe server a esuat';
+$messages['filesizeerror'] = 'Fisierul incarcat depaseste marimea de $size';
+$messages['copysuccess'] = 'Am copiat cu succes $nr de adrese';
+$messages['copyerror'] = 'Nu am putut copia nici o adresa';
+$messages['sourceisreadonly'] = 'Sursa adrese este "read-only"(se poate doar citi)';
+$messages['errorsavingcontact'] = 'Nu am putut salva adresa de contact';
+
+?>
\ No newline at end of file
diff --git a/program/localization/ru/labels.inc b/program/localization/ru/labels.inc
new file mode 100755 (executable)
index 0000000..3c36be9
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/ru_RU/labels.inc                                             |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Maxim Zenin <maxx@webmechanics.ru>                            |
+ |         Vladimir Kulev <me@lightoze.net>                              |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 560 2007-05-17 15:01:26Z thomasb $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Добро пожаловать в $product!';
+$labels['username'] = 'Имя пользователя';
+$labels['password'] = 'Пароль';
+$labels['server'] = 'Сервер';
+$labels['login'] = 'Войти';
+$labels['logout'] = 'Выход';
+$labels['mail'] = 'Почта';
+$labels['settings'] = 'Настройки';
+$labels['addressbook'] = 'Контакты';
+$labels['inbox'] = 'Входящие';
+$labels['drafts'] = 'Черновики';
+$labels['sent'] = 'Отправленные';
+$labels['trash'] = 'Корзина';
+$labels['junk'] = 'СПАМ';
+$labels['subject'] = 'Тема';
+$labels['from'] = 'От';
+$labels['to'] = 'Кому';
+$labels['cc'] = 'Копия';
+$labels['bcc'] = 'Скрытая';
+$labels['replyto'] = 'Обратный адрес';
+$labels['date'] = 'Дата';
+$labels['size'] = 'Размер';
+$labels['priority'] = 'Приоритет';
+$labels['organization'] = 'Организация';
+$labels['reply-to'] = 'Обратный адрес';
+$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'] = 'Добавить в контакты';
+$labels['sun'] = 'Вс';
+$labels['mon'] = 'Пн';
+$labels['tue'] = 'Вт';
+$labels['wed'] = 'Ср';
+$labels['thu'] = 'Чт';
+$labels['fri'] = 'Пт';
+$labels['sat'] = 'Сб';
+$labels['sunday'] = 'Воскресенье';
+$labels['monday'] = 'Понедельник';
+$labels['tuesday'] = 'Вторник';
+$labels['wednesday'] = 'Среда';
+$labels['thursday'] = 'Четверг';
+$labels['friday'] = 'Пятница';
+$labels['saturday'] = 'Суббота';
+$labels['today'] = 'Сегодня';
+$labels['checkmail'] = 'Доставить почту';
+$labels['writenewmessage'] = 'Новое сообщение';
+$labels['replytomessage'] = 'Ответить';
+$labels['replytoallmessage'] = 'Ответить всем';
+$labels['forwardmessage'] = 'Переслать';
+$labels['deletemessage'] = 'В корзину';
+$labels['printmessage'] = 'Печать';
+$labels['previousmessage'] = 'Показать предыдущее сообщение';
+$labels['previousmessages'] = 'Предыдущее';
+$labels['firstmessage'] = 'Показать первое сообщение';
+$labels['firstmessages'] = 'Первое сообщение';
+$labels['nextmessage'] = 'Показать следующее сообщение';
+$labels['nextmessages'] = 'Следующее';
+$labels['lastmessage'] = 'Показать последнее сообщение';
+$labels['lastmessages'] = 'Последнее сообщение';
+$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'] = 'Сброс';
+$labels['compose'] = 'Написать сообщение';
+$labels['sendmessage'] = 'Отправить сейчас';
+$labels['savemessage'] = 'Сохранить черновик';
+$labels['addattachment'] = 'Добавить вложение';
+$labels['charset'] = 'Кодировка';
+$labels['editortype'] = 'Редактор';
+$labels['returnreceipt'] = 'Запрос ответа';
+$labels['checkspelling'] = 'Проверить орфографию';
+$labels['resumeediting'] = 'Продолжить редактирование';
+$labels['revertto'] = 'Отменить правки';
+$labels['attachments'] = 'Вложения';
+$labels['upload'] = 'Загрузить';
+$labels['close'] = 'Закрыть';
+$labels['low'] = 'Низкий';
+$labels['lowest'] = 'Нижайш.';
+$labels['normal'] = 'Норм.';
+$labels['high'] = 'Высокий';
+$labels['highest'] = 'Высоч.';
+$labels['nosubject'] = '(без темы)';
+$labels['showimages'] = 'Показать изображения';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Обычный текст';
+$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'] = 'Экспорт';
+$labels['previouspage'] = 'Показать предыдущий';
+$labels['firstpage'] = 'Показать первый';
+$labels['nextpage'] = 'Показать следующий';
+$labels['lastpage'] = 'Показать последний';
+$labels['groups'] = 'Группы';
+$labels['personaladrbook'] = 'Персональные адреса';
+$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['htmleditor'] = 'Создавать сообщения в HTML';
+$labels['htmlsignature'] = 'Подпись в HTML';
+$labels['previewpane'] = 'Показать панель превью';
+$labels['autosavedraft'] = 'Автосохранение черновика';
+$labels['everynminutes'] = 'каждые $n минут';
+$labels['never'] = 'никогда';
+$labels['folder'] = 'Папка';
+$labels['folders'] = 'Папки';
+$labels['foldername'] = 'Имя папки';
+$labels['subscribed'] = 'Подписан';
+$labels['create'] = 'Создать';
+$labels['createfolder'] = 'Создать новую папку';
+$labels['rename'] = 'Переименовать';
+$labels['renamefolder'] = 'Переименовать папку';
+$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
new file mode 100755 (executable)
index 0000000..4e7e73c
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/ru_RU/messages.inc                                           |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Maxim Zenin <maxx@webmechanics.ru>                            |
+ |         Vladimir Kulev <me@lightoze.net>                              |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 560 2007-05-17 15:01:26Z thomasb $
+
+*/
+
+$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['contactnotfound'] = 'Требуемый контакт не найден';
+$messages['sendingfailed'] = 'Не удалось отправить сообщение';
+$messages['errorsaving'] = 'В процессе сохранения произошла ошибка';
+$messages['errormoving'] = 'Не удалось переместить сообщение';
+$messages['errordeleting'] = 'Не удалось удалить сообщение';
+$messages['deletecontactconfirm'] = 'Вы действительно хотите удалить выделенные контакты?';
+$messages['deletemessagesconfirm'] = 'Вы действительно хотите удалить выбранные сообщения?';
+$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'] = 'Поиск...';
+$messages['checking'] = 'Проверка...';
+$messages['nospellerrors'] = 'Орфографических ошибок не найдено';
+$messages['folderdeleted'] = 'Папка удалена';
+$messages['deletedsuccessfully'] = 'Удалено';
+$messages['converting'] = 'Удаление форматирования сообщения...';
+$messages['messageopenerror'] = 'Невозможно загрузить сообщение с сервера';
+$messages['fileuploaderror'] = 'Невозможно загрузить файл';
+$messages['filesizeerror'] = 'Загруженный файл больше максимального размера в $size';
+$messages['copysuccess'] = 'Скопировано $nr адресов';
+$messages['copyerror'] = 'Невозможно скопировать адреса';
+$messages['sourceisreadonly'] = 'Данный источник адресов только для чтения';
+$messages['errorsavingcontact'] = 'Невозможно сохранить адрес контакта';
+
+?>
\ No newline at end of file
diff --git a/program/localization/se/labels.inc b/program/localization/se/labels.inc
new file mode 100644 (file)
index 0000000..4014c02
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/se/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Fredrik Nygren <f.nygren@gmail.com>                           |
+ |         Andreas Henriksson <andreas@fatal.se>                         |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Välkommen till $product';
+$labels['username'] = 'Användarnamn';
+$labels['password'] = 'Lösenord';
+$labels['server'] = 'Server';
+$labels['login'] = 'Logga in';
+$labels['logout'] = 'Logga ut';
+$labels['mail'] = 'E-post';
+$labels['settings'] = 'Personliga inställningar';
+$labels['addressbook'] = 'Adressbok';
+$labels['inbox'] = 'Inkorg';
+$labels['drafts'] = 'Utkast';
+$labels['sent'] = 'Skickat';
+$labels['trash'] = 'Papperskorg';
+$labels['junk'] = 'Skräp';
+$labels['subject'] = 'Ämne';
+$labels['from'] = 'Avsändare';
+$labels['to'] = 'Mottagare';
+$labels['cc'] = 'Kopia';
+$labels['bcc'] = 'Hemlig kopia';
+$labels['replyto'] = 'Svara till';
+$labels['date'] = 'Datum';
+$labels['size'] = 'Storlek';
+$labels['priority'] = 'Prioritet';
+$labels['organization'] = 'Organisation';
+$labels['reply-to'] = 'Svara till';
+$labels['mailboxlist'] = 'Mappar';
+$labels['messagesfromto'] = 'Meddelanden $from till $to av $count';
+$labels['messagenrof'] = 'Meddelande $nr av $count';
+$labels['moveto'] = 'flytta till...';
+$labels['download'] = 'ladda ner';
+$labels['filename'] = 'Filnamn';
+$labels['filesize'] = 'Filstorlek';
+$labels['preferhtml'] = 'Visa HTML';
+$labels['htmlmessage'] = 'HTML-meddelande';
+$labels['prettydate'] = 'Fina datum';
+$labels['addtoaddressbook'] = 'Lägg till i adressbok';
+$labels['sun'] = 'Sön';
+$labels['mon'] = 'Mån';
+$labels['tue'] = 'Tis';
+$labels['wed'] = 'Ons';
+$labels['thu'] = 'Tor';
+$labels['fri'] = 'Fre';
+$labels['sat'] = 'Lör';
+$labels['sunday'] = 'Söndag';
+$labels['monday'] = 'Måndag';
+$labels['tuesday'] = 'Tisdag';
+$labels['wednesday'] = 'Onsdag';
+$labels['thursday'] = 'Torsdag';
+$labels['friday'] = 'Fredag';
+$labels['saturday'] = 'Lördag';
+$labels['today'] = 'Idag';
+$labels['checkmail'] = 'Hämta ny e-post';
+$labels['writenewmessage'] = 'Skapa nytt meddelande';
+$labels['replytomessage'] = 'Svar på meddelande';
+$labels['replytoallmessage'] = 'Svar till avsändare och alla mottagare';
+$labels['forwardmessage'] = 'Vidarebefordra meddelande';
+$labels['deletemessage'] = 'Flytta meddelande till papperskorgen';
+$labels['printmessage'] = 'Skriv ut';
+$labels['previousmessage'] = 'Visa föregående meddelande';
+$labels['previousmessages'] = 'Visa tidigare grupp av meddelanden';
+$labels['firstmessage'] = 'Visa första meddelandet';
+$labels['firstmessages'] = 'Visa första gruppen av meddelanden';
+$labels['nextmessage'] = 'Visa nästa meddelande';
+$labels['nextmessages'] = 'Visa nästa grupp av meddelanden';
+$labels['lastmessage'] = 'Visa sista meddelandet';
+$labels['lastmessages'] = 'Visa sista gruppen av meddelanden';
+$labels['backtolist'] = 'Tillbaka till meddelandelistan';
+$labels['viewsource'] = 'Visa källa';
+$labels['select'] = 'Välj';
+$labels['all'] = 'Alla';
+$labels['none'] = 'Ingen';
+$labels['unread'] = 'Oläst';
+$labels['compact'] = 'Packa';
+$labels['empty'] = 'Tom';
+$labels['purge'] = 'Rensa';
+$labels['quota'] = 'Diskutrymme';
+$labels['unknown'] = 'okänd';
+$labels['unlimited'] = 'obegränsad';
+$labels['quicksearch'] = 'Snabbsök';
+$labels['resetsearch'] = 'Återställ sökning';
+$labels['compose'] = 'Skapa nytt meddelande';
+$labels['sendmessage'] = 'Skicka meddelande nu';
+$labels['savemessage'] = 'Spara utkast';
+$labels['addattachment'] = 'Bifoga en fil';
+$labels['charset'] = 'Teckenkodning';
+$labels['editortype'] = 'Typ av redigerare';
+$labels['returnreceipt'] = 'Mottagarkvitto';
+$labels['checkspelling'] = 'Kontrollera stavning';
+$labels['resumeediting'] = 'Återuppta redigering';
+$labels['revertto'] = 'Återgå till';
+$labels['attachments'] = 'Bilagor';
+$labels['upload'] = 'Uppladdning';
+$labels['close'] = 'Stäng';
+$labels['low'] = 'Låg';
+$labels['lowest'] = 'Lägst';
+$labels['normal'] = 'Normal';
+$labels['high'] = 'Hög';
+$labels['highest'] = 'Högst';
+$labels['nosubject'] = '(inget ämne)';
+$labels['showimages'] = 'Visa bilder';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Oformaterad text';
+$labels['name'] = 'Visa namn';
+$labels['firstname'] = 'Förnamn';
+$labels['surname'] = 'Efternamn';
+$labels['email'] = 'E-post';
+$labels['addcontact'] = 'Lägg till ny kontakt';
+$labels['editcontact'] = 'Redigera kontakt';
+$labels['edit'] = 'Redigera';
+$labels['cancel'] = 'Avbryt';
+$labels['save'] = 'Spara';
+$labels['delete'] = 'Radera';
+$labels['newcontact'] = 'Skapa nytt kontaktkort';
+$labels['deletecontact'] = 'Radera valda kontakter';
+$labels['composeto'] = 'Skriv e-post till';
+$labels['contactsfromto'] = 'Kontakter $from till $to av $count';
+$labels['print'] = 'Skriv ut';
+$labels['export'] = 'Exportera';
+$labels['previouspage'] = 'Visa föregående grupp';
+$labels['firstpage'] = 'Visa första gruppen';
+$labels['nextpage'] = 'Visa nästa grupp';
+$labels['lastpage'] = 'Visa sista gruppen';
+$labels['groups'] = 'Grupper';
+$labels['personaladrbook'] = 'Personliga adresser';
+$labels['settingsfor'] = 'Inställningar för';
+$labels['preferences'] = 'Inställningar';
+$labels['userpreferences'] = 'Användarinställningar';
+$labels['editpreferences'] = 'Ändra användarinställningar';
+$labels['identities'] = 'Profiler';
+$labels['manageidentities'] = 'Hantera profiler för detta konto';
+$labels['newidentity'] = 'Ny profil';
+$labels['newitem'] = 'Ny post';
+$labels['edititem'] = 'Ändra post';
+$labels['setdefault'] = 'Sätt som standard';
+$labels['language'] = 'Språk';
+$labels['timezone'] = 'Tidszon';
+$labels['pagesize'] = 'Rader per sida';
+$labels['signature'] = 'Signatur';
+$labels['dstactive'] = 'Sommartid';
+$labels['htmleditor'] = 'Skriv HTML-meddelanden';
+$labels['htmlsignature'] = 'HTML-signatur';
+$labels['previewpane'] = 'Visa föregående panel';
+$labels['autosavedraft'] = 'Spara utkast automatiskt';
+$labels['everynminutes'] = 'var $n minut';
+$labels['never'] = 'aldrig';
+$labels['folder'] = 'Mapp';
+$labels['folders'] = 'Mappar';
+$labels['foldername'] = 'Mappnamn';
+$labels['subscribed'] = 'Ansluten';
+$labels['create'] = 'Skapa';
+$labels['createfolder'] = 'Skapa ny mapp';
+$labels['rename'] = 'Byt namn';
+$labels['renamefolder'] = 'Byt mappnamn';
+$labels['deletefolder'] = 'Radera mapp';
+$labels['managefolders'] = 'Hantera mappar';
+$labels['sortby'] = 'Sortera på';
+$labels['sortasc'] = 'Sortera stigande';
+$labels['sortdesc'] = 'Sortera fallande';
+
+?>
diff --git a/program/localization/se/messages.inc b/program/localization/se/messages.inc
new file mode 100644 (file)
index 0000000..945c7f8
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/se/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Fredrik Nygren <f.nygren@gmail.com>                           |
+ |         Andreas Henriksson <andreas@fatal.se>                         |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Inloggningen misslyckades';
+$messages['cookiesdisabled'] = 'Din webbläsare accepterar inte cookies';
+$messages['sessionerror'] = 'Din session är felaktig eller har gått ut';
+$messages['imaperror'] = 'Kontakt med IMAP-servern misslyckades';
+$messages['nomessagesfound'] = 'Inga meddelanden hittades i din inkorg';
+$messages['loggedout'] = 'Du har framgångsrikt avslutat din session. Hej då!';
+$messages['mailboxempty'] = 'Postlådan är tom';
+$messages['loading'] = 'Laddar...';
+$messages['loadingdata'] = 'Laddar data...';
+$messages['checkingmail'] = 'Letar efter ny e-post...';
+$messages['sendingmessage'] = 'Skickar meddelande...';
+$messages['messagesent'] = 'Meddelandet har skickats';
+$messages['savingmessage'] = 'Sparar meddelande...';
+$messages['messagesaved'] = 'Meddelande sparades till utkast';
+$messages['successfullysaved'] = 'Sparat';
+$messages['addedsuccessfully'] = 'Kontakten har lagts till i adressboken';
+$messages['contactexists'] = 'En kontakt med den här e-postadressen finns redan';
+$messages['blockedimages'] = 'För att skydda dig är bilder blockerade.';
+$messages['encryptedmessage'] = 'Det här ett krypterat meddelande som inte kan visas. Tyvärr!';
+$messages['nocontactsfound'] = 'Inga kontakter hittades';
+$messages['contactnotfound'] = 'Den efterfrågade kontanten hittades inte';
+$messages['sendingfailed'] = 'Misslyckades med att skicka meddelandet';
+$messages['errorsaving'] = 'Ett fel uppstod vid sparandet';
+$messages['errormoving'] = 'Meddelandet kunde inte flyttas';
+$messages['errordeleting'] = 'Meddelandet kunde inte raderas';
+$messages['deletecontactconfirm'] = 'Vill du verkligen radera valda kontakter?';
+$messages['deletemessagesconfirm'] = 'Vill du verkligen ta bort valda meddelanden?';
+$messages['deletefolderconfirm'] = 'Vill du verkligen radera den här mappen?';
+$messages['purgefolderconfirm'] = 'Vill du verkligen radera alla meddelanden i den här mappen?';
+$messages['formincomplete'] = 'Formuläret var inte ifyllt i sin helhet';
+$messages['noemailwarning'] = 'Vänligen ange en giltig e-postadress';
+$messages['nonamewarning'] = 'Vänligen ange ett namn';
+$messages['nopagesizewarning'] = 'Vänligen ange en sidstorlek';
+$messages['norecipientwarning'] = 'Vänligen ange minst en mottagare';
+$messages['nosubjectwarning'] = 'Ämnesfältet är tomt. Vill du lägga till något nu?';
+$messages['nobodywarning'] = 'Skicka det här meddelandet utan text?';
+$messages['notsentwarning'] = 'Meddelande har inte skickats. Vill du avbryta meddelandet?';
+$messages['noldapserver'] = 'Vänligen ange en LDAP-server att söka';
+$messages['nocontactsreturned'] = 'Inga kontakter hittades';
+$messages['nosearchname'] = 'Vänligen ange ett kontaktnamn eller e-postadress';
+$messages['searchsuccessful'] = '$nr meddelanden hittades';
+$messages['searchnomatch'] = 'Sökningen returnerade inga träffar';
+$messages['searching'] = 'Söker...';
+$messages['checking'] = 'Kontrollerar...';
+$messages['nospellerrors'] = 'Inget stavfel hittades';
+$messages['folderdeleted'] = 'Mappen raderades';
+$messages['deletedsuccessfully'] = 'Lyckad borttagning';
+$messages['converting'] = 'Tar bort formatering från meddelande...';
+$messages['messageopenerror'] = 'Kunde inte ladda meddelande från servern';
+$messages['fileuploaderror'] = 'Filuppladdning misslyckades';
+$messages['filesizeerror'] = 'Den uppladdade filen överstiger maxstorleken $size';
+$messages['copysuccess'] = 'Lyckad kopiering av $nr adresser';
+$messages['copyerror'] = 'Kunde inte kopiera några adresser';
+$messages['sourceisreadonly'] = 'Denna adresskälla är skrivskyddad';
+$messages['errorsavingcontact'] = 'Kunde inte spara kontakt-adressen';
+
+?>
diff --git a/program/localization/si/labels.inc b/program/localization/si/labels.inc
new file mode 100644 (file)
index 0000000..98ab215
--- /dev/null
@@ -0,0 +1,177 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | language/si/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2007, RoundQube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Melanga Dissanayake <Melanga.Dissanayake@pabcbank.com>        |
+ +-----------------------------------------------------------------------+
+
+*/
+
+$labels = array();
+$labels['welcome'] = '$product ආයුබොවන්';
+$labels['username'] = 'නම';
+$labels['password'] = 'මුරපදය';
+$labels['server'] = 'පද්ධතිය';
+$labels['login'] = 'අතුල්වීම';
+$labels['logout'] = 'පිටවීම';
+$labels['mail'] = 'විද්යුත් තැපෑල';
+$labels['settings'] = 'පොද්ගලික කට්ටල අංග';
+$labels['addressbook'] = 'ලිපින පොත';
+$labels['inbox'] = 'ඇතුල්වීම්';
+$labels['drafts'] = 'කටු සටහන්';
+$labels['sent'] = 'පිටවුම්';
+$labels['trash'] = 'ලටපට';
+$labels['junk'] = 'සුන්බුන්';
+$labels['subject'] = 'මාතෘකාව';
+$labels['from'] = 'යවන්නා';
+$labels['to'] = 'ලබන්නා';
+$labels['cc'] = 'පිටපත් කිරීම්';
+$labels['bcc'] = 'අඳ පිටපත් කිරීම්';
+$labels['replyto'] = 'පිළිතුරු සඳහා';
+$labels['date'] = 'දිනය';
+$labels['size'] = 'ප්රමාණය';
+$labels['priority'] = 'ප්රමුඛතාව';
+$labels['organization'] = 'සංවිධානය';
+$labels['reply-to'] = 'පිළිතුරු සඳහා';
+$labels['mailboxlist'] = 'ෆෝල්ඩරය';
+$labels['messagesfromto'] = '$from ගෙන් $to පනිවුඩ $count';
+$labels['messagenrof'] = 'පනිවුඩය $count න් $nr ';
+$labels['moveto'] = 'ගෙනයෑම...';
+$labels['download'] = 'බාගතකිරීම';
+$labels['filename'] = 'ගොනුවේ නම';
+$labels['filesize'] = 'ගොනුවේ ප්රමාණය';
+$labels['preferhtml'] = 'HTML විදහා පෙන්වීම';
+$labels['htmlmessage'] = 'HTML පනිවුඩය';
+$labels['prettydate'] = 'සුරුබුහුටි දින';
+$labels['addtoaddressbook'] = 'ලිපින පොතට එකතු කරන්න';
+$labels['sun'] = 'ඉරිදා';
+$labels['mon'] = 'සඳුදා';
+$labels['tue'] = 'අගහ';
+$labels['wed'] = 'බදාදා';
+$labels['thu'] = 'බ්රහස්';
+$labels['fri'] = 'සිකුරා';
+$labels['sat'] = 'සෙනසු';
+$labels['sunday'] = 'ඉරිදා';
+$labels['monday'] = 'සඳුදා';
+$labels['tuesday'] = 'අගහරුවාදා';
+$labels['wednesday'] = 'බදාදා';
+$labels['thursday'] = 'බ්රහස්පතිනිදා';
+$labels['friday'] = 'සිකුරාදා';
+$labels['saturday'] = 'සෙනසුරාදා';
+$labels['today'] = 'අද';
+$labels['checkmail'] = 'අඵත් පනිවුඩ සඳහා පිරික්සීම';
+$labels['writenewmessage'] = 'අඵත් පනිවුඩක්';
+$labels['replytomessage'] = 'පනිවුඩයට පිළිතුරු';
+$labels['replytoallmessage'] = 'එවන්නාට සහ සැමට පිළිතුරු';
+$labels['forwardmessage'] = 'පනිවුඩය ඉදිරියට';
+$labels['deletemessage'] = 'පනිවුඩය ලටපට තුලට ගෙනයන්න';
+$labels['printmessage'] = 'පනිවුඩය මුද්රනය කරන්න';
+$labels['previousmessage'] = 'කලින් පනිවුඩය පෙන්නන්න';
+$labels['previousmessages'] = 'කලින් පනිවුඩ කට්ටලය පෙන්නන්න';
+$labels['firstmessage'] = 'පළමුවන පනිවුඩය පෙන්නන්න';
+$labels['firstmessages'] = 'පළමුවන පනිවුඩ කට්ටලය පෙන්නන්න';
+$labels['nextmessage'] = 'මීළඟ පනිවුඩය පෙන්නන්න';
+$labels['nextmessages'] = 'මීළඟ පනිවුඩ කට්ටලය පෙන්නන්න';
+$labels['lastmessage'] = 'අවසාන පනිවුඩය පෙන්නන්න';
+$labels['lastmessages'] = 'අවසාන පනිවුඩ කට්ටලය පෙන්නන්න';
+$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'] = 'සෙවුම යලි පිහිටවීම';
+$labels['compose'] = 'පනිවුඩයක් සෑදීම';
+$labels['sendmessage'] = 'පනිවුඩය දැන් යවන්න';
+$labels['savemessage'] = 'කටු සටහනේ තැන්පත කරන්න';
+$labels['addattachment'] = 'ගොනුවක් ඇතුලත් කිරීම';
+$labels['charset'] = 'අකුරැ කට්ටලය';
+$labels['editortype'] = 'සම්පාදන ආකාරය';
+$labels['returnreceipt'] = 'නැවත ලබන්නා';
+$labels['checkspelling'] = 'වචන පරීක්ෂාව';
+$labels['resumeediting'] = 'සම්පාදන නැවත ඇරඹීම';
+$labels['revertto'] = 'ආපසු ඒම';
+$labels['attachments'] = 'ගොනු';
+$labels['upload'] = 'ඇතුල් කරීම';
+$labels['close'] = 'වැසීම';
+$labels['low'] = 'අඩු';
+$labels['lowest'] = 'අඩුම';
+$labels['normal'] = 'සමක';
+$labels['high'] = 'ඉහළ';
+$labels['highest'] = 'ඉහළම';
+$labels['nosubject'] = '(මාතෘකාව නොමැති)';
+$labels['showimages'] = 'රූප පෙන්නන්න';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'පැහැදිලි අකුරු';
+$labels['name'] = 'නම පෙන්නන්න';
+$labels['firstname'] = 'පළමු නම';
+$labels['surname'] = 'අවසාන නම';
+$labels['email'] = 'ද්යුත් තැපෑල';
+$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'] = 'නිර්යාත';
+$labels['previouspage'] = 'කලින් කට්ටලය පෙන්නන්න';
+$labels['firstpage'] = 'පළමුවන කට්ටලය පෙන්නන්න';
+$labels['nextpage'] = 'මීළඟ කට්ටලය පෙන්නන්න';
+$labels['lastpage'] = 'අවසාන කට්ටලය පෙන්නන්න';
+$labels['groups'] = 'කණ්ඩායම්';
+$labels['personaladrbook'] = 'පොද්ගලික ලිපිනය';
+$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['htmleditor'] = 'HTML පනිවුඩයක් සෑදීම';
+$labels['htmlsignature'] = 'HTML අත්සන';
+$labels['previewpane'] = 'පූර්වදර්ශන කොටස පෙන්නන්න';
+$labels['autosavedraft'] = 'ස්වයංක්රීයව කටු සටහනේ තැන්පත් කරන්න';
+$labels['everynminutes'] = 'සෑම මිනිත්තු $n';
+$labels['never'] = 'කිසි විටෙකත් නැති';
+$labels['folder'] = 'ෆෝල්ඩරය';
+$labels['folders'] = 'ෆෝල්ඩර';
+$labels['foldername'] = 'ෆෝල්ඩරයේ නම';
+$labels['subscribed'] = 'සාමාජික';
+$labels['create'] = 'සෑදීම';
+$labels['createfolder'] = 'අඵත් ෆෝල්ඩරයක් සෑදීම';
+$labels['rename'] = 'නැවත නම් කිරීම';
+$labels['renamefolder'] = 'ෆෝල්ඩරය නැවත නම් කිරීම';
+$labels['deletefolder'] = 'ෆෝල්ඩරය මකා දැමීම';
+$labels['managefolders'] = 'හැසිරවීම හැසිරවීම';
+$labels['sortby'] = 'චිසින් වර්ග කිරීම';
+$labels['sortasc'] = 'ආරෝහණ වර්ග කිරීම';
+$labels['sortdesc'] = 'අවරෝහණ වර්ග කිරීම';
+
+?>
\ No newline at end of file
diff --git a/program/localization/si/messages.inc b/program/localization/si/messages.inc
new file mode 100644 (file)
index 0000000..0523926
--- /dev/null
@@ -0,0 +1,73 @@
+<?
+/*
+ +-----------------------------------------------------------------------+
+ | language/si/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2007, RoundQube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Melanga Dissanayake <Melanga.Dissanayake@pabcbank.com>        |
+ +-----------------------------------------------------------------------+
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'ඇතුල්වීම අසාර්ථකයි';
+$messages['cookiesdisabled'] = 'ඔබේ බෞසරය කුකී බාර ගන්නේ නැත';
+$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['contactnotfound'] = 'ඉල්ලූ ලිපිනය සොයාගත නොහැක';
+$messages['sendingfailed'] = 'පනිවුඩය යැවීම අසාර්ථකයි';
+$messages['errorsaving'] = 'පනිවුඩය තැන්පත් කීරීමේදී දොෂයක් සිදු විය';
+$messages['errormoving'] = 'පනිවුඩය ගෙන යාමට නොහැක';
+$messages['errordeleting'] = 'පනිවුඩය මකා දැමීමට නොහැක';
+$messages['deletecontactconfirm'] = 'තෝරා ඇති ලිපින ඔබට මකා දැමීමට සැබවින්ම වුවමනාද?';
+$messages['deletemessagesconfirm'] = 'තෝරා ඇත පනිවුඩ ඔබට මකා දැමීමට සැබවින්ම වුවමනාද?';
+$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'] = 'කරුණාකර ලිපිනයෙහි නම හෝ විද්යුත් තැපැල් ලිපිනය ඇතුලත් කරන්න';
+$messages['searchsuccessful'] = '$nr පනිවුඩය හමු විය';
+$messages['searchnomatch'] = 'සෙවුමට අදාල ගැලපීමක් නොමැත';
+$messages['searching'] = 'සොයමින් පවතී...';
+$messages['checking'] = 'පිරික්සමින් පවතී...';
+$messages['nospellerrors'] = 'වියාකරන දොෂ නොමැත';
+$messages['folderdeleted'] = 'ෆෝල්ඩරය සාර්ථකව මකා දමන ලදී';
+$messages['deletedsuccessfully'] = 'සාර්ථකව මකා දමන ලදී';
+$messages['converting'] = 'පනිවුඩයෙන් ආකෘතීකරණය ඉවත් කිරීම';
+$messages['messageopenerror'] = 'පනිවුඩය පූරනය කිරීමට නොහැක';
+$messages['fileuploaderror'] = 'ගොනුව ඇතුලත් කිරීමට නොහැක';
+$messages['filesizeerror'] = 'ඇතුලත් කල ගොනුවෙ ප්රමාණය උපරිම අගය $size ඉක්මවා ඇත';
+$messages['copysuccess'] = '$nr ලිපිනය සාර්ථකව පිටපත් කරන ලදී';
+$messages['copyerror'] = 'කවර ලිපිනයක්වත් හෝ පිටපත් කල නොහැක';
+$messages['sourceisreadonly'] = 'මෙම ලිපින මූලාශ්රය කියවීම සඳහා පමනි';
+$messages['errorsavingcontact'] = 'ලිපිනය තැන්පත් කීරීමට නොහැක';
+
+?>
\ No newline at end of file
diff --git a/program/localization/sk/labels.inc b/program/localization/sk/labels.inc
new file mode 100644 (file)
index 0000000..8906ac5
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/sk/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Lukas Kraic <lukas.kraic@truni.sk>                            |
+ |         Marek Kutnar marek19@zmail.sk>                                |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 569 2007-05-17 19:42:17Z thomasb $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Vitajte v $product';
+$labels['username'] = 'Prihlasovacie meno';
+$labels['password'] = 'Heslo';
+$labels['server'] = 'Server';
+$labels['login'] = 'Prihlásiť';
+$labels['logout'] = 'Odhlásiť';
+$labels['mail'] = 'E-Mail';
+$labels['settings'] = 'Osobné nastavenia';
+$labels['addressbook'] = 'Adresár';
+$labels['inbox'] = 'Doručená pošta';
+$labels['drafts'] = 'Rozpísané';
+$labels['sent'] = 'Odoslané';
+$labels['trash'] = 'Kôš';
+$labels['junk'] = 'Nevyžiadaná pošta';
+$labels['subject'] = 'Predmet';
+$labels['from'] = 'Odosielateľ';
+$labels['to'] = 'Adresát';
+$labels['cc'] = 'Kópia';
+$labels['bcc'] = 'Tajná kópia';
+$labels['replyto'] = 'Odpovedať na';
+$labels['date'] = 'Dátum';
+$labels['size'] = 'Veľkosť';
+$labels['priority'] = 'Priorita';
+$labels['organization'] = 'Organizácia';
+$labels['reply-to'] = 'Odpovedať na';
+$labels['mailboxlist'] = 'Adresár';
+$labels['messagesfromto'] = 'Správy od $from do $to z $count';
+$labels['messagenrof'] = 'Správa $nr z $count';
+$labels['moveto'] = 'presunúť do...';
+$labels['download'] = 'stiahnuť';
+$labels['filename'] = 'Meno súboru';
+$labels['filesize'] = 'Veľkosť súboru';
+$labels['preferhtml'] = 'Uprednostniť HTML zobrazenie';
+$labels['htmlmessage'] = 'HTML správa';
+$labels['prettydate'] = 'Krajší dátum';
+$labels['addtoaddressbook'] = 'Pridaj do adresára';
+$labels['sun'] = 'Ned';
+$labels['mon'] = 'Pon';
+$labels['tue'] = 'Uto';
+$labels['wed'] = 'Str';
+$labels['thu'] = 'Štv';
+$labels['fri'] = 'Pia';
+$labels['sat'] = 'Sob';
+$labels['sunday'] = 'Nedeľa';
+$labels['monday'] = 'Pondelok';
+$labels['tuesday'] = 'Utorok';
+$labels['wednesday'] = 'Streda';
+$labels['thursday'] = 'Štvrtok';
+$labels['friday'] = 'Piatok';
+$labels['saturday'] = 'Sobota';
+$labels['today'] = 'Dnes';
+$labels['checkmail'] = 'Skontroluj nové správy';
+$labels['writenewmessage'] = 'Vytvor novú správu';
+$labels['replytomessage'] = 'Odpovedať';
+$labels['replytoallmessage'] = 'Odpovedať všetkým';
+$labels['forwardmessage'] = 'Poslať ďalej';
+$labels['deletemessage'] = 'Presuň správu do koša';
+$labels['printmessage'] = 'Vytlač správu';
+$labels['previousmessage'] = 'Zobraziť predchádzajúcu správu';
+$labels['previousmessages'] = 'Zobraziť predchádzajúcu stránku správ';
+$labels['firstmessage'] = 'Zobraziť prvú správu';
+$labels['firstmessages'] = 'Zobraziť prvú stránku správ';
+$labels['nextmessage'] = 'Zobraziť ďalšiu správu';
+$labels['nextmessages'] = 'Zobraziť ďalšiu stránku správ';
+$labels['lastmessage'] = 'Zobraziť poslednú správu';
+$labels['lastmessages'] = 'Zobraziť poslednú stránku správ';
+$labels['backtolist'] = 'Späť na zoznam správ';
+$labels['viewsource'] = 'Ukáž zdroj správy';
+$labels['select'] = 'Výber';
+$labels['all'] = 'Všetky';
+$labels['none'] = 'Žiadnu';
+$labels['unread'] = 'Neprečítané';
+$labels['compact'] = 'Kompaktné';
+$labels['empty'] = 'Prázdne';
+$labels['purge'] = 'Vyprázdniť';
+$labels['quota'] = 'Využitie schránky';
+$labels['unknown'] = 'neznáme';
+$labels['unlimited'] = 'neobmedzené';
+$labels['quicksearch'] = 'Rýchle vyhľadávanie';
+$labels['resetsearch'] = 'Vyčisti vyhľadávanie';
+$labels['compose'] = 'Vytvoriť správu';
+$labels['sendmessage'] = 'Odoslať správu';
+$labels['savemessage'] = 'Uložiť do rozpísaných';
+$labels['addattachment'] = 'Pridať prílohu';
+$labels['charset'] = 'Znaková sada';
+$labels['editortype'] = 'Typ editora';
+$labels['returnreceipt'] = 'Doručenka';
+$labels['checkspelling'] = 'Skontroluj pravopis';
+$labels['resumeediting'] = 'Pokračovať v úpravách';
+$labels['revertto'] = 'Vrátiť sa na';
+$labels['attachments'] = 'Prílohy';
+$labels['upload'] = 'Nahrať';
+$labels['close'] = 'Zatvor';
+$labels['low'] = 'Nízka';
+$labels['lowest'] = 'Najnižšia';
+$labels['normal'] = 'Normálna';
+$labels['high'] = 'Vysoká';
+$labels['highest'] = 'Najvyššia';
+$labels['nosubject'] = '(bez predmetu)';
+$labels['showimages'] = 'Ukáž obrázky';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = 'Čisty text';
+$labels['name'] = 'Celé meno';
+$labels['firstname'] = 'Meno';
+$labels['surname'] = 'Priezvisko';
+$labels['email'] = 'E-Mail';
+$labels['addcontact'] = 'Pridaj nový kontakt';
+$labels['editcontact'] = 'Uprav kontakt';
+$labels['edit'] = 'Uprav';
+$labels['cancel'] = 'Zruš';
+$labels['save'] = 'Ulož';
+$labels['delete'] = 'Zmaž';
+$labels['newcontact'] = 'Vytvor nový kontakt';
+$labels['deletecontact'] = 'Zmaž zvolené kontakty';
+$labels['composeto'] = 'Vytvor správu';
+$labels['contactsfromto'] = 'Kontakty od $from do $to z $count';
+$labels['print'] = 'Tlač';
+$labels['export'] = 'Export';
+$labels['previouspage'] = 'Predchádzajúca stránka';
+$labels['firstpage'] = 'Prvá stránka';
+$labels['nextpage'] = 'Nasledujúca stránka';
+$labels['lastpage'] = 'Posledná stránka';
+$labels['groups'] = 'Skupiny';
+$labels['personaladrbook'] = 'Osobné adresy';
+$labels['settingsfor'] = 'Nastavenia pre';
+$labels['preferences'] = 'Vlastnosti';
+$labels['userpreferences'] = 'Užívateľské vlastnosti';
+$labels['editpreferences'] = 'Uprav užívateľské vlastnosti';
+$labels['identities'] = 'Profily';
+$labels['manageidentities'] = 'Spravovať profily pre tento účet';
+$labels['newidentity'] = 'Nový profil';
+$labels['newitem'] = 'Nová položka';
+$labels['edititem'] = 'Uprav položku';
+$labels['setdefault'] = 'Obnoviť pôvodné';
+$labels['language'] = 'Jazyk';
+$labels['timezone'] = 'Časová zóna';
+$labels['pagesize'] = 'Riadky na stránku';
+$labels['signature'] = 'Podpis';
+$labels['dstactive'] = 'Letný čas';
+$labels['htmleditor'] = 'Vytvoriť HTML správu';
+$labels['htmlsignature'] = 'HTML podpis';
+$labels['previewpane'] = 'Ukáž náhlad výplne';
+$labels['autosavedraft'] = 'Automaticky ulož koncept';
+$labels['everynminutes'] = 'každých $n minút';
+$labels['never'] = 'nikdy';
+$labels['folder'] = 'Zložka';
+$labels['folders'] = 'Zložky';
+$labels['foldername'] = 'Meno zložky';
+$labels['subscribed'] = 'Podpísaný';
+$labels['create'] = 'Vytvoriť';
+$labels['createfolder'] = 'Vytvor novú zložku';
+$labels['rename'] = 'Premenovať';
+$labels['renamefolder'] = 'Premenovať zložku';
+$labels['deletefolder'] = 'Zmaž zložku';
+$labels['managefolders'] = 'Spravovať zložky';
+$labels['sortby'] = 'Triediť podľa';
+$labels['sortasc'] = 'Triediť vzostupne';
+$labels['sortdesc'] = 'Triediť zostupne';
+
+?>
diff --git a/program/localization/sk/messages.inc b/program/localization/sk/messages.inc
new file mode 100644 (file)
index 0000000..d9c5875
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | language/sk/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Lukas Kraic <lukas.kraic@truni.sk>                            |
+ |         Marek Kutnar marek19@zmail.sk>                                |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 569 2007-05-17 19:42:17Z thomasb $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Chybné prihlásenie';
+$messages['cookiesdisabled'] = 'Váš internetový prehliadač nepodporuje cookies, ktoré sú potrebné pre prihlásenie';
+$messages['sessionerror'] = 'Vaše prihlásenie je neplatné alebo vypršala jeho platnosť';
+$messages['imaperror'] = 'Nepodarilo sa spojiť s IMAP serverom';
+$messages['nomessagesfound'] = 'Vo Vašej schránke nie je žiadna správa';
+$messages['loggedout'] = 'Odhlásenie prebehlo úspešne. Dovidenia.';
+$messages['mailboxempty'] = 'Schránka je prázdna';
+$messages['loading'] = 'Nahrávam...';
+$messages['loadingdata'] = 'Nahrávam údaje...';
+$messages['checkingmail'] = 'Kontrolujem nové správy...';
+$messages['sendingmessage'] = 'Posielam správu...';
+$messages['messagesent'] = 'Správa bola odoslaná';
+$messages['savingmessage'] = 'Ukladám správu...';
+$messages['messagesaved'] = 'Správa bola uložená do Nedokončené';
+$messages['successfullysaved'] = 'Uložené';
+$messages['addedsuccessfully'] = 'Kontakt bol pridaný do adresára';
+$messages['contactexists'] = 'Kontakt s touto e-mailovou adresou už existuje';
+$messages['blockedimages'] = 'Z bezpečnostných dôvodov sú v správe zablokované obrázky.';
+$messages['encryptedmessage'] = 'Táto správa je zakryptovaná, a nie je možné ju zobraziť!';
+$messages['nocontactsfound'] = 'Nemáte žiadne kontakty';
+$messages['contactnotfound'] = 'Požadovaný kontakt nebol nájdený';
+$messages['sendingfailed'] = 'Odosielanie správy zlyhalo';
+$messages['errorsaving'] = 'Vyskytla sa chyba pri ukladaní';
+$messages['errormoving'] = 'Nemôžem presunúť správu';
+$messages['errordeleting'] = 'Nemôžem zmazať správu';
+$messages['deletecontactconfirm'] = 'Ste si istý, že chcete zmazať zvolený(é) konakt(y)?';
+$messages['deletemessagesconfirm'] = 'Ste si istý, že chcete zmazať zvolenú(é) správu(y)?';
+$messages['deletefolderconfirm'] = 'Ste si istý, že chcete zmazať túto zložku?';
+$messages['purgefolderconfirm'] = 'Ste si istý, že chcete zmazať všetky správy v tejto zložke?';
+$messages['formincomplete'] = 'Formulár nie je kompletne vyplnený';
+$messages['noemailwarning'] = 'Prosím vložte platnú emailovú adresu';
+$messages['nonamewarning'] = 'Prosím zadajte meno';
+$messages['nopagesizewarning'] = 'Prosím zadajte počet strán';
+$messages['norecipientwarning'] = 'Prosím vložte aspoň jedného adresáta';
+$messages['nosubjectwarning'] = 'Predmet správy je prázdny. Chcete ho teraz zadať?';
+$messages['nobodywarning'] = 'Chcete odoslať správu bez textu?';
+$messages['notsentwarning'] = 'Správa nebola odoslaná, chcete ju zrušiť?';
+$messages['noldapserver'] = 'Prosím zvoľ LDAP server pre vyhľadávanie';
+$messages['nocontactsreturned'] = 'Neboli nájdené žiadne kontakty';
+$messages['nosearchname'] = 'Prosím vložte meno alebo emailovú adresu';
+$messages['searchsuccessful'] = '$nr správa(y) nájdené';
+$messages['searchnomatch'] = 'Hľadaný výraz nebol nájdený';
+$messages['searching'] = 'Hľadám...';
+$messages['checking'] = 'Kontrolujem...';
+$messages['nospellerrors'] = 'Pri kontrole pravopisu neboli nájdene chyby';
+$messages['folderdeleted'] = 'Adresár bol zmazaný';
+$messages['deletedsuccessfully'] = 'Úspešne zmazané';
+$messages['converting'] = 'Odstraňujem formátovanie zo správy...';
+$messages['messageopenerror'] = 'Nemôžem nahrať správu zo servera';
+$messages['fileuploaderror'] = 'Nahrávanie súboru neuspešné';
+$messages['filesizeerror'] = 'Nahrávaný súbor prekročil maximálnu velkost $size';
+$messages['copysuccess'] = 'Úspešne skopírovanie $nr adries';
+$messages['copyerror'] = 'Nemôžem skopírovať žiadnu adresu';
+$messages['sourceisreadonly'] = 'Tento zdroj adries je len na čítanie';
+$messages['errorsavingcontact'] = 'Nemôžem uložit adresu kontaktu';
+
+?>
diff --git a/program/localization/sl/labels.inc b/program/localization/sl/labels.inc
new file mode 100755 (executable)
index 0000000..a7350b6
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+
+/*
+
+ +--------------------------------------------------------------------------------------+
+ | language/si/labels.inc                                                               |
+ |                                                                                      |
+ | Language file of the RoundCube Webmail client                                        |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                                |
+ | Licensed under the GNU GPL                                                           |
+ |                                                                                      |
+ +--------------------------------------------------------------------------------------+
+ | Author: Andrej Sossi <asossi@dotcom.ts.it>                                           |
+ |         Andrej Mocilnik <amocilnik@dotcom.ts.it>                                     |
+ +--------------------------------------------------------------------------------------+
+
+ @version $Id: labels.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$labels = array();
+$labels['welcome'] = 'Dobrodošel v $product';
+$labels['username'] = 'Uporabniško ime';
+$labels['password'] = 'Geslo';
+$labels['server'] = 'Strežnik';
+$labels['login'] = 'Prijava';
+$labels['logout'] = 'Odjava';
+$labels['mail'] = 'E-Pošta';
+$labels['settings'] = 'Osebne nastavitve';
+$labels['addressbook'] = 'Stiki';
+$labels['inbox'] = 'Prejeto';
+$labels['drafts'] = 'Osnutki';
+$labels['sent'] = 'Poslano';
+$labels['trash'] = 'Smeti';
+$labels['junk'] = 'Nezaželena  sporočila';
+$labels['subject'] = 'Zadeva';
+$labels['from'] = 'Pošiljatelj';
+$labels['to'] = 'Prejemnik';
+$labels['cc'] = 'Kopija';
+$labels['bcc'] = 'Skp';
+$labels['replyto'] = 'Odgovor na';
+$labels['date'] = 'Datum';
+$labels['size'] = 'Velikost';
+$labels['priority'] = 'Prioriteta';
+$labels['organization'] = 'Organizacija';
+$labels['reply-to'] = 'Odgovor na';
+$labels['mailboxlist'] = 'Mape';
+$labels['messagesfromto'] = 'Sporočila $from do $to od $count';
+$labels['messagenrof'] = 'Sporočilo $nr od $count';
+$labels['moveto'] = 'premakni v...';
+$labels['download'] = 'prenesi';
+$labels['filename'] = 'Ime datoteke';
+$labels['filesize'] = 'Velikost datoteke';
+$labels['preferhtml'] = 'Prednostno HTML';
+$labels['htmlmessage'] = 'HTML sporočilo';
+$labels['prettydate'] = 'Čitljivejši datumi';
+$labels['addtoaddressbook'] = 'Dodaj v stike';
+$labels['sun'] = 'Ned';
+$labels['mon'] = 'Pon';
+$labels['tue'] = 'Tor';
+$labels['wed'] = 'Sre';
+$labels['thu'] = 'Čet';
+$labels['fri'] = 'Pet';
+$labels['sat'] = 'Sob';
+$labels['sunday'] = 'Nedelja';
+$labels['monday'] = 'Ponedeljek';
+$labels['tuesday'] = 'Torek';
+$labels['wednesday'] = 'Sreda';
+$labels['thursday'] = 'Četrtek';
+$labels['friday'] = 'Petek';
+$labels['saturday'] = 'Sobota';
+$labels['today'] = 'Danes';
+$labels['checkmail'] = 'Preglej nova sporočila';
+$labels['writenewmessage'] = 'Novo sporočilo';
+$labels['replytomessage'] = 'Odgovori na sporočilo';
+$labels['replytoallmessage'] = 'Odgovori pošiljatelju in vsem prejemnikom';
+$labels['forwardmessage'] = 'Posreduj sporočilo';
+$labels['deletemessage'] = 'Premakni sporočilo v smeti';
+$labels['printmessage'] = 'Tiskaj to sporočilo';
+$labels['previousmessage'] = 'Prikaži prejšnje sporočilo';
+$labels['previousmessages'] = 'Prikaži prejšni set sporočil';
+$labels['firstmessage'] = 'Prikaži prvo sporočilo';
+$labels['firstmessages'] = 'Prikaži prvi set sporočil';
+$labels['nextmessage'] = 'Prikaži naslednjo sporočilo';
+$labels['nextmessages'] = 'Prikaži naslednji set sporočil';
+$labels['lastmessage'] = 'Prikaži zadnjo sporočilo';
+$labels['lastmessages'] = 'Prikaži zadnji set sporočil';
+$labels['backtolist'] = 'Nazaj na seznam sporočil';
+$labels['viewsource'] = 'Prikaži izvirno kodo';
+$labels['select'] = 'Izberi';
+$labels['all'] = 'Vse';
+$labels['none'] = 'Nobenih';
+$labels['unread'] = 'Neprebrano';
+$labels['compact'] = 'Stistni';
+$labels['empty'] = 'Izprazni';
+$labels['purge'] = 'Počisti';
+$labels['quota'] = 'Poraba diska';
+$labels['unknown'] = 'neznana';
+$labels['unlimited'] = 'neomejena';
+$labels['quicksearch'] = 'Hitri iskalnik';
+$labels['resetsearch'] = 'Prekliči iskanje';
+$labels['compose'] = 'Sestavi sporočilo';
+$labels['sendmessage'] = 'Pošlji sporočilo zdaj';
+$labels['savemessage'] = 'Shrani kot osnutek';
+$labels['addattachment'] = 'Pripni datoteko';
+$labels['charset'] = 'Nabor znakov';
+$labels['editortype'] = 'Vrsta urejevalnika';
+$labels['returnreceipt'] = 'Potrdilo prejemnika';
+$labels['checkspelling'] = 'Preglej pravopis';
+$labels['resumeediting'] = 'Nadaljuj z urejanjem';
+$labels['revertto'] = 'Razveljavi';
+$labels['attachments'] = 'Priponke';
+$labels['upload'] = 'Naloži';
+$labels['close'] = 'Zapri';
+$labels['low'] = 'Nizka';
+$labels['lowest'] = 'Najnižja';
+$labels['normal'] = 'Normalna';
+$labels['high'] = 'Visoka';
+$labels['highest'] = 'Najvišja';
+$labels['nosubject'] = '(brez naslova)';
+$labels['showimages'] = 'Prikaži slike';
+$labels['htmltoggle'] = 'Obogateno besedilo (HTML)';
+$labels['plaintoggle'] = 'Samo besedilo';
+$labels['name'] = 'Ime za prikaz';
+$labels['firstname'] = 'Ime';
+$labels['surname'] = 'Priimek';
+$labels['email'] = 'E-Pošta';
+$labels['addcontact'] = 'Dodaj izbrane stike v imenik';
+$labels['editcontact'] = 'Uredi vizitko';
+$labels['edit'] = 'Uredi';
+$labels['cancel'] = 'Prekliči';
+$labels['save'] = 'Shrani';
+$labels['delete'] = 'Briši';
+$labels['newcontact'] = 'Dodaj vizitko';
+$labels['deletecontact'] = 'Izbriši izbrane vizitke';
+$labels['composeto'] = 'Sestavi sporočilo za';
+$labels['contactsfromto'] = 'Vizitke $from od $to do $count';
+$labels['print'] = 'Natisni';
+$labels['export'] = 'Izvozi';
+$labels['previouspage'] = 'Prejšnja stran';
+$labels['firstpage'] = 'Prva stran';
+$labels['nextpage'] = 'Naslednja stran';
+$labels['lastpage'] = 'Zadnja stran';
+$labels['groups'] = 'Skupine';
+$labels['personaladrbook'] = 'Osebni Stiki';
+$labels['settingsfor'] = 'Nastavitve za';
+$labels['preferences'] = 'Nastavitve';
+$labels['userpreferences'] = 'Uporabniške nastavitve';
+$labels['editpreferences'] = 'Uredi uporabniške nastavitve';
+$labels['identities'] = 'Identitete';
+$labels['manageidentities'] = 'Upravljaj identitete za ta račun';
+$labels['newidentity'] = 'Nova identiteta';
+$labels['newitem'] = 'Nov predmet';
+$labels['edititem'] = 'Uredi predmet';
+$labels['setdefault'] = 'Nastavi privzeto';
+$labels['language'] = 'Jezik';
+$labels['timezone'] = 'Časovni pas';
+$labels['pagesize'] = 'Vrstic na stran';
+$labels['signature'] = 'Podpis';
+$labels['dstactive'] = 'Avtomatična nastavitev sončne/legalne ure';
+$labels['htmleditor'] = 'Sestavi sporočila z obogatenim besedilom';
+$labels['htmlsignature'] = 'Podpis z obogatenim besedilom';
+$labels['previewpane'] = 'Prikaži predogled';
+$labels['autosavedraft'] = 'Avtomatično shrani osnutke';
+$labels['everynminutes'] = 'vsakih $n minut';
+$labels['never'] = 'nikoli';
+$labels['folder'] = 'Mapa';
+$labels['folders'] = 'Mape';
+$labels['foldername'] = 'Ime mape';
+$labels['subscribed'] = 'Vpisan';
+$labels['create'] = 'Ustvari';
+$labels['createfolder'] = 'Ustvari novo mapo';
+$labels['rename'] = 'Preimenuj';
+$labels['renamefolder'] = 'Preimenuj mapo';
+$labels['deletefolder'] = 'Izbriši mapo';
+$labels['managefolders'] = 'Urejaj mape';
+$labels['sortby'] = 'Uredi po';
+$labels['sortasc'] = 'Uredi naraščajoče';
+$labels['sortdesc'] = 'Uredi padajoče';
+?>
diff --git a/program/localization/sl/messages.inc b/program/localization/sl/messages.inc
new file mode 100755 (executable)
index 0000000..d8aded0
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+/*
+
+ +--------------------------------------------------------------------------------------+
+ | language/si/messages.inc                                                             |
+ |                                                                                      |
+ | Language file of the RoundCube Webmail client                                        |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                                |
+ | Licensed under the GNU GPL                                                           |
+ |                                                                                      |
+ +--------------------------------------------------------------------------------------+
+ | Author: Andrej Sossi <asossi@dotcom.ts.it>                                           |
+ |         Andrej Mocilnik <amocilnik@dotcom.ts.it>                                     |
+ +--------------------------------------------------------------------------------------+
+
+ @version $Id: messages.inc 557 2007-05-15 06:41:32Z yllar $
+
+*/
+
+$messages = array();
+$messages['loginfailed'] = 'Prijava neuspešna';
+$messages['cookiesdisabled'] = 'Vaš brskalnik nima omogočenih piškotov';
+$messages['sessionerror'] = 'Vaša seja je napačna oz. potekla';
+$messages['imaperror'] = 'Povezava na IMAP strežnik neuspešna';
+$messages['nomessagesfound'] = 'Ni sporočil';
+$messages['loggedout'] = 'Uspešno ste zaključili sejo. Nasvidenje!';
+$messages['mailboxempty'] = 'Nabiralnik je prazen';
+$messages['loading'] = 'Nalagam...';
+$messages['loadingdata'] = 'Nalagam podatke...';
+$messages['checkingmail'] = 'Iščem nova sporočila...';
+$messages['sendingmessage'] = 'Pošiljam sporočilo...';
+$messages['messagesent'] = 'Sporočilo uspešno poslano';
+$messages['savingmessage'] = 'Shrenjujem sporočilo';
+$messages['messagesaved'] = 'Sporočilo shranjeno v osnutke';
+$messages['successfullysaved'] = 'Uspešno shranjeno';
+$messages['addedsuccessfully'] = 'Vizitka uspešno dodana';
+$messages['contactexists'] = 'Vizitka s tem e-naslovom že obstaja!';
+$messages['blockedimages'] = 'Zaradi vaše varnosti slike v tem sporočilu niso prikazane.';
+$messages['encryptedmessage'] = 'To je zaščiteno sporočilo, na žalost ne more biti prikazano. Oprostite!';
+$messages['nocontactsfound'] = 'Ne najdem nobene vizitke';
+$messages['contactnotfound'] = 'Ne najdem iskane vizitke';
+$messages['sendingfailed'] = 'Pošiljanje sporočila neuspešno';
+$messages['errorsaving'] = 'Pri shranjevanju je prišlo do napake';
+$messages['errormoving'] = 'Ne morem premakniti sporočila';
+$messages['errordeleting'] = 'Ne morem izbrisati sporočila';
+$messages['deletecontactconfirm'] = 'Želite zbrisati izbrane vizitke?';
+$messages['deletemessagesconfirm'] = 'Želite zbrisati izbrana sporočila?';
+$messages['deletefolderconfirm'] = 'Želite zbrisati to mapo?';
+$messages['purgefolderconfirm'] = 'Želite zbrisati vsa sporočila v tej mapi?';
+$messages['formincomplete'] = 'Obrazec ni bil izpolnjen v celoti';
+$messages['noemailwarning'] = 'Prosim vpišite veljaven e-naslov';
+$messages['nonamewarning'] = 'Prosim vpišite ime';
+$messages['nopagesizewarning'] = 'Prosim vpišite velikost strani';
+$messages['norecipientwarning'] = 'Prosim vpišite vsaj enega naslovnika';
+$messages['nosubjectwarning'] = 'Polje "Naslov" je prazno. Ali ga želite vpisati zdaj?';
+$messages['nobodywarning'] = 'Pošlji to sporočilo brez besedila?';
+$messages['notsentwarning'] = 'Sporočilo ni bilo poslano. Želite opustiti vaše sporočilo?';
+$messages['noldapserver'] = 'Prosim izberite ldap strežnik za iskanje';
+$messages['nocontactsreturned'] = 'Ne najdem vizitk';
+$messages['nosearchname'] = 'Prosim vpišite ime ali e-naslov stika';
+$messages['searchsuccessful'] = 'Število dobljenih sporočil: $nr';
+$messages['searchnomatch'] = 'Iskanje ni doprineslo nobenega rezultata';
+$messages['searching'] = 'Iščem...';
+$messages['checking'] = 'Previrjam...';
+$messages['nospellerrors'] = 'Ni pravopisnih napak';
+$messages['folderdeleted'] = 'Mapa uspešno zbrisana';
+$messages['deletedsuccessfully'] = 'Uspešno zbrisano';
+$messages['converting'] = 'Brišem obogatitev besedila...';
+$messages['messageopenerror'] = 'Neuspešno nalaganje sporočila s stežnika';
+$messages['fileuploaderror'] = 'Neuspešno nalaganje datoteke';
+$messages['filesizeerror'] = 'Naložena datoteka presega maksimalno velikost $size';
+$messages['copysuccess'] = 'Število prepisanih naslovov: $nr';
+$messages['copyerror'] = 'Ne morem prepisati nobenega naslova';
+$messages['sourceisreadonly'] = 'Izvirnik naslova je samo berljiv';
+$messages['errorsavingcontact'] = 'Ne morem shraniti vizitke';
+?>
diff --git a/program/localization/zh_TW/labels.inc b/program/localization/zh_TW/labels.inc
new file mode 100755 (executable)
index 0000000..62ecf82
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | localization/tw/labels.inc                                            |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: kourge <kourge@gmail.com>                                     |
+ |         Ting-Hung Chiu <earrl@mmlab.cse.yzu.edu.tw>                   |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: labels.inc 560 2007-05-17 15:01:26Z thomasb $
+
+*/
+
+$labels = array();
+$labels['welcome'] = '歡迎使用 $product';
+$labels['username'] = '使用者名稱';
+$labels['password'] = '使用者密碼';
+$labels['server'] = '伺服器';
+$labels['login'] = '登入';
+$labels['logout'] = '登出';
+$labels['mail'] = '電子郵件';
+$labels['settings'] = '個人設定';
+$labels['addressbook'] = '通訊錄';
+$labels['inbox'] = '信件匣';
+$labels['drafts'] = '草稿匣';
+$labels['sent'] = '寄件備份';
+$labels['trash'] = '垃圾郵件';
+$labels['junk'] = '垃圾桶';
+$labels['subject'] = '主旨';
+$labels['from'] = '寄件者';
+$labels['to'] = '收件者';
+$labels['cc'] = '副本';
+$labels['bcc'] = '秘件副本';
+$labels['replyto'] = '回覆至';
+$labels['date'] = '日期';
+$labels['size'] = '大小';
+$labels['priority'] = '優先順序';
+$labels['organization'] = '組織';
+$labels['reply-to'] = '回覆至';
+$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'] = '新增至通訊錄';
+$labels['sun'] = '日';
+$labels['mon'] = '一';
+$labels['tue'] = '二';
+$labels['wed'] = '三';
+$labels['thu'] = '四';
+$labels['fri'] = '五';
+$labels['sat'] = '六';
+$labels['sunday'] = '星期日';
+$labels['monday'] = '星期一';
+$labels['tuesday'] = '星期二';
+$labels['wednesday'] = '星期三';
+$labels['thursday'] = '星期四';
+$labels['friday'] = '星期五';
+$labels['saturday'] = '星期六';
+$labels['today'] = '今日';
+$labels['checkmail'] = '檢查新郵件';
+$labels['writenewmessage'] = '撰寫新郵件';
+$labels['replytomessage'] = '回覆';
+$labels['replytoallmessage'] = '全部回覆';
+$labels['forwardmessage'] = '轉寄';
+$labels['deletemessage'] = '移至垃圾郵件';
+$labels['printmessage'] = '列印此郵件';
+$labels['previousmessage'] = '顯示上一封郵件';
+$labels['previousmessages'] = '顯示上一頁';
+$labels['firstmessage'] = '顯示第一封郵件';
+$labels['firstmessages'] = '顯示第一頁';
+$labels['nextmessage'] = '顯示下一封郵件';
+$labels['nextmessages'] = '顯示下一頁';
+$labels['lastmessage'] = '顯示最後一封郵件';
+$labels['lastmessages'] = '顯示最後一頁';
+$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'] = '重設搜尋';
+$labels['compose'] = '撰寫新郵件';
+$labels['sendmessage'] = '立即寄出';
+$labels['savemessage'] = '存至草稿匣';
+$labels['addattachment'] = '增加附件檔案';
+$labels['charset'] = '字元集';
+$labels['editortype'] = '編輯器類型';
+$labels['returnreceipt'] = '郵件回條';
+$labels['checkspelling'] = '拼字檢查';
+$labels['resumeediting'] = '繼續編輯';
+$labels['revertto'] = '恢復至';
+$labels['attachments'] = '附件';
+$labels['upload'] = '上傳';
+$labels['close'] = '關閉';
+$labels['low'] = '低';
+$labels['lowest'] = '最低';
+$labels['normal'] = '普通';
+$labels['high'] = '高';
+$labels['highest'] = '最高';
+$labels['nosubject'] = '(沒有主旨)';
+$labels['showimages'] = '顯示圖片';
+$labels['htmltoggle'] = 'HTML';
+$labels['plaintoggle'] = '純文字';
+$labels['name'] = '顯示名稱';
+$labels['firstname'] = '名稱';
+$labels['surname'] = '姓氏';
+$labels['email'] = '電子郵件';
+$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'] = '匯出';
+$labels['previouspage'] = '顯示上一頁';
+$labels['firstpage'] = '顯示第一頁';
+$labels['nextpage'] = '顯示下一頁';
+$labels['lastpage'] = '顯示最後一頁';
+$labels['groups'] = '群組';
+$labels['personaladrbook'] = '個人住址';
+$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['htmleditor'] = '撰寫 HTML 郵件';
+$labels['htmlsignature'] = 'HTML 簽名檔';
+$labels['previewpane'] = '顯示預覽窗格';
+$labels['autosavedraft'] = '自動儲存草稿';
+$labels['everynminutes'] = '每 $n 分鐘';
+$labels['never'] = '絕不';
+$labels['folder'] = '資料夾';
+$labels['folders'] = '資料夾';
+$labels['foldername'] = '資料夾名稱';
+$labels['subscribed'] = '已訂閱';
+$labels['create'] = '建立';
+$labels['createfolder'] = '建立新資料夾';
+$labels['rename'] = '重新命名';
+$labels['renamefolder'] = '重新命名資料夾';
+$labels['deletefolder'] = '刪除資料夾';
+$labels['managefolders'] = '管理資料夾';
+$labels['sortby'] = '排序';
+$labels['sortasc'] = '遞增排序';
+$labels['sortdesc'] = '遞減排序';
+
+?>
\ No newline at end of file
diff --git a/program/localization/zh_TW/messages.inc b/program/localization/zh_TW/messages.inc
new file mode 100755 (executable)
index 0000000..d8bfbe5
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+/*
+
+ +-----------------------------------------------------------------------+
+ | localization/tw/messages.inc                                          |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: kourge <kourge@gmail.com>                                     |
+ |         Ting-Hung Chiu <earrl@mmlab.cse.yzu.edu.tw>                   |
+ +-----------------------------------------------------------------------+
+
+ @version $Id: messages.inc 560 2007-05-17 15:01:26Z thomasb $
+
+*/
+
+$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'] = '此聯絡人的電子郵件位址已存在';
+$messages['blockedimages'] = '為了保護你的隱私,此郵件中的遠端圖片已經被阻擋。';
+$messages['encryptedmessage'] = '此郵件經過加密,因此無法顯示。抱歉!';
+$messages['nocontactsfound'] = '沒有找到任何聯絡人';
+$messages['contactnotfound'] = '找不到要求的聯絡人';
+$messages['sendingfailed'] = '郵件寄出失敗';
+$messages['errorsaving'] = '儲存過程當中發生錯誤';
+$messages['errormoving'] = '無法移動此郵件';
+$messages['errordeleting'] = '無法刪除此郵件';
+$messages['deletecontactconfirm'] = '你確定要刪除已選擇的聯絡人?';
+$messages['deletemessagesconfirm'] = '你確定要刪除已選擇的郵件?';
+$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'] = '請輸入一個聯絡人姓名或電子郵件位址';
+$messages['searchsuccessful'] = '共找到 $nr 封郵件';
+$messages['searchnomatch'] = '找不到任何符合的郵件';
+$messages['searching'] = '搜尋中...';
+$messages['checking'] = '檢查中...';
+$messages['nospellerrors'] = '沒有找到任何拼字錯誤';
+$messages['folderdeleted'] = '資料夾已經成功地被刪除';
+$messages['deletedsuccessfully'] = '刪除成功';
+$messages['converting'] = '移除郵件格式中...';
+$messages['messageopenerror'] = '無法從伺服器載入郵件';
+$messages['fileuploaderror'] = '檔案上傳失敗';
+$messages['filesizeerror'] = '上傳的檔案超過了 $size 的大小限制';
+$messages['copysuccess'] = '複製 $nr 個位址成功';
+$messages['copyerror'] = '無法複製任何位址';
+$messages['sourceisreadonly'] = '此來源位址是唯讀的';
+$messages['errorsavingcontact'] = '無法儲存連絡人的位址';
+
+?>
\ No newline at end of file
diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc
new file mode 100644 (file)
index 0000000..e6d917e
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/addressbook/copy.inc                                    |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2007, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Copy a contact record from one direcotry to another                 |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com>                        |
+ +-----------------------------------------------------------------------+
+
+ $Id: copy.inc 471 2007-02-09 21:25:50Z thomasb $
+
+*/
+
+$cid = get_input_value('_cid', RCUBE_INPUT_POST);
+$target = get_input_value('_to', RCUBE_INPUT_POST);
+if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($target) && $target != $source)
+{
+  if ($target != '0')
+    $TARGET = new rcube_ldap($CONFIG['ldap_public'][$target]);
+  else
+    $TARGET = new rcube_contacts($DB, $_SESSION['user_id']);
+    
+  $success = false;  
+  if ($TARGET && $TARGET->ready && !$TARGET->readonly)
+    $success = $TARGET->insert($CONTACTS->search($CONTACTS->primary_key, $cid), true);
+
+  if (empty($success))
+    $OUTPUT->show_message('copyerror', 'error');
+  else
+    $OUTPUT->show_message('copysuccess', 'notice', array('nr' => count($success)));
+}
+  
+// send response
+$OUTPUT->send();
+
+?>
\ No newline at end of file
index 2bec51e8a337e5768b9b3dd1ac532a2ee9ea00c5..20e98ce59a4293204a0bb93cd2acf98cb7534faa 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/addressbook/delete.inc                                  |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: delete.inc 429 2006-12-22 22:26:24Z thomasb $
+ $Id: delete.inc 573 2007-05-18 11:29:25Z thomasb $
 
 */
 
-$REMOTE_REQUEST = TRUE;
-
-if ($_GET['_cid'] && preg_match('/^[0-9]+(,[0-9]+)*$/',$_GET['_cid']))
+if (($cid = get_input_value('_cid', RCUBE_INPUT_POST)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $cid))
   {
-  $DB->query("UPDATE ".get_table_name('contacts')."
-              SET    del=1
-              WHERE  user_id=?
-              AND    contact_id IN (".$_GET['_cid'].")",
-              $_SESSION['user_id']);
-                     
-  $count = $DB->affected_rows();
-  if (!$count)
+  $deleted = $CONTACTS->delete($cid);
+  if (!$deleted)
     {
     // send error message
     exit;
     }
 
-
   // count contacts for this user
-  $sql_result = $DB->query("SELECT COUNT(contact_id) AS rows
-                            FROM ".get_table_name('contacts')."
-                            WHERE  del<>1
-                            AND    user_id=?",
-                            $_SESSION['user_id']);
-                                   
-  $sql_arr = $DB->fetch_assoc($sql_result);
-  $rowcount = $sql_arr['rows'];    
+  $result = $CONTACTS->count();
 
   // update message count display
-  $pages = ceil($rowcount/$CONFIG['pagesize']);
-  $commands = sprintf("this.set_rowcount('%s');\n", rcmail_get_rowcount_text($rowcount));
-  $commands .= sprintf("this.set_env('pagecount', %d);\n", $pages);
-
+  $OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size));
+  $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result->count));
 
   // add new rows from next page (if any)
-  if ($_GET['_from']!='show' && $pages>1 && $_SESSION['page'] < $pages)
-    {
-    $start_row = ($_SESSION['page'] * $CONFIG['pagesize']) - $count;
-
-    // get contacts from DB
-    $sql_result = $DB->limitquery("SELECT * FROM ".get_table_name('contacts')."
-                                   WHERE  del<>1
-                                   AND    user_id=?
-                                   ORDER BY name",
-                                   $start_row,
-                                   $count,
-                                   $_SESSION['user_id']);
-                                     
-    $commands .= rcmail_js_contacts_list($sql_result);
-
-/*
-    // define list of cols to be displayed
-    $a_show_cols = array('name', 'email');
-    
-    while ($sql_arr = $DB->fetch_assoc($sql_result))
-      {
-      $a_row_cols = array();
-            
-      // format each col
-      foreach ($a_show_cols as $col)
-        {
-        $cont = rep_specialchars_output($sql_arr[$col]);
-        $a_row_cols[$col] = $cont;
-        }
-  
-      $commands .= sprintf("this.add_contact_row(%s, %s);\n",
-                           $sql_arr['contact_id'],
-                           array2js($a_row_cols));
-      }
-*/
-    }
+  $pages = ceil(($result->count + $deleted) / $CONTACTS->page_size);
+  if ($_GET['_from'] != 'show' && $pages > 1 && $CONTACTS->list_page < $pages)
+    rcmail_js_contacts_list($CONTACTS->list_records(null, -$deleted));
 
   // send response
-  rcube_remote_response($commands);
+  $OUTPUT->send();
   }
 
 exit;
index c71e2beeaaf9a27cf97943a6b7b99b7ce2784517..918625ea619174fed1f8c397e13416607a7a0c1d 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/addressbook/edit.inc                                    |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: edit.inc 88 2005-12-03 16:54:12Z roundcube $
+ $Id: edit.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
 
-if (($_GET['_cid'] || $_POST['_cid']) && $_action=='edit')
-  {
-  $cid = $_POST['_cid'] ? $_POST['_cid'] : $_GET['_cid'];
-  $DB->query("SELECT * FROM ".get_table_name('contacts')."
-             WHERE  contact_id=?
-             AND    user_id=?
-             AND    del<>1",
-             $cid,
-             $_SESSION['user_id']);
-  
-  $CONTACT_RECORD = $DB->fetch_assoc();
-
-  if (is_array($CONTACT_RECORD))
-    $OUTPUT->add_script(sprintf("%s.set_env('cid', '%s');", $JS_OBJECT_NAME, $CONTACT_RECORD['contact_id']));
-  }
-
+if (($cid = get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true)))
+  $OUTPUT->set_env('cid', $record['ID']);
 
+// adding not allowed here
+if ($CONTACTS->readonly)
+{
+  $OUTPUT->show_message('sourceisreadonly');
+  rcmail_overwrite_action('show');
+  return;
+}
 
 function rcmail_contact_editform($attrib)
-  {
-  global $CONTACT_RECORD, $JS_OBJECT_NAME;
+{
+  global $CONTACTS, $OUTPUT;
 
-  if (!$CONTACT_RECORD && $GLOBALS['_action']!='add')
-    return rcube_label('contactnotfound');
+  // check if we have a valid result
+  if ($GLOBALS['_action'] != 'add' && !(($result = $CONTACTS->get_result()) && ($record = $result->first())))
+  {
+    $OUTPUT->show_message('contactnotfound');
+    return false;
+  }
 
   // add some labels to client
   rcube_add_label('noemailwarning');
@@ -51,15 +48,14 @@ function rcmail_contact_editform($attrib)
 
   list($form_start, $form_end) = get_form_tags($attrib);
   unset($attrib['form']);
-  
 
   // a specific part is requested
   if ($attrib['part'])
-    {
+  {
     $out = $form_start;
-    $out .= rcmail_get_edit_field($attrib['part'], $CONTACT_RECORD[$attrib['part']], $attrib); 
+    $out .= rcmail_get_edit_field($attrib['part'], $record[$attrib['part']], $attrib); 
     return $out;
-    }
+  }
 
 
   // return the complete address edit form as table
@@ -67,38 +63,37 @@ function rcmail_contact_editform($attrib)
 
   $a_show_cols = array('name', 'firstname', 'surname', 'email');
   foreach ($a_show_cols as $col)
-    {
+  {
     $attrib['id'] = 'rcmfd_'.$col;
-    $title = rcube_label($col);
-    $value = rcmail_get_edit_field($col, $CONTACT_RECORD[$col], $attrib);
+    $value = rcmail_get_edit_field($col, $record[$col], $attrib);
     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
                     $attrib['id'],
-                    $title,
+                    Q(rcube_label($col)),
                     $value);
-    }
+  }
 
   $out .= "\n</table>$form_end";
 
   return $out;  
-  }
+}
+
+$OUTPUT->add_handler('contacteditform', 'rcmail_contact_editform');
 
 
 // similar function as in /steps/settings/edit_identity.inc
 function get_form_tags($attrib)
   {
-  global $CONTACT_RECORD, $OUTPUT, $JS_OBJECT_NAME, $EDIT_FORM, $SESS_HIDDEN_FIELD;  
+  global $CONTACTS, $OUTPUT, $EDIT_FORM, $SESS_HIDDEN_FIELD;  
 
+  $result = $CONTACTS->get_result();
   $form_start = '';
   if (!strlen($EDIT_FORM))
     {
     $hiddenfields = new hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task']));
-    $hiddenfields->add(array('name' => '_action', 'value' => 'save'));
-    
-    if ($_GET['_framed'] || $_POST['_framed'])
-      $hiddenfields->add(array('name' => '_framed', 'value' => 1));
+    $hiddenfields->add(array('name' => '_action', 'value' => 'save', 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));
     
-    if ($CONTACT_RECORD['contact_id'])
-      $hiddenfields->add(array('name' => '_cid', 'value' => $CONTACT_RECORD['contact_id']));
+    if (($result = $CONTACTS->get_result()) && ($record = $result->first()))
+      $hiddenfields->add(array('name' => '_cid', 'value' => $record['ID']));
     
     $form_start = !strlen($attrib['form']) ? '<form name="form" action="./" method="post">' : '';
     $form_start .= "\n$SESS_HIDDEN_FIELD\n";
@@ -109,7 +104,7 @@ function get_form_tags($attrib)
   $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
   
   if (!strlen($EDIT_FORM))
-    $OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('editform', '$form_name');");
+    $OUTPUT->add_gui_object('editform', $form_name);
   
   $EDIT_FORM = $form_name;
 
@@ -118,7 +113,7 @@ function get_form_tags($attrib)
 
 
 
-if (!$CONTACT_RECORD && template_exists('addcontact'))
+if (!$CONTACTS->get_result() && template_exists('addcontact'))
   parse_template('addcontact');
 
 // this will be executed if no template for addcontact exists
index efa64f7d87d620c75aed63bae40b2477954cbf10..46c600f2ab7b0f346f9d00211089b30ef79e50f7 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/addressbook/func.inc                                    |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: func.inc 127 2006-01-25 22:56:53Z roundcube $
+ $Id: func.inc 578 2007-05-18 13:06:01Z thomasb $
 
 */
 
-$CONTACTS_LIST = array();
+require_once('include/rcube_contacts.inc');
+require_once('include/rcube_ldap.inc');
+
+// instantiate a contacts object according to the given source
+if (($source = get_input_value('_source', RCUBE_INPUT_GPC)) && isset($CONFIG['ldap_public'][$source]))
+  $CONTACTS = new rcube_ldap($CONFIG['ldap_public'][$source]);
+else
+  $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']);
+
+$CONTACTS->set_pagesize($CONFIG['pagesize']);
 
 // set list properties and session vars
-if (strlen($_GET['_page']))
+if (!empty($_GET['_page']))
   {
-  $CONTACTS_LIST['page'] = $_GET['_page'];
+  $CONTACTS->set_page(intval($_GET['_page']));
   $_SESSION['page'] = $_GET['_page'];
   }
 else
-  $CONTACTS_LIST['page'] = $_SESSION['page'] ? $_SESSION['page'] : 1;
+  $CONTACTS->set_page(isset($_SESSION['page']) ?$_SESSION['page'] : 1);
+
+// set message set for search result
+if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']]))
+  $CONTACTS->set_search_set($_SESSION['search'][$_REQUEST['_search']]);
+
+// set data source env
+$OUTPUT->set_env('source', $source ? $source : '0');
+$OUTPUT->set_env('readonly', $CONTACTS->readonly, false);
+
+// add list of address sources to client env
+$js_list = array("0" => array('id' => 0, 'readonly' => false));
+foreach ((array)$CONFIG['ldap_public'] as $id => $prop)
+  $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writeable']);
+$OUTPUT->set_env('address_sources', $js_list);
+
 
-// disable the ldap public search button if there's no servers configured
-$enable_ldap = 'true';
-if (!$CONFIG['ldap_public'])
-  $enable_ldap = 'false';
+function rcmail_directory_list($attrib)
+{
+  global $CONFIG, $OUTPUT;
   
-$OUTPUT->add_script("$JS_OBJECT_NAME.set_env('ldappublicsearch', $enable_ldap);");  
+  if (!$attrib['id'])
+    $attrib['id'] = 'rcmdirectorylist';
+
+  $local_id = '0';
+  $current = get_input_value('_source', RCUBE_INPUT_GPC);
+  $line_templ = '<li id="%s" class="%s"><a href="%s"' .
+    ' onclick="return %s.command(\'list\',\'%s\',this)"' .
+    ' onmouseover="return %s.focus_folder(\'%s\')"' .
+    ' onmouseout="return %s.unfocus_folder(\'%s\')"' .
+    ' onmouseup="return %s.folder_mouse_up(\'%s\')">%s'.
+    "</a></li>\n";
+    
+  // allow the following attributes to be added to the <ul> tag
+  $out = '<ul' . create_attrib_string($attrib, array('style', 'class', 'id')) . ">\n";
+  $out .= sprintf($line_templ,
+    'rcmli'.$local_id,
+    !$current ? 'selected' : '',
+    Q(rcmail_url('list', array('_source' => 0))),
+    JS_OBJECT_NAME,
+    $local_id,
+    JS_OBJECT_NAME,
+    $local_id,
+    JS_OBJECT_NAME,
+    $local_id,
+    JS_OBJECT_NAME,
+    $local_id,
+    rcube_label('personaladrbook'));
+  
+  foreach ((array)$CONFIG['ldap_public'] as $id => $prop)
+  {
+    $js_id = JQ($id);
+    $dom_id = preg_replace('/[^a-z0-9\-_]/i', '', $id);
+    $out .= sprintf($line_templ,
+      'rcmli'.$dom_id,
+      $current == $id ? 'selected' : '',
+      Q(rcmail_url('list', array('_source' => $id))),
+      JS_OBJECT_NAME,
+      $js_id,
+      JS_OBJECT_NAME,
+      $js_id,
+      JS_OBJECT_NAME,
+      $js_id,
+      JS_OBJECT_NAME,
+      $js_id,
+      !empty($prop['name']) ? Q($prop['name']) : Q($id));
+  }
+  
+  $out .= '</ul>';
+
+  $OUTPUT->add_gui_object('folderlist', $attrib['id']);
+  
+  return $out;
+}
+
 
 // return the message list as HTML table
 function rcmail_contacts_list($attrib)
   {
-  global $DB, $CONFIG, $OUTPUT, $CONTACTS_LIST, $JS_OBJECT_NAME;
-  
-  //$skin_path = $CONFIG['skin_path'];
-  //$image_tag = '<img src="%s%s" alt="%s" border="0" />';
+  global $CONTACTS, $OUTPUT;
   
   // count contacts for this user
-  $sql_result = $DB->query("SELECT COUNT(contact_id) AS rows
-                            FROM ".get_table_name('contacts')."
-                            WHERE  del<>1
-                            AND    user_id=?",
-                            $_SESSION['user_id']);
-
-  $sql_arr = $DB->fetch_assoc($sql_result);
-  $rowcount = $sql_arr['rows'];
-
-  if ($rowcount)
-    {
-    $start_row = ($CONTACTS_LIST['page']-1) * $CONFIG['pagesize'];
-
-    // get contacts from DB
-    $sql_result = $DB->limitquery("SELECT * FROM ".get_table_name('contacts')."
-                                   WHERE  del<>1
-                                   AND    user_id= ?
-                                   ORDER BY name",
-                                   $start_row,
-                                   $CONFIG['pagesize'],
-                                   $_SESSION['user_id']);
-    }
-  else
-    $sql_result = NULL;
-
-
+  $result = $CONTACTS->list_records();
+  
   // add id to message list table if not specified
   if (!strlen($attrib['id']))
     $attrib['id'] = 'rcmAddressList';
-
+  
   // define list of cols to be displayed
-  $a_show_cols = array('name', 'email');
-
-  // create XHTML table  
-  $out = rcube_table_output($attrib, $sql_result, $a_show_cols, 'contact_id');
+  $a_show_cols = array('name');
 
+  // create XHTML table
+  $out = rcube_table_output($attrib, $result->records, $a_show_cols, $CONTACTS->primary_key);
+  
   // set client env
-  $javascript = sprintf("%s.gui_object('contactslist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']);
-  $javascript .= sprintf("%s.set_env('current_page', %d);\n", $JS_OBJECT_NAME, $CONTACTS_LIST['page']);
-  $javascript .= sprintf("%s.set_env('pagecount', %d);\n", $JS_OBJECT_NAME, ceil($rowcount/$CONFIG['pagesize']));
-  $javascript .= "rcmail.set_env('newcontact', '" . rcube_label('newcontact') . "');";
-  //$javascript .= sprintf("%s.set_env('contacts', %s);", $JS_OBJECT_NAME, array2js($a_js_message_arr));
+  $OUTPUT->add_gui_object('contactslist', $attrib['id']);
+  $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page);
+  $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size));
+  $OUTPUT->include_script('list.js');
   
-  $OUTPUT->add_script($javascript);  
-
   // add some labels to client
   rcube_add_label('deletecontactconfirm');
-
+  
   return $out;
   }
 
 
-
-function rcmail_js_contacts_list($sql_result, $obj_name='this')
+function rcmail_js_contacts_list($result, $prefix='')
   {
-  global $DB;
+  global $OUTPUT;
 
-  $commands = '';
-  
-  if (!$sql_result)
-    return '';
+  if (empty($result) || $result->count == 0)
+    return;
 
   // define list of cols to be displayed
-  $a_show_cols = array('name', 'email');
-    
-  while ($sql_arr = $DB->fetch_assoc($sql_result))
+  $a_show_cols = array('name');
+  
+  while ($row = $result->next())
     {
     $a_row_cols = array();
-            
+    
     // format each col
     foreach ($a_show_cols as $col)
-      {
-      $cont = rep_specialchars_output($sql_arr[$col]);
-      $a_row_cols[$col] = $cont;
-      }
-  
-    $commands .= sprintf("%s.add_contact_row(%s, %s);\n",
-                         $obj_name,
-                         $sql_arr['contact_id'],
-                         array2js($a_row_cols));
-    }
+      $a_row_cols[$col] = $row[$col];
     
-  return $commands;
+    $OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols);
+    }
   }
 
 
 // similar function as /steps/settings/identities.inc::rcmail_identity_frame()
 function rcmail_contact_frame($attrib)
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT;
 
   if (!$attrib['id'])
     $attrib['id'] = 'rcmcontactframe';
     
   $attrib['name'] = $attrib['id'];
-
-  $OUTPUT->add_script(sprintf("%s.set_env('contentframe', '%s');", $JS_OBJECT_NAME, $attrib['name']));
-
   $attrib_str = create_attrib_string($attrib, array('name', 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
-  $out = '<iframe'. $attrib_str . '></iframe>';
-    
-  return $out;
+
+  $OUTPUT->set_env('contentframe', $attrib['name']);
+  $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif');
+  return '<iframe'. $attrib_str . '></iframe>';
   }
 
 
 function rcmail_rowcount_display($attrib)
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT;
   
   if (!$attrib['id'])
     $attrib['id'] = 'rcmcountdisplay';
 
-  $OUTPUT->add_script(sprintf("%s.gui_object('countdisplay', '%s');", $JS_OBJECT_NAME, $attrib['id']));
+  $OUTPUT->add_gui_object('countdisplay', $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_rowcount_text();
   $out .= '</span>';
@@ -172,32 +204,37 @@ function rcmail_rowcount_display($attrib)
 
 
 
-function rcmail_get_rowcount_text($max=NULL)
+function rcmail_get_rowcount_text()
   {
-  global $CONTACTS_LIST, $CONFIG, $DB;
+  global $CONTACTS;
   
-  $start_row = ($CONTACTS_LIST['page']-1) * $CONFIG['pagesize'] + 1;
-
-  // get nr of contacts
-  if ($max===NULL)
-    {
-    $sql_result = $DB->query("SELECT 1 FROM ".get_table_name('contacts')."
-                              WHERE  del<>1
-                              AND    user_id=?",
-                              $_SESSION['user_id']);
-
-    $max = $DB->num_rows($sql_result);
-    }
-
-  if ($max==0)
+  // read nr of contacts
+  $result = $CONTACTS->get_result();
+  if (!$result)
+    $result = $CONTACTS->count();
+  
+  if ($result->count == 0)
     $out = rcube_label('nocontactsfound');
   else
-    $out = rcube_label(array('name' => 'contactsfromto',
-                             'vars' => array('from'  => $start_row,
-                                             'to'    => min($max, $start_row + $CONFIG['pagesize'] - 1),
-                                             'count' => $max)));
+    $out = rcube_label(array(
+      'name' => 'contactsfromto',
+      'vars' => array(
+        'from'  => $result->first + 1,
+        'to'    => min($result->count, $result->first + $CONTACTS->page_size),
+        'count' => $result->count)
+      ));
 
   return $out;
   }
+  
+  
+// register UI objects
+$OUTPUT->add_handlers(array(
+  'directorylist' => 'rcmail_directory_list',
+  'addresslist' => 'rcmail_contacts_list',
+  'addressframe' => 'rcmail_contact_frame',
+  'recordscountdisplay' => 'rcmail_rowcount_display',
+  'searchform' => 'rcmail_search_form'
+));
 
 ?>
diff --git a/program/steps/addressbook/ldapsearchform.inc b/program/steps/addressbook/ldapsearchform.inc
deleted file mode 100644 (file)
index 7633bde..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-<?php
-
-/*
- +-----------------------------------------------------------------------+
- | program/steps/addressbook/ldapsearch.inc                              |
- |                                                                       |
- | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
- | Licensed under the GNU GPL                                            |
- |                                                                       |
- | PURPOSE:                                                              |
- |   Show an ldap search form in the addressbook                         |
- |                                                                       |
- +-----------------------------------------------------------------------+
- | Author: Justin Randell <justin.randell@gmail.com>                     |
- +-----------------------------------------------------------------------+
-
- $Id: ldapsearchform.inc 159 2006-03-03 16:34:35Z roundcube $
-
-*/
-require_once 'include/rcube_ldap.inc';
-
-/**
- * draw the ldap public search form
- */
-function rcmail_ldap_public_search_form($attrib)
-  {
-  global $CONFIG, $JS_OBJECT_NAME, $OUTPUT; 
-  if (!isset($CONFIG['ldap_public']))
-    {
-    // no ldap servers to search
-    show_message('noldapserver', 'warning');
-    rcmail_overwrite_action('add');
-    return false;
-    }
-  else
-    {
-    // store some information in the session
-    $_SESSION['ldap_public']['server_count'] = $server_count = count($CONFIG['ldap_public']);
-    $_SESSION['ldap_public']['server_names'] = $server_names = array_keys($CONFIG['ldap_public']);
-    }
-  
-  list($form_start, $form_end) = get_form_tags($attrib);
-  $out = "$form_start<table id=\"ldap_public_search_table\">\n\n";
-  
-  // search name field
-  $search_name = new textfield(array('name' => '_ldap_public_search_name',
-                                     'id'   => 'rcmfd_ldap_public_search_name'));
-  $out .= "<tr><td class=\"title\"><label for=\"rcmfd_ldap_public_search_name\">" . 
-          rep_specialchars_output(rcube_label('ldappublicsearchname')) . 
-          "</label></td><td>" . $search_name->show() . "</td></tr>\n";
-
-
-  // there's more than one server to search for, show a dropdown menu
-  if ($server_count > 1)
-    {
-    $select_server = new select(array('name' => '_ldap_public_servers', 
-                                      'id'   => 'rcfmd_ldap_public_servers'));
-     
-    $select_server->add($server_names, $server_names);
-
-    $out .= '<tr><td class="title"><label for="rcfmd_ldap_public_servers">' .
-            rep_specialchars_output(rcube_label('ldappublicserverselect')) .
-            "</label></td><td>" . $select_server->show() . "</td></tr>\n";
-    }
-  
-  // foreach configured ldap server, set up the search fields
-  for ($i = 0; $i < $server_count; $i++)
-    {
-    $server = $CONFIG['ldap_public'][$server_names[$i]];
-    
-    // only display one search fields select - js takes care of the rest
-    if (!$i)
-      {
-      $field_name = '_ldap_public_search_field';
-      $field_id   = 'rcfmd_ldap_public_search_field';
-
-      $search_fields = new select(array('name' => $field_name, 
-                                        'id'   => $field_id));
-
-      $search_fields->add(array_keys($server['search_fields']), array_values($server['search_fields']));
-      $out .= '<tr><td class="title"><label for="' . $field_id . '">' .
-              rep_specialchars_output(rcube_label('ldappublicsearchfield')) . 
-              "</label></td><td>" . $search_fields->show() . "</td></tr>\n";
-      
-      $attributes = array('name'  => '_ldap_public_search_type', 
-                          'id'    => 'rcmfd_ldap_public_search_type');
-
-      // if there's only one server, and it doesn't accept fuzzy searches,
-      // then check and disable the check box - thanks pieter
-      if ($server_count == 1 && !$server['fuzzy_search'])
-        {
-        $attributes['CHECKED'] = 'CHECKED'; 
-        $attributes['disabled'] = 'disabled'; 
-        }
-
-      $search_type = new checkbox($attributes);
-
-      $out .= '<tr id="ldap_fuzzy_search"><td class="title"><label for="rcmfd_ldap_public_search_type">' .
-              rep_specialchars_output(rcube_label('ldappublicsearchtype')) .
-              "</label></td><td>" . $search_type->show() . "</td></tr>\n";
-      }
-    
-    if ($server_count > 1)
-      {
-      // store the search fields in a js array for each server
-      $js = '';
-      foreach ($server['search_fields'] as $search_name => $search_value)
-        $js .= "['$search_name', '$search_value'], ";
-
-      // store whether this server accepts fuzzy search as last item in array
-      $js .= $server['fuzzy_search'] ? "'fuzzy'" : "'exact'";
-      $OUTPUT->add_script("rcmail.set_env('{$server_names[$i]}_search_fields', new Array($js));");
-      }
-    }
-
-  // add contact button label text
-  $OUTPUT->add_script("rcmail.set_env('addcontact', '" . rcube_label('addcontact') . "');");
-
-  $out .= "\n</table>$form_end";
-  return $out;  
-  }
-
-/**
- * get search values and return ldap contacts
- */
-function rcmail_ldap_public_list()
-  {
-  // just return if we are not being called from a search form
-  if (!isset($_POST['_action']))
-    return null;
-
-  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME;
-  
-  // show no search name warning and exit
-  if (empty($_POST['_ldap_public_search_name']) || trim($_POST['_ldap_public_search_name']) == '')
-    {
-    show_message('nosearchname', 'warning');
-    return false;
-    }
-  
-  // set up ldap server(s) array or bail
-  if ($_SESSION['ldap_public']['server_count'] > 1)
-    // show no ldap server warning and exit
-    if (empty($_POST['_ldap_public_servers']))
-      {
-      show_message('noldappublicserver', 'warning');
-      return false;
-      }
-    else
-      $server_name = $_POST['_ldap_public_servers'];
-  else if ($_SESSION['ldap_public']['server_count'] == 1)
-    $server_name = $_SESSION['ldap_public']['server_names'][0];
-  else
-    return false;
-
-  // get search parameters
-  $search_value = $_POST['_ldap_public_search_name'];
-  $search_field = $_POST['_ldap_public_search_field'];
-
-  // only use the post var for search type if the ldap server allows 'like'
-  $exact = true;
-  if ($CONFIG['ldap_public'][$server_name]['fuzzy_search'])
-    $exact = isset($_POST['_ldap_public_search_type']) ? true : false; 
-  
-  // perform an ldap search
-  $contacts = rcmail_ldap_contact_search($search_value, 
-                                         $search_field, 
-                                         $CONFIG['ldap_public'][$server_name], 
-                                         $exact);
-  
-  // if no results, show a warning and return
-  if (!$contacts)
-    {
-    show_message('nocontactsreturned', 'warning');
-    return false;
-    }
-
-  // add id to message list table if not specified
-  if (!strlen($attrib['id']))
-    $attrib['id'] = 'ldapAddressList';
-  
-  // define table class
-  $attrib['class'] = 'records-table';
-  $attrib['cellspacing'] = 0;
-
-  // define list of cols to be displayed
-  $a_show_cols = array('name', 'email');
-
-  // create XHTML table  
-  $out = rcube_table_output($attrib, $contacts, $a_show_cols, 'row_id');
-
-  // set client env
-  $javascript = "$JS_OBJECT_NAME.gui_object('ldapcontactslist', '{$attrib['id']}');\n";
-  $OUTPUT->add_script($javascript);  
-  
-  return $out;  
-  }
-
-/**
- * perform search for contacts from given public ldap server
- */
-function rcmail_ldap_contact_search($search_value, $search_field, $server, $exact=true)
-  {
-  global $CONFIG;
-  
-  $attributes = array($server['name_field'], $server['mail_field']); 
-
-  $LDAP = new rcube_ldap();
-  if ($LDAP->connect($server['hosts'], $server['port'], $server['protocol']))
-    {
-    $filter = "$search_field=" . ($exact ? $search_value : "*$search_value*"); 
-    $result = $LDAP->search($server['base_dn'],
-                            $filter, 
-                            $attributes, 
-                            $server['scope'], 
-                            $sort=null);
-         
-    // add any results to contact array
-    if ($result['count'])
-      {
-      for ($n = 0; $n < $result['count']; $n++)
-        {
-        $contacts[$n]['name']   = $result[$n][$server['name_field']][0];
-        $contacts[$n]['email']  = $result[$n][$server['mail_field']][0];
-        $contacts[$n]['row_id'] = $n + 1;
-        }
-      }
-    }
-  else
-    return false;
-
-  // cleanup
-  $LDAP->close();
-
-  if (!$result['count'])
-    return false;
-  // weed out duplicate emails
-  for ($n = 0; $n < $result['count']; $n++)
-    for ($i = 0; $i < $result['count']; $i++)
-      if ($contacts[$i]['email'] == $contacts[$n]['email'] && $i != $n)
-        unset($contacts[$n]);
-
-  return $contacts;
-  }
-
-function get_form_tags($attrib)
-  {
-  global $OUTPUT, $JS_OBJECT_NAME, $EDIT_FORM, $SESS_HIDDEN_FIELD;  
-
-  $form_start = '';
-  if (!strlen($EDIT_FORM))
-    {
-    $hiddenfields = new hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task']));
-    $hiddenfields->add(array('name' => '_action', 'value' => 'ldappublicsearch'));
-    
-    if ($_framed)
-      $hiddenfields->add(array('name' => '_framed', 'value' => 1));
-    
-    $form_start .= !strlen($attrib['form']) ? '<form name="form" action="./" method="post">' : '';
-    $form_start .= "\n$SESS_HIDDEN_FIELD\n";
-    $form_start .= $hiddenfields->show();
-    }
-    
-  $form_end = (strlen($EDIT_FORM) && !strlen($attrib['form'])) ? '</form>' : '';
-  $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
-  
-  $OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('ldappublicsearchform', '$form_name');");
-  
-  $EDIT_FORM = $form_name;
-
-  return array($form_start, $form_end);  
-  }
-
-parse_template('ldappublicsearch');
-?>
index 78a69c48e9f683b28e0c5d7b1938772a3d68eec1..41cc6eddce4754e69b989e10dfe8d3023a697e37 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/addressbook/list.inc                                    |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: list.inc 88 2005-12-03 16:54:12Z roundcube $
+ $Id: list.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
-$REMOTE_REQUEST = TRUE;
-
-// count contacts for this user
-$sql_result = $DB->query("SELECT COUNT(contact_id) AS rows
-                          FROM ".get_table_name('contacts')."
-                          WHERE  del<>1
-                          AND    user_id=?",
-                          $_SESSION['user_id']);
-                                   
-$sql_arr = $DB->fetch_assoc($sql_result);
-$rowcount = $sql_arr['rows'];    
+// get contacts for this user
+$result = $CONTACTS->list_records();
 
 // update message count display
-$pages = ceil($rowcount/$CONFIG['pagesize']);
-$commands = sprintf("this.set_rowcount('%s');\n", rcmail_get_rowcount_text($rowcount));
-$commands .= sprintf("this.set_env('pagecount', %d);\n", $pages);
-
-$start_row = ($CONTACTS_LIST['page']-1) * $CONFIG['pagesize'];
+$OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size));
+$OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($rowcount));
 
-// get contacts from DB
-$sql_result = $DB->limitquery("SELECT * FROM ".get_table_name('contacts')."
-                               WHERE  del<>1
-                               AND    user_id=?
-                               ORDER BY name",
-                               $start_row,
-                               $CONFIG['pagesize'],
-                               $_SESSION['user_id']);
-                                 
-$commands .= rcmail_js_contacts_list($sql_result);
+// create javascript list
+rcmail_js_contacts_list($result);
   
 // send response
-rcube_remote_response($commands);
+$OUTPUT->send();
 
-exit;
 ?>
\ No newline at end of file
diff --git a/program/steps/addressbook/mailto.inc b/program/steps/addressbook/mailto.inc
new file mode 100644 (file)
index 0000000..27217e5
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/addressbook/mailto.inc                                  |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2007, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Compose a recipient list with all selected contacts                 |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com>                        |
+ +-----------------------------------------------------------------------+
+
+ $Id: copy.inc 471 2007-02-09 21:25:50Z thomasb $
+
+*/
+
+$cid = get_input_value('_cid', RCUBE_INPUT_GET);
+$recipients = null;
+$mailto = array();
+
+if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && $CONTACTS->ready)
+{
+  $recipients = $CONTACTS->search($CONTACTS->primary_key, $cid);
+
+  while (is_object($recipients) && ($rec = $recipients->iterate()))
+    $mailto[] = format_email_recipient($rec['email'], $rec['name']);
+}
+
+if (!empty($mailto))
+{
+  $mailto_str = join(', ', $mailto);
+  $mailto_id = substr(md5($mailto_str), 0, 16);
+  $_SESSION['mailto'][$mailto_id] = $mailto_str;
+  $OUTPUT->command('redirect', rcmail_url('compose', array('_mailto' => $mailto_id), 'mail'));
+}
+else
+  $OUTPUT->show_message('nocontactsfound', 'warning');
+
+
+// send response
+$OUTPUT->send();
+
+?>
\ No newline at end of file
index 1627d0727eace9ff3b4d245154f4f5df3cd6d8bb..5a65d864b5e5bf298e02b024b343241c82dcb62c 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/addressbook/save.inc                                    |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: save.inc 159 2006-03-03 16:34:35Z roundcube $
+ $Id: save.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
+// cannot edit record
+if ($CONTACTS->readonly)
+{
+  $OUTPUT->show_message('contactreadonly', 'error');
+  rcmail_overwrite_action(empty($_POST['_cid']) ? 'add' : 'show');
+  return;
+}
+
 // check input
-if ((empty($_POST['_name']) || empty($_POST['_email'])) && empty($_GET['_framed']))
-  {
-  show_message('formincomplete', 'warning');
+if ((!get_input_value('_name', RCUBE_INPUT_POST) || !get_input_value('_email', RCUBE_INPUT_POST)) && $_framed)
+{
+  $OUTPUT->show_message('formincomplete', 'warning');
   rcmail_overwrite_action(empty($_POST['_cid']) ? 'add' : 'show');
   return;
-  }
+}
+
 
 // setup some vars we need
 $a_save_cols = array('name', 'firstname', 'surname', 'email');
-$contacts_table = get_table_name('contacts');
+$a_record = array();
+$cid = get_input_value('_cid', RCUBE_INPUT_POST);
+
+// read POST values into hash array
+foreach ($a_save_cols as $col)
+{
+  $fname = '_'.$col;
+  if (isset($_POST[$fname]))
+    $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);
+}
 
 // update an existing contact
-if (!empty($_POST['_cid']))
+if (!empty($cid))
+{
+  if ($CONTACTS->update($cid, $a_record))
   {
-  $a_write_sql = array();
-
-  foreach ($a_save_cols as $col)
-    {
-    $fname = '_'.$col;
-    if (!isset($_POST[$fname]))
-      continue;
-    
-    $a_write_sql[] = sprintf("%s=%s",
-                             $DB->quoteIdentifier($col),
-                             $DB->quote(get_input_value($fname, RCUBE_INPUT_POST)));
-    }
-
-  if (sizeof($a_write_sql))
-    {
-    $DB->query("UPDATE $contacts_table
-                SET    changed=now(), ".join(', ', $a_write_sql)."
-                WHERE  contact_id=?
-                AND    user_id=?
-                AND    del<>1",
-                $_POST['_cid'],
-                $_SESSION['user_id']);
-                       
-    $updated = $DB->affected_rows();
-    }
-       
-  if ($updated)
-    {
-    $_action = 'show';
-    show_message('successfullysaved', 'confirmation');    
-    
     if ($_framed)
-      {
+    {
       // define list of cols to be displayed
-      $a_show_cols = array('name', 'email');
       $a_js_cols = array();
-  
-      $sql_result = $DB->query("SELECT * FROM $contacts_table
-                                WHERE  contact_id=?
-                                AND    user_id=?
-                                AND    del<>1",
-                               $_POST['_cid'],
-                               $_SESSION['user_id']);
-                         
-      $sql_arr = $DB->fetch_assoc($sql_result);
-      foreach ($a_show_cols as $col)
-        $a_js_cols[] = (string)$sql_arr[$col];
+      $record = $CONTACTS->get_record($cid, true);
 
-      // update the changed col in list
-      $OUTPUT->add_script(sprintf("if(parent.%s)parent.%s.update_contact_row('%d', %s);",
-                          $JS_OBJECT_NAME,
-                          $JS_OBJECT_NAME,
-                          $_POST['_cid'],
-                          array2js($a_js_cols)));
+      foreach (array('name', 'email') as $col)
+        $a_js_cols[] = (string)$record[$col];
 
-      // show confirmation
-      show_message('successfullysaved', 'confirmation');
-      }
+      // update the changed col in list
+      $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols);
     }
+      
+    // show confirmation
+    $OUTPUT->show_message('successfullysaved', 'confirmation');    
+    rcmail_overwrite_action('show');
+  }
   else
-    {
+  {
     // show error message
-    show_message('errorsaving', 'error');
+    $OUTPUT->show_message('errorsaving', 'error');
     rcmail_overwrite_action('show');
-    }
   }
+}
 
 // insert a new contact
 else
-  {
-  $a_insert_cols = $a_insert_values = array();
-
+{
   // check for existing contacts
-  $sql = "SELECT 1 FROM $contacts_table
-          WHERE  user_id = {$_SESSION['user_id']}
-          AND del <> '1' ";
-
-  // get email and name, build sql for existing user check
-  if (isset($_GET['_emails']) && isset($_GET['_names']))
-    {
-    $sql   .= "AND email IN (";
-    $emails = explode(',', get_input_value('_emails', RCUBE_INPUT_GET));
-    $names  = explode(',', get_input_value('_names', RCUBE_INPUT_GET));
-    $count  = count($emails);
-    $n = 0;
-    foreach ($emails as $email)
-      {
-      $end  = (++$n == $count) ? '' : ',';
-      $sql .= $DB->quote($email) . $end;
-      }
-    $sql .= ")";
-    $ldap_form = true; 
-    }
-  else if (isset($_POST['_email'])) 
-    $sql  .= "AND email = " . $DB->quote(get_input_value('_email', RCUBE_INPUT_POST));
-
-  $sql_result = $DB->query($sql);
-
+  $existing = $CONTACTS->search('email', $a_record['email'], false);
+  
   // show warning message
-  if ($DB->num_rows($sql_result))
-    {
-    show_message('contactexists', 'warning');
-
-    if ($ldap_form)
-      rcmail_overwrite_action('ldappublicsearch');
-    else
-      rcmail_overwrite_action('add');
-
+  if ($existing->count)
+  {
+    $OUTPUT->show_message('contactexists', 'warning');
+    rcmail_overwrite_action('add');
     return;
-    }
+  }
 
-  if ($ldap_form)
-    {
-    $n = 0; 
-    foreach ($emails as $email) 
-      {
-      $DB->query("INSERT INTO $contacts_table 
-                 (user_id, name, email
-                 VALUES ({$_SESSION['user_id']}," . $DB->quote($names[$n++]) . "," . 
-                                      $DB->quote($email) . ")");
-      $insert_id[] = $DB->insert_id();
-      }
-    }
-  else
-    {
-    foreach ($a_save_cols as $col)
-      {
-      $fname = '_'.$col;
-      if (!isset($_POST[$fname]))
-        continue;
-    
-      $a_insert_cols[] = $col;
-      $a_insert_values[] = $DB->quote(get_input_value($fname, RCUBE_INPUT_POST));
-      }
-    
-    if (sizeof($a_insert_cols))
-      {
-      $DB->query("INSERT INTO $contacts_table
-                (user_id, changed, del, ".join(', ', $a_insert_cols).")
-                VALUES (?, now(), 0, ".join(', ', $a_insert_values).")",
-                $_SESSION['user_id']);
-                       
-      $insert_id = $DB->insert_id(get_sequence_name('contacts'));
-      }
-    }
-    
-  if ($insert_id)
+  // insert record and send response
+  if ($insert_id = $CONTACTS->insert($a_record))
+  {
+    if ($_framed)
     {
-    if (!$ldap_form)
-      {
-      $_action = 'show';
-      $_GET['_cid'] = $insert_id;
-
-      if ($_framed)
-        {
-        // add contact row or jump to the page where it should appear
-        $commands = sprintf("if(parent.%s)parent.", $JS_OBJECT_NAME);
-        $sql_result = $DB->query("SELECT * FROM $contacts_table
-                                  WHERE  contact_id=?
-                                  AND    user_id=?",
-                                  $insert_id,
-                                  $_SESSION['user_id']);
-        $commands .= rcmail_js_contacts_list($sql_result, $JS_OBJECT_NAME);
-
-        $commands .= sprintf("if(parent.%s)parent.%s.select('%d');\n",
-                             $JS_OBJECT_NAME, 
-                             $JS_OBJECT_NAME,
-                             $insert_id);
-      
-        // update record count display
-        $commands .= sprintf("if(parent.%s)parent.%s.set_rowcount('%s');\n",
-                             $JS_OBJECT_NAME, 
-                             $JS_OBJECT_NAME,
-                             rcmail_get_rowcount_text());
-
-        $OUTPUT->add_script($commands);
-        }
-
-      // show confirmation
-      show_message('successfullysaved', 'confirmation');      
-      }
-    else 
-      {
       // add contact row or jump to the page where it should appear
-      $commands = '';
-      foreach ($insert_id as $id) 
-        {
-        $sql_result = $DB->query("SELECT * FROM $contacts_table
-                                  WHERE  contact_id = $id
-                                  AND    user_id    = {$_SESSION['user_id']}");
-        
-        $commands .= sprintf("if(parent.%s)parent.", $JS_OBJECT_NAME);
-        $commands .= rcmail_js_contacts_list($sql_result, $JS_OBJECT_NAME);
-        $last_id = $id;
-        }
+      $CONTACTS->reset();
+      $result = $CONTACTS->search($CONTACTS->primary_key, $insert_id);
 
-      // display the last insert id
-      $commands .= sprintf("if(parent.%s)parent.%s.select('%d');\n",
-                            $JS_OBJECT_NAME, 
-                            $JS_OBJECT_NAME,
-                            $last_id);
+      rcmail_js_contacts_list($result, 'parent.');
+      $OUTPUT->command('parent.contact_list.select', $insert_id);
 
       // update record count display
-      $commands .= sprintf("if(parent.%s)parent.%s.set_rowcount('%s');\n",
-                           $JS_OBJECT_NAME, 
-                           $JS_OBJECT_NAME,
-                           rcmail_get_rowcount_text());
-
-      $OUTPUT->add_script($commands);
-      rcmail_overwrite_action('ldappublicsearch');
-      }
+      $CONTACTS->reset();
+      $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text());
+    }
 
     // show confirmation
-    show_message('successfullysaved', 'confirmation');      
-    }
+    $OUTPUT->show_message('successfullysaved', 'confirmation');
+    rcmail_overwrite_action('show');
+    $_GET['_cid'] = $insert_id;
+  }
   else
-    {
+  {
     // show error message
-    show_message('errorsaving', 'error');
+    $OUTPUT->show_message('errorsaving', 'error');
     rcmail_overwrite_action('add');
-    }
   }
+}
 
 ?>
diff --git a/program/steps/addressbook/search.inc b/program/steps/addressbook/search.inc
new file mode 100644 (file)
index 0000000..01233a0
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/addressbook/search.inc                                  |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Search step for address book contacts                               |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com>                        |
+ +-----------------------------------------------------------------------+
+
+ $Id: search.inc 456 2007-01-10 12:34:33Z thomasb $
+
+*/
+
+$CONTACTS->set_page(1);
+$_SESSION['page'] = 1;
+
+$search = trim(get_input_value('_q', RCUBE_INPUT_GET));
+$search_request = md5('addr'.$search);
+
+// get contacts for this user
+$result = $CONTACTS->search(array('name','email'), $search);
+
+if ($result->count > 0)
+{
+  // save search settings in session
+  $_SESSION['search'][$search_request] = $CONTACTS->get_search_set();
+  
+  // create javascript list
+  rcmail_js_contacts_list($result);
+}
+else
+{
+  $OUTPUT->show_message('nocontactsfound', 'warning');
+  $search_request = -1;
+}
+
+// update message count display
+$OUTPUT->set_env('search_request', $search_request);
+$OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size));
+$OUTPUT->command('set_rowcount', rcmail_get_rowcount_text());
+  
+// send response
+$OUTPUT->send();
+
+?>
\ No newline at end of file
index a779b6258eddb124aea2b45e3e950eca8770d703..c55025c9b2f5b5592dd15f1ad9c1c9b80b77ab3a 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/addressbook/show.inc                                    |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: show.inc 88 2005-12-03 16:54:12Z roundcube $
+ $Id: show.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
 
-if ($_GET['_cid'] || $_POST['_cid'])
-  {
-  $cid = $_POST['_cid'] ? $_POST['_cid'] : $_GET['_cid'];
-  $DB->query("SELECT * FROM ".get_table_name('contacts')."
-              WHERE  contact_id=?
-              AND    user_id=?
-              AND    del<>1",
-              $cid,
-              $_SESSION['user_id']);
-  
-  $CONTACT_RECORD = $DB->fetch_assoc();
-  
-  if (is_array($CONTACT_RECORD))
-    $OUTPUT->add_script(sprintf("%s.set_env('cid', '%s');", $JS_OBJECT_NAME, $CONTACT_RECORD['contact_id']));
-  }
-
+// read contact record
+if (($cid = get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true)))
+  $OUTPUT->set_env('cid', $record['ID']);
 
 
 function rcmail_contact_details($attrib)
   {
-  global $CONTACT_RECORD, $JS_OBJECT_NAME;
+  global $CONTACTS, $OUTPUT;
 
-  if (!$CONTACT_RECORD)
-    return show_message('contactnotfound');
+  // check if we have a valid result
+  if (!(($result = $CONTACTS->get_result()) && ($record = $result->first())))
+  {
+    $OUTPUT->show_message('contactnotfound');
+    return false;
+  }
   
   // a specific part is requested
   if ($attrib['part'])
-    return rep_specialchars_output($CONTACT_RECORD[$attrib['part']]);
-
+    return Q($record[$attrib['part']]);
 
   // return the complete address record as table
   $out = "<table>\n\n";
@@ -56,25 +46,28 @@ function rcmail_contact_details($attrib)
   $a_show_cols = array('name', 'firstname', 'surname', 'email');
   foreach ($a_show_cols as $col)
     {
-    if ($col=='email' && $CONTACT_RECORD[$col])
-      $value = sprintf('<a href="#compose" onclick="%s.command(\'compose\', %d)" title="%s">%s</a>',
-                       $JS_OBJECT_NAME,
-                       $CONTACT_RECORD['contact_id'],
-                       rcube_label('composeto'),
-                       $CONTACT_RECORD[$col]);
+    if ($col=='email' && !empty($record[$col]))
+      $value = sprintf(
+        '<a href="#compose" onclick="%s.command(\'compose\', \'%s\')" title="%s">%s</a>',
+        JS_OBJECT_NAME,
+        JQ($record[$col]),
+        rcube_label('composeto'),
+        Q($record[$col]));
     else
-      $value = rep_specialchars_output($CONTACT_RECORD[$col]);
+      $value = Q($record[$col]);
     
-    $title = rcube_label($col);
-    $out .= sprintf("<tr><td class=\"title\">%s</td><td>%s</td></tr>\n", $title, $value);
+    $out .= sprintf("<tr><td class=\"title\">%s</td><td>%s</td></tr>\n",
+                    Q(rcube_label($col)),
+                    $value);
     }
-
-
+  
   $out .= "\n</table>";
   
   return $out;  
   }
 
 
-parse_template('showcontact');
+//$OUTPUT->framed = $_framed;
+$OUTPUT->add_handler('contactdetails', 'rcmail_contact_details');
+$OUTPUT->send('showcontact');
 ?>
\ No newline at end of file
index 03dd32495d5c6a6408e9657fe92b32bdd8eafa54..54e1d392ca5338b9ff8daf14b991f25612568767 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: error.inc 50 2005-10-21 12:12:23Z roundcube $
+ $Id: error.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
@@ -53,7 +53,7 @@ else if ($ERROR_CODE==401)
 else if ($ERROR_CODE==404)
   {
   $__error_title = "REQUEST FAILED/FILE NOT FOUND";
-  $request_url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
+  $request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
   $__error_text  = <<<EOF
 The requested page was not found!<br />
 Please contact your server-administrator.
@@ -63,17 +63,26 @@ http://$request_url</p>
 EOF;
   }
 
+// database connection error
+else if ($ERROR_CODE==603)
+  {
+  $__error_title = "DATABASE ERROR: CONNECTION FAILED!";
+  $__error_text  =  <<<EOF
+Unable to connect to the database!<br /> 
+Please contact your server-administrator. 
+EOF;
+  }
 
 // system error
 else
   {
   $__error_title = "SERVICE CURRENTLY NOT AVAILABLE!";
   $__error_text  = "Please contact your server-administrator.";
-  
+
   if (($CONFIG['debug_level'] & 4) && $ERROR_MESSAGE)
     $__error_text = $ERROR_MESSAGE;
   else
-    $__error_text = 'Error No. '.dechex($ERROR_CODE).')';
+    $__error_text = sprintf('Error No. [0x%04X]', $ERROR_CODE);
   }
 
 
index afb327982528b3c98865fb82a84f274c09ecc842..e59dcbe2abf7ec31bba368ee79afa9d68d662c34 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/mail/addcontact.inc                                     |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: addcontact.inc 160 2006-03-03 16:36:22Z roundcube $
+ $Id: addcontact.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
-$REMOTE_REQUEST = TRUE;
+require_once('include/rcube_contacts.inc');
 
-if (!empty($_GET['_address']))
-  {
-  $contact_arr = $IMAP->decode_address_list(get_input_value('_address', RCUBE_INPUT_GET, TRUE));
-  if (sizeof($contact_arr))
-    {
-    $contact = $contact_arr[1];
-
-    if ($contact['mailto'])
-      $sql_result = $DB->query("SELECT 1 FROM ".get_table_name('contacts')."
-                                WHERE  user_id=?
-                                AND    email=?
-                                AND    del<>1",
-                                $_SESSION['user_id'],$contact['mailto']);
-
-    // contact entry with this mail address exists
-    if ($sql_result && $DB->num_rows($sql_result))
-      $existing_contact = TRUE;
-
-    else if ($contact['mailto'])
-      {
-      $DB->query("INSERT INTO ".get_table_name('contacts')."
-                  (user_id, changed, del, name, email)
-                  VALUES (?, now(), 0, ?, ?)",
-                  $_SESSION['user_id'],
-                  $contact['name'],
-                  $contact['mailto']);
+$done = false;
 
-      $added = $DB->insert_id(get_sequence_name('contacts'));
-      }
-    }
-
-  if ($added)
-    $commands = show_message('addedsuccessfully', 'confirmation');
-  else if ($existing_contact)
-    $commands = show_message('contactexists', 'warning');
+if (!empty($_POST['_address']))
+{
+  $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']);
+  $contact_arr = $IMAP->decode_address_list(get_input_value('_address', RCUBE_INPUT_POST, true), 1, false);
+  
+  if (!empty($contact_arr[1]['mailto']))
+  {
+    $contact = array(
+      'email' => $contact_arr[1]['mailto'],
+      'name' => $contact_arr[1]['name']
+    );
+    
+    // use email address part for name
+    if (empty($contact['name']) || $contact['name'] == $contact['email'])
+      $contact['name'] = ucfirst(preg_replace('/[\.\-]/', ' ', substr($contact['email'], 0, strpos($contact['email'], '@'))));
+
+    // check for existing contacts
+    $existing = $CONTACTS->search('email', $contact['email'], false);
+    if ($done = $existing->count)
+      $OUTPUT->show_message('contactexists', 'warning');
+    else if ($done = $CONTACTS->insert($contact))
+      $OUTPUT->show_message('addedsuccessfully', 'confirmation');
   }
+}
 
+if (!$done)
+  $OUTPUT->show_message('errorsavingcontact', 'warning');
 
-if (!$commands)
-  $commands = show_message('errorsavingcontact', 'warning');
-
-rcube_remote_response($commands);  
-exit;
+$OUTPUT->send();
 ?>
\ No newline at end of file
index 5846699e76fcbaf503ddbcf18b10ed56cde2ee29..119d481aba7edb9e66c8fc11bddcd8352e13bf73 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/mail/check_recent.inc                                   |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -19,8 +19,6 @@
 
 */
 
-$REMOTE_REQUEST = TRUE;
-
 $a_mailboxes = $IMAP->list_mailboxes();
 
 foreach ($a_mailboxes as $mbox_name)
@@ -29,13 +27,13 @@ foreach ($a_mailboxes as $mbox_name)
     {
     if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE))
       {
-      $count = $IMAP->messagecount();
+      $count = $IMAP->messagecount(NULL, 'ALL', TRUE);
       $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE);
 
-      $commands .= sprintf("this.set_unread_count('%s', %d);\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());
+      $OUTPUT->set_env('messagecount', $count);
+      $OUTPUT->command('set_unread_count', $mbox_name, $unread_count);
+      $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text());
+      $OUTPUT->command('set_quota', $IMAP->get_quota());
 
       // add new message headers to list
       $a_headers = array();
@@ -46,15 +44,16 @@ foreach ($a_mailboxes as $mbox_name)
           $a_headers[] = $header;
         }
 
-      $commands .= rcmail_js_message_list($a_headers, TRUE);
+      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'));
+      $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'));
     }
   }
 
-rcube_remote_response($commands);
+$OUTPUT->send();
+
 ?>
index bab8d3d509e552b3fd5b6120416128f2fca30f74..3464d55e6fd59e2ef81e9c100a80fb54f7433276 100644 (file)
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: compose.inc 297 2006-08-06 15:55:11Z thomasb $
+ $Id: compose.inc 579 2007-05-18 13:11:22Z thomasb $
 
 */
 
-
 require_once('Mail/mimeDecode.php');
+require_once('lib/html2text.inc');
+
+// define constants for message compose mode
+define('RCUBE_COMPOSE_REPLY', 0x0106);
+define('RCUBE_COMPOSE_FORWARD', 0x0107);
+define('RCUBE_COMPOSE_DRAFT', 0x0108);
+
 
 // remove an attachment
-if ($_action=='remove-attachment' && preg_match('/^rcmfile([0-9]+)$/', $_GET['_file'], $regs))
+if ($_action=='remove-attachment' && preg_match('/^rcmfile([0-9]+)$/', $_POST['_file'], $regs))
   {
   $id = $regs[1];
   if (is_array($_SESSION['compose']['attachments'][$id]))
     {
     @unlink($_SESSION['compose']['attachments'][$id]['path']);
     $_SESSION['compose']['attachments'][$id] = NULL;
-    $commands = sprintf("parent.%s.remove_from_attachment_list('rcmfile%d');\n", $JS_OBJECT_NAME, $id);
-    rcube_remote_response($commands);  
+    $OUTPUT->command('remove_from_attachment_list', "rcmfile$id");
+    $OUTPUT->send();
     exit;
     }
   }
 
+// this version does not support HTML mails
+$CONFIG['htmleditor'] = false;
 
 $MESSAGE_FORM = NULL;
-$REPLY_MESSAGE = NULL;
-$FORWARD_MESSAGE = NULL;
-$DRAFT_MESSAGE = NULL;
+$MESSAGE = NULL;
 
-// nothing below is called during message composition, only at "new/forward/reply/draft" initialization
-// since there are many ways to leave the compose page improperly, it seems necessary to clean-up an old
+// Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or
+// if a compose-ID is given (i.e. when the compose step is opened in a new window/tab).
+// Since there are many ways to leave the compose page improperly, it seems necessary to clean-up an old
 // compose when a "new/forward/reply/draft" is called - otherwise the old session attachments will appear
 
-rcmail_compose_cleanup();
-$_SESSION['compose'] = array('id' => uniqid(rand()));
+if (!is_array($_SESSION['compose']) || $_SESSION['compose']['id'] != get_input_value('_id', RCUBE_INPUT_GET))
+  {
+  rcmail_compose_cleanup();
+  $_SESSION['compose'] = array('id' => uniqid(rand()));
+  }
 
 // add some labels to client
-rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved');
+rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved', 'converting');
 
+// add config parameter to client script
+$OUTPUT->set_env('draft_autosave', !empty($CONFIG['drafts_mbox']) ? $CONFIG['draft_autosave'] : 0);
 
-if ($_GET['_reply_uid'] || $_GET['_forward_uid'] || $_GET['_draft_uid'])
-  {
-  $msg_uid = ($_GET['_reply_uid'] ? $_GET['_reply_uid'] : ($_GET['_forward_uid'] ? $_GET['_forward_uid'] : $_GET['_draft_uid']));
 
-  // similar as in program/steps/mail/show.inc
-  $MESSAGE = array();
-  $MESSAGE['headers'] = $IMAP->get_headers($msg_uid);
-  
-  $MESSAGE['source'] = rcmail_message_source($msg_uid);
-  
-  $mmd = new Mail_mimeDecode($MESSAGE['source']);
-  $MESSAGE['structure'] = $mmd->decode(array('include_bodies' => TRUE,
-                                             'decode_headers' => TRUE,
-                                             'decode_bodies' => FALSE));
+// get reference message and set compose mode
+if ($msg_uid = get_input_value('_reply_uid', RCUBE_INPUT_GET))
+  $compose_mode = RCUBE_COMPOSE_REPLY;
+else if ($msg_uid = get_input_value('_forward_uid', RCUBE_INPUT_GET))
+  $compose_mode = RCUBE_COMPOSE_FORWARD;
+else if ($msg_uid = get_input_value('_draft_uid', RCUBE_INPUT_GET))
+  $compose_mode = RCUBE_COMPOSE_DRAFT;
 
-  $MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject);
-  $MESSAGE['parts'] = $mmd->getMimeNumbers($MESSAGE['structure']);
 
-  if ($_GET['_reply_uid'])
+if (!empty($msg_uid))
+  {
+  // similar as in program/steps/mail/show.inc
+  $MESSAGE = array('UID' => $msg_uid);
+  $MESSAGE['headers'] = &$IMAP->get_headers($msg_uid);
+  $MESSAGE['structure'] = &$IMAP->get_structure($msg_uid);  
+  $MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject);
+  $MESSAGE['parts'] = $IMAP->get_mime_numbers($MESSAGE['structure']);
+  
+  if ($compose_mode == RCUBE_COMPOSE_REPLY)
     {
-    $REPLY_MESSAGE = &$MESSAGE;
-    $_SESSION['compose']['reply_uid'] = $_GET['_reply_uid'];
-    $_SESSION['compose']['reply_msgid'] = $REPLY_MESSAGE['headers']->messageID;
-    $_SESSION['compose']['references']  = $REPLY_MESSAGE['headers']->reference;
-    $_SESSION['compose']['references'] .= !empty($REPLY_MESSAGE['headers']->reference) ? ' ' : '';
-    $_SESSION['compose']['references'] .= $REPLY_MESSAGE['headers']->messageID;
-
-    if ($_GET['_all'])
-      $REPLY_MESSAGE['reply_all'] = 1;
-
+    $_SESSION['compose']['reply_uid'] = $msg_uid;
+    $_SESSION['compose']['reply_msgid'] = $MESSAGE['headers']->messageID;
+    $_SESSION['compose']['references']  = $MESSAGE['headers']->reference;
+    $_SESSION['compose']['references'] .= !empty($MESSAGE['headers']->reference) ? ' ' : '';
+    $_SESSION['compose']['references'] .= $MESSAGE['headers']->messageID;
+
+    if (!empty($_GET['_all']))
+      $MESSAGE['reply_all'] = 1;
     }
-  else if ($_GET['_forward_uid'])
+  else if ($compose_mode == RCUBE_COMPOSE_FORWARD)
     {
-    $FORWARD_MESSAGE = $MESSAGE;
-    $_SESSION['compose']['forward_uid'] = $_GET['_forward_uid'];
+    $_SESSION['compose']['forward_uid'] = $msg_uid;
     }
-  else
+  else if ($compose_mode == RCUBE_COMPOSE_DRAFT)
     {
-    $DRAFT_MESSAGE = $MESSAGE;
-    $_SESSION['compose']['draft_uid'] = $_GET['_draft_uid'];
+    $_SESSION['compose']['draft_uid'] = $msg_uid;
     }
 
   }
@@ -102,7 +111,7 @@ if ($_GET['_reply_uid'] || $_GET['_forward_uid'] || $_GET['_draft_uid'])
 
 function rcmail_compose_headers($attrib)
   {
-  global $IMAP, $REPLY_MESSAGE, $DRAFT_MESSAGE, $DB;
+  global $IMAP, $MESSAGE, $DB, $compose_mode;
   static $sa_recipients = array();
 
   list($form_start, $form_end) = get_form_tags($attrib);
@@ -118,26 +127,12 @@ function rcmail_compose_headers($attrib)
     case 'to':
       $fname = '_to';
       $header = 'to';
-
-      // we have contact id's as get parameters
-      if (!empty($_GET['_to']) && preg_match('/^[0-9]+(,[0-9]+)*$/', $_GET['_to']))
-        {
-        $a_recipients = array();
-        $sql_result = $DB->query("SELECT name, email
-                                  FROM ".get_table_name('contacts')."
-                                  WHERE user_id=?
-                                  AND    del<>1
-                                  AND    contact_id IN (".$_GET['_to'].")",
-                                  $_SESSION['user_id']);
-                                         
-        while ($sql_arr = $DB->fetch_assoc($sql_result))
-          $a_recipients[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
-          
-        if (sizeof($a_recipients))
-          $fvalue = join(', ', $a_recipients);
-        }
+      
+      // we have a set of recipients stored is session
+      if (($mailto_id = get_input_value('_mailto', RCUBE_INPUT_GET)) && $_SESSION['mailto'][$mailto_id])
+        $fvalue = $_SESSION['mailto'][$mailto_id];
       else if (!empty($_GET['_to']))
-        $fvalue = $_GET['_to'];
+        $fvalue = get_input_value('_to', RCUBE_INPUT_GET);
         
     case 'cc':
       if (!$fname)
@@ -147,7 +142,10 @@ function rcmail_compose_headers($attrib)
         }
     case 'bcc':
       if (!$fname)
+        {
         $fname = '_bcc';
+        $header = 'bcc';
+        }
         
       $allow_attrib = array('id', 'class', 'style', 'cols', 'rows', 'wrap', 'tabindex');
       $field_type = 'textarea';            
@@ -164,28 +162,24 @@ function rcmail_compose_headers($attrib)
  
   if ($fname && !empty($_POST[$fname]))
     $fvalue = get_input_value($fname, RCUBE_INPUT_POST, TRUE);
-  else if ($header && is_object($REPLY_MESSAGE['headers']))
+
+  else if ($header && $compose_mode == RCUBE_COMPOSE_REPLY)
     {
     // get recipent address(es) out of the message headers
-    if ($header=='to' && $REPLY_MESSAGE['headers']->replyto)
-      $fvalue = $IMAP->decode_header($REPLY_MESSAGE['headers']->replyto);
+    if ($header=='to' && !empty($MESSAGE['headers']->replyto))
+      $fvalue = $MESSAGE['headers']->replyto;
 
-    else if ($header=='to' && $REPLY_MESSAGE['headers']->from)
-      $fvalue = $IMAP->decode_header($REPLY_MESSAGE['headers']->from);
+    else if ($header=='to' && !empty($MESSAGE['headers']->from))
+      $fvalue = $MESSAGE['headers']->from;
 
     // add recipent of original message if reply to all
-    else if ($header=='cc' && $REPLY_MESSAGE['reply_all'])
+    else if ($header=='cc' && !empty($MESSAGE['reply_all']))
       {
-      if ($IMAP->decode_header($REPLY_MESSAGE['headers']->to))
-        $fvalue .= $IMAP->decode_header($REPLY_MESSAGE['headers']->to);
-
-      if ($IMAP->decode_header($REPLY_MESSAGE['headers']->cc))
-        {
-        if($fvalue)
-          $fvalue .= ', ';
+      if ($v = $MESSAGE['headers']->to)
+        $fvalue .= $v;
 
-        $fvalue .= $IMAP->decode_header($REPLY_MESSAGE['headers']->cc);
-        }
+      if ($v = $MESSAGE['headers']->cc)
+        $fvalue .= (!empty($fvalue) ? ', ' : '') . $v;
       }
 
     // split recipients and put them back together in a unique way
@@ -195,7 +189,7 @@ function rcmail_compose_headers($attrib)
       $fvalue = '';
       foreach ($to_addresses as $addr_part)
         {
-        if (!in_array($addr_part['mailto'], $sa_recipients) && (!$REPLY_MESSAGE['FROM'] || !in_array($addr_part['mailto'], $REPLY_MESSAGE['FROM'])))
+        if (!empty($addr_part['mailto']) && !in_array($addr_part['mailto'], $sa_recipients) && (!$MESSAGE['FROM'] || !in_array($addr_part['mailto'], $MESSAGE['FROM'])))
           {
           $fvalue .= (strlen($fvalue) ? ', ':'').$addr_part['string'];
           $sa_recipients[] = $addr_part['mailto'];
@@ -203,18 +197,17 @@ function rcmail_compose_headers($attrib)
         }
       }
     }
-  else if ($header && is_object($DRAFT_MESSAGE['headers']))
+  else if ($header && $compose_mode == RCUBE_COMPOSE_DRAFT)
     {
     // get drafted headers
-    if ($header=='to' && $DRAFT_MESSAGE['headers']->to)
-      $fvalue = $IMAP->decode_header($DRAFT_MESSAGE['headers']->to);
-
-    if ($header=='cc' && $DRAFT_MESSAGE['headers']->cc)
-      $fvalue = $IMAP->decode_header($DRAFT_MESSAGE['headers']->cc);
+    if ($header=='to' && !empty($MESSAGE['headers']->to))
+      $fvalue = $IMAP->decode_header($MESSAGE['headers']->to);
 
-    if ($header=='bcc' && $DRAFT_MESSAGE['headers']->bcc)
-      $fvalue = $IMAP->decode_header($DRAFT_MESSAGE['headers']->bcc);
+    if ($header=='cc' && !empty($MESSAGE['headers']->cc))
+      $fvalue = $IMAP->decode_header($MESSAGE['headers']->cc);
 
+    if ($header=='bcc' && !empty($MESSAGE['headers']->bcc))
+      $fvalue = $IMAP->decode_header($MESSAGE['headers']->bcc);
     }
 
         
@@ -241,7 +234,7 @@ function rcmail_compose_headers($attrib)
 
 function rcmail_compose_header_from($attrib)
   {
-  global $IMAP, $REPLY_MESSAGE, $DRAFT_MESSAGE, $DB, $OUTPUT, $JS_OBJECT_NAME;
+  global $IMAP, $MESSAGE, $DB, $OUTPUT, $compose_mode;
     
   // pass the following attributes to the form class
   $field_attrib = array('name' => '_from');
@@ -251,20 +244,20 @@ function rcmail_compose_header_from($attrib)
 
   // extract all recipients of the reply-message
   $a_recipients = array();
-  if ($REPLY_MESSAGE && is_object($REPLY_MESSAGE['headers']))
+  if ($compose_mode == RCUBE_COMPOSE_REPLY && is_object($MESSAGE['headers']))
     {
-    $REPLY_MESSAGE['FROM'] = array();
+    $MESSAGE['FROM'] = array();
 
-    $a_to = $IMAP->decode_address_list($REPLY_MESSAGE['headers']->to);        
+    $a_to = $IMAP->decode_address_list($MESSAGE['headers']->to);
     foreach ($a_to as $addr)
       {
       if (!empty($addr['mailto']))
         $a_recipients[] = $addr['mailto'];
       }
 
-    if (!empty($REPLY_MESSAGE['headers']->cc))
+    if (!empty($MESSAGE['headers']->cc))
       {
-      $a_cc = $IMAP->decode_address_list($REPLY_MESSAGE['headers']->cc);
+      $a_cc = $IMAP->decode_address_list($MESSAGE['headers']->cc);
       foreach ($a_cc as $addr)
         {
         if (!empty($addr['mailto']))
@@ -274,50 +267,58 @@ function rcmail_compose_header_from($attrib)
     }
 
   // get this user's identities
-  $sql_result = $DB->query("SELECT identity_id, name, email, signature
+  $sql_result = $DB->query("SELECT identity_id, name, email, signature, html_signature
                             FROM   ".get_table_name('identities')."
                             WHERE user_id=?
                             AND    del<>1
                             ORDER BY ".$DB->quoteIdentifier('standard')." DESC, name ASC",
                            $_SESSION['user_id']);
-                                   
+
   if ($DB->num_rows($sql_result))
     {
     $from_id = 0;
     $a_signatures = array();
-    
-    $field_attrib['onchange'] = "$JS_OBJECT_NAME.change_identity(this)";
+
+    $field_attrib['onchange'] = JS_OBJECT_NAME.".change_identity(this)";
     $select_from = new select($field_attrib);
-    
+
     while ($sql_arr = $DB->fetch_assoc($sql_result))
       {
-      $select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $sql_arr['identity_id']);
+      $identity_id = $sql_arr['identity_id'];
+      $select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $identity_id);
 
       // add signature to array
       if (!empty($sql_arr['signature']))
-        $a_signatures[$sql_arr['identity_id']] = $sql_arr['signature'];
-      
+        {
+        $a_signatures[$identity_id]['text'] = $sql_arr['signature'];
+        $a_signatures[$identity_id]['is_html'] = ($sql_arr['html_signature'] == 1) ? true : false;
+        if ($a_signatures[$identity_id]['is_html'])
+          {
+            $h2t = new html2text($a_signatures[$identity_id]['text'], false, false);
+            $plainTextPart = $h2t->get_text();
+            $a_signatures[$identity_id]['plain_text'] = trim($plainTextPart);
+          }
+        }
+
       // set identity if it's one of the reply-message recipients
       if (in_array($sql_arr['email'], $a_recipients))
         $from_id = $sql_arr['identity_id'];
-        
-      if ($REPLY_MESSAGE && is_array($REPLY_MESSAGE['FROM']))
-        $REPLY_MESSAGE['FROM'][] = $sql_arr['email'];
 
-      if (strstr($DRAFT_MESSAGE['headers']->from,$sql_arr['email']))
-        $from_id = $sql_arr['identity_id'];
+      if ($compose_mode == RCUBE_COMPOSE_REPLY && is_array($MESSAGE['FROM']))
+        $MESSAGE['FROM'][] = $sql_arr['email'];
 
+      if ($compose_mode == RCUBE_COMPOSE_DRAFT && strstr($MESSAGE['headers']->from, $sql_arr['email']))
+        $from_id = $sql_arr['identity_id'];
       }
 
     // overwrite identity selection with post parameter
     if (isset($_POST['_from']))
-      $from_id = $_POST['_from'];
+      $from_id = get_input_value('_from', RCUBE_INPUT_POST);
 
     $out = $select_from->show($from_id);
-    
 
     // add signatures to client
-    $OUTPUT->add_script(sprintf("%s.set_env('signatures', %s);", $JS_OBJECT_NAME, array2js($a_signatures)));  
+    $OUTPUT->set_env('signatures', $a_signatures);
     }
   else
     {
@@ -335,78 +336,125 @@ function rcmail_compose_header_from($attrib)
 
 function rcmail_compose_body($attrib)
   {
-  global $CONFIG, $OUTPUT, $REPLY_MESSAGE, $FORWARD_MESSAGE, $DRAFT_MESSAGE, $JS_OBJECT_NAME;
+  global $CONFIG, $OUTPUT, $MESSAGE, $compose_mode;
   
   list($form_start, $form_end) = get_form_tags($attrib);
   unset($attrib['form']);
   
   if (empty($attrib['id']))
     $attrib['id'] = 'rcmComposeMessage';
-  
+
   $attrib['name'] = '_message';
-  $textarea = new textarea($attrib);
+
+  if ($CONFIG['htmleditor'])
+    $isHtml = true;
+  else
+    $isHtml = false;
 
   $body = '';
-  
+
   // use posted message body
   if (!empty($_POST['_message']))
+    {
     $body = get_input_value('_message', RCUBE_INPUT_POST, TRUE);
-    
+    }
   // compose reply-body
-  else if (is_array($REPLY_MESSAGE['parts']))
+  else if ($compose_mode == RCUBE_COMPOSE_REPLY)
     {
-    $body = rcmail_first_text_part($REPLY_MESSAGE['parts']);
-    if (strlen($body))
-      $body = rcmail_create_reply_body($body);
-    }
+    $hasHtml = rcmail_has_html_part($MESSAGE['parts']); 
+    if ($hasHtml && $CONFIG['htmleditor'])
+      {
+      $body = rcmail_first_html_part($MESSAGE);
+      $isHtml = true;
+      }
+    else
+      {
+      $body = rcmail_first_text_part($MESSAGE);
+      $isHtml = false;
+      }
 
+    $body = rcmail_create_reply_body($body, $isHtml);
+    }
   // forward message body inline
-  else if (is_array($FORWARD_MESSAGE['parts']))
+  else if ($compose_mode == RCUBE_COMPOSE_FORWARD)
     {
-    $body = rcmail_first_text_part($FORWARD_MESSAGE['parts']);
-    if (strlen($body))
-      $body = rcmail_create_forward_body($body);
-    }
+    $hasHtml = rcmail_has_html_part($MESSAGE['parts']);
+    if ($hasHtml && $CONFIG['htmleditor'])
+      {
+      $body = rcmail_first_html_part($MESSAGE);
+      $isHtml = true;
+      }
+    else
+      {
+      $body = rcmail_first_text_part($MESSAGE);
+      $isHtml = false;
+      }
 
-  // forward message body inline
-  else if (is_array($DRAFT_MESSAGE['parts']))
+    $body = rcmail_create_forward_body($body, $isHtml);
+    }
+  else if ($compose_mode == RCUBE_COMPOSE_DRAFT)
     {
-    $body = rcmail_first_text_part($DRAFT_MESSAGE['parts']);
-    if (strlen($body))
-      $body = rcmail_create_draft_body($body);
+    $hasHtml = rcmail_has_html_part($MESSAGE['parts']);
+    if ($hasHtml && $CONFIG['htmleditor'])
+      {
+      $body = rcmail_first_html_part($MESSAGE);
+      $isHtml = true;
+      }
+    else
+      {
+      $body = rcmail_first_text_part($MESSAGE);
+      $isHtml = false;
+      }
+
+    $body = rcmail_create_draft_body($body, $isHtml);
     }
-  
+
   $out = $form_start ? "$form_start\n" : '';
 
-  $saveid = new hiddenfield(array('name' => '_draft_saveid', 'value' => str_replace(array('<','>'),"",$DRAFT_MESSAGE['headers']->messageID) ));
+  $saveid = new hiddenfield(array('name' => '_draft_saveid', 'value' => $compose_mode==RCUBE_COMPOSE_DRAFT ? str_replace(array('<','>'), "", $MESSAGE['headers']->messageID) : ''));
   $out .= $saveid->show();
 
   $drafttoggle = new hiddenfield(array('name' => '_draft', 'value' => 'yes'));
   $out .= $drafttoggle->show();
 
+  $msgtype = new hiddenfield(array('name' => '_is_html', 'value' => ($isHtml?"1":"0")));
+  $out .= $msgtype->show();
+
+  // If desired, set this text area to be editable by TinyMCE
+  if ($isHtml)
+    $attrib['mce_editable'] = "true";
+  $textarea = new textarea($attrib);
   $out .= $textarea->show($body);
   $out .= $form_end ? "\n$form_end" : '';
-  
+
   // include GoogieSpell
-  if (!empty($CONFIG['enable_spellcheck']))
+  if (!empty($CONFIG['enable_spellcheck']) && !$isHtml)
     {
+    $lang_set = '';
+    if (!empty($CONFIG['spellcheck_languages']) && is_array($CONFIG['spellcheck_languages']))
+      $lang_set = "googie.setLanguages(".array2js($CONFIG['spellcheck_languages']).");\n";
+    
     $OUTPUT->include_script('googiespell.js');
-    $OUTPUT->add_script(sprintf("var googie = new GoogieSpell('\$__skin_path/images/googiespell/','%s&_action=spell&lang=');\n".
-                                "googie.lang_chck_spell = \"%s\";\n".
-                                "googie.lang_rsm_edt = \"%s\";\n".
-                                "googie.lang_close = \"%s\";\n".
-                                "googie.lang_revert = \"%s\";\n".
-                                "googie.lang_no_error_found = \"%s\";\n".
-                                "googie.decorateTextarea('%s');\n".
-                                "%s.set_env('spellcheck', googie);",
-                                $GLOBALS['COMM_PATH'],
-                                rep_specialchars_output(rcube_label('checkspelling')),
-                                rep_specialchars_output(rcube_label('resumeediting')),
-                                rep_specialchars_output(rcube_label('close')),
-                                rep_specialchars_output(rcube_label('revertto')),
-                                rep_specialchars_output(rcube_label('nospellerrors')),
-                                $attrib['id'],
-                                $JS_OBJECT_NAME), 'foot');
+    $OUTPUT->add_script(sprintf(
+      "var googie = new GoogieSpell('\$__skin_path/images/googiespell/','%s&_action=spell&lang=');\n".
+      "googie.lang_chck_spell = \"%s\";\n".
+      "googie.lang_rsm_edt = \"%s\";\n".
+      "googie.lang_close = \"%s\";\n".
+      "googie.lang_revert = \"%s\";\n".
+      "googie.lang_no_error_found = \"%s\";\n%s".
+      "googie.setCurrentLanguage('%s');\n".
+      "googie.decorateTextarea('%s');\n".
+      "%s.set_env('spellcheck', googie);",
+      $GLOBALS['COMM_PATH'],
+      JQ(Q(rcube_label('checkspelling'))),
+      JQ(Q(rcube_label('resumeediting'))),
+      JQ(Q(rcube_label('close'))),
+      JQ(Q(rcube_label('revertto'))),
+      JQ(Q(rcube_label('nospellerrors'))),
+      $lang_set,
+      substr($_SESSION['user_lang'], 0, 2),
+      $attrib['id'],
+      JS_OBJECT_NAME), 'foot');
 
     rcube_add_label('checking');
     }
@@ -417,151 +465,146 @@ function rcmail_compose_body($attrib)
   }
 
 
-function rcmail_create_reply_body($body)
+function rcmail_create_reply_body($body, $bodyIsHtml)
   {
-  global $IMAP, $REPLY_MESSAGE;
+  global $IMAP, $MESSAGE;
 
-  // soft-wrap message first
-  $body = wordwrap($body, 75);
+  if (! $bodyIsHtml)
+  {
+    // soft-wrap message first
+    $body = wordwrap($body, 75);
   
-  // split body into single lines
-  $a_lines = preg_split('/\r?\n/', $body);
+    // split body into single lines
+    $a_lines = preg_split('/\r?\n/', $body);
   
-  // add > to each line
-  for($n=0; $n<sizeof($a_lines); $n++)
-    {
-    if (strpos($a_lines[$n], '>')===0)
-      $a_lines[$n] = '>'.$a_lines[$n];
-    else
-      $a_lines[$n] = '> '.$a_lines[$n];
-    }
+    // add > to each line
+    for($n=0; $n<sizeof($a_lines); $n++)
+      {
+      if (strpos($a_lines[$n], '>')===0)
+        $a_lines[$n] = '>'.$a_lines[$n];
+      else
+        $a_lines[$n] = '> '.$a_lines[$n];
+      }
  
-  $body = join("\n", $a_lines);
+    $body = join("\n", $a_lines);
 
-  // add title line
-  $pefix = sprintf("\n\n\nOn %s, %s wrote:\n",
-           $REPLY_MESSAGE['headers']->date,
-           $IMAP->decode_header($REPLY_MESSAGE['headers']->from));
-           
+    // add title line
+    $prefix = sprintf("\n\n\nOn %s, %s wrote:\n",
+             $MESSAGE['headers']->date,
+             $IMAP->decode_header($MESSAGE['headers']->from));
 
-  // try to remove the signature
-  if ($sp = strrpos($body, '-- '))
-    {
-    if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r")
-      $body = substr($body, 0, $sp-1);
-    }
-
-  return $pefix.$body;
+    // try to remove the signature
+    if ($sp = strrstr($body, '-- '))
+      {
+      if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r")
+        $body = substr($body, 0, $sp-1);
+      }
+    $suffix = '';
   }
-
-
-function rcmail_create_forward_body($body)
+  else
   {
-  global $IMAP, $FORWARD_MESSAGE;
+     $prefix = sprintf("<br><br>On %s, %s wrote:<br><blockquote type=\"cite\" " .
+                       "style=\"padding-left: 5px; border-left: #1010ff 2px solid; " .
+                       "margin-left: 5px; width: 100%%\">",
+                       $MESSAGE['headers']->date,
+                       $IMAP->decode_header($MESSAGE['headers']->from));
 
-  // soft-wrap message first
-  $body = wordwrap($body, 80);
-  
-  $prefix = sprintf("\n\n\n-------- Original Message --------\nSubject: %s\nDate: %s\nFrom: %s\nTo: %s\n\n",
-                   $FORWARD_MESSAGE['subject'],
-                   $FORWARD_MESSAGE['headers']->date,
-                   $IMAP->decode_header($FORWARD_MESSAGE['headers']->from),
-                   $IMAP->decode_header($FORWARD_MESSAGE['headers']->to));
+     $suffix = "</blockquote>";
+  }
 
-  // add attachments
-  if (!isset($_SESSION['compose']['forward_attachments']) && is_array($FORWARD_MESSAGE['parts']) && sizeof($FORWARD_MESSAGE['parts'])>1)
-    {
-    $temp_dir = rcmail_create_compose_tempdir();
+  return $prefix.$body.$suffix;
+  }
 
-    if (!is_array($_SESSION['compose']['attachments']))
-      $_SESSION['compose']['attachments'] = array();
-  
-    foreach ($FORWARD_MESSAGE['parts'] as $part)
-      {
-      if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
-               (empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name'])))
-        {
-        $tmp_path = tempnam($temp_dir, 'rcmAttmnt');
-        if ($fp = fopen($tmp_path, 'w'))
-          {
-          fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']));
-          fclose($fp);
 
-          if ($part->d_parameters['filename'])
-            $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'],
-                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
-                                                          'path' => $tmp_path);
-                                   
-          else if ($part->ctype_parameters['name'])
-           $_SESSION['compose']['attachments'][] = array('name' => $part->ctype_parameters['name'],
-                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
-                                                          'path' => $tmp_path);
-                                                         
-          else if ($part->headers['content-description'])
-           $_SESSION['compose']['attachments'][] = array('name' => $part->headers['content-description'],
-                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
-                                                          'path' => $tmp_path);
-          }
-       }
-      }
+function rcmail_create_forward_body($body, $bodyIsHtml)
+  {
+  global $IMAP, $MESSAGE;
 
-    $_SESSION['compose']['forward_attachments'] = TRUE;
-    }
+  if (! $bodyIsHtml)
+  {
+    // soft-wrap message first
+    $body = wordwrap($body, 80);
+  
+    $prefix = sprintf("\n\n\n-------- Original Message --------\nSubject: %s\nDate: %s\nFrom: %s\nTo: %s\n\n",
+                     $MESSAGE['subject'],
+                     $MESSAGE['headers']->date,
+                     $IMAP->decode_header($MESSAGE['headers']->from),
+                     $IMAP->decode_header($MESSAGE['headers']->to));
+  }
+  else
+  {
+      $prefix = sprintf(
+        "<br><br>-------- Original Message --------" .
+        "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody>" .
+        "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">Subject: </th><td>%s</td></tr>" .
+        "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">Date: </th><td>%s</td></tr>" .
+        "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">From: </th><td>%s</td></tr>" .
+        "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">To: </th><td>%s</td></tr>" .
+        "</tbody></table><br>",
+                     Q($MESSAGE['subject']),
+                     Q($MESSAGE['headers']->date),
+                     Q($IMAP->decode_header($MESSAGE['headers']->from)),
+                     Q($IMAP->decode_header($MESSAGE['headers']->to)));
+  }
 
+  // add attachments
+  if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE['parts']))
+    rcmail_write_compose_attachments($MESSAGE);
+    
   return $prefix.$body;
   }
 
-function rcmail_create_draft_body($body)
+
+function rcmail_create_draft_body($body, $bodyIsHtml)
   {
-  global $IMAP, $DRAFT_MESSAGE;
+  global $IMAP, $MESSAGE;
     
   // add attachments
-  if (!isset($_SESSION['compose']['forward_attachments']) && is_array($DRAFT_MESSAGE['parts']) && sizeof($DRAFT_MESSAGE['parts'])>1)
-    { 
-    $temp_dir = rcmail_create_compose_tempdir();
+  if (!isset($_SESSION['compose']['forward_attachments']) &&
+      is_array($MESSAGE['parts']) && sizeof($MESSAGE['parts'])>1)
+    rcmail_write_compose_attachments($MESSAGE);
+
+  return $body;
+  }
+  
+  
+function rcmail_write_compose_attachments(&$message)
+  {
+  global $IMAP, $CONFIG;
+
+  $temp_dir = unslashify($CONFIG['temp_dir']);
 
-    if (!is_array($_SESSION['compose']['attachments']))
-      $_SESSION['compose']['attachments'] = array();
+  if (!is_array($_SESSION['compose']['attachments']))
+    $_SESSION['compose']['attachments'] = array();
   
-    foreach ($DRAFT_MESSAGE['parts'] as $part)
+  foreach ($message['parts'] as $pid => $part)
+    {
+    if ($part->ctype_primary != 'message' && $part->ctype_primary != 'text' &&
+        ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
+         (empty($part->disposition) && $part->filename)))
       {
-      if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
-               (empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name'])))
+      $tmp_path = tempnam($temp_dir, 'rcmAttmnt');
+      if ($fp = fopen($tmp_path, 'w'))
         {
-        $tmp_path = tempnam($temp_dir, 'rcmAttmnt');
-        if ($fp = fopen($tmp_path, 'w'))
-          {                     
-          fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']));
-          fclose($fp);          
-                                
-          if ($part->d_parameters['filename'])
-            $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'],
-                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
-                                                          'path' => $tmp_path);
-
-          else if ($part->ctype_parameters['name'])
-            $_SESSION['compose']['attachments'][] = array('name' => $part->ctype_parameters['name'],
-                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
-                                                          'path' => $tmp_path);
-
-          else if ($part->headers['content-description'])
-            $_SESSION['compose']['attachments'][] = array('name' => $part->headers['content-description'],
-                                                          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
-                                                          'path' => $tmp_path);
-          }
+        fwrite($fp, $IMAP->get_message_part($message['UID'], $pid, $part->encoding));
+        fclose($fp);
+        
+        $_SESSION['compose']['attachments'][] = array(
+          'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
+          'name' => $part->filename,
+          'path' => $tmp_path
+          );
         }
       }
-
-    $_SESSION['compose']['forward_attachments'] = TRUE;
     }
-
-  return $body;
+       
+  $_SESSION['compose']['forward_attachments'] = TRUE;
   }
 
 
 function rcmail_compose_subject($attrib)
   {
-  global $CONFIG, $REPLY_MESSAGE, $FORWARD_MESSAGE, $DRAFT_MESSAGE;
+  global $CONFIG, $MESSAGE, $compose_mode;
   
   list($form_start, $form_end) = get_form_tags($attrib);
   unset($attrib['form']);
@@ -576,26 +619,26 @@ function rcmail_compose_subject($attrib)
     $subject = get_input_value('_subject', RCUBE_INPUT_POST, TRUE);
     
   // create a reply-subject
-  else if (isset($REPLY_MESSAGE['subject']))
+  else if ($compose_mode == RCUBE_COMPOSE_REPLY)
     {
-    if (eregi('^re:', $REPLY_MESSAGE['subject']))
-      $subject = $REPLY_MESSAGE['subject'];
+    if (eregi('^re:', $MESSAGE['subject']))
+      $subject = $MESSAGE['subject'];
     else
-      $subject = 'Re: '.$REPLY_MESSAGE['subject'];
+      $subject = 'Re: '.$MESSAGE['subject'];
     }
 
   // create a forward-subject
-  else if (isset($FORWARD_MESSAGE['subject']))
+  else if ($compose_mode == RCUBE_COMPOSE_FORWARD)
     {
-    if (eregi('^fwd:', $REPLY_MESSAGE['subject']))
-      $subject = $FORWARD_MESSAGE['subject'];
+    if (eregi('^fwd:', $MESSAGE['subject']))
+      $subject = $MESSAGE['subject'];
     else
-      $subject = 'Fwd: '.$FORWARD_MESSAGE['subject'];
+      $subject = 'Fwd: '.$MESSAGE['subject'];
     }
 
   // creeate a draft-subject
-  else if (isset($DRAFT_MESSAGE['subject']))
-    $subject = $DRAFT_MESSAGE['subject'];
+  else if ($compose_mode == RCUBE_COMPOSE_DRAFT)
+    $subject = $MESSAGE['subject'];
   
   $out = $form_start ? "$form_start\n" : '';
   $out .= $textfield->show($subject);
@@ -607,7 +650,7 @@ function rcmail_compose_subject($attrib)
 
 function rcmail_compose_attachment_list($attrib)
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT, $CONFIG;
   
   // add ID if not given
   if (!$attrib['id'])
@@ -631,14 +674,14 @@ function rcmail_compose_attachment_list($attrib)
     foreach ($_SESSION['compose']['attachments'] as $id => $a_prop)
       $out .= sprintf('<li id="rcmfile%d"><a href="#delete" onclick="return %s.command(\'remove-attachment\',\'rcmfile%d\', this)" title="%s">%s</a>%s</li>',
                       $id,
-                      $JS_OBJECT_NAME,
+                      JS_OBJECT_NAME,
                       $id,
-                      rcube_label('delete'), 
+                      Q(rcube_label('delete')),
                       $button,
-                      rep_specialchars_output($a_prop['name']));
+                      Q($a_prop['name']));
     }
 
-  $OUTPUT->add_script(sprintf("%s.gui_object('attachmentlist', '%s');", $JS_OBJECT_NAME, $attrib['id']));  
+  $OUTPUT->add_gui_object('attachmentlist', $attrib['id']);
     
   $out .= '</ul>';
   return $out;
@@ -648,7 +691,7 @@ function rcmail_compose_attachment_list($attrib)
 
 function rcmail_compose_attachment_form($attrib)
   {
-  global $OUTPUT, $JS_OBJECT_NAME, $SESS_HIDDEN_FIELD;
+  global $OUTPUT, $SESS_HIDDEN_FIELD;
 
   // add ID if not given
   if (!$attrib['id'])
@@ -659,6 +702,7 @@ function rcmail_compose_attachment_form($attrib)
   $input_field = rcmail_compose_attachment_field(array());
   $label_send = rcube_label('upload');
   $label_close = rcube_label('close');
+  $js_instance = JS_OBJECT_NAME;
   
   $out = <<<EOF
 <div$attrib_str>
@@ -666,13 +710,13 @@ function rcmail_compose_attachment_form($attrib)
 $SESS_HIDDEN_FIELD
 $input_field<br />
 <input type="button" value="$label_close" class="button" onclick="document.getElementById('$attrib[id]').style.visibility='hidden'" />
-<input type="button" value="$label_send" class="button" onclick="$JS_OBJECT_NAME.command('send-attachment', this.form)" />
+<input type="button" value="$label_send" class="button" onclick="$js_instance.command('send-attachment', this.form)" />
 </form>
 </div>
 EOF;
 
   
-  $OUTPUT->add_script(sprintf("%s.gui_object('uploadbox', '%s');", $JS_OBJECT_NAME, $attrib['id']));  
+  $OUTPUT->add_gui_object('uploadbox', $attrib['id']);
   return $out;
   }
 
@@ -732,9 +776,57 @@ function rcmail_receipt_checkbox($attrib)
   }
 
 
+function rcmail_editor_selector($attrib)
+{
+  global $CONFIG, $MESSAGE, $compose_mode;
+
+  $choices = array(
+    'html'  => 'htmltoggle',
+    'plain' => 'plaintoggle'
+  );
+
+  // determine whether HTML or plain text should be checked 
+  if ($CONFIG['htmleditor'])
+    $useHtml = true;
+  else
+    $useHtml = false;
+
+  if ($compose_mode == RCUBE_COMPOSE_REPLY ||
+      $compose_mode == RCUBE_COMPOSE_FORWARD ||
+      $compose_mode == RCUBE_COMPOSE_DRAFT)
+    {
+    $hasHtml = rcmail_has_html_part($MESSAGE['parts']);
+    $useHtml = ($hasHtml && $CONFIG['htmleditor']);
+    }
+
+  $selector = '';
+  
+  $attrib['name'] = '_editorSelect';
+  $attrib['onchange'] = 'return rcmail_toggle_editor(this)';
+  foreach ($choices as $value => $text)
+    {
+    $checked = '';
+    if ((($value == 'html') && $useHtml) ||
+        (($value != 'html') && !$useHtml))
+      $attrib['checked'] = 'true';
+    else
+      unset($attrib['checked']);
+
+    $attrib['id'] = '_' . $value;
+    $rb = new radiobutton($attrib);
+    $selector .= sprintf("%s<label for=\"%s\">%s</label>",
+                         $rb->show($value),
+                         $attrib['id'],
+                         rcube_label($text));
+    }
+
+  return $selector;
+}
+
+
 function get_form_tags($attrib)
   {
-  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $MESSAGE_FORM, $SESS_HIDDEN_FIELD;  
+  global $CONFIG, $OUTPUT, $MESSAGE_FORM, $SESS_HIDDEN_FIELD;  
 
   $form_start = '';
   if (!strlen($MESSAGE_FORM))
@@ -751,7 +843,7 @@ function get_form_tags($attrib)
   $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
   
   if (!strlen($MESSAGE_FORM))
-    $OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('messageform', '$form_name');");
+    $OUTPUT->add_gui_object('messageform', $form_name);
   
   $MESSAGE_FORM = $form_name;
 
@@ -759,38 +851,34 @@ function get_form_tags($attrib)
   }
 
 
-function format_email_recipient($email, $name='')
-  {
-  if ($name && $name != $email)
-    return sprintf('%s <%s>', strpos($name, ",") ? '"'.$name.'"' : $name, $email);
-  else
-    return $email;
-  }
-
-
-function rcmail_charset_pulldown($selected='ISO-8859-1')
-  {
-  $select = new select();
-  
-  
-  return $select->show($selected);
-  }
+// register UI objects
+$OUTPUT->add_handlers(array(
+  'composeheaders' => 'rcmail_compose_headers',
+  'composesubject' => 'rcmail_compose_subject',
+  'composebody' => 'rcmail_compose_body',
+  'composeattachmentlist' => 'rcmail_compose_attachment_list',
+  'composeattachmentform' => 'rcmail_compose_attachment_form',
+  'composeattachment' => 'rcmail_compose_attachment_field',
+  'priorityselector' => 'rcmail_priority_selector',
+  'receiptcheckbox' => 'rcmail_receipt_checkbox',
+));
 
 
 /****** get contacts for this user and add them to client scripts ********/
 
-$sql_result = $DB->query("SELECT name, email
-                          FROM ".get_table_name('contacts')." WHERE  user_id=?
-                          AND  del<>1",$_SESSION['user_id']);
+require_once('include/rcube_contacts.inc');
+
+$CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']);
+$CONTACTS->set_pagesize(1000);
                                    
-if ($DB->num_rows($sql_result))
+if ($result = $CONTACTS->list_records())
   {        
   $a_contacts = array();
-  while ($sql_arr = $DB->fetch_assoc($sql_result))
+  while ($sql_arr = $result->iterate())
     if ($sql_arr['email'])
-      $a_contacts[] = format_email_recipient($sql_arr['email'], rep_specialchars_output($sql_arr['name'], 'js'));
+      $a_contacts[] = format_email_recipient($sql_arr['email'], JQ($sql_arr['name']));
   
-  $OUTPUT->add_script(sprintf("$JS_OBJECT_NAME.set_env('contacts', %s);", array2js($a_contacts)));
+  $OUTPUT->set_env('contacts', $a_contacts);
   }
 
 
index 3faf0f8ee92e6e56dff6ecfdeea95a931f86cab1..c7d9ebe972eedf1327b6d72a1eb680e7d07eacec 100644 (file)
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: folders.inc 232 2006-05-18 15:46:50Z cmcnulty $
+ $Id: folders.inc 573 2007-05-18 11:29:25Z thomasb $
 */
 
-$REMOTE_REQUEST = TRUE;
 $mbox_name = $IMAP->get_mailbox_name();
 
-
 // send EXPUNGE command
-if ($_action=='expunge')
-  {
-  $success = $IMAP->expunge($_GET['_mbox']);
+if ($_action=='expunge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST)))
+{
+  $success = $IMAP->expunge($mbox);
 
   // reload message list if current mailbox  
-  if ($success && $_GET['_reload'])
-    {
-    rcube_remote_response('this.clear_message_list();', TRUE);
+  if ($success && !empty($_REQUEST['_reload']))
+  {
+    $OUTPUT->command('message_list.clear');
     $_action = 'list';
     return;
-    }
+  }
   else
     $commands = "// expunged: $success\n";
-  }
+}
 
 // clear mailbox
-else if ($_action=='purge')
-  {
-  $success = $IMAP->clear_mailbox($_GET['_mbox']);
+else if ($_action=='purge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST)))
+{
+  $success = $IMAP->clear_mailbox($mbox);
   
-  if ($success && $_GET['_reload'])
-    {
-    $commands = "this.clear_message_list();\n";
-    $commands .= "this.set_env('messagecount', 0);\n";
-    $commands .= "this.set_env('pagecount', 0);\n";
-    $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
-    $commands .= sprintf("this.set_unread_count('%s', 0);\n", addslashes($mbox_name));
-    }
+  if ($success && !empty($_REQUEST['_reload']))
+  {
+    $OUTPUT->set_env('messagecount', 0);
+    $OUTPUT->set_env('pagecount', 0);
+    $OUTPUT->command('message_list.clear');
+    $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text());
+    $OUTPUT->command('set_unread_count', $mbox_name, 0);
+  }
   else
     $commands = "// purged: $success";
-  }
-
-
+}
 
-rcube_remote_response($commands);
+$OUTPUT->send($commands);
 ?>
\ No newline at end of file
index 3a971bd4052387f6c54f55e686fa68b758ac1509..5628ad7ff31615bff83d261cb19898db2f470214 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/mail/func.inc                                           |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: func.inc 429 2006-12-22 22:26:24Z thomasb $
+ $Id: func.inc 575 2007-05-18 12:35:28Z thomasb $
 
 */
 
@@ -25,21 +25,20 @@ 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'])){
+if (empty($_SESSION['mbox']))
   $_SESSION['mbox'] = $IMAP->get_mailbox_name();
-}
 
 // set imap properties and session vars
-if (strlen($_GET['_mbox']))
+if ($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC))
   {
-  $IMAP->set_mailbox($_GET['_mbox']);
-  $_SESSION['mbox'] = $_GET['_mbox'];
+  $IMAP->set_mailbox($mbox);
+  $_SESSION['mbox'] = $mbox;
   }
 
-if (strlen($_GET['_page']))
+if (!empty($_GET['_page']))
   {
-  $IMAP->set_page($_GET['_page']);
-  $_SESSION['page'] = $_GET['_page'];
+  $IMAP->set_page((int)$_GET['_page']);
+  $_SESSION['page'] = (int)$_GET['_page'];
   }
 
 // set mailbox to INBOX if not set
@@ -51,34 +50,42 @@ if (!isset($_SESSION['sort_col']))
   $_SESSION['sort_col'] = $CONFIG['message_sort_col'];
 if (!isset($_SESSION['sort_order']))
   $_SESSION['sort_order'] = $CONFIG['message_sort_order'];
-  
+
+// set message set for search result
+if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']]))
+  $IMAP->set_search_set($_SESSION['search'][$_REQUEST['_search']]);
+
 
 // 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']);
+  $GET_URL = rcmail_url('get', array('_mbox'=>$IMAP->get_mailbox_name(), '_uid'=>get_input_value('_uid', RCUBE_INPUT_GET)));
 
 
 // set current mailbox in client environment
-$OUTPUT->add_script(sprintf("%s.set_env('mailbox', '%s');", $JS_OBJECT_NAME, $IMAP->get_mailbox_name()));
+$OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name());
+$OUTPUT->set_env('quota', $IMAP->get_capability('quota'));
 
 if ($CONFIG['trash_mbox'])
-  $OUTPUT->add_script(sprintf("%s.set_env('trash_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['trash_mbox']));
-
+  $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
 if ($CONFIG['drafts_mbox'])
-  $OUTPUT->add_script(sprintf("%s.set_env('drafts_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['drafts_mbox']));
-
+  $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
 if ($CONFIG['junk_mbox'])
-  $OUTPUT->add_script(sprintf("%s.set_env('junk_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['junk_mbox']));
+  $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']);
+
+if (!$OUTPUT->ajax_call)
+  rcube_add_label('checkingmail');
+
 
 // return the mailboxlist in HTML
 function rcmail_mailbox_list($attrib)
   {
-  global $IMAP, $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $COMM_PATH;
+  global $IMAP, $CONFIG, $OUTPUT, $COMM_PATH;
   static $s_added_script = FALSE;
   static $a_mailboxes;
 
   // add some labels to client
   rcube_add_label('purgefolderconfirm');
+  rcube_add_label('deletemessagesconfirm');
   
 // $mboxlist_start = rcube_timer();
   
@@ -131,7 +138,7 @@ function rcmail_mailbox_list($attrib)
 
 
   if ($type=='ul')
-    $OUTPUT->add_script(sprintf("%s.gui_object('mailboxlist', '%s');", $JS_OBJECT_NAME, $attrib['id']));
+    $OUTPUT->add_gui_object('mailboxlist', $attrib['id']);
 
   return $out . "</$type>";
   }
@@ -171,7 +178,7 @@ function rcmail_build_folder_tree(&$arrFolders, $folder, $delm='/', $path='')
 // 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;
+  global $COMM_PATH, $IMAP, $CONFIG, $OUTPUT;
 
   $idx = 0;
   $out = '';
@@ -192,7 +199,7 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$special, &$mbox_name, $m
         {
         $fname = abbrevate_string($foldername, $maxlength);
         if ($fname != $foldername)
-          $title = ' title="'.rep_specialchars_output($foldername, 'html', 'all').'"';
+          $title = ' title="'.Q($foldername).'"';
         $foldername = $fname;
         }
       }
@@ -202,7 +209,8 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$special, &$mbox_name, $m
       $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);
+    $folder_id = preg_replace('/[^A-Za-z0-9\-_]/', '', $folder['id']);
+    $class_name = preg_replace('/[^a-z0-9\-_]/', '', $folder_lc);
 
     // set special class for Sent, Drafts, Trash and Junk
     if ($folder['id']==$CONFIG['sent_mbox'])
@@ -214,28 +222,28 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$special, &$mbox_name, $m
     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&amp;_mbox=%s"'.
-                    ' onclick="return %s.command(\'list\',\'%s\')"'.
-                    ' onmouseover="return %s.focus_mailbox(\'%s\')"' .            
-                    ' onmouseout="return %s.unfocus_mailbox(\'%s\')"' .
-                    ' onmouseup="return %s.mbox_mouse_up(\'%s\')"%s>%s</a>',
-                    $folder_css,
+    $js_name = htmlspecialchars(JQ($folder['id']));
+    $out .= sprintf('<li id="rcmli%s" class="mailbox %s %s%s%s"><a href="%s"'.
+                    ' onclick="return %s.command(\'list\',\'%s\',this)"'.
+                    ' onmouseover="return %s.focus_folder(\'%s\')"' .
+                    ' onmouseout="return %s.unfocus_folder(\'%s\')"' .
+                    ' onmouseup="return %s.folder_mouse_up(\'%s\')"%s>%s</a>',
+                    $folder_id,
                     $class_name,
                     $zebra_class,
                     $unread_count ? ' unread' : '',
-                    addslashes($folder['id'])==addslashes($mbox_name) ? ' selected' : '',
-                    $COMM_PATH,
-                    urlencode($folder['id']),
-                    $JS_OBJECT_NAME,
-                    addslashes($folder['id']),
-                    $JS_OBJECT_NAME,
-                    addslashes($folder['id']),
-                    $JS_OBJECT_NAME,
-                    addslashes($folder['id']),
-                    $JS_OBJECT_NAME,
-                    addslashes($folder['id']),
+                    $folder['id']==$mbox_name ? ' selected' : '',
+                    Q(rcmail_url('', array('_mbox' => $folder['id']))),
+                    JS_OBJECT_NAME,
+                    $js_name,
+                    JS_OBJECT_NAME,
+                    $js_name,
+                    JS_OBJECT_NAME,
+                    $js_name,
+                    JS_OBJECT_NAME,
+                    $js_name,
                     $title,
-                    rep_specialchars_output($foldername, 'html', 'all'));
+                    Q($foldername));
 
     if (!empty($folder['folders']))
       $out .= "\n<ul>\n" . rcmail_render_folder_tree_html($folder['folders'], $special, $mbox_name, $maxlength, $nestLevel+1) . "</ul>\n";
@@ -270,9 +278,9 @@ function rcmail_render_folder_tree_select(&$arrFolders, &$special, &$mbox_name,
       }
 
     $out .= sprintf('<option value="%s">%s%s</option>'."\n",
-                    $folder['id'],
+                    htmlspecialchars($folder['id']),
                     str_repeat('&nbsp;', $nestLevel*4),
-                    rep_specialchars_output($foldername, 'html', 'all'));
+                    Q($foldername));
 
     if (!empty($folder['folders']))
       $out .= rcmail_render_folder_tree_select($folder['folders'], $special, $mbox_name, $maxlength, $nestLevel+1);
@@ -287,7 +295,7 @@ function rcmail_render_folder_tree_select(&$arrFolders, &$special, &$mbox_name,
 // return the message list as HTML table
 function rcmail_message_list($attrib)
   {
-  global $IMAP, $CONFIG, $COMM_PATH, $OUTPUT, $JS_OBJECT_NAME;
+  global $IMAP, $CONFIG, $COMM_PATH, $OUTPUT;
 
   $skin_path = $CONFIG['skin_path'];
   $image_tag = '<img src="%s%s" alt="%s" border="0" />';
@@ -315,9 +323,11 @@ function rcmail_message_list($attrib)
   // 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', 'size');
+
+  $mbox = $IMAP->get_mailbox_name();
   
   // show 'to' instead of from in sent messages
-  if (($IMAP->get_mailbox_name()==$CONFIG['sent_mbox'] || $IMAP->get_mailbox_name()==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols))
+  if (($mbox==$CONFIG['sent_mbox'] || $mbox==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols))
       && !array_search('to', $a_show_cols))
     $a_show_cols[$f] = 'to';
   
@@ -338,7 +348,7 @@ function rcmail_message_list($attrib)
   foreach ($a_show_cols as $col)
     {
     // get column name
-    $col_name = rep_specialchars_output(rcube_label($col));
+    $col_name = Q(rcube_label($col));
 
     // make sort links
     $sort = '';
@@ -352,31 +362,34 @@ function rcmail_message_list($attrib)
         // asc link
         if (!empty($attrib['sortascbutton']))
           {
-          $sort .= rcube_button(array('command' => 'sort',
-                                      'prop' => $col.'_ASC',
-                                      'image' => $attrib['sortascbutton'],
-                                      'align' => 'absmiddle',
-                                      'title' => 'sortasc'));
+          $sort .= $OUTPUT->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'));        
+          $sort .= $OUTPUT->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);
+        $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);
         }
       }
       
@@ -392,10 +405,9 @@ function rcmail_message_list($attrib)
   // 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')));
+    $out .= sprintf('<tr><td colspan="%d">%s</td></tr>',
+                    sizeof($a_show_cols)+2,
+                    Q(rcube_label('nomessagesfound')));
     }
 
 
@@ -425,8 +437,8 @@ function rcmail_message_list($attrib)
     else if ($attrib['messageicon'])
       $message_icon = $attrib['messageicon'];
     
-       // set attachment icon
-    if ($attrib['attachmenticon'] && preg_match("/multipart\/m/i", $header->ctype))
+    // set attachment icon
+    if ($attrib['attachmenticon'] && preg_match("/multipart\/[mr]/i", $header->ctype))
       $attach_icon = $attrib['attachmenticon'];
         
     $out .= sprintf('<tr id="rcmrow%d" class="message%s%s %s">'."\n",
@@ -436,26 +448,28 @@ function rcmail_message_list($attrib)
                     $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']));
+        $cont = Q(rcmail_address_string($header->$col, 3, $attrib['addicon']), 'show');
       else if ($col=='subject')
         {
-        $cont = rep_specialchars_output($IMAP->decode_header($header->$col), 'html', 'all');
-        // firefox/mozilla temporary workaround to pad subject with content so that whitespace in rows responds to drag+drop
-        $cont .= '<img src="./program/blank.gif" height="5" width="1000" alt="" />';
+        $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show';
+        $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid';
+        $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset));
+        if (empty($cont)) $cont = Q(rcube_label('nosubject'));
+        $cont = sprintf('<a href="%s" onclick="return false">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont);
         }
       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));
+        $cont = format_date($header->date);
       else
-        $cont = rep_specialchars_output($header->$col, 'html', 'all');
+        $cont = Q($header->$col);
         
-         $out .= '<td class="'.$col.'">' . $cont . "</td>\n";
+      $out .= '<td class="'.$col.'">' . $cont . "</td>\n";
       }
 
     $out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : '');
@@ -472,49 +486,47 @@ function rcmail_message_list($attrib)
   $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);
+  $OUTPUT->add_gui_object('mailcontframe', 'mailcontframe');
+  $OUTPUT->add_gui_object('messagelist', $attrib['id']);
+  $OUTPUT->set_env('messagecount', $message_count);
+  $OUTPUT->set_env('current_page', $IMAP->list_page);
+  $OUTPUT->set_env('pagecount', ceil($message_count/$IMAP->page_size));
+  $OUTPUT->set_env('sort_col', $sort_col);
+  $OUTPUT->set_env('sort_order', $sort_order);
   
   if ($attrib['messageicon'])
-    $javascript .= sprintf("%s.set_env('messageicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['messageicon']);
+    $OUTPUT->set_env('messageicon', $skin_path . $attrib['messageicon']);
   if ($attrib['deletedicon'])
-    $javascript .= sprintf("%s.set_env('deletedicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['deletedicon']);
+    $OUTPUT->set_env('deletedicon', $skin_path . $attrib['deletedicon']);
   if ($attrib['unreadicon'])
-    $javascript .= sprintf("%s.set_env('unreadicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['unreadicon']);
+    $OUTPUT->set_env('unreadicon', $skin_path . $attrib['unreadicon']);
   if ($attrib['repliedicon'])
-    $javascript .= sprintf("%s.set_env('repliedicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['repliedicon']);
+    $OUTPUT->set_env('repliedicon', $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->set_env('attachmenticon', $skin_path . $attrib['attachmenticon']);
+  
+  $OUTPUT->set_env('messages', $a_js_message_arr);
   
-  $OUTPUT->add_script($javascript);  
+  $OUTPUT->include_script('list.js');
   
   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;
+  global $CONFIG, $IMAP, $OUTPUT;
 
-  $commands = '';
   $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
+  $mbox = $IMAP->get_mailbox_name();
 
   // 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))
+  if (($mbox == $CONFIG['sent_mbox'] || $mbox == $CONFIG['drafts_mbox'])
+      && (($f = array_search('from', $a_show_cols)) !== false) && array_search('to', $a_show_cols) === false)
     $a_show_cols[$f] = 'to';
 
-  $commands .= sprintf("this.set_message_coltypes(%s);\n", array2js($a_show_cols)); 
+  $OUTPUT->command('set_message_coltypes', $a_show_cols);
 
   // loop through message headers
   for ($n=0; $a_headers[$n]; $n++)
@@ -522,20 +534,26 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE)
     $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));
+        $cont = Q(rcmail_address_string($header->$col, 3), 'show');
       else if ($col=='subject')
-        $cont = rep_specialchars_output($IMAP->decode_header($header->$col), 'html', 'all');
+        {
+        $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show';
+        $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid';
+        $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset));
+        if (!$cont) $cont = Q(rcube_label('nosubject'));
+        $cont = sprintf('<a href="%s" onclick="return false">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont);
+        }
       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));
+        $cont = format_date($header->date);
       else
-        $cont = rep_specialchars_output($header->$col, 'html', 'all');
+        $cont = Q($header->$col);
           
       $a_msg_cols[$col] = $cont;
       }
@@ -543,59 +561,47 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE)
     $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);
+    $OUTPUT->command('add_message_row',
+      $header->uid,
+      $a_msg_cols,
+      $a_msg_flags,
+      preg_match("/multipart\/m/i", $header->ctype),
+      $insert_top);
     }
-
-  return $commands;
   }
 
 
-// return code for search function
-function rcmail_search_form($attrib)
+// return an HTML iframe for loading mail content
+function rcmail_messagecontent_frame($attrib)
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
-
-  // add some labels to client
-  rcube_add_label('searching');
-
-  $attrib['name'] = '_q';
+  global $OUTPUT;
   
   if (empty($attrib['id']))
-    $attrib['id'] = 'rcmqsearchbox';
-  
-  $input_q = new textfield($attrib);
-  $out = $input_q->show();
+    $attrib['id'] = 'rcmailcontentwindow';
+
+  // allow the following attributes to be added to the <iframe> tag
+  $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
+  $framename = $attrib['id'];
 
-  $OUTPUT->add_script(sprintf("%s.gui_object('qsearchbox', '%s');",
-                              $JS_OBJECT_NAME,
-                              $attrib['id']));
+  $out = sprintf('<iframe name="%s"%s></iframe>'."\n",
+         $framename,
+         $attrib_str);
 
-  // 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);
+  $OUTPUT->set_env('contentframe', $framename);
+  $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif');
 
   return $out;
-  } 
+  }
 
 
 function rcmail_messagecount_display($attrib)
   {
-  global $IMAP, $OUTPUT, $JS_OBJECT_NAME;
+  global $IMAP, $OUTPUT;
   
   if (!$attrib['id'])
     $attrib['id'] = 'rcmcountdisplay';
 
-  $OUTPUT->add_script(sprintf("%s.gui_object('countdisplay', '%s');",
-                              $JS_OBJECT_NAME,
-                              $attrib['id']));
+  $OUTPUT->add_gui_object('countdisplay', $attrib['id']);
 
   // allow the following attributes to be added to the <span> tag
   $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
@@ -610,28 +616,56 @@ function rcmail_messagecount_display($attrib)
 
 function rcmail_quota_display($attrib)
   {
-  global $IMAP, $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT, $COMM_PATH;
 
   if (!$attrib['id'])
     $attrib['id'] = 'rcmquotadisplay';
 
-  $OUTPUT->add_script(sprintf("%s.gui_object('quotadisplay', '%s');", $JS_OBJECT_NAME, $attrib['id']));
+  $OUTPUT->add_gui_object('quotadisplay', $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 .= rcmail_quota_content($attrib['display']);
   $out .= '</span>';
   return $out;
   }
 
 
+function rcmail_quota_content($display)
+  {
+  global $IMAP, $COMM_PATH;
+
+  if (!$IMAP->get_capability('QUOTA'))
+    $quota_text = rcube_label('unknown');
+  else if ($quota = $IMAP->get_quota())
+    {
+    $quota_text = sprintf("%s / %s (%.0f%%)",
+                          show_bytes($quota["used"] * 1024),
+                          show_bytes($quota["total"] * 1024),
+                          $quota["percent"]);
+
+    // show quota as image (by Brett Patterson)
+    if ($display == 'image' && function_exists('imagegif'))
+      {
+      $attrib = array('width' => 100, 'height' => 14);
+      $quota_text = sprintf('<img src="./bin/quotaimg.php?u=%s&amp;q=%d&amp;w=%d&amp;h=%d" width="%d" height="%d" alt="%s" title="%s / %s" />',
+                            $quota['used'], $quota['total'],
+                            $attrib['width'], $attrib['height'],
+                            $attrib['width'], $attrib['height'],
+                            $quota_text,
+                            show_bytes($quota["used"] * 1024),
+                            show_bytes($quota["total"] * 1024));
+      }
+    }
+  else
+    $quota_text = rcube_label('unlimited');
+
+  return $quota_text;
+  }
+
+
 function rcmail_get_messagecount_text($count=NULL, $page=NULL)
   {
   global $IMAP, $MESSAGE;
@@ -657,38 +691,44 @@ function rcmail_get_messagecount_text($count=NULL, $page=NULL)
                                               'to'    => min($max, $start_msg + $IMAP->page_size - 1),
                                               'count' => $max)));
 
-  return rep_specialchars_output($out);
+  return Q($out);
   }
 
 
-function rcmail_print_body($part, $safe=FALSE, $plain=FALSE) // $body, $ctype_primary='text', $ctype_secondary='plain', $encoding='7bit', $safe=FALSE, $plain=FALSE)
+function rcmail_print_body($part, $safe=FALSE, $plain=FALSE)
   {
-  global $IMAP, $REMOTE_OBJECTS, $JS_OBJECT_NAME;
-
-  // extract part properties: body, ctype_primary, ctype_secondary, encoding, parameters
-  extract($part);
+  global $IMAP, $REMOTE_OBJECTS;
   
-  $block = $plain ? '%s' : '%s'; //'<div style="display:block;">%s</div>';
-  $body = $IMAP->mime_decode($body, $encoding);  
-  $body = $IMAP->charset_decode($body, $parameters);
+  $body = is_array($part->replaces) ? strtr($part->body, $part->replaces) : $part->body;
 
+  // convert html to text/plain
+  if ($part->ctype_secondary=='html' && $plain)
+    {
+    $txt = new html2text($body, false, true);
+    $body = $txt->get_text();
+    $part->ctype_secondary = 'plain';
+    }
+    
   // text/html
-  if ($ctype_secondary=='html')
+  if ($part->ctype_secondary=='html')
     {
+    // remove charset specification in HTML message
+    $body = preg_replace('/charset=[a-z0-9\-]+/i', '', $body);
+
     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',
+      $remote_patterns = array('/<img\s+(.*)src=(["\']?)([hftps]{3,5}:\/{2}[^"\'\s]+)(\2|\s|>)/Ui',
+                               '/(src|background)=(["\']?)([hftps]{3,5}:\/{2}[^"\'\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',
+      $remote_replaces = array('<img \\1src=\\2./program/blocked.gif\\4',
+                               '',
+                               '',
                                '',
-                               '',  // '\\1#\\3',
                                'none',
                                'none',
                                '');
@@ -706,21 +746,20 @@ function rcmail_print_body($part, $safe=FALSE, $plain=FALSE) // $body, $ctype_pr
       $body = preg_replace($remote_patterns, $remote_replaces, $body);
       }
 
-    return sprintf($block, rep_specialchars_output($body, 'html', '', FALSE));
+    return Q($body, 'show', FALSE);
     }
 
   // text/enriched
-  if ($ctype_secondary=='enriched')
+  if ($part->ctype_secondary=='enriched')
     {
-    $body = enriched_to_html($body);
-    return sprintf($block, rep_specialchars_output($body, 'html'));
+    return Q(enriched_to_html($body), 'show');
     }
   else
     {
     // make links and email-addresses clickable
     $convert_patterns = $convert_replaces = $replace_strings = array();
     
-    $url_chars = 'a-z0-9_\-\+\*\$\/&%=@#:';
+    $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";
@@ -730,40 +769,45 @@ function rcmail_print_body($part, $safe=FALSE, $plain=FALSE) // $body, $ctype_pr
     $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)";
+    $convert_replaces[] = "rcmail_str_replacement('<a href=\"mailto:\\1\" onclick=\"return ".JS_OBJECT_NAME.".command(\'compose\',\'\\1\',this)\">\\1</a>', \$replace_strings)";
+    
+    if ($part->ctype_parameters['format'] != 'flowed')
+      $body = wordwrap(trim($body), 80);
 
-    $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);
+    $quote_level = 0;
 
     // colorize quoted parts
     for($n=0; $n<sizeof($a_lines); $n++)
       {
       $line = $a_lines[$n];
+      $quotation = '';
+      $q = 0;
+      
+      if (preg_match('/^(>+\s*)/', $line, $regs))
+        {
+        $q = strlen(preg_replace('/\s/', '', $regs[1]));
+        $line = substr($line, strlen($regs[1]));
 
-      if ($line{2}=='>')
-        $color = 'red';
-      else if ($line{1}=='>')
-        $color = 'green';
-      else if ($line{0}=='>')
-        $color = 'blue';
-      else
-        $color = FALSE;
+        if ($q > $quote_level)
+          $quotation = str_repeat('<blockquote>', $q - $quote_level);
+        else if ($q < $quote_level)
+          $quotation = str_repeat("</blockquote>", $quote_level - $q);
+        }
+      else if ($quote_level > 0)
+        $quotation = str_repeat("</blockquote>", $quote_level);
 
-      $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;
+      $quote_level = $q;
+      $a_lines[$n] = $quotation . Q($line, 'replace', FALSE);
       }
 
     // 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>");
+    return "<div class=\"pre\">".$body."\n</div>";
     }
   }
 
@@ -778,7 +822,7 @@ function rcmail_str_replacement($str, &$rep)
   }
 
 
-function rcmail_parse_message($structure, $arg=array(), $recursive=FALSE)
+function rcmail_parse_message(&$structure, $arg=array(), $recursive=FALSE)
   {
   global $IMAP;
   static $sa_inline_objects = array();
@@ -795,18 +839,18 @@ function rcmail_parse_message($structure, $arg=array(), $recursive=FALSE)
 
   // show message headers
   if ($recursive && is_array($structure->headers) && isset($structure->headers['subject']))
-    $a_return_parts[] = array('type' => 'headers',
-                              'headers' => $structure->headers);
+    {
+    $c = new stdClass;
+    $c->type = 'headers';
+    $c->headers = &$structure->headers;
+    $a_return_parts[] = $c;
+    }
 
   // 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']);
+    $structure->type = 'content';
+    $a_return_parts[] = &$structure;
     }
 
   // message contains alternative parts
@@ -841,49 +885,52 @@ function rcmail_parse_message($structure, $arg=array(), $recursive=FALSE)
 
     // print html/plain part
     else if ($html_part!==NULL && $prefer_html)
-      $print_part = $structure->parts[$html_part];
+      $print_part = &$structure->parts[$html_part];
     else if ($enriched_part!==NULL)
-      $print_part = $structure->parts[$enriched_part];
+      $print_part = &$structure->parts[$enriched_part];
     else if ($plain_part!==NULL)
-      $print_part = $structure->parts[$plain_part];
+      $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']);
+      {
+      $print_part->type = 'content';
+      $a_return_parts[] = $print_part;
+      }
     // show plaintext warning
     else if ($html_part!==NULL)
-      $a_return_parts[] = array('type' => 'content',
-                                'body' => rcube_label('htmlmessage'),
-                                'ctype_primary' => 'text',
-                                'ctype_secondary' => 'plain');
+      {
+      $c = new stdClass;
+      $c->type = 'content';
+      $c->body = rcube_label('htmlmessage');
+      $c->ctype_primary = 'text';
+      $c->ctype_secondary = 'plain';
+      
+      $a_return_parts[] = $c;
+      }
                                 
     // 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'])));
+      $html_part = &$structure->parts[$html_part];
+      $html_part->filename = rcube_label('htmlmessage');
+      $html_part->mimetype = 'text/html';
+      
+      $a_attachments[] = $html_part;
       }
     }
 
   // message contains multiple parts
-  else if ($message_ctype_primary=='multipart' && is_array($structure->parts))
+  else if (is_array($structure->parts) && !empty($structure->parts))
     {
-    foreach ($structure->parts as $mail_part)
+    for ($i=0; $i<count($structure->parts); $i++)
       {
+      $mail_part = &$structure->parts[$i];
       $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'))
+      if ($primary_type=='multipart')
         {
         list($parts, $attachmnts) = rcmail_parse_message($mail_part, $arg, TRUE);
 
@@ -895,93 +942,64 @@ function rcmail_parse_message($structure, $arg=array(), $recursive=FALSE)
       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']);
+        $mail_part->type = 'content';
+        $a_return_parts[] = $mail_part;
         }
 
       // 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);
-
+        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 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'])))
+               (empty($mail_part->disposition) && $mail_part->filename))
         {
+        // skip apple resource forks
+        if ($message_ctype_secondary=='appledouble' && $secondary_type=='applefile')
+          continue;
+
+        // part belongs to a related message
         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 */);
+          {
+          $mail_part->content_id = preg_replace(array('/^</', '/>$/'), '', $mail_part->headers['content-id']);
+          $sa_inline_objects[] = $mail_part;
+          }
+        // is regular attachment
+        else
+          {
+          if (!$mail_part->filename)
+            $mail_part->filename = 'file_'.$mail_part->mime_id;
+          $a_attachments[] = $mail_part;
+          }
         }
       }
 
-
     // 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();
+      $a_replaces = 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']);
-        }
+        $a_replaces['cid:'.$inline_object->content_id] = htmlspecialchars(sprintf($get_url, $inline_object->mime_id));
       
-      foreach ($a_return_parts as $i => $return_part)
+      // add replace array to each content part
+      // (will be applied later when part body is available)
+      for ($i=0; $i<count($a_return_parts); $i++)
         {
-        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';
+        if ($a_return_parts[$i]->type=='content')
+          $a_return_parts[$i]->replaces = $a_replaces;
         }
       }
     }
-    
 
-  // join all parts together
-  //$out .= join($part_delimiter, $a_return_parts);
+  // message is single part non-text
+  else if ($structure->filename)
+    $a_attachments[] = $structure;
 
   return array($a_return_parts, $a_attachments);
   }
@@ -1008,7 +1026,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
   // 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
@@ -1026,12 +1044,12 @@ function rcmail_message_headers($attrib, $headers=NULL)
     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($headers[$hkey], NULL, $attrib['addicon']));
+      $header_value = Q(rcmail_address_string($headers[$hkey], NULL, $attrib['addicon']), 'show');
     else
-      $header_value = rep_specialchars_output($IMAP->decode_header($headers[$hkey]), '', 'all');
+      $header_value = Q(rcube_imap::decode_mime_string($headers[$hkey], $headers['charset']));
 
     $out .= "\n<tr>\n";
-    $out .= '<td class="header-title">'.rep_specialchars_output(rcube_label($hkey)).":&nbsp;</td>\n";
+    $out .= '<td class="header-title">'.Q(rcube_label($hkey)).":&nbsp;</td>\n";
     $out .= '<td class="'.$hkey.'" width="90%">'.$header_value."</td>\n</tr>";
     $header_count++;
     }
@@ -1045,7 +1063,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
 
 function rcmail_message_body($attrib)
   {
-  global $CONFIG, $OUTPUT, $MESSAGE, $GET_URL, $REMOTE_OBJECTS, $JS_OBJECT_NAME;
+  global $CONFIG, $OUTPUT, $MESSAGE, $IMAP, $GET_URL, $REMOTE_OBJECTS;
   
   if (!is_array($MESSAGE['parts']) && !$MESSAGE['body'])
     return '';
@@ -1067,29 +1085,34 @@ function rcmail_message_body($attrib)
   // -> 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'));
+    $p = new stdClass;
+    $p->type = 'content';
+    $p->ctype_primary = 'text';
+    $p->ctype_secondary = 'plain';
+    $p->body = rcube_label('encryptedmessage');
+    $MESSAGE['parts'][0] = $p;
     }
   
   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 ($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);
+        if (empty($part->ctype_parameters) || empty($part->ctype_parameters['charset']))
+          $part->ctype_parameters['charset'] = $MESSAGE['headers']->charset;
+
+        // fetch part if not available
+        if (!isset($part->body))
+          $part->body = $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part);
+
+        $body = rcmail_print_body($part, $safe_mode, !$CONFIG['prefer_html']);
         $out .= '<div class="message-part">';
         
-        if ($part['ctype_secondary']!='plain')
-          $out .= rcmail_mod_html_body($body, $attrib['id']);
+        if ($part->ctype_secondary != 'plain')
+          $out .= rcmail_sanitize_html($body, $attrib['id']);
         else
           $out .= $body;
 
@@ -1110,17 +1133,17 @@ function rcmail_message_body($attrib)
     {
     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']);
+      if (strpos($attach_prop->mimetype, 'image/')===0)
+        $out .= sprintf("\n<hr />\n<p align=\"center\"><img src=\"%s&amp;_part=%s\" alt=\"%s\" title=\"%s\" /></p>\n",
+                        htmlspecialchars($GET_URL), $attach_prop->mime_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));
+    $OUTPUT->set_env('blockedobjects', true);
 
   $out .= "\n</div>";
   return $out;
@@ -1129,7 +1152,7 @@ function rcmail_message_body($attrib)
 
 
 // modify a HTML message that it can be displayed inside a HTML page
-function rcmail_mod_html_body($body, $container_id)
+function rcmail_sanitize_html($body, $container_id)
   {
   // remove any null-byte characters before parsing
   $body = preg_replace('/\x00/', '', $body);
@@ -1140,15 +1163,13 @@ function rcmail_mod_html_body($body, $container_id)
   // 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);
-    
+    $pos = strpos($body_lc, '>', $pos)+1;
+
     // replace all css definitions with #container [def]
-    $styles = rcmail_mod_css_styles($styles, $container_id);
-    
-    $body = $body_pre . $styles . $body_post;
+    $styles = rcmail_mod_css_styles(substr($body, $pos, $pos2-$pos), $container_id);
+
+    $body = substr($body, 0, $pos) . $styles . substr($body, $pos2);
+    $body_lc = strtolower($body);
     $last_style_pos = $pos2;
     }
 
@@ -1158,7 +1179,7 @@ function rcmail_mod_html_body($body, $container_id)
     {
     while (($pos = strpos($body_lc, '<'.$tag)) && ($pos2 = strpos($body_lc, '</'.$tag.'>', $pos)))
       {
-      $pos2 += 8;
+      $pos2 += strlen('</'.$tag.'>');
       $body = substr($body, 0, $pos) . substr($body, $pos2, strlen($body)-$pos2);
       $body_lc = strtolower($body);
       }
@@ -1186,19 +1207,24 @@ function rcmail_mod_html_body($body, $container_id)
   $body = preg_replace('/<a\s+([^>]+)>/Uie', "rcmail_alter_html_link('\\1');", $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">',
+  $out = preg_replace(array(
+      '/(<!DOCTYPE.+)/i',
+      '/(<\/?html[^>]*>)/i',
+      '/(<\/?head[^>]*>)/i',
+      '/(<title[^>]*>.*<\/title>)/Ui',
+      '/(<\/?meta[^>]*>)/i'),
+    '<!--\\1-->',
+    $body);
+
+  $out = preg_replace(array('/<body([^>]*)>/i',
+                            '/<\/body>/i'),
+                      array('<div class="rcmBody"\\1>',
                             '</div>'),
                       $out);
-  
+
+  // quote <? of php and xml files that are specified as text/html
+  $out = preg_replace(array('/<\?/', '/\?>/'), array('&lt;?', '?&gt;'), $out);
+
   return $out;
   }
 
@@ -1206,12 +1232,13 @@ function rcmail_mod_html_body($body, $container_id)
 // parse link attributes and set correct target
 function rcmail_alter_html_link($in)
   {
+  $in = preg_replace('/=([^("|\'|\s)]+)(\s|$)/', '="\1"', $in);
   $attrib = parse_attrib_string($in);
 
   if (stristr((string)$attrib['href'], 'mailto:'))
     $attrib['onclick'] = sprintf("return %s.command('compose','%s',this)",
-                                 $GLOBALS['JS_OBJECT_NAME'],
-                                 preg_replace("/'+/i","",substr($attrib['href'], 7)));
+                                 JS_OBJECT_NAME,
+                                 JQ(substr($attrib['href'], 7)));
   else if (!empty($attrib['href']) && $attrib['href']{0}!='#')
     $attrib['target'] = '_blank';
   
@@ -1233,151 +1260,106 @@ function rcmail_mod_css_styles($source, $container_id)
     $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);
-  
+
+  // remove html commends and add #container to each tag selector.
+  // also replace body definition because we also stripped off the <body> tag
+  $styles = preg_replace(array('/(^\s*<!--)|(-->\s*$)/', '/(^\s*|,\s*|\}\s*)([a-z0-9\._][a-z0-9\.\-_]*)/im', '/<<str_replacement\[([0-9]+)\]>>/e', "/$container_id\s+body/i"),
+                         array('', "\\1#$container_id \\2", "\$a_css_values[\\1]", "$container_id div.rcmBody"),
+                         $source);
+
   return $styles;
   }
 
 
+function rcmail_has_html_part($message_parts)
+{
+   if (!is_array($message_parts))
+      return FALSE;
 
-// return first text part of a message
-function rcmail_first_text_part($message_parts)
+   // check all message parts
+   foreach ($message_parts as $pid => $part)
+   {
+      $mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary);
+      if ($mimetype=='text/html')
+      {
+         return TRUE;
+      }
+   }
+    
+   return FALSE;
+}
+
+// return first HTML part of a message
+function rcmail_first_html_part($message_struct)
   {
-  if (!is_array($message_parts))
+  global $IMAP;
+
+  if (!is_array($message_struct['parts']))
     return FALSE;
     
   $html_part = NULL;
-      
+
   // check all message parts
-  foreach ($message_parts as $pid => $part)
+  foreach ($message_struct['parts'] as $pid => $part)
     {
     $mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary);
-    if ($mimetype=='text/plain')
+    if ($mimetype=='text/html')
       {
-      $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);
+      $html_part = $IMAP->get_message_part($message_struct['UID'], $pid, $part);
       }
     }
-    
 
-  // 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);
+    //$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 $html_part;
     }
 
   return FALSE;
-  }
+}
 
 
-// get source code of a specific message and cache it
-function rcmail_message_source($uid)
+// return first text part of a message
+function rcmail_first_text_part($message_struct)
   {
-  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;
+  global $IMAP;
 
+  if (empty($message_struct['parts']))
+    return $message_struct['UID'] ? $IMAP->get_body($message_struct['UID']) : false;
 
-  // let's cache the message body within the database
-  if ($cached && ($CONFIG['db_max_length'] -300) > $headers->size)
+  // check all message parts
+  foreach ($message_struct['parts'] as $pid => $part)
     {
-    $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;
-    }
+    $mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary);
 
+    if ($mimetype=='text/plain')
+      return $IMAP->get_message_part($message_struct['UID'], $pid, $part);
 
-  // create dir for caching
-  if (!is_dir($cache_dir))
-    $dir = mkdir($cache_dir);
-  else
-    $dir = true;
+    else if ($mimetype=='text/html')
+      {
+      $html_part = $IMAP->get_message_part($message_struct['UID'], $pid, $part);
+      
+      // remove special chars encoding
+      $trans = array_flip(get_html_translation_table(HTML_ENTITIES));
+      $html_part = strtr($html_part, $trans);
 
-  // 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);
+      // create instance of html2text class
+      $txt = new html2text($html_part);
+      return $txt->get_text();
+      }
     }
 
-  return $msg_source;
+  return FALSE;
   }
 
 
 // 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;
+  global $IMAP, $PRINT_MODE, $CONFIG, $OUTPUT, $EMAIL_ADDRESS_PATTERN;
   
   $a_parts = $IMAP->decode_address_list($input);
 
@@ -1392,19 +1374,19 @@ function rcmail_address_string($input, $max=NULL, $addicon=NULL)
     {
     $j++;
     if ($PRINT_MODE)
-      $out .= sprintf('%s &lt;%s&gt;', rep_specialchars_output($part['name']), $part['mailto']);
+      $out .= sprintf('%s &lt;%s&gt;', Q($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']));
+                      Q($part['mailto']),
+                      JS_OBJECT_NAME,
+                      JQ($part['mailto']),
+                      Q($part['mailto']),
+                      Q($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,
+                        JS_OBJECT_NAME,
                         urlencode($part['string']),
                         rcube_label('addtoaddressbook'),
                         $CONFIG['skin_path'],
@@ -1413,9 +1395,9 @@ function rcmail_address_string($input, $max=NULL, $addicon=NULL)
     else
       {
       if ($part['name'])
-        $out .= rep_specialchars_output($part['name']);
+        $out .= Q($part['name']);
       if ($part['mailto'])
-        $out .= (strlen($out) ? ' ' : '') . sprintf('&lt;%s&gt;', $part['mailto']);
+        $out .= (strlen($out) ? ' ' : '') . sprintf('&lt;%s&gt;', Q($part['mailto']));
       }
       
     if ($c>$j)
@@ -1439,27 +1421,24 @@ function rcmail_message_part_controls()
   if (!is_array($MESSAGE) || !is_array($MESSAGE['parts']) || !($_GET['_uid'] && $_GET['_part']) || !$MESSAGE['parts'][$_GET['_part']])
     return '';
     
-  $part = $MESSAGE['parts'][$_GET['_part']];
+  $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),
+                    Q(rcube_label('filename')),
+                    Q($part->filename),
                     str_replace('_frame=', '_download=', $_SERVER['QUERY_STRING']),
-                    rcube_label('download'));
+                    Q(rcube_label('download')));
     }
     
-  if ($filesize)
+  if ($part->size)
     $out .= sprintf('<tr><td class="title">%s</td><td>%s</td></tr>'."\n",
-                    rcube_label('filesize'),
-                    show_bytes($filesize));
+                    Q(rcube_label('filesize')),
+                    show_bytes($part->size));
   
   $out .= "\n</table>";
   
@@ -1478,51 +1457,39 @@ function rcmail_message_part_frame($attrib)
   $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>";
+  $out = '<iframe '. $attrib_str . "></iframe>";
     
   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']);
   }
-  
-  
-?>
+
+
+// register UI objects
+$OUTPUT->add_handlers(array(
+  'mailboxlist' => 'rcmail_mailbox_list',
+  'messages' => 'rcmail_message_list',
+  'messagecountdisplay' => 'rcmail_messagecount_display',
+  'quotadisplay' => 'rcmail_quota_display',
+  'messageheaders' => 'rcmail_message_headers',
+  'messagebody' => 'rcmail_message_body',
+  'messagecontentframe' => 'rcmail_messagecontent_frame',
+  'messagepartframe' => 'rcmail_message_part_frame',
+  'messagepartcontrols' => 'rcmail_message_part_controls',
+  'searchform' => 'rcmail_search_form'
+));
+
+?>
\ No newline at end of file
index 6322f707669450af52fc470ac041832c2656645f..42b52bfeb24af252d0f8a121fdd013cf33a49884 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: get.inc 147 2006-02-20 23:29:14Z roundcube $
+ $Id: get.inc 511 2007-03-19 22:36:24Z thomasb $
 
 */
 
@@ -29,7 +29,7 @@ if ($_GET['_preload'])
   $message = rcube_label('loadingdata');
 
   print "<html>\n<head>\n" .
-        '<meta http-equiv="refresh" content="0; url='.$url.'">' .
+        '<meta http-equiv="refresh" content="0; url='.htmlspecialchars($url).'">' .
         "\n</head>\n<body>" .
         $message .
         "\n</body>\n</html>";
@@ -37,23 +37,15 @@ if ($_GET['_preload'])
   }
 
 
-
 // similar code as in program/steps/mail/show.inc
 if ($_GET['_uid'])
   {
-  $MESSAGE = array();
-  $MESSAGE['source'] = rcmail_message_source($_GET['_uid']);
-
-  $mmd = new Mail_mimeDecode($MESSAGE['source']);
-  $MESSAGE['structure'] = $mmd->decode(array('include_bodies' => TRUE,
-                                             'decode_headers' => FALSE,
-                                             'decode_bodies' => FALSE));
-
-  $MESSAGE['parts'] = $mmd->getMimeNumbers($MESSAGE['structure']);
+  $MESSAGE = array('UID' => get_input_value('_uid', RCUBE_INPUT_GET));
+  $MESSAGE['structure'] = $IMAP->get_structure($MESSAGE['UID']);
+  $MESSAGE['parts'] = $IMAP->get_mime_numbers($MESSAGE['structure']);
   }
 
 
-
 // show part page
 if ($_GET['_frame'])
   {
@@ -61,43 +53,27 @@ if ($_GET['_frame'])
   exit;
   }
 
-else if ($_GET['_part'])
+else if ($pid = get_input_value('_part', RCUBE_INPUT_GET))
   {
-  if ($part = $MESSAGE['parts'][$_GET['_part']]);
+  if ($part = $MESSAGE['parts'][$pid]);
     {
     $ctype_primary = strtolower($part->ctype_primary);
     $ctype_secondary = strtolower($part->ctype_secondary);
-
     $mimetype = sprintf('%s/%s', $ctype_primary, $ctype_secondary);
-    $filename = $part->d_parameters['filename'] ? $part->d_parameters['filename'] : $part->ctype_parameters['name'];
-
-    if ($ctype_primary=='text' && $ctype_secondary=='html')
-      {
-      list($MESSAGE['parts']) = rcmail_parse_message($part,
-                                                     array('safe' => (bool)$_GET['_safe'],
-                                                           'prefer_html' => TRUE,
-                                                           'get_url' => $GET_URL.'&_part=%s'));
 
-      $cont = rcmail_print_body($MESSAGE['parts'][0], (bool)$_GET['_safe']);
-      }
-    else
-      $cont = $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']);
+    header("Expires: 0");
+    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+    header("Cache-Control: private", false);
+    header("Content-Transfer-Encoding: binary");
 
-    // send correct headers for content type and length
+    // send download headers
     if ($_GET['_download'])
       {
-      // send download headers
+      header("Cache-Control: private", false);
       header("Content-Type: application/octet-stream");
-      header(sprintf('Content-Disposition: attachment; filename="%s"',
-                     $filename ? $filename : "roundcube.$ctype_secondary"));
       }
     else
-      {
       header("Content-Type: $mimetype");
-      header(sprintf('Content-Disposition: inline; filename="%s"', $filename));
-      }
-
-    header(sprintf('Content-Length: %d', strlen($cont)));
 
     // We need to set the following headers to make downloads work using IE in HTTPS mode.
     if (isset($_SERVER['HTTPS']))
@@ -107,7 +83,37 @@ else if ($_GET['_part'])
       }
 
     // deliver part content
-    echo $cont;
+    if ($ctype_primary=='text' && $ctype_secondary=='html')
+      {
+      // we have to analyze the whole structure again to find inline objects
+      list($new_parts, $new_attachments) =
+        rcmail_parse_message($MESSAGE['structure'],
+                             array('safe' => (bool)$_GET['_safe'],
+                                   'prefer_html' => TRUE,
+                                   'get_url' => $GET_URL.'&_part=%s'));
+
+      $all_parts = array_merge($new_parts, $new_attachments);
+      for ($partix = 0; $partix < sizeof($all_parts); $partix++)
+        if ($all_parts[$partix]->mime_id == $pid)
+          $part = &$all_parts[$partix];
+
+      // get part body if not available
+      if (!$part->body)
+        $part->body = $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part);
+
+      $OUTPUT = new rcube_html_page();
+      $OUTPUT->write(rcmail_print_body($part, (bool)$_GET['_safe']));
+      }
+    else
+      {
+      header(sprintf('Content-Disposition: %s; filename="%s";',
+                     $part->disposition ? $part->disposition : 'attachment',
+                     $part->filename ? $part->filename : "roundcube.$ctype_secondary"));
+
+      // turn off output buffering and print part content
+      $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part->encoding, true);
+      }
+
     exit;
     }
   }
@@ -127,34 +133,13 @@ else
                                                  array('safe' => (bool)$_GET['_safe'],
                                                  'get_url' => $GET_URL.'&_part=%s'));
 
-  if ($MESSAGE['parts'] && $ctype_primary=='multipart')
-    {
-    // reset output page
-    $OUTPUT = new rcube_html_page();
-    parse_template('messagepart');
-    exit;
-    }
-  else if ($MESSAGE['parts'][0])
-    {
-    $part = $MESSAGE['parts'][0];
-    $cont = rcmail_print_body($part, (bool)$_GET['_safe']);
-    }
-  else
-    $cont = $IMAP->get_body($_GET['_uid']);
+  $cont = "<html>\n<head><title></title>\n</head>\n<body>";
+  $cont .= rcmail_message_body(array());
+  $cont .= "\n</body>\n</html>";
 
   $OUTPUT = new rcube_html_page();
   $OUTPUT->write($cont);
 
-/*
-    if ($mimetype=='text/html')
-      print $cont;
-    else
-      {
-      print "<html>\n<body>\n";
-      print $cont;
-      print "\n</body>\n</html>";
-      }
-*/
   exit;
   }
 
index 2e417e9782b4238f9e927e92bcb38db0d26efc62..41d0a6d5b1d05d95fbf09224669ab466d959bdbb 100644 (file)
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: getunread.inc 269 2006-06-29 23:41:40Z richs $
+ $Id: getunread.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
-$REMOTE_REQUEST = TRUE;
-
 $a_folders = $IMAP->list_mailboxes();
 
 if (!empty($a_folders))
-  {
+{
   foreach ($a_folders as $mbox_row)
-    {
-    $commands = sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_row), $IMAP->messagecount($mbox_row, 'UNSEEN'));
-    rcube_remote_response($commands, TRUE);
-    }
-  }
+    $OUTPUT->command('set_unread_count', $mbox_row, $IMAP->messagecount($mbox_row, 'UNSEEN'));
+}
 
-exit;
+$OUTPUT->send();
 ?>
index 02c15cf101cb2a591fec5cf826258efd126a492e..e93e9f9c275fa3935720c816501900aab5b70902 100644 (file)
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: list.inc 232 2006-05-18 15:46:50Z cmcnulty $
+ $Id: list.inc 575 2007-05-18 12:35:28Z thomasb $
 
 */
 
-$REMOTE_REQUEST = TRUE;
 $OUTPUT_TYPE = 'js';
-
-$sort = isset($_GET['_sort']) ? $_GET['_sort'] : false;
-
 // is there a sort type for this request?
-if ($sort)
-  {
+if ($sort = get_input_value('_sort', RCUBE_INPUT_GET))
+{
   // yes, so set the sort vars
   list($sort_col, $sort_order) = explode('_', $sort);
 
   // set session vars for sort (so next page and task switch know how to sort)
   $_SESSION['sort_col'] = $sort_col;
   $_SESSION['sort_order'] = $sort_order;
-  }
+}
 else
-  {
+{
   // use session settings if set, defaults if not
   $sort_col   = isset($_SESSION['sort_col'])   ? $_SESSION['sort_col']   : $CONFIG['message_sort_col'];
   $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order'];
-  }
-  
+}
 
-// we have a saved search request
-if (!empty($_GET['_search']) && isset($_SESSION['search'][$_GET['_search']]))
-  {
-  $a_msgs = split(',', $_SESSION['search'][$_GET['_search']]);
-  $a_headers = $IMAP->list_header_set($mbox_name, $a_msgs, NULL, $sort_col, $sort_order);
-  $count = count($a_msgs);
-  }
-else
-  {
-  if ($count = $IMAP->messagecount())
-    $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order);
-  }
+$mbox_name = $IMAP->get_mailbox_name();
+
+// fetch message headers
+if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh'])))
+  $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order);
 
-$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_GET['_refresh']) ? TRUE : FALSE);
+$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh']));
 
 // update message count display
 $pages = ceil($count/$IMAP->page_size);
-$commands = sprintf("this.set_env('messagecount', %d);\n", $count);
-$commands .= sprintf("this.set_env('pagecount', %d);\n", $pages);
-$commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text($count));
+$OUTPUT->set_env('messagecount', $count);
+$OUTPUT->set_env('pagecount', $pages);
+$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count));
 
 // update mailboxlist
-$mbox_name = $IMAP->get_mailbox_name();
-$commands .= sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_name), $unseen);
+$OUTPUT->command('set_unread_count', $mbox_name, $unseen);
 
 
 // add message rows
 if (isset($a_headers) && count($a_headers))
-  $commands .= rcmail_js_message_list($a_headers);
+  rcmail_js_message_list($a_headers);
 
   
 // send response
-rcube_remote_response($commands);
+$OUTPUT->send();
 
-exit;
 ?>
\ No newline at end of file
index fb5cb7eb4dfd55d424352625f0d69d0047d13638..3958329e739f6b093970a43bc9c96d36e164654b 100644 (file)
@@ -4,7 +4,7 @@
  | program/steps/mail/mark.inc                                           |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: mark.inc 232 2006-05-18 15:46:50Z cmcnulty $
+ $Id: mark.inc 573 2007-05-18 11:29:25Z thomasb $
 
 */
 
-$REMOTE_REQUEST = TRUE;
+$a_flags_map = array(
+  'undelete' => 'UNDELETED',
+  'delete' => 'DELETED',
+  'read' => 'SEEN',
+  'unread' => 'UNSEEN');
 
-$a_flags_map = array('undelete' => 'UNDELETED',
-                     'delete' => 'DELETED',
-                     'read' => 'SEEN',
-                     'unread' => 'UNSEEN');
+if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_value('_flag', RCUBE_INPUT_POST)))
+{
+  $flag = $a_flags_map[$flag] ? $a_flags_map[$flag] : strtoupper($flag);
+  $marked = $IMAP->set_flag($uids, $flag);
 
-if ($_GET['_uid'] && $_GET['_flag'])
-  {
-  $flag = $a_flags_map[$_GET['_flag']] ? $a_flags_map[$_GET['_flag']] : strtoupper($_GET['_flag']);
-  $marked = $IMAP->set_flag($_GET['_uid'], $flag);
   if ($marked != -1)
-    {
+  {
     $mbox_name = $IMAP->get_mailbox_name();
-    $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'));
-    rcube_remote_response($commands);
-    }
+    $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'));
+    $OUTPUT->send();
   }
+}
   
 exit;
 ?>
\ No newline at end of file
index 1d20e15775b2ab0dec318c240fcf0683c6a15449..82e6e761140569f4e13ddb8a41e10c721c4b0dc9 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/mail/move_del.inc                                       |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: move_del.inc 269 2006-06-29 23:41:40Z richs $
+ $Id: move_del.inc 573 2007-05-18 11:29:25Z thomasb $
 
 */
 
-$REMOTE_REQUEST = TRUE;
-
 // move messages
-if ($_action=='moveto' && $_GET['_uid'] && $_GET['_target_mbox'])
-  {
-  $count = sizeof(explode(',', $_GET['_uid']));  
-  $moved = $IMAP->move_message($_GET['_uid'], $_GET['_target_mbox'], $_GET['_mbox']);
+if ($_action=='moveto' && !empty($_POST['_uid']) && !empty($_POST['_target_mbox']))
+{
+  $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
+  $target = get_input_value('_target_mbox', RCUBE_INPUT_POST);
+  $moved = $IMAP->move_message($uids, $target, get_input_value('_mbox', RCUBE_INPUT_POST));
   
   if (!$moved)
-    {
+  {
     // send error message
-    $commands = "this.list_mailbox();\n";
-    $commands .= show_message('errormoving', 'error');
-    rcube_remote_response($commands);
+    $OUTPUT->command('list_mailbox');
+    $OUTPUT->show_message('errormoving', 'error');
+    $OUTPUT->send();
     exit;
-    }
   }
+}
 
 // delete messages 
-else if ($_action=='delete' && $_GET['_uid'])
-  {
-  $count = sizeof(explode(',', $_GET['_uid']));
-  $del = $IMAP->delete_message($_GET['_uid'], $_GET['_mbox']);
+else if ($_action=='delete' && !empty($_POST['_uid']))
+{
+  $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
+  $del = $IMAP->delete_message($uids, get_input_value('_mbox', RCUBE_INPUT_POST));
   
   if (!$del)
-    {
+  {
     // send error message
-    $commands = "this.list_mailbox();\n";
-    $commands .= show_message('errordeleting', 'error');
-    rcube_remote_response($commands);
+    $OUTPUT->command('list_mailbox');
+    $OUTPUT->show_message('errordeleting', 'error');
+    $OUTPUT->send();
     exit;
-    }
   }
+}
   
 // unknown action or missing query param
 else
-  {
   exit;
-  }
+
+// refresh saved seach set after moving some messages
+if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set)
+  $_SESSION['search'][$search_request] = $IMAP->refresh_search();
 
 
 // update message count display
-$pages = ceil($IMAP->messagecount()/$IMAP->page_size);
-$commands = sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
-$commands .= sprintf("this.set_env('pagecount', %d);\n", $pages);
+$msg_count = $IMAP->messagecount();
+$pages = ceil($msg_count / $IMAP->page_size);
+$OUTPUT->set_env('pagecount', $pages);
+$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count));
 
 
 // update mailboxlist
 $mbox = $IMAP->get_mailbox_name();
-$commands .= sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));
+$OUTPUT->command('set_unread_count', $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));
 
-if ($_action=='moveto')
-  $commands .= sprintf("this.set_unread_count('%s', %d);\n", $_GET['_target_mbox'], $IMAP->messagecount($_GET['_target_mbox'], 'UNSEEN'));
+if ($_action=='moveto' && $target)
+  $OUTPUT->command('set_unread_count', $target, $IMAP->messagecount($target, 'UNSEEN'));
 
-$commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota()); 
+$OUTPUT->command('set_quota', $IMAP->get_quota());
 
 // add new rows from next page (if any)
-if ($_GET['_from']!='show' && $pages>1 && $IMAP->list_page < $pages)
-  {
-  $a_headers = $IMAP->list_headers($mbox, null, $_SESSION['sort_col'], $_SESSION['sort_order']);
+if ($_POST['_from']!='show' && $pages>1 && $IMAP->list_page < $pages)
+{
+  $sort_col   = isset($_SESSION['sort_col'])   ? $_SESSION['sort_col']   : $CONFIG['message_sort_col'];
+  $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order'];
+  
+  $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order);
   $a_headers = array_slice($a_headers, -$count, $count);
-  $commands .= rcmail_js_message_list($a_headers);
-  }
 
-  
+  rcmail_js_message_list($a_headers);
+}
+
+
 // send response
-rcube_remote_response($commands);
+$OUTPUT->send();
 
-exit;
 ?>
diff --git a/program/steps/mail/quotadisplay.inc b/program/steps/mail/quotadisplay.inc
new file mode 100644 (file)
index 0000000..295cf03
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/mail/quotadisplay.inc                                   |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Remote call to return the quota image or text                       |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Robin Elfrink <robin@15augustus.nl>                           |
+ +-----------------------------------------------------------------------+
+
+ $Id: quotadisplay.inc 543 2007-04-28 18:07:12Z thomasb $
+
+*/
+
+$display = isset($_GET['_display']) ? $_GET['_display'] : 'text';
+$id = isset($_GET['_id']) ? $_GET['_id'] : 'rcmquotadisplay';
+$quota = rcmail_quota_content($display);
+$OUTPUT->remote_response(sprintf("this.gui_objects.%s.innerHTML = '%s';\n", $id, $quota));
+
+exit;
+?>
index a0ccf4186109d9c55383d92d9940578beeeef092..cba733e5153e7bd967516dd7d322de196e821c84 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Sjon Hortensius <sjon@hortensius.net>                         |
  +-----------------------------------------------------------------------+
 
- $Id: rss.inc 134 2006-02-05 16:35:40Z roundcube $
+ $Id: rss.inc 320 2006-08-18 12:48:33Z thomasb $
 
 */
 
@@ -42,7 +42,7 @@ $webmail_url .= '/';
 if (dirname($_SERVER['SCRIPT_NAME']) != '/')
        $webmail_url .= dirname($_SERVER['SCRIPT_NAME']).'/';
 
-$auth_webmail_url = $webmail_url.'?_auth='.$GLOBALS['sess_auth'];
+$webmail_url .= '?_task=mail';
 
 $messagecount_unread = $IMAP->messagecount('INBOX', 'UNSEEN', TRUE);
 $messagecount = $IMAP->messagecount();
@@ -68,7 +68,7 @@ echo '
                <ttl>5</ttl>
                <docs>http://blogs.law.harvard.edu/tech/rss</docs>
                <description>INBOX contains '.$messagecount.' messages, of which '.$messagecount_unread.' unread</description>
-               <link>'.rss_encode($auth_webmail_url, 'xml') .'</link>
+               <link>'.rss_encode($webmail_url, 'xml') .'</link>
                <title>webmail for '.rss_encode($_SESSION['username'].' @ '.$_SESSION['imap_host']).'</title>
                <generator>'.rss_encode($CONFIG['useragent'], 'xml').' (RSS extension by Sjon Hortensius)</generator>
                <image>
@@ -92,7 +92,7 @@ if ($messagecount > 0)
     if (strstr($item->from, '<'))
       $item->from = preg_replace('~"?([^"]*)"? <([^>]*)>~', '\2 (\1)', $item->from);
 
-    $item->link = $auth_webmail_url.'&_task=mail&_action=show&_uid='.$item->uid.'&_mbox=INBOX';
+    $item->link = $webmail_url.'&_task=mail&_action=show&_uid='.$item->uid.'&_mbox=INBOX';
 
     $item->body = $IMAP->get_body($item->uid);
 
index 517ef3008e666eb9dfa4660d0544ad3b84e5b703..bef821b4072c9f43c333e71d6c64dbfe23adeef1 100644 (file)
 
 $REMOTE_REQUEST = TRUE;
 
-// reset list_page
+// reset list_page and old search results
 $IMAP->set_page(1);
+$IMAP->set_search_set(NULL);
 $_SESSION['page'] = 1;
 
-// search query comes in with ISO encoding because javascript escape()
-// uses ISO-8859-1. Better handling for that will follow.
-$imap_charset = 'ISO-8859-1';
+// using encodeURI with javascript "should" give us
+// a correctly UTF-8 encoded query string
+$imap_charset = 'UTF-8';
 
 // get search string
-$str = get_input_value('_search', RCUBE_INPUT_GET);
+$str = get_input_value('_q', RCUBE_INPUT_GET);
 $mbox = get_input_value('_mbox', RCUBE_INPUT_GET);
-$search_request = md5($str);
+$search_request = md5($mbox.$str);
 
 
 // Check the search string for type of search
-if (preg_match("/^from:/i", $str)) {
+if (preg_match("/^from:/i", $str))
+{
   list(,$srch) = explode(":", $str);
-  $search = $IMAP->search($mbox, "HEADER FROM" ,trim($srch), $imap_charset);
-  finish_search($mbox, $search);
+  $subject =  "HEADER FROM";
+  $search = trim($srch);
 }
-else if (preg_match("/^to:/i", $str)) {
+else if (preg_match("/^to:/i", $str))
+{
   list(,$srch) = explode(":", $str);
-  $search = $IMAP->search($mbox, "HEADER TO", trim($srch), $imap_charset);
-  finish_search($mbox, $search);
+  $subject = "HEADER TO";
+  $search = trim($srch);
 }
-else if (preg_match("/^cc:/i", $str)) {
+else if (preg_match("/^cc:/i", $str))
+{
   list(,$srch) = explode(":", $str);
-  $search = $IMAP->search($mbox, "HEADER CC", trim($srch), $imap_charset);
-  finish_search($mbox, $search);
+  $subject = "HEADER CC";
+  $search = trim($srch);
 }
-else if (preg_match("/^subject:/i", $str)) {
+else if (preg_match("/^subject:/i", $str))
+{
   list(,$srch) = explode(":", $str);
-  $search = $IMAP->search($mbox, "HEADER SUBJECT", trim($srch), $imap_charset);
-  finish_search($mbox, $search);
+  $subject = "HEADER SUBJECT";
+  $search = trim($srch);
 }
-else if (preg_match("/^body:/i", $str)) {
+else if (preg_match("/^body:/i", $str))
+{
   list(,$srch) = explode(":", $str);
-  $search = $IMAP->search($mbox, "TEXT", trim($srch), $imap_charset);
-  finish_search($mbox, $search);
+  $subject = "TEXT";
+  $search = trim($srch);
 }
 // search in subject and sender by default
-else {
-  $search = $IMAP->search($mbox, "HEADER SUBJECT", trim($str), $imap_charset);
-  $search2 = $IMAP->search($mbox, "HEADER FROM", trim($str), $imap_charset);
-  finish_search($mbox, array_unique(array_merge($search, $search2)));
+else
+{
+  $subject = array("HEADER SUBJECT", "HEADER FROM");
+  $search = trim($str);
 }
 
 
-// Complete the search display results or report error
-function finish_search($mbox, $search)
-  {
-  global $IMAP, $JS_OBJECT_NAME, $OUTPUT, $search_request;
-  $commands = '';
-  $count = 0;
-    
-  // Make sure our $search is legit..
-  if (is_array($search) && $search[0] != '')
-    {
-    // Get the headers
-    $result_h = $IMAP->list_header_set($mbox, $search, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
-    $count = count($search);
+// execute IMAP search
+$result = $IMAP->search($mbox, $subject, $search, $imap_charset);
+$count = 0;
+  
+// Make sure our $result is legit..
+if (is_array($result) && $result[0] != '')
+{
+  // Get the headers
+  $result_h = $IMAP->list_header_set($mbox, $result, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
+  $count = count($result_h);
 
-    // save search results in session
-    if (!is_array($_SESSION['search']))
-      $_SESSION['search'] = array();
+  // save search results in session
+  if (!is_array($_SESSION['search']))
+    $_SESSION['search'] = array();
 
-    // Make sure we got the headers
-    if ($result_h != NULL)
-      {
-      $_SESSION['search'][$search_request] = join(',', $search);
-      $commands = rcmail_js_message_list($result_h);
-      $commands .= show_message('searchsuccessful', 'confirmation', array('nr' => $count));
-      }
-    }
-  else
-    {
-    $commands = show_message('searchnomatch', 'warning');
-    $search_request = -1;
-    }
-  
-  // update message count display
-  $pages = ceil($count/$IMAP->page_size);
-  $commands .= sprintf("\nthis.set_env('search_request', '%s')\n", $search_request);
-  $commands .= sprintf("this.set_env('messagecount', %d);\n", $count);
-  $commands .= sprintf("this.set_env('pagecount', %d);\n", $pages);
-  $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text($count, 1));
-  rcube_remote_response($commands);
+  // Make sure we got the headers
+  if ($result_h != NULL)
+  {
+    $_SESSION['search'][$search_request] = $IMAP->get_search_set();
+    rcmail_js_message_list($result_h);
+    $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count));
   }
+}
+else
+{
+  $OUTPUT->show_message('searchnomatch', 'warning');
+  $search_request = -1;
+}
+
+// update message count display
+$pages = ceil($count/$IMAP->page_size);
+$OUTPUT->set_env('search_request', $search_request);
+$OUTPUT->set_env('messagecount', $count);
+$OUTPUT->set_env('pagecount', $pages);
+$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1));
+$OUTPUT->send();
 
 ?>
\ No newline at end of file
index 607badb44987049bd40f5a3c6c386beca8b0240b..88510107a1f23a05ef5b919e4586b8926c2826ff 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/mail/sendmail.inc                                       |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: sendmail.inc 288 2006-07-31 22:51:23Z thomasb $
+ $Id: sendmail.inc 556 2007-05-13 18:25:52Z thomasb $
 
 */
 
 
 //require_once('lib/smtp.inc');
 require_once('include/rcube_smtp.inc');
-require_once('Mail/mime.php');
+require_once('lib/html2text.inc');
+require_once('lib/rc_mail_mime.inc');
 
 
 if (!isset($_SESSION['compose']['id']))
@@ -38,7 +39,7 @@ if (!isset($_SESSION['compose']['id']))
 
 function rcmail_get_identity($id)
   {
-  global $DB, $CHARSET, $OUTPUT;
+  global $DB, $OUTPUT;
   
   // get identity record
   $sql_result = $DB->query("SELECT *, email AS mailto
@@ -54,7 +55,7 @@ function rcmail_get_identity($id)
     $out = $sql_arr;
     $name = strpos($sql_arr['name'], ",") ? '"'.$sql_arr['name'].'"' : $sql_arr['name'];
     $out['string'] = sprintf('%s <%s>',
-                             rcube_charset_convert($name, $CHARSET, $OUTPUT->get_charset()),
+                             rcube_charset_convert($name, RCMAIL_CHARSET, $OUTPUT->get_charset()),
                              $sql_arr['mailto']);
     return $out;
     }
@@ -62,26 +63,84 @@ function rcmail_get_identity($id)
   return FALSE;  
   }
 
+/**
+ * go from this:
+ * <img src=".../tiny_mce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" />
+ *
+ * to this:
+ *
+ * <IMG src="cid:smiley-cool.gif"/>
+ * ...
+ * ------part...
+ * Content-Type: image/gif
+ * Content-Transfer-Encoding: base64
+ * Content-ID: <smiley-cool.gif>
+ */
+function rcmail_attach_emoticons(&$mime_message)
+{
+  global $CONFIG, $INSTALL_PATH;
+
+  $htmlContents = $mime_message->getHtmlBody();
+
+  // remove any null-byte characters before parsing
+  $body = preg_replace('/\x00/', '', $htmlContents);
+  
+  $last_img_pos = 0;
+
+  $searchstr = 'program/js/tiny_mce/plugins/emotions/images/';
+
+  // keep track of added images, so they're only added once
+  $included_images = array();
+
+  // find emoticon image tags
+  while ($pos = strpos($body, $searchstr, $last_img_pos))
+    {
+    $pos2 = strpos($body, '"', $pos);
+    $body_pre = substr($body, 0, $pos);
+    $image_name = substr($body,
+                         $pos + strlen($searchstr),
+                         $pos2 - ($pos + strlen($searchstr)));
+    // sanitize image name so resulting attachment doesn't leave images dir
+    $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i','',$image_name);
+
+    $body_post = substr($body, $pos2);
+
+    if (! in_array($image_name, $included_images))
+      {
+      // add the image to the MIME message
+      $img_file = $INSTALL_PATH . '/' . $searchstr . $image_name;
+      if(! $mime_message->addHTMLImage($img_file, 'image/gif', '', true, '_' . $image_name))
+        $OUTPUT->show_message("emoticonerror", 'error');
+
+      array_push($included_images, $image_name);
+      }
+
+    $body = $body_pre . 'cid:_' . $image_name . $body_post;
+
+    $last_img_pos = $pos2;
+    }
+   
+  $mime_message->setHTMLBody($body);
+}
 
 if (strlen($_POST['_draft_saveid']) > 3)
   $olddraftmessageid = get_input_value('_draft_saveid', RCUBE_INPUT_POST);
 
-$message_id = sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), $_SESSION['imap_host']);
+$message_id = sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), rcmail_mail_domain($_SESSION['imap_host']));
 $savedraft = !empty($_POST['_draft']) ? TRUE : FALSE;
 
 // remove all scripts and act as called in frame
 $OUTPUT->reset();
-$_framed = TRUE;
+$OUTPUT->framed = TRUE;
 
 
 /****** check submission and compose message ********/
 
 
-if (empty($_POST['_to']) && empty($_POST['_subject']) && $_POST['_message'])
+if (!$savedraft && empty($_POST['_to']) && empty($_POST['_subject']) && $_POST['_message'])
   {
-  show_message("sendingfailed", 'error'); 
-  //rcmail_overwrite_action('compose');
-  rcube_iframe_response();
+  $OUTPUT->show_message("sendingfailed", 'error');
+  $OUTPUT->send('iframe');
   return;
   }
 
@@ -90,8 +149,8 @@ if (empty($_POST['_to']) && empty($_POST['_subject']) && $_POST['_message'])
 $input_charset = $OUTPUT->get_charset();
 $message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset;
 
-$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m');
-$mailto_replace = array(', ', ', ', '');
+$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/');
+$mailto_replace = array(', ', ', ', '', ',');
 
 // replace new lines and strip ending ', '
 $mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset));
@@ -107,9 +166,9 @@ if (empty($identity_arr['string']))
   $identity_arr['string'] = $from;
 
 // compose headers array
-$headers = array('Date' => date('D, j M Y G:i:s O'),
-                 'From' => $identity_arr['string'],
-                 'To'   => rcube_charset_convert($mailto, $input_charset, $message_charset));
+$headers = array('Date' => date('D, j M Y H:i:s O'),
+                 'From' => rcube_charset_convert($identity_arr['string'], RCMAIL_CHARSET, $message_charset),
+                 'To'   => $mailto);
 
 // additional recipients
 if (!empty($_POST['_cc']))
@@ -139,7 +198,7 @@ if (!empty($_SESSION['compose']['references']))
 if (!empty($_POST['_priority']))
   {
   $priority = (int)$_POST['_priority'];
-  $a_priorities = array(1=>'lowest', 2=>'low', 4=>'high', 5=>'highest');
+  $a_priorities = array(1=>'highest', 2=>'high', 4=>'low', 5=>'lowest');
   if ($str_priority = $a_priorities[$priority])
     $headers['X-Priority'] = sprintf("%d (%s)", $priority, ucfirst($str_priority));
   }
@@ -183,22 +242,45 @@ else if (strtolower(substr(PHP_OS, 0, 3)=='mac'))
 else    
   $header_delm = "\n";
 
-// create PEAR::Mail_mime instance
-$MAIL_MIME = new Mail_mime($header_delm);
-$MAIL_MIME->setTXTBody($message_body, FALSE, TRUE);
-//$MAIL_MIME->setTXTBody(wordwrap($message_body), FALSE, TRUE);
+
+$isHtmlVal = strtolower(get_input_value('_is_html', RCUBE_INPUT_POST));
+$isHtml = ($isHtmlVal == "1");
+
+// create extended PEAR::Mail_mime instance
+$MAIL_MIME = new rc_mail_mime($header_delm);
+
+// For HTML-formatted messages, construct the MIME message with both
+// the HTML part and the plain-text part
+
+if ($isHtml)
+  {
+  $MAIL_MIME->setHTMLBody($message_body);
+
+  // add a plain text version of the e-mail as an alternative part.
+  $h2t = new html2text($message_body);
+  $plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true);
+  $MAIL_MIME->setTXTBody($plainTextPart);
+
+  // look for "emoticon" images from TinyMCE and copy into message as attachments
+  rcmail_attach_emoticons($MAIL_MIME);
+  }
+else
+  {
+  $message_body = wordwrap($message_body, 75, "\r\n");
+  $message_body = wordwrap($message_body, 998, "\r\n", true);
+  $MAIL_MIME->setTXTBody($message_body, FALSE, TRUE);
+  }
 
 
 // add stored attachments, if any
 if (is_array($_SESSION['compose']['attachments']))
   foreach ($_SESSION['compose']['attachments'] as $attachment)
-    $MAIL_MIME->addAttachment($attachment['path'], $attachment['mimetype'], $attachment['name'], TRUE);
+    $MAIL_MIME->addAttachment($attachment['path'], $attachment['mimetype'], $attachment['name'], true, 'base64', 'attachment', $message_charset);
 
-  
 // add submitted attachments
 if (is_array($_FILES['_attachments']['tmp_name']))
   foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
-    $MAIL_MIME->addAttachment($filepath, $files['type'][$i], $files['name'][$i], TRUE);
+    $MAIL_MIME->addAttachment($filepath, $files['type'][$i], $files['name'][$i], true, 'base64', 'attachment', $message_charset);
 
 
 // chose transfer encoding
@@ -206,20 +288,27 @@ $charset_7bit = array('ASCII', 'ISO-2022-JP', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8
 $transfer_encoding = in_array(strtoupper($message_charset), $charset_7bit) ? '7bit' : '8bit';
 
 // encoding settings for mail composing
-$message_param = array('text_encoding' => $transfer_encoding,
-                       'html_encoding' => 'quoted-printable',
-                       'head_encoding' => 'quoted-printable',
-                       'head_charset'  => $message_charset,
-                       'html_charset'  => $message_charset,
-                       'text_charset'  => $message_charset);
+$message_param = array(
+  'text_encoding' => $transfer_encoding,
+  'html_encoding' => 'quoted-printable',
+  'head_encoding' => 'quoted-printable',
+  'head_charset'  => $message_charset,
+  'html_charset'  => $message_charset,
+  'text_charset'  => $message_charset,
+);
 
 // compose message body and get headers
-$msg_body = &$MAIL_MIME->get($message_param);
-
-$msg_subject = $headers['Subject'];
+$msg_body = $MAIL_MIME->get($message_param);
+// unset to save memory.
+unset($MAIL_MIME->_parts);
 
+// encoding subject header with mb_encode provides better results with asian characters
 if ($MBSTRING && function_exists("mb_encode_mimeheader"))
-  $headers['Subject'] = mb_encode_mimeheader($headers['Subject'], $message_charset);
+{
+  mb_internal_encoding($message_charset);
+  $mb_subject = mb_encode_mimeheader($headers['Subject'], $message_charset, 'Q');
+  mb_internal_encoding(RCMAIL_CHARSET);
+}
 
 // Begin SMTP Delivery Block 
 if (!$savedraft) {
@@ -239,21 +328,17 @@ if (!$savedraft) {
     $send_headers = $headers;
     unset($send_headers['Bcc']);
   
-    // generate message headers
-    $header_str = $MAIL_MIME->txtHeaders($send_headers);
+    if (!empty($mb_subject))
+      $send_headers['Subject'] = $mb_subject;
   
     // send message
-    $sent = smtp_mail($from, $a_recipients, $header_str, $msg_body);
+    $smtp_response = array();
+    $sent = smtp_mail($from, $a_recipients, $MAIL_MIME->txtHeaders($send_headers), $msg_body, $smtp_response);
   
     // log error
     if (!$sent)
-      {
-      raise_error(array('code' => 800,
-                        'type' => 'smtp',
-                        'line' => __LINE__,
-                        'file' => __FILE__,
-                        'message' => "SMTP error: $SMTP_ERROR"), TRUE, FALSE);
-      }
+      raise_error(array('code' => 800, 'type' => 'smtp', 'line' => __LINE__, 'file' => __FILE__,
+                        'message' => "SMTP error: ".join("\n", $smtp_response)), TRUE, FALSE);
     }
   
   // send mail using PHP's mail() function
@@ -264,6 +349,9 @@ if (!$savedraft) {
     $headers_php = $MAIL_MIME->_headers;
     unset($headers_php['To'], $headers_php['Subject']);
     
+    if (!empty($mb_subject))
+      $headers_enc['Subject'] = $mb_subject;
+    
     // reset stored headers and overwrite
     $MAIL_MIME->_headers = array();
     $header_str = $MAIL_MIME->txtHeaders($headers_php);
@@ -278,8 +366,8 @@ if (!$savedraft) {
   // return to compose page if sending failed
   if (!$sent)
     {
-    show_message("sendingfailed", 'error'); 
-    rcube_iframe_response();
+    $OUTPUT->show_message("sendingfailed", 'error'); 
+    $OUTPUT->send('iframe');
     return;
     }
   
@@ -319,13 +407,11 @@ if ($CONFIG[$store_target])
   // raise error if saving failed
   if (!$saved)
     {
-    raise_error(array('code' => 800,
-                      'type' => 'imap',
-                      'file' => __FILE__,
+    raise_error(array('code' => 800, 'type' => 'imap', 'file' => __FILE__,
                       'message' => "Could not save message in $CONFIG[$store_target]"), TRUE, FALSE);
     
-    show_message('errorsaving', 'error');
-    rcube_iframe_response($errorout);
+    $OUTPUT->show_message('errorsaving', 'error');
+    $OUTPUT->send('iframe');
     }
 
   if ($olddraftmessageid)
@@ -336,41 +422,36 @@ if ($CONFIG[$store_target])
 
     // raise error if deletion of old draft failed
     if (!$deleted)
-      raise_error(array('code' => 800,
-                        'type' => 'imap',
-                        'file' => __FILE__,
+      raise_error(array('code' => 800, 'type' => 'imap', 'file' => __FILE__,
                         'message' => "Could not delete message from ".$CONFIG['drafts_mbox']), TRUE, FALSE);
     }
   }
 
 if ($savedraft)
   {
-  // clear the "saving message" busy status, and display success
-  show_message('messagesaved', 'confirmation');
-
-  // update "_draft_saveid" on the page, which is used to delete a previous draft
-  $frameout = "var foundid = parent.rcube_find_object('_draft_saveid', parent.document);\n";
-  $frameout .= sprintf("foundid.value = '%s';\n", str_replace(array('<','>'), "", $message_id));
+  // display success
+  $OUTPUT->show_message('messagesaved', 'confirmation');
 
-  // update the "cmp_hash" to prevent "Unsaved changes" warning
-  $frameout .= sprintf("parent.%s.cmp_hash = parent.%s.compose_field_hash();\n", $JS_OBJECT_NAME, $JS_OBJECT_NAME);
+  // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning
+  $OUTPUT->command('set_draft_id', str_replace(array('<','>'), "", $message_id));
+  $OUTPUT->command('compose_field_hash', true);
 
   // start the auto-save timer again
-  $frameout .= sprintf("parent.%s.auto_save_start();", $JS_OBJECT_NAME);
+  $OUTPUT->command('auto_save_start');
 
-  // send html page with JS calls as response
-  rcube_iframe_response($frameout);
+  $OUTPUT->send('iframe');
   }
 else
   {
   if ($CONFIG['smtp_log'])
     {
-    $log_entry = sprintf("[%s] User: %d on %s; Message for %s; Subject: %s\n",
-                 date("d-M-Y H:i:s O", mktime()),
-                 $_SESSION['user_id'],
-                 $_SERVER['REMOTE_ADDR'],
-                 $mailto,
-                 $msg_subject);
+    $log_entry = sprintf(
+      "[%s] User: %d on %s; Message for %s; %s\n",
+      date("d-M-Y H:i:s O", mktime()),
+      $_SESSION['user_id'],
+      $_SERVER['REMOTE_ADDR'],
+      $mailto,
+      !empty($smtp_response) ? join('; ', $smtp_response) : '');
 
     if ($fp = @fopen($CONFIG['log_dir'].'/sendmail', 'a'))
       {
@@ -380,8 +461,8 @@ else
     }
 
   rcmail_compose_cleanup();
-  rcube_iframe_response(sprintf("parent.$JS_OBJECT_NAME.sent_successfully('%s');",
-                                rep_specialchars_output(rcube_label('messagesent'), 'js')));
+  $OUTPUT->command('sent_successfully', rcube_label('messagesent'));
+  $OUTPUT->send('iframe');
   }
 
 
index bbf43b8a48735ad035c683f1d8b73e125cbf844c..e35ff205f9ca2d8e4b589fc386199ae37fd1a01d 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/mail/show.inc                                           |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: show.inc 277 2006-07-19 19:36:35Z thomasb $
+ $Id: show.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
@@ -23,78 +23,96 @@ require_once('Mail/mimeDecode.php');
 
 $PRINT_MODE = $_action=='print' ? TRUE : FALSE;
 
-
 // similar code as in program/steps/mail/get.inc
 if ($_GET['_uid'])
   {
-  $MESSAGE = array();
-  $MESSAGE['headers'] = $IMAP->get_headers($_GET['_uid']);
-  $MESSAGE['source'] = rcmail_message_source($_GET['_uid']);
+  $MESSAGE = array('UID' => get_input_value('_uid', RCUBE_INPUT_GET));
+  $MESSAGE['headers'] = $IMAP->get_headers($MESSAGE['UID']);
   
   // go back to list if message not found (wrong UID)
-  if (!$MESSAGE['headers'] || !$MESSAGE['source'])
+  if (!$MESSAGE['headers'])
     {
-    $_action = 'list';
-    return;
+    $OUTPUT->show_message('messageopenerror', 'error');
+    if ($_action=='preview' && template_exists('messagepreview'))
+        parse_template('messagepreview');
+    else
+      {
+      $_action = 'list';
+      return;
+      }
     }
 
-  $mmd = new Mail_mimeDecode($MESSAGE['source']);
-  $MESSAGE['structure'] = $mmd->decode(array('include_bodies' => TRUE,
-                                             'decode_headers' => FALSE,
-                                             'decode_bodies' => FALSE));
-                                             
-  $mmd->getMimeNumbers($MESSAGE['structure']);
+  // calculate Etag for this request
+  $etag = md5($MESSAGE['UID'].$IMAP->get_mailbox_name().session_id().($PRINT_MODE?1:0));
 
-  $MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['structure']->headers['subject']);
+  // allow caching, unless remote images are present
+  if ((bool)get_input_value('_safe', RCUBE_INPUT_GET))
+    send_nocacheing_headers();
+  else
+    send_modified_header($_SESSION['login_time'], $etag);
 
-  if ($MESSAGE['structure'])
-    list($MESSAGE['parts'], $MESSAGE['attachments']) = rcmail_parse_message($MESSAGE['structure'],
-                                                                           array('safe' => (bool)$_GET['_safe'],
-                                                                                 'prefer_html' => $CONFIG['prefer_html'],
-                                                                                 'get_url' => $GET_URL.'&_part=%s'));
+  $MESSAGE['subject'] = rcube_imap::decode_mime_string($MESSAGE['headers']->subject, $MESSAGE['headers']->charset);
+  $OUTPUT->set_pagetitle($MESSAGE['subject']);
+  
+  if ($MESSAGE['structure'] = $IMAP->get_structure($MESSAGE['UID']))
+    list($MESSAGE['parts'], $MESSAGE['attachments']) = rcmail_parse_message(
+      $MESSAGE['structure'],
+      array('safe' => (bool)$_GET['_safe'],
+            'prefer_html' => $CONFIG['prefer_html'],
+            'get_url' => $GET_URL.'&_part=%s')
+      );
   else
-    $MESSAGE['body'] = $IMAP->get_body($_GET['_uid']);
+    $MESSAGE['body'] = $IMAP->get_body($MESSAGE['UID']);
 
 
   // mark message as read
-  if (!$MESSAGE['headers']->seen)
-    $IMAP->set_flag($_GET['_uid'], 'SEEN');
+  if (!$MESSAGE['headers']->seen && $_action != 'preview')
+    $IMAP->set_flag($MESSAGE['UID'], 'SEEN');
 
   // give message uid to the client
-  $javascript = sprintf("%s.set_env('uid', '%s');\n", $JS_OBJECT_NAME, $_GET['_uid']);
-  $javascript .= sprintf("%s.set_env('safemode', '%b');", $JS_OBJECT_NAME, $_GET['_safe']);
+  $OUTPUT->set_env('uid', $MESSAGE['UID']);
+  $OUTPUT->set_env('safemode', (bool)$_GET['_safe']);
 
   $next = $prev = -1;
-  // get previous and next message UID
+  // get previous, first, next and last message UID
   if (!($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] == 'DESC') && 
-      $IMAP->get_capability('sort')) {
-      // Only if we use custom sorting
-      $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']);
+      $IMAP->get_capability('sort')) 
+    {
+    // Only if we use custom sorting
+    $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']);
  
-      $MESSAGE['index'] = array_search((string)$_GET['_uid'], $a_msg_index, TRUE);
-      $prev = isset($a_msg_index[$MESSAGE['index']-1]) ? $a_msg_index[$MESSAGE['index']-1] : -1 ;
-      $next = isset($a_msg_index[$MESSAGE['index']+1]) ? $a_msg_index[$MESSAGE['index']+1] : -1 ;
-  } else {
-      // this assumes that we are sorted by date_DESC
-      $seq = $IMAP->get_id($_GET['_uid']);
-      $prev = $IMAP->get_uid($seq + 1);
-      $next = $IMAP->get_uid($seq - 1);
-      $MESSAGE['index'] = $IMAP->messagecount() - $seq;
-  }
+    $MESSAGE['index'] = array_search((string)$MESSAGE['UID'], $a_msg_index, TRUE);
+    $prev = isset($a_msg_index[$MESSAGE['index']-1]) ? $a_msg_index[$MESSAGE['index']-1] : -1 ;
+    $first = count($a_msg_index)>0 ? $a_msg_index[0] : -1;
+    $next = isset($a_msg_index[$MESSAGE['index']+1]) ? $a_msg_index[$MESSAGE['index']+1] : -1 ;
+    $last = count($a_msg_index)>0 ? $a_msg_index[count($a_msg_index)-1] : -1;
+    }
+  else
+    {
+    // this assumes that we are sorted by date_DESC
+    $seq = $IMAP->get_id($MESSAGE['UID']);
+    $prev = $IMAP->get_uid($seq + 1);
+    $first = $IMAP->get_uid($IMAP->messagecount());
+    $next = $IMAP->get_uid($seq - 1);
+    $last = $IMAP->get_uid(1);
+    $MESSAGE['index'] = $IMAP->messagecount() - $seq;
+    }
   
   if ($prev > 0)
-    $javascript .= sprintf("\n%s.set_env('prev_uid', '%s');", $JS_OBJECT_NAME, $prev);
+    $OUTPUT->set_env('prev_uid', $prev);
+  if ($first >0)
+    $OUTPUT->set_env('first_uid', $first);
   if ($next > 0)
-    $javascript .= sprintf("\n%s.set_env('next_uid', '%s');", $JS_OBJECT_NAME, $next);
-
-  $OUTPUT->add_script($javascript);
+    $OUTPUT->set_env('next_uid', $next);
+  if ($last >0)
+    $OUTPUT->set_env('last_uid', $last);
   }
 
 
 
 function rcmail_message_attachments($attrib)
   {
-  global $CONFIG, $OUTPUT, $PRINT_MODE, $MESSAGE, $GET_URL, $JS_OBJECT_NAME;
+  global $CONFIG, $OUTPUT, $PRINT_MODE, $MESSAGE, $GET_URL;
 
   if (sizeof($MESSAGE['attachments']))
     {
@@ -106,16 +124,16 @@ function rcmail_message_attachments($attrib)
       {
       if ($PRINT_MODE)
         $out .= sprintf('<li>%s (%s)</li>'."\n",
-                        $attach_prop['filename'],
-                        show_bytes($attach_prop['size']));
+                        $attach_prop->filename,
+                        show_bytes($attach_prop->size));
       else
         $out .= sprintf('<li><a href="%s&amp;_part=%s" onclick="return %s.command(\'load-attachment\',{part:\'%s\', mimetype:\'%s\'},this)">%s</a></li>'."\n",
-                        htmlentities($GET_URL),
-                        $attach_prop['part_id'],
-                        $JS_OBJECT_NAME,
-                        $attach_prop['part_id'],
-                        $attach_prop['mimetype'],
-                        $attach_prop['filename']);
+                        htmlspecialchars($GET_URL),
+                        $attach_prop->mime_id,
+                        JS_OBJECT_NAME,
+                        $attach_prop->mime_id,
+                        $attach_prop->mimetype,
+                        $attach_prop->filename);
       }
 
     $out .= "</ul>";
@@ -125,31 +143,9 @@ function rcmail_message_attachments($attrib)
 
 
 
-// return an HTML iframe for loading mail content
-function rcmail_messagecontent_frame($attrib)
-  {
-  global $COMM_PATH, $OUTPUT, $GET_URL, $JS_OBJECT_NAME;
-  
-  // allow the following attributes to be added to the <iframe> tag
-  $attrib_str = create_attrib_string($attrib);
-  $framename = 'rcmailcontentwindow';
-  
-  $out = sprintf('<iframe src="%s" name="%s"%s>%s</iframe>'."\n",
-         $GET_URL,
-         $framename,
-         $attrib_str,
-         rcube_label('loading'));
-
-
-  $OUTPUT->add_script("$JS_OBJECT_NAME.set_env('contentframe', '$framename');");
-
-  return $out;
-  }
-
-
 function rcmail_remote_objects_msg($attrib)
   {
-  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME;
+  global $CONFIG, $OUTPUT;
   
   if (!$attrib['id'])
     $attrib['id'] = 'rcmremoteobjmsg';
@@ -158,21 +154,27 @@ function rcmail_remote_objects_msg($attrib)
   $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
   $out = '<div' . $attrib_str . ">";
   
-  $out .= rep_specialchars_output(sprintf('%s&nbsp;<a href="#loadimages" onclick="%s.command(\'load-images\')" title="%s">%s</a>',
-                                  rcube_label('blockedimages'),
-                                  $JS_OBJECT_NAME,
-                                  rcube_label('showimages'),
-                                  rcube_label('showimages')));
+  $out .= sprintf('%s&nbsp;<a href="#loadimages" onclick="%s.command(\'load-images\')">%s</a>',
+                  Q(rcube_label('blockedimages')),
+                  JS_OBJECT_NAME,
+                  Q(rcube_label('showimages')));
   
   $out .= '</div>';
   
-  $OUTPUT->add_script(sprintf("%s.gui_object('remoteobjectsmsg', '%s');", $JS_OBJECT_NAME, $attrib['id']));
+  $OUTPUT->add_gui_object('remoteobjectsmsg', $attrib['id']);
   return $out;
   }
 
 
-if ($_action=='print')
+$OUTPUT->add_handlers(array(
+  'messageattachments' => 'rcmail_message_attachments',
+  'blockedobjects' => 'rcmail_remote_objects_msg'));
+
+
+if ($_action=='print' && template_exists('printmessage'))
   parse_template('printmessage');
+else if ($_action=='preview' && template_exists('messagepreview'))
+    parse_template('messagepreview');
 else
   parse_template('message');
 ?>
\ No newline at end of file
index ea22a32a0ee29a34270753d523df8c88fc444837..0c8021bb402aac07d7f542fc81c82356854b215d 100644 (file)
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: spell.inc 265 2006-06-25 10:04:45Z thomasb $
+ $Id: spell.inc 321 2006-08-20 14:06:30Z thomasb $
 
 */
 
 $REMOTE_REQUEST = TRUE;
 
-$google = "ssl://www.google.com";
+// default settings
+$host = "ssl://www.google.com";
 $port = 443;
-$lang = $_GET['lang'];
+$lang = get_input_value('lang', RCUBE_INPUT_GET);
 $path = "/tbproxy/spell?lang=$lang";
+
+// spell check uri is configured
+if (!empty($CONFIG['spellcheck_uri']))
+  {
+  $a_uri = parse_url($CONFIG['spellcheck_uri']);
+  $ssl = ($a_uri['scheme']=='https' || $a_uri['scheme']=='ssl');
+  $port = $a_uri['port'] ? $a_uri['port'] : ($ssl ? 443 : 80);
+  $host = ($ssl ? 'ssl://' : '') . $a_uri['host'];
+  $path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '') . $lang;
+  }
+
 $data = file_get_contents('php://input');
 $store = "";
 
-if ($fp = fsockopen($google, $port, $errno, $errstr, 30))
+if ($fp = fsockopen($host, $port, $errno, $errstr, 30))
   {
   $out = "POST $path HTTP/1.0\r\n";
-  $out .= "Host: $google\r\n";
+  $out .= "Host: $host\r\n";
   $out .= "Content-Length: " . strlen($data) . "\r\n";
   $out .= "Content-type: application/x-www-form-urlencoded\r\n";
   $out .= "Connection: Close\r\n\r\n";
index 22fb7c8eefa1b61c3aa79f2bd662ec41068de0ae..2e9aac37ab87c8e221578c8c11cabb8151ec4a3d 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: upload.inc 297 2006-08-06 15:55:11Z thomasb $
+ $Id: upload.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
@@ -26,8 +26,8 @@ if (!$_SESSION['compose'])
   }
 
 
-// create temp dir for file uploads
-$temp_dir = rcmail_create_compose_tempdir();
+// use common temp dir for file uploads
+$temp_dir = unslashify($CONFIG['temp_dir']);
 
 
 if (!is_array($_SESSION['compose']['attachments']))
@@ -47,34 +47,39 @@ foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
                                                   'path' => $tmpfname);
 
     if (is_file($CONFIG['skin_path'] . '/images/icons/remove-attachment.png'))
-      $button = sprintf('<img src="%s/images/icons/remove-attachment.png" alt="%s" border="0" style="padding-right:2px;vertical-align:middle" />',
-                        $CONFIG['skin_path'],
-                        rcube_label('delete'));
+      $button = sprintf(
+        '<img src="%s/images/icons/remove-attachment.png" alt="%s" border="0" style="padding-right:2px;vertical-align:middle" />',
+        $CONFIG['skin_path'],
+        Q(rcube_label('delete')));
     else
-      $button = rcube_label('delete');
-
-    $content = sprintf('<a href="#delete" onclick="return %s.command(\\\'remove-attachment\\\', \\\'rcmfile%d\\\', this)" title="%s">%s</a>%s',
-                       $JS_OBJECT_NAME,
-                       $id,
-                       rcube_label('delete'),
-                       $button,
-                       rep_specialchars_output($_FILES['_attachments']['name'][$i], 'js'));
-
-    $response .= sprintf('parent.%s.add2attachment_list(\'rcmfile%d\',\'%s\');',
-                         $JS_OBJECT_NAME,
-                         $id,
-                         $content);
+      $button = Q(rcube_label('delete'));
+
+    $content = sprintf(
+      '<a href="#delete" onclick="return %s.command(\'remove-attachment\', \'rcmfile%d\', this)" title="%s">%s</a>%s',
+      JS_OBJECT_NAME,
+      $id,
+      Q(rcube_label('delete')),
+      $button,
+      Q($_FILES['_attachments']['name'][$i]));
+
+    $OUTPUT->command('add2attachment_list', "rcmfile$id", $content);
+    }
+  else // upload failed
+    {
+    $err = $_FILES['_attachments']['error'][$i];
+    if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE)
+      $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))));
+    else
+      $msg = rcube_label('fileuploaderror');
+    
+    $OUTPUT->command('display_message', $msg, 'error');
     }
   }
 
 
 // send html page with JS calls as response
-$frameout = <<<EOF
-$response
-parent.$JS_OBJECT_NAME.show_attachment_form(false);
-parent.$JS_OBJECT_NAME.auto_save_start();
-EOF;
-
-rcube_iframe_response($frameout);
+$OUTPUT->command('show_attachment_form', false);
+$OUTPUT->command('auto_save_start', false);
+$OUTPUT->send('iframe');
 
 ?>
index 76046db03b0a367184f3179660e4f9eb0f4e23eb..adc2f5495e1e983ea0c6f1f8afef49607f45336d 100644 (file)
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: viewsource.inc 8 2005-09-28 22:28:05Z roundcube $
+ $Id: viewsource.inc 320 2006-08-18 12:48:33Z thomasb $
 
 */
 
 
 // similar code as in program/steps/mail/get.inc
-if ($_GET['_uid'])
+if ($uid = get_input_value('_uid', RCUBE_INPUT_GET))
   {
   header('Content-Type: text/plain');
-  print rcmail_message_source($_GET['_uid']);
+  //@ob_end_clean();
+  $IMAP->print_raw_body($uid);
   }
 else
   {
   raise_error(array('code' => 500,
                     'type' => 'php',
-                    'message' => 'Message UID '.$_GET['_uid'].' not found'),
+                    'message' => 'Message UID '.$uid.' not found'),
               TRUE,
               TRUE);
   }
index 669608e5ec4b87ff35745e8c0a05fb583a3c87a9..4555a6f110029d44e21ab287dc1d1981893245a4 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/settings/delete_identity.inc                            |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: delete_identity.inc 429 2006-12-22 22:26:24Z thomasb $
+ $Id: delete_identity.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
-$REMOTE_REQUEST = $_GET['_remote'] ? TRUE : FALSE;
-
-if ($_GET['_iid'] && preg_match('/^[0-9]+(,[0-9]+)*$/',$_GET['_iid']))
-  {
-  $DB->query("UPDATE ".get_table_name('identities')."
-              SET    del=1
-              WHERE  user_id=?
-              AND    identity_id IN (".$_GET['_iid'].")",
-              $_SESSION['user_id']);
+if (($ids = get_input_value('_iid', RCUBE_INPUT_GET)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $ids))
+{
+  $DB->query(
+    "UPDATE ".get_table_name('identities')."
+     SET    del=1
+     WHERE  user_id=?
+     AND    identity_id IN (".$ids.")",
+    $_SESSION['user_id']);
 
   $count = $DB->affected_rows();
   if ($count)
-    {
-    $commands = show_message('deletedsuccessfully', 'confirmation');
-    }
+    $OUTPUT->show_message('deletedsuccessfully', 'confirmation');
 
   // send response
-  if ($REMOTE_REQUEST)
-    rcube_remote_response($commands);
-  }
+  if ($OUTPUT->ajax_call)
+    $OUTPUT->send();
+}
 
 
-if ($REMOTE_REQUEST)
+if ($OUTPUT->ajax_call)
   exit;
 
 
 // go to identities page
-$_action = 'identities';
+rcmail_overwrite_action('identities');
 
-// overwrite action variable  
-$OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action));
 ?>
index f29f94d4414642cbf7791580aea69c876eb3ff05..e72198e23f6be0b61c6cdfbaa6360fa583ae97d3 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/settings/edit_identity.inc                              |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: edit_identity.inc 88 2005-12-03 16:54:12Z roundcube $
+ $Id: edit_identity.inc 579 2007-05-18 13:11:22Z thomasb $
 
 */
 
 if (($_GET['_iid'] || $_POST['_iid']) && $_action=='edit-identity')
   {
-  $id = $_POST['_iid'] ? $_POST['_iid'] : $_GET['_iid'];
   $DB->query("SELECT * FROM ".get_table_name('identities')."
               WHERE  identity_id=?
               AND    user_id=?
               AND    del<>1",
-              $id,
+              get_input_value('_iid', RCUBE_INPUT_GPC),
               $_SESSION['user_id']);
   
   $IDENTITY_RECORD = $DB->fetch_assoc();
   
   if (is_array($IDENTITY_RECORD))
-    $OUTPUT->add_script(sprintf("%s.set_env('iid', '%s');", $JS_OBJECT_NAME, $IDENTITY_RECORD['identity_id']));
-    
-  $PAGE_TITLE = rcube_label('edititem');
+    $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']);
+
+  $OUTPUT->set_pagetitle(rcube_label('edititem'));
   }
 else
-  $PAGE_TITLE = rcube_label('newitem');
+  $OUTPUT->set_pagetitle(rcube_label('newitem'));
+
 
+$OUTPUT->include_script('list.js');
 
 
 function rcube_identity_form($attrib)
   {
-  global $IDENTITY_RECORD, $JS_OBJECT_NAME;
+  global $IDENTITY_RECORD, $OUTPUT;
 
+/*
+  $OUTPUT->include_script('tiny_mce/tiny_mce_src.js');
+  $OUTPUT->add_script("tinyMCE.init({ mode : 'specific_textareas'," .
+                                    "apply_source_formatting : true," .
+                                    "content_css : '\$__skin_path' + '/editor_content.css'," .
+                                    "popups_css : '\$__skin_path' + '/editor_popups.css'," .
+                                    "editor_css : '\$__skin_path' + '/editor_ui.css'," .
+                                    "theme : 'advanced'," .
+                                    "theme_advanced_toolbar_location : 'top'," .
+                                    "theme_advanced_toolbar_align : 'left'," .
+                                    "theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr'," .
+                                    "theme_advanced_buttons2 : 'link,unlink,code,forecolor,fontselect,fontsizeselect'," .
+                                    "theme_advanced_buttons3 : '' });");
+*/
   if (!$IDENTITY_RECORD && $GLOBALS['_action']!='add-identity')
     return rcube_label('notfound');
 
   // add some labels to client
-  rcube_add_label('noemailwarning');
-  rcube_add_label('nonamewarning');
+  rcube_add_label('noemailwarning', 'nonamewarning');
 
 
   list($form_start, $form_end) = get_form_tags($attrib, 'save-identity', array('name' => '_iid', 'value' => $IDENTITY_RECORD['identity_id']));
@@ -63,7 +77,8 @@ function rcube_identity_form($attrib)
                        'organization' => array('type' => 'text'),
                        'reply-to'     => array('type' => 'text', 'label' => 'replyto'),
                        'bcc'          => array('type' => 'text'),
-                       'signature'       => array('type' => 'textarea'),
+                       'signature'       => array('type' => 'textarea', 'size' => "40", 'rows' => "4"),
+                   //  'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'_signature\');'),
                        'standard'     => array('type' => 'checkbox', 'label' => 'setdefault'));
 
 
@@ -88,12 +103,31 @@ function rcube_identity_form($attrib)
   foreach ($a_show_cols as $col => $colprop)
     {
     $attrib['id'] = 'rcmfd_'.$col;
+
+    if (strlen($colprop['onclick']))
+      $attrib['onclick'] = $colprop['onclick'];
+    else
+      unset($attrib['onclick']);
+
+    if ($col == 'signature')
+      {
+      $attrib['size'] = $colprop['size'];
+      $attrib['rows'] = $colprop['rows'];
+      $attrib['mce_editable'] = $IDENTITY_RECORD['html_signature'] ? "true" : "false";
+      }
+    else
+      {
+      unset($attrib['size']);
+      unset($attrib['rows']);
+      unset($attrib['mce_editable']);
+      }
+
     $label = strlen($colprop['label']) ? $colprop['label'] : $col;
     $value = rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $attrib, $colprop['type']);
 
     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
                     $attrib['id'],
-                    rep_specialchars_output(rcube_label($label)),
+                    Q(rcube_label($label)),
                     $value);
     }
 
@@ -102,10 +136,10 @@ function rcube_identity_form($attrib)
   return $out;  
   }
 
-
+$OUTPUT->add_handler('identityform', 'rcube_identity_form');
 
 if ($_action=='add-identity' && template_exists('addidentity'))
   parse_template('addidentity');
 
 parse_template('editidentity');
-?>
\ No newline at end of file
+?>
index 429e176bbb6aaaaf59efe235d4e0e914c493d971..72e018384b915b6545a62453ac3b61e65f6628e7 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/settings/func.inc                                       |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: func.inc 171 2006-03-23 22:32:47Z roundcube $
+ $Id: func.inc 579 2007-05-18 13:11:22Z thomasb $
 
 */
 
@@ -26,7 +26,7 @@ $sql_result = $DB->query("SELECT username, mail_host FROM ".get_table_name('user
                           $_SESSION['user_id']);
                                  
 if ($USER_DATA = $DB->fetch_assoc($sql_result))
-  $PAGE_TITLE = sprintf('%s %s@%s', rcube_label('settingsfor'), $USER_DATA['username'], $USER_DATA['mail_host']);
+  $OUTPUT->set_pagetitle(sprintf('%s %s@%s', rcube_label('settingsfor'), $USER_DATA['username'], $USER_DATA['mail_host']));
 
 
 
@@ -34,6 +34,8 @@ function rcmail_user_prefs_form($attrib)
   {
   global $DB, $CONFIG, $sess_user_lang;
 
+  $no_override = is_array($CONFIG['dont_override']) ? array_flip($CONFIG['dont_override']) : array();
+
   // add some labels to client
   rcube_add_label('nopagesizewarning');
   
@@ -46,104 +48,150 @@ function rcmail_user_prefs_form($attrib)
   // return the complete edit form as table
   $out = "$form_start<table" . $attrib_str . ">\n\n";
 
-  $a_show_cols = array('language'   => array('type' => 'text'),
-                       'pagesize'   => array('type' => 'text'),
-                       'timezone'   => array('type' => 'text'),
-                       'prettydate' => array('type' => 'text'));
-                       
   // show language selection
-  $a_lang = rcube_list_languages();
-  asort($a_lang);
+  if (!isset($no_override['language']))
+    {
+    $a_lang = rcube_list_languages();
+    asort($a_lang);
   
-  $field_id = 'rcmfd_lang';
-  $select_lang = new select(array('name' => '_language', 'id' => $field_id));
-  $select_lang->add(array_values($a_lang), array_keys($a_lang));
+    $field_id = 'rcmfd_lang';
+    $select_lang = new select(array('name' => '_language', 'id' => $field_id));
+    $select_lang->add(array_values($a_lang), array_keys($a_lang));
   
-
-  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
-                  $field_id,
-                  rep_specialchars_output(rcube_label('language')),
-                  $select_lang->show($sess_user_lang));
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('language')),
+                    $select_lang->show($sess_user_lang));
+    }
 
 
   // show page size selection
-  $field_id = 'rcmfd_timezone';
-  $select_timezone = new select(array('name' => '_timezone', 'id' => $field_id));
-  $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11');
-  $select_timezone->add('(GMT -10:00) Hawaii', '-10');
-  $select_timezone->add('(GMT -9:00) Alaska', '-9');
-  $select_timezone->add('(GMT -8:00) Pacific Time (US/Canada)', '-8');
-  $select_timezone->add('(GMT -7:00) Mountain Time (US/Canada)', '-7');
-  $select_timezone->add('(GMT -6:00) Central Time (US/Canada), Mexico City', '-6');
-  $select_timezone->add('(GMT -5:00) Eastern Time (US/Canada), Bogota, Lima', '-5');
-  $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz', '-4');
-  $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3');
-  $select_timezone->add('(GMT -3:30) Nfld Time (Canada), Nfld, S. Labador', '-3.5');
-  $select_timezone->add('(GMT -2:00) Mid-Atlantic', '-2');
-  $select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1');
-  $select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0');
-  $select_timezone->add('(GMT +1:00) Central European Time', '1');
-  $select_timezone->add('(GMT +2:00) EET: Kaliningrad, South Africa', '2');
-  $select_timezone->add('(GMT +3:00) Baghdad, Kuwait, Riyadh, Moscow, Nairobi', '3');
-  $select_timezone->add('(GMT +3:30) Tehran', '3.5');
-  $select_timezone->add('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', '4');
-  $select_timezone->add('(GMT +4:30) Kabul', '4.5');
-  $select_timezone->add('(GMT +5:00) Ekaterinburg, Islamabad, Karachi', '5');
-  $select_timezone->add('(GMT +5:30) Chennai, Kolkata, Mumbai, New Delhi', '5.5');
-  $select_timezone->add('(GMT +5:45) Kathmandu', '5.75');
-  $select_timezone->add('(GMT +6:00) Almaty, Dhaka, Colombo', '6');
-  $select_timezone->add('(GMT +7:00) Bangkok, Hanoi, Jakarta', '7');
-  $select_timezone->add('(GMT +8:00) Beijing, Perth, Singapore, Taipei', '8');
-  $select_timezone->add('(GMT +9:00) Tokyo, Seoul, Yakutsk', '9');
-  $select_timezone->add('(GMT +9:30) Adelaide, Darwin', '9.5');
-  $select_timezone->add('(GMT +10:00) EAST/AEST: Guam, Vladivostok', '10');
-  $select_timezone->add('(GMT +11:00) Magadan, Solomon Islands', '11');
-  $select_timezone->add('(GMT +12:00) Auckland, Wellington, Kamchatka', '12');
-  $select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13');
-  $select_timezone->add('(GMT +14:00) Kiribati', '14');
+  if (!isset($no_override['timezone']))
+    {
+    $field_id = 'rcmfd_timezone';
+    $select_timezone = new select(array('name' => '_timezone', 'id' => $field_id));
+    $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11');
+    $select_timezone->add('(GMT -10:00) Hawaii', '-10');
+    $select_timezone->add('(GMT -9:00) Alaska', '-9');
+    $select_timezone->add('(GMT -8:00) Pacific Time (US/Canada)', '-8');
+    $select_timezone->add('(GMT -7:00) Mountain Time (US/Canada)', '-7');
+    $select_timezone->add('(GMT -6:00) Central Time (US/Canada), Mexico City', '-6');
+    $select_timezone->add('(GMT -5:00) Eastern Time (US/Canada), Bogota, Lima', '-5');
+    $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz', '-4');
+    $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3');
+    $select_timezone->add('(GMT -3:30) Nfld Time (Canada), Nfld, S. Labador', '-3.5');
+    $select_timezone->add('(GMT -2:00) Mid-Atlantic', '-2');
+    $select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1');
+    $select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0');
+    $select_timezone->add('(GMT +1:00) Central European Time', '1');
+    $select_timezone->add('(GMT +2:00) EET: Kaliningrad, South Africa', '2');
+    $select_timezone->add('(GMT +3:00) Baghdad, Kuwait, Riyadh, Moscow, Nairobi', '3');
+    $select_timezone->add('(GMT +3:30) Tehran', '3.5');
+    $select_timezone->add('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', '4');
+    $select_timezone->add('(GMT +4:30) Kabul', '4.5');
+    $select_timezone->add('(GMT +5:00) Ekaterinburg, Islamabad, Karachi', '5');
+    $select_timezone->add('(GMT +5:30) Chennai, Kolkata, Mumbai, New Delhi', '5.5');
+    $select_timezone->add('(GMT +5:45) Kathmandu', '5.75');
+    $select_timezone->add('(GMT +6:00) Almaty, Dhaka, Colombo', '6');
+    $select_timezone->add('(GMT +7:00) Bangkok, Hanoi, Jakarta', '7');
+    $select_timezone->add('(GMT +8:00) Beijing, Perth, Singapore, Taipei', '8');
+    $select_timezone->add('(GMT +9:00) Tokyo, Seoul, Yakutsk', '9');
+    $select_timezone->add('(GMT +9:30) Adelaide, Darwin', '9.5');
+    $select_timezone->add('(GMT +10:00) EAST/AEST: Guam, Vladivostok', '10');
+    $select_timezone->add('(GMT +11:00) Magadan, Solomon Islands', '11');
+    $select_timezone->add('(GMT +12:00) Auckland, Wellington, Kamchatka', '12');
+    $select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13');
+    $select_timezone->add('(GMT +14:00) Kiribati', '14');
   
   
-  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
-                  $field_id,
-                  rep_specialchars_output(rcube_label('timezone')),
-                  $select_timezone->show($CONFIG['timezone']));
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('timezone')),
+                    $select_timezone->show($CONFIG['timezone']));
+    }
 
+  // daylight savings
+  if (!isset($no_override['dst_active']))
+    {
+    $field_id = 'rcmfd_dst';
+    $input_dst = new checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1));
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('dstactive')),
+                    $input_dst->show($CONFIG['dst_active']));
+    }
 
-  $field_id = 'rcmfd_dst';
-  $input_dst = new checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1));
-  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
-                  $field_id,
-                  rep_specialchars_output(rcube_label('dstactive')),
-                  $input_dst->show($CONFIG['dst_active']));
+  // show page size selection
+  if (!isset($no_override['pagesize']))
+    {
+    $field_id = 'rcmfd_pgsize';
+    $input_pagesize = new textfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5));
 
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('pagesize')),
+                    $input_pagesize->show($CONFIG['pagesize']));
+    }
 
-  // show page size selection
-  $field_id = 'rcmfd_pgsize';
-  $input_pagesize = new textfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5));
+  // MM: Show checkbox for toggling 'pretty dates' 
+  if (!isset($no_override['prettydate']))
+    {
+    $field_id = 'rcmfd_prettydate';
+    $input_prettydate = new checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1));
 
-  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
-                  $field_id,
-                  rep_specialchars_output(rcube_label('pagesize')),
-                  $input_pagesize->show($CONFIG['pagesize']));
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('prettydate')),
+                    $input_prettydate->show($CONFIG['prettydate']?1:0));
+    }
 
   // show checkbox for HTML/plaintext messages
-  $field_id = 'rcmfd_htmlmsg';
-  $input_pagesize = new checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1));
-
-  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
-                  $field_id,
-                  rep_specialchars_output(rcube_label('preferhtml')),
-                  $input_pagesize->show($CONFIG['prefer_html']?1:0));
+  if (!isset($no_override['prefer_html']))
+    {
+    $field_id = 'rcmfd_htmlmsg';
+    $input_pagesize = new checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1));
 
-  // MM: Show checkbox for toggling 'pretty dates' 
-  $field_id = 'rcmfd_prettydate';
-  $input_prettydate = new checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1));
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('preferhtml')),
+                    $input_pagesize->show($CONFIG['prefer_html']?1:0));
+    }
 
-  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
-                  $field_id,
-                  rep_specialchars_output(rcube_label('prettydate')),
-                  $input_prettydate->show($CONFIG['prettydate']?1:0));
+  // Show checkbox for HTML Editor
+  if (false && !isset($no_override['htmleditor']))
+    {
+    $field_id = 'rcmfd_htmleditor';
+    $input_htmleditor = new checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1));
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('htmleditor')),
+                    $input_htmleditor->show($CONFIG['htmleditor']?1:0));
+    }
 
+  // show config parameter for preview pane
+  if (false && !isset($no_override['preview_pane']))
+    {
+    $field_id = 'rcmfd_preview';
+    $input_preview = new checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1));
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('previewpane')),
+                    $input_preview->show($CONFIG['preview_pane']?1:0));
+    }
+                  
+  if (!empty($CONFIG['drafts_mbox']) && !isset($no_override['draft_autosave']))
+    {
+    $field_id = 'rcmfd_autosave';
+    $select_autosave = new select(array('name' => '_draft_autosave', 'id' => $field_id));
+    $select_autosave->add(rcube_label('never'), 0);
+    foreach (array(3, 5, 10) as $i => $min)
+      $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60);
+
+    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                    $field_id,
+                    Q(rcube_label('autosavedraft')),
+                    $select_autosave->show($CONFIG['draft_autosave']));
+    }
 
   $out .= "\n</table>$form_end";
 
@@ -152,10 +200,9 @@ function rcmail_user_prefs_form($attrib)
 
 
 
-
 function rcmail_identities_list($attrib)
   {
-  global $DB, $CONFIG, $OUTPUT, $JS_OBJECT_NAME;
+  global $DB, $CONFIG, $OUTPUT;
 
 
   // get contacts from DB
@@ -177,8 +224,7 @@ function rcmail_identities_list($attrib)
   $out = rcube_table_output($attrib, $sql_result, $a_show_cols, 'identity_id');
   
   // set client env
-  $javascript = sprintf("%s.gui_object('identitieslist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']);
-  $OUTPUT->add_script($javascript);    
+  $OUTPUT->add_gui_object('identitieslist', $attrib['id']);
 
   return $out;
   }
@@ -188,7 +234,7 @@ function rcmail_identities_list($attrib)
 // similar function as in /steps/addressbook/edit.inc
 function get_form_tags($attrib, $action, $add_hidden=array())
   {
-  global $OUTPUT, $JS_OBJECT_NAME, $EDIT_FORM, $SESS_HIDDEN_FIELD;  
+  global $OUTPUT, $EDIT_FORM, $SESS_HIDDEN_FIELD;  
 
   $form_start = '';
   if (!strlen($EDIT_FORM))
@@ -211,7 +257,7 @@ function get_form_tags($attrib, $action, $add_hidden=array())
   $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
 
   if (!strlen($EDIT_FORM))
-    $OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('editform', '$form_name');");
+    $OUTPUT->add_gui_object('editform', $form_name);
   
   $EDIT_FORM = $form_name;
 
@@ -219,4 +265,11 @@ function get_form_tags($attrib, $action, $add_hidden=array())
   }
 
 
+// register UI objects
+$OUTPUT->add_handlers(array(
+  'userprefs' => 'rcmail_user_prefs_form',
+  'itentitieslist' => 'rcmail_identities_list'
+));
+
+
 ?>
\ No newline at end of file
index f7fb31cfca1c6a72a2bb0f813eb375437f6aa3f2..73f28cb168ccf7eb4df3a2025ee7dd88bdc343a0 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/settings/identities.inc                                 |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: identities.inc 8 2005-09-28 22:28:05Z roundcube $
+ $Id: identities.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
 if ($USER_DATA = $DB->fetch_assoc($sql_result))
-  $PAGE_TITLE = sprintf('%s (%s@%s)', rcube_label('identities'), $USER_DATA['username'], $USER_DATA['mail_host']);
+  $OUTPUT->set_pagetitle(sprintf('%s (%s@%s)', rcube_label('identities'), $USER_DATA['username'], $USER_DATA['mail_host']));
 
+$OUTPUT->include_script('list.js');
 
 
 // similar function as /steps/addressbook/func.inc::rcmail_contact_frame()
 function rcmail_identity_frame($attrib)
   {
-  global $OUTPUT, $JS_OBJECT_NAME;
+  global $OUTPUT;
 
   if (!$attrib['id'])
     $attrib['id'] = 'rcmIdentityFrame';
 
   $attrib['name'] = $attrib['id'];
 
-  $OUTPUT->add_script(sprintf("%s.set_env('contentframe', '%s');", $JS_OBJECT_NAME, $attrib['name']));
+  $OUTPUT->set_env('contentframe', $attrib['name']);
 
   $attrib_str = create_attrib_string($attrib, array('name', 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
   $out = '<iframe'. $attrib_str . '></iframe>';
@@ -42,7 +43,7 @@ function rcmail_identity_frame($attrib)
   return $out;
   }
 
-
+$OUTPUT->add_handler('identityframe', 'rcmail_identity_frame');
 
 parse_template('identities');
 ?>
\ No newline at end of file
index 8eb03ab5aabfedcfe460b81a9b44c4ef0833dfe4..a3330216aa59293fdd21df56f214f4492138a104 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/settings/manage_folders.inc                             |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: manage_folders.inc 285 2006-07-30 19:38:06Z thomasb $
+ $Id: manage_folders.inc 573 2007-05-18 11:29:25Z thomasb $
 
 */
 
@@ -26,82 +26,81 @@ rcmail_imap_init(TRUE);
 // subscribe to one or more mailboxes
 if ($_action=='subscribe')
   {
-  if (strlen($_GET['_mboxes']))
-    $IMAP->subscribe(array($_GET['_mboxes']));
+  if ($mboxes = get_input_value('_mboxes', RCUBE_INPUT_POST))
+    $IMAP->subscribe(array($mboxes));
 
-  if ($REMOTE_REQUEST)
-    rcube_remote_response('// subscribed');
+  if ($OUTPUT->ajax_call)
+    $OUTPUT->remote_response('// subscribed');
   }
 
 // unsubscribe one or more mailboxes
 else if ($_action=='unsubscribe')
   {
-  if (strlen($_GET['_mboxes']))
-    $IMAP->unsubscribe(array($_GET['_mboxes']));
+  if ($mboxes = get_input_value('_mboxes', RCUBE_INPUT_POST))
+    $IMAP->unsubscribe(array($mboxes));
 
-  if ($REMOTE_REQUEST)
-    rcube_remote_response('// unsubscribed');
+  if ($OUTPUT->ajax_call)
+    $OUTPUT->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 (!empty($_POST['_name']))
+    $create = $IMAP->create_mailbox(trim(get_input_value('_name', RCUBE_INPUT_POST, FALSE, 'UTF-7')), TRUE);
 
-  if ($create && $REMOTE_REQUEST)
+  if ($create && $OUTPUT->ajax_call)
     {
-    $commands = sprintf("this.add_folder_row('%s')", rep_specialchars_output($create, 'js'));
-    rcube_remote_response($commands);
+    $OUTPUT->command('add_folder_row', $create, rcube_charset_convert($create, 'UTF-7'));
+    $OUTPUT->send();
     }
-  else if (!$create && $REMOTE_REQUEST)
+  else if (!$create && $OUTPUT->ajax_call)
     {
-    $commands = show_message('errorsaving', 'error');
-    rcube_remote_response($commands);
+    $OUTPUT->show_message('errorsaving', 'error');
+    $OUTPUT->remote_response();
     }
   else if (!$create)
-    show_message('errorsaving', 'error');
+    $OUTPUT->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)));
-
-  if ($rename && $REMOTE_REQUEST)
+  if (!empty($_POST['_folder_oldname']) && !empty($_POST['_folder_newname']))
+    $rename = $IMAP->rename_mailbox(($oldname = get_input_value('_folder_oldname', RCUBE_INPUT_POST)), trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, FALSE, 'UTF-7')));
+    
+  if ($rename && $OUTPUT->ajax_call)
     {
-    $commands = sprintf("this.replace_folder_row('%s','%s');",
-                        addslashes(rep_specialchars_output($rename, 'js')),
-                        rep_specialchars_output($_GET['_folder_oldname'], 'js'));
-    rcube_remote_response($commands);
+    $OUTPUT->command('replace_folder_row', $oldname, $rename, rcube_charset_convert($rename, 'UTF-7'));
+    $OUTPUT->command('reset_folder_rename');
+    $OUTPUT->send();
     }
-  else if (!$rename && $REMOTE_REQUEST)
+  else if (!$rename && $OUTPUT->ajax_call)
     {
-    $commands = "this.reset_folder_rename();\n";
-    $commands .= show_message('errorsaving', 'error');
-    rcube_remote_response($commands);
+    $OUTPUT->command('reset_folder_rename');
+    $OUTPUT->show_message('errorsaving', 'error');
+    $OUTPUT->send();
     }
   else if (!$rename)
-    show_message('errorsaving', 'error');
+    $OUTPUT->show_message('errorsaving', 'error');
   }
 
 // delete an existing IMAP mailbox
 else if ($_action=='delete-folder')
   {
-  if (!empty($_GET['_mboxes']))
-    $deleted = $IMAP->delete_mailbox(array(get_input_value('_mboxes', RCUBE_INPUT_GET)));
+  if ($mboxes = get_input_value('_mboxes', RCUBE_INPUT_POST))
+    $deleted = $IMAP->delete_mailbox(array($mboxes));
 
-  if ($REMOTE_REQUEST && $deleted)
+  if ($OUTPUT->ajax_call && $deleted)
     {
-    $commands = sprintf("this.remove_folder_row('%s');\n", rep_specialchars_output(get_input_value('_mboxes', RCUBE_INPUT_GET), 'js'));
-    $commands .= show_message('folderdeleted', 'confirmation');
-    rcube_remote_response($commands);
+    $OUTPUT->command('remove_folder_row', get_input_value('_mboxes', RCUBE_INPUT_POST));
+    $OUTPUT->show_message('folderdeleted', 'confirmation');
+    $OUTPUT->send();
     }
-  else if ($REMOTE_REQUEST)
+  else if ($OUTPUT->ajax_call)
     {
-    $commands = show_message('errorsaving', 'error');
-    rcube_remote_response($commands);
+    $OUTPUT->show_message('errorsaving', 'error');
+    $OUTPUT->send();
     }
   }
 
@@ -110,7 +109,7 @@ else if ($_action=='delete-folder')
 // build table with all folders listed by server
 function rcube_subscription_form($attrib)
   {
-  global $IMAP, $CONFIG, $OUTPUT, $JS_OBJECT_NAME;
+  global $IMAP, $CONFIG, $OUTPUT;
 
   list($form_start, $form_end) = get_form_tags($attrib, 'folders');
   unset($attrib['form']);
@@ -135,11 +134,13 @@ function rcube_subscription_form($attrib)
 
 
   // get folders from server
+  $IMAP->clear_cache('mailboxes');
+
   $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)"));
+  $checkbox_subscribe = new checkbox(array('name' => '_subscribed[]', 'onclick' => JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)"));
   
   if (!empty($attrib['deleteicon']))
     $del_button = sprintf('<img src="%s%s" alt="%s" border="0" />', $CONFIG['skin_path'], $attrib['deleteicon'], rcube_label('delete'));
@@ -154,28 +155,34 @@ function rcube_subscription_form($attrib)
   // create list of available folders
   foreach ($a_unsubscribed as $i => $folder)
     {
+    $subscribed = in_array($folder, $a_subscribed);
     $protected = ($CONFIG['protect_default_folders'] == TRUE && in_array($folder,$CONFIG['default_imap_folders']));
     $zebra_class = $i%2 ? 'even' : 'odd';
-    $folder_js = rep_specialchars_output($folder, 'js');
+    $folder_js = JQ($folder);
+    $folder_html = $CONFIG['protect_default_folders'] && in_array($folder, $CONFIG['default_imap_folders']) ? rcube_label(strtolower($folder)) : rcube_charset_convert($folder, 'UTF-7');
     
     if (!$protected)
-      $a_js_folders['rcmrow'.($i+1)] = $folder_js;
+      $a_js_folders['rcmrow'.($i+1)] = array($folder, rcube_charset_convert($folder, 'UTF-7'));
 
-    $out .= sprintf('<tr id="rcmrow%d" class="%s"><td>%s</td><td>%s</td>',
+    $out .= sprintf('<tr id="rcmrow%d" class="%s"><td>%s</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, 'disabled' => $protected)));
+                    Q($folder_html));
+                    
+    if ($protected)
+      $out .= '<td>&nbsp;'.($subscribed ? '&#x2022;' : '-').'</td>';
+    else
+      $out .= '<td>'.$checkbox_subscribe->show($subscribed?$folder:'', array('value' => $folder)).'</td>';
 
     // add rename and delete buttons
     if (!$protected)
       $out .= sprintf('<td><a href="#rename" onclick="%s.command(\'rename-folder\',\'%s\')" title="%s">%s</a>'.
                       '<td><a href="#delete" onclick="%s.command(\'delete-folder\',\'%s\')" title="%s">%s</a></td>',
-                      $JS_OBJECT_NAME,
+                      JS_OBJECT_NAME,
                       $folder_js,
                       rcube_label('renamefolder'),
                       $edit_button,
-                      $JS_OBJECT_NAME,
+                      JS_OBJECT_NAME,
                       $folder_js,
                       rcube_label('deletefolder'),
                       $del_button);
@@ -188,10 +195,8 @@ function rcube_subscription_form($attrib)
   $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);
+  $OUTPUT->add_gui_object('subscriptionlist', $attrib['id']);
+  $OUTPUT->set_env('subscriptionrows', $a_js_folders);
 
   return $out;  
   }
@@ -199,8 +204,6 @@ function rcube_subscription_form($attrib)
 
 function rcube_create_folder_form($attrib)
   {
-  global $JS_OBJECT_NAME;
-
   list($form_start, $form_end) = get_form_tags($attrib, 'create-folder');
   unset($attrib['form']);
 
@@ -215,7 +218,7 @@ function rcube_create_folder_form($attrib)
     {
     $button = new input_field(array('type' => 'button',
                                     'value' => rcube_label('create'),
-                                    'onclick' => "$JS_OBJECT_NAME.command('create-folder',this.form)"));
+                                    'onclick' => JS_OBJECT_NAME.".command('create-folder',this.form)"));
     $out .= $button->show();
     }
 
@@ -226,7 +229,7 @@ function rcube_create_folder_form($attrib)
 
 function rcube_rename_folder_form($attrib)
   {
-  global $CONFIG, $IMAP, $JS_OBJECT_NAME;
+  global $CONFIG, $IMAP;
 
   list($form_start, $form_end) = get_form_tags($attrib, 'rename-folder');
   unset($attrib['form']);
@@ -255,7 +258,7 @@ function rcube_rename_folder_form($attrib)
     {
     $button = new input_field(array('type' => 'button',
                                     'value' => rcube_label('rename'),
-                                    'onclick' => "$JS_OBJECT_NAME.command('rename-folder',this.form)"));
+                                    'onclick' => JS_OBJECT_NAME.".command('rename-folder',this.form)"));
     $out .= $button->show();
     }
 
@@ -265,9 +268,15 @@ function rcube_rename_folder_form($attrib)
   }
 
 
+// register UI objects
+$OUTPUT->add_handlers(array(
+  'foldersubscription' => 'rcube_subscription_form',
+  'createfolder' => 'rcube_create_folder_form',
+  'renamefolder' => 'rcube_rename_folder_form'
+));
+
 // add some labels to client
 rcube_add_label('deletefolderconfirm');
 
-
-parse_template('managefolders');
+$OUTPUT->send('managefolders');
 ?>
index 253dcbdb270654541dbb1e73f4fa13fa979d89b6..eeadd58093df54db0ce7aa303d1c58b285b31dba 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/settings/save_identity.inc                              |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: save_identity.inc 430 2006-12-22 22:31:38Z thomasb $
+ $Id: save_identity.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
-$a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature');
+$a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature', 'html_signature');
 $a_html_cols = array('signature');
-
+$a_boolean_cols = array('standard', 'html_signature');
+$updated = $default_id = false;
 
 // check input
 if (empty($_POST['_name']) || empty($_POST['_email']))
   {
-  show_message('formincomplete', 'warning');
+  $OUTPUT->show_message('formincomplete', 'warning');
   rcmail_overwrite_action('edit-identitiy');
   return;
   }
@@ -40,39 +41,41 @@ if ($_POST['_iid'])
   foreach ($a_save_cols as $col)
     {
     $fname = '_'.$col;
-    if (!isset($_POST[$fname]))
-      continue;
+    if (isset($_POST[$fname]))
+      $a_write_sql[] = sprintf("%s=%s",
+        $DB->quoteIdentifier($col),
+        $DB->quote(get_input_value($fname, RCUBE_INPUT_POST, in_array($col, $a_html_cols))));
+    }
 
-    $a_write_sql[] = sprintf("%s=%s",
-                             $DB->quoteIdentifier($col),
-                             $DB->quote(get_input_value($fname, RCUBE_INPUT_POST, in_array($col, $a_html_cols))));
+  // set "off" values for checkboxes that were not checked, and therefore
+  // not included in the POST body.
+  foreach ($a_boolean_cols as $col)
+    {
+    $fname = '_' . $col;
+    if (!isset($_POST[$fname]))
+      $a_write_sql[] = sprintf("%s=0", $DB->quoteIdentifier($col));
     }
 
   if (sizeof($a_write_sql))
     {
-    $DB->query("UPDATE ".get_table_name('identities')."
-                SET ".join(', ', $a_write_sql)."
-                WHERE  identity_id=?
-                AND    user_id=?
-                AND    del<>1",
-                $_POST['_iid'],
-                $_SESSION['user_id']);
+    $DB->query(
+      "UPDATE ".get_table_name('identities')."
+       SET ".join(', ', $a_write_sql)."
+       WHERE  identity_id=?
+       AND    user_id=?
+       AND    del<>1",
+      get_input_value('_iid', RCUBE_INPUT_POST),
+      $_SESSION['user_id']);
                        
     $updated = $DB->affected_rows();
     }
        
-  if ($updated && !empty($_POST['_standard']))
+  if ($updated)
     {
-    show_message('successfullysaved', 'confirmation');
-
-    // mark all other identities as 'not-default'
-    $DB->query("UPDATE ".get_table_name('identities')."
-                SET ".$DB->quoteIdentifier('standard')."='0'
-                WHERE  user_id=?
-                AND    identity_id<>?
-                AND    del<>1",
-                $_SESSION['user_id'],
-                $_POST['_iid']);
+    $OUTPUT->show_message('successfullysaved', 'confirmation');
+    
+    if (!empty($_POST['_standard']))
+      $default_id = get_input_value('_iid', RCUBE_INPUT_POST);
     
     if ($_POST['_framed'])
       {
@@ -83,8 +86,9 @@ if ($_POST['_iid'])
   else if ($DB->is_error())
     {
     // show error message
-    show_message('errorsaving', 'error');
+    $OUTPUT->show_message('errorsaving', 'error');
     rcmail_overwrite_action('edit-identitiy');
+    return;
     }
   }
 
@@ -117,6 +121,9 @@ else
     {
     $_GET['_iid'] = $insert_id;
 
+    if (!empty($_POST['_standard']))
+      $default_id = $insert_id;
+
     if ($_POST['_framed'])
       {
       // add contact row or jump to the page where it should appear
@@ -126,13 +133,25 @@ else
   else
     {
     // show error message
-    show_message('errorsaving', 'error');
+    $OUTPUT->show_message('errorsaving', 'error');
     rcmail_overwrite_action('edit-identity');
+    return;
     }
   }
 
 
+// mark all other identities as 'not-default'
+if ($default_id)
+  $DB->query(
+    "UPDATE ".get_table_name('identities')."
+     SET ".$DB->quoteIdentifier('standard')."='0'
+     WHERE  user_id=?
+     AND    identity_id<>?
+     AND    del<>1",
+    $_SESSION['user_id'],
+    $default_id);
+
 // go to next step
-rcmail_overwrite_action($_POST['_framed'] ? 'edit-identity' : 'identities');
+rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities');
 
 ?>
\ No newline at end of file
index f71254731dad491868b226c07d1b17a7ac51ef15..0f073b334ca21b1cebc4a6c374bf1a4f7d22d601 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/settings/save_prefs.inc                                 |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: save_prefs.inc 194 2006-04-13 18:23:48Z roundcube $
+ $Id: save_prefs.inc 543 2007-04-28 18:07:12Z thomasb $
 
 */
 
-$a_user_prefs = $_SESSION['user_prefs'];
-if (!is_array($a_user_prefs))
-  $a_user_prefs = array();
+$a_user_prefs = array(
+  'timezone'     => isset($_POST['_timezone']) ? floatval($_POST['_timezone']) : $CONFIG['timezone'],
+  'dst_active'   => isset($_POST['_dst_active']) ? TRUE : FALSE,
+  'pagesize'     => is_numeric($_POST['_pagesize']) ? intval($_POST['_pagesize']) : $CONFIG['pagesize'],
+  'prettydate'   => isset($_POST['_pretty_date']) ? TRUE : FALSE,
+  'prefer_html'  => isset($_POST['_prefer_html']) ? TRUE : FALSE,
+  'htmleditor'   => isset($_POST['_htmleditor']) ? TRUE : FALSE,
+  'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE,
+  'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0
+  );
 
+// don't override these parameters
+foreach ((array)$CONFIG['dont_override'] as $p)
+  $a_user_prefs[$p] = $CONFIG[$p];
 
-$a_user_prefs['timezone'] = isset($_POST['_timezone']) ? floatval($_POST['_timezone']) : $CONFIG['timezone'];
-$a_user_prefs['dst_active'] = isset($_POST['_dst_active']) ? TRUE : FALSE;
-$a_user_prefs['pagesize'] = is_numeric($_POST['_pagesize']) ? (int)$_POST['_pagesize'] : $CONFIG['pagesize'];
-$a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE;
-
-// MM: Date format toggle (Pretty / Standard)
-$a_user_prefs['prettydate'] = isset($_POST['_pretty_date']) ? TRUE : FALSE;
 
+// switch UI language
 if (isset($_POST['_language']))
   {
-  $sess_user_lang = $_SESSION['user_lang'] = $_POST['_language'];
+  $sess_user_lang = $_SESSION['user_lang'] = get_input_value('_language', RCUBE_INPUT_POST);
   rcmail_set_locale($sess_user_lang);
   }
 
 if (rcmail_save_user_prefs($a_user_prefs))
-  show_message('successfullysaved', 'confirmation');
+  $OUTPUT->show_message('successfullysaved', 'confirmation');
 
 
 // go to next step
-$_action = 'preferences';
-
-// overwrite action variable  
-$OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action));  
+rcmail_overwrite_action('preferences');
 
-?>
\ No newline at end of file
+?>
index 5bb6c61d73c64f05bdfa082f8ef24d5dfb72d7c3..5193f1c9122463b7157734f393f68a5349b0a9df 100644 (file)
@@ -17,8 +17,8 @@
 #abookcountbar
 {
   position: absolute;
-  top: 60px;
-  left: 490px;
+  bottom: 16px;
+  left: 185px;
   width: 240px;
   height: 20px;
   text-align: left;
   color: #333333;
 }
 
-
-#addresslist
+#directorylist, #addresslist
 {
   position: absolute;
   top: 85px;
-  left: 20px;
-  width: 450px;
   bottom: 40px;
   border: 1px solid #999999;
   background-color: #F9F9F9;
   overflow: auto;
   /* css hack for IE */
-  height: expression((parseInt(document.documentElement.clientHeight)-135)+'px');
+  height: expression((parseInt(document.documentElement.clientHeight)-135)+'px');  
+}
+
+#directorylist
+{
+  left: 20px;
+  width: 150px;
+}
+
+#addresslist
+{
+  left: 185px;
+  width: 340px;
+}
+
+#directorylist ul
+{
+  list-style: none;
+  margin: 0;
+  padding: 0;
 }
 
+#directorylist ul li
+{
+  font-size: 11px;
+  border-bottom: 1px solid #EBEBEB;
+}
+
+#directorylist ul li a
+{
+  display: block;
+  padding-left: 6px;
+  padding-top: 2px;
+  padding-bottom: 2px;
+  text-decoration: none;
+}
+
+#directorylist li.selected
+{
+  background-color: #929292;
+  border-bottom: 1px solid #898989;
+}
+
+#directorylist li.selected a
+{
+  color: #FFF;
+  font-weight: bold;
+}
+
+#directorylist li.droptarget
+{
+  background-color: #FFFFA6;
+}
+
+
 #contacts-table
 {
   width: 100%;
 {
   position: absolute;
   top: 85px;
-  left: 490px;
-  right: 40px;
+  left: 540px;
+  right: 30px;
   bottom: 40px;
   border: 1px solid #999999;
   overflow: hidden;
   /* css hack for IE */
-  width: expression((parseInt(document.documentElement.clientWidth)-530)+'px');
+  width: expression((parseInt(document.documentElement.clientWidth)-45-document.getElementById('addresslist').offsetLeft-document.getElementById('addresslist').offsetWidth)+'px');
   height: expression((parseInt(document.documentElement.clientHeight)-135)+'px');
 }
 
+
+#addressviewsplitter
+{
+  background-position: 4px center;
+}
+
+#addressviewsplitter .splitterLine
+{
+  margin-left: 3px;
+  width: 6px;
+}
+
+
 body.iframe,
 #contact-frame
 {
@@ -86,34 +148,36 @@ body.iframe,
 /* visibility: hidden; */
 }
 
-#contact-title
+#contact-title, #groups-title
 {
   height: 12px !important;
 /*  height: 20px; */
-  padding: 4px 20px 3px 20px;
-  border-bottom: 1px solid #999999;
-  color: #333333;
+  padding: 4px 5px 3px 5px;
+  border-bottom: 1px solid #999;
+  color: #333;
   font-size: 11px;
   font-weight: bold;
   background-color: #EBEBEB;
-  background-image: url(images/listheader_aqua.gif); 
+  background-image: url(images/listheader_aqua.gif);
+  white-space: nowrap;
+}
+
+#contact-title
+{
+  padding: 4px 10px 3px 10px;
 }
 
 #contact-details
 {
-  padding: 15px 20px 10px 20px;
+  padding: 15px 10px 10px 10px;
 }
 
 #contact-details table td.title
 {
-  color: #666666;
+  color: #666;
   font-weight: bold;
   text-align: right;
   padding-right: 10px;
 }
 
 
-
-
-
-
index 6cec3cf9ed5bb2324a19c094e28281779b70d51a..32105ef90fc11a10ae8329486cea2b4bb1d7eda6 100755 (executable)
@@ -73,6 +73,13 @@ input, textarea
   border: 1px solid #666666;
 }
 
+input[type="checkbox"],
+input[type="radio"]
+{
+  border: 0;
+  padding: 0;
+}
+
 input.button
 {
   height: 20px;
@@ -120,7 +127,7 @@ img
   width: 600px;
   height: 37px;
   background: url(images/taskbar.gif) top right no-repeat;
-  padding: 10px 24px 0px 0px;
+  padding: 10px 14px 10px 0px;
   text-align: right;
   white-space: nowrap;
   z-index: 2;
@@ -213,6 +220,41 @@ a.button-logout
   border: 1px solid #CCCCCC;
 }
 
+.splitter
+{
+  position: absolute;
+  padding: 2px;
+  background: url(images/dimple.png) center no-repeat;
+}
+
+.splitter-h
+{
+  cursor: n-resize;
+  background-position: center 2px;
+}
+
+.splitter-v
+{
+  cursor: e-resize;
+  background-position: 1px center;
+}
+
+.boxtitle
+{
+  height: 12px !important;
+  padding: 4px 20px 3px 20px;
+  border-bottom: 1px solid #999;
+  color: #333;
+  font-size: 11px;
+  font-weight: bold;
+  background-color: #EBEBEB;
+  background-image: url(images/listheader_aqua.gif);
+}
+
+.radios-left label
+{
+  padding-left: 0.3em;
+}
 
 /***** common table settings ******/
 
@@ -247,15 +289,99 @@ table.records-table tr
 
 table.records-table tr.selected td
 {
-  font-weight: bold;
   color: #FFFFFF;
   background-color: #CC3333;
 }
 
+table.records-table tr.focused td
+{
+}
+
+table.records-table tr.unfocused td
+{
+  color: #FFFFFF;
+  background-color: #929292;
+}
+
+
+/***** mac-style quicksearch field *****/
+
+#quicksearchbar
+{
+  position: absolute;
+  top: 60px;
+  right: 30px;
+  width: 182px;
+  height: 20px;
+  text-align: right;
+  background: url('images/searchfield.gif') top left no-repeat;
+}
+
+#quicksearchbar a
+{
+  position: absolute;
+  top: 3px;
+  right: 4px;
+  text-decoration: none;
+}
+
+#quicksearchbar img
+{
+  vertical-align: middle;
+}
+
+#quicksearchbox
+{
+  position: absolute;
+  top: 2px;
+  left: 20px;
+  width: 140px;
+  font-size: 11px;
+  padding: 0px;
+  border: none;
+}
+
+
+/*\*/
+html>body*#quicksearchbar[id$="quicksearchbar"]:not([class="none"]) { background-image: none; }
+html>body*#quicksearchbar[id$="quicksearchbar"]:not([class="none"]) a { top: 5px; }
+html>body*#quicksearchbar[id$="quicksearchbar"]:not([class="none"]) #quicksearchbox { width: 180px; top:0px; right: 1px; left: auto; }
+/**/
 
 
 /***** roundcube webmail pre-defined classes *****/
 
+#rcversion
+{
+  position: absolute;
+  top: 67px;
+  left: 20px;
+  width: 160px;
+  text-align: center;
+
+  font-weight: normal;
+  font-size: x-small;
+  font-variant: small-caps;
+  
+  color: #999999;
+  /*border: 1px solid #308014;
+  background-color: #b4eeb4;*/
+}
+
+#rcmdraglayer
+{
+  width: 300px;
+  border: 1px solid #999999;
+  background-color: #F9F9F9;
+  padding-left: 8px;
+  padding-right: 8px;
+  padding-top: 3px;
+  padding-bottom: 3px;
+  font-size: 11px;
+  opacity: 0.6;
+  -moz-opacity: 0.6;
+}
+
 a.rcmContactAddress
 {
   text-decoration: none;
diff --git a/skins/default/images/buttons/first_act.png b/skins/default/images/buttons/first_act.png
new file mode 100644 (file)
index 0000000..8322fd1
Binary files /dev/null and b/skins/default/images/buttons/first_act.png differ
diff --git a/skins/default/images/buttons/first_pas.png b/skins/default/images/buttons/first_pas.png
new file mode 100644 (file)
index 0000000..0934cd1
Binary files /dev/null and b/skins/default/images/buttons/first_pas.png differ
diff --git a/skins/default/images/buttons/first_sel.png b/skins/default/images/buttons/first_sel.png
new file mode 100644 (file)
index 0000000..6bc1d9f
Binary files /dev/null and b/skins/default/images/buttons/first_sel.png differ
diff --git a/skins/default/images/buttons/last_act.png b/skins/default/images/buttons/last_act.png
new file mode 100644 (file)
index 0000000..3967fa4
Binary files /dev/null and b/skins/default/images/buttons/last_act.png differ
diff --git a/skins/default/images/buttons/last_pas.png b/skins/default/images/buttons/last_pas.png
new file mode 100644 (file)
index 0000000..e18d37a
Binary files /dev/null and b/skins/default/images/buttons/last_pas.png differ
diff --git a/skins/default/images/buttons/last_sel.png b/skins/default/images/buttons/last_sel.png
new file mode 100644 (file)
index 0000000..0d608ea
Binary files /dev/null and b/skins/default/images/buttons/last_sel.png differ
diff --git a/skins/default/images/dimple.png b/skins/default/images/dimple.png
new file mode 100644 (file)
index 0000000..d96a5ad
Binary files /dev/null and b/skins/default/images/dimple.png differ
diff --git a/skins/default/ldapsearchform.css b/skins/default/ldapsearchform.css
deleted file mode 100644 (file)
index 9661442..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/***** RoundCube|Mail address book task styles *****/
-
-
-body.iframe,
-{
-  background-color: #F9F9F9;
-}
-
-#ldapsearch-title
-{
-  height: 12px !important;
-/*  height: 20px; */
-  padding: 4px 20px 3px 20px;
-  border-bottom: 1px solid #999999;
-  color: #333333;
-  font-size: 11px;
-  font-weight: bold;
-  background-color: #EBEBEB;
-  background-image: url(images/listheader_aqua.gif); 
-}
-
-#ldapsearch-details
-{
-  padding: 15px 20px 10px 20px;
-}
-
-#ldapsearch-details table td.title
-{
-  color: #666666;
-  font-weight: bold;
-  text-align: right;
-  padding-right: 10px;
-}
-
-#ldapAddressList 
-{
-  width: 100%;
-  table-layout: fixed;
-  /* css hack for IE */
-  width: expression(document.getElementById('addresslist').clientWidth);
-}
-
-#ldapAddressList table 
-{
-  border-top: 1px solid #999999;
-}
-
-#ldap-search-results div
-{
-  width: 100%;
-  color: red;
-  background-color: green;
-}
-
index 72a782bc2a3842411e60f58695fdb7902f6b0241..a406e423a7c00e33895cb114d5612bfe80ac4116 100644 (file)
@@ -83,7 +83,7 @@
 {
   position: absolute;
   bottom: 16px;
-  right: 40px;
+  right: 30px;
   width: 300px;
   height: 20px;
   text-align: right;
   position: absolute;
   top: 85px;
   left: 200px;
-  right: 40px;
+  right: 30px;
   bottom: 40px;
   border: 1px solid #999999;
   background-color: #F9F9F9;
   overflow: auto;
   /* css hack for IE */
-  width: expression((parseInt(document.documentElement.clientWidth)-240)+'px');
+  width: expression((parseInt(document.documentElement.clientWidth)-230)+'px');
   height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
 }
 
+#mailpreviewframe
+{
+  position: absolute;
+  top: 305px;
+  left: 200px;
+  right: 30px;
+  bottom: 40px;
+  border: 1px solid #999999;
+  background-color: #F9F9F9;
+  /* css hack for IE */
+  width: expression((parseInt(document.documentElement.clientWidth)-230)+'px');
+  height: expression((parseInt(document.documentElement.clientHeight)-135-document.getElementById('mailcontframe').offsetHeight)+'px');
+}
+
+#messagecontframe
+{
+  width: 100%;
+  height: 100%;
+  border: 0;
+}
+
+/*\*/
+html>body*#messagecontframe
+{
+  [height: 40%;
+  height: 40%;
+  ]height: 100%;
+}
+/**/
 
 #messagepartframe
 {
+  position: absolute;
+  top: 0px;
+  left: 0px;
+  right: 0px;
+  bottom: 0px;
+  width: auto;
+  height: auto;
   border: 1px solid #999999;
-  background-color: #F9F9F9;  
+  background-color: #F9F9F9;
 }
 
 
   font-weight: bold;
 }
 
-#rcmdraglayer
-{
-  width: 300px;
-  border: 1px solid #999999;
-  background-color: #F9F9F9;
-  padding-left: 8px;
-  padding-right: 8px;
-  padding-top: 3px;
-  padding-bottom: 3px;
-  font-size: 11px;
-  opacity: 0.6;
-  -moz-opacity: 0.6;
-}
-
 
 /** mailbox list styles */
 
   position: absolute;
   top: 85px;
   left: 20px;
-  width: 140px !important;
+  width: 145px !important;
 /*  width: 162px; */
   height: 13px;
   padding: 3px 10px 2px 10px;
   position: absolute;
   top: 105px;
   left: 20px;
-  width: 160px;
+  width: 165px;
   bottom: 40px;
   border: 1px solid #CCCCCC;
   background-color: #F9F9F9;
@@ -373,8 +395,7 @@ body.messagelist
   background: url(images/sort_desc.gif) top right no-repeat;
 }
 
-#messagelist thead tr td a,
-#messagelist thead tr td a:hover
+#messagelist thead tr td a
 {
   display: block;
   width: auto !important;
@@ -385,8 +406,7 @@ body.messagelist
 
 #messagelist tbody tr td
 {
-  height: 16px !important;
-  height: 20px;
+  height: 16px;
   padding: 2px;
   padding-right: 4px;
   font-size: 11px;
@@ -397,6 +417,12 @@ body.messagelist
   cursor: pointer;
 }
 
+#messagelist tbody tr td a
+{
+  color: #000;
+  text-decoration: none;
+}
+
 #messagelist col
 {
   display: table-column;
@@ -432,7 +458,7 @@ body.messagelist
 
 #messagelist tr td.date
 {
-  width: 110px;
+  width: 118px;
   vertical-align: middle;
 }
 
@@ -456,35 +482,27 @@ body.messagelist
 
 #messagelist tr.selected td
 {
-  font-weight: bold;
   color: #FFFFFF;
   background-color: #CC3333;
 }
 
-#messagelist tr.focused td
-{
-  border-bottom: thin dotted;
-  border-top: thin dotted;
-}
-
 #messagelist tr.unfocused td
 {
-  font-weight: bold;
   color: #FFFFFF;
   background-color: #929292;
 }
 
-#messagelist tr.selected td a.rcmContactAddress
+#messagelist tr.selected td a
 {
   color: #FFFFFF;
 }
 
-#messagelist tr.unfocused td a.rcmContactAddress
+#messagelist tr.unfocused td a
 {
   color: #FFFFFF;
 }
 
-#messagelist tr.deleted td a.rcmContactAddress
+#messagelist tr.deleted td a
 {
   color: #CCCCCC;
 }
@@ -495,65 +513,20 @@ body.messagelist
   color: #CCCCCC;
 }
 
-#quicksearchbar
-{
-  position: absolute;
-  top: 60px;
-  right: 40px;
-  width: 182px;
-  height: 20px;
-  text-align: right;
-  background: url('images/searchfield.gif') top left no-repeat;
-}
 
-#quicksearchbar a
+#quotadisplay
 {
-  position: absolute;
-  top: 3px;
-  right: 4px;
-  text-decoration: none;
+  color: #666666;
+  font-size: 11px;
 }
 
-#quicksearchbar img
+#quotadisplay img
 {
   vertical-align: middle;
+  margin-left: 4px;
+  border: 1px solid #666666;
 }
 
-#quicksearchbox
-{
-  position: absolute;
-  top: 2px;
-  left: 20px;
-  width: 140px;
-  font-size: 11px;
-  padding: 0px;
-  border: none;
-}
-
-
-/*\*/
-html>body*#quicksearchbar { background-image: none; }
-html>body*#quicksearchbar a { top: 5px; }
-html>body*#quicksearchbar #quicksearchbox { width: 180px; top:0px; right: 1px; left: auto; }
-/**/
-
-
-#rcversion
-{
-  position: absolute;
-  top: 67px;
-  left: 20px;
-  width: 160px;
-  text-align: center;
-
-  font-weight: normal;
-  font-size: x-small;
-  font-variant: small-caps;
-  
-  color: #999999;
-  /*border: 1px solid #308014;
-  background-color: #b4eeb4;*/
-}
 
 /** message view styles */
 
@@ -563,7 +536,7 @@ html>body*#quicksearchbar #quicksearchbox { width: 180px; top:0px; right: 1px; l
   position: absolute;
   top: 85px;
   left: 200px;
-  right: 40px;
+  right: 30px;
   bottom: 40px;
   border: 1px solid #cccccc;
   background-color: #FFFFFF;
@@ -574,12 +547,25 @@ html>body*#quicksearchbar #quicksearchbox { width: 180px; top:0px; right: 1px; l
   height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
 }
 
+div.messageheaderbox
+{
+  margin: 6px 8px 0px 8px;
+  border: 1px solid #ccc;
+}
+
 table.headers-table
 {
   width: 100%;
   background-color: #EBEBEB;
   table-layout: fixed;
+}
 
+#messagebody table.headers-table
+{
+  width: auto;
+  margin: 6px 8px;
+  background-color: #F4F4F4;
+  border: 1px solid #ccc;
 }
 
 table.headers-table tr td
@@ -608,16 +594,26 @@ table.headers-table tr td.subject
 {
   margin: 0px;
   padding: 0px 0px 0px 68px;
-  height: 18px;
+  min-height: 18px;
   list-style-image: none;
   list-style-type: none;
-  background: url(images/icons/attachment.png) 52px 1px no-repeat #DFDFDF; 
-  border-bottom: 1px solid #FFFFFF;
+  background: url(images/icons/attachment.png) 52px 1px no-repeat #DFDFDF;
+  /* css hack for IE */
+  height: expression(Math.min(18, parseInt(this.clientHeight))+'px');
+}
+
+#attachment-list:after
+{
+  content: ".";
+  display: block;
+  height: 0;
+  font-size: 0;
+  clear: both;
+  visibility: hidden;
 }
 
 #attachment-list li
 {
-/*  display: block; */
   float: left;
   height: 18px;
   font-size: 11px;
@@ -636,6 +632,7 @@ table.headers-table tr td.subject
 
 #messagebody
 {
+  position:relative;
   min-height: 300px;
   padding-top: 10px;
   padding-bottom: 10px;
@@ -654,12 +651,37 @@ div.message-part a
   color: #0000CC;
 }
 
-div.message-part pre
+div.message-part div.pre
 {
   margin: 0px;
   padding: 0px;
+  white-space: pre;
+  font-family: monospace;
 }
 
+div.message-part blockquote
+{
+  color: blue;
+  border-left: 2px solid blue;
+  border-right: 2px solid blue;
+  background-color: #F6F6F6;
+  margin: 2px 0px 2px 0px;
+  padding: 1px 8px 1px 10px;
+}
+
+div.message-part blockquote blockquote
+{
+  color: green;
+  border-left: 2px solid green;
+  border-right: 2px solid green;
+}
+
+div.message-part blockquote blockquote blockquote
+{
+  color: #990000;
+  border-left: 2px solid #bb0000;
+  border-right: 2px solid #bb0000;
+}
 
 #remote-objects-message
 {
@@ -856,8 +878,3 @@ div.message-part pre
   margin-top: 8px;
 }
 
-#rcmquotadisplay
-{
-  color: #999999;
-  font-size: 11px;
-}
index 24bfd4c7954bcde2cf251c652f3b590625e10e90..f19aad33e093ff5969704697d6cd44f68840e1b3 100644 (file)
@@ -3,7 +3,7 @@
 <script>
 
 var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32";
-var realSrc;
+var realSrc = null;
 var blankSrc = "skins/default/images/blank.gif";
 
 if (supported) fixImage();
@@ -35,7 +35,7 @@ function fixImage() {
    }
 
    // test for png
-   if ( /\.png$/.test( realSrc.toLowerCase() ) ) {
+   if ( realSrc &&  /\.png$/.test( realSrc.toLowerCase() ) ) {
       // set blank image
       element.src = blankSrc;
       // set filter
index ac184db9dc6d91e8c5f299eaa1ceda058b04831b..a36f87a1f04d09e79a0d7855beeff4662e61e324 100644 (file)
@@ -103,9 +103,34 @@ div.message-part a
   color: #0000CC;
 }
 
-div.message-part pre
+div.message-part div.pre
 {
   margin: 0;
   padding: 0;
-  font-size: 9pt;
+  white-space: pre;
+  font-family: monospace;
+}
+
+div.message-part blockquote
+{
+       color: blue;
+       border-left: 2px solid blue;
+       border-right: 2px solid blue;
+       background-color: #F6F6F6;
+       margin: 0.5em 0em 0.5em 0em;
+       padding: 0.25em 1em 0.25em 1em;
+}
+
+div.message-part blockquote blockquote
+{
+       color: green;
+       border-left: 2px solid green;
+       border-right: 2px solid green;
+}
+
+div.message-part blockquote blockquote blockquote
+{
+       color: #990000;
+       border-left: 2px solid #bb0000;
+       border-right: 2px solid #bb0000;
 }
index c172576fd55f0f3fc0a0af130e2c9788cf001177..ba5b65b312c0c055d6672af35db69ae822c6b219 100644 (file)
@@ -49,7 +49,7 @@ span.tablink-selected a
   position: absolute;
   top: 95px;
   left: 20px;
-  width: 550px;
+  width: 600px;
   border: 1px solid #999999;  
 }
 
@@ -78,7 +78,7 @@ span.tablink-selected a
 
 #identities-table
 {
-  width: 500px;
+  width: 600px;
   border: 1px solid #999999;
   background-color: #F9F9F9;
 }
index a7f4379ff1d6c91e31e4672043df6df157f351ef..e52b8c7377881449f7fb2b2c8eaad588fd9f0688 100644 (file)
@@ -7,7 +7,7 @@
 </head>
 <body class="iframe">
 
-<div id="contact-title"><roundcube:label name="addcontact" /></div>
+<div id="contact-title" class="boxtitle"><roundcube:label name="addcontact" /></div>
 
 <div id="contact-details">
 <roundcube:object name="contacteditform" size="40" />
@@ -17,6 +17,7 @@
 <roundcube:button command="save" type="input" class="button" label="save" />
 </p>
 
+</form>
 </div>
 
 
index dcf965604f96989fc2fd9f5956f682bd656fb70e..d1d202f8560320436362c9d4e12f4a4a9a3e7ac1 100644 (file)
 <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" 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" 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 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>
 
+<roundcube:if condition="config:ldap_public" />
+<div id="directorylist">
+<div id="groups-title"><roundcube:label name="groups" /></div>
+<roundcube:object name="directorylist" id="directories-list" />
+</div>
+
+<roundcube:else />
+<style type="text/css">
+#addresslist { left:20px; width:440px }
+#contacts-box { left:475px }
+#abookcountbar { left:20px }
+</style>
+
+<roundcube:endif />
+
 <div id="addresslist">
 <roundcube:object name="addresslist" id="contacts-table" class="records-table" cellspacing="0" summary="Contacts list" />
 </div>
 <roundcube:object name="addressframe" id="contact-frame" width="100%" height="100%" frameborder="0" src="/watermark.html" />
 </div>
 
+<div id="abookcountbar">
+<roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstpage" />
+<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" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextpage" />
+<roundcube:button command="lastpage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastpage" />
+</div>
+
 </body>
 </html>
index ed44bb56c5bb43de3824c9a96e00243e163b5a5f..1427371a72cdc59199e3f0b505d013a1748210cb 100644 (file)
@@ -94,21 +94,13 @@ function rcmail_toggle_display(id)
 
 </tr><tr>
 
-<td style="width:100%; height:98%; vertical-align:top;">
+<td style="width:100%; height:90%; vertical-align:top;">
 <roundcube:object name="composeBody" id="compose-body" form="form" cols="80" rows="20" wrap="virtual" tabindex="7" />
 
-<table border="0" cellspacing="0" width="100%" summary=""><tbody><tr>
-
-<td>
+<div>
 <roundcube:button type="input" command="send" class="button" label="sendmessage" />
 <roundcube:button type="input" command="list" class="button" label="cancel" />
-</td>
-<td align="right">
-<roundcube:label name="charset" />:&nbsp;<roundcube:object name="charsetSelector" tabindex="8" />
-</td>
-
-</tr></tbody></table>
-
+</div>
 </td>
 
 </tr>
@@ -133,6 +125,9 @@ function rcmail_toggle_display(id)
 var cc_field = document.form._cc;
 if (cc_field && cc_field.value!='')
   rcmail_toggle_display('compose-cc');
+var bcc_field = document.form._bcc;
+if (bcc_field && bcc_field.value!='')
+  rcmail_toggle_display('compose-bcc');
 
 //-->
 </script>
index 34f14e102ff3ceab3b14befbb5ac766c7aaaf234..bff81df0f0217f3f46c83963f5697569199400bd 100644 (file)
@@ -7,7 +7,7 @@
 </head>
 <body class="iframe">
 
-<div id="contact-title"><roundcube:label name="editcontact" /></div>
+<div id="contact-title" class="boxtitle"><roundcube:label name="editcontact" /></div>
 
 <div id="contact-details">
 <roundcube:object name="contacteditform" size="40" />
diff --git a/skins/default/templates/ldappublicsearch.html b/skins/default/templates/ldappublicsearch.html
deleted file mode 100644 (file)
index 70570c0..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!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>
-<link rel="stylesheet" type="text/css" href="/common.css" />
-<link rel="stylesheet" type="text/css" href="/ldapsearchform.css" />
-</head>
-<body class="iframe">
-
-<div id="ldapsearch-title"><roundcube:label name="ldappublicsearchform" /></div>
-
-<div id="ldapsearch-details">
-<roundcube:object name="ldappublicsearch" size="40" />
-<p>
-<roundcube:button command="ldappublicsearch" type="input" class="button" label="ldappublicsearch" />
-<input type="button" value="<roundcube:label name="cancel" />" class="button" onclick="history.back()" />&nbsp;
-<br /></p>
-</div>
-
-
-<div id="ldapsearch-results">
-<roundcube:object name="ldappublicaddresslist"
-  id="ldappublicaddresslist"
-  cellspacing="0"
-  summary="Ldap email address list" />
-</div>
-
-<roundcube:include file="/includes/ldapscripts.html" />
-
-</body>
-</html>
index 66ec6f242e2dbbf5fa84ab97c576c46fd6b3f62c..6f7999d7727888bf0a689941b5533ec347bb9f15 100644 (file)
@@ -9,25 +9,41 @@
   margin-left: auto;
   margin-right: auto;
   margin-top: 50px;
-  width: 350px;
+  width: 380px;
+  border: 1px solid #999;
+}
+
+#login-form table td.title
+{
+  color: #666;
+  text-align: right;
+  padding-right: 10px;
+}
+
+.boxcontent {
+  padding: 20px 20px 10px 20px;
 }
 
 </style>
 </head>
 <body>
 
-<img src="skins/default/images/roundcube_logo.png" id="rcmbtn104" width="165" height="55" border="0" alt="RoundCube Webmail" hspace="10" />
+<img src="/images/roundcube_logo.png" width="165" height="55" border="0" alt="<roundcube:object name='productname' />" hspace="10" />
 
 <roundcube:object name="message" id="message" />
 
 <div id="login-form">
+<div class="boxtitle"><roundcube:label name="welcome" /></div>
+<div class="boxcontent">
+
 <form name="form" action="./" method="post">
 <roundcube:object name="loginform" form="form" />
 
-<p style="text-align: center;"><input type="submit" class="button" value="<roundcube:label name="login" />" />
+<p style="text-align:center;"><input type="submit" class="button" value="<roundcube:label name='login' />" /></p>
 
 </form>
 </div>
+</div>
 
 </body>
 </html>
index c2e5316eb03a1159e7e6dc160df972340258cdd0..05c6ec7c6035c3fcc2d68128ed8985420b4a4750 100644 (file)
 </div>
 
 <div id="messagecountbar">
+<roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstmessages" />
 <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" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" />
+<roundcube:button command="lastpage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastmessages" />
 </div>
 
 <div id="mailboxlist-header"><roundcube:label name="mailboxlist" /></div>
   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" />
+<roundcube:if condition="env:quota" />
+<roundcube:label name="quota" />: <roundcube:object name="quotaDisplay" display="image" width="120" id="quotadisplay" />
+<roundcube:endif />
 </div>
 
 </body>
index f802b5a54de3d9ced8814c83e8892b6282951dad..9efed60bd9173b8eea2f98692af57242d33f1928 100644 (file)
 <roundcube:include file="/includes/header.html" />
 
 <div id="messagecountbar">
-<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" />
+<roundcube:button command="firstmessage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstmessage" />
+<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="previousmessage" />
 &nbsp;<roundcube:object name="messageCountDisplay" />&nbsp;
-<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" />
+<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="nextmessage" />
+<roundcube:button command="lastmessage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastmessage" />
 </div>
 
 <div id="messagetoolbar">
diff --git a/skins/default/templates/messagepreview.html b/skins/default/templates/messagepreview.html
new file mode 100644 (file)
index 0000000..e08f2c7
--- /dev/null
@@ -0,0 +1,19 @@
+<!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>
+<link rel="stylesheet" type="text/css" href="/common.css" />
+<link rel="stylesheet" type="text/css" href="/mail.css" />
+</head>
+<body class="iframe">
+
+<div class="messageheaderbox">
+<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" />
+</div>
+
+<roundcube:object name="blockedObjects" id="remote-objects-message" />
+<roundcube:object name="messageBody" id="messagebody" />
+
+</body>
+</html>
index 8a84343125c5b483af107c915de4bc1008351ad1..79304578c6b2529db7a0abd9698237ea1f10acd5 100644 (file)
@@ -7,12 +7,12 @@
 </head>
 <body class="iframe">
 
-<div id="contact-title"><roundcube:object name="contactdetails" part="name" /></div>
+<div id="contact-title" class="boxtitle"><roundcube:object name="contactdetails" part="name" /></div>
 
 <div id="contact-details">
 <roundcube:object name="contactdetails" />
 
-<p><br /><roundcube:button command="edit" type="input" class="button" label="editcontact" /></p>
+<p><br /><roundcube:button command="edit" type="input" class="button" label="editcontact" condition="!ENV:readonly" /></p>
 </div>
 
 </body>