version 1.186, 2005/03/03 21:14:10
|
version 1.191, 2005/04/04 23:55:17
|
Line 850 sub store_metadata {
|
Line 850 sub store_metadata {
|
|
|
sub checkonthis { |
sub checkonthis { |
my ($r,$source)=@_; |
my ($r,$source)=@_; |
my $oldpath=$ENV{'request.filename'}; |
my $uri=&Apache::lonnet::hreflocation($source); |
$ENV{'request.filename'}=$source; |
$uri=~s/\/$//; |
&Apache::lonxml::xmlparse($r,'web', |
my $result=&Apache::lonnet::ssi_body($uri, |
&Apache::lonnet::getfile($source)); |
('grade_target'=>'web', |
undef($Apache::lonhomework::parsing_a_problem); |
'return_only_error_and_warning_counts' => 1)); |
$ENV{'request.filename'}=$oldpath; |
my ($errorcount,$warningcount)=split(':',$result); |
if (($Apache::lonxml::errorcount) || |
if (($errorcount) || ($warningcount)) { |
($Apache::lonxml::warningcount)) { |
$r->print('<br /><tt>'.$uri.'</tt>: '); |
if ($Apache::lonxml::errorcount) { |
if ($errorcount) { |
$r->print('<img src="/adm/lonMisc/bomb.gif" /><font color="red"><b>'. |
$r->print('<img src="/adm/lonMisc/bomb.gif" /><font color="red"><b>'. |
$Apache::lonxml::errorcount.' '. |
$errorcount.' '. |
&mt('error(s)').'</b></font> '); |
&mt('error(s)').'</b></font> '); |
} |
} |
if ($Apache::lonxml::warningcount) { |
if ($warningcount) { |
$r->print('<font color="blue">'. |
$r->print('<font color="blue">'. |
$Apache::lonxml::warningcount.' '. |
$warningcount.' '. |
&mt('warning(s)').'</font>'); |
&mt('warning(s)').'</font>'); |
} |
} |
} else { |
} else { |
$r->print('<font color="green">'.&mt('ok').'</font>'); |
#$r->print('<font color="green">'.&mt('ok').'</font>'); |
} |
} |
$r->rflush(); |
$r->rflush(); |
return ($Apache::lonxml::warningcount,$Apache::lonxml::errorcount); |
return ($warningcount,$errorcount); |
} |
} |
|
|
# ============================================== Parse file itself for metadata |
# ============================================== Parse file itself for metadata |
Line 1289 END
|
Line 1289 END
|
} |
} |
my $copyright_help = |
my $copyright_help = |
Apache::loncommon::help_open_topic('Publishing_Copyright'); |
Apache::loncommon::help_open_topic('Publishing_Copyright'); |
$intr_scrout =~ s/DISTRIBUTION:/'DISTRIBUTION: ' . $copyright_help/ge; |
$intr_scrout =~ s/Distribution:/'Distribution: ' . $copyright_help/ge; |
$intr_scrout.=&text_with_browse_field('Custom Distribution File','customdistributionfile',$metadatafields{'customdistributionfile'},'rights').$copyright_help; |
$intr_scrout.=&text_with_browse_field('Custom Distribution File','customdistributionfile',$metadatafields{'customdistributionfile'},'rights').$copyright_help; |
$intr_scrout.=&selectbox('Source Distribution','sourceavail', |
$intr_scrout.=&selectbox('Source Distribution','sourceavail', |
$defaultsourceoption, |
$defaultsourceoption, |
Line 2013 ENDDIFF
|
Line 2013 ENDDIFF
|
|
|
unless ($ENV{'form.phase'} eq 'two') { |
unless ($ENV{'form.phase'} eq 'two') { |
# ---------------------------------------------------------- Parse for problems |
# ---------------------------------------------------------- Parse for problems |
&checkonthis($r,$thisfn); |
my ($warningcount,$errorcount); |
my ($outstring,$error)=&publish($thisfn,$thistarget,$thisembstyle); |
if ($thisembstyle eq 'ssi') { |
$r->print('<hr />'.$outstring); |
($warningcount,$errorcount)=&checkonthis($r,$thisfn); |
|
} |
|
unless ($errorcount) { |
|
my ($outstring,$error)= |
|
&publish($thisfn,$thistarget,$thisembstyle); |
|
$r->print('<hr />'.$outstring); |
|
} else { |
|
$r->print('<h3>'. |
|
&mt('The document contains errors and cannot be published.'). |
|
'</h3>'); |
|
} |
} else { |
} else { |
$r->print('<hr />'. |
$r->print('<hr />'. |
&phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget)); |
&phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget)); |