[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm
droeschl
droeschl@source.lon-capa.org
Fri, 17 Jul 2009 15:42:07 -0000
This is a MIME encoded message
--droeschl1247845327
Content-Type: text/plain
droeschl Fri Jul 17 15:42:07 2009 EDT
Modified files:
/loncom/interface lonindexer.pm
Log:
Improved XHTML validity.
--droeschl1247845327
Content-Type: text/plain
Content-Disposition: attachment; filename="droeschl-20090717154207.txt"
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.198 loncom/interface/lonindexer.pm:1.199
--- loncom/interface/lonindexer.pm:1.198 Fri Jul 3 09:59:06 2009
+++ loncom/interface/lonindexer.pm Fri Jul 17 15:42:07 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.198 2009/07/03 09:59:06 bisitz Exp $
+# $Id: lonindexer.pm,v 1.199 2009/07/17 15:42:07 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -184,7 +184,7 @@
$colspan=" colspan='2' ";
my $cl=&mt('Close');
$closebutton=<<END;
-<input type="button" name="close" value='$cl' onClick="self.close()" />
+<input type="button" name="close" value='$cl' onclick="self.close()" />
END
}
elsif ($env{'form.catalogmode'} eq 'import') {
@@ -196,11 +196,11 @@
my $cl=&mt('Close');
my $gi=&mt('Import');
$closebutton=<<END;
-<input type="button" name="close" value='$cl' onClick="self.close()" />
+<input type="button" name="close" value='$cl' onclick="self.close()" />
END
$groupimportbutton=<<END;
<input type="button" name="groupimport" value='$gi'
-onClick="javascript:select_group()" />
+onclick="javascript:select_group()" />
END
}
# Additions made by Matthew to make the browser a little easier to deal
@@ -361,6 +361,7 @@
my $js = <<"ENDHEADER";
<script type="text/javascript">
+// <![CDATA[
$catalogmodefunctions;
function update_only(field) {
alert(field.name);
@@ -405,6 +406,7 @@
function gothere(val) {
window.location=val+'?acts='+document.forms.fileattr.acts.value$inhibit_menu;
}
+// ]]>
</script>
ENDHEADER
@@ -446,7 +448,7 @@
}
} else {
for (my $i=0; $i<=16; $i++) {
- $attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
+ $attrchk[$i] = 'checked="checked"' if $hash{'display_attrs_'.$i} == 1;
}
}
@@ -478,34 +480,33 @@
'hd' => 'Display Options'
);
$r->print(<<END);
+<form method="post" name="fileattr" action="$uri" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>$lt{'hd'}</legend>
-<form method="post" name="fileattr" action="$uri"
- enctype="application/x-www-form-urlencoded">
-<label><input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}</label>
+<label><input type="checkbox" name="attr9" value="1" $attrchk[9] onclick="this.form.submit();" /> $lt{'av'}</label>
<table border="0">
<tr>
-<td><label><input type="checkbox" name="attr0" value="1" $attrchk[0] onClick="this.form.submit();" /> $lt{'ti'}</label></td>
-<td><label><input type="checkbox" name="attr4" value="1" $attrchk[4] onClick="this.form.submit();" /> $lt{'au'}</label></td>
-<td><label><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</label></td>
-<td><label><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</label></td>
-<td><label><input type="checkbox" name="attr13" value="1" $attrchk[13] onClick="this.form.submit();" /> $lt{'nt'}</label></td>
-<td><label><input type="checkbox" name="attr16" value="1" $attrchk[16] onClick="this.form.submit();" /> $lt{'sd'}</label></td>
+<td><label><input type="checkbox" name="attr0" value="1" $attrchk[0] onclick="this.form.submit();" /> $lt{'ti'}</label></td>
+<td><label><input type="checkbox" name="attr4" value="1" $attrchk[4] onclick="this.form.submit();" /> $lt{'au'}</label></td>
+<td><label><input type="checkbox" name="attr5" value="1" $attrchk[5] onclick="this.form.submit();" /> $lt{'kw'}</label></td>
+<td><label><input type="checkbox" name="attr6" value="1" $attrchk[6] onclick="this.form.submit();" /> $lt{'ln'}</label></td>
+<td><label><input type="checkbox" name="attr13" value="1" $attrchk[13] onclick="this.form.submit();" /> $lt{'nt'}</label></td>
+<td><label><input type="checkbox" name="attr16" value="1" $attrchk[16] onclick="this.form.submit();" /> $lt{'sd'}</label></td>
</tr>
<tr>
-<td><label><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</label></td>
-<td><label><input type="checkbox" name="attr2" value="1" $attrchk[2] onClick="this.form.submit();" /> $lt{'la'}</label></td>
-<td><label><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</label></td>
-<td><label><input type="checkbox" name="attr10" value="1" $attrchk[10] onClick="this.form.submit();" /> $lt{'sa'}</label></td>
-<td><label><input type="checkbox" name="attr14" value="1" $attrchk[14] onClick="this.form.submit();" /> $lt{'ab'}</label></td>
+<td><label><input type="checkbox" name="attr1" value="1" $attrchk[1] onclick="this.form.submit();" /> $lt{'si'}</label></td>
+<td><label><input type="checkbox" name="attr2" value="1" $attrchk[2] onclick="this.form.submit();" /> $lt{'la'}</label></td>
+<td><label><input type="checkbox" name="attr3" value="1" $attrchk[3] onclick="this.form.submit();" /> $lt{'lm'}</label></td>
+<td><label><input type="checkbox" name="attr10" value="1" $attrchk[10] onclick="this.form.submit();" /> $lt{'sa'}</label></td>
+<td><label><input type="checkbox" name="attr14" value="1" $attrchk[14] onclick="this.form.submit();" /> $lt{'ab'}</label></td>
<td> </td>
</tr>
<tr>
-<td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</label></td>
-<td><label><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</label></td>
-<td><label><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</label></td>
-<td><label><input type="checkbox" name="attr12" value="1" $attrchk[12] onClick="this.form.submit();" /> $lt{'sb'}</label></td>
-<td><label><input type="checkbox" name="attr15" value="1" $attrchk[15] onClick="this.form.submit();" /> $lt{'gl'}</label></td>
+<td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onclick="this.form.submit();" /> $lt{'st'}</label></td>
+<td><label><input type="checkbox" name="attr11" value="1" $attrchk[11] onclick="this.form.submit();" /> $lt{'li'}</label></td>
+<td><label><input type="checkbox" name="attr7" value="1" $attrchk[7] onclick="this.form.submit();" /> $lt{'sr'}</label></td>
+<td><label><input type="checkbox" name="attr12" value="1" $attrchk[12] onclick="this.form.submit();" /> $lt{'sb'}</label></td>
+<td><label><input type="checkbox" name="attr15" value="1" $attrchk[15] onclick="this.form.submit();" /> $lt{'gl'}</label></td>
<td> </td>
</tr>
</table>
@@ -529,7 +530,6 @@
$r->print($type_element
.'</fieldset>');
$r->print(<<END);
-<br />
<input type="submit" name="updatedisplay" value="$lt{'ud'}" />
<input type="hidden" name="acts" value="" />
$closebutton $groupimportbutton
@@ -563,8 +563,8 @@
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri);
# -------------------------------------------------- Check All and Uncheck all
if ($env{'form.catalogmode'} eq 'import') {
- $r->print('<br /><input type="button" value="'.&mt("Check All").'" id="checkallbutton" onClick="javascript:checkAll()" />');
- $r->print('<input type="button" value="'.&mt("Uncheck All").'" id="uncheckallbutton" onClick="javascript:uncheckAll()" />');
+ $r->print('<br /><input type="button" value="'.&mt("Check All").'" id="checkallbutton" onclick="javascript:checkAll()" />');
+ $r->print('<input type="button" value="'.&mt("Uncheck All").'" id="uncheckallbutton" onclick="javascript:uncheckAll()" />');
}
# ----------------- output starting row to the indexed file/directory hierarchy
#$r->print(&initdebug());
@@ -897,7 +897,7 @@
$r->print("<td>\n");
$r->print ('<form method="post" name="dirpathUP" action="'.$updir.
'/" '.
- 'onSubmit="return rep_dirpath(\'UP\','.
+ 'onsubmit="return rep_dirpath(\'UP\','.
'document.forms.fileattr.acts.value)" '.
'enctype="application/x-www-form-urlencoded"'.
'>'."\n");
@@ -905,8 +905,8 @@
$r->print ('<input type="hidden" name="openuri" value="'.
$startdir.'" />'."\n");
$r->print ('<input type="hidden" name="acts" value="" />'."\n");
- $r->print ('<a href="#" onClick="document.dirpathUP.submit()"><img src="'.$iconpath.'arrow.up.gif"');
- $r->print (' name="'.$msg.'" type="image" class="LC_fileicon" />'.
+ $r->print ('<a href="#" onclick="document.dirpathUP.submit()"><img src="'.$iconpath.'arrow.up.gif"');
+ $r->print (' alt="'.$msg.'" class="LC_fileicon" />'.
"\n");
$r->print(&mt("Up")."</a></form>$tabtag");
$r->print(&Apache::loncommon::end_data_table_row());
@@ -932,8 +932,8 @@
$anchor =~ s/\W//g;
$r->print ('<a name="'.$anchor.'"></a>');
$r->print ('<input type="hidden" name="acts" value="" />');
- $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).'.gif"');
- $r->print (' name="'.$msg.'" type="image" class="LC_fileicon" /></a>'.
+ $r->print ('<a href="#" onclick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).'.gif"');
+ $r->print (' alt="'.$msg.'" class="LC_fileicon" /></a>'.
"\n");
my $quotable_filecom = &Apache::loncommon::escape_single($filecom[0]);
$r->print ('<a href="javascript:gothere(\''.$quotable_filecom.
@@ -962,10 +962,10 @@
$r->print ('<a name="'.$anchor.'"></a><img alt="" src="'.$iconpath.
'whitespace_21.gif" class="LC_icon" />'."\n");
$r->print ('<input type="hidden" name="acts" value="" />');
- $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()">');
+ $r->print ('<a href="#" onclick="document.dirpath'.($dnum-1).'.submit()">');
$r->print ('<img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).
'.gif" class="LC_fileicon"');
- $r->print (' name="'.$msg.'"/></a>'.
+ $r->print (' alt="'.$msg.'"/></a>'.
"\n");
my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
$r->print ('<a href="javascript:gothere(\''.$quotable_curdir
@@ -1010,17 +1010,17 @@
$quotable_filelink,"')\">");
$r->print("<img alt=\"\" src='",$iconpath,"select.gif' class='LC_icon' /></a>".
"\n");
- $r->print('</td><td class="LC_middle"><span class="LC_nobreak">');
+ $r->print('</td><td class="LC_middle">');
} elsif ($env{'form.catalogmode'} eq 'import') {
$r->print("<form name='form$fnum' action=''>\n");
$r->print("<input type='checkbox' name='filelink"."' ".
- "value='$filelink' onClick='".
+ "value='$filelink' onclick='".
"javascript:queue(\"form$fnum\")' ");
if ($hash{'store_'.$filelink}) {
$r->print("checked");
}
$r->print(" />\n");
- $r->print('</form></td><td class="LC_middle"><span class="LC_nobreak">');
+ $r->print('</form></td><td class="LC_middle">');
$hash{"pre_${fnum}_link"}=$filelink;
$hash{"pre_${fnum}_title"}=$title;
if (!$hash{"pre_${fnum}_title"}) {
@@ -1037,8 +1037,8 @@
# General indentation
my $count = 0;
while ($count < $indent) {
- $r->print("<img alt=\"\" src=".$iconpath.
- "whitespace_21.gif class='LC_icon' />\n");
+ $r->print('<img alt="" src="'.$iconpath.'whitespace_21.gif"
+ class="LC_icon" />');
$count++;
}
# Sequence open/close icon
@@ -1048,10 +1048,10 @@
$anchor =~ s/\W//g;
$r->print ('<input type="hidden" name="acts" value="" />');
$r->print ('<a name="'.$anchor.'"></a>');
- $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()">');
+ $r->print ('<a href="#" onclick="document.dirpath'.($dnum-1).'.submit()">');
$r->print ('<img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).
'.gif" class="LC_fileicon"');
- $r->print (' name="'.$msg.'" type="image" class="LC_fileicon" /></a>'.
+ $r->print (' alt="'.$msg.'" /></a>'.
"\n");
}
# Filetype icons
@@ -1070,7 +1070,7 @@
if ($filelink=~/\.(page|sequence)$/) {
$r->print('</form>');
}
- $r->print("</span></td>\n");
+ $r->print("</td>\n");
if ($hash{'display_attrs_0'} == 1) {
$r->print('<td> '.($title eq '' ? ' ' : $title).
' </td>'."\n");
@@ -1147,7 +1147,7 @@
if ($hash{'display_attrs_7'} == 1) {
# Show resource
my $output=&showpreview($filelink);
- $r->print('<td> '.($output eq '' ? ' ':$output).
+ $r->print('<td class="LC_fontsize_medium LC_nobreak">'.($output eq '' ? ' ':$output).
" </td>\n");
}
@@ -1199,15 +1199,15 @@
my $indentm1 = $indent-1;
my $count = 0;
while ($count < $indentm1) {
- $r->print ("<img alt=\"\" src=",$iconpath
- ,"whitespace_21.gif class='LC_icon' />\n");
+ $r->print ('<img alt="" src="',$iconpath
+ ,'whitespace_21.gif" class="LC_icon" />');
$count++;
}
$r->print ('<input type="hidden" name="acts" value="" />');
$r->print ('<a name="'.$anchor.'"></a>');
- $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.
+ $r->print ('<a href="#" onclick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.
'arrow.'.($nowOpen ? "open" : "closed" ).'.gif"');
- $r->print (' name="'.$msg.'" class="LC_fileicon" /></a>'.
+ $r->print (' alt="'.$msg.'" class="LC_fileicon" /></a>'.
"\n");
my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
@@ -1346,7 +1346,6 @@
close(FH);
}
}
- $output='<span class="LC_fontsize_medium">'.$output.'</span>';
} elsif ($embstyle eq 'img') {
$output='<img alt="'.&mt('Preview').'" src="'.$filelink.'" />';
} elsif ($filelink=~m{^/res/($match_domain)/($match_username)/}) {
@@ -1377,7 +1376,7 @@
$uri=&Apache::loncommon::escape_single($uri);
$r->print ('<form method="post" name="dirpath'.$dnum.'" action="'.$uri.
'#'.$anchor.
- '" onSubmit="return rep_dirpath(\''.$dnum.'\''.
+ '" onsubmit="return rep_dirpath(\''.$dnum.'\''.
',document.forms.fileattr.acts.value)" '.
'enctype="application/x-www-form-urlencoded">'."\n");
$r->print ('<input type="hidden" name="openuri" value="'.$uri.'" />'.
--droeschl1247845327--