Fixed "Select All" link problem for searches.
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 4 Feb 2001 01:56:08 +0000 (01:56 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 4 Feb 2001 01:56:08 +0000 (01:56 +0000)
Made Select/Unselect All link a function, so we can put it at the bottom of
searches too.
Made Select/Unselect All link to the current page instead of hardcoding it.

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

functions/mailbox_display.php

index 1e4b69c82c6697d464a9b835cfe228030ce32c89..f52cd1229c79c18841e6485f1395a90e3ba0352b 100644 (file)
       echo '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>';
       echo "$More</td><td align=right>\n";
       if (!$startMessage) $startMessage=1;
-      if ( $checkall == '1')
-         echo "\n<A HREF=\"right_main.php?mailbox=$urlMailbox&startMessage=$real_startMessage&sort=$sort\">" . _("Unselect All") . "</A>\n";
-      else
-         echo "\n<A HREF=\"right_main.php?mailbox=$urlMailbox&startMessage=$real_startMessage&sort=$sort&checkall=1\">" . _("Select All") . "</A>\n";
+      ShowSelectAllLink($startMessage, $sort);
 
       echo '</td></tr></table>';
       echo '</td></tr>';
       echo "<TR BGCOLOR=\"$color[4]\"><TD>";
       echo '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>';
       echo "$More</td><td align=right>\n";
-      if ( $checkall == '1')
-         echo "\n<A HREF=\"right_main.php?mailbox=$urlMailbox&startMessage=$startMessage&sort=$sort\">" . _("Unselect All") . "</A>\n";
-      else
-         echo "\n<A HREF=\"right_main.php?mailbox=$urlMailbox&startMessage=$startMessage&sort=$sort&checkall=1\">" . _("Select All") . "</A>\n";
+      ShowSelectAllLink($startMessage, $sort);
 
       echo '</td></tr></table>';
       echo '</td></tr>';
       }
       echo "</TR>\n";
    }
+   
+   function ShowSelectAllLink($startMessage, $sort)
+   {
+       global $checkall, $PHP_SELF, $what, $where, $mailbox;
+       
+       echo "\n<A HREF=\"$PHP_SELF?mailbox=" . urlencode($mailbox) .
+           "&startMessage=$startMessage&sort=$sort&";
+       if ( isset($checkall) && $checkall == '1')
+           echo "checkall=0";
+       else
+           echo "checkall=1";
+       if (isset($where) && isset($what))
+           echo "&where=" . urlencode($where) . "&what=" . urlencode($what);
+       echo "\">";
+       if (isset($checkall) && $checkall == '1')
+           echo _("Unselect All");
+       else
+           echo _("Select All");
+       echo "</A>\n";
+   }
+   
 ?>