XHTML fixes and making use of forms.php
[squirrelmail.git] / src / read_body.php
index c3b739031767b93ef9a5c61a8182faed411cbeb9..faed6afaa1b57f8ddb1f238ce56f94b5597a2577 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * read_body.php
  *
@@ -184,9 +185,9 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
     $now = getLongDateString( time() );
     set_my_charset();
     $body = _("Your message") . "\r\n\r\n" .
-            "\t" . _("To:") . ' ' . decodeHeader($to,false,false) . "\r\n" .
-            "\t" . _("Subject:") . ' ' . decodeHeader($header->subject,false,false) . "\r\n" .
-            "\t" . _("Sent:") . ' ' . $senton . "\r\n" .
+            "\t" . _("To") . ': ' . decodeHeader($to,false,false) . "\r\n" .
+            "\t" . _("Subject") . ': ' . decodeHeader($header->subject,false,false) . "\r\n" .
+            "\t" . _("Sent") . ': ' . $senton . "\r\n" .
             "\r\n" .
             sprintf( _("Was displayed on %s"), $now );
 
@@ -265,7 +266,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
         $success = $deliver->finalizeStream($stream);
     }
     if (!$success) {
-        $msg  = $deliver->dlv_msg . '<br>' .
+        $msg  = $deliver->dlv_msg . '<br />' .
                 _("Server replied: ") . $deliver->dlv_ret_nr . ' '.
                 $deliver->dlv_server_msg;
         require_once(SM_PATH . 'functions/display_messages.php');
@@ -302,7 +303,7 @@ function ClearAttachments() {
             if ($info['session'] == -1) {
                 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
                 if (file_exists($attached_file)) {
-                        unlink($attached_file);
+                    unlink($attached_file);
                 }
             } else {
                 $rem_attachments[] = $info;
@@ -369,9 +370,9 @@ function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
                          $color, $FirstTimeSee) {
     global $msn_user_support, $default_use_mdn, $default_use_priority,
            $show_xmailer_default, $mdn_user_support, $PHP_SELF, $javascript_on,
-          $squirrelmail_language;
+           $squirrelmail_language;
 
-    $mailbox = $aMailbox['NAME']       ;
+    $mailbox = $aMailbox['NAME'];
 
     $header = $message->rfc822_header;
     $env = array();
@@ -630,13 +631,13 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
     }
     // Show Alt URI for Draft/Sent
     if (isset($comp_alt_string))
-        $menu_row .= getButton('SUBMIT', $new_button, $comp_alt_string, $on_click) . "\n";
+        $menu_row .= getButton('submit', $new_button, $comp_alt_string, $on_click) . "\n";
 
-    $menu_row .= getButton('SUBMIT', 'smaction_reply', _("Reply"), $on_click) . "\n";
-    $menu_row .= getButton('SUBMIT', 'smaction_reply_all', _("Reply All"), $on_click) ."\n";
-    $menu_row .= getButton('SUBMIT', 'smaction_forward', _("Forward"), $on_click);
+    $menu_row .= getButton('submit', 'smaction_reply', _("Reply"), $on_click) . "\n";
+    $menu_row .= getButton('submit', 'smaction_reply_all', _("Reply All"), $on_click) ."\n";
+    $menu_row .= getButton('submit', 'smaction_forward', _("Forward"), $on_click);
     if ($enable_forward_as_attachment)
-        $menu_row .= '<input type="checkbox" name="smaction_attache">' . _("As Attachment") .'&nbsp;&nbsp;'."\n";
+        $menu_row .= '<input type="checkbox" name="smaction_attache" />' . _("As Attachment") .'&nbsp;&nbsp;'."\n";
 
     $menu_row .= '</form>&nbsp;';
 
@@ -648,10 +649,10 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
         if (!(isset($passed_ent_id) && $passed_ent_id)) {
             $menu_row .= addHidden('mailbox', $aMailbox['NAME']);
             $menu_row .= addHidden('msg[0]', $passed_id);
-            $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
-            $menu_row .= '<input type="checkbox" name="bypass_trash">' . _("Bypass Trash");
+            $menu_row .= getButton('submit', 'delete', _("Delete"));
+            $menu_row .= '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
         } else {
-            $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
+            $menu_row .= getButton('submit', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
         }
 
         $menu_row .= '</form>';
@@ -676,7 +677,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
         }
         $menu_row .= '</select> ';
 
-        $menu_row .= getButton('SUBMIT', 'moveButton',_("Move")) . "\n" . '</form>';
+        $menu_row .= getButton('submit', 'moveButton',_("Move")) . "\n" . '</form>';
     }
     $menu_row .= '</td></tr>';
 
@@ -849,7 +850,7 @@ $header = $message->header;
 if (isset($sendreceipt)) {
    if ( !$message->is_mdnsent ) {
       $final_recipient = '';
-      if ((isset($identity)) && ($identity != 0))      //Main identity
+      if ((isset($identity)) && ($identity != 0)) //Main identity
          $final_recipient = trim(getPref($data_dir, $username, 'email_address' . $identity, '' ));
       if ($final_recipient == '' )
          $final_recipient = trim(getPref($data_dir, $username, 'email_address', '' ));
@@ -879,7 +880,7 @@ $cnt = count($ent_ar);
 for ($i = 0; $i < $cnt; $i++) {
    $messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox);
    if ($i != $cnt-1) {
-       $messagebody .= '<hr noshade size=1 />';
+       $messagebody .= '<hr noshade size="1" />';
    }
 }
 
@@ -955,5 +956,4 @@ sqimap_logout($imapConnection);
 $mailbox_cache[$aMailbox['NAME']] = $aMailbox;
 sqsession_register($mailbox_cache,'mailbox_cache');
 ?>
-</body>
-</html>
+</body></html>