From f94e442469deca30b39f3fa08aade83cbd0ede70 Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Fri, 16 Dec 2011 13:38:59 -0500 Subject: [PATCH] Add more classes and options to HTML elements for better styleability --- program/steps/mail/func.inc | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 5f36da9..d44e9c3 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -379,6 +379,8 @@ // make sort links if (in_array($col, $a_sort_cols)) $col_name = html::a(array('href'=>"./#sort", 'onclick' => 'return '.JS_OBJECT_NAME.".command('sort','".$col."',this)", 'title' => rcube_label('sortby')), $col_name); + else if ($col_name[0] != '<') + $col_name = '<span class="' . $col .'">' . $col_name . '</span>'; $sort_class = $col == $sort_col ? " sorted$sort_order" : ''; $class_name = $col.$sort_class; @@ -890,6 +892,7 @@ // show these headers $standard_headers = array('subject', 'from', 'to', 'cc', 'bcc', 'replyto', 'mail-reply-to', 'mail-followup-to', 'date'); + $exclude_headers = $attrib['exclude'] ? explode(',', $attrib['exclude']) : array(); $output_headers = array(); foreach ($standard_headers as $hkey) { @@ -898,6 +901,9 @@ else if ($headers['others'][$hkey]) $value = $headers['others'][$hkey]; else + continue; + + if (in_array($hkey, $exclude_headers)) continue; if ($hkey == 'date') { @@ -937,7 +943,11 @@ } $plugin = $RCMAIL->plugins->exec_hook('message_headers_output', - array('output' => $output_headers, 'headers' => $MESSAGE->headers)); + array('output' => $output_headers, 'headers' => $MESSAGE->headers, 'exclude' => $exclude_headers)); + + // single header value is requested + if (!empty($attrib['valueof'])) + return Q($plugin['output'][$attrib['valueof']]['value'], ($hkey == 'subject' ? 'strict' : 'show')); // compose html table $table = new html_table(array('cols' => 2)); @@ -1062,6 +1072,11 @@ // list images after mail body if ($CONFIG['inline_images'] && !empty($MESSAGE->attachments)) { foreach ($MESSAGE->attachments as $attach_prop) { + // skip inline images + if ($attach_prop->content_id && $attach_prop->disposition == 'inline') { + continue; + } + // Content-Type: image/*... if (preg_match('/^image\//i', $attach_prop->mimetype) || // ...or known file extension: many clients are using application/octet-stream -- Gitblit v1.9.1