- did decodeHeader on to_ary and cc_ary
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 30 Jul 2000 18:12:53 +0000 (18:12 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 30 Jul 2000 18:12:53 +0000 (18:12 +0000)
- removed requirements for subject and body of message (by request
  from the list a while ago)
- fixed some language problems in help.php
- fixed some bugs with saving sent and trash folders in prefs
- let the searched results use message highlighting

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@653 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_search.php
src/compose.php
src/help.php
src/options.php
src/read_body.php

index b40cb4f..a82242f 100644 (file)
    if (!isset($mime_php))
       include("../functions/mime.php");
 
+   $imap_search_php = true;
+
 function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
-   global $msgs;
+   global $msgs, $message_highlight_list;
    $urlMailbox = urlencode($mailbox);
    
    # Construct the Search QuERY
@@ -55,9 +57,13 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
          $hdr = sqimap_get_small_header ($imapConnection, $messagelist[$q], true);
       else
          $hdr = sqimap_get_small_header ($imapConnection, $messagelist[$q], false);
-         $from[$q] = $hdr->from;
-         $date[$q] = $hdr->date;
-         $subject[$q] = $hdr->subject;
+                                               
+                       $from[$q] = $hdr->from;
+                       $date[$q] = $hdr->date;
+                       $subject[$q] = $hdr->subject;
+         $to[$q] = $hdr->to;
+         $priority[$q] = $hdr->priority;
+         $cc[$q] = $hdr->cc;
          $id[$q] = $messagelist[$q];
 
          $flags[$q] = sqimap_get_flags ($imapConnection, $messagelist[$q]);
@@ -70,9 +76,14 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
 
          $messages[$j]["TIME_STAMP"] = getTimeStamp($tmpdate);
          $messages[$j]["DATE_STRING"] = getDateString($messages[$j]["TIME_STAMP"]);
-         $messages[$j]["ID"] = $id[$j]; 
+         $messages[$j]["ID"] = $id[$j];
          $messages[$j]["FROM"] = decodeHeader($from[$j]);
+         $messages[$j]["FROM-SORT"] = strtolower(sqimap_find_displayable_name(decodeHeader($from[$j])));
          $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]);
+         $messages[$j]["SUBJECT-SORT"] = strtolower(decodeHeader($subject[$j]));
+         $messages[$j]["TO"] = decodeHeader($to[$j]);
+                       $messages[$j]["PRIORITY"] = $priority[$j];
+         $messages[$j]["CC"] = $cc[$j];
 
          $num = 0;
          while ($num < count($flags[$j])) {
@@ -166,7 +177,6 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
  
          while ($j < count($msgs)) {
             printMessageInfo($imapConnection, $msgs[$j]["ID"], 0, $j, $mailbox, "", 0, $search_where, $search_what);
-            //echo $msgs[$j]["SUBJECT"]."<br>";
             $j++;
          }
          echo "</table>";
index ccf4f7e..5617da7 100644 (file)
           error message, show=true **/
       global $body, $send_to, $subject, $color;
 
-      if ($body == "" && $subject == "") {
-         if ($show)
-            plain_error_message(_("You have not entered a message body or a subject."), $color);
-         return false;
-      } else if ($send_to == "") {
+      if ($send_to == "") {
          if ($show)
             plain_error_message(_("You have not filled in the \"To:\" field."), $color);
          return false;
index 60f9235..e8c4b43 100644 (file)
    if (!isset($auth_php))
       include ("../functions/auth.php"); 
 
-   if ($language) {
-      setcookie("squirrelmail_language", $language, time()+2592000);
-      $squirrelmail_language = $language;
-   }   
-
    include("../src/load_prefs.php");
    displayPageHeader($color, "None");
    is_logged_in(); 
        $helpdir[7] = "FAQ.hlp";
 
    /****************[ HELP FUNCTIONS ]********************/
+   // parses through and gets the information from the different documents.  
+   // this returns one section at a time.  You must keep track of the position
+   // so that it knows where to start to look for the next section.
+
    function get_info($doc, $pos) {
       for ($n=$pos; $n < count($doc); $n++) {
          if (trim(strtolower($doc[$n])) == "<chapter>" || trim(strtolower($doc[$n])) == "<section>") {
          $context = "read"; 
    }
    
-   if (file_exists("../help/$user_language")) {
+   if (file_exists("../help/$squirrelmail_language")) {
       $help_exists = true;
-      $user_language = $user_language;
    } else if (file_exists("../help/en")) {
       $help_exists = true;
       echo "<center><font color=\"$color[2]\">";
-      echo _("The help has not been translated to your preferred language.  It will be displayed in English instead.");
+      printf (_("The help has not been translated to %s.  It will be displayed in English instead."), $languages[$squirrelmail_language]["NAME"]);
       echo "</font></center><br>";
       $user_language = "en";
    } else {
index e32ef0d..1f7d38b 100644 (file)
          setPref($data_dir, $username, "move_to_trash", true);
          setPref($data_dir, $username, "trash_folder", $trash);
       } else {
-         setPref($data_dir, $username, "move_to_trash", false);
-         setPref($data_dir, $username, "trash_folder", "");
+         setPref($data_dir, $username, "move_to_trash", "0");
+         setPref($data_dir, $username, "trash_folder", "none");
       }
       if ($sent != "none") {
          setPref($data_dir, $username, "move_to_sent", true);
          setPref($data_dir, $username, "sent_folder", $sent);
       } else {
-         setPref($data_dir, $username, "move_to_sent", false);
-         setPref($data_dir, $username, "sent_folder", "");
+         setPref($data_dir, $username, "move_to_sent", "0");
+         setPref($data_dir, $username, "sent_folder", "none");
       } 
       setPref($data_dir, $username, "folder_prefix", $folderprefix);
       setPref($data_dir, $username, "unseen_notify", $unseennotify);
index 11829d6..59e6f0d 100644 (file)
    $to_string = "";
    $to_ary = $message->header->to;
    while ($i < count($to_ary)) {
-      $to_ary[$i] = htmlspecialchars($to_ary[$i]);
+      $to_ary[$i] = htmlspecialchars(decodeHeader($to_ary[$i]));
 
       if ($to_string)
          $to_string = "$to_string<BR>$to_ary[$i]";
    $i = 0;
    $cc_string = "";
    $cc_ary = $message->header->cc;
-   while ($i < count($cc_ary)) {
+   while ($i < count(decodeHeader($cc_ary))) {
       $cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
       if ($cc_string)
          $cc_string = "$cc_string<BR>$cc_ary[$i]";
    echo _("Message List");
    echo "</A>&nbsp;|&nbsp;";
    if ($where && $what) {
-      echo "               <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1&where=".urlencode($where)."&what=".urlencode($what)."\">";
+      echo "               <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."\">";
    } else {
       echo "               <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">";
    }