--- loncom/interface/lonmeta.pm 2006/09/13 22:08:07 1.176
+++ loncom/interface/lonmeta.pm 2006/10/06 19:12:22 1.182
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.176 2006/09/13 22:08:07 banghart Exp $
+# $Id: lonmeta.pm,v 1.182 2006/10/06 19:12:22 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -95,7 +95,8 @@ sub get_dynamic_metadata_from_sql {
while (my $result = <$fh>) {
chomp($result);
next if (! $result);
- my %hash=&LONCAPA::lonmetadata::metadata_col_to_hash(map { &unescape($_) } split(/\,/,$result));
+ my %hash=&LONCAPA::lonmetadata::metadata_col_to_hash('metadata',
+ map { &unescape($_) } split(/\,/,$result));
foreach my $key (keys(%hash)) {
$ReturnHash{$hash{'url'}}->{$key}=$hash{$key};
}
@@ -505,6 +506,7 @@ sub prettyprint {
if ($type=~/\_list/) {
my @Courses = split(/\s*\,\s*/,$value);
my $Str='';
+ my %descriptions;
foreach my $course (@Courses) {
my %courseinfo =
&Apache::lonnet::coursedescription($course,
@@ -512,10 +514,16 @@ sub prettyprint {
if (! exists($courseinfo{'num'}) || $courseinfo{'num'} eq '') {
next;
}
- $Str .= '
';
}
# No pretty print found
@@ -1185,7 +1193,7 @@ ENDEDIT
my $output;
my @fields;
my $added_metadata_fields;
- if ($file_type eq 'portfolio') {
+ if ($file_type eq 'portfolio' || $file_type eq 'groups') {
if(exists ($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.fieldlist'})) {
# retrieve fieldnames (in order) from the course restricted list
@fields = (split /,/,$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.fieldlist'});
@@ -1195,7 +1203,6 @@ ENDEDIT
'notes','lowestgradelevel',
'highestgradelevel','standards');
$added_metadata_fields = &Apache::lonparmset::get_added_meta_fieldnames();
-
$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.fieldlist'} = join (",",@fields);
}
} else {
@@ -1239,9 +1246,8 @@ ENDEDIT
}
}
foreach my $field_name(keys (%$added_metadata_fields)) {
+
push (@fields,$field_name);
- $Apache::lonpublisher::metadatafields{$field_name} =
- $$added_metadata_fields{$field_name};
$lt{$field_name} = $$added_metadata_fields{$field_name};
}
foreach my $field_name (@fields) {
@@ -1252,8 +1258,9 @@ ENDEDIT
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none'
&& exists($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'})) {
# handle restrictions here
- if (($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/active/) ||
- ($field_name eq 'courserestricted')){
+ if ((($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/active/) ||
+ ($field_name eq 'courserestricted'))&&
+ (!($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/deleted/))){
$output.=("\n".'
'.$lt{$field_name}.': '. &prettyinput($field_name, $Apache::lonpublisher::metadatafields{$field_name}, @@ -1281,7 +1288,7 @@ ENDEDIT foreach my $field (sort keys %Apache::lonpublisher::metadatafields) { next if ($field =~ /\./); my $unikey=$field; - $unikey=~/^([A-Za-z]+)/; + $unikey=~/^([A-Za-z_]+)/; my $tag=$1; $tag=~tr/A-Z/a-z/; $file_content.= "\n\<$tag";