version 1.74, 2002/03/06 22:58:45
|
version 1.76, 2002/04/10 15:28:45
|
Line 68 use strict;
|
Line 68 use strict;
|
use Apache::File; |
use Apache::File; |
use File::Copy; |
use File::Copy; |
use Apache::Constants qw(:common :http :methods); |
use Apache::Constants qw(:common :http :methods); |
use HTML::TokeParser; |
use HTML::LCParser; |
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::lonhomework; |
use Apache::lonhomework; |
use Apache::loncacc; |
use Apache::loncacc; |
Line 91 my $cudom;
|
Line 91 my $cudom;
|
sub metaeval { |
sub metaeval { |
my $metastring=shift; |
my $metastring=shift; |
|
|
my $parser=HTML::TokeParser->new(\$metastring); |
my $parser=HTML::LCParser->new(\$metastring); |
my $token; |
my $token; |
while ($token=$parser->get_token) { |
while ($token=$parser->get_token) { |
if ($token->[0] eq 'S') { |
if ($token->[0] eq 'S') { |
Line 257 sub publish {
|
Line 257 sub publish {
|
$content=join('',<$org>); |
$content=join('',<$org>); |
} |
} |
{ |
{ |
my $parser=HTML::TokeParser->new(\$content); |
my $parser=HTML::LCParser->new(\$content); |
my $token; |
my $token; |
while ($token=$parser->get_token) { |
while ($token=$parser->get_token) { |
if ($token->[0] eq 'S') { |
if ($token->[0] eq 'S') { |
Line 288 sub publish {
|
Line 288 sub publish {
|
"Max Index: $maxindex (min 10)\n"; |
"Max Index: $maxindex (min 10)\n"; |
} |
} |
my $outstring=''; |
my $outstring=''; |
my $parser=HTML::TokeParser->new(\$content); |
my $parser=HTML::LCParser->new(\$content); |
$parser->xml_mode(1); |
$parser->xml_mode(1); |
my $token; |
my $token; |
while ($token=$parser->get_token) { |
while ($token=$parser->get_token) { |
Line 429 sub publish {
|
Line 429 sub publish {
|
$allowstr=~s/\n+/\n/g; |
$allowstr=~s/\n+/\n/g; |
$outstring=~s/(\<\/[^\>]+\>\s*)$/$allowstr$1/s; |
$outstring=~s/(\<\/[^\>]+\>\s*)$/$allowstr$1/s; |
|
|
|
#Encode any High ASCII characters |
|
$outstring=&HTML::Entities::encode($outstring,"\200-\377"); |
# ------------------------------------------------------------- Write modified |
# ------------------------------------------------------------- Write modified |
|
|
{ |
{ |
Line 722 sub phasetwo {
|
Line 724 sub phasetwo {
|
$value=~s/\"/\'\'/g; |
$value=~s/\"/\'\'/g; |
print $mfh ' '.$_.'="'.$value.'"'; |
print $mfh ' '.$_.'="'.$value.'"'; |
} |
} |
print $mfh '>'.$metadatafields{$unikey}.'</'.$tag.'>'; |
print $mfh '>'. |
|
&HTML::Entities::encode($metadatafields{$unikey}) |
|
.'</'.$tag.'>'; |
} |
} |
} |
} |
$scrout.='<p>Wrote Metadata'; |
$scrout.='<p>Wrote Metadata'; |
Line 947 if (-e $target) {
|
Line 951 if (-e $target) {
|
|
|
|
|
return $warning.$scrout. |
return $warning.$scrout. |
'<hr><a href="'.$thisdistarget.'"><font size=+2>View Target</font></a>'. |
'<hr><a href="'.$thisdistarget.'"><font size=+2>View Published Version</font></a>'. |
'<p><a href="'.$thissrc.'"><font size=+2>Back to Source</font></a>'. |
'<p><a href="'.$thissrc.'"><font size=+2>Back to Source</font></a>'. |
'<p><a href="'.$thissrcdir. |
'<p><a href="'.$thissrcdir. |
'"><font size=+2>Back to Source Directory</font></a>'; |
'"><font size=+2>Back to Source Directory</font></a>'; |