Fix unknown variable notice
[squirrelmail.git] / src / read_body.php
index 36e3ab2b8747e1a02844e4ecba6c036998ea000a..17e19fb3a5c383e3ce9be0ab14e73c766c85cf06 100644 (file)
@@ -12,6 +12,9 @@
  * @package squirrelmail
  */
 
+/** This is the read_body page */
+define('PAGE_NAME', 'read_body');
+
 /**
  * Include the SquirrelMail initialization file.
  */
@@ -125,8 +128,7 @@ function ServerMDNSupport($aFlags) {
 }
 
 function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) {
-    global $username, $attachment_dir, $color,
-           $squirrelmail_language, $default_charset,
+    global $squirrelmail_language, $default_charset,
            $languages, $useSendmail, $domain, $sent_folder;
 
     sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER);
@@ -143,7 +145,7 @@ function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) {
     }
     $rfc822_header->content_type = $content_type;
     $rfc822_header->to[] = $header->dnt;
-    $rfc822_header->subject = _("Read:") . ' ' . encodeHeader($header->subject);
+    $rfc822_header->subject = _("Read:") . ' ' . decodeHeader($header->subject,true,false);
 
     $idents = get_identities();
     $needles = array();
@@ -271,7 +273,7 @@ function SendMDN ( $mailbox, $passed_id, $message, $imapConnection) {
                 _("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
                 nl2br(htmlspecialchars($deliver->dlv_server_msg));
         }
-        plain_error_message($msg, $color);
+        plain_error_message($msg);
     } else {
         unset ($deliver);
         if (sqimap_mailbox_exists ($imapConnection, $sent_folder)) {
@@ -294,7 +296,7 @@ function ToggleMDNflag ($set ,$imapConnection, $mailbox, $passed_id) {
 }
 
 function formatRecipientString($recipients, $item ) {
-    global $show_more_cc, $show_more, $show_more_bcc,
+    global $show_more, $show_more_cc, $show_more_bcc,
            $PHP_SELF, $oTemplate;
 
     $string = '';
@@ -374,6 +376,10 @@ function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
         $oTemplate->assign('xmailer', decodeHeader($header->xmailer));
         $env[_("Mailer")] = $oTemplate->fetch('read_xmailer.tpl');
     }
+
+    // this is used for both mdn and also general use for plugins, etc
+    $oTemplate->assign('first_time_reading', $FirstTimeSee);
+
     if ($default_use_mdn) {
         if ($mdn_user_support) {
             if ($header->dnt) {
@@ -384,7 +390,6 @@ function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
                 $mdn_url = set_url_var($mdn_url, 'sendreceipt', 1);
 
                 $oTemplate->assign('read_receipt_sent', $message->is_mdnsent);
-                $oTemplate->assign('first_time_reading', $FirstTimeSee);
                 $oTemplate->assign('send_receipt_href', $mdn_url);
 
                 $env[_("Read Receipt")] = $oTemplate->fetch('read_handle_receipt.tpl');
@@ -445,8 +450,6 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
 
     $urlMailbox = urlencode($mailbox);
 
-    $msgs_url = $base_uri . 'src/';
-
     // Create Prev & Next links
     // Handle nested entities first (i.e. Mime Attach parts)
     $prev_href = $next_href = $up_href = $del_href = $del_prev_href = $del_next_href = '';
@@ -785,7 +788,6 @@ if(sqgetGlobalVar('view_unsafe_images', $temp)) {
 sqgetGlobalVar('mailbox_cache',$mailbox_cache,SQ_SESSION);
 
 /* end of get globals */
-global $sqimap_capabilities, $lastTargetMailbox;
 
 $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
 $aMailbox = sqm_api_mailbox_select($imapConnection, $iAccount, $mailbox,array('setindex' => $what, 'offset' => $startMessage),array());
@@ -980,4 +982,3 @@ formatMenuBar($aMailbox, $passed_id, $passed_ent_id, $message, false, FALSE);
 do_hook('read_body_bottom', $null);
 sqimap_logout($imapConnection);
 $oTemplate->display('footer.tpl');
-?>