Ignore:
Timestamp:
08/04/11 17:54:22 (13 years ago)
Author:
thiagoaos
Message:

Ticket #2192 - Adicionado configuração para definir nome da pasta Trash.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/z-push/backend/imap.php

    r4898 r4903  
    567567                $lid = strtolower($id); 
    568568 
     569                $trash_folder_name = 'inbox.trash'; 
     570 
     571                if(defined("IMAP_TRASHFOLDER")) 
     572                        $trash_folder_name = strtolower(str_replace($this->_serverdelimiter, ".", IMAP_TRASHFOLDER)); 
     573 
     574                $sent_folder_name = 'inbox.sent'; 
     575 
     576                if(defined("IMAP_SENTFOLDER")) 
     577                        $sent_folder_name = strtolower(str_replace($this->_serverdelimiter, ".", IMAP_SENTFOLDER)); 
     578 
     579                $folder->parentid =  (($fhir && count($fhir) > 1) ? $fhir[(count($fhir) - 2)] : "0"); 
     580 
    569581                if($lid == "inbox") { 
    570582                        $folder->parentid = "0"; // Root 
     
    573585                } 
    574586                // Zarafa IMAP-Gateway outputs 
    575                 else if($lid == "drafts") { 
    576                         $folder->parentid = "0"; 
     587                else if($lid == "drafts" || $lid == "inbox.drafts" || $lid == "inbox.rascunhos") { 
    577588                        $folder->displayname = "Drafts"; 
    578589                        $folder->type = SYNC_FOLDER_TYPE_DRAFTS; 
    579590                } 
    580                 else if($lid == "trash") { 
    581                         $folder->parentid = "0"; 
    582                         $folder->displayname = "Trash"; 
     591                else if($lid == "trash" || $lid == $trash_folder_name) { 
     592                        $folder->displayname = (defined("IMAP_DISPLAYNAME_TRASHFOLDER") ? IMAP_DISPLAYNAME_TRASHFOLDER : "Trash"); 
    583593                        $folder->type = SYNC_FOLDER_TYPE_WASTEBASKET; 
    584594                        $this->_wasteID = $id; 
    585595                } 
    586                 else if($lid == "sent" || $lid == "sent items" || $lid == IMAP_SENTFOLDER) { 
    587                         $folder->parentid = "0"; 
    588                         $folder->displayname = "Sent"; 
     596                else if($lid == "sent" || $lid == "sent items" || $lid == $sent_folder_name) { 
     597                        $folder->displayname = (defined("IMAP_DISPLAYNAME_SENTFOLDER") ? IMAP_DISPLAYNAME_SENTFOLDER : "Sent"); 
    589598                        $folder->type = SYNC_FOLDER_TYPE_SENTMAIL; 
    590599                        $this->_sentID = $id; 
    591600                } 
    592                 // courier-imap outputs 
    593                 else if($lid == "inbox.drafts") { 
    594                         $folder->parentid = $fhir[0]; 
    595                         $folder->displayname = "Drafts"; 
    596                         $folder->type = SYNC_FOLDER_TYPE_DRAFTS; 
    597                 } 
    598                 else if($lid == "inbox.trash") { 
    599                         $folder->parentid = $fhir[0]; 
    600                         $folder->displayname = "Trash"; 
    601                         $folder->type = SYNC_FOLDER_TYPE_WASTEBASKET; 
    602                         $this->_wasteID = $id; 
    603                 } 
    604                 else if($lid == "inbox.sent") { 
    605                         $folder->parentid = $fhir[0]; 
    606                         $folder->displayname = "Sent"; 
    607                         $folder->type = SYNC_FOLDER_TYPE_SENTMAIL; 
    608                         $this->_sentID = $id; 
    609                 } 
    610  
    611601                // define the rest as other-folders 
    612602                else { 
Note: See TracChangeset for help on using the changeset viewer.