--- loncom/interface/lonindexer.pm 2004/06/18 01:27:04 1.116 +++ loncom/interface/lonindexer.pm 2004/10/21 11:18:41 1.128 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.116 2004/06/18 01:27:04 www Exp $ +# $Id: lonindexer.pm,v 1.128 2004/10/21 11:18:41 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,6 +60,7 @@ my %hash; # global user-specific gdbm fi my %dirs; # keys are directories, values are the open/close status my %language; # has the reference information present in language.tab my %dynhash; # hash of hashes for dynamic metadata +my %dynread; # hash of directories already read for dynamic metadata my %fieldnames; # Metadata fieldnames # ----- Values which are set by the handler subroutine and are accessible to # ----- other methods. @@ -72,6 +73,8 @@ my @Only = (); my @Omit = (); + + # ----------------------------- Handling routine called via Apache and mod_perl sub handler { my $r = shift; @@ -135,7 +138,8 @@ sub handler { if ($ENV{'form.launch'} eq '2') { $r->content_type('text/html'); my $extra=''; - if (defined($ENV{'form.titleelement'})) { + if (defined($ENV{'form.titleelement'}) && + $ENV{'form.titleelement'} ne '') { my $verify_title = &Apache::lonnet::gettitle($ENV{'form.acts'}); # &Apache::lonnet::logthis("Hrrm $ENV{'form.acts'} -- $verify_title"); $verify_title=~s/'/\\'/g; @@ -143,9 +147,12 @@ sub handler { } $r->print(< + ENDJS } @@ -825,7 +849,8 @@ sub display_line { $diropen.'.gif"'); $r->print (' name="'.$msg.'" height="22" type="image" border="0">'. "\n"); - $r->print ('print (' border="0" />'."\n"); $r->print (&mt("Domain")." - $listname "); @@ -852,7 +877,9 @@ sub display_line { '.gif"'); $r->print (' name="'.$msg.'" height="22" type="image" border="0">'. "\n"); - $r->print (''); my $domain=(split(m|/|,$startdir))[2]; @@ -881,8 +908,9 @@ sub display_line { $r->print(""); if ($ENV{'form.catalogmode'} eq 'interactive') { + my $quotable_filelink = &Apache::loncommon::escape_single($filelink); $r->print(""); + $quotable_filelink,"')\">"); $r->print("". "\n"); $r->print(""); @@ -941,11 +969,14 @@ sub display_line { if ($filelink=~/\.(page|sequence)$/) { $r->print(''); } - $r->print (" print (" $listname "); - $r->print (" (print (" (metadata) "); $r->print("\n"); @@ -985,6 +1016,7 @@ sub display_line { } if ($hash{'display_attrs_8'} == 1) { # statistics + &dynmetaread($filelink); $r->print(""); &dynmetaprint($r,$filelink,'count'); &dynmetaprint($r,$filelink,'course'); @@ -1003,8 +1035,10 @@ sub display_line { if ($hash{'display_attrs_10'} == 1) { my $source = &Apache::lonnet::metadata($filelink,'sourceavail'); if($source eq 'open') { - my $sourcelink = &Apache::lonsource::make_link($filelink); - $r->print(''."print(''."Yes "."\n"); } else { #A cuddled else. :P @@ -1013,6 +1047,7 @@ sub display_line { } if ($hash{'display_attrs_11'} == 1) { # links + &dynmetaread($filelink); $r->print(''); &dynmetaprint($r,$filelink,'goto_list'); &dynmetaprint($r,$filelink,'comefrom_list'); @@ -1080,7 +1115,9 @@ sub display_line { 'folder_pointer_'.$diropen.'.gif"'); $r->print (' name="'.$msg.'" height="22" type="image" border="0">'. "\n"); - $r->print (''. "\n"); $r->print ("$listname\n"); @@ -1198,6 +1235,10 @@ sub cleanup { } } + + + + =head1 NAME Apache::lonindexer - mod_perl module for cross server filesystem browsing