Changeset 6f4e7db in github


Ignore:
Timestamp:
May 22, 2010 2:47:27 PM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
5183767
Parents:
87a8685
Message:
  • Added list_mailboxes hook in rcube_imap::list_unsubscribed() (#1486668)
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r87a8685 r6f4e7db  
    22=========================== 
    33 
     4- Added list_mailboxes hook in rcube_imap::list_unsubscribed() (#1486668) 
    45- Fix wrong message on file upload error (#1486725) 
    56- Add support for data URI scheme [RFC2397] (#1486740) 
  • program/include/rcube_imap.php

    r9d5c834 r6f4e7db  
    25132513 
    25142514    /** 
    2515      * Public method for mailbox listing. 
     2515     * Public method for listing subscribed folders 
    25162516     * 
    25172517     * Converts mailbox name with root dir first 
     
    25532553    private function _list_mailboxes($root='', $filter='*') 
    25542554    { 
    2555         $a_defaults = $a_out = array(); 
    2556  
    25572555        // get cached folder list 
    25582556        $a_mboxes = $this->get_cache('mailboxes'); 
     
    25602558            return $a_mboxes; 
    25612559 
     2560        $a_defaults = $a_out = array(); 
     2561 
    25622562        // Give plugins a chance to provide a list of mailboxes 
    25632563        $data = rcmail::get_instance()->plugins->exec_hook('list_mailboxes', 
    2564             array('root'=>$root,'filter'=>$filter)); 
     2564            array('root' => $root, 'filter' => $filter, 'mode' => 'LSUB')); 
    25652565 
    25662566        if (isset($data['folders'])) { 
     
    25862586     * 
    25872587     * @param string IMAP root dir 
     2588     * @param string Optional filter for mailbox listing 
    25882589     * @return array Indexed array with folder names 
    25892590     */ 
    2590     function list_unsubscribed($root='') 
    2591     { 
    2592         static $a_folders; 
    2593  
    2594         if (is_array($a_folders)) 
    2595             return $a_folders; 
    2596  
    2597         // retrieve list of folders from IMAP server 
    2598         $a_mboxes = $this->conn->listMailboxes($this->mod_mailbox($root), '*'); 
     2591    function list_unsubscribed($root='', $filter='*') 
     2592    { 
     2593        // Give plugins a chance to provide a list of mailboxes 
     2594        $data = rcmail::get_instance()->plugins->exec_hook('list_mailboxes', 
     2595            array('root' => $root, 'filter' => $filter, 'mode' => 'LIST')); 
     2596 
     2597        if (isset($data['folders'])) { 
     2598            $a_mboxes = $data['folders']; 
     2599        } 
     2600        else { 
     2601            // retrieve list of folders from IMAP server 
     2602            $a_mboxes = $this->conn->listMailboxes($this->mod_mailbox($root), $filter); 
     2603        } 
     2604         
     2605        $a_folders = array(); 
     2606        if (!is_array($a_mboxes)) 
     2607            $a_mboxes = array(); 
    25992608 
    26002609        // modify names with root dir 
Note: See TracChangeset for help on using the changeset viewer.