Changeset 5836 in subversion for branches/devel-framework/roundcubemail


Ignore:
Timestamp:
Jan 27, 2012 9:34:32 AM (16 months ago)
Author:
alec
Message:
  • Rename rcube_mail_header to rcube_message_header
  • Rename rcube_header_sorter to rcube_message_header_sorter
  • Put both classes into separate file
Location:
branches/devel-framework/roundcubemail/program
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-framework/roundcubemail/program/include/rcube_imap.php

    r5829 r5836  
    10441044        if ($sort) { 
    10451045            // use this class for message sorting 
    1046             $sorter = new rcube_header_sorter(); 
     1046            $sorter = new rcube_message_header_sorter(); 
    10471047            $sorter->set_index($msgs); 
    10481048            $sorter->sort_headers($a_msg_headers); 
     
    14941494     * @param bool    $force    True to skip cache 
    14951495     * 
    1496      * @return rcube_mail_header Message headers 
     1496     * @return rcube_message_header Message headers 
    14971497     */ 
    14981498    public function get_message_headers($uid, $folder = null, $force = false) 
     
    15251525     * @param string  $folder   Folder to read from 
    15261526     * 
    1527      * @return object rcube_mail_header Message data 
     1527     * @return object rcube_message_header Message data 
    15281528     */ 
    15291529    public function get_message($uid, $folder = null) 
  • branches/devel-framework/roundcubemail/program/include/rcube_imap_cache.php

    r5829 r5836  
    288288     * @param array  $msgs     Message UIDs 
    289289     * 
    290      * @return array The list of messages (rcube_mail_header) indexed by UID 
     290     * @return array The list of messages (rcube_message_header) indexed by UID 
    291291     */ 
    292292    function get_messages($mailbox, $msgs = array()) 
     
    346346     * @param bool   $no_cache Enables internal cache usage 
    347347     * 
    348      * @return rcube_mail_header Message data 
     348     * @return rcube_message_header Message data 
    349349     */ 
    350350    function get_message($mailbox, $uid, $update = true, $cache = true) 
     
    401401     * Saves the message in cache. 
    402402     * 
    403      * @param string            $mailbox  Folder name 
    404      * @param rcube_mail_header $message  Message data 
    405      * @param bool              $force    Skips message in-cache existance check 
     403     * @param string               $mailbox  Folder name 
     404     * @param rcube_message_header $message  Message data 
     405     * @param bool                 $force    Skips message in-cache existance check 
    406406     */ 
    407407    function add_message($mailbox, $message, $force = false) 
     
    10371037     * @param array $sql_arr Message row data 
    10381038     * 
    1039      * @return rcube_mail_header Message object 
     1039     * @return rcube_message_header Message object 
    10401040     */ 
    10411041    private function build_message($sql_arr) 
  • branches/devel-framework/roundcubemail/program/include/rcube_imap_generic.php

    r5834 r5836  
    2727*/ 
    2828 
    29 /** 
    30  * Struct representing an e-mail message header 
    31  * 
    32  * @package Mail 
    33  * @author  Aleksander Machniak <alec@alec.pl> 
    34  */ 
    35 class rcube_mail_header 
    36 { 
    37     public $id; 
    38     public $uid; 
    39     public $subject; 
    40     public $from; 
    41     public $to; 
    42     public $cc; 
    43     public $replyto; 
    44     public $in_reply_to; 
    45     public $date; 
    46     public $messageID; 
    47     public $size; 
    48     public $encoding; 
    49     public $charset; 
    50     public $ctype; 
    51     public $timestamp; 
    52     public $bodystructure; 
    53     public $internaldate; 
    54     public $references; 
    55     public $priority; 
    56     public $mdn_to; 
    57     public $others = array(); 
    58     public $flags = array(); 
    59 } 
     29// for backward copat. 
     30class rcube_mail_header extends rcube_message_header { } 
    6031 
    6132 
     
    20111982     * @param bool   $vanished    Enables VANISHED parameter (RFC5162) for CHANGEDSINCE query 
    20121983     * 
    2013      * @return array List of rcube_mail_header elements, False on error 
     1984     * @return array List of rcube_message_header elements, False on error 
    20141985     * @since 0.6 
    20151986     */ 
     
    20512022                $id = intval($m[1]); 
    20522023 
    2053                 $result[$id]            = new rcube_mail_header; 
     2024                $result[$id]            = new rcube_message_header; 
    20542025                $result[$id]->id        = $id; 
    20552026                $result[$id]->subject   = ''; 
  • branches/devel-framework/roundcubemail/program/include/rcube_storage.php

    r5835 r5836  
    424424     * @param string  $folder  Folder to read from 
    425425     * 
    426      * @return object rcube_mail_header Message data 
     426     * @return object rcube_message_header Message data 
    427427     */ 
    428428    abstract function get_message($uid, $folder = null); 
     
    436436     * @param bool    $force    True to skip cache 
    437437     * 
    438      * @return rcube_mail_header Message headers 
     438     * @return rcube_message_header Message headers 
    439439     */ 
    440440    abstract function get_message_headers($uid, $folder = null, $force = false); 
     
    969969    abstract function get_cache($key); 
    970970 
    971 }  // end class rcube_storage 
    972  
    973  
    974 /** 
    975  * Class for sorting an array of rcube_mail_header objects in a predetermined order. 
    976  * 
    977  * @package Mail 
    978  * @author Eric Stadtherr 
    979  */ 
    980 class rcube_header_sorter 
    981 { 
    982     private $uids = array(); 
    983  
    984  
    985     /** 
    986      * Set the predetermined sort order. 
    987      * 
    988      * @param array $index  Numerically indexed array of IMAP UIDs 
    989      */ 
    990     function set_index($index) 
    991     { 
    992         $index = array_flip($index); 
    993  
    994         $this->uids = $index; 
    995     } 
    996  
    997     /** 
    998      * Sort the array of header objects 
    999      * 
    1000      * @param array $headers Array of rcube_mail_header objects indexed by UID 
    1001      */ 
    1002     function sort_headers(&$headers) 
    1003     { 
    1004         uksort($headers, array($this, "compare_uids")); 
    1005     } 
    1006  
    1007     /** 
    1008      * Sort method called by uksort() 
    1009      * 
    1010      * @param int $a Array key (UID) 
    1011      * @param int $b Array key (UID) 
    1012      */ 
    1013     function compare_uids($a, $b) 
    1014     { 
    1015         // then find each sequence number in my ordered list 
    1016         $posa = isset($this->uids[$a]) ? intval($this->uids[$a]) : -1; 
    1017         $posb = isset($this->uids[$b]) ? intval($this->uids[$b]) : -1; 
    1018  
    1019         // return the relative position as the comparison value 
    1020         return $posa - $posb; 
    1021     } 
    1022971} 
  • branches/devel-framework/roundcubemail/program/steps/mail/func.inc

    r5759 r5836  
    226226  $a_show_cols = array_unique($a_show_cols); 
    227227 
    228   // Plugins may set header's list_cols/list_flags and other rcube_mail_header variables 
     228  // Plugins may set header's list_cols/list_flags and other rcube_message_header variables 
    229229  // and list columns 
    230230  $plugin = $RCMAIL->plugins->exec_hook('messages_list', 
Note: See TracChangeset for help on using the changeset viewer.