--- loncom/interface/lonindexer.pm 2004/06/16 23:39:01 1.111 +++ loncom/interface/lonindexer.pm 2004/06/17 01:44:34 1.112 @@ -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::lonmeta; use Apache::File; use Apache::lonlocal; use Apache::lonsource(); -use LONCAPA::lonmetadata(); use GDBM_File; # ---------------------------------------- variables used throughout the module @@ -675,10 +674,20 @@ sub get_list { # 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 < @@ -795,7 +804,7 @@ sub display_line { 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 @@ sub display_line { } if ($hash{'display_attrs_8'} == 1) { # statistics - $r->print(" \n"); + $r->print(""); + if ($dynhash{$filelink}->{'stdno'}) { + $r->print(&mt('Number of students: '). + $dynhash{$filelink}->{'stdno'}.'
'); + } + $r->print(" \n"); } if ($hash{'display_attrs_10'} == 1) { @@ -1023,7 +1037,16 @@ sub display_line { } if ($hash{'display_attrs_11'} == 1) { # links - $r->print(" \n"); + $r->print("$filelink"); + if ($dynhash{$filelink}->{'goto_list'}) { + $r->print(&mt('Number of students: '). + $dynhash{$filelink}->{'goto_list'}.'
'); + } + if ($dynhash{$filelink}->{'comefrom_list'}) { + $r->print(&mt('Number of students: '). + $dynhash{$filelink}->{'comefrom_list'}.'
'); + } + $r->print(" \n"); } $r->print("\n"); }