|
|
@ -197,12 +197,11 @@ function rcmail_message_attachments($attrib)
|
|
|
|
foreach ($MESSAGE->attachments as $attach_prop) {
|
|
|
|
foreach ($MESSAGE->attachments as $attach_prop) {
|
|
|
|
$filename = rcmail_attachment_name($attach_prop, true);
|
|
|
|
$filename = rcmail_attachment_name($attach_prop, true);
|
|
|
|
$filesize = $RCMAIL->message_part_size($attach_prop);
|
|
|
|
$filesize = $RCMAIL->message_part_size($attach_prop);
|
|
|
|
|
|
|
|
$mimetype = rcmail_fix_mimetype($attach_prop->mimetype);
|
|
|
|
|
|
|
|
$class = rcube_utils::file2class($mimetype, $filename);
|
|
|
|
|
|
|
|
$id = 'attach' . $attach_prop->mime_id;
|
|
|
|
|
|
|
|
$size = html::span('attachment-size', '(' . rcube::Q($filesize) . ')');
|
|
|
|
|
|
|
|
|
|
|
|
if ($PRINT_MODE) {
|
|
|
|
|
|
|
|
$ol .= html::tag('li', array('id' => 'attach' . $attach_prop->mime_id),
|
|
|
|
|
|
|
|
rcube::Q(sprintf("%s (%s)", $filename, $filesize)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
|
|
|
|
if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
|
|
|
|
$title = $filename;
|
|
|
|
$title = $filename;
|
|
|
|
$filename = abbreviate_string($filename, $attrib['maxlength']);
|
|
|
|
$filename = abbreviate_string($filename, $attrib['maxlength']);
|
|
|
@ -211,22 +210,21 @@ function rcmail_message_attachments($attrib)
|
|
|
|
$title = '';
|
|
|
|
$title = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$size = ' ' . html::span('attachment-size', '(' . rcube::Q($filesize) . ')');
|
|
|
|
$item = rcube::Q($filename) . ' ' . $size;
|
|
|
|
$mimetype = rcmail_fix_mimetype($attach_prop->mimetype);
|
|
|
|
|
|
|
|
$class = rcube_utils::file2class($mimetype, $filename);
|
|
|
|
if (!$PRINT_MODE) {
|
|
|
|
$id = 'attach' . $attach_prop->mime_id;
|
|
|
|
$item = html::a(array(
|
|
|
|
$link = html::a(array(
|
|
|
|
|
|
|
|
'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
|
|
|
|
'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
|
|
|
|
'onclick' => sprintf('return %s.command(\'load-attachment\',\'%s\',this)',
|
|
|
|
'onclick' => sprintf('return %s.command(\'load-attachment\',\'%s\',this)',
|
|
|
|
rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id),
|
|
|
|
rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id),
|
|
|
|
'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
|
|
|
|
'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
|
|
|
|
'title' => $title,
|
|
|
|
'title' => $title,
|
|
|
|
), rcube::Q($filename) . $size);
|
|
|
|
), $item);
|
|
|
|
|
|
|
|
|
|
|
|
$ol .= html::tag('li', array('class' => $class, 'id' => $id), $link);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$attachments[$attach_prop->mime_id] = $mimetype;
|
|
|
|
$attachments[$attach_prop->mime_id] = $mimetype;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ol .= html::tag('li', array('class' => $class, 'id' => $id), $item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$out = html::tag('ul', $attrib, $ol, html::$common_attrib);
|
|
|
|
$out = html::tag('ul', $attrib, $ol, html::$common_attrib);
|
|
|
|