Macros process on one pass.
This commit is contained in:
parent
8e4c8a9fd8
commit
0ebac2be41
22 changed files with 24 additions and 51 deletions
|
|
@ -271,8 +271,7 @@ sub page {
|
|||
}
|
||||
$httpHeader = WebGUI::Session::httpHeader();
|
||||
unless ($useCache && defined $content) {
|
||||
$content = WebGUI::Template::process(WebGUI::Style::get($pageEdit.WebGUI::Page::getTemplate($template)),
|
||||
$positions);
|
||||
$content = WebGUI::Macro::process(WebGUI::Template::process(WebGUI::Style::get($pageEdit.WebGUI::Page::getTemplate($template)), $positions));
|
||||
$cache->set($cacheKey, $content, $session{config}{cachePages}) if ($useCache);
|
||||
}
|
||||
$debug = _generateDebug();
|
||||
|
|
|
|||
|
|
@ -173,7 +173,6 @@ sub insufficient {
|
|||
$output = '<h1>'.WebGUI::International::get(37).'</h1>';
|
||||
$output .= WebGUI::International::get(38);
|
||||
$output .= '<p>';
|
||||
$output = WebGUI::Macro::process($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ package WebGUI::Style;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Template;
|
||||
|
|
@ -79,7 +78,7 @@ sub get {
|
|||
}
|
||||
$header .= '</head>'.$body[0];
|
||||
$footer = $body[1].' </html>';
|
||||
return WebGUI::Macro::process($header.$_[0].$footer);
|
||||
return $header.$_[0].$footer;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -264,7 +264,6 @@ sub duplicate {
|
|||
title => $_[0]->get("title"),
|
||||
description => $_[0]->get("description"),
|
||||
displayTitle => $_[0]->get("displayTitle"),
|
||||
processMacros => $_[0]->get("processMacros"),
|
||||
startDate => $_[0]->get("startDate"),
|
||||
endDate => $_[0]->get("endDate"),
|
||||
templatePosition => $_[0]->get("templatePosition")
|
||||
|
|
@ -642,7 +641,7 @@ NOTE: This method should be extended by all subclasses.
|
|||
|
||||
A hash reference of the properties of this wobject instance. This method will accept any name/value pair and associate it with this wobject instance in memory, but will only store the following fields to the database:
|
||||
|
||||
title, displayTitle, description, processMacros, pageId, templatePosition, startDate, endDate, sequenceNumber
|
||||
title, displayTitle, description, pageId, templatePosition, startDate, endDate, sequenceNumber
|
||||
|
||||
=item arrayRef
|
||||
|
||||
|
|
@ -678,7 +677,7 @@ sub set {
|
|||
$sql = "update wobject set";
|
||||
foreach $key (keys %{$_[1]}) {
|
||||
$_[0]->{_property}{$key} = ${$_[1]}{$key};
|
||||
if (isIn($key, qw(userDefined1 userDefined2 userDefined3 userDefined4 userDefined5 moderationType groupToModerate groupToPost karmaPerPost editTimeout title displayTitle description processMacros pageId templatePosition startDate endDate sequenceNumber))) {
|
||||
if (isIn($key, qw(userDefined1 userDefined2 userDefined3 userDefined4 userDefined5 moderationType groupToModerate groupToPost karmaPerPost editTimeout title displayTitle description pageId templatePosition startDate endDate sequenceNumber))) {
|
||||
$sql .= " ".$key."=".quote(${$_[1]}{$key}).",";
|
||||
}
|
||||
if (isIn($key, @{$_[2]})) {
|
||||
|
|
@ -1023,12 +1022,6 @@ sub www_edit {
|
|||
-value=>$displayTitle,
|
||||
-uiLevel=>5
|
||||
);
|
||||
$f->yesNo(
|
||||
-name=>"processMacros",
|
||||
-label=>WebGUI::International::get(175),
|
||||
-value=>$_[0]->get("processMacros"),
|
||||
-uiLevel=>5
|
||||
);
|
||||
$f->select(
|
||||
-name=>"templatePosition",
|
||||
-label=>WebGUI::International::get(363),
|
||||
|
|
@ -1084,7 +1077,6 @@ sub www_editSave {
|
|||
$_[0]->set({
|
||||
title=>$title,
|
||||
displayTitle=>$session{form}{displayTitle},
|
||||
processMacros=>$session{form}{processMacros},
|
||||
templatePosition=>$templatePosition,
|
||||
startDate=>$startDate,
|
||||
endDate=>$endDate,
|
||||
|
|
@ -1348,7 +1340,6 @@ sub www_view {
|
|||
my ($output);
|
||||
$output = $_[0]->displayTitle;
|
||||
$output .= $_[0]->description;
|
||||
$output = $_[0]->processMacros($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ sub www_view {
|
|||
$var{"post.URL"} = WebGUI::URL::page('func=post&mid=new&wid='.$_[0]->get("wobjectId"));
|
||||
$var{"post.label"} = WebGUI::International::get(24,$namespace);
|
||||
}
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -510,7 +510,7 @@ sub www_view {
|
|||
$var{"list.pageList"} = $p->getPageLinks;
|
||||
$var{"list.previousPage"} = $p->getPreviousPageLink;
|
||||
$var{"list.multiplePages"} = ($p->getNumberOfPages > 1);
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -540,14 +540,7 @@ sub www_viewEvent {
|
|||
$var{"next.label"} = WebGUI::International::get(93,$namespace).'»';
|
||||
$var{"next.url"} = WebGUI::URL::page("func=viewEvent&wid=".$_[0]->get("wobjectId")."&eid=".$id) if ($id);
|
||||
$var{description} = $event{description};
|
||||
return WebGUI::Macro::process(
|
||||
WebGUI::Template::process(
|
||||
WebGUI::Template::get(
|
||||
$_[0]->get("eventTemplateId"),
|
||||
"EventsCalendar/Event"
|
||||
),
|
||||
\%var)
|
||||
);
|
||||
return WebGUI::Template::process( WebGUI::Template::get( $_[0]->get("eventTemplateId"), "EventsCalendar/Event"), \%var);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ sub www_edit {
|
|||
$f->readOnly($_[0]->get("wobjectId"),WebGUI::International::get(499));
|
||||
$f->hidden("title",$namespace);
|
||||
$f->hidden("displayTitle",0);
|
||||
$f->hidden("processMacros",0);
|
||||
$f->select(
|
||||
-name=>"templatePosition",
|
||||
-label=>WebGUI::International::get(363),
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ sub www_view {
|
|||
}
|
||||
$sth->finish;
|
||||
$var{qa_loop} = \@qa;
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ sub www_view {
|
|||
$var{pageList} = $p->getPageLinks;
|
||||
$var{previousPage} = $p->getPreviousPageLink;
|
||||
$var{multiplePages} = ($p->getNumberOfPages > 1);
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,6 @@ sub www_view {
|
|||
|
||||
$output = $_[0]->displayTitle;
|
||||
$output .= $_[0]->description;
|
||||
$output = $_[0]->processMacros($output);
|
||||
|
||||
if(not(-w $_[0]->get("cookiebox") && -r $_[0]->get("cookiebox"))) {
|
||||
return "<b>Error while opening cookie directory ".$_[0]->get("cookiebox")."</b><p><i>$!</i>";
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ sub www_view {
|
|||
$var{"attachment.URL"} = $file->getURL;
|
||||
$var{"attachment.Icon"} = $file->getIcon;
|
||||
}
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use Tie::CPHash;
|
|||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Icon;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -206,7 +205,7 @@ sub www_view {
|
|||
}
|
||||
$sth->finish;
|
||||
$var{link_loop} = \@linkloop;
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -321,8 +321,6 @@ sub www_view {
|
|||
|
||||
$sth = WebGUI::SQL->read("select * from MailForm_field where wobjectId=".$_[0]->get("wobjectId")." order by sequenceNumber");
|
||||
while (%data = $sth->hash) {
|
||||
# process macros on default values
|
||||
$data{defaultValue} = $_[0]->processMacros($data{defaultValue});
|
||||
if ($data{status} == 1) {
|
||||
# hidden field, don't show on form for security reasons
|
||||
$row = "";
|
||||
|
|
@ -348,7 +346,7 @@ sub www_view {
|
|||
$f->submit(WebGUI::International::get(73, $namespace));
|
||||
$output .= $f->print;
|
||||
|
||||
return $_[0]->processMacros($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -452,7 +450,7 @@ sub _createField {
|
|||
# add an empty option if no default value is provided
|
||||
foreach (split(/\n/, $data->{possibleValues})) {
|
||||
s/\s+$//; # remove trailing spaces
|
||||
$selectOptions{$_} = $_[0]->processMacros($_);
|
||||
$selectOptions{$_} = $_;
|
||||
}
|
||||
$f->selectList(
|
||||
-name=>$name,
|
||||
|
|
@ -470,7 +468,7 @@ sub _createField {
|
|||
tie %selectOptions, 'Tie::IxHash';
|
||||
foreach (split(/\n/, $data->{possibleValues})) {
|
||||
s/\s+$//; # remove trailing spaces
|
||||
$selectOptions{$_} = $_[0]->processMacros($_);
|
||||
$selectOptions{$_} = $_;
|
||||
}
|
||||
if ($session{form}{$name}) {
|
||||
@defaultValues = $session{cgi}->param($name);
|
||||
|
|
@ -498,7 +496,7 @@ sub _createField {
|
|||
tie %selectOptions, 'Tie::IxHash';
|
||||
foreach (split(/\n/, $data->{possibleValues})) {
|
||||
s/\s+$//; # remove trailing spaces
|
||||
$selectOptions{$_} = $_[0]->processMacros($_);
|
||||
$selectOptions{$_} = $_;
|
||||
}
|
||||
if ($session{form}{$name}) {
|
||||
@defaultValues = $session{cgi}->param($name);
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ sub www_showMessage {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my ($p, $data, %var, @message_loop, $rows, @last, $replies);
|
||||
$var{title} = $_[0]->processMacros($_[0]->get("title"));
|
||||
$var{description} = $_[0]->processMacros($_[0]->get("description"));
|
||||
$var{title} = $_[0]->get("title");
|
||||
$var{description} = $_[0]->get("description");
|
||||
$var{canPost} = WebGUI::Privilege::isInGroup($_[0]->get("groupToPost"));
|
||||
$var{"post.url"} = WebGUI::URL::page('func=post&mid=new&wid='.$_[0]->get("wobjectId"));
|
||||
$var{"post.label"} = WebGUI::International::get(17,$namespace);
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ sub www_view {
|
|||
}
|
||||
$output .= '<span class="pollAnswer"><hr size="1"><b>'.WebGUI::International::get(12,$namespace).'</b> '.$totalResponses.'</span>';
|
||||
}
|
||||
return $_[0]->processMacros($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ sub www_view {
|
|||
}
|
||||
$sth->finish;
|
||||
$var{relatedproduct_loop} = \@relatedloop;
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ sub www_view {
|
|||
$output .= WebGUI::International::get(12,$namespace).'<p>' if ($_[0]->get("debugMode"));
|
||||
WebGUI::ErrorHandler::warn("SQLReport [".$_[0]->get("wobjectId")."] Could not connect to database.");
|
||||
}
|
||||
return $_[0]->processMacros($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ sub www_editSave {
|
|||
sub www_view {
|
||||
my (%var);
|
||||
$var{page_loop} = _traversePageTree($_[0]->get("startAtThisLevel"),0,$_[0]->get("depth"),$_[0]->get("indent"));
|
||||
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -677,7 +677,7 @@ sub www_view {
|
|||
$output .= WebGUI::International::get(49,$namespace);
|
||||
}
|
||||
}
|
||||
return $_[0]->processMacros($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use WebGUI::DateTime;
|
|||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Icon;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -83,7 +82,6 @@ sub www_view {
|
|||
my ($output);
|
||||
$output = $_[0]->displayTitle;
|
||||
$output .= $_[0]->description;
|
||||
$output = $_[0]->processMacros($output);
|
||||
$output .= $_[0]->get("content");
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,8 +320,8 @@ sub www_view {
|
|||
$numResults = $_[0]->get("submissionsPerPage");
|
||||
$var{"readmore.label"} = WebGUI::International::get(46,$namespace);
|
||||
$var{"responses.label"} = WebGUI::International::get(57,$namespace);
|
||||
$var{title} = $_[0]->processMacros($_[0]->get("title"));
|
||||
$var{description} = $_[0]->processMacros($_[0]->get("description"));
|
||||
$var{title} = $_[0]->get("title");
|
||||
$var{description} = $_[0]->get("description");
|
||||
$var{canPost} = WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute"));
|
||||
$var{"post.url"} = WebGUI::URL::page('func=editSubmission&sid=new&wid='.$_[0]->get("wobjectId"));
|
||||
$var{"post.label"} = WebGUI::International::get(20,$namespace);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ sub www_edit {
|
|||
$f->readOnly($_[0]->get("wobjectId"),WebGUI::International::get(499));
|
||||
$f->hidden("title",$namespace);
|
||||
$f->hidden("displayTitle",0);
|
||||
$f->hidden("processMacros",0);
|
||||
$f->select(
|
||||
-name=>"templatePosition",
|
||||
-label=>WebGUI::International::get(363),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue