Added javascript select all code
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Jul 2001 13:08:48 +0000 (13:08 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Jul 2001 13:08:48 +0000 (13:08 +0000)
Untested -- I'm using CVS to transfer this patch to another box

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

functions/mailbox_display.php

index 0947bc6..dc36a47 100644 (file)
    {
        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";
+?>
+<script language="JavaScript">
+<!--
+   function CheckAll() {
+      for (var i = 0; i < document.List.elements.length; i++) {
+         var e = document.List.elements[i];
+        if (e.name != 'allbox')
+           e.checked = document.List.allbox.checked;
+      }
+   }
+//-->
+<input name="allbox" type="checkbox"
+    value="Check All" onClick="CheckAll();"> <B>Select all</B>
+</script>
+<noscript>
+<a href="<?PHP echo $PHP_SELF ?>?mailbox=<?PHP echo urlencode($mailbox)
+?>&startMessage=<?PHP echo $startMessage ?>&sort=<?PHP echo $sort
+?>&checkall=<?PHP
+       if (isset($checkall) && $checkall == '1')
+           echo '0';
        else
-           echo "checkall=1";
+           echo '1';
        if (isset($where) && isset($what))
-           echo "&where=" . urlencode($where) . "&what=" . urlencode($what);
+           echo '&where=' . urlencode($where) . '&what=' . urlencode($what);
        echo "\">";
        if (isset($checkall) && $checkall == '1')
            echo _("Unselect All");
        else
            echo _("Select All");
-       echo "</A>\n";
+       echo "</A>\n</noscript>\n";
    }
 
    function processSubject($subject)