forward porting fix for non-unique separator strings, ~~~, #8543

This commit is contained in:
Colin Kuskie 2008-11-21 23:07:05 +00:00
parent 9eff3a4b77
commit 13eb87ffe5
13 changed files with 54 additions and 27 deletions

View file

@ -2087,8 +2087,8 @@ sub www_search {
# This is very bad! It should be $self->processStyle or whatnot.
$self->session->http->sendHeader;
my $template = WebGUI::Asset::Template->new($self->session,$self->get("templateIdSearch"));
my $style = $self->session->style->process("~~~",$self->get("styleTemplateId"));
my ($head, $foot) = split("~~~",$style);
my $style = $self->session->style->process($self->getSeparator,$self->get("styleTemplateId"));
my ($head, $foot) = split($self->getSeparator,$style);
$self->session->output->print($head, 1);
$self->session->output->print($self->processTemplate($var, undef, $template));
$self->session->output->print($foot, 1);

View file

@ -763,8 +763,8 @@ sub sendChunkedContent {
$self->session->http->setLastModified($self->getContentLastModified);
$self->session->http->sendHeader;
my $style = $self->processStyle("~~~");
my ($head, $foot) = split("~~~",$style);
my $style = $self->processStyle($self->getSeparator);
my ($head, $foot) = split($self->getSeparator,$style);
$self->session->output->print($head, 1);
$self->session->output->print( $callback->() );
$self->session->output->print($foot, 1);

View file

@ -439,8 +439,8 @@ sub www_view {
return $output;
} else {
$self->session->http->sendHeader;
my $style = $self->processStyle("~~~");
my ($head, $foot) = split("~~~",$style);
my $style = $self->processStyle($self->getSeparator);
my ($head, $foot) = split($self->getSeparator,$style);
$self->session->output->print($head);
$self->session->output->print($output, 1); # Do not process macros
$self->session->output->print($foot);

View file

@ -196,14 +196,14 @@ sub prepareView {
push(@{$vars{"position1_loop"}},{
id=>$child->getId,
isUncommitted=> $child->get('status') eq 'pending',
content=>"~~~".$child->getId."~~~~~"
content=>$self->getSeparator.$child->getId.$self->getSeparator('!'),
});
} else {
$placeHolder{$child->getId} = $child;
push(@{$vars{"position".$i."_loop"}},{
id=>$child->getId,
isUncommitted=>$child->get('status') eq 'pending',
content=>"~~~".$child->getId."~~~~~"
content=>$self->getSeparator.$child->getId.$self->getSeparator('!'),
});
}
}
@ -226,13 +226,13 @@ sub prepareView {
if($self->getValue("assetOrder") eq "asc"){
push(@{$vars{"position1_loop"}},{
id=>$child->getId,
content=>"~~~".$child->getId."~~~~~"
content=>$self->getSeparator.$child->getId.$self->getSeparator('!'),
});
}
else {
unshift(@{$vars{"position1_loop"}},{
id=>$child->getId,
content=>"~~~".$child->getId."~~~~~"
content=>$self->getSeparator.$child->getId.$self->getSeparator('!'),
});
}
}
@ -272,10 +272,10 @@ sub view {
}
my $showPerformance = $self->session->errorHandler->canShowPerformanceIndicators();
my $out = $self->processTemplate($self->{_viewVars},undef,$self->{_viewTemplate});
my @parts = split("~~~~~",$self->processTemplate($self->{_viewVars},undef,$self->{_viewTemplate}));
my @parts = split($self->getSeparator('!'),$self->processTemplate($self->{_viewVars},undef,$self->{_viewTemplate}));
my $output = "";
foreach my $part (@parts) {
my ($outputPart, $assetId) = split("~~~",$part,2);
my ($outputPart, $assetId) = split($self->getSeparator,$part,2);
if ($self->{_viewPrintOverride}) {
$self->session->output->print($outputPart);
} else {