Code didn't work for me either, but I cleaned it up a bit and made it easier
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Jul 2001 13:26:36 +0000 (13:26 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Jul 2001 13:26:36 +0000 (13:26 +0000)
for someone to fix later -- just uncomment a lot of stuff.

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

functions/mailbox_display.php

index dc36a47c812cbaefd858c3ecd327acb1e83a6846..1298b6b25dd5432ebac04145ad0b5f7bb5e6a0a1 100644 (file)
    {
        global $checkall, $PHP_SELF, $what, $where, $mailbox;
        
-?>
-<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 you can figure out some working javascript,
+       // feel free to put it in here!
+       // Allegedly this stuff works for someone somewhere
+       // Don't forget to uncomment the </noscript> at the end!
+       
+       // This code is from Kevin Cawthorne <kevin at intuitive.net>
+       // It was adapted by Tyler to use a document.write for drawing the
+       // input checkbox and to use the <noscript> and old style selection
+       // for non-javascript browsers.
+
+       // echo "<script language=\"JavaScript\">\n";
+       // echo "<!--\n";
+       // echo "function CheckAll() {\n";
+       // echo "   for (var i = 0; i < document.List.elements.length; i++) {\n";
+       // echo "      var e = document.List.elements[i];\n";
+       // echo "      if (e.name != 'allbox')\n";
+       // echo "         e.checked = document.List.allbox.checked;\n";
+       // echo "   }\n";
+       // echo "}\n";
+       // echo "document.write(\"<input name=\\\"allbox\\\" " .
+       //    "type=\\\"checkbox\\\" value=\\\"Check All\\\" " .
+       //    "onClick=\\\"CheckAll();\\\"> <B>" . _("Select All") .
+       //    "</B>\n");
+       // echo "//-->\n";
+       // echo "</script><noscript>\n";
+
+       echo "<a href=\"$PHP_SELF?mailbox=" . urlencode($mailbox) .
+          "&startMessage=$startMessage&sort=$sort&checkall=";
        if (isset($checkall) && $checkall == '1')
            echo '0';
        else
            echo _("Unselect All");
        else
            echo _("Select All");
-       echo "</A>\n</noscript>\n";
+          
+       // If a javascript selection solution can be created eventually,
+       // do not forget to uncomment this line too!
+       // echo "</A>\n</noscript>\n";
    }
 
    function processSubject($subject)