Explorar o código

Modifications to respect way back to search from reading.

philippe_mingo %!s(int64=23) %!d(string=hai) anos
pai
achega
228080ecb5
Modificáronse 4 ficheiros con 19 adicións e 8 borrados
  1. 9 4
      functions/imap_messages.php
  2. 8 3
      functions/imap_search.php
  3. 1 0
      functions/mailbox_display.php
  4. 1 1
      src/search.php

+ 9 - 4
functions/imap_messages.php

@@ -448,12 +448,17 @@ function sqimap_messages_copy ($imap_stream, $start, $end, $mailbox) {
          /** SUBJECT **/
          else if (strtolower(substr($read[$i], 0, 8)) == "subject:") {
             $hdr->subject = trim(substr($read[$i], 8, strlen($read[$i]) - 9));
-            if (strlen(Chop($hdr->subject)) == 0)
+            if (strlen(Chop($hdr->subject)) == 0) {
                $hdr->subject = _("(no subject)");
-
-            if ($where == "SUBJECT") {
-               $hdr->subject = eregi_replace($what, "<b>\\0</b>", $hdr->subject);
             }
+            
+            /*  
+            if ($where == 'SUBJECT') {
+                $hdr->subject = $what;
+               // $hdr->subject = eregi_replace($what, "<b>\\0</b>", $hdr->subject);
+            }
+            */
+            
             $i++;
          }
          /** CC **/

+ 8 - 3
functions/imap_search.php

@@ -17,9 +17,12 @@ require_once('../functions/array.php');
 require_once('../functions/mailbox_display.php');
 require_once('../functions/mime.php');
 
-function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
+function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color, $search_position = '') {
 
     global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order;
+    global $pos;
+
+    $pos = $search_position;
 
     $urlMailbox = urlencode($mailbox);
     $isid = sqimap_session_id();
@@ -141,10 +144,12 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
 
     if (count($messagelist) > 0) {
         $j=0;
-        if (!isset ($msg)) { $msg = ""; }
+        if (!isset ($msg)) { 
+            $msg = ''; 
+        }
 
         mail_message_listing_beginning( $imapConnection,
-            "move_messages.php?msg=$msg&mailbox=$urlMailbox&where=" . urlencode($search_where) . "&what=".urlencode($search_what),
+            "move_messages.php?msg=$msg&mailbox=$urlMailbox&pos=$pos&where=" . urlencode($search_where) . "&what=".urlencode($search_what),
             $mailbox,
             -1,
             '<b>' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '</b>',

+ 1 - 0
functions/mailbox_display.php

@@ -21,6 +21,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start
     global $default_use_priority;
     global $message_highlight_list;
     global $index_order;
+    global $pos;            /* Search postion (if any)  */
 
     $color_string = $color[4];
     if ($GLOBALS['alt_index_colors']) {

+ 1 - 1
src/search.php

@@ -123,7 +123,7 @@ $where = "where$pos";
 
 if (isset($$where) && $$where && isset($$what) && $$what) {
     sqimap_mailbox_select($imapConnection, $mailbox);
-    sqimap_search($imapConnection, $$where, $$what, $mailbox, $color);
+    sqimap_search($imapConnection, $$where, $$what, $mailbox, $color, $pos);
 }
 do_hook("search_bottom");
 sqimap_logout ($imapConnection);