[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm

banghart lon-capa-cvs-allow@mail.lon-capa.org
Wed, 27 Jun 2007 16:35:57 -0000


banghart		Wed Jun 27 12:35:57 2007 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  	Bug 4773. Import folder in its entirety.
  	It might work, needs more testing. Also needs 
  	a "check all" button.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.160 loncom/interface/lonindexer.pm:1.161
--- loncom/interface/lonindexer.pm:1.160	Tue Jun 26 19:06:17 2007
+++ loncom/interface/lonindexer.pm	Wed Jun 27 12:35:55 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.160 2007/06/26 23:06:17 banghart Exp $
+# $Id: lonindexer.pm,v 1.161 2007/06/27 16:35:55 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -353,13 +353,18 @@
 function checkAll(dir) {
     var numForms = document.forms.length;
     var dirLength = dir.length;
+    var dirCheckbox = document.getElementById(dir);
     for (i=0;i<numForms;i++) {
         var numElements = document.forms[i].elements.length;
         for (j=0;j<numElements;j++){
             var fieldVal = document.forms[i].elements[j].value;
             var comp = fieldVal.substr(0,dirLength);
             if ((comp == dir) && (dirLength < fieldVal.length)) {
-                //alert(document.forms[i].elements[j].value);
+                if (dirCheckbox.checked == true) {
+                    document.forms[i].elements[j].checked = true;
+                } else {
+                    document.forms[i].elements[j].checked = false;
+                }
             }
         }
     }
@@ -886,7 +891,7 @@
 	$anchor =~ s/\///g;
 	$r->print("<tr valign=$valign bgcolor=\"$fileclr\">");
 	$r->print("<td>\n");
-	$r->print("<input type=\"checkbox\" name=\"tester\" value=\"$curdir\" onClick=\"javascript:checkAll('$curdir')\" /></td>\n");
+	$r->print("<input type=\"checkbox\" name=\"$curdir\" id=\"$curdir\" value=\"$curdir\" onClick=\"javascript:checkAll('$curdir')\" /></td>\n");
 	$r->print("<td nowrap>\n");
 	&begin_form ($r,$curdir);
 	$r->print ('<a name="'.$anchor.'"></a><img alt="" src="'.$iconpath.