Changeset 3692 in subversion


Ignore:
Timestamp:
Jun 1, 2010 7:35:35 AM (3 years ago)
Author:
alec
Message:
Location:
trunk/roundcubemail
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r3687 r3692  
    22=========================== 
    33 
     4- Add 'messages_list' hook (#1486266) 
    45- Add request* event triggers in http_post/http_request (#1486054) 
    56- Fix use RFC-compliant line-delimiter when saving messages on IMAP (#1486712) 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r3688 r3692  
    228228function rcmail_js_message_list($a_headers, $insert_top=FALSE, $head_replace=FALSE) 
    229229{ 
    230   global $CONFIG, $IMAP, $OUTPUT; 
     230  global $CONFIG, $IMAP, $RCMAIL, $OUTPUT; 
    231231 
    232232  if (!empty($_SESSION['list_attrib']['columns'])) 
     
    246246  if (!in_array('threads', $a_show_cols)) 
    247247    array_unshift($a_show_cols, 'threads'); 
     248 
     249  // Plugins may set header's list_cols/list_flags and other rcube_mail_header variables 
     250  // and list columns 
     251  $plugin = $RCMAIL->plugins->exec_hook('messages_list', 
     252    array('messages' => $a_headers, 'cols' => $a_show_cols)); 
     253 
     254  $a_show_cols = $plugin['cols']; 
     255  $a_headers   = $plugin['messages']; 
    248256 
    249257  $thead = $head_replace ? rcmail_message_list_head($_SESSION['list_attrib'], $a_show_cols) : NULL; 
     
    261269  if (($key = array_search('threads', $a_show_cols)) !== FALSE) 
    262270    unset($a_show_cols[$key]); 
    263  
    264271  // loop through message headers 
     272 
    265273  foreach ($a_headers as $n => $header) 
    266274    { 
     275    if (empty($header)) 
     276      continue; 
     277 
    267278    $a_msg_cols = array(); 
    268279    $a_msg_flags = array(); 
    269  
    270     if (empty($header)) 
    271       continue; 
    272280 
    273281    $IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']); 
     
    318326    $a_msg_flags['mbox'] = $mbox; 
    319327 
     328    // merge with plugin result 
     329    if (!empty($header->list_flags) && is_array($header->list_flags)) 
     330      $a_msg_flags = array_merge($a_msg_flags, $header->list_flags); 
     331    if (!empty($header->list_cols) && is_array($header->list_cols)) 
     332      $a_msg_cols = array_merge($a_msg_cols, $header->list_cols); 
     333 
    320334    $OUTPUT->command('add_message_row', 
    321335      $header->uid, 
     
    325339    } 
    326340 
    327     if ($IMAP->threading && $a_headers) { 
     341    if ($IMAP->threading) { 
    328342      $OUTPUT->command('init_threads', (array) $roots); 
    329343    } 
Note: See TracChangeset for help on using the changeset viewer.