--- loncom/interface/lonindexer.pm 2003/12/22 18:58:26 1.82
+++ loncom/interface/lonindexer.pm 2004/07/02 08:01:20 1.118
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.82 2003/12/22 18:58:26 www Exp $
+# $Id: lonindexer.pm,v 1.118 2004/07/02 08:01:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,21 +25,6 @@
#
# http://www.lon-capa.org/
#
-# YEAR=1999
-# 5/21/99, 5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14 Gerd Kortemeyer)
-# 11/23 Gerd Kortemeyer
-# YEAR=2000
-# 07/20-08/04 H.K. Ng
-# YEAR=2001
-# 05/9-05/19/2001 H. K. Ng
-# 05/21/2001 H. K. Ng
-# 05/23/2001 H. K. Ng
-# 6/26,7/8 H. K. Ng
-# 8/14 H. K. Ng
-# 11/30 Matthew Hall
-# YEAR=2002
-# 6/29/2002 H. K. Ng
-#
###
###############################################################################
@@ -61,17 +46,22 @@ package Apache::lonindexer;
use strict;
use Apache::lonnet();
use Apache::loncommon();
+use Apache::lonhtmlcommon();
+use Apache::lonsequence();
use Apache::Constants qw(:common);
use Apache::lonmeta;
use Apache::File;
use Apache::lonlocal;
+use Apache::lonsource();
use GDBM_File;
# ---------------------------------------- variables used throughout the module
-my %hash; # tied to a user-specific gdbm file
+my %hash; # global user-specific gdbm file
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.
my $extrafield; # default extra table cell
@@ -83,20 +73,6 @@ my @Only = ();
my @Omit = ();
-# ------------------------------------------------------- Puts directory header
-
-sub crumbs {
- my $uri=shift;
- my $output='
/';
- my $path='/';
- foreach (split('/',$uri)) {
- unless ($_) { next; }
- $path.=$_.'/';
- $output.=''.$_.'/';
- }
- return $output.'
';
-}
-
# ----------------------------- Handling routine called via Apache and mod_perl
sub handler {
my $r = shift;
@@ -112,6 +88,7 @@ sub handler {
# these global to this package? It is just so wrong....)
undef (@Only);
undef (@Omit);
+ %fieldnames=&Apache::lonmeta::fieldnames();
# ------------------------------------- read in machine configuration variables
my $iconpath= $r->dir_config('lonIconsURL') . "/";
@@ -144,7 +121,7 @@ sub handler {
%hash = ();
{
my %dbfile;
- if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) {
+ if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_READER(),0640)) {
while(my($key,$value)=each(%dbfile)) {
$hash{$key}=$value;
}
@@ -154,7 +131,34 @@ 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') {
+ $r->content_type('text/html');
+ my $extra='';
+ 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;
+ $extra='window.opener.document.forms["'.$ENV{'form.form'}.'"].elements["'.$ENV{'form.titleelement'}.'"].value=\''.$verify_title.'\';';
+ }
+ $r->print(<
+
+
+
+