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

www lon-capa-cvs@mail.lon-capa.org
Thu, 17 Jun 2004 01:44:35 -0000


www		Wed Jun 16 21:44:35 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Just saving my work - which doesn't.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.111 loncom/interface/lonindexer.pm:1.112
--- loncom/interface/lonindexer.pm:1.111	Wed Jun 16 19:39:01 2004
+++ loncom/interface/lonindexer.pm	Wed Jun 16 21:44:34 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.111 2004/06/16 23:39:01 www Exp $
+# $Id: lonindexer.pm,v 1.112 2004/06/17 01:44:34 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -53,7 +53,6 @@
 use Apache::File;
 use Apache::lonlocal;
 use Apache::lonsource();
-use LONCAPA::lonmetadata();
 use GDBM_File;
 
 # ---------------------------------------- variables used throughout the module
@@ -675,10 +674,20 @@
 # is really a directory
 	@list = &Apache::lonnet::dirlist($uri);
 	$hash{'dirlist_files_'.$luri} = join("\n",@list);
+	&dynmetaread($uri);
     }
     return @list=&match_ext($r,@list);
 }
 
+sub dynmetaread {
+    my $uri=shift;
+    if (($hash{'display_attrs_8'}==1) || ($hash{'display_attrs_11'}==1)) {
+	%dynhash=
+	    (%dynhash,&Apache::lonmeta::get_dynamic_metadata_from_sql($uri));
+	&Apache::lonnet::logthis('Found: '.$uri." : ".join(',',keys %dynhash));
+    } 
+}
+
 sub initdebug {
     return <<ENDJS;
 <script>
@@ -795,7 +804,7 @@
     if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])); }
 
 # make absolute links appear on different background
-    if ($absolute) { $fileclr='#aaaa88'; }
+    if ($absolute) { $fileclr='#ccdd99'; }
 
 # display domain
     if ($filecom[1] eq 'domain') {
@@ -1007,7 +1016,12 @@
         }
 	if ($hash{'display_attrs_8'} == 1) {
 # statistics
-	    $r->print("<td>&nbsp;</td>\n");
+	    $r->print("<td>");
+	    if ($dynhash{$filelink}->{'stdno'}) {
+		$r->print(&mt('Number of students: ').
+			  $dynhash{$filelink}->{'stdno'}.'<br />');
+	    }
+	    $r->print("&nbsp;</td>\n");
 
 	}
 	if ($hash{'display_attrs_10'} == 1) {
@@ -1023,7 +1037,16 @@
 	}
 	if ($hash{'display_attrs_11'} == 1) {
 # links
-	    $r->print("<td>&nbsp;</td>\n");
+	    $r->print("<td>$filelink");
+	    if ($dynhash{$filelink}->{'goto_list'}) {
+		$r->print(&mt('Number of students: ').
+			  $dynhash{$filelink}->{'goto_list'}.'<br />');
+	    }
+	    if ($dynhash{$filelink}->{'comefrom_list'}) {
+		$r->print(&mt('Number of students: ').
+			  $dynhash{$filelink}->{'comefrom_list'}.'<br />');
+	    }
+	    $r->print("&nbsp;</td>\n");
 	}
 	$r->print("</tr>\n");
     }