--- loncom/interface/lonindexer.pm 2006/09/21 22:11:12 1.152 +++ loncom/interface/lonindexer.pm 2007/01/16 21:20:57 1.156 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.152 2006/09/21 22:11:12 albertel Exp $ +# $Id: lonindexer.pm,v 1.156 2007/01/16 21:20:57 albertel 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'); @@ -913,7 +915,7 @@ sub display_line { $quotable_filelink,"')\">"); $r->print("\"\"". "\n"); - $r->print(""); + $r->print(""); } elsif ($env{'form.catalogmode'} eq 'import') { $r->print("
\n"); $r->print("print("checked"); } $r->print(" />\n"); - $r->print("
"); + $r->print(""); $hash{"pre_${fnum}_link"}=$filelink; $fnum++; } @@ -1199,7 +1201,7 @@ 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').'';