--- loncom/publisher/lonpublisher.pm 2001/08/17 16:49:04 1.40
+++ loncom/publisher/lonpublisher.pm 2001/10/16 19:28:38 1.50
@@ -11,7 +11,7 @@
# 04/16/2001 Scott Harrison
# 05/03,05/05,05/07 Gerd Kortemeyer
# 05/28/2001 Scott Harrison
-# 06/23,08/07,08/11,8/13,8/17 Gerd Kortemeyer
+# 06/23,08/07,08/11,8/13,8/17,8/18,8/24,9/26 Gerd Kortemeyer
package Apache::lonpublisher;
@@ -71,7 +71,8 @@ sub metaeval {
} @{$token->[3]};
if ($metadatafields{$unikey}) {
my $newentry=$parser->get_text('/'.$entry);
- unless ($metadatafields{$unikey}=~/$newentry/) {
+ unless (($metadatafields{$unikey}=~/$newentry/) ||
+ ($newentry eq '')) {
$metadatafields{$unikey}.=', '.$newentry;
}
} else {
@@ -258,7 +259,7 @@ sub publish {
}
$allow{$newurl}=1;
}
- } ('src','href');
+ } ('src','href','background');
if ($tag eq 'applet') {
my $codebase='';
@@ -308,7 +309,7 @@ sub publish {
}
} elsif ($token->[0] eq 'E') {
unless ($token->[1] eq 'allow') {
- $outstring.=$token->[2];
+ $outstring.=''.$token->[1].'>';
}
} else {
$outstring.=$token->[1];
@@ -316,9 +317,18 @@ sub publish {
}
# ------------------------------------------------------------ Construct Allows
unless ($style eq 'rat') {
+ $scrout.='
Dependencies
';
my $allowstr="\n";
map {
$allowstr.=''."\n";
+ $scrout.='
';
+ unless ($_=~/\*/) {
+ $scrout.='';
+ }
+ $scrout.=''.$_.'';
+ unless ($_=~/\*/) {
+ $scrout.='';
+ }
} keys %allow;
$outstring=~s/(\<\/[^\>]+\>\s*)$/$allowstr$1/s;
}
@@ -351,6 +361,8 @@ sub publish {
%metadatakeys=();
my %oldparmstores=();
+
+ $scrout.='Metadata Information
';
# ------------------------------------------------ First, check out environment
unless (-e $source.'.meta') {
@@ -401,7 +413,11 @@ sub publish {
# -------------------------------------------------- Parse content for metadata
if ($style eq 'ssi') {
+ my $oldenv=$ENV{'request.uri'};
+
+ $ENV{'request.uri'}=$target;
$allmeta=Apache::lonxml::xmlparse('meta',$content);
+ $ENV{'request.uri'}=$oldenv;
&metaeval($allmeta);
}
@@ -517,6 +533,13 @@ sub publish {
$scrout.=&textfield('Publisher/Owner','owner',
$metadatafields{'owner'});
+# --------------------------------------------------- Correct copyright for rat
+ if ($style eq 'rat') {
+ if ($metadatafields{'copyright'} eq 'public') {
+ delete $metadatafields{'copyright'};
+ }
+ delete $cprtag{'public'};
+ }
$scrout.=&selectbox('Copyright/Distribution','copyright',
$metadatafields{'copyright'},%cprtag);
@@ -832,6 +855,20 @@ sub handler {
return OK;
}
+# Get query string for limited number of parameters
+
+ map {
+ my ($name, $value) = split(/=/,$_);
+ $value =~ tr/+/ /;
+ $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
+ if ($name eq 'filename') {
+ unless ($ENV{'form.'.$name}) {
+ $ENV{'form.'.$name}=$value;
+ }
+ }
+ } (split(/&/,$ENV{'QUERY_STRING'}));
+
+
# -------------------------------------------------------------- Check filename
my $fn=$ENV{'form.filename'};
@@ -863,7 +900,8 @@ sub handler {
return HTTP_NOT_ACCEPTABLE;
}
- $fn=~s/^http\:\/\/[^\/]+\/\~(\w+)/\/home\/$1\/public_html/;
+ $fn=~s/^http\:\/\/[^\/]+//;
+ $fn=~s/^\/\~(\w+)/\/home\/$1\/public_html/;
my $targetdir='';
$docroot=$r->dir_config('lonDocRoot');