--- loncom/publisher/lonpublisher.pm 2005/01/24 21:55:20 1.184
+++ loncom/publisher/lonpublisher.pm 2007/03/02 23:20:17 1.222
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.184 2005/01/24 21:55:20 albertel Exp $
+# $Id: lonpublisher.pm,v 1.222 2007/03/02 23:20:17 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -121,7 +121,7 @@ use HTML::LCParser;
use Apache::lonxml;
use Apache::loncacc;
use DBI;
-use Apache::lonnet();
+use Apache::lonnet;
use Apache::loncommon();
use Apache::lonmysql;
use Apache::lonlocal;
@@ -129,6 +129,8 @@ use Apache::loncfile;
use LONCAPA::lonmetadata;
use Apache::lonmsg;
use vars qw(%metadatafields %metadatakeys);
+use LONCAPA qw(:DEFAULT :match);
+
my %addid;
my %nokey;
@@ -181,17 +183,18 @@ sub metaeval {
if ($token->[0] eq 'S') {
my $entry=$token->[1];
my $unikey=$entry;
+ next if ($entry =~ m/^(?:parameter|stores)_/);
if (defined($token->[2]->{'package'})) {
- $unikey.='_package_'.$token->[2]->{'package'};
+ $unikey.="\0package\0".$token->[2]->{'package'};
}
if (defined($token->[2]->{'part'})) {
- $unikey.='_'.$token->[2]->{'part'};
+ $unikey.="\0".$token->[2]->{'part'};
}
if (defined($token->[2]->{'id'})) {
- $unikey.='_'.$token->[2]->{'id'};
+ $unikey.="\0".$token->[2]->{'id'};
}
if (defined($token->[2]->{'name'})) {
- $unikey.='_'.$token->[2]->{'name'};
+ $unikey.="\0".$token->[2]->{'name'};
}
foreach (@{$token->[3]}) {
$metadatafields{$unikey.'.'.$_}=$token->[2]->{$_};
@@ -278,9 +281,8 @@ sub metaread {
sub coursedependencies {
my $url=&Apache::lonnet::declutter(shift);
$url=~s/\.meta$//;
- my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//);
- my $regexp=$url;
- $regexp=~s/(\W)/\\$1/g;
+ my ($adomain,$aauthor)=($url=~ m{^($match_domain)/($match_username)/});
+ my $regexp=quotemeta($url);
$regexp='___'.$regexp.'___course';
my %evaldata=&Apache::lonnet::dump('nohist_resevaldata',$adomain,
$aauthor,$regexp);
@@ -326,7 +328,7 @@ sub textfield {
$value=~s/\s+$//gs;
$value=~s/\s+/ /gs;
$title=&mt($title);
- $ENV{'form.'.$name}=$value;
+ $env{'form.'.$name}=$value;
return "\n
$title:".
"
".
'';
@@ -338,7 +340,7 @@ sub text_with_browse_field {
$value=~s/\s+$//gs;
$value=~s/\s+/ /gs;
$title=&mt($title);
- $ENV{'form.'.$name}=$value;
+ $env{'form.'.$name}=$value;
return "\n$title:".
"
".
''.
@@ -349,18 +351,24 @@ sub text_with_browse_field {
sub hiddenfield {
my ($name,$value)=@_;
- $ENV{'form.'.$name}=$value;
+ $env{'form.'.$name}=$value;
return "\n".'';
}
+sub checkbox {
+ my ($name,$text)=@_;
+ return "\n
";
+}
+
sub selectbox {
my ($title,$name,$value,$functionref,@idlist)=@_;
$title=&mt($title);
$value=(split(/\s*,\s*/,$value))[-1];
if (defined($value)) {
- $ENV{'form.'.$name}=$value;
+ $env{'form.'.$name}=$value;
} else {
- $ENV{'form.'.$name}=$idlist[0];
+ $env{'form.'.$name}=$idlist[0];
}
my $selout="\n$title:".
'