Changeset c3ab87b6 in github


Ignore:
Timestamp:
Oct 2, 2007 4:25:48 AM (6 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
9a3567a
Parents:
51e14a1
Message:

Better fix for messaage reloading after moving

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/steps/mail/move_del.inc

    r51e14a1 rc3ab87b6  
    2020*/ 
    2121 
    22 // count pages before changing anything 
     22// count messages before changing anything 
    2323$old_count = $IMAP->messagecount(); 
    24 $old_pages = ceil($old_count / $IMAP->page_size); 
    2524 
    2625// move messages 
     
    6665 
    6766 
     67$remaining = $old_count - $IMAP->page_size * $IMAP->list_page; 
     68 
     69// jump back one page (user removed the whole last page) 
     70if ($IMAP->list_page > 1 && $remaining <= 0) 
     71{ 
     72  $IMAP->set_page($IMAP->list_page-1); 
     73  $_SESSION['page'] = $IMAP->list_page; 
     74  $jump_back = true; 
     75} 
     76 
    6877// update message count display 
    6978$msg_count = $IMAP->messagecount(); 
    7079$pages = ceil($msg_count / $IMAP->page_size); 
    7180$OUTPUT->set_env('pagecount', $pages); 
     81$OUTPUT->set_env('current_page', $IMAP->list_page); 
    7282$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); 
    7383 
     
    8393 
    8494// add new rows from next page (if any) 
    85 if ($_POST['_from']!='show' && $old_pages>1 && $IMAP->list_page < $old_pages) 
     95if ($_POST['_from']!='show' && ($jump_back || $remaining > 0)) 
    8696{ 
    8797  $sort_col   = isset($_SESSION['sort_col'])   ? $_SESSION['sort_col']   : $CONFIG['message_sort_col']; 
     
    8999   
    90100  $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order); 
    91   $a_headers = array_slice($a_headers, -$count, $count); 
     101  if (!$jump_back) 
     102    $a_headers = array_slice($a_headers, -$count, $count); 
    92103 
    93104  rcmail_js_message_list($a_headers); 
Note: See TracChangeset for help on using the changeset viewer.