fixed color problems with error messagees in compose.
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 24 Mar 2000 12:24:47 +0000 (12:24 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 24 Mar 2000 12:24:47 +0000 (12:24 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@329 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php
src/compose.php

index f92a6184d07edc93602ac7bfd6bfdc7126e601cf..963f7d43faea7831e12f2201c3305cf068e4835f 100755 (executable)
@@ -83,7 +83,6 @@
     ******************************************************************************/
    function sqimap_mailbox_delete ($imap_stream, $mailbox) {
       fputs ($imap_stream, "a001 DELETE \"$mailbox\"\r\n");
-      echo "mailbox: $mailbox<BR>";
       $read_ary = sqimap_read_data($imap_stream, "a001", true, $response, $message);
       sqimap_unsubscribe ($imap_stream, $mailbox);
    }
index 3571c55ec5e4fba683e3ffe13b9988ac65f32fe9..000eb0f09c270369991351eab0a4b2a377c0ce83 100644 (file)
       echo "</CENTER>";
    }
 
-   function checkInput () {
-      global $body, $send_to, $subject;
+   function checkInput ($show) {
+      /** I implemented the $show variable because the error messages
+          were getting sent before the page header.  So, I check once
+          using $show=false, and then when i'm ready to display the
+          error message, show=true **/
+      global $body, $send_to, $subject, $color;
 
       if ($body == "") {
-         plain_error_message(_("You have not entered a message body."), $color);
+         if ($show)
+            plain_error_message(_("You have not entered a message body."), $color);
          return false;
       } else if ($send_to == "") {
-         displayPageHeader($color, "None");
-         plain_error_message(_("You have not filled in the \"To:\" field."), $color);
+         if ($show)
+            plain_error_message(_("You have not filled in the \"To:\" field."), $color);
          return false;
       } else if ($subject == "") {
-         plain_error_message(_("You have not entered a subject."), $color);
+         if ($show)
+            plain_error_message(_("You have not entered a subject."), $color);
          return false;
       }
       return true;
    } // function checkInput()
 
    if(isset($send)) {
-      if (checkInput()) {
+      if (checkInput(false)) {
          sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body);
          header ("Location: right_main.php");
       } else {
          echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
          $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
          displayPageHeader($color, "None");
-
+         checkInput(true);
+         
          showInputForm();
       }
    } else if (isset($attach)) {