--- loncom/interface/lonindexer.pm 2006/06/23 06:39:09 1.146
+++ loncom/interface/lonindexer.pm 2006/12/11 02:12:08 1.155
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.146 2006/06/23 06:39:09 www Exp $
+# $Id: lonindexer.pm,v 1.155 2006/12/11 02:12:08 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
@@ -123,7 +124,11 @@ sub handler {
%hash = ();
{
my %dbfile;
- if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_READER(),0640)) {
+ if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRITER(),0640)) {
+ if ($env{'form.launch'} eq '1') {
+ &start_fresh_session(\%dbfile);
+ }
+
while(my($key,$value)=each(%dbfile)) {
$hash{$key}=$value;
}
@@ -131,9 +136,6 @@ sub handler {
}
}
{
- if ($env{'form.launch'} eq '1') {
- &start_fresh_session();
- }
#Hijack lonindexer to verify a title and be close down.
if ($env{'form.launch'} eq '2') {
&Apache::loncommon::content_type($r,'text/html');
@@ -171,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');
@@ -181,7 +183,7 @@ END
}
elsif ($env{'form.catalogmode'} eq 'import') {
$extrafield='
'.
- '
';
$colspan=" colspan='2' ";
my $cl=&mt('Close');
@@ -365,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)
@@ -579,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
@@ -796,7 +799,8 @@ sub display_line {
my $i=0;
while ($i<=11) {
$tabtag=join('',$tabtag,"