[ Index ]
 

Code source de IMP H3 (4.1.5)

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> message.php (source)

   1  <?php
   2  /**
   3   * $Horde: imp/message.php,v 2.560.4.41 2007/01/02 13:54:54 jan Exp $
   4   *
   5   * Copyright 1999-2007 Charles J. Hagenbuch <chuck@horde.org>
   6   * Copyright 1999-2007 Jon Parise <jon@horde.org>
   7   *
   8   * See the enclosed file COPYING for license information (GPL).  If you
   9   * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  10   */
  11  
  12  /**
  13   * Set pertinent variables for the mailbox.php script.
  14   *
  15   * @param integer $startIndex  The start index to use.
  16   * @param string $actID        The action ID to use.
  17   */
  18  function _returnToMailbox($startIndex = null, $actID = null)
  19  {
  20      global $actionID, $from_message_page, $start;
  21  
  22      $actionID = null;
  23      $from_message_page = true;
  24      $start = null;
  25  
  26      if (!is_null($startIndex)) {
  27          $start = $startIndex;
  28      }
  29      if (!is_null($actID)) {
  30          $actionID = $actID;
  31      }
  32  }
  33  
  34  @define('IMP_BASE', dirname(__FILE__));
  35  require_once  IMP_BASE . '/lib/base.php';
  36  require_once  IMP_BASE . '/lib/MIME/Contents.php';
  37  require_once  IMP_BASE . '/lib/MIME/Headers.php';
  38  require_once  IMP_BASE . '/lib/Mailbox.php';
  39  require_once  IMP_BASE . '/lib/Search.php';
  40  require_once 'Horde/Identity.php';
  41  
  42  /* Make sure we have a valid index. */
  43  $imp_mailbox = &IMP_Mailbox::singleton(Util::getFormData('index'));
  44  if (!$imp_mailbox->isValidIndex()) {
  45      _returnToMailbox(null, 'message_missing');
  46      require  IMP_BASE . '/mailbox.php';
  47      exit;
  48  }
  49  
  50  /* Are we using printer-friendly formatting? */
  51  $printer_friendly = false;
  52  
  53  /* Set the current time zone. */
  54  NLS::setTimeZone();
  55  
  56  /* Initialize the user's identities. */
  57  $user_identity = &Identity::singleton(array('imp', 'imp'));
  58  
  59  /* Run through action handlers. */
  60  $actionID = Util::getFormData('actionID');
  61  switch ($actionID) {
  62  case 'blacklist':
  63  case 'whitelist':
  64      require_once  IMP_BASE . '/lib/Filter.php';
  65      $imp_filter = &IMP_Filter::singleton();
  66      $idx = $imp_mailbox->getIMAPIndex();
  67      if ($actionID == 'blacklist') {
  68          $imp_filter->blacklistMessage(array($idx['mailbox'] => array($idx['index'])));
  69      } else {
  70          $imp_filter->whitelistMessage(array($idx['mailbox'] => array($idx['index'])));
  71      }
  72      break;
  73  
  74  case 'print_message':
  75      $printer_friendly = true;
  76      IMP::printMode(true);
  77      break;
  78  
  79  case 'delete_message':
  80  case 'undelete_message':
  81      require_once  IMP_BASE . '/lib/Message.php';
  82      $imp_message = &IMP_Message::singleton();
  83      if ($actionID == 'undelete_message') {
  84          $imp_message->undelete($imp_mailbox);
  85      } else {
  86          $imp_message->delete($imp_mailbox);
  87          if ($prefs->getValue('mailbox_return')) {
  88              _returnToMailbox($imp_mailbox->getMessageIndex());
  89              require  IMP_BASE . '/mailbox.php';
  90              exit;
  91          }
  92      }
  93      break;
  94  
  95  case 'move_message':
  96  case 'copy_message':
  97      if (($targetMbox = Util::getFormData('targetMbox')) !== null) {
  98          require_once  IMP_BASE . '/lib/Message.php';
  99          $imp_message = &IMP_Message::singleton();
 100  
 101          $action = ($actionID == 'move_message') ? IMP_MESSAGE_MOVE : IMP_MESSAGE_COPY;
 102  
 103          if ($conf['tasklist']['use_tasklist'] &&
 104              (strpos($targetMbox, '_tasklist_') === 0)) {
 105              /* If the target is a tasklist, handle the move/copy specially. */
 106              $tasklist = str_replace('_tasklist_', '', $targetMbox);
 107              $imp_message->createTasksOrNotes($tasklist, $action, $imp_mailbox, 'task');
 108          } elseif ($conf['notepad']['use_notepad'] &&
 109              (strpos($targetMbox, '_notepad_') === 0)) {
 110              /* If the target is a notepad, handle the move/copy specially. */
 111              $notepad = str_replace('_notepad_', '', $targetMbox);
 112              $imp_message->createTasksOrNotes($notepad, $action, $imp_mailbox, 'note');
 113          } else {
 114              /* Otherwise, the target is a standard mailbox. */
 115              if (Util::getFormData('newMbox', 0) == 1) {
 116                  $new_mailbox = String::convertCharset(IMP::folderPref($targetMbox, true), NLS::getCharset(), 'UTF7-IMAP');
 117                  require_once  IMP_BASE . '/lib/Folder.php';
 118                  $imp_folder = &IMP_Folder::singleton();
 119                  if ($imp_folder->create($new_mailbox, $prefs->getValue('subscribe'))) {
 120                      $imp_message->copy($new_mailbox, $action, $imp_mailbox);
 121                  }
 122              } else {
 123                  $imp_message->copy($targetMbox, $action, $imp_mailbox);
 124              }
 125          }
 126      }
 127      if ($prefs->getValue('mailbox_return')) {
 128          _returnToMailbox($imp_mailbox->getMessageIndex());
 129          require  IMP_BASE . '/mailbox.php';
 130          exit;
 131      }
 132      break;
 133  
 134  case 'spam_report':
 135  case 'notspam_report':
 136      $action = str_replace('_report', '', $actionID);
 137  
 138      require_once  IMP_BASE . '/lib/Spam.php';
 139      $imp_spam = &new IMP_Spam();
 140      $imp_spam->reportSpam($imp_mailbox, $action);
 141  
 142      /* Delete spam after report. */
 143      $delete_spam = $prefs->getValue('delete_spam_after_report');
 144      if ($action == 'spam' && ($delete_spam == 1)) {
 145          require_once  IMP_BASE . '/lib/Message.php';
 146          $imp_message = &IMP_Message::singleton();
 147          $imp_message->delete($imp_mailbox);
 148          $notification->push(_("The message has been deleted."), 'horde.message');
 149          if ($prefs->getValue('mailbox_return')) {
 150              _returnToMailbox($imp_mailbox->getMessageIndex());
 151              require  IMP_BASE . '/mailbox.php';
 152              exit;
 153          }
 154      } elseif ($delete_spam == 2) {
 155          $targetMbox = ($action == 'spam') ? IMP::folderPref($prefs->getValue('spam_folder'), true) : 'INBOX';
 156          if ($targetMbox) {
 157              require_once  IMP_BASE . '/lib/Message.php';
 158              $imp_message = &IMP_Message::singleton();
 159              $imp_message->copy($targetMbox, IMP_MESSAGE_MOVE, $imp_mailbox, true);
 160              if ($prefs->getValue('mailbox_return')) {
 161                  _returnToMailbox($imp_mailbox->getMessageIndex());
 162                  require  IMP_BASE . '/mailbox.php';
 163                  exit;
 164              }
 165          } else {
 166              $notification->push(_("Could not move message to spam mailbox - no spam mailbox defined in preferences."), 'horde.error');
 167          }
 168      }
 169      break;
 170  
 171  case 'flag_message':
 172      $flag = Util::getFormData('flag');
 173      if ($flag) {
 174          if ($flag{0} == '0') {
 175              $flag = '\\' . substr($flag, 1);
 176              $set = false;
 177          } else {
 178              $flag = '\\' . $flag;
 179              $set = true;
 180          }
 181          require_once  IMP_BASE . '/lib/Message.php';
 182          $imp_message = &IMP_Message::singleton();
 183          $imp_message->flag($flag, $imp_mailbox, $set);
 184          if ($prefs->getValue('mailbox_return')) {
 185              _returnToMailbox($imp_mailbox->getMessageIndex());
 186              require  IMP_BASE . '/mailbox.php';
 187              exit;
 188          }
 189          $imp_mailbox->moveNext();
 190      }
 191      break;
 192  
 193  case 'add_address':
 194      $contact_link = IMP::addAddress(Util::getFormData('address'), Util::getFormData('name'));
 195      if (is_a($contact_link, 'PEAR_Error')) {
 196          $notification->push($contact_link);
 197      } else {
 198          $notification->push(sprintf(_("Entry \"%s\" was successfully added to the address book"), $contact_link), 'horde.success', array('content.raw'));
 199      }
 200      break;
 201  
 202  case 'strip_attachment':
 203      require_once  IMP_BASE . '/lib/Message.php';
 204      $imp_message = &IMP_Message::singleton();
 205      $result = $imp_message->stripPart($imp_mailbox, Util::getFormData('imapid'));
 206      if (is_a($result, 'PEAR_Error')) {
 207          $notification->push($result, 'horde.error');
 208      }
 209  
 210      break;
 211  }
 212  
 213  if ($conf['user']['allow_folders']) {
 214      $options = IMP::flistSelect(_("This message to"), true, array(), null, true, true, false, true);
 215  }
 216  
 217  /* We may have done processing that has taken us past the end of the
 218   * message array, so we will return to mailbox.php if that is the
 219   * case. */
 220  if (!$imp_mailbox->isValidIndex()) {
 221      _returnToMailbox($imp_mailbox->getMessageIndex());
 222      require  IMP_BASE . '/mailbox.php';
 223      exit;
 224  }
 225  
 226  /* Now that we are done processing the messages, get the index and
 227   * array index of the current message. */
 228  $index_array = $imp_mailbox->getIMAPIndex();
 229  $index = $index_array['index'];
 230  $mailbox_name = $index_array['mailbox'];
 231  $array_index = $imp_mailbox->getArrayIndex();
 232  
 233  /* If we grab the headers before grabbing body parts, we'll see when a
 234   * message is unread. */
 235  $imp_headers = &new IMP_Headers($index);
 236  $imp_headers->buildHeaders();
 237  $imp_headers->buildFlags();
 238  $imp_headers_copy = &Util::cloneObject($imp_headers);
 239  
 240  /* Parse MIME info and create the body of the message. */
 241  $imp_contents = &IMP_Contents::singleton($index . IMP_IDX_SEP . $mailbox_name);
 242  
 243  /* Update the message flag, if necessary. */
 244  $use_pop = ($imp['base_protocol'] == 'pop3');
 245  if (!$use_pop && !$imp_headers->getFlag('seen')) {
 246      require_once  IMP_BASE . '/lib/Message.php';
 247      $imp_message = &IMP_Message::singleton();
 248      $imp_message->flag('\\SEEN', $imp_mailbox, true);
 249  }
 250  
 251  /* Determine if we should generate the attachment strip links or
 252   * not. */
 253  if ($prefs->getValue('strip_attachments')) {
 254      $imp_contents->setStripLink(true);
 255  }
 256  
 257  /* Don't show summary links if we are printing the message. */
 258  $imp_contents->showSummaryLinks(!$printer_friendly);
 259  
 260  if (!$imp_contents->buildMessage()) {
 261      _returnToMailbox(null, 'message_missing');
 262      require  IMP_BASE . '/mailbox.php';
 263      exit;
 264  }
 265  
 266  $attachments = $imp_contents->getAttachments();
 267  $msgText = $imp_contents->getMessage();
 268  
 269  /* Develop the list of Headers to display now. We will deal with the
 270   * 'basic' header information first since there are various
 271   * manipulations we do to them. */
 272  $basic_headers = array(
 273      'date'      =>  _("Date"),
 274      'from'      =>  _("From"),
 275      'to'        =>  _("To"),
 276      'cc'        =>  _("Cc"),
 277      'bcc'       =>  _("Bcc"),
 278      'reply-to'  =>  _("Reply-To"),
 279      'subject'   =>  _("Subject")
 280  );
 281  $msgAddresses = array();
 282  
 283  $imp_headers->setValueByFunction('date', array('nl2br', array($imp_headers, 'addLocalTime'), 'htmlspecialchars'));
 284  
 285  /* Get the title/mailbox label of the mailbox page. */
 286  $page_label = IMP::getLabel();
 287  
 288  /* Process the subject now. */
 289  if (($subject = $imp_headers->getValue('subject'))) {
 290      /* Filter the subject text, if requested. */
 291      $subject = IMP::filterText($subject);
 292  
 293      require_once 'Horde/Text.php';
 294      $imp_headers->setValue('subject', Text::htmlSpaces($subject));
 295  
 296      $title = sprintf(_("%s: %s"), $page_label, $subject);
 297      $shortsub = htmlspecialchars($subject);
 298  } else {
 299      $shortsub = _("[No Subject]");
 300      $imp_headers->addHeader('Subject', $shortsub);
 301      $title = sprintf(_("%s: %s"), $page_label, $shortsub);
 302  }
 303  
 304  /* See if the 'X-Priority' header has been set. */
 305  if (($priority = $imp_headers->getValue('x-priority'))) {
 306      if (preg_match("/\s*(\d+)\s*/", $priority, $matches)) {
 307          if (($matches[1] == '1') || ($matches[1] == '2')) {
 308              $imp_headers->addHeader('Priority', Horde::img('mail_priority_high.png', _("High Priority")) . '&nbsp;' . $priority);
 309          } elseif (($matches[1] == '4') || ($matches[1] == '5')) {
 310              $imp_headers->addHeader('Priority', Horde::img('mail_priority_low.png', _("Low Priority")) . '&nbsp;' . $priority);
 311          }
 312      }
 313  }
 314  
 315  /* Determine if all/list headers needed. */
 316  $all_headers = Util::getFormData('show_all_headers');
 317  $list_headers = Util::getFormData('show_list_headers');
 318  
 319  /* Get the rest of the headers if all headers are requested. */
 320  $user_hdrs = $user_identity->getValue('mail_hdr');
 321  if ($all_headers || !empty($user_hdrs)) {
 322      $full_h = $imp_headers->getAllHeaders();
 323      foreach ($full_h as $head => $val) {
 324          /* Skip the X-Priority header if we have already dealt with
 325           * it. */
 326          if ((stristr($head, 'x-priority') !== false) &&
 327              $imp_headers->getValue('priority')) {
 328              unset($full_h[$head]);
 329          } elseif ($imp_headers->alteredHeader($head)) {
 330              $full_h[$head] = $imp_headers->getValue($head);
 331          } elseif (is_array($val)) {
 332              $val = array_map('htmlspecialchars', $val);
 333              $full_h[$head] = '<ul style="margin:0px;padding-left:15px"><li>' . implode("</li>\n<li>", $val) . '</li></ul>';
 334          } else {
 335              $full_h[$head] = htmlspecialchars($val);
 336          }
 337      }
 338      ksort($full_h);
 339  }
 340  
 341  /* Display the user-specified headers for the current identity. */
 342  $custom_hdrs = array();
 343  if (!empty($user_hdrs) && !$all_headers) {
 344      foreach ($user_hdrs as $user_hdr) {
 345          foreach ($full_h as $head => $val) {
 346              if (stristr($head, $user_hdr) !== false) {
 347                  $custom_hdrs[$head] = $val;
 348              }
 349          }
 350      }
 351  }
 352  
 353  /* Generate the list of search parameters. */
 354  $search_params = IMP::getSearchParameters($mailbox_name, $index);
 355  
 356  /* For the self URL link, we can't trust the index in the query string as it
 357   * may have changed if we deleted/copied/moved messages. We may need other
 358   * stuff in the query string, so we need to do an add/remove of 'index'. */
 359  $selfURL = Util::removeParameter(Horde::selfUrl(true), array('index', 'actionID'));
 360  $selfURL = Util::addParameter($selfURL, 'index', $index);
 361  $headersURL = Util::removeParameter($selfURL, array('show_all_headers', 'show_list_headers', 'mailbox', 'thismailbox'));
 362  $headersURL = Util::addParameter($headersURL, $search_params);
 363  
 364  /* Determine previous message index. */
 365  if (($prev_msg = $imp_mailbox->getIMAPIndex(-1))) {
 366      $prev_url = IMP::generateSearchUrl('message.php', $prev_msg['mailbox']);
 367      $prev_url = Util::addParameter($prev_url, 'index', $prev_msg['index']);
 368  }
 369  
 370  /* Determine next message index. */
 371  if (($next_msg = $imp_mailbox->getIMAPIndex(1))) {
 372      $next_url = IMP::generateSearchUrl('message.php', $next_msg['mailbox']);
 373      $next_url = Util::addParameter($next_url, 'index', $next_msg['index']);
 374  }
 375  
 376  /* Get the starting index for the current message and the message
 377   * count. */
 378  $msgindex = $imp_mailbox->getMessageIndex();
 379  $msgcount = $imp_mailbox->getMessageCount();
 380  
 381  /* Generate the mailbox link. */
 382  $mailbox_url = Util::addParameter(Horde::applicationUrl('mailbox.php'), 'start', $msgindex);
 383  
 384  /* Generate the view link. */
 385  $view_link = IMP::generateSearchUrl('view.php', $mailbox_name);
 386  $view_link = Util::addParameter($view_link, 'index', $index);
 387  
 388  /* Generate the Save Message link. */
 389  $save_link_array = array_merge(array('actionID' => 'save_message', 'index' => $index), $search_params);
 390  $save_link = Horde::downloadUrl($subject, $save_link_array);
 391  
 392  /* Generate the Message Source link. */
 393  if (!empty($conf['user']['allow_view_source'])) {
 394      $base_part = $imp_contents->getMIMEMessage();
 395      $source_link = $imp_contents->linkViewJS($base_part, 'view_source', _("_Message Source"), _("Message Source"), 'widget', array(), true);
 396  }
 397  
 398  /* Generate the link to ourselves. */
 399  $self_link = IMP::generateSearchUrl('message.php', $mailbox_name);
 400  $self_link = Util::addParameter($self_link, array('index' => $index, 'start' => $msgindex));
 401  
 402  /* Generate the print link. */
 403  $print_params = array('actionID' => 'print_message', 'index' => $index);
 404  $print_link = Horde::applicationUrl('message.php');
 405  $print_link = Util::addParameter($print_link, array_merge($print_params, $search_params));
 406  
 407  /* Generate the thread view link. */
 408  $thread_link = Util::addParameter(Horde::applicationUrl('thread.php'), array('index' => $index, 'start' => $msgindex));
 409  
 410  $delete_warning = '';
 411  if ($use_pop) {
 412      $delete_warning = "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete these messages?")) . "');";
 413  }
 414  
 415  Horde::addScriptFile('popup.js', 'horde', true);
 416  Horde::addScriptFile('keybindings.js', 'horde');
 417  require IMP_TEMPLATES . '/common-header.inc';
 418  
 419  /* Check for the presence of mailing list information. */
 420  $reply_author = array();
 421  $reply_list = null;
 422  if (($list_exists = $imp_headers->listHeadersExist())) {
 423      /* See if the List-Post header provides an e-mail address for the
 424       * list. */
 425      if ($imp_headers->getValue('list-post')) {
 426          $reply_list = $imp_headers->parseListHeaders('list-post', true);
 427      }
 428  
 429      /* If the Reply-to: address is the same as the list address, use
 430       * the user's from address for the "Reply" action. */
 431      if (!is_null($reply_list) &&
 432          IMP::bareAddress($reply_list) == IMP::bareAddress(MIME::addrArray2String($imp_headers->getOb('reply_to')))) {
 433          $reply_author = MIME::addrArray2String($imp_headers->getOb('from'));
 434      }
 435  
 436      /* See if the mailing list information has been requested to be
 437       * displayed. */
 438      if ($list_headers || $all_headers) {
 439          $imp_headers->parseAllListHeaders();
 440      }
 441  }
 442  
 443  /* Build From address links. */
 444  $imp_headers->buildAddressLinks('from', $self_link, true, !$printer_friendly);
 445  
 446  /* Add country/flag image. Try X-Originating-IP first, then fall back
 447   * on the sender's domain name. */
 448  if (!$printer_friendly) {
 449      $from_img = '';
 450      $origin_host = str_replace(array('[', ']'), '', $imp_headers->getValue('X-Originating-IP'));
 451      if (is_array($origin_host)) {
 452          $from_img = '';
 453          foreach ($origin_host as $host) {
 454              $from_img .= NLS::generateFlagImageByHost($host) . ' ';
 455          }
 456          trim($from_img);
 457      } elseif ($origin_host) {
 458          $from_img = NLS::generateFlagImageByHost($origin_host);
 459      }
 460      if (empty($from_img)) {
 461          $from_ob = imap_rfc822_parse_adrlist($imp_headers->getFromAddress(), '');
 462          $from_ob = array_shift($from_ob);
 463          $origin_host = $from_ob->host;
 464          $from_img = NLS::generateFlagImageByHost($origin_host);
 465      }
 466      if (!empty($from_img)) {
 467          $imp_headers->setValue('from', $imp_headers->getValue('from') . '&nbsp;' . $from_img);
 468      }
 469  }
 470  
 471  /* Build To/Cc/Bcc links. */
 472  $address_headers = array('to' => 'toaddress', 'cc' => 'ccaddress', 'bcc' => 'bccaddress');
 473  foreach ($address_headers as $key => $val) {
 474      if ($imp_headers->buildAddressLinks($key, $self_link, true, !$printer_friendly)) {
 475          $msgAddresses[] = $imp_headers->getOb($val);
 476      }
 477  }
 478  
 479  /* Build Reply-To address links. */
 480  if (($reply_to = $imp_headers->buildAddressLinks('reply-to', $self_link, false, !$printer_friendly))) {
 481      if (!($from = $imp_headers->getValue('from')) || ($from != $reply_to)) {
 482          $imp_headers->setValue('Reply-to', $reply_to);
 483      } else {
 484          $imp_headers->removeHeader('reply-to');
 485      }
 486  }
 487  
 488  /* Set the status information of the message. */
 489  $addresses = array_keys($user_identity->getAllFromAddresses(true));
 490  $identity = null;
 491  $status = '';
 492  if (!$use_pop) {
 493      if (count($msgAddresses)) {
 494          $identity = $user_identity->getMatchingIdentity($msgAddresses);
 495          if (!is_null($identity) ||
 496              $user_identity->getMatchingIdentity($msgAddresses, false) !== null) {
 497              $status .= Horde::img('mail_personal.png', _("Personal"));
 498          }
 499          if (is_null($identity)) {
 500              $identity = $user_identity->getDefault();
 501          }
 502      }
 503  
 504      /* Set status flags. */
 505      $flag_array = array(
 506          'unseen'   => _("Unseen"),
 507          'answered' => _("Answered"),
 508          'draft'    => _("Draft"),
 509          'flagged'  => _("Important"),
 510          'deleted'  => _("Deleted")
 511      );
 512      foreach ($flag_array as $flag => $desc) {
 513          if ($imp_headers->getFlag($flag)) {
 514              $status .= Horde::img('mail_' . $flag . '.png', $desc);
 515          }
 516      }
 517  }
 518  
 519  /* Show the [black|white]list link if we have that functionality
 520   * enabled. */
 521  $show_blacklist_link = false;
 522  $show_whitelist_link = false;
 523  if ($registry->hasMethod('mail/blacklistFrom')) {
 524      $show_blacklist_link = true;
 525  }
 526  if ($registry->hasMethod('mail/whitelistFrom')) {
 527      $show_whitelist_link = true;
 528  }
 529  
 530  /* Determine if we need to show the Reply to All link. */
 531  $show_reply_all = true;
 532  if (!MIME::addrArray2String(array_merge($imp_headers->getOb('to'), $imp_headers->getOb('cc')), $addresses)) {
 533      $show_reply_all = false;
 534  }
 535  
 536  /* Retrieve any history information for this message. */
 537  if (!$printer_friendly && !empty($conf['maillog']['use_maillog'])) {
 538      require_once  IMP_BASE . '/lib/Maillog.php';
 539      $msg_id = $imp_headers->getOb('message_id');
 540      IMP_Maillog::displayLog($msg_id);
 541  
 542      /* Do MDN processing now. */
 543      if ($prefs->getValue('disposition_send_mdn')) {
 544          /* Check to see if an MDN has been requested. */
 545          require_once 'Horde/MIME/MDN.php';
 546          $mdn = &new MIME_MDN($imp_headers_copy);
 547          if ($mdn->getMDNReturnAddr()) {
 548              /* See if we have already processed this message. */
 549              if (!IMP_Maillog::sentMDN($msg_id, 'displayed')) {
 550                  $mdn_confirm = Util::getFormData('mdn_confirm');
 551                  /* See if we need to query the user. */
 552                  if ($mdn->userConfirmationNeeded() && !$mdn_confirm) {
 553                      $confirm_link = Horde::link(Util::addParameter($selfURL, 'mdn_confirm', 1)) . _("HERE") . '</a>';
 554                      $notification->push(sprintf(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message. Please click %s to send the notification message."), $confirm_link), 'horde.message', array('content.raw'));
 555                  } else {
 556                      /* Send out the MDN now. */
 557                      $result = $mdn->generate(false, $mdn_confirm, 'displayed');
 558                      if (!is_a($result, 'PEAR_Error')) {
 559                          IMP_Maillog::log('mdn', $msg_id, 'displayed');
 560                      }
 561                  }
 562              }
 563          }
 564      }
 565  }
 566  
 567  if (!$printer_friendly) {
 568      require IMP_TEMPLATES . '/menu.inc';
 569      IMP::status();
 570  
 571      /* Print quota information. */
 572      if (isset($imp['quota']) && is_array($imp['quota'])) {
 573          require_once  IMP_BASE . '/lib/Quota.php';
 574          $quotaDriver = &IMP_Quota::singleton($imp['quota']['driver'], $imp['quota']['params']);
 575          if ($quotaDriver !== false) {
 576              $quota = $quotaDriver->getQuota();
 577              require IMP_TEMPLATES . '/quota/quota.inc';
 578          }
 579      }
 580  
 581      require IMP_TEMPLATES . '/message/navbar_top.inc';
 582      $nav_id = 1;
 583      require IMP_TEMPLATES . '/message/navbar_navigate.inc';
 584  
 585      /* Cache the results of the navbar_actions.inc require. */
 586      ob_start();
 587      require IMP_TEMPLATES . '/message/navbar_actions.inc';
 588      $actions_output = ob_get_contents();
 589      ob_end_clean();
 590      echo $actions_output . '</table>';
 591  }
 592  
 593  /* Generate some variables needed for the templates. */
 594  $downloadall_link = $imp_contents->getDownloadAllLink();
 595  $atc_display = $prefs->getValue('attachment_display');
 596  $show_parts = (!empty($attachments) && (($atc_display == 'list') || ($atc_display == 'both')));
 597  
 598  require IMP_TEMPLATES . '/message/headers.inc';
 599  require IMP_TEMPLATES . '/message/message.inc';
 600  
 601  if (!$printer_friendly) {
 602      echo '<table width="100%" cellspacing="0">' . $actions_output;
 603      $nav_id = 2;
 604      require IMP_TEMPLATES . '/message/navbar_navigate.inc';
 605      echo '</table></form>';
 606  }
 607  if ($browser->hasFeature('javascript')) {
 608      require_once IMP_TEMPLATES . '/message/javascript.inc';
 609      require_once $registry->get('templates', 'horde') . '/contents/open_view_win.js';
 610      if ($printer_friendly) {
 611          require_once $registry->get('templates', 'horde') . '/javascript/print.js';
 612      }
 613  }
 614  
 615  require $registry->get('templates', 'horde') . '/common-footer.inc';


Généré le : Thu Nov 29 12:30:07 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics