--- loncom/interface/lonindexer.pm 2006/07/28 19:16:08 1.150
+++ loncom/interface/lonindexer.pm 2007/03/08 01:58:45 1.158
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.150 2006/07/28 19:16:08 www Exp $
+# $Id: lonindexer.pm,v 1.158 2007/03/08 01:58:45 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
@@ -172,7 +173,7 @@ ENDSUBM
# --------------------- define extra fields and buttons in case of special mode
if ($env{'form.catalogmode'} eq 'interactive') {
$extrafield='
'.
- '
';
$colspan=" colspan='2' ";
my $cl=&mt('Close');
@@ -182,7 +183,7 @@ END
}
elsif ($env{'form.catalogmode'} eq 'import') {
$extrafield='
'.
- '
';
$colspan=" colspan='2' ";
my $cl=&mt('Close');
@@ -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)
@@ -580,12 +581,13 @@ END
# -------- recursively go through all the directories and output as appropriate
&scanDir ($r,$toplevel,$indent,\%hash);
-# ---------------------------- embed hidden information useful for group import
- $r->print("");
# -------------------------------------------------------------- end the tables
$r->print('');
+# ---------------------------- embed hidden information useful for group import
+ $r->print("");
+# -------------------------------------------------------------- end the tables
$r->print('');
# --------------------------------------------------- end the output and return
@@ -678,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 {
@@ -687,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 {
@@ -797,7 +799,8 @@ sub display_line {
my $i=0;
while ($i<=11) {
$tabtag=join('',$tabtag,"