--- loncom/publisher/lonpublisher.pm 2003/12/22 22:09:06 1.149
+++ loncom/publisher/lonpublisher.pm 2005/01/05 20:11:19 1.181
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.149 2003/12/22 22:09:06 www Exp $
+# $Id: lonpublisher.pm,v 1.181 2005/01/05 20:11:19 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -126,6 +126,8 @@ use Apache::loncommon();
use Apache::lonmysql;
use Apache::lonlocal;
use Apache::loncfile;
+use LONCAPA::lonmetadata;
+use Apache::lonmsg;
use vars qw(%metadatafields %metadatakeys);
my %addid;
@@ -197,12 +199,17 @@ sub metaeval {
}
}
my $newentry=$parser->get_text('/'.$entry);
- if ($entry eq 'customdistributionfile') {
+ if (($entry eq 'customdistributionfile') ||
+ ($entry eq 'sourcerights')) {
$newentry=~s/^\s*//;
if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; }
}
# actually store
- $metadatafields{$unikey}=$newentry;
+ if ( $entry eq 'rule' && exists($metadatafields{$unikey})) {
+ $metadatafields{$unikey}.=','.$newentry;
+ } else {
+ $metadatafields{$unikey}=$newentry;
+ }
}
}
}
@@ -316,23 +323,43 @@ sub textfield {
$value=~s/\s+$//gs;
$value=~s/\s+/ /gs;
$title=&mt($title);
- my $uctitle=uc($title);
- return "\n
$uctitle:".
+ $ENV{'form.'.$name}=$value;
+ return "\n$title:".
"
".
'';
}
+sub text_with_browse_field {
+ my ($title,$name,$value,$restriction)=@_;
+ $value=~s/^\s+//gs;
+ $value=~s/\s+$//gs;
+ $value=~s/\s+/ /gs;
+ $title=&mt($title);
+ $ENV{'form.'.$name}=$value;
+ return "\n$title:".
+ "
".
+ ''.
+ 'Select '.
+ 'Search';
+
+}
+
sub hiddenfield {
my ($name,$value)=@_;
+ $ENV{'form.'.$name}=$value;
return "\n".'';
}
sub selectbox {
my ($title,$name,$value,$functionref,@idlist)=@_;
$title=&mt($title);
- my $uctitle=uc($title);
$value=(split(/\s*,\s*/,$value))[-1];
- my $selout="\n$uctitle:".
+ if (defined($value)) {
+ $ENV{'form.'.$name}=$value;
+ } else {
+ $ENV{'form.'.$name}=$idlist[0];
+ }
+ my $selout="\n$title:".
'