fix typo in address group.
[squirrelmail.git] / src / search.php
index 9e050fd287377cec4f86baafa120448431bd2043..934ff4913c592a52bfc1b682f8293c8bb1f3cf4e 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * search.php
  *
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * IMAP search page
@@ -860,8 +860,8 @@ function asearch_print_form_basic($imapConnection, &$boxes, $mailbox_array, $bio
 /** Print the $msgs messages from $mailbox mailbox
  */
 
-function asearch_print_mailbox_msgs($imapConnection, &$aMailbox, $color)
-{
+function asearch_print_mailbox_msgs($imapConnection, &$aMailbox, $color) {
+    global $javascript_on, $compact_paginator;
     /**
      * A mailbox can contain different sets with uid's. Default, for normal
      * message list view we use '0' as setindex and for search a different
@@ -878,12 +878,24 @@ function asearch_print_mailbox_msgs($imapConnection, &$aMailbox, $color)
     $cnt = count($aMailbox['UIDSET'][$iSetIndx]);
 
     $iLimit = ($aMailbox['SHOWALL'][$iSetIndx]) ? $cnt : $aMailbox['LIMIT'];
-    $iEnd = ($aMailbox['PAGEOFFSET'] + ($iLimit - 1) < $aMailbox['EXISTS']) ?
-            $aMailbox['PAGEOFFSET'] + $iLimit - 1 : $cnt;
+    $iEnd = ($aMailbox['PAGEOFFSET'] + ($iLimit - 1) < $cnt) ?
+            $aMailbox['PAGEOFFSET'] + ($iLimit - 1) : $cnt;
 
     $paginator_str = get_paginator_str($aMailbox['NAME'], $aMailbox['PAGEOFFSET'],
                                     $cnt, $aMailbox['LIMIT'], $aMailbox['SHOWALL'][$iSetIndx]);
 
+    if ($javascript_on && $compact_paginator) {
+    echo "\n<!-- start of compact paginator javascript -->\n"
+    . "<script language=\"JavaScript\">\n"
+    . "function SubmitOnSelect(select, URL)\n"
+    . "{\n"
+    . "   URL += select.options[select.selectedIndex].value;\n"
+    . "   window.location.href = URL;\n"
+    . "}\n"
+    . "</script>\n"
+    . "<!-- end of compact paginator javascript -->\n";
+    }
+
     $msg_cnt_str = get_msgcnt_str($aMailbox['PAGEOFFSET'], $iEnd,$cnt);
 
     echo '<table border="0" width="100%" cellpadding="0" cellspacing="0">';
@@ -909,7 +921,7 @@ function asearch_print_mailbox_msgs($imapConnection, &$aMailbox, $color)
     mail_message_listing_end($cnt, '', $msg_cnt_str);
     echo '</td></tr>';
 
-    echo '</table>';
+    echo '</table></form>';
 }
 
 /**
@@ -1030,6 +1042,7 @@ if (isset($_GET['mailbox'])) {
     }
 } else {
     $mailbox_array = array();
+    $targetmailbox = array();
 }
 $aMailboxGlobalPref = array(
                        MBX_PREF_SORT         => 0,