fixed some xhhtml stuff

increased performance on burst protection
This commit is contained in:
JT Smith 2006-04-07 19:35:31 +00:00
parent ddeee5fbe8
commit adea847875
8 changed files with 34 additions and 30 deletions

View file

@ -107,7 +107,9 @@ sub contentHandler {
$session->http->getHeader();
unless ($session->http->isRedirect()) {
$session->output->print($output);
$session->output->goodNightAndGoodLuck();
if ($session->errorHandler->canShowDebug()) {
$session->output->print($session->errorHandler->showDebug(),1);
}
}
WebGUI::Affiliate::grabReferral($session); # process affilliate tracking request
}

View file

@ -1039,9 +1039,9 @@ sub www_view {
$self->prepareView;
my $style = $self->getParent->processStyle("~~~");
my ($head, $foot) = split("~~~",$style);
$self->session->output->print($head);
$self->session->output->print($head,1);
$self->session->output->print($self->view);
$self->session->output->print($foot);
$self->session->output->print($foot,1);
return "chunked";
}

View file

@ -558,9 +558,9 @@ sub www_view {
$self->prepareView;
my $style = $self->processStyle("~~~");
my ($head, $foot) = split("~~~",$style);
$self->session->output->print($head);
$self->session->output->print($head, 1);
$self->session->output->print($self->view);
$self->session->output->print($foot);
$self->session->output->print($foot, 1);
return "chunked";
}

View file

@ -15,6 +15,7 @@ package WebGUI::Asset::Wobject::Layout;
=cut
use strict;
use WebGUI::AdSpace;
use WebGUI::Asset::Wobject;
use WebGUI::Utility;
use WebGUI::Cache;
@ -278,12 +279,16 @@ sub www_view {
$cache->set($out, 60);
$self->session->stow->delete("cacheFixOverride");
}
# keep those ads rotating
while ($out =~ /(\[AD\:(\w+)\])/gs) {
my $ad = $1;
my $macro = "^AdSpace(".$2.");";
$out =~ s/\Q$ad/$macro/ges;
my $code = $1;
my $adSpace = WebGUI::AdSpace->newByName($self->session, $2);
my $ad = $adSpace->displayImpression if (defined $adSpace);
$out =~ s/\Q$code/$ad/ges;
}
return $out;
$self->session->http->getHeader;
$self->session->output->print($out, 1);
return "chunked";
}
$self->{_viewPrintOverride} = 1; # we do this to make it output each easset as it goes, rather than waiting until the end
return $self->SUPER::www_view;

View file

@ -1184,7 +1184,7 @@ sub www_viewDetail {
$f->submit(
-extras=>'class="ratingForm"',
-value=>"Rate",
-label=>'<a href="'.$self->formatURL("rate",$listingId).'">'.$i18n->get('show ratings').'</A>'
-label=>'<a href="'.$self->formatURL("rate",$listingId).'">'.$i18n->get('show ratings').'</a>'
);
if ($hasRated) {
$var{'ratings'} = $ratingsTable;

View file

@ -54,10 +54,6 @@ The number of rows (in characters) tall the box should be. Defaults to the setti
The number of columns (in characters) wide the box should be. Defaults to the setting textAreaCols or 50 if that's not specified.
=head4 wrap
The style of wrapping this form should use. Defaults to "virtual". Other possible values are "off" and "physical".
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
@ -79,9 +75,6 @@ sub definition {
columns=>{
defaultValue=> $session->setting->get("textAreaCols") || 50
},
wrap=>{
defaultValue=>"virtual"
},
profileEnabled=>{
defaultValue=>1
},
@ -100,8 +93,7 @@ Renders an input tag of type text.
sub toHtml {
my $self = shift;
my $value = $self->fixMacros($self->fixTags($self->fixSpecialCharacters($self->get("value"))));
return '<textarea id="'.$self->get('id').'" name="'.$self->get("name").'" cols="'.$self->get("columns").'" rows="'.$self->get("rows").'" wrap="'.
$self->get("wrap").'" '.$self->get("extras").'>'.$value.'</textarea>';
return '<textarea id="'.$self->get('id').'" name="'.$self->get("name").'" cols="'.$self->get("columns").'" rows="'.$self->get("rows").'" '.$self->get("extras").'>'.$value.'</textarea>';
}

View file

@ -170,7 +170,7 @@ sub error {
my $self = shift;
my $message = shift;
$self->getLogger->error($message);
$self->session->output->print("\n\n".$message.":\n".$self->getStackTrace());
$self->session->output->print("\n\n".$message.":\n".$self->getStackTrace(), 1);
$self->getLogger->debug("Stack trace for ERROR ".$message."\n".$self->getStackTrace());
$self->session->stow->set("debug_error", $self->session->stow->get("debug_error").$message."\n");
}
@ -191,19 +191,19 @@ sub fatal {
Apache2::RequestUtil->request->content_type('text/html') if ($self->session->request);
$self->getLogger->fatal($message);
$self->getLogger->debug("Stack trace for FATAL ".$message."\n".$self->getStackTrace());
$self->session->output->print($self->session->http->getHeader) if ($self->session->request);
$self->session->http->getHeader if ($self->session->request);
unless ($self->canShowDebug()) {
#NOTE: You can't internationalize this because with some types of errors that would cause an infinite loop.
$self->session->output->print("<h1>Problem With Request</h1>
We have encountered a problem with your request. Please use your back button and try again.
If this problem persists, please contact us with what you were trying to do and the time and date of the problem.");
$self->session->output->print('<br />'.$self->session->setting("companyName"));
$self->session->output->print('<br />'.$self->session->setting("companyEmail"));
$self->session->output->print('<br />'.$self->session->setting("companyURL"));
If this problem persists, please contact us with what you were trying to do and the time and date of the problem.",1);
$self->session->output->print('<br />'.$self->session->setting("companyName"),1);
$self->session->output->print('<br />'.$self->session->setting("companyEmail"),1);
$self->session->output->print('<br />'.$self->session->setting("companyURL"),1);
} else {
$self->session->output->print("<h1>WebGUI Fatal Error</h1><p>Something unexpected happened that caused this system to fault.</p>\n");
$self->session->output->print("<p>".$message."</p>\n");
$self->session->output->print($self->showDebug());
$self->session->output->print("<h1>WebGUI Fatal Error</h1><p>Something unexpected happened that caused this system to fault.</p>\n",1);
$self->session->output->print("<p>".$message."</p>\n",1);
$self->session->output->print($self->showDebug(),1);
}
$self->session->close();
die $message;

View file

@ -85,7 +85,7 @@ sub new {
#-------------------------------------------------------------------
=head2 print ( content )
=head2 print ( content, skipMacros )
Outputs content to either the web server or standard out, depending on which is available.
@ -93,12 +93,17 @@ Outputs content to either the web server or standard out, depending on which is
The content to output.
=head3 skipMacros
A boolean indicating whether to skip macro processing on this content.
=cut
sub print {
my $self = shift;
my $content = shift;
WebGUI::Macro::process($self->session, \$content);
my $skipMacros = shift;
WebGUI::Macro::process($self->session, \$content) unless $skipMacros;
print $content;
}