summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-11-17 17:01:37 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-11-17 17:01:37 +0100
commitd20e965c48565fecff9562155951cd89c0c8a4e3 (patch)
tree636a0cd26a63798419a3b2bcebcdcf3216302d87 /program
parent8fb4f05725b90bee03aaf284adb21818789a15c0 (diff)
Improve thumbnail display: center images and display a 'show' link for attachments the browser is capable to display them
Diffstat (limited to 'program')
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/steps/mail/func.inc4
2 files changed, 4 insertions, 1 deletions
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 4dbe9f9a1..44a5a3d99 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -63,6 +63,7 @@ $labels['copy'] = 'Copy';
$labels['move'] = 'Move';
$labels['moveto'] = 'Move to...';
$labels['download'] = 'Download';
+$labels['showattachment'] = 'Show';
$labels['filename'] = 'File name';
$labels['filesize'] = 'File size';
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index df83b03a8..dc97d1fce 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1189,6 +1189,7 @@ function rcmail_message_body($attrib)
// list images after mail body
if ($RCMAIL->config->get('inline_images', true) && !empty($MESSAGE->attachments)) {
$thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240);
+ $client_mimetypes = (array)$RCMAIL->config->get('client_mimetypes');
foreach ($MESSAGE->attachments as $attach_prop) {
// skip inline images
@@ -1209,7 +1210,7 @@ function rcmail_message_body($attrib)
rcmail_fix_mimetype($attach_prop->mimetype))
);
$out .= html::p('image-attachment',
- html::a($show_link + array('class' => 'image-link'),
+ html::a($show_link + array('class' => 'image-link', 'style' => sprintf('width:%dpx', $thumbnail_size)),
html::img(array(
'class' => 'image-thumbnail',
'src' => $MESSAGE->get_part_url($attach_prop->mime_id, true) . '&_thumb=1',
@@ -1221,6 +1222,7 @@ function rcmail_message_body($attrib)
html::span('image-filename', Q($attach_prop->filename)) .
html::span('image-filesize', Q($RCMAIL->show_bytes($attach_prop->size))) .
html::span('attachment-links',
+ (in_array($attach_prop->mimetype, $client_mimetypes) ? html::a($show_link['href'], rcube_label('showattachment')) . '&nbsp;' : '') .
html::a($show_link['href'] . '&_download=1', rcube_label('download'))
) .
html::br(array('style' => 'clear:both'))