where/what support
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 30 Jul 2002 11:42:18 +0000 (11:42 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 30 Jul 2002 11:42:18 +0000 (11:42 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3183 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
src/read_body.php
src/search.php

index a7af8bdf67f01d9fa7ec16175503f35fee29223a..0a139ed1d9d141f602cb1404774929d5c5b1d0a3 100644 (file)
 require_once('../functions/strings.php');
 require_once('../functions/html.php');
 require_once('../class/html.class.php');
-require_once('../functions/imap_utf7_decode_local.php');
+require_once('../functions/imap_mailbox.php');
 
 /* Default value for page_selector_max. */
 define('PG_SEL_MAX', 10);
 
 function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, 
-                          $start_msg) {
+                          $start_msg, $where, $what) {
     global $checkall,
            $color, $msgs, $msort,
            $default_use_priority,
@@ -109,6 +109,11 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox,
         $fontstr_end = '';
     }
 
+    if ($where && $what) {
+        $searchstr = '&amp;where='.$where.'&amp;what='.$what;
+    } else {
+        $searchstr = '';
+    }  
     /**
     * AAAAH! Make my eyes stop bleeding!
     * Who wrote this?!
@@ -178,8 +183,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox,
                 }
                 $td_str .= '<a href="read_body.php?mailbox='.$urlMailbox
                             .'&amp;passed_id='. $msg["ID"]
-                             . '&amp;startMessage='.$start_msg
-                            .'&amp;show_more=0"';
+                             . '&amp;startMessage='.$start_msg.$searchstr.'"';
                 do_hook("subject_link");
                 if ($subject != $msg['SUBJECT']) {
                     $title = get_html_translation_table(HTML_SPECIALCHARS);
@@ -628,7 +632,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
     } while (isset ($key) && ($k < $i));
     do {
       printMessageInfo($imapConnection, $t, $i, $key, $mailbox, 
-                      $real_startMessage);
+                      $real_startMessage, $where, $what);
       $key = key($msort);
       $t++;
       $i++;
index 1842480792fc67d4aa7b3abc23581fbaeda9148c..04fd2280e92ef76d6b3fc908892974501440bee2 100644 (file)
@@ -389,16 +389,15 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
 
    $msgs_url = $base_uri . 'src/';
    if (isset($where) && isset($what)) {
-      if ($pos == '') {
-          $pos=0;
-      }
-      $msgs_url .= 'search.php?where='.urlencode($where).'&amp;pos='.$pos.
+      $msgs_url .= 'search.php?where='.urlencode($where).
                    '&amp;what='.urlencode($what).'&amp;mailbox='.$urlMailbox;
+      $msgs_str = _("Search results");            
    } else {
       $msgs_url .= 'right_main.php?sort='.$sort.'&amp;startMessage='.
                   $startMessage.'&amp;mailbox='.$urlMailbox;
+      $msgs_str = _("Message List");
    }
-   $s .= '<a href="'. $msgs_url.'">'._("Message List").'</a>';
+   $s .= '<a href="'. $msgs_url.'">'.$msgs_str.'</a>';
    $s .= $topbar_delimiter;
    
    $delete_url = $base_uri . 'src/delete_message.php?mailbox='.$urlMailbox.
index cdd37727ea6b50512b6c86bf72ce9fed7c54b1cc..3acc5b1262274dc0fea371b4eb4e21e19dcd48c4 100644 (file)
@@ -12,7 +12,7 @@
 require_once('../src/validate.php');
 require_once('../functions/imap.php');
 require_once('../functions/imap_search.php');
-require_once('../functions/imap_utf7_decode_local.php');
+require_once('../functions/imap_mailbox.php');
 require_once('../functions/array.php');
 require_once('../functions/strings.php');
 
@@ -159,7 +159,7 @@ function save_recent($save_index, $username, $data_dir) {
     }
 }
 
-function printSearchMessages($msgs,$mailbox, $cnt, $imapConnection, $usecache = false, $newsort = false) {
+function printSearchMessages($msgs,$mailbox, $cnt, $imapConnection, $where, $what, $usecache = false, $newsort = false) {
     global $sort, $color;
     
     $msort = calc_msort($msgs, $sort);
@@ -181,7 +181,7 @@ function printSearchMessages($msgs,$mailbox, $cnt, $imapConnection, $usecache =
        printHeader($mailbox, 6, $color, false);
 
        displayMessageArray($imapConnection, $cnt, 1, 
-                         $msort, $mailbox, $sort, $color, $cnt);
+                         $msort, $mailbox, $sort, $color, $cnt, $where, $what);
 
        mail_message_listing_end($cnt, '', $msg_cnt_str, $color); 
     }
@@ -448,7 +448,7 @@ if ($search_all == 'all') {
             $msgs = sqimap_search($imapConnection, $where, $what, $mailbox, $color, 0, $search_all, $count_all);
            $count_all = count($msgs);
             printSearchMessages($msgs, $mailbox, $count_all, $imapConnection, 
-                               false, false);
+                               $where, $what, false, false);
             array_push($perbox_count, $count_all);
         }
     }
@@ -472,7 +472,7 @@ else {
         $msgs = sqimap_search($imapConnection, $where, $what, $mailbox, $color, 0, $search_all, $count_all);
        if (count($msgs)) {
            printSearchMessages($msgs, $mailbox, count($msgs), $imapConnection,
-                              false, false);
+                              $where, $what, false, false);
        } else {
            echo '<br><center>' . _("No Messages Found") . '</center>';
        }