diff options
69 files changed, 1555 insertions, 1033 deletions
@@ -1,6 +1,10 @@ CHANGELOG Roundcube Webmail =========================== +- Fix list mode switch to 'List' after saving list settings in Larry skin (#1489164) +- Fix error when there's no writeable addressbook source (#1489162) +- Add option show_real_foldernames to disable localization of special folders +- Fix zipdownload plugin issue with filenames charset (#1489156) - Fix database cache expunge issues (#1489149) - Fix date format issues on MS SQL Server (#1488918) - Fix so non-inline images aren't skipped on forward (#1489150) diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index 889d101d9..84a0a7a61 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -481,6 +481,9 @@ $rcmail_config['trash_mbox'] = 'Trash'; // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP) $rcmail_config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash'); +// Disable localization of the default folder names listed above +$rcmail_config['show_real_foldernames'] = false; + // automatically create the above listed default folders on first login $rcmail_config['create_default_folders'] = false; diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 305fb1e56..a5f325008 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,5 +1,6 @@ - Add vacation-seconds extension support (RFC 6131) - Several script parser code improvements +- Support string list arguments in filter form (#1489018) * version 6.2 [2013-02-17] ----------------------------------------------------------- @@ -206,18 +207,18 @@ - Added it_IT localization * version 1.1 [2009-05-27] ------------------------------------------------------------ +----------------------------------------------------------- - Added new icons - Added support for headers lists (coma-separated) in rules - Added de_CH localization * version 1.0 [2009-05-21] ------------------------------------------------------------ +----------------------------------------------------------- - Rewritten using plugin API - Added hu_HU localization (Tamas Tevesz) * version beta7 (svn-r2300) [2009-03-01] ------------------------------------------------------------ +----------------------------------------------------------- - Added SquirrelMail script auto-import (Jonathan Ernst) - Added 'vacation' support (Jonathan Ernst & alec) - Added 'stop' support (Jonathan Ernst) @@ -226,47 +227,47 @@ - Small style fixes * version 0.2-stable1 (svn-r2205) [2009-01-03] ------------------------------------------------------------ +----------------------------------------------------------- - Fix moving down filter row - Fixes for compressed js files in stable release package - Created patch for svn version r2205 * version 0.2-stable [2008-12-31] ------------------------------------------------------------ +----------------------------------------------------------- - Added ru_RU, fr_FR, zh_CN translation - Fixes for Roundcube 0.2-stable -* version rc0.2beta [2008-09-21] ------------------------------------------------------------ +* version 0.2-beta [2008-09-21] +----------------------------------------------------------- - Small css fixes for IE - Fixes for Roundcube 0.2-beta * version beta6 [2008-08-08] ------------------------------------------------------------ +----------------------------------------------------------- - Added de_DE translation - Fix for Roundcube r1634 * version beta5 [2008-06-10] ------------------------------------------------------------ +----------------------------------------------------------- - Fixed 'exists' operators - Fixed 'not*' operators for custom headers - Fixed filters deleting * version beta4 [2008-06-09] ------------------------------------------------------------ +----------------------------------------------------------- - Fix for Roundcube r1490 * version beta3 [2008-05-22] ------------------------------------------------------------ +----------------------------------------------------------- - Fixed textarea error class setting - Added pagetitle setting - Added option 'managesieve_replace_delimiter' - Fixed errors on IE (still need some css fixes) - + * version beta2 [2008-05-20] ------------------------------------------------------------ +----------------------------------------------------------- - Use 'if' only for first filter and 'elsif' for the rest * version beta1 [2008-05-15] ------------------------------------------------------------ +----------------------------------------------------------- - Initial version for Roundcube r1388. diff --git a/plugins/managesieve/localization/az_AZ.inc b/plugins/managesieve/localization/az_AZ.inc index b1bfae5e9..670162552 100644 --- a/plugins/managesieve/localization/az_AZ.inc +++ b/plugins/managesieve/localization/az_AZ.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Əlavə et'; $labels['del'] = 'Sil'; $labels['sender'] = 'Göndərən'; $labels['recipient'] = 'Qəbul edən'; -$labels['vacationaddresses'] = 'Əlavə ünvanlarım üçün siyahı (vergüllər ilə ayrılmış):'; +$labels['vacationaddr'] = 'Əlavə ünvanlarım üçün siyahı:'; $labels['vacationdays'] = 'Məktub neçə müddətdən bir göndərilsin (gündə):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/be_BE.inc b/plugins/managesieve/localization/be_BE.inc index 64f81599e..ff54c0546 100644 --- a/plugins/managesieve/localization/be_BE.inc +++ b/plugins/managesieve/localization/be_BE.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Дадаць'; $labels['del'] = 'Выдаліць'; $labels['sender'] = 'Ад каго'; $labels['recipient'] = 'Каму'; -$labels['vacationaddresses'] = 'Дадатковы спіс атрымальнікаў (праз коску):'; +$labels['vacationaddr'] = 'Дадатковы спіс атрымальнікаў:'; $labels['vacationdays'] = 'Як часта дасылаць паведамленні (ў днях):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/bg_BG.inc b/plugins/managesieve/localization/bg_BG.inc index a8f75df04..e22290cff 100644 --- a/plugins/managesieve/localization/bg_BG.inc +++ b/plugins/managesieve/localization/bg_BG.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Добавяне'; $labels['del'] = 'Изтриване'; $labels['sender'] = 'Подател'; $labels['recipient'] = 'Получател'; -$labels['vacationaddresses'] = 'Допълнителни e-mail адреси (разделени със запетая):'; +$labels['vacationaddr'] = 'Допълнителни e-mail адреси:'; $labels['vacationdays'] = 'Колко често пращате съобщения (в дни):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/bs_BA.inc b/plugins/managesieve/localization/bs_BA.inc index 7d21dbd9f..df9083129 100644 --- a/plugins/managesieve/localization/bs_BA.inc +++ b/plugins/managesieve/localization/bs_BA.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Dodaj'; $labels['del'] = 'Obriši'; $labels['sender'] = 'Pošiljaoc'; $labels['recipient'] = 'Primaoc'; -$labels['vacationaddresses'] = 'Moje dodatne email adrese (odvojite zarezima):'; +$labels['vacationaddr'] = 'Moje dodatne email adrese:'; $labels['vacationdays'] = 'Frekvencija slanja poruka (u danima):'; $labels['vacationinterval'] = 'Frekvencija slanja poruka:'; $labels['days'] = 'dana'; diff --git a/plugins/managesieve/localization/ca_ES.inc b/plugins/managesieve/localization/ca_ES.inc index df1cdec89..7ebd2c049 100644 --- a/plugins/managesieve/localization/ca_ES.inc +++ b/plugins/managesieve/localization/ca_ES.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Afegeix'; $labels['del'] = 'Suprimeix'; $labels['sender'] = 'Remitent'; $labels['recipient'] = 'Destinatari/a'; -$labels['vacationaddresses'] = 'Altres adreces electròniques meves (separades per coma)'; +$labels['vacationaddr'] = 'Altres adreces electròniques meves:'; $labels['vacationdays'] = 'Cada quan enviar un missatge (en dies):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/cs_CZ.inc b/plugins/managesieve/localization/cs_CZ.inc index 26baeff2b..c14873bb7 100644 --- a/plugins/managesieve/localization/cs_CZ.inc +++ b/plugins/managesieve/localization/cs_CZ.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Přidej'; $labels['del'] = 'Smaž'; $labels['sender'] = 'Odesílatel'; $labels['recipient'] = 'Příjemce'; -$labels['vacationaddresses'] = 'Moje další e-mailové adresy (aliasy) spojené s tímto účtem (oddělené čárkou):'; +$labels['vacationaddr'] = 'Moje další e-mailové adresy (aliasy) spojené s tímto účtem:'; $labels['vacationdays'] = 'Počet dnů mezi automatickými odpověďmi:'; $labels['vacationinterval'] = 'Prodleva mezi automatickými odpověďmi:'; $labels['days'] = 'dnů'; diff --git a/plugins/managesieve/localization/cy_GB.inc b/plugins/managesieve/localization/cy_GB.inc index 800d14b65..63d2e7100 100644 --- a/plugins/managesieve/localization/cy_GB.inc +++ b/plugins/managesieve/localization/cy_GB.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Ychwanegu'; $labels['del'] = 'Dileu'; $labels['sender'] = 'Anfonwr'; $labels['recipient'] = 'Derbynnwr'; -$labels['vacationaddresses'] = 'Fy chyfeiriadau ebost ychwanegol (gwahanir gyda coma):'; +$labels['vacationaddr'] = 'Fy chyfeiriadau ebost ychwanegol:'; $labels['vacationdays'] = 'Pa mor aml i ddanfon negeseuon (mewn dyddiau):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/da_DK.inc b/plugins/managesieve/localization/da_DK.inc index 6bc43cf58..058481031 100644 --- a/plugins/managesieve/localization/da_DK.inc +++ b/plugins/managesieve/localization/da_DK.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Tilføje'; $labels['del'] = 'Fjern'; $labels['sender'] = 'Afsender'; $labels['recipient'] = 'Modtager'; -$labels['vacationaddresses'] = 'Mine alternative e-mailadresser (kommasepareret):'; +$labels['vacationaddr'] = 'Mine alternative e-mailadresser:'; $labels['vacationdays'] = 'Hvor tit skal besked sendes (i dage):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/de_CH.inc b/plugins/managesieve/localization/de_CH.inc index b30625fe9..19a9b9de3 100644 --- a/plugins/managesieve/localization/de_CH.inc +++ b/plugins/managesieve/localization/de_CH.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Hinzufügen'; $labels['del'] = 'Löschen'; $labels['sender'] = 'Absender'; $labels['recipient'] = 'Empfänger'; -$labels['vacationaddresses'] = 'Zusätzliche Liste von Empfängern (Komma getrennt):'; +$labels['vacationaddr'] = 'Zusätzliche Liste von Empfängern:'; $labels['vacationdays'] = 'Antwort wird erneut gesendet nach (in Tagen):'; $labels['vacationinterval'] = 'Wie oft senden:'; $labels['days'] = 'Tage'; diff --git a/plugins/managesieve/localization/de_DE.inc b/plugins/managesieve/localization/de_DE.inc index 1b741efc6..4894904d6 100644 --- a/plugins/managesieve/localization/de_DE.inc +++ b/plugins/managesieve/localization/de_DE.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Hinzufügen'; $labels['del'] = 'Löschen'; $labels['sender'] = 'Absender'; $labels['recipient'] = 'Empfänger'; -$labels['vacationaddresses'] = 'Zusätzliche Liste von E-Mail Empfängern (Komma getrennt):'; +$labels['vacationaddr'] = 'Zusätzliche Liste von E-Mail Empfängern:'; $labels['vacationdays'] = 'Wie oft sollen Nachrichten gesendet werden (in Tagen):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/el_GR.inc b/plugins/managesieve/localization/el_GR.inc index 714b7240f..e5a1b792d 100644 --- a/plugins/managesieve/localization/el_GR.inc +++ b/plugins/managesieve/localization/el_GR.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Προσθήκη'; $labels['del'] = 'Διαγραφή'; $labels['sender'] = 'Αποστολέας'; $labels['recipient'] = 'Παραλήπτης'; -$labels['vacationaddresses'] = 'Πρόσθετη λίστα email παραληπτών (διαχωρισμένη με κόμματα):'; +$labels['vacationaddr'] = 'Πρόσθετη λίστα email παραληπτών:'; $labels['vacationdays'] = 'Συχνότητα αποστολής μηνυμάτων (σε ημέρες):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/en_GB.inc b/plugins/managesieve/localization/en_GB.inc index 4dd4f7d8b..ff4965ca0 100644 --- a/plugins/managesieve/localization/en_GB.inc +++ b/plugins/managesieve/localization/en_GB.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Add'; $labels['del'] = 'Delete'; $labels['sender'] = 'Sender'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'Additional list of recipient e-mails (comma separated):'; +$labels['vacationaddr'] = 'Additional list of recipient e-mails:'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/en_US.inc b/plugins/managesieve/localization/en_US.inc index 2b391e0c5..9fe943446 100644 --- a/plugins/managesieve/localization/en_US.inc +++ b/plugins/managesieve/localization/en_US.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Add'; $labels['del'] = 'Delete'; $labels['sender'] = 'Sender'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/eo.inc b/plugins/managesieve/localization/eo.inc index 3ce49ddb2..3f54e2391 100644 --- a/plugins/managesieve/localization/eo.inc +++ b/plugins/managesieve/localization/eo.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Aldoni'; $labels['del'] = 'Forigi'; $labels['sender'] = 'Sendanto'; $labels['recipient'] = 'Ricevanto'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/es_AR.inc b/plugins/managesieve/localization/es_AR.inc index c9c6e70f8..e8d90efcf 100644 --- a/plugins/managesieve/localization/es_AR.inc +++ b/plugins/managesieve/localization/es_AR.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Agregar'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remitente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista de direcciones de correo de destinatarios adicionales (separados por comas):'; +$labels['vacationaddr'] = 'Lista de direcciones de correo de destinatarios adicionales:'; $labels['vacationdays'] = 'Cada cuanto enviar mensajes (en días):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/es_ES.inc b/plugins/managesieve/localization/es_ES.inc index 9673a9959..93ea89262 100644 --- a/plugins/managesieve/localization/es_ES.inc +++ b/plugins/managesieve/localization/es_ES.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Agregar'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remitente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista de direcciones de correo de destinatarios adicionales (separados por comas):'; +$labels['vacationaddr'] = 'Lista de direcciones de correo de destinatarios adicionales:'; $labels['vacationdays'] = 'Cada cuánto enviar mensajes (en días):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/et_EE.inc b/plugins/managesieve/localization/et_EE.inc index 334a65cee..7a10af41e 100644 --- a/plugins/managesieve/localization/et_EE.inc +++ b/plugins/managesieve/localization/et_EE.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Lisa'; $labels['del'] = 'Kustuta'; $labels['sender'] = 'Saatja'; $labels['recipient'] = 'Saaja'; -$labels['vacationaddresses'] = 'Lisanimekiri saaja e-posti aadressidest (komadega eraldatud):'; +$labels['vacationaddr'] = 'Lisanimekiri saaja e-posti aadressidest:'; $labels['vacationdays'] = 'Kui tihti kirju saata (päevades):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/fa_IR.inc b/plugins/managesieve/localization/fa_IR.inc index 91dfcb605..1c8eace27 100644 --- a/plugins/managesieve/localization/fa_IR.inc +++ b/plugins/managesieve/localization/fa_IR.inc @@ -55,7 +55,6 @@ $labels['add'] = 'افزودن'; $labels['del'] = 'حذف'; $labels['sender'] = 'فرستنده'; $labels['recipient'] = 'گیرنده'; -$labels['vacationaddresses'] = 'آدرسهای ایمیل دیگر من (جدا شده با ویرگول):'; $labels['vacationdays'] = 'پیغام ها در چه مواقعی فرستاده شدند (در روزهای):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/fi_FI.inc b/plugins/managesieve/localization/fi_FI.inc index 71856c95f..f006f6d23 100644 --- a/plugins/managesieve/localization/fi_FI.inc +++ b/plugins/managesieve/localization/fi_FI.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Lisää'; $labels['del'] = 'Poista'; $labels['sender'] = 'Lähettäjä'; $labels['recipient'] = 'Vastaanottaja'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/fr_FR.inc b/plugins/managesieve/localization/fr_FR.inc index 9be9f1054..047c455ef 100644 --- a/plugins/managesieve/localization/fr_FR.inc +++ b/plugins/managesieve/localization/fr_FR.inc @@ -55,12 +55,12 @@ $labels['add'] = 'Ajouter'; $labels['del'] = 'Supprimer'; $labels['sender'] = 'Expéditeur'; $labels['recipient'] = 'Destinataire'; -$labels['vacationaddresses'] = 'Liste des destinataires (séparés par une virgule) :'; -$labels['vacationdays'] = 'Ne pas renvoyer un message avant (jours) :'; +$labels['vacationaddr'] = 'Liste des destinataires:'; +$labels['vacationdays'] = 'Ne pas renvoyer un message avant (jours):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; $labels['seconds'] = 'seconds'; -$labels['vacationreason'] = 'Corps du message (raison de l\'absence) :'; +$labels['vacationreason'] = 'Corps du message (raison de l\'absence):'; $labels['vacationsubject'] = 'Sujet du message:'; $labels['rulestop'] = 'Arrêter d\'évaluer les prochaines règles'; $labels['enable'] = 'Activer/Désactiver'; diff --git a/plugins/managesieve/localization/gl_ES.inc b/plugins/managesieve/localization/gl_ES.inc index 3f492ad46..185490a94 100644 --- a/plugins/managesieve/localization/gl_ES.inc +++ b/plugins/managesieve/localization/gl_ES.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Engadir'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remitente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista de enderezos de correo de destinatarios adicionais (separados por comas):'; +$labels['vacationaddr'] = 'Lista de enderezos de correo de destinatarios adicionais:'; $labels['vacationdays'] = 'Cada canto enviar mensaxes (en días):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/he_IL.inc b/plugins/managesieve/localization/he_IL.inc index 0b2f67ede..932d4e5d6 100644 --- a/plugins/managesieve/localization/he_IL.inc +++ b/plugins/managesieve/localization/he_IL.inc @@ -55,7 +55,6 @@ $labels['add'] = 'הוספה'; $labels['del'] = 'מחיקה'; $labels['sender'] = 'השולח'; $labels['recipient'] = 'הנמען'; -$labels['vacationaddresses'] = 'כתובות דוא"ל נוספות שלי (מופרדות ע"י פסיקים)'; $labels['vacationdays'] = 'באיזו תדירות ( בימים ) לשלוח הודעות:'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/hu_HU.inc b/plugins/managesieve/localization/hu_HU.inc index 9d39ffac3..ea59fa717 100644 --- a/plugins/managesieve/localization/hu_HU.inc +++ b/plugins/managesieve/localization/hu_HU.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Hozzáadás'; $labels['del'] = 'Törlés'; $labels['sender'] = 'Feladó'; $labels['recipient'] = 'Címzett'; -$labels['vacationaddresses'] = 'További címzettek (vesszővel elválasztva):'; +$labels['vacationaddr'] = 'További címzettek:'; $labels['vacationdays'] = 'Válaszüzenet küldése ennyi naponként:'; $labels['vacationinterval'] = 'Milyen gyakran küld üzeneteket:'; $labels['days'] = 'napok'; diff --git a/plugins/managesieve/localization/hy_AM.inc b/plugins/managesieve/localization/hy_AM.inc index 908175f1d..68837b065 100644 --- a/plugins/managesieve/localization/hy_AM.inc +++ b/plugins/managesieve/localization/hy_AM.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Ավելացնել'; $labels['del'] = 'Ջնջել'; $labels['sender'] = 'Ուղարկող'; $labels['recipient'] = 'Ստացող'; -$labels['vacationaddresses'] = 'Իմ հավելյալ էլփոստի հասցեներ (բաժանված ստորակետներով).'; +$labels['vacationaddr'] = 'Իմ հավելյալ էլփոստի հասցեներ.'; $labels['vacationdays'] = 'Ինչ հաճախությամբ ուղարկել հաղորդագրությունները (օրեր)`'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/ia.inc b/plugins/managesieve/localization/ia.inc index 45f6e5263..945de27d8 100644 --- a/plugins/managesieve/localization/ia.inc +++ b/plugins/managesieve/localization/ia.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Add'; $labels['del'] = 'Delete'; $labels['sender'] = 'Sender'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/id_ID.inc b/plugins/managesieve/localization/id_ID.inc index a30c2a0b0..d98a326c1 100644 --- a/plugins/managesieve/localization/id_ID.inc +++ b/plugins/managesieve/localization/id_ID.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Tambah'; $labels['del'] = 'Hapus'; $labels['sender'] = 'Pengirim'; $labels['recipient'] = 'Penerima'; -$labels['vacationaddresses'] = 'Alamat email tambahan saya (dipisahkan koma):'; +$labels['vacationaddr'] = 'Alamat email tambahan saya:'; $labels['vacationdays'] = 'Seberapa sering mengirim pesan (dalam hari):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/it_IT.inc b/plugins/managesieve/localization/it_IT.inc index 6fb2c424f..b54c46d9a 100644 --- a/plugins/managesieve/localization/it_IT.inc +++ b/plugins/managesieve/localization/it_IT.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Aggiungi'; $labels['del'] = 'Elimina'; $labels['sender'] = 'Mittente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista di indirizzi e-mail di destinatari addizionali (separati da virgola):'; +$labels['vacationaddr'] = 'Lista di indirizzi e-mail di destinatari addizionali:'; $labels['vacationdays'] = 'Ogni quanti giorni ribadire il messaggio allo stesso mittente'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/ja_JP.inc b/plugins/managesieve/localization/ja_JP.inc index 0cd4f44b9..c8927d3f2 100644 --- a/plugins/managesieve/localization/ja_JP.inc +++ b/plugins/managesieve/localization/ja_JP.inc @@ -55,7 +55,7 @@ $labels['add'] = '追加'; $labels['del'] = '削除'; $labels['sender'] = '送信者'; $labels['recipient'] = '宛先'; -$labels['vacationaddresses'] = '電子メールの宛先の(コンマ区切った)追加のリスト:'; +$labels['vacationaddr'] = '電子メールの宛先の追加のリスト:'; $labels['vacationdays'] = 'メッセージを(1日に)送信する頻度:'; $labels['vacationinterval'] = 'メッセージを送信する頻度:'; $labels['days'] = '日'; diff --git a/plugins/managesieve/localization/ko_KR.inc b/plugins/managesieve/localization/ko_KR.inc index 5ab4fc220..1085f624d 100644 --- a/plugins/managesieve/localization/ko_KR.inc +++ b/plugins/managesieve/localization/ko_KR.inc @@ -55,7 +55,7 @@ $labels['add'] = '추가'; $labels['del'] = '삭제'; $labels['sender'] = '발신인'; $labels['recipient'] = '수신인'; -$labels['vacationaddresses'] = '나의 추가 이메일 주소 (쉼표로 구분됨):'; +$labels['vacationaddr'] = '나의 추가 이메일 주소:'; $labels['vacationdays'] = '메시지 발신 주기 (일):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/lt_LT.inc b/plugins/managesieve/localization/lt_LT.inc index fecd3d6bc..3b6f4eec4 100644 --- a/plugins/managesieve/localization/lt_LT.inc +++ b/plugins/managesieve/localization/lt_LT.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Pridėti'; $labels['del'] = 'Pašalinti'; $labels['sender'] = 'Siuntėjas'; $labels['recipient'] = 'Gavėjas'; -$labels['vacationaddresses'] = 'Papildomas gavėjų adresų sąrašas (skirti kableliais):'; +$labels['vacationaddr'] = 'Papildomas gavėjų adresų sąrašas:'; $labels['vacationdays'] = 'Kaip dažnai išsiųsti laiškus (dienomis):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/lv_LV.inc b/plugins/managesieve/localization/lv_LV.inc index f1f85c2e0..0a008f8b8 100644 --- a/plugins/managesieve/localization/lv_LV.inc +++ b/plugins/managesieve/localization/lv_LV.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Pievienot'; $labels['del'] = 'Dzēst'; $labels['sender'] = 'Sūtītājs'; $labels['recipient'] = 'Saņēmējs'; -$labels['vacationaddresses'] = 'Ievadiet vienu vai vairākus e-pastu(s), atdalot tos komatu:'; +$labels['vacationaddr'] = 'Ievadiet vienu vai vairākus e-pastu(s):'; $labels['vacationdays'] = 'Cik dienu laikā vienam un tam pašam sūtītājam neatbildēt atkārtoti (piem., 7):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/ml_IN.inc b/plugins/managesieve/localization/ml_IN.inc index 67cd6829f..761b4305b 100644 --- a/plugins/managesieve/localization/ml_IN.inc +++ b/plugins/managesieve/localization/ml_IN.inc @@ -55,7 +55,6 @@ $labels['add'] = 'ചേര്ക്കു'; $labels['del'] = 'നീക്കം ചെയ്യുക'; $labels['sender'] = 'അയചയാള്'; $labels['recipient'] = 'സ്വീകര്ത്താവ്'; -$labels['vacationaddresses'] = 'സ്വീകര്ത്താവിന്റെ ഇമെയില് വിലാസങ്ങളുടെ അധികമുള്ള പട്ടിക (കോമയിട്ട് തിരിച്ച)'; $labels['vacationdays'] = 'എത്ര ഭിവസം കൂടുമ്പോള് സന്ദേശം അയക്കണം:'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/mr_IN.inc b/plugins/managesieve/localization/mr_IN.inc index 3339737e0..082ea9bc6 100644 --- a/plugins/managesieve/localization/mr_IN.inc +++ b/plugins/managesieve/localization/mr_IN.inc @@ -55,7 +55,7 @@ $labels['add'] = 'समावेश करा'; $labels['del'] = 'नष्ट करा'; $labels['sender'] = 'प्रेषक'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/nb_NO.inc b/plugins/managesieve/localization/nb_NO.inc index c2c17b23c..c3bf98f8b 100644 --- a/plugins/managesieve/localization/nb_NO.inc +++ b/plugins/managesieve/localization/nb_NO.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Legg til'; $labels['del'] = 'Slett'; $labels['sender'] = 'Avsender'; $labels['recipient'] = 'Mottaker'; -$labels['vacationaddresses'] = 'Liste med mottakeradresser (adskilt med komma):'; +$labels['vacationaddr'] = 'Liste med mottakeradresser:'; $labels['vacationdays'] = 'Periode mellom meldinger (i dager):'; $labels['vacationinterval'] = 'Periode mellom meldinger:'; $labels['days'] = 'dager'; diff --git a/plugins/managesieve/localization/nl_NL.inc b/plugins/managesieve/localization/nl_NL.inc index 1fd6eee4e..80c2274b1 100644 --- a/plugins/managesieve/localization/nl_NL.inc +++ b/plugins/managesieve/localization/nl_NL.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Toevoegen'; $labels['del'] = 'Verwijderen'; $labels['sender'] = 'Afzender'; $labels['recipient'] = 'Ontvanger'; -$labels['vacationaddresses'] = 'Aanvullende lijst van geadresseerden (gescheiden met komma\'s):'; +$labels['vacationaddr'] = 'Aanvullende lijst van geadresseerden:'; $labels['vacationdays'] = 'Hoe vaak moet een bericht verstuurd worden (in dagen):'; $labels['vacationinterval'] = 'Hoe vaak moet een bericht verstuurd worden:'; $labels['days'] = 'dagen'; diff --git a/plugins/managesieve/localization/nn_NO.inc b/plugins/managesieve/localization/nn_NO.inc index 69af8cde4..03563a72b 100644 --- a/plugins/managesieve/localization/nn_NO.inc +++ b/plugins/managesieve/localization/nn_NO.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Legg til'; $labels['del'] = 'Slett'; $labels['sender'] = 'Avsendar'; $labels['recipient'] = 'Mottakar'; -$labels['vacationaddresses'] = 'Liste med mottakaradresser (komma-separert):'; +$labels['vacationaddr'] = 'Liste med mottakaradresser:'; $labels['vacationdays'] = 'Periode mellom meldingar (i dagar):'; $labels['vacationreason'] = 'Innhald (grunngjeving for fråvær)'; $labels['vacationsubject'] = 'Meldingsemne:'; diff --git a/plugins/managesieve/localization/pl_PL.inc b/plugins/managesieve/localization/pl_PL.inc index f2ec96eb9..287633727 100644 --- a/plugins/managesieve/localization/pl_PL.inc +++ b/plugins/managesieve/localization/pl_PL.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Dodaj'; $labels['del'] = 'Usuń'; $labels['sender'] = 'Nadawca'; $labels['recipient'] = 'Odbiorca'; -$labels['vacationaddresses'] = 'Lista dodatkowych adresów odbiorców (oddzielonych przecinkami):'; +$labels['vacationaddr'] = 'Lista dodatkowych adresów odbiorców:'; $labels['vacationdays'] = 'Częstotliwość wysyłania wiadomości (w dniach):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/pt_BR.inc b/plugins/managesieve/localization/pt_BR.inc index fb4699fd2..92c1e6ae6 100644 --- a/plugins/managesieve/localization/pt_BR.inc +++ b/plugins/managesieve/localization/pt_BR.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Adicionar'; $labels['del'] = 'Excluir'; $labels['sender'] = 'Remetente'; $labels['recipient'] = 'Destinatário'; -$labels['vacationaddresses'] = 'Lista adicional de e-mails destinatários (separado por vírgula):'; +$labels['vacationaddr'] = 'Lista adicional de e-mails destinatários:'; $labels['vacationdays'] = 'Enviar mensagens com que frequência (em dias):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/pt_PT.inc b/plugins/managesieve/localization/pt_PT.inc index bfb3f296a..f51e8bf5e 100644 --- a/plugins/managesieve/localization/pt_PT.inc +++ b/plugins/managesieve/localization/pt_PT.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Adicionar'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remetente'; $labels['recipient'] = 'Destinatário'; -$labels['vacationaddresses'] = 'Lista adicional de destinatários de e-mails (separados por vírgula):'; +$labels['vacationaddr'] = 'Lista adicional de destinatários de e-mails:'; $labels['vacationdays'] = 'Enviar mensagens com que frequência (em dias):'; $labels['vacationinterval'] = 'Com que frequência envia mensagens:'; $labels['days'] = 'dias'; diff --git a/plugins/managesieve/localization/ro_RO.inc b/plugins/managesieve/localization/ro_RO.inc index 2c917cbdd..8d6e9c96f 100644 --- a/plugins/managesieve/localization/ro_RO.inc +++ b/plugins/managesieve/localization/ro_RO.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Adaugă'; $labels['del'] = 'Șterge'; $labels['sender'] = 'Expeditor'; $labels['recipient'] = 'Destinatar'; -$labels['vacationaddresses'] = 'Adresele mele de e-mail adiționale (împărțite cu virgulă):'; +$labels['vacationaddr'] = 'Adresele mele de e-mail adiționale:'; $labels['vacationdays'] = 'Cât de des să trimit mesajele (în zile):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/ru_RU.inc b/plugins/managesieve/localization/ru_RU.inc index b05074c22..6aab60da6 100644 --- a/plugins/managesieve/localization/ru_RU.inc +++ b/plugins/managesieve/localization/ru_RU.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Добавить'; $labels['del'] = 'Удалить'; $labels['sender'] = 'Отправитель'; $labels['recipient'] = 'Получатель'; -$labels['vacationaddresses'] = 'Список моих дополнительных адресов (разделённых запятыми):'; +$labels['vacationaddr'] = 'Список моих дополнительных адресов:'; $labels['vacationdays'] = 'Как часто отправлять сообщения (в днях):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/si_LK.inc b/plugins/managesieve/localization/si_LK.inc index afc2e3851..378fcf15d 100644 --- a/plugins/managesieve/localization/si_LK.inc +++ b/plugins/managesieve/localization/si_LK.inc @@ -55,7 +55,6 @@ $labels['add'] = 'එක් කරන්න'; $labels['del'] = 'මකන්න'; $labels['sender'] = 'යවන්නා'; $labels['recipient'] = 'ලබන්නා'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/sk_SK.inc b/plugins/managesieve/localization/sk_SK.inc index f336cf2c5..9bfb2ef8f 100644 --- a/plugins/managesieve/localization/sk_SK.inc +++ b/plugins/managesieve/localization/sk_SK.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Pridaj'; $labels['del'] = 'Zmaž'; $labels['sender'] = 'Odosielateľ'; $labels['recipient'] = 'Adresát'; -$labels['vacationaddresses'] = 'Dodatoční príjemcovia správy (oddelení čiarkami):'; +$labels['vacationaddr'] = 'Dodatoční príjemcovia správy:'; $labels['vacationdays'] = 'Počet dní medzi odoslaním správy:'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/sl_SI.inc b/plugins/managesieve/localization/sl_SI.inc index f1c3b983b..0a30a3a87 100644 --- a/plugins/managesieve/localization/sl_SI.inc +++ b/plugins/managesieve/localization/sl_SI.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Dodaj'; $labels['del'] = 'Izbriši'; $labels['sender'] = 'Pošiljatelj'; $labels['recipient'] = 'Prejemnik'; -$labels['vacationaddresses'] = 'Dodaten seznam naslovov prejemnikov (ločenih z vejico):'; +$labels['vacationaddr'] = 'Dodaten seznam naslovov prejemnikov:'; $labels['vacationdays'] = 'Kako pogosto naj bodo sporočila poslana (v dnevih):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/sv_SE.inc b/plugins/managesieve/localization/sv_SE.inc index 49d5b1222..f2aeddd9f 100644 --- a/plugins/managesieve/localization/sv_SE.inc +++ b/plugins/managesieve/localization/sv_SE.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Lägg till'; $labels['del'] = 'Ta bort'; $labels['sender'] = 'Avsändare'; $labels['recipient'] = 'Mottagare'; -$labels['vacationaddresses'] = 'Ytterligare mottagaradresser (avdelade med kommatecken)'; +$labels['vacationaddr'] = 'Ytterligare mottagaradresser:'; $labels['vacationdays'] = 'Antal dagar mellan auto-svar:'; $labels['vacationinterval'] = 'Tid mellan auto-svar:'; $labels['days'] = 'Dagar'; diff --git a/plugins/managesieve/localization/tr_TR.inc b/plugins/managesieve/localization/tr_TR.inc index 984cb94c4..19bbb2e8e 100644 --- a/plugins/managesieve/localization/tr_TR.inc +++ b/plugins/managesieve/localization/tr_TR.inc @@ -55,8 +55,8 @@ $labels['add'] = 'Ekle'; $labels['del'] = 'Sil'; $labels['sender'] = 'Gönderici'; $labels['recipient'] = 'Alıcı'; -$labels['vacationaddresses'] = 'İlave e-posta adreslerim(virgül ile ayrılmış)'; -$labels['vacationdays'] = 'Ne sıklıkla mesajlar gönderilir(gün)'; +$labels['vacationaddr'] = 'İlave e-posta adreslerim:'; +$labels['vacationdays'] = 'Ne sıklıkla mesajlar gönderilir(gün):'; $labels['vacationinterval'] = 'Ne kadar sıklıkla mesaj gönderirsiniz:'; $labels['days'] = 'günler'; $labels['seconds'] = 'saniyeler'; diff --git a/plugins/managesieve/localization/uk_UA.inc b/plugins/managesieve/localization/uk_UA.inc index 41623df35..57cab9ea5 100644 --- a/plugins/managesieve/localization/uk_UA.inc +++ b/plugins/managesieve/localization/uk_UA.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Додати'; $labels['del'] = 'Видалити'; $labels['sender'] = 'Відправник'; $labels['recipient'] = 'Отримувач'; -$labels['vacationaddresses'] = 'Додатковий список адрес отримувачів (розділених комою)'; +$labels['vacationaddr'] = 'Додатковий список адрес отримувачів:'; $labels['vacationdays'] = 'Як часто повторювати (у днях):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/vi_VN.inc b/plugins/managesieve/localization/vi_VN.inc index 8d6fcd348..6e65cccf5 100644 --- a/plugins/managesieve/localization/vi_VN.inc +++ b/plugins/managesieve/localization/vi_VN.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Thêm'; $labels['del'] = 'Xoá'; $labels['sender'] = 'Người gửi'; $labels['recipient'] = 'Người nhận'; -$labels['vacationaddresses'] = 'Địa chỉ email bổ sung của tôi ( phân cách bằng dấu phẩy)'; +$labels['vacationaddr'] = 'Địa chỉ email bổ sung của tôi'; $labels['vacationdays'] = 'Số lần gửi thư (trong ngày)'; $labels['vacationreason'] = 'Nội dung chính'; $labels['vacationsubject'] = 'Tiêu đề thư'; diff --git a/plugins/managesieve/localization/zh_CN.inc b/plugins/managesieve/localization/zh_CN.inc index 79b705c54..106fb40fc 100644 --- a/plugins/managesieve/localization/zh_CN.inc +++ b/plugins/managesieve/localization/zh_CN.inc @@ -55,7 +55,7 @@ $labels['add'] = '添加'; $labels['del'] = '删除'; $labels['sender'] = '发件人'; $labels['recipient'] = '收件人'; -$labels['vacationaddresses'] = '收件人地址的附加名单(以半角逗号分隔)'; +$labels['vacationaddr'] = '收件人地址的附加名单'; $labels['vacationdays'] = '发送邮件频率(单位:天):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/zh_TW.inc b/plugins/managesieve/localization/zh_TW.inc index 3f3fc1313..047ebcccc 100644 --- a/plugins/managesieve/localization/zh_TW.inc +++ b/plugins/managesieve/localization/zh_TW.inc @@ -55,7 +55,7 @@ $labels['add'] = '新增'; $labels['del'] = '刪除'; $labels['sender'] = '寄件者'; $labels['recipient'] = '收件者'; -$labels['vacationaddresses'] = '其他收件者(用半形逗號隔開):'; +$labels['vacationaddr'] = '其他收件者:'; $labels['vacationdays'] = '多久回覆一次(單位:天):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index 04b9a76af..a1f31bb25 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -55,6 +55,11 @@ if (window.rcmail) { } $('input[type="text"]:first', rcmail.gui_objects.sieveform).focus(); + + // initialize smart list inputs + $('textarea[data-type="list"]', rcmail.gui_objects.sieveform).each(function() { + smart_field_init(this); + }); } else { rcmail.enable_command('plugin.managesieve-add', 'plugin.managesieve-setadd', !rcmail.env.sieveconnerror); @@ -469,6 +474,11 @@ rcube_webmail.prototype.managesieve_rulefill = function(content, id, after) row.className = 'rulerow'; row.innerHTML = content; + // initialize smart list inputs + $('textarea[data-type="list"]', row).each(function() { + smart_field_init(this); + }); + this.managesieve_formbuttons(div); } }; @@ -565,8 +575,7 @@ function rule_header_select(id) var obj = document.getElementById('header' + id), size = document.getElementById('rule_size' + id), op = document.getElementById('rule_op' + id), - target = document.getElementById('rule_target' + id), - header = document.getElementById('custom_header' + id), + header = document.getElementById('custom_header' + id + '_list'), mod = document.getElementById('rule_mod' + id), trans = document.getElementById('rule_trans' + id), comp = document.getElementById('rule_comp' + id); @@ -574,31 +583,30 @@ function rule_header_select(id) if (obj.value == 'size') { size.style.display = 'inline'; op.style.display = 'none'; - target.style.display = 'none'; header.style.display = 'none'; mod.style.display = 'none'; trans.style.display = 'none'; comp.style.display = 'none'; } else { - header.style.display = obj.value != '...' ? 'none' : 'inline'; + header.style.display = obj.value != '...' ? 'none' : 'inline-block'; size.style.display = 'none'; op.style.display = 'inline'; comp.style.display = ''; - rule_op_select(id); mod.style.display = obj.value == 'body' ? 'none' : 'block'; trans.style.display = obj.value == 'body' ? 'block' : 'none'; } + rule_op_select(op, id, obj.value); obj.style.width = obj.value == '...' ? '40px' : ''; }; -function rule_op_select(id) +function rule_op_select(obj, id, header) { - var obj = document.getElementById('rule_op' + id), - target = document.getElementById('rule_target' + id); + var target = document.getElementById('rule_target' + id + '_list'), + style = obj.value == 'exists' || obj.value == 'notexists' || header == 'size' ? 'none' : 'inline-block'; - target.style.display = obj.value == 'exists' || obj.value == 'notexists' ? 'none' : 'inline'; + target.style.display = style; }; function rule_trans_select(id) @@ -677,6 +685,72 @@ function action_type_select(id) } }; +// Inititalizes smart list input +function smart_field_init(field) +{ + var id = field.id + '_list', + area = $('<span class="listarea"></span>'), + list = field.value ? field.value.split("\n") : ['']; + + if ($('#'+id).length) + return; + + // add input rows + $.each(list, function(i, v) { + area.append(smart_field_row(v, field.name, i, $(field).data('size'))); + }); + + area.attr('id', id); + field = $(field); + + if (field.attr('disabled')) + area.hide(); + + field.after(area); + + if (field.hasClass('error')) { + area.addClass('error'); + rcmail.managesieve_tip_register([[id, field.data('tip')]]); + } +}; + +function smart_field_row(value, name, idx, size) +{ + // build row element content + var input, content = '<span class="listelement">' + + '<span class="reset"></span><input type="text"></span>', + elem = $(content), + attrs = {value: value, name: name + '[]'}; + + if (size) + attrs.size = size; + + input = $('input', elem).attr(attrs).keydown(function(e) { + var input = $(this); + // element creation event (on Enter) + if (e.which == 13) { + var name = input.attr('name').replace(/\[\]$/, ''), + dt = (new Date()).getTime(), + elem = smart_field_row('', name, dt, size); + + input.parent().after(elem); + $('input', elem).focus(); + } + }); + + // element deletion event + $('span[class="reset"]', elem).click(function() { + var span = $(this.parentNode); + + if (span.parent().children().length > 1) + span.remove(); + else + $('input', span).val('').focus(); + }); + + return elem; +} + // Register onmouse(leave/enter) events for tips on specified form element rcube_webmail.prototype.managesieve_tip_register = function(tips) { @@ -685,25 +759,26 @@ rcube_webmail.prototype.managesieve_tip_register = function(tips) for (var n in tips) { $('#'+tips[n][0]) - .bind('mouseenter', {str: tips[n][1]}, - function(e) { - var offset = $(this).offset(), - left = offset.left, - top = offset.top - 12, - minwidth = $(this).width(); - - if (framed) { - offset = $((rcmail.env.task == 'mail' ? '#sievefilterform > iframe' : '#filter-box'), parent.document).offset(); - top += offset.top; - left += offset.left; - } - - tip.html(e.data.str) - top -= tip.height(); - - tip.css({left: left, top: top, minWidth: (minwidth-2) + 'px'}).show(); - }) - .bind('mouseleave', function(e) { tip.hide(); }); + .data('tip', tips[n][1]) + .bind('mouseenter', function(e) { + var elem = $(this), + offset = elem.offset(), + left = offset.left, + top = offset.top - 12, + minwidth = elem.width(); + + if (framed) { + offset = $((rcmail.env.task == 'mail' ? '#sievefilterform > iframe' : '#filter-box'), parent.document).offset(); + top += offset.top; + left += offset.left; + } + + tip.html(elem.data('tip')); + top -= tip.height(); + + tip.css({left: left, top: top, minWidth: (minwidth-2) + 'px'}).show(); + }) + .bind('mouseleave', function(e) { tip.hide(); }); } }; diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index f451a810e..63ca97a70 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -708,8 +708,9 @@ class managesieve extends rcube_plugin } else { foreach ($headers as $idx => $header) { + // targets are indexed differently (assume form order) + $target = $this->strip_value(array_shift($targets), true); $header = $this->strip_value($header); - $target = $this->strip_value($targets[$idx], true); $operator = $this->strip_value($ops[$idx]); $comparator = $this->strip_value($comparators[$idx]); @@ -747,10 +748,16 @@ class managesieve extends rcube_plugin $this->form['tests'][$i]['type'] = $type; $this->form['tests'][$i]['arg'] = $target; - if ($target == '' && $type != 'exists') + if (empty($target) && $type != 'exists') { $this->errors['tests'][$i]['target'] = $this->gettext('cannotbeempty'); - else if (preg_match('/^(value|count)-/', $type) && !preg_match('/[0-9]+/', $target)) - $this->errors['tests'][$i]['target'] = $this->gettext('forbiddenchars'); + } + else if (preg_match('/^(value|count)-/', $type)) { + foreach ($target as $target_value) { + if (!preg_match('/[0-9]+/', $target_value)) { + $this->errors['tests'][$i]['target'] = $this->gettext('forbiddenchars'); + } + } + } $this->form['tests'][$i]['part'] = $trans; if ($trans == 'content') { @@ -758,7 +765,7 @@ class managesieve extends rcube_plugin } } else { - $cust_header = $headers = $this->strip_value($cust_headers[$idx]); + $cust_header = $headers = $this->strip_value(array_shift($cust_headers)); $mod = $this->strip_value($mods[$idx]); $mod_type = $this->strip_value($mod_types[$idx]); @@ -767,8 +774,6 @@ class managesieve extends rcube_plugin $type = preg_replace('/^not/', '', $operator); if ($header == '...') { - $headers = preg_split('/[\s,]+/', $cust_header, -1, PREG_SPLIT_NO_EMPTY); - if (!count($headers)) $this->errors['tests'][$i]['header'] = $this->gettext('cannotbeempty'); else { @@ -809,10 +814,16 @@ class managesieve extends rcube_plugin $this->form['tests'][$i]['arg1'] = $header; $this->form['tests'][$i]['arg2'] = $target; - if ($target == '') + if (empty($target)) { $this->errors['tests'][$i]['target'] = $this->gettext('cannotbeempty'); - else if (preg_match('/^(value|count)-/', $type) && !preg_match('/[0-9]+/', $target)) - $this->errors['tests'][$i]['target'] = $this->gettext('forbiddenchars'); + } + else if (preg_match('/^(value|count)-/', $type)) { + foreach ($target as $target_value) { + if (!preg_match('/[0-9]+/', $target_value)) { + $this->errors['tests'][$i]['target'] = $this->gettext('forbiddenchars'); + } + } + } if ($mod) { $this->form['tests'][$i]['part'] = $mod_type; @@ -893,20 +904,14 @@ class managesieve extends rcube_plugin $interval_type = $interval_types[$idx] == 'seconds' ? 'seconds' : 'days'; $this->form['actions'][$i]['reason'] = str_replace("\r\n", "\n", $reason); $this->form['actions'][$i]['subject'] = $subject[$idx]; - $this->form['actions'][$i]['addresses'] = explode(',', $addresses[$idx]); + $this->form['actions'][$i]['addresses'] = array_shift($addresses); $this->form['actions'][$i][$interval_type] = $intervals[$idx]; // @TODO: vacation :mime, :from, :handle - if ($this->form['actions'][$i]['addresses']) { - foreach($this->form['actions'][$i]['addresses'] as $aidx => $address) { - $address = trim($address); - if (!$address) - unset($this->form['actions'][$i]['addresses'][$aidx]); - else if(!rcube_utils::check_email($address)) { - $this->errors['actions'][$i]['addresses'] = $this->gettext('noemailwarning'); - break; - } else - $this->form['actions'][$i]['addresses'][$aidx] = $address; + foreach ((array)$this->form['actions'][$i]['addresses'] as $aidx => $address) { + if (!rcube_utils::check_email($address)) { + $this->errors['actions'][$i]['addresses'] = $this->gettext('noemailwarning'); + break; } } @@ -1329,22 +1334,20 @@ class managesieve extends rcube_plugin $aout .= $select_header->show(); if (isset($rule['test']) && in_array($rule['test'], array('header', 'address', 'envelope'))) { - if (is_array($rule['arg1'])) - $custom = implode(', ', $rule['arg1']); - else if (!in_array($rule['arg1'], $this->headers)) - $custom = $rule['arg1']; + $custom = (array) $rule['arg1']; + if (count($custom) == 1 && isset($this->headers[strtolower($custom[0])])) { + unset($custom); + } } else if (isset($rule['test']) && $rule['test'] == 'exists') { - if (is_array($rule['arg'])) - $custom = implode(', ', $rule['arg']); - else if (!in_array($rule['arg'], $this->headers)) - $custom = $rule['arg']; + $custom = (array) $rule['arg']; + if (count($custom) == 1 && isset($this->headers[strtolower($custom[0])])) { + unset($custom); + } } - $tout = '<div id="custom_header' .$id. '" style="display:' .(isset($custom) ? 'inline' : 'none'). '"> - <input type="text" name="_custom_header[]" id="custom_header_i'.$id.'" ' - . $this->error_class($id, 'test', 'header', 'custom_header_i') - .' value="' .rcube::Q($custom). '" size="15" /> </div>' . "\n"; + $tout = $this->list_input($id, 'custom_header', $custom, isset($custom), + $this->error_class($id, 'test', 'header', 'custom_header'), 15) . "\n"; // matching type select (operator) $select_op = new html_select(array('name' => "_rule_op[]", 'id' => 'rule_op'.$id, @@ -1406,9 +1409,9 @@ class managesieve extends rcube_plugin } $tout .= $select_op->show($test); - $tout .= '<input type="text" name="_rule_target[]" id="rule_target' .$id. '" - value="' .rcube::Q($target). '" size="20" ' . $this->error_class($id, 'test', 'target', 'rule_target') - . ' style="display:' . ($rule['test']!='size' && $rule['test'] != 'exists' ? 'inline' : 'none') . '" />'."\n"; + $tout .= $this->list_input($id, 'rule_target', $target, + $rule['test'] != 'size' && $rule['test'] != 'exists', + $this->error_class($id, 'test', 'target', 'rule_target')) . "\n"; $select_size_op = new html_select(array('name' => "_rule_size_op[]", 'id' => 'rule_size_op'.$id)); $select_size_op->add(rcube::Q($this->gettext('filterover')), 'over'); @@ -1589,10 +1592,9 @@ class managesieve extends rcube_plugin .'<input type="text" name="_action_subject['.$id.']" id="action_subject'.$id.'" ' .'value="' . (is_array($action['subject']) ? rcube::Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' . $this->error_class($id, 'action', 'subject', 'action_subject') .' />'; - $out .= '<br /><span class="label">' .rcube::Q($this->gettext('vacationaddresses')) . '</span><br />' - .'<input type="text" name="_action_addresses['.$id.']" id="action_addr'.$id.'" ' - .'value="' . (is_array($action['addresses']) ? rcube::Q(implode(', ', $action['addresses']), 'strict', false) : $action['addresses']) . '" size="35" ' - . $this->error_class($id, 'action', 'addresses', 'action_addr') .' />'; + $out .= '<br /><span class="label">' .rcube::Q($this->gettext('vacationaddr')) . '</span><br />' + . $this->list_input($id, 'action_addresses', $action['addresses'], true, + $this->error_class($id, 'action', 'addresses', 'action_addresses'), 30); $out .= '<br /><span class="label">' . rcube::Q($this->gettext($vsec ? 'vacationinterval' : 'vacationdays')) . '</span><br />' .'<input type="text" name="_action_interval['.$id.']" id="action_interval'.$id.'" ' .'value="' .rcube::Q(isset($action['seconds']) ? $action['seconds'] : $action['days'], 'strict', false) . '" size="2" ' @@ -1727,6 +1729,18 @@ class managesieve extends rcube_plugin private function strip_value($str, $allow_html = false, $trim = true) { + if (is_array($str)) { + foreach ($str as $idx => $val) { + $val = $this->strip_value($val, $allow_html, $trim); + + if ($val === '') { + unset($str[$idx]); + } + } + + return $str; + } + if (!$allow_html) { $str = strip_tags($str); } @@ -1764,6 +1778,19 @@ class managesieve extends rcube_plugin $this->rc->output->add_script($script, 'foot'); } + private function list_input($id, $name, $value, $enabled, $class, $size=null) + { + $value = (array) $value; + $value = array_map(array('rcube', 'Q'), $value); + $value = implode("\n", $value); + + return '<textarea data-type="list" name="_' . $name . '['.$id.']" id="' . $name.$id . '"' + . ($enabled ? '' : ' disabled="disabled"') + . ($size ? ' data-size="'.$size.'"' : '') + . $class + . ' style="display:none">' . $value . '</textarea>'; + } + /** * Converts mailbox name from/to UTF7-IMAP from/to internal Sieve encoding * with delimiter replacement. diff --git a/plugins/managesieve/skins/classic/images/erase.png b/plugins/managesieve/skins/classic/images/erase.png Binary files differnew file mode 100644 index 000000000..ddd3a9782 --- /dev/null +++ b/plugins/managesieve/skins/classic/images/erase.png diff --git a/plugins/managesieve/skins/classic/managesieve.css b/plugins/managesieve/skins/classic/managesieve.css index 86a0d197d..1f112b956 100644 --- a/plugins/managesieve/skins/classic/managesieve.css +++ b/plugins/managesieve/skins/classic/managesieve.css @@ -201,11 +201,23 @@ td.rowtargets padding-top: 2px; } +td.rowtargets > div +{ + vertical-align: top; + margin-top: 2px; +} + td.rowtargets div.adv { padding-top: 3px; } +html.mozilla #filter-form select +{ + padding-top: 3px; + padding-bottom: 3px; +} + input.disabled, input.disabled:hover { color: #999999; @@ -226,6 +238,7 @@ input.radio select.operator_selector { width: 200px; + vertical-align: top; } td.rowtargets span, @@ -308,6 +321,75 @@ a.button.disabled font-size: 11px; } +/* smart multi-row input field */ +.listarea +{ + border: 1px solid #666; + margin: 0; + padding: 1px; + display: inline-block; + max-height: 67px; + overflow-y: auto; +} + +td.rowtargets > span.listarea +{ + vertical-align: top; + margin-top: 2px; +} + +.listelement +{ + display: block; + white-space: nowrap; + background-color: #fff; + border-top: 1px solid #e2e2e2; + height: 16px; + padding: 0; + margin: 0; + overflow: hidden; + line-height: 16px; +} + +.listarea.error .listelement +{ + background-color: #FFFFC4; +} + +.listelement:first-child +{ + border-top: none; +} + +#filter-form .listelement input +{ + border: none; + border-radius: 0; + box-shadow: none; + outline: none; + vertical-align: top; + height: 16px; + padding-top: 0; + padding-bottom: 0; + line-height: 16px; + background-color: transparent; +} + +.listelement input:focus +{ + box-shadow: none; +} + +.listelement .reset +{ + display: inline-block; + width: 16px; + height: 16px; + background: url(images/erase.png) -1px 0 no-repeat #eee; + cursor: pointer; +} + + /* fixes for popup window */ body.iframe.mail diff --git a/plugins/managesieve/skins/larry/images/erase.png b/plugins/managesieve/skins/larry/images/erase.png Binary files differnew file mode 100644 index 000000000..ddd3a9782 --- /dev/null +++ b/plugins/managesieve/skins/larry/images/erase.png diff --git a/plugins/managesieve/skins/larry/managesieve.css b/plugins/managesieve/skins/larry/managesieve.css index 099f05f0d..a618502d2 100644 --- a/plugins/managesieve/skins/larry/managesieve.css +++ b/plugins/managesieve/skins/larry/managesieve.css @@ -175,6 +175,12 @@ td.rowtargets padding-top: 2px; } +td.rowtargets > div +{ + vertical-align: top; + margin-top: 2px; +} + td.rowtargets div.adv { padding-top: 3px; @@ -205,6 +211,7 @@ input.radio select.operator_selector { width: 200px; + vertical-align: top; } td.rowtargets span, @@ -292,6 +299,12 @@ a.button.disabled padding: 1px; } +html.mozilla #filter-form select +{ + padding-top: 3px; + padding-bottom: 3px; +} + /* revert larry style button */ #filter-form input.button { @@ -306,6 +319,80 @@ fieldset border-radius: 4px; } +/* smart multi-row input field */ +.listarea +{ + border: 1px solid #B2B2B2; + border-radius: 4px; + box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + -moz-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + -webkit-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + -o-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + margin: 0; + padding: 2px; + display: inline-block; + max-height: 59px; + overflow-y: auto; +} + +td.rowtargets > span.listarea +{ + vertical-align: top; + margin-top: 2px; +} + +.listelement +{ + display: block; + white-space: nowrap; + background-color: #fff; + border-top: 1px solid #e2e2e2; + height: 14px; + padding: 0; + margin: 0; + overflow: hidden; + line-height: 14px; +} + +.listarea.error .listelement +{ + background-color: #FFFFC4; +} + +.listelement:first-child +{ + border-top: none; +} + +#filter-form .listelement input +{ + border: none; + border-radius: 0; + box-shadow: none; + outline: none; + vertical-align: top; + height: 14px; + padding-top: 0; + padding-bottom: 0; + line-height: 14px; + background-color: transparent; +} + +.listelement input:focus +{ + box-shadow: none; +} + +.listelement .reset +{ + display: inline-block; + width: 16px; + height: 16px; + background: url(images/erase.png) -1px -1px no-repeat #eee; + cursor: pointer; +} + + /* fixes for popup window */ body.iframe.mail diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php index fbf1d2342..59431267d 100644 --- a/plugins/zipdownload/zipdownload.php +++ b/plugins/zipdownload/zipdownload.php @@ -108,7 +108,7 @@ class zipdownload extends rcube_plugin foreach ($message->attachments as $part) { $pid = $part->mime_id; $part = $message->mime_parts[$pid]; - $disp_name = $this->_convert_filename($part->filename, $part->charset); + $disp_name = $this->_convert_filename($part->filename); if ($part->body) { $orig_message_raw = $part->body; @@ -263,9 +263,9 @@ class zipdownload extends rcube_plugin /** * Helper function to convert filenames to the configured charset */ - private function _convert_filename($str, $from = RCUBE_CHARSET) + private function _convert_filename($str) { - $str = rcube_charset::convert($str, $from == '' ? RCUBE_CHARSET : $from, $this->charset); + $str = rcube_charset::convert($str, RCUBE_CHARSET, $this->charset); return strtr($str, array(':'=>'', '/'=>'-')); } diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 0cb4aad15..fd625ba4d 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -228,6 +228,11 @@ class rcmail extends rcube } if (!$contacts) { + // there's no default, just return + if ($default) { + return null; + } + self::raise_error(array( 'code' => 700, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, @@ -1325,6 +1330,7 @@ class rcmail extends rcube $realnames = (bool)$attrib['realnames']; $msgcounts = $this->storage->get_cache('messagecount'); $collapsed = $this->config->get('collapsed_folders'); + $realnames = $this->config->get('show_real_foldernames'); $out = ''; foreach ($arrFolders as $folder) { @@ -1481,8 +1487,10 @@ class rcmail extends rcube */ public function localize_foldername($name, $with_path = true) { + $realnames = $this->config->get('show_real_foldernames'); + // try to localize path of the folder - if ($with_path) { + if ($with_path && !$realnames) { $storage = $this->get_storage(); $delimiter = $storage->get_hierarchy_delimiter(); $path = explode($delimiter, $name); @@ -1499,12 +1507,11 @@ class rcmail extends rcube } } - if ($folder_class = $this->folder_classname($name)) { + if (!$realnames && ($folder_class = $this->folder_classname($name))) { return $this->gettext($folder_class); } - else { - return rcube_charset::convert($name, 'UTF7-IMAP'); - } + + return rcube_charset::convert($name, 'UTF7-IMAP'); } diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 257efbbbc..0a84f8d08 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -308,14 +308,7 @@ class rcube_imap extends rcube_storage */ public function set_folder($folder) { - if ($this->folder == $folder) { - return; - } - $this->folder = $folder; - - // clear messagecount cache for this folder - $this->clear_messagecount($folder); } @@ -812,20 +805,22 @@ class rcube_imap extends rcube_storage return $mcache->get_thread($folder); } - if (empty($this->icache['threads'])) { - if (!$this->check_connection()) { - return new rcube_result_thread(); + if (!empty($this->icache['threads'])) { + if ($this->icache['threads']->get_parameters('MAILBOX') == $folder) { + return $this->icache['threads']; } + } - // get all threads - $result = $this->conn->thread($folder, $this->threading, - $this->options['skip_deleted'] ? 'UNDELETED' : '', true); - - // add to internal (fast) cache - $this->icache['threads'] = $result; + if (!$this->check_connection()) { + return new rcube_result_thread(); } - return $this->icache['threads']; + // get all threads + $result = $this->conn->thread($folder, $this->threading, + $this->options['skip_deleted'] ? 'UNDELETED' : '', true); + + // add to internal (fast) cache + return $this->icache['threads'] = $result; } diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc index 275208a98..88e4cfd9c 100644 --- a/program/localization/en_GB/labels.inc +++ b/program/localization/en_GB/labels.inc @@ -37,6 +37,7 @@ $labels['drafts'] = 'Drafts'; $labels['sent'] = 'Sent'; $labels['trash'] = 'Deleted Items'; $labels['junk'] = 'Junk'; +$labels['show_real_foldernames'] = 'Show real names for special folders'; // message listing $labels['subject'] = 'Subject'; diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 8a8fa2c07..d8e517387 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -37,6 +37,7 @@ $labels['drafts'] = 'Drafts'; $labels['sent'] = 'Sent'; $labels['trash'] = 'Trash'; $labels['junk'] = 'Junk'; +$labels['show_real_foldernames'] = 'Show real names for special folders'; // message listing $labels['subject'] = 'Subject'; diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index 3649d148c..8c0b1ffc0 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -81,9 +81,10 @@ foreach ($a_mailboxes as $mbox_name) { if (empty($_GET['_list'])) continue; - // get overall message count; allow caching because rcube_storage::folder_status() did a refresh + // get overall message count; allow caching because rcube_storage::folder_status() + // did a refresh but only in list mode $list_mode = $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL'; - $all_count = $RCMAIL->storage->count($mbox_name, $list_mode, false, false); + $all_count = $RCMAIL->storage->count($mbox_name, $list_mode, $list_mode == 'THREADS', false); $page = $RCMAIL->storage->get_page(); $page_size = $RCMAIL->storage->get_pagesize(); diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index d8d4372f9..59f4d55e1 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -275,9 +275,13 @@ function rcmail_contact_exists($email) if ($email) { // @TODO: search in all address books? $CONTACTS = $RCMAIL->get_address_book(-1, true); - $existing = $CONTACTS->search('email', $email, true, false); - if ($existing->count) - return true; + + if (is_object($CONTACTS)) { + $existing = $CONTACTS->search('email', $email, true, false); + if ($existing->count) { + return true; + } + } } return false; diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 636941d8c..3ee098ca8 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -19,936 +19,1175 @@ +-----------------------------------------------------------------------+ */ -if (!$OUTPUT->ajax_call) - $OUTPUT->set_pagetitle(rcube_label('preferences')); - +if (!$OUTPUT->ajax_call) { + $OUTPUT->set_pagetitle(rcube_label('preferences')); +} // similar function as /steps/settings/identities.inc::rcmail_identity_frame() function rcmail_preferences_frame($attrib) { - global $OUTPUT; + global $OUTPUT; - if (!$attrib['id']) - $attrib['id'] = 'rcmprefsframe'; + if (!$attrib['id']) { + $attrib['id'] = 'rcmprefsframe'; + } - return $OUTPUT->frame($attrib, true); + return $OUTPUT->frame($attrib, true); } function rcmail_sections_list($attrib) { - global $RCMAIL; + global $RCMAIL; - // add id to message list table if not specified - if (!strlen($attrib['id'])) - $attrib['id'] = 'rcmsectionslist'; + // add id to message list table if not specified + if (!strlen($attrib['id'])) { + $attrib['id'] = 'rcmsectionslist'; + } - list($list, $cols) = rcmail_user_prefs(); + list($list, $cols) = rcmail_user_prefs(); - // create XHTML table - $out = rcube_table_output($attrib, $list, $cols, 'id'); + // create XHTML table + $out = rcube_table_output($attrib, $list, $cols, 'id'); - // set client env - $RCMAIL->output->add_gui_object('sectionslist', $attrib['id']); - $RCMAIL->output->include_script('list.js'); + // set client env + $RCMAIL->output->add_gui_object('sectionslist', $attrib['id']); + $RCMAIL->output->include_script('list.js'); - return $out; + return $out; } function rcmail_identities_list($attrib) { - global $OUTPUT, $RCMAIL; + global $OUTPUT, $RCMAIL; - // add id to message list table if not specified - if (!strlen($attrib['id'])) - $attrib['id'] = 'rcmIdentitiesList'; + // add id to message list table if not specified + if (!strlen($attrib['id'])) { + $attrib['id'] = 'rcmIdentitiesList'; + } - // get identities list and define 'mail' column - $list = $RCMAIL->user->list_identities(); - foreach ($list as $idx => $row) - $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>'); + // get identities list and define 'mail' column + $list = $RCMAIL->user->list_identities(); + foreach ($list as $idx => $row) { + $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>'); + } - // get all identites from DB and define list of cols to be displayed - $plugin = $RCMAIL->plugins->exec_hook('identities_list', array( - 'list' => $list, - 'cols' => array('mail'))); + // get all identites from DB and define list of cols to be displayed + $plugin = $RCMAIL->plugins->exec_hook('identities_list', array( + 'list' => $list, + 'cols' => array('mail') + )); - // @TODO: use <UL> instead of <TABLE> for identities list - // create XHTML table - $out = rcube_table_output($attrib, $plugin['list'], $plugin['cols'], 'identity_id'); + // @TODO: use <UL> instead of <TABLE> for identities list + // create XHTML table + $out = rcube_table_output($attrib, $plugin['list'], $plugin['cols'], 'identity_id'); - // set client env - $OUTPUT->add_gui_object('identitieslist', $attrib['id']); + // set client env + $OUTPUT->add_gui_object('identitieslist', $attrib['id']); - return $out; + return $out; } // similar function as in /steps/addressbook/edit.inc function get_form_tags($attrib, $action, $id = null, $hidden = null) { - global $EDIT_FORM, $RCMAIL; - - $form_start = $form_end = ''; - - if (empty($EDIT_FORM)) { - $request_key = $action . (isset($id) ? '.'.$id : ''); - $form_start = $RCMAIL->output->request_form(array( - 'name' => 'form', - 'method' => 'post', - 'task' => $RCMAIL->task, - 'action' => $action, - 'request' => $request_key, - 'noclose' => true - ) + $attrib); - - if (is_array($hidden)) { - $hiddenfields = new html_hiddenfield($hidden); - $form_start .= $hiddenfields->show(); - } + global $EDIT_FORM, $RCMAIL; + + $form_start = $form_end = ''; + + if (empty($EDIT_FORM)) { + $request_key = $action . (isset($id) ? '.'.$id : ''); + $form_start = $RCMAIL->output->request_form(array( + 'name' => 'form', + 'method' => 'post', + 'task' => $RCMAIL->task, + 'action' => $action, + 'request' => $request_key, + 'noclose' => true + ) + $attrib); + + if (is_array($hidden)) { + $hiddenfields = new html_hiddenfield($hidden); + $form_start .= $hiddenfields->show(); + } - $form_end = !strlen($attrib['form']) ? '</form>' : ''; + $form_end = !strlen($attrib['form']) ? '</form>' : ''; - $EDIT_FORM = !empty($attrib['form']) ? $attrib['form'] : 'form'; - $RCMAIL->output->add_gui_object('editform', $EDIT_FORM); - } + $EDIT_FORM = !empty($attrib['form']) ? $attrib['form'] : 'form'; + $RCMAIL->output->add_gui_object('editform', $EDIT_FORM); + } - return array($form_start, $form_end); + return array($form_start, $form_end); } -function rcmail_user_prefs($current=null) +function rcmail_user_prefs($current = null) { - global $RCMAIL; - - $sections['general'] = array('id' => 'general', 'section' => rcube_label('uisettings')); - $sections['mailbox'] = array('id' => 'mailbox', 'section' => rcube_label('mailboxview')); - $sections['mailview'] = array('id' => 'mailview','section' => rcube_label('messagesdisplaying')); - $sections['compose'] = array('id' => 'compose', 'section' => rcube_label('messagescomposition')); - $sections['addressbook'] = array('id' => 'addressbook','section' => rcube_label('addressbook')); - $sections['folders'] = array('id' => 'folders', 'section' => rcube_label('specialfolders')); - $sections['server'] = array('id' => 'server', 'section' => rcube_label('serversettings')); - - // hook + define list cols - $plugin = $RCMAIL->plugins->exec_hook('preferences_sections_list', - array('list' => $sections, 'cols' => array('section'))); - - $sections = $plugin['list']; - - $config = $RCMAIL->config->all(); - $no_override = array_flip($RCMAIL->config->get('dont_override', array())); - - foreach ($sections as $idx => $sect) { - - if ($current && $sect['id'] != $current) - continue; - - $blocks = array(); - - switch ($sect['id']) { - // general - case 'general': - - $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'skin' => array('name' => Q(rcube_label('skin'))), - 'browser' => array('name' => Q(rcube_label('browseroptions'))), - ); + global $RCMAIL; - // language selection - if (!isset($no_override['language'])) { - $a_lang = $RCMAIL->list_languages(); - asort($a_lang); + $sections['general'] = array('id' => 'general', 'section' => rcube_label('uisettings')); + $sections['mailbox'] = array('id' => 'mailbox', 'section' => rcube_label('mailboxview')); + $sections['mailview'] = array('id' => 'mailview','section' => rcube_label('messagesdisplaying')); + $sections['compose'] = array('id' => 'compose', 'section' => rcube_label('messagescomposition')); + $sections['addressbook'] = array('id' => 'addressbook','section' => rcube_label('addressbook')); + $sections['folders'] = array('id' => 'folders', 'section' => rcube_label('specialfolders')); + $sections['server'] = array('id' => 'server', 'section' => rcube_label('serversettings')); - $field_id = 'rcmfd_lang'; - $select_lang = new html_select(array('name' => '_language', 'id' => $field_id)); - $select_lang->add(array_values($a_lang), array_keys($a_lang)); + // hook + define list cols + $plugin = $RCMAIL->plugins->exec_hook('preferences_sections_list', + array('list' => $sections, 'cols' => array('section'))); - $blocks['main']['options']['language'] = array( - 'title' => html::label($field_id, Q(rcube_label('language'))), - 'content' => $select_lang->show($RCMAIL->user->language), - ); - } + $sections = $plugin['list']; + $config = $RCMAIL->config->all(); + $no_override = array_flip((array)$RCMAIL->config->get('dont_override')); - // timezone selection - if (!isset($no_override['timezone'])) { - $field_id = 'rcmfd_timezone'; - $select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id)); - $select_timezone->add(rcube_label('autodetect'), 'auto'); - - $zones = array(); - foreach (DateTimeZone::listIdentifiers() as $i => $tzs) { - try { - $tz = new DateTimeZone($tzs); - $date = new DateTime('2012-12-21', $tz); - $offset = $date->format('Z') + 45000; - $sortkey = sprintf('%06d.%s', $offset, $tzs); - $zones[$sortkey] = array($tzs, $date->format('P')); + foreach ($sections as $idx => $sect) { + if ($current && $sect['id'] != $current) { + continue; } - catch (Exception $e) {} - } - - ksort($zones); - foreach ($zones as $zone) { - list($tzs, $offset) = $zone; - $select_timezone->add('(GMT ' . $offset . ') ' . strtr($tzs, '_', ' '), $tzs); - } - - $blocks['main']['options']['timezone'] = array( - 'title' => html::label($field_id, Q(rcube_label('timezone'))), - 'content' => $select_timezone->show((string)$config['timezone']), - ); - } - // date/time formatting - if (!isset($no_override['time_format'])) { - $reftime = mktime(7,30,0); - $field_id = 'rcmfd_time_format'; - $select_time = new html_select(array('name' => '_time_format', 'id' => $field_id)); - foreach ((array)$RCMAIL->config->get('time_formats', array('G:i', 'H:i', 'g:i a', 'h:i A')) as $choice) - $select_time->add(date($choice, $reftime), $choice); - - $blocks['main']['options']['time_format'] = array( - 'title' => html::label($field_id, Q(rcube_label('timeformat'))), - 'content' => $select_time->show($RCMAIL->config->get('time_format')), - ); - } + $blocks = array(); + + switch ($sect['id']) { + + // general + case 'general': + $blocks = array( + 'main' => array('name' => Q(rcube_label('mainoptions'))), + 'skin' => array('name' => Q(rcube_label('skin'))), + 'browser' => array('name' => Q(rcube_label('browseroptions'))), + ); + + // language selection + if (!isset($no_override['language'])) { + if (!$current) { + continue 2; + } + + $a_lang = $RCMAIL->list_languages(); + asort($a_lang); + + $field_id = 'rcmfd_lang'; + $select = new html_select(array('name' => '_language', 'id' => $field_id)); + $select->add(array_values($a_lang), array_keys($a_lang)); + + $blocks['main']['options']['language'] = array( + 'title' => html::label($field_id, Q(rcube_label('language'))), + 'content' => $select->show($RCMAIL->user->language), + ); + } + + // timezone selection + if (!isset($no_override['timezone'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_timezone'; + $select = new html_select(array('name' => '_timezone', 'id' => $field_id)); + $select->add(rcube_label('autodetect'), 'auto'); + + $zones = array(); + foreach (DateTimeZone::listIdentifiers() as $i => $tzs) { + try { + $tz = new DateTimeZone($tzs); + $date = new DateTime('2012-12-21', $tz); + $offset = $date->format('Z') + 45000; + $sortkey = sprintf('%06d.%s', $offset, $tzs); + $zones[$sortkey] = array($tzs, $date->format('P')); + } + catch (Exception $e) {} + } + + ksort($zones); + + foreach ($zones as $zone) { + list($tzs, $offset) = $zone; + $select->add('(GMT ' . $offset . ') ' . strtr($tzs, '_', ' '), $tzs); + } + + $blocks['main']['options']['timezone'] = array( + 'title' => html::label($field_id, Q(rcube_label('timezone'))), + 'content' => $select->show((string)$config['timezone']), + ); + } + + // date/time formatting + if (!isset($no_override['time_format'])) { + if (!$current) { + continue 2; + } + + $reftime = mktime(7,30,0); + $defaults = array('G:i', 'H:i', 'g:i a', 'h:i A'); + $formats = (array)$RCMAIL->config->get('time_formats', $defaults); + $field_id = 'rcmfd_time_format'; + $select = new html_select(array('name' => '_time_format', 'id' => $field_id)); + + foreach ($formats as $choice) { + $select->add(date($choice, $reftime), $choice); + } + + $blocks['main']['options']['time_format'] = array( + 'title' => html::label($field_id, Q(rcube_label('timeformat'))), + 'content' => $select->show($RCMAIL->config->get('time_format')), + ); + } + + if (!isset($no_override['date_format'])) { + if (!$current) { + continue 2; + } + + $refdate = mktime(12,30,0,7,24); + $defaults = array('Y-m-d','d-m-Y','Y/m/d','m/d/Y','d/m/Y','d.m.Y','j.n.Y'); + $formats = (array)$RCMAIL->config->get('date_formats', $defaults); + $field_id = 'rcmfd_date_format'; + $select = new html_select(array('name' => '_date_format', 'id' => $field_id)); + + foreach ($formats as $choice) { + $select->add(date($choice, $refdate), $choice); + } + + $blocks['main']['options']['date_format'] = array( + 'title' => html::label($field_id, Q(rcube_label('dateformat'))), + 'content' => $select->show($config['date_format']), + ); + } + + // Show checkbox for toggling 'pretty dates' + if (!isset($no_override['prettydate'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_prettydate'; + $input = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['prettydate'] = array( + 'title' => html::label($field_id, Q(rcube_label('prettydate'))), + 'content' => $input->show($config['prettydate']?1:0), + ); + } + + if (!isset($no_override['refresh_interval'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_refresh_interval'; + $select = new html_select(array('name' => '_refresh_interval', 'id' => $field_id)); + + $select->add(rcube_label('never'), 0); + foreach (array(1, 3, 5, 10, 15, 30, 60) as $min) { + if (!$config['min_refresh_interval'] || $config['min_refresh_interval'] <= $min * 60) { + $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))); + $select->add($label, $min); + } + } + + $blocks['main']['options']['refresh_interval'] = array( + 'title' => html::label($field_id, Q(rcube_label('refreshinterval'))), + 'content' => $select->show($config['refresh_interval']/60), + ); + } + + // show drop-down for available skins + if (!isset($no_override['skin'])) { + if (!$current) { + continue 2; + } + + $skins = rcmail_get_skins(); + + if (count($skins) > 1) { + $field_id = 'rcmfd_skin'; + $input = new html_radiobutton(array('name'=>'_skin')); + + foreach ($skins as $skin) { + $thumbnail = "./skins/$skin/thumbnail.png"; + if (!is_file($thumbnail)) + $thumbnail = './program/resources/blank.gif'; + + $skinname = ucfirst($skin); + $author_link = $license_link = ''; + $meta = @json_decode(@file_get_contents("./skins/$skin/meta.json"), true); + + if (is_array($meta) && $meta['name']) { + $skinname = $meta['name']; + $author_link = $meta['url'] ? html::a(array('href' => $meta['url'], 'target' => '_blank'), Q($meta['author'])) : Q($meta['author']); + $license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank'), Q($meta['license'])) : Q($meta['license']); + } + + $blocks['skin']['options'][$skin]['content'] = html::label(array('class' => 'skinselection'), + html::span('skinitem', $input->show($config['skin'], array('value' => $skin, 'id' => $field_id.$skin))) . + html::span('skinitem', html::img(array('src' => $thumbnail, 'class' => 'skinthumbnail', 'alt' => $skin, 'width' => 64, 'height' => 64))) . + html::span('skinitem', html::span('skinname', Q($skinname)) . html::br() . + html::span('skinauthor', $author_link ? 'by ' . $author_link : '') . html::br() . + html::span('skinlicense', $license_link ? rcube_label('license').': ' . $license_link : '')) + ); + } + } + } + + // standard_windows option decides if new windows should be + // opened as popups or standard windows (which can be handled by browsers as tabs) + if (!isset($no_override['standard_windows'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_standard_windows'; + $checkbox = new html_checkbox(array('name' => '_standard_windows', 'id' => $field_id, 'value' => 1)); + + $blocks['browser']['options']['standard_windows'] = array( + 'title' => html::label($field_id, Q(rcube_label('standardwindows'))), + 'content' => $checkbox->show($config['standard_windows']?1:0), + ); + } + + if ($current) { + $product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail'); + $RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');", + JS_OBJECT_NAME, JQ($product_name)), 'foot'); + } + + $blocks['browser']['options']['mailtoprotohandler'] = array( + 'content' => html::a(array( + 'href' => '#', + 'id' => 'mailtoprotohandler'), Q(rcube_label('mailtoprotohandler'))), + ); - if (!isset($no_override['date_format'])) { - $refdate = mktime(12,30,0,7,24); - $field_id = 'rcmfd_date_format'; - $select_date = new html_select(array('name' => '_date_format', 'id' => $field_id)); - foreach ((array)$RCMAIL->config->get('date_formats', array('Y-m-d','d-m-Y','Y/m/d','m/d/Y','d/m/Y','d.m.Y','j.n.Y')) as $choice) - $select_date->add(date($choice, $refdate), $choice); - - $blocks['main']['options']['date_format'] = array( - 'title' => html::label($field_id, Q(rcube_label('dateformat'))), - 'content' => $select_date->show($config['date_format']), - ); - } + break; - // MM: Show checkbox for toggling 'pretty dates' - if (!isset($no_override['prettydate'])) { - $field_id = 'rcmfd_prettydate'; - $input_prettydate = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); + // Mailbox view (mail screen) + case 'mailbox': + $blocks = array( + 'main' => array('name' => Q(rcube_label('mainoptions'))), + 'new_message' => array('name' => Q(rcube_label('newmessage'))), + ); + + // show config parameter for preview pane + if (!isset($no_override['preview_pane'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_preview'; + $input = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1, + 'onchange' => "$('#rcmfd_preview_pane_mark_read').prop('disabled', !this.checked)")); + + $blocks['main']['options']['preview_pane'] = array( + 'title' => html::label($field_id, Q(rcube_label('previewpane'))), + 'content' => $input->show($config['preview_pane']?1:0), + ); + } + + // show config parameter for preview pane auto mark as read delay + if (!isset($no_override['preview_pane_mark_read'])) { + if (!$current) { + continue 2; + } + + // apply default if config option is not set at all + $config['preview_pane_mark_read'] = $RCMAIL->config->get('preview_pane_mark_read', 0); + + $field_id = 'rcmfd_preview_pane_mark_read'; + $select = new html_select(array('name' => '_preview_pane_mark_read', 'id' => $field_id, + 'disabled' => $config['preview_pane']?0:1)); + + $select->add(rcube_label('never'), '-1'); + $select->add(rcube_label('immediately'), 0); + + foreach (array(5, 10, 20, 30) as $sec) { + $label = rcube_label(array('name' => 'afternseconds', 'vars' => array('n' => $sec))); + $select->add($label, $sec); + } + + $blocks['main']['options']['preview_pane_mark_read'] = array( + 'title' => html::label($field_id, Q(rcube_label('previewpanemarkread'))), + 'content' => $select->show(intval($config['preview_pane_mark_read'])), + ); + } + + if (!isset($no_override['mdn_requests'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_mdn_requests'; + $select = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); + $select->add(rcube_label('askuser'), 0); + $select->add(rcube_label('autosend'), 1); + $select->add(rcube_label('autosendknown'), 3); + $select->add(rcube_label('autosendknownignore'), 4); + $select->add(rcube_label('ignore'), 2); + + $blocks['main']['options']['mdn_requests'] = array( + 'title' => html::label($field_id, Q(rcube_label('mdnrequests'))), + 'content' => $select->show($config['mdn_requests']), + ); + } + + if (!isset($no_override['autoexpand_threads'])) { + if (!$current) { + continue 2; + } + + $storage = $RCMAIL->get_storage(); + $supported = $storage->get_capability('THREAD'); + + if ($supported) { + $field_id = 'rcmfd_autoexpand_threads'; + $select = new html_select(array('name' => '_autoexpand_threads', 'id' => $field_id)); + $select->add(rcube_label('never'), 0); + $select->add(rcube_label('do_expand'), 1); + $select->add(rcube_label('expand_only_unread'), 2); + + $blocks['main']['options']['autoexpand_threads'] = array( + 'title' => html::label($field_id, Q(rcube_label('autoexpand_threads'))), + 'content' => $select->show($config['autoexpand_threads']), + ); + } + } + + // show page size selection + if (!isset($no_override['mail_pagesize'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_mail_pagesize'; + $input = new html_inputfield(array('name' => '_mail_pagesize', 'id' => $field_id, 'size' => 5)); + $size = intval($config['mail_pagesize'] ? $config['mail_pagesize'] : $config['pagesize']); + + $blocks['main']['options']['pagesize'] = array( + 'title' => html::label($field_id, Q(rcube_label('pagesize'))), + 'content' => $input->show($size ? $size : 50), + ); + } + + if (!isset($no_override['check_all_folders'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_check_all_folders'; + $input = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1)); + + $blocks['new_message']['options']['check_all_folders'] = array( + 'title' => html::label($field_id, Q(rcube_label('checkallfolders'))), + 'content' => $input->show($config['check_all_folders']?1:0), + ); + } + break; - $blocks['main']['options']['prettydate'] = array( - 'title' => html::label($field_id, Q(rcube_label('prettydate'))), - 'content' => $input_prettydate->show($config['prettydate']?1:0), - ); - } + // Message viewing + case 'mailview': + $blocks = array( + 'main' => array('name' => Q(rcube_label('mainoptions'))), + ); + + // show checkbox to open message view in new window + if (!isset($no_override['message_extwin'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_message_extwin'; + $input = new html_checkbox(array('name' => '_message_extwin', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['message_extwin'] = array( + 'title' => html::label($field_id, Q(rcube_label('showinextwin'))), + 'content' => $input->show($config['message_extwin']?1:0), + ); + } + + // show checkbox to show email instead of name + if (!isset($no_override['message_show_email'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_message_show_email'; + $input = new html_checkbox(array('name' => '_message_show_email', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['message_show_email'] = array( + 'title' => html::label($field_id, Q(rcube_label('showemail'))), + 'content' => $input->show($config['message_show_email']?1:0), + ); + } + + // show checkbox for HTML/plaintext messages + if (!isset($no_override['prefer_html'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_htmlmsg'; + $input = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1, + 'onchange' => "$('#rcmfd_show_images').prop('disabled', !this.checked).val(0)")); + + $blocks['main']['options']['prefer_html'] = array( + 'title' => html::label($field_id, Q(rcube_label('preferhtml'))), + 'content' => $input->show($config['prefer_html']?1:0), + ); + } + + if (!isset($no_override['default_charset'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_default_charset'; + + $blocks['main']['options']['default_charset'] = array( + 'title' => html::label($field_id, Q(rcube_label('defaultcharset'))), + 'content' => $RCMAIL->output->charset_selector(array( + 'name' => '_default_charset', 'selected' => $config['default_charset'] + ))); + } + + if (!isset($no_override['show_images'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_show_images'; + $input = new html_select(array('name' => '_show_images', 'id' => $field_id, + 'disabled' => !$config['prefer_html'])); + + $input->add(rcube_label('never'), 0); + $input->add(rcube_label('fromknownsenders'), 1); + $input->add(rcube_label('always'), 2); + + $blocks['main']['options']['show_images'] = array( + 'title' => html::label($field_id, Q(rcube_label('showremoteimages'))), + 'content' => $input->show($config['prefer_html'] ? $config['show_images'] : 0), + ); + } + + if (!isset($no_override['inline_images'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_inline_images'; + $input = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['inline_images'] = array( + 'title' => html::label($field_id, Q(rcube_label('showinlineimages'))), + 'content' => $input->show($config['inline_images']?1:0), + ); + } + + // "display after delete" checkbox + if (!isset($no_override['display_next'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_displaynext'; + $input = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['display_next'] = array( + 'title' => html::label($field_id, Q(rcube_label('displaynext'))), + 'content' => $input->show($config['display_next']?1:0), + ); + } + break; - if (!isset($no_override['refresh_interval'])) { - $field_id = 'rcmfd_refresh_interval'; - $select_refresh_interval = new html_select(array('name' => '_refresh_interval', 'id' => $field_id)); + // Mail composition + case 'compose': + $blocks = array( + 'main' => array('name' => Q(rcube_label('mainoptions'))), + 'sig' => array('name' => Q(rcube_label('signatureoptions'))), + 'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))), + ); + + // show checkbox to compose messages in a new window + if (!isset($no_override['compose_extwin'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfdcompose_extwin'; + $input = new html_checkbox(array('name' => '_compose_extwin', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['compose_extwin'] = array( + 'title' => html::label($field_id, Q(rcube_label('composeextwin'))), + 'content' => $input->show($config['compose_extwin']?1:0), + ); + } + + if (!isset($no_override['htmleditor'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_htmleditor'; + $select = new html_select(array('name' => '_htmleditor', 'id' => $field_id)); + + $select->add(rcube_label('never'), 0); + $select->add(rcube_label('always'), 1); + $select->add(rcube_label('htmlonreply'), 2); + $select->add(rcube_label('htmlonreplyandforward'), 3); + + $blocks['main']['options']['htmleditor'] = array( + 'title' => html::label($field_id, Q(rcube_label('htmleditor'))), + 'content' => $select->show(intval($config['htmleditor'])), + ); + } + + if (!isset($no_override['draft_autosave'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_autosave'; + $select = new html_select(array('name' => '_draft_autosave', 'id' => $field_id, 'disabled' => empty($config['drafts_mbox']))); + + $select->add(rcube_label('never'), 0); + foreach (array(1, 3, 5, 10) as $i => $min) { + $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))); + $select->add($label, $min*60); + } + + $blocks['main']['options']['draft_autosave'] = array( + 'title' => html::label($field_id, Q(rcube_label('autosavedraft'))), + 'content' => $select->show($config['draft_autosave']), + ); + } + + if (!isset($no_override['mime_param_folding'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_param_folding'; + $select = new html_select(array('name' => '_mime_param_folding', 'id' => $field_id)); + + $select->add(rcube_label('2231folding'), 0); + $select->add(rcube_label('miscfolding'), 1); + $select->add(rcube_label('2047folding'), 2); + + $blocks['main']['options']['mime_param_folding'] = array( + 'advanced' => true, + 'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))), + 'content' => $select->show($config['mime_param_folding']), + ); + } + + if (!isset($no_override['force_7bit'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_force_7bit'; + $input = new html_checkbox(array('name' => '_force_7bit', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['force_7bit'] = array( + 'advanced' => true, + 'title' => html::label($field_id, Q(rcube_label('force7bit'))), + 'content' => $input->show($config['force_7bit']?1:0), + ); + } + + if (!isset($no_override['mdn_default'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_mdn_default'; + $input = new html_checkbox(array('name' => '_mdn_default', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['mdn_default'] = array( + 'title' => html::label($field_id, Q(rcube_label('reqmdn'))), + 'content' => $input->show($config['mdn_default']?1:0), + ); + } + + if (!isset($no_override['dsn_default'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_dsn_default'; + $input = new html_checkbox(array('name' => '_dsn_default', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['dsn_default'] = array( + 'title' => html::label($field_id, Q(rcube_label('reqdsn'))), + 'content' => $input->show($config['dsn_default']?1:0), + ); + } + + if (!isset($no_override['reply_same_folder'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_reply_same_folder'; + $input = new html_checkbox(array('name' => '_reply_same_folder', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['reply_same_folder'] = array( + 'title' => html::label($field_id, Q(rcube_label('replysamefolder'))), + 'content' => $input->show($config['reply_same_folder']?1:0), + ); + } + + if (!isset($no_override['reply_mode'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_reply_mode'; + $select = new html_select(array('name' => '_reply_mode', 'id' => $field_id)); + + $select->add(rcube_label('replyempty'), -1); + $select->add(rcube_label('replybottomposting'), 0); + $select->add(rcube_label('replytopposting'), 1); + + $blocks['main']['options']['reply_mode'] = array( + 'title' => html::label($field_id, Q(rcube_label('whenreplying'))), + 'content' => $select->show(intval($config['reply_mode'])), + ); + } + + if (!isset($no_override['spellcheck_before_send']) && $config['enable_spellcheck']) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_spellcheck_before_send'; + $input = new html_checkbox(array('name' => '_spellcheck_before_send', 'id' => $field_id, 'value' => 1)); + + $blocks['spellcheck']['options']['spellcheck_before_send'] = array( + 'title' => html::label($field_id, Q(rcube_label('spellcheckbeforesend'))), + 'content' => $input->show($config['spellcheck_before_send']?1:0), + ); + } + + if ($config['enable_spellcheck']) { + if (!$current) { + continue 2; + } + + foreach (array('syms', 'nums', 'caps') as $key) { + $key = 'spellcheck_ignore_'.$key; + if (!isset($no_override[$key])) { + $input = new html_checkbox(array('name' => '_'.$key, 'id' => 'rcmfd_'.$key, 'value' => 1)); + + $blocks['spellcheck']['options'][$key] = array( + 'title' => html::label($field_id, Q(rcube_label(str_replace('_', '', $key)))), + 'content' => $input->show($config[$key]?1:0), + ); + } + } + } + + if (!isset($no_override['show_sig'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_show_sig'; + $select = new html_select(array('name' => '_show_sig', 'id' => $field_id)); + + $select->add(rcube_label('never'), 0); + $select->add(rcube_label('always'), 1); + $select->add(rcube_label('newmessageonly'), 2); + $select->add(rcube_label('replyandforwardonly'), 3); + + $blocks['sig']['options']['show_sig'] = array( + 'title' => html::label($field_id, Q(rcube_label('autoaddsignature'))), + 'content' => $select->show($RCMAIL->config->get('show_sig', 1)), + ); + } + + if (!isset($no_override['strip_existing_sig'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_strip_existing_sig'; + $input = new html_checkbox(array('name' => '_strip_existing_sig', 'id' => $field_id, 'value' => 1)); + + $blocks['sig']['options']['strip_existing_sig'] = array( + 'title' => html::label($field_id, Q(rcube_label('replyremovesignature'))), + 'content' => $input->show($config['strip_existing_sig']?1:0), + ); + } + + if (!isset($no_override['forward_attachment'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_forward_attachment'; + $select = new html_select(array('name' => '_forward_attachment', 'id' => $field_id)); + + $select->add(rcube_label('inline'), 0); + $select->add(rcube_label('asattachment'), 1); + + $blocks['main']['options']['forward_attachment'] = array( + 'title' => html::label($field_id, Q(rcube_label('forwardmode'))), + 'content' => $select->show(intval($config['forward_attachment'])), + ); + } + + if (!isset($no_override['default_font'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_default_font'; + $fonts = rcube_fontdefs(); + $selected = $config['default_font']; + + $select = '<select name="_default_font" id="'.$field_id.'">'; + $select .= '<option value=""' . (!$selected ? ' selected="selected"' : '') . '>---</option>'; + foreach ($fonts as $fname => $font) { + $select .= '<option value="'.$fname.'"' + . ($fname == $selected ? ' selected="selected"' : '') + . ' style=\'font-family: ' . $font . '\'>' + . Q($fname) . '</option>'; + } + $select .= '</select>'; + + $blocks['main']['options']['default_font'] = array( + 'title' => html::label($field_id, Q(rcube_label('defaultfont'))), + 'content' => $select + ); + } + break; - $select_refresh_interval->add(rcube_label('never'), 0); - foreach (array(1, 3, 5, 10, 15, 30, 60) as $min) { - if (!$config['min_refresh_interval'] || $config['min_refresh_interval'] <= $min * 60) { - $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))); - $select_refresh_interval->add($label, $min); - } - } + // Addressbook config + case 'addressbook': + $blocks = array( + 'main' => array('name' => Q(rcube_label('mainoptions'))), + ); + + if (!isset($no_override['default_addressbook']) + && (!$current || ($books = $RCMAIL->get_address_sources(true, true))) + ) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_default_addressbook'; + $select = new html_select(array('name' => '_default_addressbook', 'id' => $field_id)); + + foreach ($books as $book) { + $select->add(html_entity_decode($book['name'], ENT_COMPAT, 'UTF-8'), $book['id']); + } + + $blocks['main']['options']['default_addressbook'] = array( + 'title' => html::label($field_id, Q(rcube_label('defaultabook'))), + 'content' => $select->show($config['default_addressbook']), + ); + } + + // show addressbook listing mode selection + if (!isset($no_override['addressbook_name_listing'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_addressbook_name_listing'; + $select = new html_select(array('name' => '_addressbook_name_listing', 'id' => $field_id)); + + $select->add(rcube_label('name'), 0); + $select->add(rcube_label('firstname') . ' ' . rcube_label('surname'), 1); + $select->add(rcube_label('surname') . ' ' . rcube_label('firstname'), 2); + $select->add(rcube_label('surname') . ', ' . rcube_label('firstname'), 3); + + $blocks['main']['options']['list_name_listing'] = array( + 'title' => html::label($field_id, Q(rcube_label('listnamedisplay'))), + 'content' => $select->show($config['addressbook_name_listing']), + ); + } + + // show addressbook sort column + if (!isset($no_override['addressbook_sort_col'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_addressbook_sort_col'; + $select = new html_select(array('name' => '_addressbook_sort_col', 'id' => $field_id)); + + $select->add(rcube_label('name'), 'name'); + $select->add(rcube_label('firstname'), 'firstname'); + $select->add(rcube_label('surname'), 'surname'); + + $blocks['main']['options']['sort_col'] = array( + 'title' => html::label($field_id, Q(rcube_label('listsorting'))), + 'content' => $select->show($config['addressbook_sort_col']), + ); + } + + // show addressbook page size selection + if (!isset($no_override['addressbook_pagesize'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_addressbook_pagesize'; + $input = new html_inputfield(array('name' => '_addressbook_pagesize', 'id' => $field_id, 'size' => 5)); + $size = intval($config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize']); + + $blocks['main']['options']['pagesize'] = array( + 'title' => html::label($field_id, Q(rcube_label('pagesize'))), + 'content' => $input->show($size ? $size : 50), + ); + } + + if (!isset($no_override['autocomplete_single'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_autocomplete_single'; + $checkbox = new html_checkbox(array('name' => '_autocomplete_single', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['autocomplete_single'] = array( + 'title' => html::label($field_id, Q(rcube_label('autocompletesingle'))), + 'content' => $checkbox->show($config['autocomplete_single']?1:0), + ); + } + break; - $blocks['main']['options']['refresh_interval'] = array( - 'title' => html::label($field_id, Q(rcube_label('refreshinterval'))), - 'content' => $select_refresh_interval->show($config['refresh_interval']/60), - ); - } + // Special IMAP folders + case 'folders': + $blocks = array( + 'main' => array('name' => Q(rcube_label('mainoptions'))), + ); + + if (!isset($no_override['show_real_foldernames'])) { + if (!$current) { + continue 2; + } + + $field_id = 'show_real_foldernames'; + $input = new html_checkbox(array('name' => '_show_real_foldernames', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['show_real_foldernames'] = array( + 'title' => html::label($field_id, Q(rcube_label('show_real_foldernames'))), + 'content' => $input->show($config['show_real_foldernames']?1:0), + ); + } + + // Configure special folders + if (!isset($no_override['default_folders']) && $current) { + $select = rcmail_mailbox_select(array( + 'noselection' => '---', + 'realnames' => true, + 'maxlength' => 30, + 'folder_filter' => 'mail', + 'folder_rights' => 'w', + // #1486114, #1488279 + 'onchange' => "if ($(this).val() == 'INBOX') $(this).val('')", + )); + } + + if (!isset($no_override['drafts_mbox'])) { + if (!$current) { + continue 2; + } + + $blocks['main']['options']['drafts_mbox'] = array( + 'title' => Q(rcube_label('drafts')), + 'content' => $select->show($config['drafts_mbox'], array('name' => "_drafts_mbox")), + ); + } + + if (!isset($no_override['sent_mbox'])) { + if (!$current) { + continue 2; + } + + $blocks['main']['options']['sent_mbox'] = array( + 'title' => Q(rcube_label('sent')), + 'content' => $select->show($config['sent_mbox'], array('name' => "_sent_mbox")), + ); + } + + if (!isset($no_override['junk_mbox'])) { + if (!$current) { + continue 2; + } + + $blocks['main']['options']['junk_mbox'] = array( + 'title' => Q(rcube_label('junk')), + 'content' => $select->show($config['junk_mbox'], array('name' => "_junk_mbox")), + ); + } + + if (!isset($no_override['trash_mbox'])) { + if (!$current) { + continue 2; + } + + $blocks['main']['options']['trash_mbox'] = array( + 'title' => Q(rcube_label('trash')), + 'content' => $select->show($config['trash_mbox'], array('name' => "_trash_mbox")), + ); + } + break; - // show drop-down for available skins - if (!isset($no_override['skin'])) { - $skins = rcmail_get_skins(); - - if (count($skins) > 1) { - $field_id = 'rcmfd_skin'; - $input_skin = new html_radiobutton(array('name'=>'_skin')); - - foreach($skins as $skin) { - $thumbnail = "./skins/$skin/thumbnail.png"; - if (!is_file($thumbnail)) - $thumbnail = './program/resources/blank.gif'; - - $skinname = ucfirst($skin); - $author_link = $license_link = ''; - $meta = @json_decode(@file_get_contents("./skins/$skin/meta.json"), true); - if (is_array($meta) && $meta['name']) { - $skinname = $meta['name']; - $author_link = $meta['url'] ? html::a(array('href' => $meta['url'], 'target' => '_blank'), Q($meta['author'])) : Q($meta['author']); - $license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank'), Q($meta['license'])) : Q($meta['license']); - } - - $blocks['skin']['options'][$skin]['content'] = html::label(array('class' => 'skinselection'), - html::span('skinitem', $input_skin->show($config['skin'], array('value' => $skin, 'id' => $field_id.$skin))) . - html::span('skinitem', html::img(array('src' => $thumbnail, 'class' => 'skinthumbnail', 'alt' => $skin, 'width' => 64, 'height' => 64))) . - html::span('skinitem', html::span('skinname', Q($skinname)) . html::br() . - html::span('skinauthor', $author_link ? 'by ' . $author_link : '') . html::br() . - html::span('skinlicense', $license_link ? rcube_label('license').': ' . $license_link : '')) - ); + // Server settings + case 'server': + $blocks = array( + 'main' => array('name' => Q(rcube_label('mainoptions'))), + 'maintenance' => array('name' => Q(rcube_label('maintenance'))), + ); + + if (!isset($no_override['read_when_deleted'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_read_deleted'; + $input = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['read_when_deleted'] = array( + 'title' => html::label($field_id, Q(rcube_label('readwhendeleted'))), + 'content' => $input->show($config['read_when_deleted']?1:0), + ); + } + + if (!isset($no_override['flag_for_deletion'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_flag_for_deletion'; + $input = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['flag_for_deletion'] = array( + 'title' => html::label($field_id, Q(rcube_label('flagfordeletion'))), + 'content' => $input->show($config['flag_for_deletion']?1:0), + ); + } + + // don't show deleted messages + if (!isset($no_override['skip_deleted'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_skip_deleted'; + $input = new html_checkbox(array('name' => '_skip_deleted', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['skip_deleted'] = array( + 'title' => html::label($field_id, Q(rcube_label('skipdeleted'))), + 'content' => $input->show($config['skip_deleted']?1:0), + ); + } + + if (!isset($no_override['delete_always'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_delete_always'; + $input = new html_checkbox(array('name' => '_delete_always', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['delete_always'] = array( + 'title' => html::label($field_id, Q(rcube_label('deletealways'))), + 'content' => $input->show($config['delete_always']?1:0), + ); + } + + if (!isset($no_override['delete_junk'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_delete_junk'; + $input = new html_checkbox(array('name' => '_delete_junk', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['delete_junk'] = array( + 'title' => html::label($field_id, Q(rcube_label('deletejunk'))), + 'content' => $input->show($config['delete_junk']?1:0), + ); + } + + // Trash purging on logout + if (!isset($no_override['logout_purge'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_logout_purge'; + $input = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); + + $blocks['maintenance']['options']['logout_purge'] = array( + 'title' => html::label($field_id, Q(rcube_label('logoutclear'))), + 'content' => $input->show($config['logout_purge']?1:0), + ); + } + + // INBOX compacting on logout + if (!isset($no_override['logout_expunge'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_logout_expunge'; + $input = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); + + $blocks['maintenance']['options']['logout_expunge'] = array( + 'title' => html::label($field_id, Q(rcube_label('logoutcompact'))), + 'content' => $input->show($config['logout_expunge']?1:0), + ); + } } - } - } - - // standard_windows option decides if new windows should be - // opened as popups or standard windows (which can be handled by browsers as tabs) - if (!isset($no_override['standard_windows'])) { - $field_id = 'rcmfd_standard_windows'; - $checkbox = new html_checkbox(array('name' => '_standard_windows', 'id' => $field_id, 'value' => 1)); - - $blocks['browser']['options']['standard_windows'] = array( - 'title' => html::label($field_id, Q(rcube_label('standardwindows'))), - 'content' => $checkbox->show($config['standard_windows']?1:0), - ); - } - - - $product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail'); - $RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');", - JS_OBJECT_NAME, JQ($product_name)), 'foot'); - - $blocks['browser']['options']['mailtoprotohandler'] = array( - 'content' => html::a(array( - 'href' => '#', - 'id' => 'mailtoprotohandler'), Q(rcube_label('mailtoprotohandler'))), - ); - - break; - - // Mailbox view (mail screen) - case 'mailbox': - - $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'new_message' => array('name' => Q(rcube_label('newmessage'))), - ); - - // show config parameter for preview pane - if (!isset($no_override['preview_pane'])) { - $field_id = 'rcmfd_preview'; - $input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1, - 'onchange' => "$('#rcmfd_preview_pane_mark_read').prop('disabled', !this.checked)")); - - $blocks['main']['options']['preview_pane'] = array( - 'title' => html::label($field_id, Q(rcube_label('previewpane'))), - 'content' => $input_preview->show($config['preview_pane']?1:0), - ); - } - - // show config parameter for preview pane auto mark as read delay - if (!isset($no_override['preview_pane_mark_read'])) { - // apply default if config option is not set at all - $config['preview_pane_mark_read'] = $RCMAIL->config->get('preview_pane_mark_read', 0); - - $field_id = 'rcmfd_preview_pane_mark_read'; - $select_delay = new html_select(array('name' => '_preview_pane_mark_read', 'id' => $field_id, - 'disabled' => $config['preview_pane']?0:1)); - - $select_delay->add(rcube_label('never'), '-1'); - $select_delay->add(rcube_label('immediately'), 0); - foreach(array(5, 10, 20, 30) as $sec) - $select_delay->add(rcube_label(array('name' => 'afternseconds', 'vars' => array('n' => $sec))), $sec); - - $blocks['main']['options']['preview_pane_mark_read'] = array( - 'title' => html::label($field_id, Q(rcube_label('previewpanemarkread'))), - 'content' => $select_delay->show(intval($config['preview_pane_mark_read'])), - ); - } - - if (!isset($no_override['mdn_requests'])) { - $field_id = 'rcmfd_mdn_requests'; - $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); - $select_mdn_requests->add(rcube_label('askuser'), 0); - $select_mdn_requests->add(rcube_label('autosend'), 1); - $select_mdn_requests->add(rcube_label('autosendknown'), 3); - $select_mdn_requests->add(rcube_label('autosendknownignore'), 4); - $select_mdn_requests->add(rcube_label('ignore'), 2); - - $blocks['main']['options']['mdn_requests'] = array( - 'title' => html::label($field_id, Q(rcube_label('mdnrequests'))), - 'content' => $select_mdn_requests->show($config['mdn_requests']), - ); - } - - $storage = $RCMAIL->get_storage(); - $threading_supported = $storage->get_capability('THREAD'); - - if (!isset($no_override['autoexpand_threads']) && $threading_supported) { - $field_id = 'rcmfd_autoexpand_threads'; - $select_autoexpand_threads = new html_select(array('name' => '_autoexpand_threads', 'id' => $field_id)); - $select_autoexpand_threads->add(rcube_label('never'), 0); - $select_autoexpand_threads->add(rcube_label('do_expand'), 1); - $select_autoexpand_threads->add(rcube_label('expand_only_unread'), 2); - - $blocks['main']['options']['autoexpand_threads'] = array( - 'title' => html::label($field_id, Q(rcube_label('autoexpand_threads'))), - 'content' => $select_autoexpand_threads->show($config['autoexpand_threads']), - ); - } - - // show page size selection - if (!isset($no_override['mail_pagesize'])) { - $field_id = 'rcmfd_mail_pagesize'; - $input_pagesize = new html_inputfield(array('name' => '_mail_pagesize', 'id' => $field_id, 'size' => 5)); - - $size = intval($config['mail_pagesize'] ? $config['mail_pagesize'] : $config['pagesize']); - - $blocks['main']['options']['pagesize'] = array( - 'title' => html::label($field_id, Q(rcube_label('pagesize'))), - 'content' => $input_pagesize->show($size ? $size : 50), - ); - } - if (!isset($no_override['check_all_folders'])) { - $field_id = 'rcmfd_check_all_folders'; - $input_check_all = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1)); - - $blocks['new_message']['options']['check_all_folders'] = array( - 'title' => html::label($field_id, Q(rcube_label('checkallfolders'))), - 'content' => $input_check_all->show($config['check_all_folders']?1:0), - ); - } - - break; - - // Message viewing - case 'mailview': - - $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - ); - - // show checkbox to open message view in new window - if (!isset($no_override['message_extwin'])) { - $field_id = 'rcmfd_message_extwin'; - $input_msgextwin = new html_checkbox(array('name' => '_message_extwin', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['message_extwin'] = array( - 'title' => html::label($field_id, Q(rcube_label('showinextwin'))), - 'content' => $input_msgextwin->show($config['message_extwin']?1:0), - ); - } - - // show checkbox to show email instead of name - if (!isset($no_override['message_show_email'])) { - $field_id = 'rcmfd_message_show_email'; - $input_msgshowemail = new html_checkbox(array('name' => '_message_show_email', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['message_show_email'] = array( - 'title' => html::label($field_id, Q(rcube_label('showemail'))), - 'content' => $input_msgshowemail->show($config['message_show_email']?1:0), - ); - } - - // show checkbox for HTML/plaintext messages - if (!isset($no_override['prefer_html'])) { - $field_id = 'rcmfd_htmlmsg'; - $input_preferhtml = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1, - 'onchange' => "$('#rcmfd_show_images').prop('disabled', !this.checked).val(0)")); - - $blocks['main']['options']['prefer_html'] = array( - 'title' => html::label($field_id, Q(rcube_label('preferhtml'))), - 'content' => $input_preferhtml->show($config['prefer_html']?1:0), - ); - } - - if (!isset($no_override['default_charset'])) { - $field_id = 'rcmfd_default_charset'; - - $blocks['main']['options']['default_charset'] = array( - 'title' => html::label($field_id, Q(rcube_label('defaultcharset'))), - 'content' => $RCMAIL->output->charset_selector(array( - 'name' => '_default_charset', 'selected' => $config['default_charset'] - )) - ); - } - - if (!isset($no_override['show_images'])) { - $field_id = 'rcmfd_show_images'; - $input_show_images = new html_select(array('name' => '_show_images', 'id' => $field_id, - 'disabled' => !$config['prefer_html'])); - $input_show_images->add(rcube_label('never'), 0); - $input_show_images->add(rcube_label('fromknownsenders'), 1); - $input_show_images->add(rcube_label('always'), 2); - - $blocks['main']['options']['show_images'] = array( - 'title' => html::label($field_id, Q(rcube_label('showremoteimages'))), - 'content' => $input_show_images->show($config['prefer_html'] ? $config['show_images'] : 0), - ); - } - - if (!isset($no_override['inline_images'])) { - $field_id = 'rcmfd_inline_images'; - $input_inline_images = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['inline_images'] = array( - 'title' => html::label($field_id, Q(rcube_label('showinlineimages'))), - 'content' => $input_inline_images->show($config['inline_images']?1:0), - ); - } - - // "display after delete" checkbox - if (!isset($no_override['display_next'])) { - $field_id = 'rcmfd_displaynext'; - $input_displaynext = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['display_next'] = array( - 'title' => html::label($field_id, Q(rcube_label('displaynext'))), - 'content' => $input_displaynext->show($config['display_next']?1:0), - ); - } - - break; - - // Mail composition - case 'compose': - - $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'sig' => array('name' => Q(rcube_label('signatureoptions'))), - 'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))), - ); - - // show checkbox to compose messages in a new window - if (!isset($no_override['compose_extwin'])) { - $field_id = 'rcmfdcompose_extwin'; - $input_compextwin = new html_checkbox(array('name' => '_compose_extwin', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['compose_extwin'] = array( - 'title' => html::label($field_id, Q(rcube_label('composeextwin'))), - 'content' => $input_compextwin->show($config['compose_extwin']?1:0), - ); - } - - if (!isset($no_override['htmleditor'])) { - $field_id = 'rcmfd_htmleditor'; - $select_htmleditor = new html_select(array('name' => '_htmleditor', 'id' => $field_id)); - $select_htmleditor->add(rcube_label('never'), 0); - $select_htmleditor->add(rcube_label('always'), 1); - $select_htmleditor->add(rcube_label('htmlonreply'), 2); - $select_htmleditor->add(rcube_label('htmlonreplyandforward'), 3); - - $blocks['main']['options']['htmleditor'] = array( - 'title' => html::label($field_id, Q(rcube_label('htmleditor'))), - 'content' => $select_htmleditor->show(intval($config['htmleditor'])), - ); - } - - if (!isset($no_override['draft_autosave'])) { - $field_id = 'rcmfd_autosave'; - $select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => $field_id, 'disabled' => empty($config['drafts_mbox']))); - $select_autosave->add(rcube_label('never'), 0); - foreach (array(1, 3, 5, 10) as $i => $min) - $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); - - $blocks['main']['options']['draft_autosave'] = array( - 'title' => html::label($field_id, Q(rcube_label('autosavedraft'))), - 'content' => $select_autosave->show($config['draft_autosave']), - ); - } - - if (!isset($no_override['mime_param_folding'])) { - $field_id = 'rcmfd_param_folding'; - $select_param_folding = new html_select(array('name' => '_mime_param_folding', 'id' => $field_id)); - $select_param_folding->add(rcube_label('2231folding'), 0); - $select_param_folding->add(rcube_label('miscfolding'), 1); - $select_param_folding->add(rcube_label('2047folding'), 2); - - $blocks['main']['options']['mime_param_folding'] = array( - 'advanced' => true, - 'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))), - 'content' => $select_param_folding->show($config['mime_param_folding']), - ); - } - - if (!isset($no_override['force_7bit'])) { - $field_id = 'rcmfd_force_7bit'; - $input_7bit = new html_checkbox(array('name' => '_force_7bit', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['force_7bit'] = array( - 'title' => html::label($field_id, Q(rcube_label('force7bit'))), - 'content' => $input_7bit->show($config['force_7bit']?1:0), - ); - } - - if (!isset($no_override['mdn_default'])) { - $field_id = 'rcmfd_mdn_default'; - $input_mdn = new html_checkbox(array('name' => '_mdn_default', 'id' => $field_id, 'value' => 1)); - $blocks['main']['options']['mdn_default'] = array( - 'title' => html::label($field_id, Q(rcube_label('reqmdn'))), - 'content' => $input_mdn->show($config['mdn_default']?1:0), - ); - } - - if (!isset($no_override['dsn_default'])) { - $field_id = 'rcmfd_dsn_default'; - $input_dsn = new html_checkbox(array('name' => '_dsn_default', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['dsn_default'] = array( - 'title' => html::label($field_id, Q(rcube_label('reqdsn'))), - 'content' => $input_dsn->show($config['dsn_default']?1:0), - ); - } - - if (!isset($no_override['reply_same_folder'])) { - $field_id = 'rcmfd_reply_same_folder'; - $input_reply_same_folder = new html_checkbox(array('name' => '_reply_same_folder', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['reply_same_folder'] = array( - 'title' => html::label($field_id, Q(rcube_label('replysamefolder'))), - 'content' => $input_reply_same_folder->show($config['reply_same_folder']?1:0), - ); - } - - if (!isset($no_override['reply_mode'])) { - $field_id = 'rcmfd_reply_mode'; - $select_replymode = new html_select(array('name' => '_reply_mode', 'id' => $field_id)); - $select_replymode->add(rcube_label('replyempty'), -1); - $select_replymode->add(rcube_label('replybottomposting'), 0); - $select_replymode->add(rcube_label('replytopposting'), 1); - - $blocks['main']['options']['reply_mode'] = array( - 'title' => html::label($field_id, Q(rcube_label('whenreplying'))), - 'content' => $select_replymode->show(intval($config['reply_mode'])), - ); - } - - if (!isset($no_override['spellcheck_before_send']) && $config['enable_spellcheck']) { - $field_id = 'rcmfd_spellcheck_before_send'; - $input_spellcheck = new html_checkbox(array('name' => '_spellcheck_before_send', 'id' => $field_id, 'value' => 1)); - - $blocks['spellcheck']['options']['spellcheck_before_send'] = array( - 'title' => html::label($field_id, Q(rcube_label('spellcheckbeforesend'))), - 'content' => $input_spellcheck->show($config['spellcheck_before_send']?1:0), - ); - } + $found = false; + $data = $RCMAIL->plugins->exec_hook('preferences_list', + array('section' => $sect['id'], 'blocks' => $blocks, 'current' => $current)); - if ($config['enable_spellcheck']) { - foreach (array('syms', 'nums', 'caps') as $key) { - $key = 'spellcheck_ignore_'.$key; - if (!isset($no_override[$key])) { - $input_spellcheck = new html_checkbox(array('name' => '_'.$key, 'id' => 'rcmfd_'.$key, 'value' => 1)); - - $blocks['spellcheck']['options'][$key] = array( - 'title' => html::label($field_id, Q(rcube_label(str_replace('_', '', $key)))), - 'content' => $input_spellcheck->show($config[$key]?1:0), - ); + // create output + foreach ($data['blocks'] as $block) { + if (!empty($block['content']) || !empty($block['options'])) { + $found = true; + break; + } } - } - } - - if (!isset($no_override['show_sig'])) { - $field_id = 'rcmfd_show_sig'; - $select_show_sig = new html_select(array('name' => '_show_sig', 'id' => $field_id)); - $select_show_sig->add(rcube_label('never'), 0); - $select_show_sig->add(rcube_label('always'), 1); - $select_show_sig->add(rcube_label('newmessageonly'), 2); - $select_show_sig->add(rcube_label('replyandforwardonly'), 3); - - $blocks['sig']['options']['show_sig'] = array( - 'title' => html::label($field_id, Q(rcube_label('autoaddsignature'))), - 'content' => $select_show_sig->show($RCMAIL->config->get('show_sig', 1)), - ); - } - - if (!isset($no_override['strip_existing_sig'])) { - $field_id = 'rcmfd_strip_existing_sig'; - $input_stripexistingsig = new html_checkbox(array('name' => '_strip_existing_sig', 'id' => $field_id, 'value' => 1)); - - $blocks['sig']['options']['strip_existing_sig'] = array( - 'title' => html::label($field_id, Q(rcube_label('replyremovesignature'))), - 'content' => $input_stripexistingsig->show($config['strip_existing_sig']?1:0), - ); - } - - if (!isset($no_override['forward_attachment'])) { - $field_id = 'rcmfd_forward_attachment'; - $select = new html_select(array('name' => '_forward_attachment', 'id' => $field_id)); - $select->add(rcube_label('inline'), 0); - $select->add(rcube_label('asattachment'), 1); - - $blocks['main']['options']['forward_attachment'] = array( - 'title' => html::label($field_id, Q(rcube_label('forwardmode'))), - 'content' => $select->show(intval($config['forward_attachment'])), - ); - } - - if (!isset($no_override['default_font'])) { - $field_id = 'rcmfd_default_font'; - $fonts = rcube_fontdefs(); - $selected = $config['default_font']; - - $select = '<select name="_default_font" id="'.$field_id.'">'; - $select .= '<option value=""' . (!$selected ? ' selected="selected"' : '') . '>---</option>'; - foreach ($fonts as $fname => $font) - $select .= '<option value="'.$fname.'"' - . ($fname == $selected ? ' selected="selected"' : '') - . ' style=\'font-family: ' . $font . '\'>' - . Q($fname) . '</option>'; - $select .= '</select>'; - - $blocks['main']['options']['default_font'] = array( - 'title' => html::label($field_id, Q(rcube_label('defaultfont'))), - 'content' => $select - ); - } - - break; - - - // Addressbook config - case 'addressbook': - - $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - ); - - if (!isset($no_override['default_addressbook']) - && ($books = $RCMAIL->get_address_sources(true, true)) - ) { - $field_id = 'rcmfd_default_addressbook'; - $select_abook = new html_select(array('name' => '_default_addressbook', 'id' => $field_id)); - - foreach ($books as $book) { - $select_abook->add(html_entity_decode($book['name'], ENT_COMPAT, 'UTF-8'), $book['id']); - } - - $blocks['main']['options']['default_addressbook'] = array( - 'title' => html::label($field_id, Q(rcube_label('defaultabook'))), - 'content' => $select_abook->show($config['default_addressbook']), - ); - } - - // show addressbook listing mode selection - if (!isset($no_override['addressbook_name_listing'])) { - $field_id = 'rcmfd_addressbook_name_listing'; - $select_listing = new html_select(array('name' => '_addressbook_name_listing', 'id' => $field_id)); - $select_listing->add(rcube_label('name'), 0); - $select_listing->add(rcube_label('firstname') . ' ' . rcube_label('surname'), 1); - $select_listing->add(rcube_label('surname') . ' ' . rcube_label('firstname'), 2); - $select_listing->add(rcube_label('surname') . ', ' . rcube_label('firstname'), 3); - - $blocks['main']['options']['list_name_listing'] = array( - 'title' => html::label($field_id, Q(rcube_label('listnamedisplay'))), - 'content' => $select_listing->show($config['addressbook_name_listing']), - ); - } - // show addressbook sort column - if (!isset($no_override['addressbook_sort_col'])) { - $field_id = 'rcmfd_addressbook_sort_col'; - $select_sort = new html_select(array('name' => '_addressbook_sort_col', 'id' => $field_id)); - $select_sort->add(rcube_label('name'), 'name'); - $select_sort->add(rcube_label('firstname'), 'firstname'); - $select_sort->add(rcube_label('surname'), 'surname'); - - $blocks['main']['options']['sort_col'] = array( - 'title' => html::label($field_id, Q(rcube_label('listsorting'))), - 'content' => $select_sort->show($config['addressbook_sort_col']), - ); + if (!$found) + unset($sections[$idx]); + else + $sections[$idx]['blocks'] = $data['blocks']; } - // show addressbook page size selection - if (!isset($no_override['addressbook_pagesize'])) { - $field_id = 'rcmfd_addressbook_pagesize'; - $input_pagesize = new html_inputfield(array('name' => '_addressbook_pagesize', 'id' => $field_id, 'size' => 5)); - - $size = intval($config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize']); - - $blocks['main']['options']['pagesize'] = array( - 'title' => html::label($field_id, Q(rcube_label('pagesize'))), - 'content' => $input_pagesize->show($size ? $size : 50), - ); - } - - if (!isset($no_override['autocomplete_single'])) { - $field_id = 'rcmfd_autocomplete_single'; - $checkbox = new html_checkbox(array('name' => '_autocomplete_single', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['autocomplete_single'] = array( - 'title' => html::label($field_id, Q(rcube_label('autocompletesingle'))), - 'content' => $checkbox->show($config['autocomplete_single']?1:0), - ); - } - - break; - - // Special IMAP folders - case 'folders': - - $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - ); - - // Configure special folders - if (!isset($no_override['default_folders'])) { - // load folders list only when needed - if ($current) { - $select = rcmail_mailbox_select(array( - 'noselection' => '---', - 'realnames' => true, - 'maxlength' => 30, - 'folder_filter' => 'mail', - 'folder_rights' => 'w', - // #1486114, #1488279 - 'onchange' => "if ($(this).val() == 'INBOX') $(this).val('')", - )); - } - else // dummy select - $select = new html_select(); - - if (!isset($no_override['drafts_mbox'])) - $blocks['main']['options']['drafts_mbox'] = array( - 'title' => Q(rcube_label('drafts')), - 'content' => $select->show($config['drafts_mbox'], array('name' => "_drafts_mbox")), - ); - - if (!isset($no_override['sent_mbox'])) - $blocks['main']['options']['sent_mbox'] = array( - 'title' => Q(rcube_label('sent')), - 'content' => $select->show($config['sent_mbox'], array('name' => "_sent_mbox")), - ); - - if (!isset($no_override['junk_mbox'])) - $blocks['main']['options']['junk_mbox'] = array( - 'title' => Q(rcube_label('junk')), - 'content' => $select->show($config['junk_mbox'], array('name' => "_junk_mbox")), - ); - - if (!isset($no_override['trash_mbox'])) - $blocks['main']['options']['trash_mbox'] = array( - 'title' => Q(rcube_label('trash')), - 'content' => $select->show($config['trash_mbox'], array('name' => "_trash_mbox")), - ); - } - - break; - - // Server settings - case 'server': - - $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'maintenance' => array('name' => Q(rcube_label('maintenance'))), - ); - - if (!isset($no_override['read_when_deleted'])) { - $field_id = 'rcmfd_read_deleted'; - $input_readdeleted = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['read_when_deleted'] = array( - 'title' => html::label($field_id, Q(rcube_label('readwhendeleted'))), - 'content' => $input_readdeleted->show($config['read_when_deleted']?1:0), - ); - } - - if (!isset($no_override['flag_for_deletion'])) { - $field_id = 'rcmfd_flag_for_deletion'; - $input_flagfordeletion = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['flag_for_deletion'] = array( - 'title' => html::label($field_id, Q(rcube_label('flagfordeletion'))), - 'content' => $input_flagfordeletion->show($config['flag_for_deletion']?1:0), - ); - } - - // don't show deleted messages - if (!isset($no_override['skip_deleted'])) { - $field_id = 'rcmfd_skip_deleted'; - $input_purge = new html_checkbox(array('name' => '_skip_deleted', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['skip_deleted'] = array( - 'title' => html::label($field_id, Q(rcube_label('skipdeleted'))), - 'content' => $input_purge->show($config['skip_deleted']?1:0), - ); - } - - if (!isset($no_override['delete_always'])) { - $field_id = 'rcmfd_delete_always'; - $input_delete_always = new html_checkbox(array('name' => '_delete_always', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['delete_always'] = array( - 'title' => html::label($field_id, Q(rcube_label('deletealways'))), - 'content' => $input_delete_always->show($config['delete_always']?1:0), - ); - } - - if (!isset($no_override['delete_junk'])) { - $field_id = 'rcmfd_delete_junk'; - $input_delete_junk = new html_checkbox(array('name' => '_delete_junk', 'id' => $field_id, 'value' => 1)); - - $blocks['main']['options']['delete_junk'] = array( - 'title' => html::label($field_id, Q(rcube_label('deletejunk'))), - 'content' => $input_delete_junk->show($config['delete_junk']?1:0), - ); - } - - // Trash purging on logout - if (!isset($no_override['logout_purge'])) { - $field_id = 'rcmfd_logout_purge'; - $input_purge = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); - - $blocks['maintenance']['options']['logout_purge'] = array( - 'title' => html::label($field_id, Q(rcube_label('logoutclear'))), - 'content' => $input_purge->show($config['logout_purge']?1:0), - ); - } - - // INBOX compacting on logout - if (!isset($no_override['logout_expunge'])) { - $field_id = 'rcmfd_logout_expunge'; - $input_expunge = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); - - $blocks['maintenance']['options']['logout_expunge'] = array( - 'title' => html::label($field_id, Q(rcube_label('logoutcompact'))), - 'content' => $input_expunge->show($config['logout_expunge']?1:0), - ); - } - - break; - } - - $data = $RCMAIL->plugins->exec_hook('preferences_list', array('section' => $sect['id'], 'blocks' => $blocks)); - $found = false; - - // create output - foreach ($data['blocks'] as $block) { - if (!empty($block['content']) || !empty($block['options'])) { - $found = true; - break; - } - } - - if (!$found) - unset($sections[$idx]); - else - $sections[$idx]['blocks'] = $data['blocks']; - } - - return array($sections, $plugin['cols']); + return array($sections, $plugin['cols']); } function rcmail_get_skins() { - $path = 'skins'; - $skins = array(); - - $dir = opendir($path); + $path = 'skins'; + $skins = array(); + $dir = opendir($path); - if (!$dir) - return false; + if (!$dir) { + return false; + } - while (($file = readdir($dir)) !== false) - { - $filename = $path.'/'.$file; - if (!preg_match('/^\./', $file) && is_dir($filename) && is_readable($filename)) - $skins[] = $file; - } + while (($file = readdir($dir)) !== false) { + $filename = $path.'/'.$file; + if (!preg_match('/^\./', $file) && is_dir($filename) && is_readable($filename)) { + $skins[] = $file; + } + } - closedir($dir); + closedir($dir); - return $skins; + return $skins; } @@ -998,9 +1237,9 @@ function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class // register UI objects $OUTPUT->add_handlers(array( - 'prefsframe' => 'rcmail_preferences_frame', - 'sectionslist' => 'rcmail_sections_list', - 'identitieslist' => 'rcmail_identities_list', + 'prefsframe' => 'rcmail_preferences_frame', + 'sectionslist' => 'rcmail_sections_list', + 'identitieslist' => 'rcmail_identities_list', )); // register action aliases diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index d0a3bec0b..19edb41d4 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -120,6 +120,8 @@ switch ($CURR_SECTION) case 'folders': $a_user_prefs = array( + 'show_real_foldernames' => + isset($_POST['_show_real_foldernames']) ? TRUE : FALSE, 'drafts_mbox' => get_input_value('_drafts_mbox', RCUBE_INPUT_POST, true), 'sent_mbox' => get_input_value('_sent_mbox', RCUBE_INPUT_POST, true), 'junk_mbox' => get_input_value('_junk_mbox', RCUBE_INPUT_POST, true), diff --git a/skins/larry/ui.js b/skins/larry/ui.js index 6f9d30daa..65707cc76 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -740,8 +740,6 @@ function rcube_mail_ui() $('input[name="sort_col"][value="'+rcmail.env.sort_col+'"]').prop('checked', true); $('input[name="sort_ord"][value="DESC"]').prop('checked', rcmail.env.sort_order == 'DESC'); $('input[name="sort_ord"][value="ASC"]').prop('checked', rcmail.env.sort_order != 'DESC'); - $('input[name="view"][value="thread"]').prop('checked', rcmail.env.threading ? true : false); - $('input[name="view"][value="list"]').prop('checked', rcmail.env.threading ? false : true); // set checkboxes $('input[name="list_col[]"]').each(function() { @@ -770,11 +768,10 @@ function rcube_mail_ui() var sort = $('input[name="sort_col"]:checked').val(), ord = $('input[name="sort_ord"]:checked').val(), - thread = $('input[name="view"]:checked').val(), cols = $('input[name="list_col[]"]:checked') .map(function(){ return this.value; }).get(); - rcmail.set_list_options(cols, sort, ord, thread == 'thread' ? 1 : 0); + rcmail.set_list_options(cols, sort, ord, rcmail.env.threading); } |