diff options
Diffstat (limited to 'program')
-rw-r--r-- | program/include/main.inc | 6 | ||||
-rwxr-xr-x | program/include/rcube_db.inc | 69 | ||||
-rw-r--r-- | program/include/rcube_imap.inc | 9 | ||||
-rw-r--r-- | program/js/app.js | 6 | ||||
-rw-r--r-- | program/localization/da/labels.inc | 175 | ||||
-rw-r--r-- | program/localization/da/messages.inc | 58 | ||||
-rw-r--r-- | program/localization/es/labels.inc | 171 | ||||
-rw-r--r-- | program/localization/es/messages.inc | 56 | ||||
-rw-r--r-- | program/localization/fr/labels.inc | 172 | ||||
-rw-r--r-- | program/localization/fr/messages.inc | 56 | ||||
-rw-r--r-- | program/localization/it/labels.inc | 172 | ||||
-rw-r--r-- | program/localization/it/messages.inc | 56 | ||||
-rw-r--r-- | program/steps/mail/compose.inc | 44 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 165 | ||||
-rw-r--r-- | program/steps/mail/upload.inc | 14 |
15 files changed, 1186 insertions, 43 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 7173917d4..0a63b685b 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -219,7 +219,7 @@ function load_gui() $javascript = "var $JS_OBJECT_NAME = new rcube_webmail();\n"; $javascript .= "$JS_OBJECT_NAME.set_env('comm_path', '$COMM_PATH');\n"; - if ($_GET['_framed'] || $_POST['_framed']) + if (!empty($GLOBALS['_framed'])) $javascript .= "$JS_OBJECT_NAME.set_env('framed', true);\n"; $OUTPUT->add_script($javascript); @@ -339,7 +339,7 @@ function show_message($message, $type='notice') { global $OUTPUT, $JS_OBJECT_NAME, $REMOTE_REQUEST; - $framed = ($_GET['framed'] || $_POST['_framed']); + $framed = $GLOBALS['_framed']; $command = sprintf("display_message('%s', '%s');", addslashes(rep_specialchars_output(rcube_label($message))), $type); @@ -837,7 +837,7 @@ function rcmail_get_edit_field($col, $value, $attrib, $type='text') $input = new textfield($attrib); // use value from post - if ($_POST[$fname]) + if (!empty($_POST[$fname])) $value = $_POST[$fname]; $out = $input->show($value); diff --git a/program/include/rcube_db.inc b/program/include/rcube_db.inc index fe838da4c..9c76cb340 100755 --- a/program/include/rcube_db.inc +++ b/program/include/rcube_db.inc @@ -51,8 +51,10 @@ class rcube_db // Connect to specific database function dsn_connect($dsn) { - // Use persistent connections if available + $dsn_array = DB::parseDSN($dsn); + $this->db_provider = $dsn_array['phptype']; + // Use persistent connections if available $dbh = DB::connect($dsn, array('persistent' => $true)); if (DB::isError($dbh)) @@ -61,6 +63,12 @@ class rcube_db 'line' => __LINE__, 'file' => __FILE__, 'message' => $dbh->getMessage()), TRUE, FALSE); + else if ($this->db_provider=='sqlite') + { + if (!is_file($dsn_array['database']) || !filesize($dsn_array['database'])) + $this->_sqlite_create_database($dbh, 'SQL/sqlite.initial.sql'); + } + return $dbh; } @@ -96,22 +104,23 @@ class rcube_db function query($query) { // Read or write ? - if (strtolower(trim(substr($query,0,6)))=='select') $mode='r'; else - { $mode='w'; - } - $this->db_connect($mode); - + $this->db_connect($mode); + + if ($this->db_provider == 'sqlite') + $query = $this->_sqlite_prepare_query($query); + $result = $this->db_handle->query($query); if (DB::isError($result)) - raise_error( array('code' => 500, 'type' => 'db', 'line' => __LINE__, - 'file' => __FILE__, - 'message' => $result->getMessage()), TRUE, FALSE); + raise_error(array('code' => 500, 'type' => 'db', + 'line' => __LINE__, + 'file' => __FILE__, + 'message' => $result->getMessage()), TRUE, FALSE); return $this->_add_result($result, $query); } @@ -120,6 +129,9 @@ class rcube_db { db_connect('w'); + if ($this->db_provider == 'sqlite') + $query = $this->_sqlite_prepare_query($query); + $result = $this->db_handle->query($query); } @@ -162,7 +174,10 @@ class rcube_db case 'mysql': // This is unfortuneate return mysql_insert_id($this->db_handle); - + + case 'sqlite': + return sqlite_last_insert_rowid($this->db_handle->connection); + default: die("portability issue with this database, please have the developer fix"); } @@ -209,6 +224,40 @@ class rcube_db return FALSE; } + + // create a sqlite database from a file + function _sqlite_create_database($dbh, $fileName) + { + if (empty($fileName) || !is_string($fileName)) + return ; + + $fd = fopen($fileName, 'r'); + if (!$fd) + return ; + + $data = ''; + while ($line = fgets($fd, 4096)) + $data .= $line; + + fclose($fd); + sqlite_exec($dbh->connection, $data); + } + + // transform a query so that it is sqlite2 compliant + function _sqlite_prepare_query($query) + { + if (!is_string($query)) + return ($query); + + $search = array('/NOW\(\)/', + '/`/'); + $replace = array("datetime('now')", + '"'); + $query = preg_replace($search, $replace, $query); + + return ($query); + } + } ?>
\ No newline at end of file diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index e74321418..127409dc8 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -35,6 +35,7 @@ class rcube_imap var $mailbox = 'INBOX'; var $list_page = 1; var $page_size = 10; + var $delimiter = NULL; var $caching_enabled = FALSE; var $default_folders = array('inbox', 'drafts', 'sent', 'junk', 'trash'); var $cache = array(); @@ -153,6 +154,14 @@ class rcube_imap } + function get_hierarchy_delimiter() + { + if ($this->conn && empty($this->delimiter)) + $this->delimiter = iil_C_GetHierarchyDelimiter($this->conn); + + return $this->delimiter; + } + // public method for mailbox listing // convert mailbox name with root dir first function list_mailboxes($root='', $filter='*') diff --git a/program/js/app.js b/program/js/app.js index 87fd25572..30d870475 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1985,9 +1985,11 @@ function rcube_webmail() var item, reg, text_obj; var s_mbox = String(mbox).toLowerCase().replace(this.mbox_expression, ''); var s_current = this.env.mailbox.toLowerCase().replace(this.mbox_expression, ''); - for (var n=0; n<this.gui_objects.mailboxlist.childNodes.length; n++) + var nodes = this.gui_objects.mailboxlist.getElementsByTagName('LI'); + + for (var n=0; n<nodes.length; n++) { - item = this.gui_objects.mailboxlist.childNodes[n]; + item = nodes[n]; if (item.className && item.className.indexOf('mailbox '+s_mbox+' ')>=0) this.set_classname(item, 'selected', true); else if (item.className && item.className.indexOf('mailbox '+s_current)>=0) diff --git a/program/localization/da/labels.inc b/program/localization/da/labels.inc new file mode 100644 index 000000000..bec439d86 --- /dev/null +++ b/program/localization/da/labels.inc @@ -0,0 +1,175 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/da/labels.inc | + | | + | Language file of the RoundCube Webmail client | + | Copyright (C) 2005, RoundQube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: Thomas Bruederli <roundcube@gmail.com> | + +-----------------------------------------------------------------------+ + | Danish translation: Martin Moeller <martin@liga.dk> | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$labels = array(); + +// login page +$labels['username'] = 'Brugernavn'; +$labels['password'] = 'Adgangskode'; +$labels['server'] = 'Server'; +$labels['login'] = 'Log på'; + +// taskbar +$labels['logout'] = 'Log af'; +$labels['mail'] = 'Email'; +$labels['settings'] = 'Personlige indstillinger'; +$labels['addressbook'] = 'Adressebog'; + +// mailbox names +$labels['inbox'] = 'Indbakke'; +$labels['sent'] = 'Sendt post'; +$labels['trash'] = 'Skrald'; +$labels['drafts'] = 'Klader'; +$labels['junk'] = 'Ragelse'; + +// message listing +$labels['subject'] = 'Emne'; +$labels['from'] = 'Afsender'; +$labels['to'] = 'Modtager'; +$labels['cc'] = 'Kopi til'; +$labels['bcc'] = 'BCC'; +$labels['replyto'] = 'Svar til'; +$labels['date'] = 'Dato'; +$labels['size'] = 'Størrelse'; +$labels['priority'] = 'Prioritet'; +$labels['organization'] = 'Organisation'; + +// aliases +$labels['reply-to'] = $labels['replyto']; + +$labels['mailboxlist'] = 'Foldere'; +$labels['messagesfromto'] = 'Beskeder $from til $to af $count'; +$labels['messagenrof'] = 'Besked $nr af $count'; + +$labels['moveto'] = 'flyt til...'; +$labels['download'] = 'download'; + +$labels['filename'] = 'Filnavn'; +$labels['filesize'] = 'Filstørrelse'; + +$labels['preferhtml'] = 'Foretræk HTML'; +$labels['htmlmessage'] = 'HTML besked'; +$labels['prettydate'] = 'Pæn datovisning'; + +$labels['addtoaddressbook'] = 'Tilføj til adressebogen'; + +// weekdays short +$labels['sun'] = 'Søn'; +$labels['mon'] = 'Man'; +$labels['tue'] = 'Tir'; +$labels['wed'] = 'Ons'; +$labels['thu'] = 'Tor'; +$labels['fri'] = 'Fre'; +$labels['sat'] = 'Lør'; + +// weekdays long +$labels['sunday'] = 'Søndag'; +$labels['monday'] = 'Mandag'; +$labels['tuesday'] = 'Tirsdag'; +$labels['wednesday'] = 'Onsdag'; +$labels['thursday'] = 'Torsdag'; +$labels['friday'] = 'Fredag'; +$labels['saturday'] = 'Lørdag'; + +$labels['today'] = 'I dag'; + +// toolbar buttons +$labels['writenewmessage'] = 'Opret en ny besked'; +$labels['replytomessage'] = 'Svar på denne besked'; +$labels['forwardmessage'] = 'Videresend denne besked'; +$labels['deletemessage'] = 'Flyt beskeden til skrald'; +$labels['printmessage'] = 'Udskriv denne besked'; +$labels['previousmessages'] = 'Vis forrige sæt beskeder'; +$labels['nextmessages'] = 'Vis næste sæt beskeder'; +$labels['backtolist'] = 'Tilbage til beskedlisten'; + +$labels['select'] = 'Vælg'; +$labels['all'] = 'Alle'; +$labels['none'] = 'Ingen'; +$labels['unread'] = 'Ulæste'; + +// message compose +$labels['compose'] = 'Forfat en besked'; +$labels['sendmessage'] = 'Send beskeden nu'; +$labels['addattachment'] = 'Vedhæft en fil'; + +$labels['attachments'] = 'Vedhæftninger'; +$labels['upload'] = 'Upload'; +$labels['close'] = 'Luk'; + +$labels['low'] = 'Lav'; +$labels['lowest'] = 'Lavest'; +$labels['normal'] = 'Normal'; +$labels['high'] = 'Høj'; +$labels['highest'] = 'Højest'; + +$labels['showimages'] = 'Vis billeder'; + + +// address boook +$labels['name'] = 'Vist navn'; +$labels['firstname'] = 'Fornavn'; +$labels['surname'] = 'Efternavn'; +$labels['email'] = 'Email'; + +$labels['addcontact'] = 'Tilføj en ny kontakt'; +$labels['editcontact'] = 'Redigér kontakt'; + +$labels['edit'] = 'Redigér'; +$labels['cancel'] = 'Afbryd'; +$labels['save'] = 'Gem'; +$labels['delete'] = 'Slet'; + +$labels['newcontact'] = 'Opret nyt kontaktkort'; +$labels['deletecontact'] = 'Slet valgte kontakter'; +$labels['composeto'] = 'Skriv brev til'; +$labels['contactsfromto'] = 'Kontakter $from til $to af $count'; + + +// settings +$labels['settingsfor'] = 'Indstillinger for'; + +$labels['preferences'] = 'Præferencer'; +$labels['userpreferences'] = 'Brugerpræferencer'; +$labels['editpreferences'] = 'Redigér brugerpræferencer'; + +$labels['identities'] = 'Identiteter'; +$labels['manageidentities'] = 'Styr identiteterne for denne konto'; +$labels['newidentity'] = 'Ny identitet'; + +$labels['newitem'] = 'Nyt punkt'; +$labels['edititem'] = 'Redigér punkt'; + +$labels['setdefault'] = 'Sæt standard'; +$labels['language'] = 'Sprog'; +$labels['timezone'] = 'Tidszone'; +$labels['pagesize'] = 'Rækker per side'; + + +$labels['folders'] = 'Foldere'; +$labels['foldername'] = 'Foldernavn'; +$labels['subscribed'] = 'Abonneret'; +$labels['create'] = 'Opret'; +$labels['createfolder'] = 'Opret ny folder'; +$labels['deletefolder'] = 'Slet folder'; +$labels['managefolders'] = 'Styr foldere'; + + +?> diff --git a/program/localization/da/messages.inc b/program/localization/da/messages.inc new file mode 100644 index 000000000..5cbe9857b --- /dev/null +++ b/program/localization/da/messages.inc @@ -0,0 +1,58 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/da/messages.inc | + | | + | Language file of the RoundCube Webmail client | + | Copyright (C) 2005, RoundCube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: Thomas Bruederli <roundcube@gmail.com> | + +-----------------------------------------------------------------------+ + | Danish translation : Martin Moeller <martin@liga.dk> | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$messages = array(); + +$messages['loginfailed'] = 'Det lykkedes ikke at logge på'; + +$messages['cookiesdisabled'] = 'Din browser accepterer ikke cookies'; + +$messages['sessionerror'] = 'Din session er ugyldig eller udløbet'; + +$messages['imaperror'] = 'Forbindelse til IMAP serveren fejlede'; + +$messages['nomessagesfound'] = 'Der blev ikke fundet nogen beskeder i denne postkasse'; + +$messages['loggedout'] = 'Du er nu logget af webmail. Farvel så længe!'; + +$messages['mailboxempty'] = 'Postkassen er tom!'; + +$messages['loadingdata'] = 'Indlæser data...'; + +$messages['messagesent'] = 'Beskeden blev sendt korrekt'; + +$messages['successfullysaved'] = 'Det lykkedes at gemme'; + +$messages['addedsuccessfully'] = 'Kontakten blev tilføjet adressebogen'; + +$messages['contactexists'] = 'Der er allerede en kontakt med denne email adresse'; + +$messages['blockedimages'] = 'For at beskytte dit privatliv er billeder fra internet servere blokeret i denne besked.'; + +$messages['encryptedmessage'] = 'Dette er en krypteret besked og kan ikke vises. Beklager!'; + +$messages['nocontactsfound'] = 'Ingen kontakter blev fundet'; + +$messages['sendingfailed'] = 'Kunne ikke sende beskeden'; + +$messages['errorsaving'] = 'Der opstod en fejl ved lagring af data'; + + +?> diff --git a/program/localization/es/labels.inc b/program/localization/es/labels.inc new file mode 100644 index 000000000..f0fdca561 --- /dev/null +++ b/program/localization/es/labels.inc @@ -0,0 +1,171 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/en/labels.inc | + | | + | Language file of the RoundCube Webmail client | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: David Grajal Blanco <dgrabla@gmail.com> | + +-----------------------------------------------------------------------+ + + $Id: labels.inc,v 1.1.1.1 2005/09/17 + +*/ + +$labels = array(); + +// login page +$labels['username'] = 'Nombre de usuario'; +$labels['password'] = 'Contraseña'; +$labels['server'] = 'Servidor'; +$labels['login'] = 'Entrar'; + +// taskbar +$labels['logout'] = 'Cerrar sesión'; +$labels['mail'] = 'E-Mail'; +$labels['settings'] = 'Configuración'; +$labels['addressbook'] = 'Contactos'; + +// mailbox names +$labels['inbox'] = 'Entrada'; +$labels['sent'] = 'Enviados'; +$labels['trash'] = 'Papelera'; +$labels['drafts'] = 'Borradores'; +$labels['junk'] = 'Basura'; + +// message listing +$labels['subject'] = 'Asunto'; +$labels['from'] = 'Remitente'; +$labels['to'] = 'Destinatario'; +$labels['cc'] = 'CC'; +$labels['bcc'] = 'BCC'; +$labels['replyto'] = 'Responder'; +$labels['date'] = 'Fecha'; +$labels['size'] = 'Tamaño'; +$labels['priority'] = 'Prioridad'; +$labels['organization'] = 'Organización'; + +// aliases +$labels['reply-to'] = $labels['replyto']; + +$labels['mailboxlist'] = 'Carpetas'; +$labels['messagesfromto'] = 'Mensajes desde $from a $to de $count'; +$labels['messagenrof'] = 'Mensaje $nr de $count'; + +$labels['moveto'] = 'mover a...'; +$labels['download'] = 'descargar'; + +$labels['filename'] = 'Nombre del fichero'; +$labels['filesize'] = 'Tamaño del fichero'; + +$labels['preferhtml'] = 'Prefiero HTML'; +$labels['htmlmessage'] = 'Mensaje HTML'; + +$labels['addtoaddressbook'] = 'Añadir a contactos'; + +// weekdays short +$labels['sun'] = 'D'; +$labels['mon'] = 'L'; +$labels['tue'] = 'M'; +$labels['wed'] = 'X'; +$labels['thu'] = 'J'; +$labels['fri'] = 'V'; +$labels['sat'] = 'S'; + +// weekdays long +$labels['sunday'] = 'Domingo'; +$labels['monday'] = 'Lunes'; +$labels['tuesday'] = 'Martes'; +$labels['wednesday'] = 'Miercoles'; +$labels['thursday'] = 'Jueves'; +$labels['friday'] = 'Viernes'; +$labels['saturday'] = 'Sábado'; + +$labels['today'] = 'Hoy'; + +// toolbar buttons +$labels['writenewmessage'] = 'Crear nuevo mensaje'; +$labels['replytomessage'] = 'Responder al mensaje'; +$labels['forwardmessage'] = 'Reenviar mensaje'; +$labels['deletemessage'] = 'Move message to trash'; +$labels['printmessage'] = 'Imprimir este mensaje'; +$labels['previousmessages'] = 'Mostrar mensajes anteriores'; +$labels['nextmessages'] = 'Mostrar mensajes siguientes'; +$labels['backtolist'] = 'Volver a la lista de mensajes'; + +$labels['select'] = 'Seleccionar'; +$labels['all'] = 'Todos'; +$labels['none'] = 'Ninguno'; +$labels['unread'] = 'No leidos'; + +// message compose +$labels['compose'] = 'Escribir un mensaje'; +$labels['sendmessage'] = 'Enviar ahora el mensaje'; +$labels['addattachment'] = 'Añadir un fichero'; + +$labels['attachments'] = 'Adjuntos'; +$labels['upload'] = 'Subir'; +$labels['close'] = 'Cerrar'; + +$labels['low'] = 'Bajo'; +$labels['lowest'] = 'Bajísimo'; +$labels['normal'] = 'Normal'; +$labels['high'] = 'Alto'; +$labels['highest'] = 'Altísimo'; + +$labels['showimages'] = 'Mostrar imágenes'; + + +// address boook +$labels['name'] = 'Mostrar nombre'; +$labels['firstname'] = 'Nombre'; +$labels['surname'] = 'Apellido'; +$labels['email'] = 'E-Mail'; + +$labels['addcontact'] = 'Añadir nuevo contacto'; +$labels['editcontact'] = 'Editar contacto'; + +$labels['edit'] = 'Editar'; +$labels['cancel'] = 'Cancelar'; +$labels['save'] = 'Salvar'; +$labels['delete'] = 'Eliminar'; + +$labels['newcontact'] = 'Crear nuevo contacto'; +$labels['deletecontact'] = 'Eliminar contactos seleccionados'; +$labels['composeto'] = 'Redactar correo a'; +$labels['contactsfromto'] = 'Contactos $from a $to de $count'; + + +// settings +$labels['settingsfor'] = 'Configuración para'; + +$labels['preferences'] = 'Preferencias'; +$labels['userpreferences'] = 'Preferencias de usuario'; +$labels['editpreferences'] = 'Editar preferencias de usuario'; + +$labels['identities'] = 'Identidades'; +$labels['manageidentities'] = 'Gestionar identidades para esta cuenta'; +$labels['newidentity'] = 'Nueva identidad'; + +$labels['newitem'] = 'Nuevo'; +$labels['edititem'] = 'Editar'; + +$labels['setdefault'] = 'Seleccionar opción por defecto'; +$labels['language'] = 'Idioma'; +$labels['timezone'] = 'Zona horaria'; +$labels['pagesize'] = 'Filas por página'; + + +$labels['folders'] = 'Carpetas'; +$labels['foldername'] = 'Nombre de carpeta'; +$labels['subscribed'] = 'Suscribirse'; +$labels['create'] = 'Crear'; +$labels['createfolder'] = 'Crear nueva carpeta'; +$labels['deletefolder'] = 'Eliminar carpeta'; +$labels['managefolders'] = 'Gestionar carpetas'; + + +?> diff --git a/program/localization/es/messages.inc b/program/localization/es/messages.inc new file mode 100644 index 000000000..cc0c6b186 --- /dev/null +++ b/program/localization/es/messages.inc @@ -0,0 +1,56 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/en/messages.inc | + | | + | Language file of the RoundCube Webmail client | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: David Grajal <dgrabla@gmail.com> | + +-----------------------------------------------------------------------+ + + $Id: messages.inc,v 1.1.1.1 2005/09/17 + +*/ + +$messages = array(); + +$messages['loginfailed'] = 'Contraseña incorrecta'; + +$messages['cookiesdisabled'] = 'Su navegador no acepta cookies'; + +$messages['sessionerror'] = 'Su sesión no existe o ha expirado'; + +$messages['imaperror'] = 'Fallo de conexión con el servidor IMAP'; + +$messages['nomessagesfound'] = 'No se han encontrado mensajes en este buzón'; + +$messages['loggedout'] = 'Ha cerrado la sesión. ¡Hasta pronto!'; + +$messages['mailboxempty'] = 'El buzón esta vacio'; + +$messages['loadingdata'] = 'Cargando datos...'; + +$messages['messagesent'] = 'Mensaje enviado correctamente'; + +$messages['successfullysaved'] = 'guardado correctamente'; + +$messages['addedsuccessfully'] = 'Contacto añadido correctamente a la libreta de direcciones'; + +$messages['contactexists'] = 'Ya existe un contacto con esta dirección de correo'; + +$messages['blockedimages'] = 'Para proteger su privacidad, las imágenes remotas han sido bloqueadas en este mensaje'; + +$messages['encryptedmessage'] = 'Este es un mensaje cifrado y no puede +ser mostrado. ¡Lo siento!'; + +$messages['nocontactsfound'] = 'No hay contactos'; + +$messages['sendingfailed'] = 'Error al enviar mensaje'; + +$messages['errorsaving'] = 'Ocurrió un error mientras se guardaba'; + + +?> diff --git a/program/localization/fr/labels.inc b/program/localization/fr/labels.inc new file mode 100644 index 000000000..5b9251820 --- /dev/null +++ b/program/localization/fr/labels.inc @@ -0,0 +1,172 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/fr/labels.inc | + | | + | Language file of the RoundCube Webmail client | + | Copyright (C) 2005, RoundQube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: aldweb <info@aldweb.com> | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$labels = array(); + +// login page +$labels['username'] = 'ID utilisateur'; +$labels['password'] = 'Mot de passe'; +$labels['server'] = 'Serveur'; +$labels['login'] = 'Connexion'; + +// taskbar +$labels['logout'] = 'Quitter'; +$labels['mail'] = 'e-Mail'; +$labels['settings'] = 'Préférences'; +$labels['addressbook'] = 'Carnet d\'adresses'; + +// mailbox names +$labels['inbox'] = 'Boîte de réception'; +$labels['sent'] = 'Messages envoyés'; +$labels['trash'] = 'Corbeille'; +$labels['drafts'] = 'Brouillons'; +$labels['junk'] = 'A trier'; + +// message listing +$labels['subject'] = 'Sujet'; +$labels['from'] = 'De'; +$labels['to'] = 'A'; +$labels['cc'] = 'Cc'; +$labels['bcc'] = 'Cci'; +$labels['replyto'] = 'Répondre à'; +$labels['date'] = 'Date'; +$labels['size'] = 'Taille'; +$labels['priority'] = 'Priorité'; +$labels['organization'] = 'Organisation'; + +// aliases +$labels['reply-to'] = $labels['replyto']; + +$labels['mailboxlist'] = 'Dossiers'; +$labels['messagesfromto'] = 'Messages $from à $to sur $count'; +$labels['messagenrof'] = 'Message $nr sur $count'; + +$labels['moveto'] = 'Déplacer vers...'; +$labels['download'] = 'Télécharger'; + +$labels['filename'] = 'Nom du fichier'; +$labels['filesize'] = 'Taille du fichier'; + +$labels['preferhtml'] = 'Préférer HTML'; +$labels['htmlmessage'] = 'Message HTML'; + +$labels['addtoaddressbook'] = 'Ajouter au carnet d\'adresses'; + +// weekdays short +$labels['sun'] = 'Dim'; +$labels['mon'] = 'Lun'; +$labels['tue'] = 'Mar'; +$labels['wed'] = 'Mer'; +$labels['thu'] = 'Jeu'; +$labels['fri'] = 'Ven'; +$labels['sat'] = 'Sam'; + +// weekdays long +$labels['sunday'] = 'Dimanche'; +$labels['monday'] = 'Lundi'; +$labels['tuesday'] = 'Mardi'; +$labels['wednesday'] = 'Mercredi'; +$labels['thursday'] = 'Jeudi'; +$labels['friday'] = 'Vendredi'; +$labels['saturday'] = 'Samedi'; + +$labels['today'] = 'Aujourd\'hui'; + +// toolbar buttons +$labels['writenewmessage'] = 'Créer un nouveau message'; +$labels['replytomessage'] = 'Répondre au message'; +$labels['forwardmessage'] = 'Transmettre le message'; +$labels['deletemessage'] = 'Déplacer le message dans la corbeille'; +$labels['printmessage'] = 'Imprimer ce message'; +$labels['previousmessages'] = 'Voir les messages précédents'; +$labels['nextmessages'] = 'Voir les messages suivants'; +$labels['backtolist'] = 'Retourner à la liste des messages'; + +$labels['select'] = 'Sélectionner'; +$labels['all'] = 'Tous'; +$labels['none'] = 'Aucun'; +$labels['unread'] = 'Non lus'; + +// message compose +$labels['compose'] = 'Composer un nouveau message'; +$labels['sendmessage'] = 'Envoyer le message maintenant'; +$labels['addattachment'] = 'Joindre un fichier'; + +$labels['attachments'] = 'Attachments'; +$labels['upload'] = 'Joindre'; +$labels['close'] = 'Fermer'; + +$labels['low'] = 'Basse'; +$labels['lowest'] = 'Très basse'; +$labels['normal'] = 'Normale'; +$labels['high'] = 'Elevée'; +$labels['highest'] = 'Très élevée'; + +$labels['showimages'] = 'Montrer les images'; + + +// address boook +$labels['name'] = 'Nom à afficher'; +$labels['firstname'] = 'Prénom'; +$labels['surname'] = 'Nom'; +$labels['email'] = 'e-Mail'; + +$labels['addcontact'] = 'Ajouter un nouveau contact'; +$labels['editcontact'] = 'Editer le contact'; + +$labels['edit'] = 'Editer'; +$labels['cancel'] = 'Annuler'; +$labels['save'] = 'Sauvegarder'; +$labels['delete'] = 'Supprimer'; + +$labels['newcontact'] = 'Créer un nouveau contact'; +$labels['deletecontact'] = 'Supprimer les contacts sélectionnés'; +$labels['composeto'] = 'Ecrire un message à'; +$labels['contactsfromto'] = 'Contacts $from à $to sur $count'; + + +// settings +$labels['settingsfor'] = 'Paramètres pour'; + +$labels['preferences'] = 'Préférences'; +$labels['userpreferences'] = 'Préférences utilisateur'; +$labels['editpreferences'] = 'Editer les préférences utilisateur'; + +$labels['identities'] = 'Identités'; +$labels['manageidentities'] = 'Gérer les identités pour ce compte'; +$labels['newidentity'] = 'Nouvelle identité'; + +$labels['newitem'] = 'Nouvel élément'; +$labels['edititem'] = 'Editer l\'élément'; + +$labels['setdefault'] = 'Paramètres par défaut'; +$labels['language'] = 'Langue'; +$labels['timezone'] = 'Fuseau horaire'; +$labels['pagesize'] = 'nombre de lignes par page'; + + +$labels['folders'] = 'Dossiers'; +$labels['foldername'] = 'Nom du dossier'; +$labels['subscribed'] = 'Abonné'; +$labels['create'] = 'Créer'; +$labels['createfolder'] = 'Créer un nouveau dossier'; +$labels['deletefolder'] = 'Supprimer le dossier'; +$labels['managefolders'] = 'Gérer les dossiers'; + + +?> diff --git a/program/localization/fr/messages.inc b/program/localization/fr/messages.inc new file mode 100644 index 000000000..0ecfb7618 --- /dev/null +++ b/program/localization/fr/messages.inc @@ -0,0 +1,56 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/fr/messages.inc | + | | + | Language file of the RoundCube Webmail client | + | Copyright (C) 2005, RoundCube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: aldweb <info@aldweb.com> | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$messages = array(); + +$messages['loginfailed'] = 'Erreur de connexion'; + +$messages['cookiesdisabled'] = 'Votre navigateur n\'accepte pas les cookies'; + +$messages['sessionerror'] = 'Votre session n\'est pas valide ou a expiré'; + +$messages['imaperror'] = 'Erreur de connexion au serveur IMAP'; + +$messages['nomessagesfound'] = 'Auncun message trouvé dans cette boîte aux lettres'; + +$messages['loggedout'] = 'Vous venez de vous déconnecter avec succès. Au revoir !'; + +$messages['mailboxempty'] = 'Boîte aux lettres vide'; + +$messages['loadingdata'] = 'Chargement des données en cours...'; + +$messages['messagesent'] = 'Message envoyé'; + +$messages['successfullysaved'] = 'Sauvegarde effectuée'; + +$messages['addedsuccessfully'] = 'Contact ajouté dans le carnet d\'adresses'; + +$messages['contactexists'] = 'Un contact avec cette adresse e-Mail existe déjà'; + +$messages['blockedimages'] = 'Afin de préserver votre intimité, les images distantes ont été bloquées dans ce message.'; + +$messages['encryptedmessage'] = 'Ceci est un message crypté et il ne peut pas être affiché. Désolé !'; + +$messages['nocontactsfound'] = 'Aucun contact trouvé'; + +$messages['sendingfailed'] = 'Le message n\'a pas été envoyé'; + +$messages['errorsaving'] = 'Une erreur est apparue pendant la sauvegarde'; + + +?> diff --git a/program/localization/it/labels.inc b/program/localization/it/labels.inc new file mode 100644 index 000000000..3eba8b6be --- /dev/null +++ b/program/localization/it/labels.inc @@ -0,0 +1,172 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/it/labels.inc | + | | + | Language file of the RoundCube Webmail client | + | Copyright (C) 2005, RoundQube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: APaella <apaella@yahoo.it> | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$labels = array(); + +// login page +$labels['username'] = 'Username'; +$labels['password'] = 'Password'; +$labels['server'] = 'Server'; +$labels['login'] = 'Login'; + +// taskbar +$labels['logout'] = 'Logout'; +$labels['mail'] = 'E-Mail'; +$labels['settings'] = 'Impostazioni personali'; +$labels['addressbook'] = 'Rubrica'; + +// mailbox names +$labels['inbox'] = 'In arrivo'; +$labels['sent'] = 'Spedita'; +$labels['trash'] = 'Cestino'; +$labels['drafts'] = 'Bozze'; +$labels['junk'] = 'Spazzatura'; + +// message listing +$labels['subject'] = 'Soggetto'; +$labels['from'] = 'Mittente'; +$labels['to'] = 'A'; +$labels['cc'] = 'Cc'; +$labels['bcc'] = 'Bcc'; +$labels['replyto'] = 'Rispondi a'; +$labels['date'] = 'Data'; +$labels['size'] = 'Dimensione'; +$labels['priority'] = 'Priorità'; +$labels['organization'] = 'Organizzazione'; + +// aliases +$labels['reply-to'] = $labels['replyto']; + +$labels['mailboxlist'] = 'Cartelle'; +$labels['messagesfromto'] = 'Messaggi $from a $to di $count'; +$labels['messagenrof'] = 'Messaggio $nr di $count'; + +$labels['moveto'] = 'sposta in...'; +$labels['download'] = 'scarica'; + +$labels['filename'] = 'Nome del file'; +$labels['filesize'] = 'Dimensione del file'; + +$labels['preferhtml'] = 'Preferisci HTML'; +$labels['htmlmessage'] = 'HTML Messaggio'; + +$labels['addtoaddressbook'] = 'Aggiungi alla rubrica'; + +// weekdays short +$labels['sun'] = 'Dom'; +$labels['mon'] = 'Lun'; +$labels['tue'] = 'Mar'; +$labels['wed'] = 'Mer'; +$labels['thu'] = 'Gio'; +$labels['fri'] = 'Ven'; +$labels['sat'] = 'Sab'; + +// weekdays long +$labels['sunday'] = 'Domenica'; +$labels['monday'] = 'Lunedì'; +$labels['tuesday'] = 'Martedì'; +$labels['wednesday'] = 'Mercoledì'; +$labels['thursday'] = 'Giovedì'; +$labels['friday'] = 'Venerdì'; +$labels['saturday'] = 'Sabato'; + +$labels['today'] = 'Oggi'; + +// toolbar buttons +$labels['writenewmessage'] = 'Crea un nuovo messaggio'; +$labels['replytomessage'] = 'Rispondi al messaggio'; +$labels['forwardmessage'] = 'Inoltra il messaggio'; +$labels['deletemessage'] = 'Sposta il messaggio nel cestino'; +$labels['printmessage'] = 'Stampa questo messaggio'; +$labels['previousmessages'] = 'Mostra i messaggi precedenti'; +$labels['nextmessages'] = 'Mostra i messaggi successivi'; +$labels['backtolist'] = 'Torna all\'elenco dei messaggi'; + +$labels['select'] = 'Seleziona'; +$labels['all'] = 'Tutto'; +$labels['none'] = 'Nulla'; +$labels['unread'] = 'Non letti'; + +// message compose +$labels['compose'] = 'Componi un messaggio'; +$labels['sendmessage'] = 'Spedisci il messaggio ora'; +$labels['addattachment'] = 'Allega un file'; + +$labels['attachments'] = 'Collegamenti'; +$labels['upload'] = 'Upload'; +$labels['close'] = 'Chiudi'; + +$labels['low'] = 'Bassma'; +$labels['lowest'] = 'Bassissia'; +$labels['normal'] = 'Normale'; +$labels['high'] = 'Alta'; +$labels['highest'] = 'Altissima'; + +$labels['showimages'] = 'Mostra immagini'; + + +// address boook +$labels['name'] = 'Nome da visualizzare'; +$labels['firstname'] = 'Nome'; +$labels['surname'] = 'Cognome'; +$labels['email'] = 'E-Mail'; + +$labels['addcontact'] = 'Aggiungi nuovo contatto'; +$labels['editcontact'] = 'Modifica contatto'; + +$labels['edit'] = 'Modifica'; +$labels['cancel'] = 'Annulla'; +$labels['save'] = 'Salva'; +$labels['delete'] = 'Elimina'; + +$labels['newcontact'] = 'Crea una nuova scheda contatto'; +$labels['deletecontact'] = 'Elimina il contatto selezionato'; +$labels['composeto'] = 'Componi una mail per'; +$labels['contactsfromto'] = 'Contatti $from a $to di $count'; + + +// settings +$labels['settingsfor'] = 'Impostazioni per'; + +$labels['preferences'] = 'Preferenze'; +$labels['userpreferences'] = 'Preferenze utente'; +$labels['editpreferences'] = 'Modifica preferenze utente'; + +$labels['identities'] = 'Identità'; +$labels['manageidentities'] = 'Gestisci le identità per questo account'; +$labels['newidentity'] = 'Nuova identità'; + +$labels['newitem'] = 'Nuovo oggetto'; +$labels['edititem'] = 'Modifica oggetto'; + +$labels['setdefault'] = 'Imposta predefinito'; +$labels['language'] = 'Lingua'; +$labels['timezone'] = 'Fuso orario'; +$labels['pagesize'] = 'Righe per pagina'; + + +$labels['folders'] = 'Cartelle'; +$labels['foldername'] = 'nome della cartella'; +$labels['subscribed'] = 'Sottoscritto/a'; +$labels['create'] = 'Creato/a'; +$labels['createfolder'] = 'Crea nuova cartella'; +$labels['deletefolder'] = 'Elimina cartella'; +$labels['managefolders'] = 'Gestisci cartelle'; + + +?>
\ No newline at end of file diff --git a/program/localization/it/messages.inc b/program/localization/it/messages.inc new file mode 100644 index 000000000..1525ea131 --- /dev/null +++ b/program/localization/it/messages.inc @@ -0,0 +1,56 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | language/it/messages.inc | + | | + | Language file of the RoundCube Webmail client | + | Copyright (C) 2005, RoundCube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + +-----------------------------------------------------------------------+ + | Author: APaella <apaella@yahoo.it> | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$messages = array(); + +$messages['loginfailed'] = 'Login non riuscito'; + +$messages['cookiesdisabled'] = 'Il browser non accetta cookie'; + +$messages['sessionerror'] = 'La sessione è invalida o scaduta.'; + +$messages['imaperror'] = 'Connessione al server IMAP non riuscita'; + +$messages['nomessagesfound'] = 'Non ci sono messaggi in questa mailbox'; + +$messages['loggedout'] = 'Sessione chiusa correttamente. Arrivederci!'; + +$messages['mailboxempty'] = 'La mailbox è vuota'; + +$messages['loadingdata'] = 'Sto caricando i dati...'; + +$messages['messagesent'] = 'Messaggio spedito con successo'; + +$messages['successfullysaved'] = 'Salvato con successo'; + +$messages['addedsuccessfully'] = 'Contatto aggiunto con successo alla rubrica'; + +$messages['contactexists'] = 'Esiste già un contatto con questa email'; + +$messages['blockedimages'] = 'Per proteggere la privacy, le immagini remote in questo messaggio sono bloccate.'; + +$messages['encryptedmessage'] = 'Questo è un messaggio criptato e non può essere visualizzato. Mi dispiace!'; + +$messages['nocontactsfound'] = 'Nessun contatto trovato'; + +$messages['sendingfailed'] = 'spedizione del messaggio non riuscita'; + +$messages['errorsaving'] = 'Errore durante il salvataggio'; + + +?>
\ No newline at end of file diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 1848acf23..03f508be8 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -120,7 +120,7 @@ function rcmail_compose_headers($attrib) $header = 'to'; // we have contact id's as get parameters - if (strlen($_GET['_to']) && preg_match('/[0-9]+,?/', $_GET['_to'])) + if (!empty($_GET['_to']) && preg_match('/[0-9]+,?/', $_GET['_to'])) { $a_recipients = array(); $sql_result = $DB->query(sprintf("SELECT name, email @@ -138,7 +138,7 @@ function rcmail_compose_headers($attrib) if (sizeof($a_recipients)) $fvalue = join(', ', $a_recipients); } - else if (strlen($_GET['_to'])) + else if (!empty($_GET['_to'])) $fvalue = $_GET['_to']; case 'cc': @@ -165,7 +165,7 @@ function rcmail_compose_headers($attrib) } - if ($fname && $_POST[$fname]) + if ($fname && !empty($_POST[$fname])) $fvalue = $_POST[$fname]; else if ($header && is_object($REPLY_MESSAGE['headers'])) { @@ -282,7 +282,7 @@ function rcmail_compose_body($attrib) $body = ''; // use posted message body - if ($_POST['_message']) + if (!empty($_POST['_message'])) $body = stripslashes($_POST['_message']); // compose reply-body @@ -352,6 +352,34 @@ function rcmail_create_forward_body($body) $IMAP->decode_header($FORWARD_MESSAGE['headers']->from), $IMAP->decode_header($FORWARD_MESSAGE['headers']->to)); + // add attachments + if (!isset($_SESSION['compose']['forward_attachments']) && is_array($FORWARD_MESSAGE['parts']) && sizeof($FORWARD_MESSAGE['parts'])>1) + { + $temp_dir = rcmail_create_compose_tempdir(); + + if (!is_array($_SESSION['compose']['attachments'])) + $_SESSION['compose']['attachments'] = array(); + + foreach ($FORWARD_MESSAGE['parts'] as $part) + { + if ($part->disposition != 'attachment') + continue; + + $tmp_path = tempnam($temp_dir, 'rcmAttmnt'); + if ($fp = fopen($tmp_path, 'w')) + { + fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding'])); + fclose($fp); + + $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'], + 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, + 'path' => $tmp_path); + } + } + + $_SESSION['compose']['forward_attachments'] = TRUE; + } + return $prefix.$body; } @@ -370,7 +398,7 @@ function rcmail_compose_subject($attrib) $subject = ''; // use subject from post - if ($_POST['_subject']) + if (isset($_POST['_subject'])) $subject = stripslashes($_POST['_subject']); // create a reply-subject @@ -473,7 +501,7 @@ function rcmail_priority_selector($attrib) rcube_label('highest')), array(1, 2, 0, 4, 5)); - $sel = $_POST['_priority'] ? $_POST['_priority'] : 0; + $sel = isset($_POST['_priority']) ? $_POST['_priority'] : 0; $out = $form_start ? "$form_start\n" : ''; $out .= $selector->show($sel); @@ -493,13 +521,13 @@ function get_form_tags($attrib) $hiddenfields = new hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task'])); $hiddenfields->add(array('name' => '_action', 'value' => 'send')); - $form_start = !strlen($attrib['form']) ? '<form name="form" action="./" method="post">' : ''; + $form_start = empty($attrib['form']) ? '<form name="form" action="./" method="post">' : ''; $form_start .= "\n$SESS_HIDDEN_FIELD\n"; $form_start .= $hiddenfields->show(); } $form_end = (strlen($MESSAGE_FORM) && !strlen($attrib['form'])) ? '</form>' : ''; - $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form'; + $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form'; if (!strlen($MESSAGE_FORM)) $OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('messageform', '$form_name');"); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 78b61377b..6ffde1c90 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -58,6 +58,7 @@ function rcmail_mailbox_list($attrib) { global $IMAP, $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $COMM_PATH; static $s_added_script = FALSE; + static $a_mailboxes; $type = $attrib['type'] ? $attrib['type'] : 'ul'; $add_attrib = $type=='select' ? array('style', 'class', 'id', 'name', 'onchange') : @@ -77,37 +78,63 @@ function rcmail_mailbox_list($attrib) rcube_label($attrib['noselection'])); // get mailbox list - $a_folders = $IMAP->list_mailboxes(); $mbox = $IMAP->get_mailbox_name(); // for these mailboxes we have localized labels $special_mailboxes = array('inbox', 'sent', 'drafts', 'trash', 'junk'); + + // build the folders tree + if (empty($a_mailboxes)) + { + // get mailbox list + $a_folders = $IMAP->list_mailboxes(); + $delimiter = $IMAP->get_hierarchy_delimiter(); + $a_mailboxes = array(); + + foreach ($a_folders as $folder) + rcmail_build_folder_tree($a_mailboxes, $folder, $delimiter); + } + +// var_dump($a_mailboxes); + + if ($type=='select') + $out .= rcmail_render_folder_tree_select($a_mailboxes, $special_mailboxes, $mbox); + else + $out .= rcmail_render_folder_tree_html($a_mailboxes, $special_mailboxes, $mbox); + + +/* foreach ($a_folders as $i => $folder) { $zebra_class = $i%2 ? 'even' : 'odd'; - - $folder_lc = strtolower($folder); + $folder_prop = $a_subfolders[$folder]; + $foldername = isset($folder_prop) ? $folder_prop['name'] : $folder; + + $folder_lc = strtolower($foldername); if (in_array($folder_lc, $special_mailboxes)) $foldername = rcube_label($folder_lc); - else - $foldername = $folder; if ($unread_count = $IMAP->messagecount($folder, 'UNSEEN')) $foldername .= sprintf(' (%d)', $unread_count); - + + $indent = isset($folder_prop) ? sprintf(' indent%d', $folder_prop['level']) : ''; + $indent_str = isset($folder_prop) ? str_repeat(' ', (int)$folder_prop['level']) : ''; + // compose mailbox line if ($type=='select') - $out .= sprintf('<option value="%s">%s</option>'."\n", + $out .= sprintf('<option value="%s">%s%s</option>'."\n", $folder, + $indent_str, rep_specialchars_output($foldername)); else - $out .= sprintf('<li class="mailbox %s %s%s%s"><a href="#%s" onclick="return %s.command(\'list\',\'%s\')" onmouseup="return %s.mbox_mouse_up(\'%s\')">%s</a></li>'."\n", - preg_replace('/[^a-z0-9\-_]/', '', $folder_lc), + $out .= sprintf('<li class="mailbox %s %s%s%s%s"><a href="#%s" onclick="return %s.command(\'list\',\'%s\')" onmouseup="return %s.mbox_mouse_up(\'%s\')">%s</a></li>'."\n", + preg_replace('/[^a-z0-9\-_]/', '', strtolower($folder)), $zebra_class, $unread_count ? ' unread' : '', $folder==$mbox ? ' selected' : '', + $indent, $folder, $JS_OBJECT_NAME, $folder, @@ -115,6 +142,7 @@ function rcmail_mailbox_list($attrib) $folder, rep_specialchars_output($foldername)); } +*/ if ($type=='ul') $OUTPUT->add_script(sprintf("%s.gui_object('mailboxlist', '%s');", $JS_OBJECT_NAME, $attrib['id'])); @@ -132,6 +160,104 @@ function rcmail_mailbox_list($attrib) } + + +// create a hierarchical array of the mailbox list +function rcmail_build_folder_tree(&$arrFolders, $folder, $delm='/', $path='') + { + $pos = strpos($folder, $delm); + if ($pos !== false) + { + $subFolders = substr($folder, $pos+1); + $currentFolder = substr($folder, 0, $pos); + } + else + { + $subFolders = false; + $currentFolder = $folder; + } + + $path .= $currentFolder; + + if (!isset($arrFolders[$currentFolder])) + { + $arrFolders[$currentFolder] = array('id' => $path, + 'name' => $currentFolder, + 'folders' => array()); + } + + if (!empty($subFolders)) + rcmail_build_folder_tree($arrFolders[$currentFolder]['folders'], $subFolders, $delm, $path.$delm); + } + + +// return html for a structured list <ul> for the mailbox tree +function rcmail_render_folder_tree_html(&$arrFolders, &$special, &$mbox, $nestLevel = 0) + { + global $JS_OBJECT_NAME, $IMAP; + + $idx = 0; + $out = ''; + foreach ($arrFolders as $key => $folder) + { + $zebra_class = ($nestLevel*$idx)%2 ? 'even' : 'odd'; + + $folder_lc = strtolower($folder['id']); + if (in_array($folder_lc, $special)) + $foldername = rcube_label($folder_lc); + else + $foldername = $folder['name']; + + if ($unread_count = $IMAP->messagecount($folder['id'], 'UNSEEN')) + $foldername .= sprintf(' (%d)', $unread_count); + + $out .= sprintf('<li class="mailbox %s %s%s%s"><a href="#%s" onclick="return %s.command(\'list\',\'%s\')" onmouseup="return %s.mbox_mouse_up(\'%s\')">%s</a>'."\n", + preg_replace('/[^a-z0-9\-_]/', '', $folder_lc), + $zebra_class, + $unread_count ? ' unread' : '', + $folder['id']==$mbox ? ' selected' : '', + $folder['id'], + $JS_OBJECT_NAME, + $folder['id'], + $JS_OBJECT_NAME, + $folder['id'], + rep_specialchars_output($foldername)); + + if (!empty($folder['folders'])) + $out .= '<ul>' . rcmail_render_folder_tree_html($folder['folders'], $special, $mbox, $nestLevel+1) . "</ul>\n"; + + $out .= "</li>\n"; + $idx++; + } + + return $out; + } + + +// return html for a flat list <select> for the mailbox tree +function rcmail_render_folder_tree_select(&$arrFolders, &$special, &$mbox, $nestLevel=0) + { + global $IMAP; + + $idx = 0; + $out = ''; + foreach ($arrFolders as $key=>$folder) + { + $out .= sprintf('<option value="%s">%s%s</option>'."\n", + $folder['id'], + str_repeat(' ', $nestLevel*4), + rep_specialchars_output($folder['name'])); + + if (!empty($folder['folders'])) + $out .= rcmail_render_folder_tree_select($folder['folders'], $special, $mbox, $nestLevel+1); + + $idx++; + } + + return $out; + } + + // return the message list as HTML table function rcmail_message_list($attrib) { @@ -1078,6 +1204,27 @@ function rcmail_message_part_frame($attrib) } +// create temp dir for attachments +function rcmail_create_compose_tempdir() + { + global $CONFIG; + + if ($_SESSION['compose']['temp_dir']) + return $_SESSION['compose']['temp_dir']; + + if (!empty($CONFIG['temp_dir'])) + $temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '').$_SESSION['compose']['id']; + + // create temp-dir for uploaded attachments + if (!empty($CONFIG['temp_dir']) && is_writeable($CONFIG['temp_dir'])) + { + mkdir($temp_dir); + $_SESSION['compose']['temp_dir'] = $temp_dir; + } + + return $_SESSION['compose']['temp_dir']; + } + // clear message composing settings function rcmail_compose_cleanup() diff --git a/program/steps/mail/upload.inc b/program/steps/mail/upload.inc index 3ae88fad6..308ec796e 100644 --- a/program/steps/mail/upload.inc +++ b/program/steps/mail/upload.inc @@ -26,21 +26,13 @@ if (!$_SESSION['compose']) } -if (strlen($CONFIG['temp_dir'])) - $temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '').$_SESSION['compose']['id']; +// create temp dir for file uploads +$temp_dir = rcmail_create_compose_tempdir(); + if (!is_array($_SESSION['compose']['attachments'])) - { $_SESSION['compose']['attachments'] = array(); - // create temp-dir for uploaded attachments - if ($CONFIG['temp_dir'] && is_writeable($CONFIG['temp_dir'])) - { - mkdir($temp_dir); - $_SESSION['compose']['temp_dir'] = $temp_dir; - } - } - $response = ''; |