--- loncom/interface/lonmeta.pm 2001/12/25 21:02:35 1.13
+++ loncom/interface/lonmeta.pm 2002/08/26 17:02:47 1.18
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.13 2001/12/25 21:02:35 www Exp $
+# $Id: lonmeta.pm,v 1.18 2002/08/26 17:02:47 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -47,8 +47,8 @@ sub dynamicmeta {
my $regexp=&Apache::lonnet::escape($url);
$regexp=~s/(\W)/\\$1/g;
$regexp='___'.$regexp.'___';
- my %evaldata=&Apache::lonnet::dump
- ('resevaldata',$adomain,$aauthor,$regexp);
+ my %evaldata=&Apache::lonnet::dump('nohist_resevaldata',$adomain,
+ $aauthor,$regexp);
my %sum;
my %cnt;
my %listitems=('count' => 'add',
@@ -154,16 +154,16 @@ sub handler {
# ------------------------------------------------------------------- Read file
my $uri=$r->uri;
- map {
+ foreach (split(/\,/,&Apache::lonnet::metadata($uri,'keys'))) {
$content{$_}=&Apache::lonnet::metadata($uri,$_);
- } split(/\,/,&Apache::lonnet::metadata($uri,'keys'));
-
+ }
+ my ($resdomain)=(&Apache::lonnet::declutter($uri)=~/^(\w+)\//);
# ------------------------------------------------------------------ Hide stuff
unless ($ENV{'user.adv'}) {
- map {
+ foreach ('keywords','notes','abstract','subject') {
$content{$_}='- not displayed -';
- } ('keywords','notes','abstract','subject');
+ }
}
# --------------------------------------------------------------- Render Output
@@ -174,10 +174,11 @@ my $language=&Apache::loncommon::languag
my $mime=&Apache::loncommon::filedescription($content{'mime'});
my $disuri=&Apache::lonnet::declutter($uri);
$disuri=~s/\.meta$//;
+my $bodytag=&Apache::loncommon::bodytag
+ ('Catalog Information','','','',$resdomain);
$r->print(<Catalog Information
-
-Catalog Information
+$bodytag
$content{'title'}
$disuri
@@ -219,7 +220,9 @@ ENDHEAD
delete($content{'copyright'});
if ($ENV{'user.adv'}) {
# ------------------------------------------------------------ Dynamic Metadata
- $r->print('Dynamic Metadata (updated periodically)
');
+ $r->print(
+ 'Dynamic Metadata (updated periodically)
Processing ...
');
+ $r->rflush();
my %items=(
'count' => 'Network-wide number of accesses (hits)',
'course' => 'Network-wide number of courses using resource',
@@ -278,12 +281,12 @@ $dynmeta{$_}." \n");
my $display=&Apache::lonnet::metadata($uri,$name.'.display');
unless ($display) { $display=$name; };
my $otherinfo='';
- map {
+ foreach ('name','part','type','default') {
if (defined(&Apache::lonnet::metadata($uri,$name.'.'.$_))) {
$otherinfo.=' '.$_.'='.
&Apache::lonnet::metadata($uri,$name.'.'.$_).'; ';
}
- } ('name','part','type','default');
+ }
$r->print(''.$display.': '.$content{$name});
if ($otherinfo) {
$r->print(' ('.$otherinfo.')');