thomascube
2008-09-18 7dfb1fba5001299300736e6b5d95d9400575e3e7
program/steps/mail/show.inc
@@ -32,10 +32,10 @@
  // go back to list if message not found (wrong UID)
  if (empty($MESSAGE->headers)) {
    $OUTPUT->show_message('messageopenerror', 'error');
    if ($RCMAIL->action=='preview' && template_exists('messagepreview'))
    if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview'))
        $OUTPUT->send('messagepreview');
    else {
      $RCMAIL->action = 'list';
      rcmail_overwrite_action('');
      return;
    }
  }
@@ -80,15 +80,21 @@
  $OUTPUT->set_env('uid', $MESSAGE->uid);
  $OUTPUT->set_env('safemode', $MESSAGE->is_safe);
  $OUTPUT->set_env('sender', $MESSAGE->sender['string']);
  $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
  
  // check for unset disposition notification
  if ($MESSAGE->headers->mdn_to && !$MESSAGE->headers->mdn_sent &&
      $mbox_name != $CONFIG['drafts_mbox'] && $mbox_name != $CONFIG['sent_mbox'])
  if ($MESSAGE->headers->mdn_to &&
      !$MESSAGE->headers->mdn_sent &&
      $IMAP->check_permflag('MDNSENT') &&
      $mbox_name != $CONFIG['drafts_mbox'] &&
      $mbox_name != $CONFIG['sent_mbox'])
  {
    if (intval($CONFIG['mdn_requests']) === 1)
    {
      if (rcmail_send_mdn($MESSAGE->uid))
        $OUTPUT->show_message('receiptsent', 'confirmation');
      else
        $OUTPUT->show_message('errorsendingreceipt', 'error');
    }
    else if (empty($CONFIG['mdn_requests']))
    {
@@ -147,6 +153,15 @@
        $ol .= html::tag('li', null, sprintf("%s (%s)", Q($attach_prop->filename), Q(show_bytes($attach_prop->size))));
      }
      else {
        if (rc_strlen($attach_prop->filename) > 50) {
          $filename = abbreviate_string($attach_prop->filename, 50);
          $title = $attach_prop->filename;
      }
      else {
        $filename = $attach_prop->filename;
        $title = '';
      }
        $ol .= html::tag('li', null,
          html::a(array(
            'href' => $MESSAGE->get_part_url($attach_prop->mime_id),
@@ -155,8 +170,9 @@
              JS_OBJECT_NAME,
              $attach_prop->mime_id,
              $attach_prop->mimetype),
              'title' => Q($title),
            ),
            Q($attach_prop->filename)));
            Q($filename)));
      }
    }
@@ -191,12 +207,13 @@
$OUTPUT->add_handlers(array(
  'messageattachments' => 'rcmail_message_attachments',
  'mailboxname' => 'rcmail_mailbox_name_display',
  'blockedobjects' => 'rcmail_remote_objects_msg'));
if ($RCMAIL->action=='print' && template_exists('printmessage'))
if ($RCMAIL->action=='print' && $OUTPUT->template_exists('printmessage'))
  $OUTPUT->send('printmessage');
else if ($RCMAIL->action=='preview' && template_exists('messagepreview'))
else if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview'))
    $OUTPUT->send('messagepreview');
else
  $OUTPUT->send('message');