Prechádzať zdrojové kódy

Added javascript select all code
Untested -- I'm using CVS to transfer this patch to another box

Tyler Akins 24 rokov pred
rodič
commit
f3434a3bb2
1 zmenil súbory, kde vykonal 23 pridanie a 7 odobranie
  1. 23 7
      functions/mailbox_display.php

+ 23 - 7
functions/mailbox_display.php

@@ -591,20 +591,36 @@
    {
    {
        global $checkall, $PHP_SELF, $what, $where, $mailbox;
        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
        else
-           echo "checkall=1";
+           echo '1';
        if (isset($where) && isset($what))
        if (isset($where) && isset($what))
-           echo "&where=" . urlencode($where) . "&what=" . urlencode($what);
+           echo '&where=' . urlencode($where) . '&what=' . urlencode($what);
        echo "\">";
        echo "\">";
        if (isset($checkall) && $checkall == '1')
        if (isset($checkall) && $checkall == '1')
            echo _("Unselect All");
            echo _("Unselect All");
        else
        else
            echo _("Select All");
            echo _("Select All");
-       echo "</A>\n";
+       echo "</A>\n</noscript>\n";
    }
    }
 
 
    function processSubject($subject)
    function processSubject($subject)