--- loncom/interface/lonindexer.pm 2006/09/29 18:21:43 1.153 +++ loncom/interface/lonindexer.pm 2007/06/20 18:38:44 1.159 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.153 2006/09/29 18:21:43 albertel Exp $ +# $Id: lonindexer.pm,v 1.159 2007/06/20 18:38:44 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -54,6 +54,7 @@ use Apache::File; use Apache::lonlocal; use Apache::lonsource(); use GDBM_File; +use LONCAPA qw(:match); # ---------------------------------------- variables used throughout the module my %hash; # global user-specific gdbm file @@ -366,7 +367,7 @@ function gothere(val) { ENDHEADER - my ($headerdom)=($uri=~/^\/res\/(\w+)\//); + my ($headerdom)=($uri=~m{^/res/($match_domain)/}); $r->print(&Apache::loncommon::start_page('Browse Resources',$js, {'domain' => $headerdom,})); # - Evaluate actions from previous page (both cumulatively and chronologically) @@ -679,7 +680,7 @@ sub get_list { $uri=~s/\/+/\//g; foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$uri))) { my @ratpart=split(/\:/,$_); - push @list,$ratpart[1]; + push(@list,&LONCAPA::map::qtescape($ratpart[1])); } $hash{'dirlist_files_'.$luri} = join("\n",@list); } else { @@ -688,7 +689,7 @@ sub get_list { $hash{'dirlist_files_'.$luri} = join("\n",@list); $hash{'dirlist_timestamp_files_'.$luri} = time; } - return @list=&match_ext($r,@list); + return @list=&match_ext($r,@list); } sub dynmetaread { @@ -798,7 +799,8 @@ sub display_line { my $i=0; while ($i<=11) { $tabtag=join('',$tabtag," ") - if $hash{'display_attrs_'.$i} == 1; + if ($i != 9 && + $hash{'display_attrs_'.$i} == 1); $i++; } my $valign = ($hash{'display_attrs_7'} == 1 ? 'top' : 'bottom'); @@ -810,7 +812,7 @@ sub display_line { $updir='/'.(split(/\.(page|sequence)\/\//,$startdir))[-1]; $updir=~s/\/+/\//g; - $r->print("$extrafield"); + $r->print("$extrafield"); $r->print("\n"); $r->print ('
print (''."\n") if ($env{'form.dirPointer'} eq "on"); - $r->print("$extrafield"); + $r->print("$extrafield"); $r->print(""); &begin_form ($r,$filecom[0]); my $anchor = $filecom[0]; @@ -854,8 +856,8 @@ sub display_line { '\')">print (' border="0" />'."\n"); $r->print (&mt("Domain")." - $listname "); - if ($Apache::lonnet::domaindescription{$listname}) { - $r->print("(".$Apache::lonnet::domaindescription{$listname}. + if (&Apache::lonnet::domain($listname,'description')) { + $r->print("(".&Apache::lonnet::domain($listname,'description'). ")"); } $r->print ("
$tabtag\n"); @@ -864,7 +866,7 @@ sub display_line { # display user directory } if ($filecom[1] eq 'user') { - $r->print("$extrafield"); + $r->print("$extrafield"); $r->print("\n"); my $curdir = $startdir.$filecom[0].'/'; my $anchor = $curdir; @@ -905,7 +907,7 @@ sub display_line { } # Set the icon for the file my $iconname = &Apache::loncommon::icon($listname); - $r->print(""); + $r->print(""); if ($env{'form.catalogmode'} eq 'interactive') { my $quotable_filelink = &Apache::loncommon::escape_single($filelink); @@ -1070,7 +1072,7 @@ sub display_line { my $curdir = $startdir.$filecom[0].'/'; my $anchor = $curdir; $anchor =~ s/\///g; - $r->print("$extrafield"); + $r->print("$extrafield"); &begin_form ($r,$curdir); my $indentm1 = $indent-1; if ($indentm1 < 11 and $indentm1 > 0) { @@ -1199,9 +1201,9 @@ sub showpreview { $output=''.$output.''; } elsif ($embstyle eq 'img') { $output=''.&mt('Preview').''; - } elsif ($filelink=~/^\/res\/(\w+)\/(\w+)\//) { + } elsif ($filelink=~m{^/res/($match_domain)/($match_username)/}) { $output=''.&mt('Preview').''; } return $output;