Ticket #1295420: roundcubemail.patch
| File roundcubemail.patch, 10.9 KB (added by moc, 6 years ago) |
|---|
-
program/include/main.inc
diff -urNw -U 2 program/include/main.inc program/include/main.inc
1322 1322 'mailboxlist' => 'rcmail_mailbox_list', 1323 1323 'message' => 'rcmail_message_container', 1324 'messagesheaders' => 'rcmail_message_list_headers', 1324 1325 'messages' => 'rcmail_message_list', 1325 1326 'messagecountdisplay' => 'rcmail_messagecount_display', -
program/js/app.js
diff -urNw -U 2 program/js/app.js program/js/app.js
2991 2991 // set correct list titles 2992 2992 var cell, col; 2993 var thead = this.gui_objects.messagelist ? this.gui_objects.messagelist.tHead : null;2993 var thead = this.gui_objects.messagelistheaders ? this.gui_objects.messagelistheaders.tHead : null; 2994 2994 for (var n=0; thead && n<this.coltypes.length; n++) 2995 2995 { -
program/steps/mail/func.inc
diff -urNw -U 2 program/steps/mail/func.inc program/steps/mail/func.inc
290 290 291 291 292 // return the message list as HTML table293 function rcmail_message_list ($attrib)292 // return the message list headers as HTML table 293 function rcmail_message_list_headers($attrib) 294 294 { 295 295 global $IMAP, $CONFIG, $COMM_PATH, $OUTPUT, $JS_OBJECT_NAME; … … 305 305 rcube_add_label('from', 'to'); 306 306 307 // get message headers308 $a_headers = $IMAP->list_headers('', '', $sort_col, $sort_order);309 310 307 // add id to message list table if not specified 311 308 if (!strlen($attrib['id'])) 312 $attrib['id'] = 'rcubemessagelist ';309 $attrib['id'] = 'rcubemessagelistheaders'; 313 310 314 311 // allow the following attributes to be added to the <table> tag … … 327 324 $a_show_cols[$f] = 'to'; 328 325 329 // add col definition330 $out .= '<colgroup>';331 $out .= '<col class="icon" />';332 333 foreach ($a_show_cols as $col)334 $out .= sprintf('<col class="%s" />', $col);335 336 $out .= '<col class="icon" />';337 $out .= "</colgroup>\n";338 339 326 // add table title 340 327 $out .= "<thead><tr>\n<td class=\"icon\"> </td>\n"; 341 328 342 $javascript = '';343 329 foreach ($a_show_cols as $col) 344 330 { … … 350 336 if ($IMAP->get_capability('sort') && in_array($col, $a_sort_cols)) 351 337 { 338 write_log('list_messages', 'Sort capabilities'); 339 352 340 // have buttons configured 353 341 if (!empty($attrib['sortdescbutton']) || !empty($attrib['sortascbutton'])) … … 393 381 394 382 $out .= '<td class="icon">'.($attrib['attachmenticon'] ? sprintf($image_tag, $skin_path, $attrib['attachmenticon'], '') : '')."</td>\n"; 395 $out .= "</tr></thead>\n< tbody>\n";383 $out .= "</tr></thead>\n</table>\n"; 396 384 385 // set client env 386 $javascript = ''; 387 $javascript .= sprintf("%s.gui_object('mailheaders', '%s');\n", $JS_OBJECT_NAME, 'mailheaders'); 388 $javascript .= sprintf("%s.gui_object('messagelistheaders', '%s');\n", $JS_OBJECT_NAME, $attrib['id']); 389 $javascript .= sprintf("%s.set_env('sort_col', '%s');\n", $JS_OBJECT_NAME, $sort_col); 390 $javascript .= sprintf("%s.set_env('sort_order', '%s');\n", $JS_OBJECT_NAME, $sort_order); 391 392 $OUTPUT->add_script($javascript); 393 394 return $out; 395 } 396 397 398 399 // return the message list as HTML table 400 function rcmail_message_list($attrib) 401 { 402 global $IMAP, $CONFIG, $COMM_PATH, $OUTPUT, $JS_OBJECT_NAME; 403 404 $skin_path = $CONFIG['skin_path']; 405 $image_tag = '<img src="%s%s" alt="%s" border="0" />'; 406 407 // check to see if we have some settings for sorting 408 $sort_col = $_SESSION['sort_col']; 409 $sort_order = $_SESSION['sort_order']; 410 411 // add some labels to client 412 rcube_add_label('from', 'to'); 413 414 // get message headers 415 $a_headers = $IMAP->list_headers('', '', $sort_col, $sort_order); 416 417 write_log('list_messages', $a_headers); 418 419 // add id to message list table if not specified 420 if (!strlen($attrib['id'])) 421 $attrib['id'] = 'rcubemessagelist'; 422 423 // allow the following attributes to be added to the <table> tag 424 $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); 425 426 $out = '<table ' . $attrib_str . ">\n"; 427 428 // define list of cols to be displayed 429 $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 430 $a_sort_cols = array('subject', 'date', 'from', 'to', 'size'); 431 432 // show 'to' instead of from in sent messages 433 if (($IMAP->get_mailbox_name()==$CONFIG['sent_mbox'] || $IMAP->get_mailbox_name()==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols)) 434 && !array_search('to', $a_show_cols)) 435 $a_show_cols[$f] = 'to'; 436 437 // add col definition 438 $out .= '<colgroup>'; 439 $out .= '<col class="icon" />'; 440 441 foreach ($a_show_cols as $col) 442 $out .= sprintf('<col class="%s" />', $col); 443 444 $out .= '<col class="icon" />'; 445 $out .= "</colgroup>\n"; 446 447 // add table title 448 $out .= "<thead><tr>\n<td class=\"icon\"></td>\n"; 449 450 foreach ($a_show_cols as $col) 451 { 452 // put it all together 453 $out .= '<td class="'.$col.'" id="rcmHead'.$col.'">' . "</td>\n"; 454 } 455 456 $out .= '<td class="icon">'."</td>\n"; 457 $out .= "</tr></thead>\n"; 458 459 $out .= "<tbody>\n"; 397 460 // no messages in this mailbox 398 461 if (!sizeof($a_headers)) … … 446 509 { 447 510 if ($col=='from' || $col=='to') 511 { 448 512 $cont = Q(rcmail_address_string($header->$col, 3, $attrib['addicon']), 'show'); 513 if (!$cont) $cont = ' '; 514 } 449 515 else if ($col=='subject') 450 516 { … … 457 523 $cont = show_bytes($header->$col); 458 524 else if ($col=='date') 525 { 459 526 $cont = format_date($header->date); //date('m.d.Y G:i:s', strtotime($header->date)); 527 if (!$cont) $cont = ' '; 528 } 460 529 else 461 530 $cont = Q($header->$col); … … 464 533 } 465 534 466 $out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : ' ');535 $out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : ' '); 467 536 $out .= "</tr>\n"; 468 537 … … 478 547 479 548 // set client env 549 $javascript = ''; 480 550 $javascript .= sprintf("%s.gui_object('mailcontframe', '%s');\n", $JS_OBJECT_NAME, 'mailcontframe'); 481 551 $javascript .= sprintf("%s.gui_object('messagelist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']); … … 483 553 $javascript .= sprintf("%s.set_env('current_page', %d);\n", $JS_OBJECT_NAME, $IMAP->list_page); 484 554 $javascript .= sprintf("%s.set_env('pagecount', %d);\n", $JS_OBJECT_NAME, ceil($message_count/$IMAP->page_size)); 485 $javascript .= sprintf("%s.set_env('sort_col', '%s');\n", $JS_OBJECT_NAME, $sort_col);486 $javascript .= sprintf("%s.set_env('sort_order', '%s');\n", $JS_OBJECT_NAME, $sort_order);487 555 488 556 if ($attrib['messageicon']) … … 1445 1513 $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'cellspacing', 'cellpadding', 'border', 'summary')); 1446 1514 $out = '<table '. $attrib_str . ">\n"; 1515 1516 $filename = $part->d_parameters['filename'] ? $part->d_parameters['filename'] : $part->ctype_parameters['name']; 1517 $filesize = $part->size; 1447 1518 1448 1519 if ($filename) -
skins/default/mail.css
diff -urNw -U 2 skins/default/mail.css skins/default/mail.css
106 106 } 107 107 108 #mail contframe108 #mailheaders 109 109 { 110 110 position: absolute; … … 112 112 left: 200px; 113 113 right: 40px; 114 border: 1px solid #999999; 115 background-color: #F9F9F9; 116 overflow: visible; 117 /* css hack for IE */ 118 width: expression((parseInt(document.documentElement.clientWidth)-240)+'px'); 119 min-width:540px; 120 height: 22px; 121 } 122 123 #mailcontframe 124 { 125 position: absolute; 126 top: 105px; 127 left: 200px; 128 right: 40px; 114 129 bottom: 40px; 115 130 border: 1px solid #999999; … … 118 133 /* css hack for IE */ 119 134 width: expression((parseInt(document.documentElement.clientWidth)-240)+'px'); 120 height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); 135 height: expression((parseInt(document.documentElement.clientHeight)-145)+'px'); 136 min-width:540px; 121 137 } 122 138 … … 369 385 } 370 386 387 #messagelistheaders 388 { 389 display: table; 390 table-layout: fixed; 391 width: 100%; 392 /* css hack for IE */ 393 width: expression(document.getElementById('mailheaders').clientWidth); 394 } 395 371 396 #messagelist 372 397 { … … 378 403 } 379 404 380 #messagelist thead tr td405 #messagelistheaders thead tr td 381 406 { 382 407 height: 20px; … … 392 417 font-size: 11px; 393 418 font-weight: bold; 419 white-space: nowrap; 394 420 } 395 421 396 #messagelist thead tr td.sortedASC, 397 #messagelist thead tr td.sortedDESC 422 #messagelist thead, #messagelist thead tr, #messagelist thead tr td 423 { 424 height:1px; 425 visible:hidden; 426 } 427 428 #messagelistheaders thead tr td.sortedASC, 429 #messagelistheaders thead tr td.sortedDESC 398 430 { 399 431 background-image: url(images/listheader_dark.gif); 400 432 } 401 433 402 #messagelist thead tr td.sortedASC a434 #messagelistheaders thead tr td.sortedASC a 403 435 { 404 436 background: url(images/sort_asc.gif) top right no-repeat; 405 437 } 406 438 407 #messagelist thead tr td.sortedDESC a439 #messagelistheaders thead tr td.sortedDESC a 408 440 { 409 441 background: url(images/sort_desc.gif) top right no-repeat; 410 442 } 411 443 412 #messagelist thead tr td a,413 #messagelist thead tr td a:hover444 #messagelistheaders thead tr td a, 445 #messagelistheaders thead tr td a:hover 414 446 { 415 447 display: block; … … 418 450 color: #333333; 419 451 text-decoration: none; 452 white-space: nowrap; 453 } 454 455 #messagelist tbody tr td a, 456 #messagelist tbody tr td a:hover 457 { 458 white-space: nowrap; 420 459 } 421 460 … … 423 462 { 424 463 height: 16px; 425 padding: 2px; 426 padding-right: 4px; 464 padding: 2px 4px 2px 2px; 427 465 font-size: 11px; 428 466 overflow: hidden; … … 440 478 } 441 479 442 #messagelist tr td.icon 480 #messagelist tr td.icon, #messagelistheaders tr td.icon 443 481 { 444 482 width: 16px; … … 446 484 } 447 485 448 #messagelist tr td.subject 486 #messagelist tr td.subject, #messagelistheaders tr td.subject 449 487 { 450 488 overflow: hidden; 451 489 vertical-align: middle; 490 width: 60%; 452 491 } 453 492 454 #messagelist tr td.size 493 #messagelist tr td.size, #messagelistheaders tr td.size 455 494 { 456 width: 60px;495 width: 80px; 457 496 text-align: right; 458 497 vertical-align: middle; … … 462 501 #messagelist tr td.to 463 502 { 464 width: 180px; 503 width: 40%; 504 vertical-align: middle; 505 } 506 507 #messagelistheaders tr td.from, 508 #messagelistheaders tr td.to 509 { 510 width: 40%; 465 511 vertical-align: middle; 466 512 } 467 513 468 #messagelist tr td.date 514 #messagelist tr td.date, #messagelistheaders tr td.date 469 515 { 470 516 width: 118px; -
skins/default/templates/mail.html
diff -urNw -U 2 skins/default/templates/mail.html skins/default/templates/mail.html
43 43 </div> 44 44 45 45 <div id="mailheaders"> 46 <roundcube:object name="messagesheaders" 47 id="messagelistheaders" 48 cellspacing="0" 49 summary="Message list headers" 50 attachmentIcon="/images/icons/attachment.png" /> 51 </div> 46 52 <div id="mailcontframe"> 47 53 <roundcube:object name="messages"
