version 1.79, 2002/04/17 18:32:35
|
version 1.84, 2002/07/17 18:23:45
|
Line 217 sub absoluteurl {
|
Line 217 sub absoluteurl {
|
return $url; |
return $url; |
} |
} |
|
|
|
sub set_allow { |
|
my ($allow,$logfile,$target,$tag,$oldurl)=@_; |
|
my $newurl=&urlfixup($oldurl,$target); |
|
my $return_url=$oldurl; |
|
print $logfile 'GUYURL: '.$tag.':'.$oldurl.' - '.$newurl."\n"; |
|
if ($newurl ne $oldurl) { |
|
$return_url=$newurl; |
|
print $logfile 'URL: '.$tag.':'.$oldurl.' - '.$newurl."\n"; |
|
} |
|
if (($newurl !~ /^javascript:/i) && |
|
($newurl !~ /^mailto:/i) && |
|
($newurl !~ /^http:/i) && |
|
($newurl !~ /^\#/)) { |
|
$$allow{&absoluteurl($newurl,$target)}=1; |
|
} |
|
return $return_url |
|
} |
|
|
sub publish { |
sub publish { |
|
|
my ($source,$target,$style)=@_; |
my ($source,$target,$style)=@_; |
Line 318 sub publish {
|
Line 336 sub publish {
|
|
|
foreach my $type ('src','href','background','bgimg') { |
foreach my $type ('src','href','background','bgimg') { |
foreach my $key (keys(%parms)) { |
foreach my $key (keys(%parms)) { |
|
print $logfile "for $type, and $key\n"; |
if ($key =~ /^$type$/i) { |
if ($key =~ /^$type$/i) { |
my $oldurl=$parms{$key}; |
print $logfile "calling set_allow\n"; |
my $newurl=&urlfixup($oldurl,$target); |
$parms{$key}=&set_allow(\%allow,$logfile, |
if ($newurl ne $oldurl) { |
$target,$tag, |
$parms{$key}=$newurl; |
$parms{$key}); |
print $logfile 'URL: '.$tag.':'.$oldurl.' - '. |
|
$newurl."\n"; |
|
} |
|
if (($newurl !~ /^javascript:/i) && |
|
($newurl !~ /^mailto:/i) && |
|
($newurl !~ /^http:/i) && |
|
($newurl !~ /^\#/)) { |
|
$allow{&absoluteurl($newurl,$target)}=1; |
|
} |
|
} |
} |
last; |
|
} |
} |
} |
} |
|
# probably a <randomlabel> image type <label> |
|
if ($lctag eq 'label' && defined($parms{'description'})) { |
|
my $next_token=$parser->get_token(); |
|
if ($next_token->[0] eq 'T') { |
|
$next_token->[1]=&set_allow(\%allow,$logfile, |
|
$target,$tag, |
|
$next_token->[1]); |
|
} |
|
$parser->unget_token($next_token); |
|
} |
if ($lctag eq 'applet') { |
if ($lctag eq 'applet') { |
my $codebase=''; |
my $codebase=''; |
if (defined($parms{'codebase'})) { |
if (defined($parms{'codebase'})) { |
Line 426 sub publish {
|
Line 444 sub publish {
|
} |
} |
} |
} |
} |
} |
$allowstr=~s/\n+/\n/g; |
$outstring=~s/\n*(\<\/[^\>]+\>)\s*$/$allowstr\n$1\n/s; |
$outstring=~s/(\<\/[^\>]+\>\s*)$/$allowstr$1/s; |
|
|
|
#Encode any High ASCII characters |
#Encode any High ASCII characters |
$outstring=&HTML::Entities::encode($outstring,"\200-\377"); |
$outstring=&HTML::Entities::encode($outstring,"\200-\377"); |
Line 461 sub publish {
|
Line 478 sub publish {
|
|
|
my %oldparmstores=(); |
my %oldparmstores=(); |
|
|
$scrout.='<h3>Metadata Information</h3>'; |
|
|
$scrout.='<h3>Metadata Information ' . |
|
Apache::loncommon::help_open_topic("Metadata_Description") |
|
. '</h3>'; |
|
|
# ------------------------------------------------ First, check out environment |
# ------------------------------------------------ First, check out environment |
unless (-e $source.'.meta') { |
unless (-e $source.'.meta') { |
Line 515 sub publish {
|
Line 535 sub publish {
|
my $oldenv=$ENV{'request.uri'}; |
my $oldenv=$ENV{'request.uri'}; |
|
|
$ENV{'request.uri'}=$target; |
$ENV{'request.uri'}=$target; |
$allmeta=Apache::lonxml::xmlparse('meta',$content); |
$allmeta=Apache::lonxml::xmlparse(undef,'meta',$content); |
$ENV{'request.uri'}=$oldenv; |
$ENV{'request.uri'}=$oldenv; |
|
|
&metaeval($allmeta); |
&metaeval($allmeta); |
Line 568 sub publish {
|
Line 588 sub publish {
|
|
|
# --------------------------------------------------- Scan content for keywords |
# --------------------------------------------------- Scan content for keywords |
|
|
|
my $keywords_help = Apache::loncommon::help_open_topic("Publishing_Keywords"); |
my $keywordout=<<"END"; |
my $keywordout=<<"END"; |
<script> |
<script> |
function checkAll(field) |
function checkAll(field) |
Line 582 function uncheckAll(field)
|
Line 603 function uncheckAll(field)
|
field[i].checked = false ; |
field[i].checked = false ; |
} |
} |
</script> |
</script> |
<p><b>Keywords:</b> |
<p><b>Keywords: $keywords_help</b> |
<input type="button" value="check all" onclick="javascript:checkAll(document.pubform.keywords)"> |
<input type="button" value="check all" onclick="javascript:checkAll(document.pubform.keywords)"> |
<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.pubform.keywords)"> |
<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.pubform.keywords)"> |
<br /> |
<br /> |
Line 662 END
|
Line 683 END
|
$scrout.=&textfield('Publisher/Owner','owner', |
$scrout.=&textfield('Publisher/Owner','owner', |
$metadatafields{'owner'}); |
$metadatafields{'owner'}); |
# --------------------------------------------------- Correct copyright for rat |
# --------------------------------------------------- Correct copyright for rat |
|
|
if ($style eq 'rat') { |
if ($style eq 'rat') { |
if ($metadatafields{'copyright'} eq 'public') { |
if ($metadatafields{'copyright'} eq 'public') { |
delete $metadatafields{'copyright'}; |
delete $metadatafields{'copyright'}; |
Line 677 END
|
Line 699 END
|
\&Apache::loncommon::copyrightdescription, |
\&Apache::loncommon::copyrightdescription, |
(&Apache::loncommon::copyrightids)); |
(&Apache::loncommon::copyrightids)); |
} |
} |
|
|
|
my $copyright_help = Apache::loncommon::help_open_topic("Publishing_Copyright"); |
|
$scrout =~ s/DISTRIBUTION:/'DISTRIBUTION: ' . $copyright_help/ge; |
return $scrout. |
return $scrout. |
'<p><input type="submit" value="Finalize Publication" /></p></form>'; |
'<p><input type="submit" value="Finalize Publication" /></p></form>'; |
} |
} |
Line 990 sub handler {
|
Line 1015 sub handler {
|
|
|
# Get query string for limited number of parameters |
# Get query string for limited number of parameters |
|
|
foreach (split(/&/,$ENV{'QUERY_STRING'})) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
my ($name, $value) = split(/=/,$_); |
['filename']); |
$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; |
|
} |
|
} |
|
} |
|
|
|
|
|
# -------------------------------------------------------------- Check filename |
# -------------------------------------------------------------- Check filename |
|
|