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

www lon-capa-cvs@mail.lon-capa.org
Fri, 18 Jun 2004 01:09:25 -0000


www		Thu Jun 17 21:09:25 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Resource rendering must be shown in last column, since it takes up so much
  room.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.114 loncom/interface/lonindexer.pm:1.115
--- loncom/interface/lonindexer.pm:1.114	Thu Jun 17 16:43:04 2004
+++ loncom/interface/lonindexer.pm	Thu Jun 17 21:09:24 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.114 2004/06/17 20:43:04 www Exp $
+# $Id: lonindexer.pm,v 1.115 2004/06/18 01:09:24 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -440,26 +440,30 @@
 					   'av' => 'All versions',
 					   'ud' => 'Update Display'
 					   );
-        my $Displayfileattributes=&mt('Display file attributes');
 	$r->print(<<END);
 <form method="post" name="fileattr" action="$uri"
  enctype="application/x-www-form-urlencoded">
-<b><font color="#666666">$Displayfileattributes</font></b><br />
-<table border=0><tr>
+<input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}
+<table border="0">
+<tr>
 <td><input type="checkbox" name="attr0" value="1" $attrchk[0] onClick="this.form.submit();" /> $lt{'ti'}</td>
+<td><input type="checkbox" name="attr4" value="1" $attrchk[4] onClick="this.form.submit();" /> $lt{'au'}</td>
+<td><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</td>
+<td><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</td>
+</tr>
+<tr>
 <td><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</td>
 <td><input type="checkbox" name="attr2" value="1" $attrchk[2] onClick="this.form.submit();" /> $lt{'la'}</td>
 <td><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</td>
-<td><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</td>
 <td><input type="checkbox" name="attr10" value="1" $attrchk[10] onClick="this.form.submit();" /> $lt{'sa'}</td>
-</tr><tr>
-<td><input type="checkbox" name="attr4" value="1" $attrchk[4] onClick="this.form.submit();" /> $lt{'au'}</td>
-<td><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</td>
-<td><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</td>
-<td><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</td>
-<td><input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}</td>
+</tr>
+<tr>
+<td><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</td>
 <td><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</td>
-</tr></table>
+<td><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</td>
+<td>&nbsp;</td>
+</tr>
+</table>
 <input type="hidden" name="attrs" value="1" />
 <input type="submit" name="updatedisplay" value="$lt{'ud'}" />
 <input type="hidden" name="acts" value="" />
@@ -512,8 +516,6 @@
 	    if ($hash{'display_attrs_5'} == 1);
 	$r->print("<td><b>".&mt("Language")."</b></td>\n")
 	    if ($hash{'display_attrs_6'} == 1);
-	$r->print("<td><b>".&mt("Resource")."</b></td>\n")
-	    if ($hash{'display_attrs_7'} == 1);
 	$r->print("<td><b>".&mt("Usage Statistics")." <br />(".
 		  &mt("Courses/Network Hits").")</b></td>\n")
 	    if ($hash{'display_attrs_8'} == 1);
@@ -521,6 +523,8 @@
 	    if ($hash{'display_attrs_10'} == 1);
 	$r->print("<td><b>".&mt("Linked/Related Resources")."</b></td>\n")
 	    if ($hash{'display_attrs_11'} == 1);
+	$r->print("<td><b>".&mt("Resource")."</b></td>\n")
+	    if ($hash{'display_attrs_7'} == 1);
 	$r->print('</tr>');
 
 # ----------------- read in what directories have previously been set to "open"
@@ -986,34 +990,6 @@
 	    $r->print('<td> '.($lang eq '' ? '&nbsp;' : $lang).
 		      " </td>\n");
 	}
-        if ($hash{'display_attrs_7'} == 1) {
-            my $output='';
-            my $embstyle=&Apache::loncommon::fileembstyle($curfext);
-	    if ($embstyle eq 'ssi') {
-		my $cache=$Apache::lonnet::perlvar{'lonDocRoot'}.$filelink.
-		    '.tmp';
-		if ((!$ENV{'form.updatedisplay'}) &&
-		    (-e $cache)) {
-		    open(FH,$cache);
-		    $output=join("\n",<FH>);
-		    close(FH);
-		} else {
-		    $output=&Apache::lonnet::ssi_body($filelink);
-		    open(FH,">$cache");
-		    print FH $output;
-		    close(FH);
-		}
-		$output='<font size="-2">'.$output.'</font>';
-	   } elsif ($embstyle eq 'img') {
-               $output='<img src="'.$filelink.'" />';
-           } elsif ($filelink=~/^\/res\/(\w+)\/(\w+)\//) {
-               $output='<img src="http://'.
-		 $Apache::lonnet::hostname{&Apache::lonnet::homeserver($2,$1)}.
-                 '/cgi-bin/thumbnail.gif?url='.$filelink.'" />';
-           }
-	   $r->print('<td> '.($output eq '' ? '&nbsp;':$output).
-		      " </td>\n");
-        }
 	if ($hash{'display_attrs_8'} == 1) {
 # statistics
 	    $r->print("<td>");
@@ -1051,6 +1027,35 @@
 	   &dynmetaprint($r,$filelink,'dependencies');
 	   $r->print('</td>');
         }
+        if ($hash{'display_attrs_7'} == 1) {
+# Show resource
+            my $output='';
+            my $embstyle=&Apache::loncommon::fileembstyle($curfext);
+	    if ($embstyle eq 'ssi') {
+		my $cache=$Apache::lonnet::perlvar{'lonDocRoot'}.$filelink.
+		    '.tmp';
+		if ((!$ENV{'form.updatedisplay'}) &&
+		    (-e $cache)) {
+		    open(FH,$cache);
+		    $output=join("\n",<FH>);
+		    close(FH);
+		} else {
+		    $output=&Apache::lonnet::ssi_body($filelink);
+		    open(FH,">$cache");
+		    print FH $output;
+		    close(FH);
+		}
+		$output='<font size="-2">'.$output.'</font>';
+	   } elsif ($embstyle eq 'img') {
+               $output='<img src="'.$filelink.'" />';
+           } elsif ($filelink=~/^\/res\/(\w+)\/(\w+)\//) {
+               $output='<img src="http://'.
+		 $Apache::lonnet::hostname{&Apache::lonnet::homeserver($2,$1)}.
+                 '/cgi-bin/thumbnail.gif?url='.$filelink.'" />';
+           }
+	   $r->print('<td> '.($output eq '' ? '&nbsp;':$output).
+		      " </td>\n");
+        }
 	$r->print("</tr>\n");
     }
 
@@ -1121,18 +1126,18 @@
 	    $r->print('<td> '.($lang eq '' ? '&nbsp;' : $lang).
 		      " </td>\n");
 	}
-        if ($hash{'display_attrs_7'} == 1) {
-	   $r->print('<td>&nbsp;</td>');
-        }
 	if ($hash{'display_attrs_8'} == 1) {
 	   $r->print('<td>&nbsp;</td>');
 	}
-	if ($hash{'display_attrs_10'} == 1) {
+ 	if ($hash{'display_attrs_10'} == 1) {
 	   $r->print('<td>&nbsp;</td>');
 	}
 	if ($hash{'display_attrs_11'} == 1) {
 	   $r->print('<td>&nbsp;</td>');
 	}
+	if ($hash{'display_attrs_7'} == 1) {
+	   $r->print('<td>&nbsp;</td>');
+        }
 	$r->print('</form></tr>');
     }