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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Wed, 27 Jun 2007 22:39:48 -0000


This is a MIME encoded message

--albertel1182983988
Content-Type: text/plain

albertel		Wed Jun 27 18:39:48 2007 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  - fix html errors in lonindexer
  - some cssing starts
  
  
--albertel1182983988
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20070627183948.txt"

Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.161 loncom/interface/lonindexer.pm:1.162
--- loncom/interface/lonindexer.pm:1.161	Wed Jun 27 12:35:55 2007
+++ loncom/interface/lonindexer.pm	Wed Jun 27 18:39:48 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.161 2007/06/27 16:35:55 banghart Exp $
+# $Id: lonindexer.pm,v 1.162 2007/06/27 22:39:48 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -174,7 +174,7 @@
 	if ($env{'form.catalogmode'} eq 'interactive') {
 	    $extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'.
 		'<img alt="" src="'.$iconpath.'whitespace1.gif"'.
-		' border="0" /></td>';
+		' class="LC_icon" /></td>';
 	    $colspan=" colspan='2' ";
             my $cl=&mt('Close');
             $closebutton=<<END;
@@ -184,7 +184,7 @@
 	elsif ($env{'form.catalogmode'} eq 'import') {
 	    $extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'.
 		'<img alt="" src="'.$iconpath.'whitespace1.gif"'.
-		' border="0" /></td>';
+		' class="LC_icon" /></td>';
 	    $colspan=" colspan='2' ";
 	    my $cl=&mt('Close');
             my $gi=&mt('Import');
@@ -843,7 +843,7 @@
 		   $startdir.'" />'."\n");
 	$r->print ('<input type="hidden" name="acts" value="" />'."\n");
 	$r->print ('<input src="'.$iconpath.'arrow_up.gif"');
-	$r->print (' name="'.$msg.'" height="22" type="image" border="0" />'.
+	$r->print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
 		   "\n");
 	$r->print(&mt("Up")."</form>$tabtag</tr>\n");
 	return OK;
@@ -863,17 +863,17 @@
 	$r->print("<td>");
 	&begin_form ($r,$filecom[0]);
 	my $anchor = $filecom[0];
-	$anchor =~ s/\///g;
+	$anchor =~ s/\W//g;
 	$r->print ('<a name="'.$anchor.'"></a>');
 	$r->print ('<input type="hidden" name="acts" value="" />');
 	$r->print ('<input src="'.$iconpath.'folder_pointer_'.
 		   $diropen.'.gif"'); 
-	$r->print (' name="'.$msg.'" height="22" type="image" border="0" />'.
+	$r->print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
 		   "\n");
 	my $quotable_filecom = &Apache::loncommon::escape_single($filecom[0]);
 	$r->print ('<a href="javascript:gothere(\''.$quotable_filecom.
 		   '\')"><img alt="" src="'.$iconpath.'server.gif"');
-	$r->print (' border="0" /></a>'."\n");
+	$r->print (' class="LC_icon" /></a>'."\n");
 	$r->print (&mt("Domain")." - $listname ");
 	if (&Apache::lonnet::domain($listname,'description')) {
 	    $r->print("(".&Apache::lonnet::domain($listname,'description').
@@ -888,24 +888,23 @@
 	# $r->print("<tr valign=$valign bgcolor=\"$fileclr\">$extrafield");
 	my $curdir = $startdir.$filecom[0].'/';
 	my $anchor = $curdir;
-	$anchor =~ s/\///g;
+	$anchor =~ s/\W//g;
 	$r->print("<tr valign=$valign bgcolor=\"$fileclr\">");
 	$r->print("<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.
-		   'whitespace1.gif" border="0" />'."\n");
+		   'whitespace1.gif" class="LC_icon" />'."\n");
 	$r->print ('<input type="hidden" name="acts" value="" />');
 	$r->print ('<input src="'.$iconpath.'folder_pointer_'.$diropen.
 		   '.gif"'); 
-	$r->print (' name="'.$msg.'" height="22" type="image" border="0" />'.
+	$r->print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
 		   "\n");
 	my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
 	$r->print ('<a href="javascript:gothere(\''.$quotable_curdir
-		   .'\')"><img alt="" src='.
-		   $iconpath.'quill.gif border="0" name="'.$msg.
-		   '" height="22" /></a>');
+		   .'\')"><img alt="'.$msg.'" src="'.
+		   $iconpath.'quill.gif" class="LC_indexer_icon" /></a>');
 	my $domain=(split(m|/|,$startdir))[2];
 	my $plainname=&Apache::loncommon::plainname($listname,$domain);
 	$r->print ($listname);
@@ -935,7 +934,7 @@
 	    my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
             $r->print("<a href=\"javascript:select_data(\'",
                       $quotable_filelink,"')\">");
-	    $r->print("<img alt=\"\" src='",$iconpath,"select.gif' border='0' /></a>".
+	    $r->print("<img alt=\"\" src='",$iconpath,"select.gif' class='LC_icon' /></a>".
 		      "\n");
 	    $r->print("</td><td nowrap='nowrap' valign='top'>");
 	} elsif ($env{'form.catalogmode'} eq 'import') {
@@ -954,49 +953,47 @@
 # Form to open or close sequences
 	if ($filelink=~/\.(page|sequence)$/) {
 	    my $curdir = $startdir.$filecom[0].'/';
-	    my $anchor = $curdir;
-	    $anchor =~ s/\///g;
 	    &begin_form($r,$curdir);
 	    $indent--;
 	}
 # General indentation
 	if ($indent > 0 and $indent < 11) {
-	    $r->print("<img alt=\"\" src=",$iconpath,"whitespace",$indent,
-		      ".gif border='0' />\n");
+	    $r->print("<img alt=\"\" src='",$iconpath,"whitespace",$indent,
+		      ".gif' class='LC_icon' />\n");
 	} elsif ($indent >0) {
 	    my $ten = int($indent/10.);
 	    my $rem = $indent%10.0;
 	    my $count = 0;
 	    while ($count < $ten) {
-		$r->print("<img alt=\"\" src=",$iconpath,
-			  "whitespace10.gif border='0' />\n");
+		$r->print("<img alt=\"\" src=".$iconpath.
+			  "whitespace10.gif class='LC_icon' />\n");
 	    $count++;
 	    }
 	    $r->print("<img alt=\"\" src=",$iconpath,"whitespace",$rem,
-		      ".gif border='0' />\n") if $rem > 0;
+		      ".gif class='LC_icon' />\n") if $rem > 0;
 	}
 # Sequence open/close icon
 	if ($filelink=~/\.(page|sequence)$/) {
 	    my $curdir = $startdir.$filecom[0].'/';
 	    my $anchor = $curdir;
-	    $anchor =~ s/\///g;
+	    $anchor =~ s/\W//g;
 	    $r->print ('<input type="hidden" name="acts" value="" />');
 	    $r->print ('<a name="'.$anchor.'"></a><input src="'.$iconpath.
 		       'folder_pointer_'.$diropen.'.gif"');
-	    $r->print (' name="'.$msg.'" height="22" type="image" border="0" />'.
+	    $r->print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
 		       "\n");
 	}
 # Filetype icons
-	$r->print("<img alt=\"\" src='$iconname' border='0' />\n");
+	$r->print("<img alt=\"\" src='$iconname' class='LC_icon' />\n");
 	my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
 
 
 	$r->print (" <a href=\"javascript:openWindow('".$quotable_filelink.
-		   "', 'previewfile', '450', '500', 'no', 'yes','yes');\"".
+		   "','previewfile','450','500','no','yes','yes');\"".
 		   " target=\"_self\">$listname</a> ");
 
 	$r->print (" (<a href=\"javascript:openWindow('".$quotable_filelink.
-		   ".meta', 'metadatafile', '500', '550', 'no', 'yes','no');\" ".
+		   ".meta','metadatafile','500','550','no','yes','no');\" ".
 		   " target=\"_self\">metadata</a>) ");
 # Close form to open/close sequence
 	if ($filelink=~/\.(page|sequence)$/) {
@@ -1093,35 +1090,35 @@
     if ($fnptr == $dirptr) {
 	my $curdir = $startdir.$filecom[0].'/';
 	my $anchor = $curdir;
-	$anchor =~ s/\///g;
+	$anchor =~ s/\W//g;
 	$r->print("<tr bgcolor=\"$fileclr\">$extrafield<td valign=$valign>");
 	&begin_form ($r,$curdir);
 	my $indentm1 = $indent-1;
 	if ($indentm1 < 11 and $indentm1 > 0) {
 	    $r->print("<img alt=\"\" src=",$iconpath,"whitespace",$indentm1,
-		      ".gif border='0' />\n");
+		      ".gif class='LC_icon' />\n");
 	} else {
 	    my $ten = int($indentm1/10.);
 	    my $rem = $indentm1%10.0;
 	    my $count = 0;
 	    while ($count < $ten) {
 		$r->print ("<img alt=\"\" src=",$iconpath
-			   ,"whitespace10.gif border='0' />\n");
+			   ,"whitespace10.gif class='LC_icon' />\n");
 		$count++;
 	    }
 	    $r->print ("<img alt=\"\" src=",$iconpath,"whitespace",$rem,
-		       ".gif border='0' />\n") if $rem > 0;
+		       ".gif class='LC_icon' />\n") if $rem > 0;
 	}
 	$r->print ('<input type="hidden" name="acts" value="" />');
 	$r->print ('<a name="'.$anchor.'"></a><input src="'.$iconpath.
 		   'folder_pointer_'.$diropen.'.gif"');
-	$r->print (' name="'.$msg.'" height="22" type="image" border="0" />'.
+	$r->print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
 		   "\n");
 	my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
 	$r->print ('<a href="javascript:gothere(\''
 		   .$quotable_curdir.'\')">'
 		   .'<img alt="'.&mt('Open Folder').'"src="'.
-		   $iconpath.'folder_'.$diropen.'.gif" border="0" /></a>'.
+		   $iconpath.'folder_'.$diropen.'.gif" class="LC_icon" /></a>'.
 		   "\n");
 	$r->print ("$listname</form></td>\n");
 # Attributes
@@ -1247,7 +1244,8 @@
 sub begin_form {
     my ($r,$uri) = @_;
     my $anchor = $uri;
-    $anchor =~ s/\///g;
+    $anchor =~ s/\W//g;
+    $uri=&Apache::loncommon::escape_single($uri);
     $r->print ('<form method="post" name="dirpath'.$dnum.'" action="'.$uri.
 	       '#'.$anchor.
 	       '" onSubmit="return rep_dirpath(\''.$dnum.'\''.

--albertel1182983988--