Changeset 5900
- Timestamp:
- 04/09/12 17:21:34 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r5864 r5900 3197 3197 function messages_sort($sort_box_type,$sort_box_reverse, $search_box_type,$offsetBegin,$offsetEnd,$folder) 3198 3198 { 3199 $sort = array(); 3199 3200 if ($sort_box_type != "SORTFROM" && $search_box_type!= "FLAGGED"){ 3200 3201 $imapsort = imap_sort($this->mbox,constant($sort_box_type),$sort_box_reverse,SE_UID,$search_box_type); 3201 foreach($imapsort as $iuid) 3202 $sort[$iuid] = "";3203 3202 foreach($imapsort as $iuid){ 3203 $sort[$iuid] = $iuid; 3204 } 3204 3205 if ($offsetBegin == -1 && $offsetEnd ==-1 ) 3205 3206 $slice_array = false; … … 3209 3210 else 3210 3211 { 3211 $sort = array();3212 3212 if ($offsetBegin > $offsetEnd) {$temp=$offsetEnd; $offsetEnd=$offsetBegin; $offsetBegin=$temp;} 3213 3213 $num_msgs = imap_num_msg($this->mbox); 3214 3214 if ($offsetEnd > $num_msgs) {$offsetEnd = $num_msgs;} 3215 3215 $slice_array = true; 3216 $from_to_sent = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent']; 3216 $from_to_sent = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent']; 3217 $dates = array(); 3217 3218 for ($i=$num_msgs; $i>0; $i--) 3218 3219 { … … 3221 3222 $iuid = @imap_uid($this->mbox,$i); 3222 3223 $header = $this->get_header($iuid); 3224 3223 3225 // List UNSEEN messages. 3224 3226 if($search_box_type == "UNSEEN" && (!trim($header->Recent) && !trim($header->Unseen))){ … … 3254 3256 $sort[$iuid] = $header->udate; 3255 3257 } 3256 3257 } 3258 natcasesort($sort); 3259 3258 $dates[$iuid] = $header->udate; 3259 } 3260 $keys = array_keys($sort); 3261 array_multisort($sort, SORT_ASC, $keys, SORT_DESC, $dates, SORT_DESC); 3262 $sort = array_combine($keys, $sort); 3260 3263 if ($sort_box_reverse) 3261 3264 $sort = array_reverse($sort,true); … … 3264 3267 $sort = array(); 3265 3268 } 3266 3267 3268 3269 3270 3269 if ($slice_array) 3271 3270 $sort = array_slice($sort,$offsetBegin-1,$offsetEnd-($offsetBegin-1),true); 3272 3273 3274 3271 return $sort; 3275 3272
Note: See TracChangeset
for help on using the changeset viewer.