- From: Bjoern Hoehrmann via cvs-syncmail <cvsmail@w3.org>
- Date: Sun, 11 Sep 2005 05:27:27 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv24940
Modified Files:
check
Log Message:
minor cleanup for template generation and self_url construction
Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.450
retrieving revision 1.451
diff -u -d -r1.450 -r1.451
--- check 10 Sep 2005 10:01:16 -0000 1.450
+++ check 11 Sep 2005 05:27:25 -0000 1.451
@@ -681,32 +681,32 @@
}
}
+my $template;
+
if ($File->{Opt}->{Output} eq 'xml') {
- prep_template($File, $XMLT);
- fin_template($File, $XMLT);
- report_xml($File, $XMLT);
+ $template = $XMLT;
} elsif ($File->{Opt}->{Output} eq 'earl') {
- prep_template($File, $EARLT);
- fin_template($File, $EARLT);
- report_earl($File, $EARLT);
+ $template = $EARLT;
} elsif ($File->{Opt}->{Output} eq 'n3') {
- prep_template($File, $N3T);
- fin_template($File, $N3T);
- report_n3($File, $N3T);
+ $template = $N3T;
} else {
- &prep_template($File, $T);
-
- fin_template($File, $T);
+ $template = $T;
+}
- $T->param(file_warnings => $File->{Warnings});
- $T->param(file_source => &source($File))
- if $T->param('opt_show_source');
- $T->param('opt_show_esis' => TRUE) if $File->{Opt}->{'Show ESIS'};
- $T->param('opt_show_raw_errors' => TRUE) if $File->{Opt}->{'Show Errors'};
- $T->param('file_raw_errors' => &show_errors($File)) if $T->param('opt_show_raw_errors');
+&prep_template($File, $template);
+fin_template($File, $template);
- print $T->output;
-}
+$template->param(file_warnings => $File->{Warnings});
+$template->param(file_source => &source($File))
+ if $template->param('opt_show_source');
+$template->param('opt_show_esis' => TRUE)
+ if $File->{Opt}->{'Show ESIS'};
+$template->param('opt_show_raw_errors' => TRUE)
+ if $File->{Opt}->{'Show Errors'};
+$template->param('file_raw_errors' => &show_errors($File))
+ if $template->param('opt_show_raw_errors');
+
+print $template->output;
#
# Get rid of $File object and exit.
@@ -847,13 +847,8 @@
} elsif (defined $File->{Tentative}) {
$T->param(is_tentative => TRUE);
}
- my $thispage = $File->{Env}->{'Self URI'};
- my $escaped_uri = uri_escape($File->{URI});
- $thispage .= qq(?uri=$escaped_uri);
- $thispage .= ';ss=1' if $File->{Opt}->{'Show Source'};
- $thispage .= ';sp=1' if $File->{Opt}->{'Show Parsetree'};
- $thispage .= ';noatt=1' if $File->{Opt}->{'No Attributes'};
- $thispage .= ';outline=1' if $File->{Opt}->{'Outline'};
+
+ my $thispage = self_url_file($File);
$T->param(file_thispage => $thispage);
}
@@ -1679,50 +1674,6 @@
}
#
-# Return an XML report for the page.
-sub report_xml {
- my $File = shift;
- my $template = shift;
-
- # TODO: restore
- # if ($File->{E}->param('fatal_http_error')) {
- # $valid = 'Could not validate';
- # }
-
- print $template->output;
-}
-
-#
-# Return an EARL report for the page.
-sub report_earl {
- my $File = shift;
- my $template = shift;
-
- # TODO: restore
- # if ($File->{E}->param('fatal_http_error')) {
- # $valid = 'Could not validate';
- # }
-
- print $template->output;
-}
-
-#
-# Return a Notation3 EARL report for the page.
-#
-# @@TODO: escape output;
-sub report_n3 {
- my $File = shift;
- my $template = shift;
-
- # TODO: restore
- # if ($File->{E}->param('fatal_http_error')) {
- # $valid = 'Could not validate';
- # }
-
- print $template->output;
-}
-
-#
# Abort with a message if an error was flagged at point.
sub abort_if_error_flagged {
my $File = shift;
@@ -1802,8 +1753,10 @@
$thispage .= ';sp=1' if $File->{Opt}->{'Show Parsetree'};
$thispage .= ';noatt=1' if $File->{Opt}->{'No Attributes'};
$thispage .= ';outline=1' if $File->{Opt}->{'Outline'};
- $thispage .= ';verbose=1' if $File->{Opt}->{'Verbose'};
- $thispage .= ';No200=1' if $File->{Opt}->{'No200'};
+
+ # These were not added by report_valid; perhaps they should be?
+ # $thispage .= ';verbose=1' if $File->{Opt}->{'Verbose'};
+ # $thispage .= ';No200=1' if $File->{Opt}->{'No200'};
return $thispage;
}
Received on Sunday, 11 September 2005 05:27:31 UTC