Changeset 2078 in subversion
- Timestamp:
- Nov 23, 2008 7:25:15 AM (4 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 6 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/main.inc (modified) (1 diff)
-
program/js/app.js (modified) (5 diffs)
-
program/steps/mail/func.inc (modified) (7 diffs)
-
skins/default/templates/mail.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r2076 r2078 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2008/11/23 (alec) 5 ---------- 6 - Allow setting attachment col position in 'list_cols' option 7 - Allow override 'list_cols' via skin (#1485577) 3 8 4 9 2008/11/21 (alec) -
trunk/roundcubemail/config/main.inc.php.dist
r2013 r2078 111 111 $rcmail_config['sendmail_delay'] = 0; 112 112 113 // These cols are shown in the message list 114 // available cols are: subject, from, to, cc, replyto, date, size, encoding, flag115 $rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size', 'flag' );113 // These cols are shown in the message list. Available cols are: 114 // subject, from, to, cc, replyto, date, size, encoding, flag, attachment 115 $rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size', 'flag', 'attachment'); 116 116 117 117 // Includes should be interpreted as PHP files -
trunk/roundcubemail/program/include/main.inc
r2041 r2078 662 662 { 663 663 $attrib = array(); 664 preg_match_all('/\s*([-_a-z]+)=(["\'])??(?(2)([^\2] +)\2|(\S+?))/Ui', stripslashes($str), $regs, PREG_SET_ORDER);664 preg_match_all('/\s*([-_a-z]+)=(["\'])??(?(2)([^\2]*)\2|(\S+?))/Ui', stripslashes($str), $regs, PREG_SET_ORDER); 665 665 666 666 // convert attributes to an associative array (name => value) -
trunk/roundcubemail/program/js/app.js
r2049 r2078 566 566 var sort_order = a_sort[1] ? a_sort[1].toUpperCase() : null; 567 567 var header; 568 568 569 569 // no sort order specified: toggle 570 570 if (sort_order==null) … … 580 580 581 581 // set table header class 582 if (header = document.getElementById('rcm Head'+this.env.sort_col))582 if (header = document.getElementById('rcm'+this.env.sort_col)) 583 583 this.set_classname(header, 'sorted'+(this.env.sort_order.toUpperCase()), false); 584 if (header = document.getElementById('rcm Head'+sort_col))584 if (header = document.getElementById('rcm'+sort_col)) 585 585 this.set_classname(header, 'sorted'+sort_order, true); 586 586 … … 3428 3428 cell.innerHTML = this.get_label(this.coltypes[n]); 3429 3429 3430 cell.id = 'rcm Head'+col;3430 cell.id = 'rcm'+col; 3431 3431 } 3432 3432 else if (col == 'subject' && this.message_list) … … 3499 3499 else if(this.env.unflaggedicon) 3500 3500 col.innerHTML = '<img src="'+this.env.unflaggedicon+'" alt="" />'; 3501 } 3501 } 3502 else if (c=='attachment') 3503 col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : ''; 3502 3504 else 3503 3505 col.innerHTML = cols[c]; … … 3505 3507 row.appendChild(col); 3506 3508 } 3507 3508 col = document.createElement('TD');3509 col.className = 'icon';3510 col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : '';3511 row.appendChild(col);3512 3509 3513 3510 this.message_list.insert_row(row, attop); -
trunk/roundcubemail/program/steps/mail/func.inc
r2068 r2078 115 115 $out = '<table' . $attrib_str . ">\n"; 116 116 117 // define list of cols to be displayed 118 $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 117 // define list of cols to be displayed based on parameter or config 118 if (empty($attrib['columns'])) 119 $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 120 else 121 $a_show_cols = explode(',', strip_quotes($attrib['columns'])); 122 123 // store column list in a session-variable 124 $_SESSION['list_columns'] = $a_show_cols; 125 126 // define sortable columns 119 127 $a_sort_cols = array('subject', 'date', 'from', 'to', 'size'); 120 128 … … 131 139 132 140 foreach ($a_show_cols as $col) 133 $out .= sprintf('<col class="%s" />', $col); 134 135 $out .= '<col class="icon" />'; 141 $out .= ($col!='attachment') ? sprintf('<col class="%s" />', $col) : '<col class="icon" />'; 142 136 143 $out .= "</colgroup>\n"; 137 144 … … 143 150 { 144 151 // get column name 145 $col_name = $col != 'flag' ? Q(rcube_label($col)) : sprintf($image_tag, $skin_path, $attrib['unflaggedicon'], ''); 152 switch ($col) 153 { 154 case 'flag': 155 $col_name = sprintf($image_tag, $skin_path, $attrib['unflaggedicon'], ''); 156 break; 157 case 'attachment': 158 $col_name = sprintf($image_tag, $skin_path, $attrib['attachmenticon'], ''); 159 break; 160 default: 161 $col_name = Q(rcube_label($col)); 162 } 146 163 147 164 // make sort links … … 191 208 192 209 // put it all together 193 $out .= '<td class="'.$col.$sort_class.'" id="rcmHead'.$col.'">' . "$col_name$sort</td>\n"; 194 } 195 196 $out .= '<td class="icon">'.($attrib['attachmenticon'] ? sprintf($image_tag, $skin_path, $attrib['attachmenticon'], '') : ' ')."</td>\n"; 210 if ($col!='attachment') 211 $out .= '<td class="'.$col.$sort_class.'" id="rcm'.$col.'">' . "$col_name$sort</td>\n"; 212 else 213 $out .= '<td class="icon" id="rcm'.$col.'">' . "$col_name$sort</td>\n"; 214 } 215 197 216 $out .= "</tr></thead>\n<tbody>\n"; 198 217 … … 284 303 $cont = Q($header->$col); 285 304 286 $out .= '<td class="'.$col.'">' . $cont . "</td>\n"; 287 } 288 289 $out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : ''); 305 if ($col!='attachment') 306 $out .= '<td class="'.$col.'">' . $cont . "</td>\n"; 307 else 308 $out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : ''); 309 } 310 290 311 $out .= "</tr>\n"; 291 312 … … 343 364 global $CONFIG, $IMAP, $OUTPUT; 344 365 345 $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 366 if (empty($_SESSION['list_columns'])) 367 $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 368 else 369 $a_show_cols = $_SESSION['list_columns']; 370 346 371 $mbox = $IMAP->get_mailbox_name(); 347 372 … … 364 389 if (!empty($header->charset)) 365 390 $IMAP->set_charset($header->charset); 391 392 // remove 'attachment' and 'flag' columns, we don't need them here 393 if(($key = array_search('attachment', $a_show_cols)) !== FALSE) 394 unset($a_show_cols[$key]); 395 if(($key = array_search('flag', $a_show_cols)) !== FALSE) 396 unset($a_show_cols[$key]); 366 397 367 398 // format each col; similar as in rcmail_message_list() -
trunk/roundcubemail/skins/default/templates/mail.html
r2049 r2078 47 47 id="messagelist" 48 48 cellspacing="0" 49 columns="" 49 50 summary="Message list" 50 51 messageIcon="/images/icons/dot.png"
Note: See TracChangeset
for help on using the changeset viewer.
