[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm
banghart
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 26 Jun 2007 23:06:21 -0000
banghart Tue Jun 26 19:06:21 2007 EDT
Modified files:
/loncom/interface lonindexer.pm
Log:
Saving work in progress. So far just adds useless checkbox
in front of directories.
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.159 loncom/interface/lonindexer.pm:1.160
--- loncom/interface/lonindexer.pm:1.159 Wed Jun 20 14:38:44 2007
+++ loncom/interface/lonindexer.pm Tue Jun 26 19:06:17 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.159 2007/06/20 18:38:44 banghart Exp $
+# $Id: lonindexer.pm,v 1.160 2007/06/26 23:06:17 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -350,6 +350,20 @@
my $js = <<"ENDHEADER";
<script type="text/javascript">
$catalogmodefunctions
+function checkAll(dir) {
+ var numForms = document.forms.length;
+ var dirLength = dir.length;
+ 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);
+ }
+ }
+ }
+}
function openWindow(url, wdwName, w, h, toolbar,scrollbar,locationbar) {
var xpos = (screen.width-w)/2;
xpos = (xpos < 0) ? '0' : xpos;
@@ -866,11 +880,14 @@
# display user directory
}
if ($filecom[1] eq 'user') {
- $r->print("<tr valign=$valign bgcolor=\"$fileclr\">$extrafield");
- $r->print("<td nowrap>\n");
+ # $r->print("<tr valign=$valign bgcolor=\"$fileclr\">$extrafield");
my $curdir = $startdir.$filecom[0].'/';
my $anchor = $curdir;
$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("<td nowrap>\n");
&begin_form ($r,$curdir);
$r->print ('<a name="'.$anchor.'"></a><img alt="" src="'.$iconpath.
'whitespace1.gif" border="0" />'."\n");