rewrote the template api and added lots of caching options

This commit is contained in:
JT Smith 2004-06-15 17:36:25 +00:00
parent 6613992f3d
commit 20482def49
24 changed files with 252 additions and 100 deletions

View file

@ -566,7 +566,7 @@ sub www_viewEvent {
$var{"next.label"} = WebGUI::International::get(93,$_[0]->get("namespace")).'»';
$var{"next.url"} = WebGUI::URL::page("func=viewEvent&wid=".$_[0]->get("wobjectId")."&eid=".$id) if ($id);
$var{description} = $event{description};
return WebGUI::Template::process( WebGUI::Template::get( $_[0]->get("eventTemplateId"), "EventsCalendar/Event"), \%var);
return $_[0]->processTemplate($_[0]->get("eventTemplateId"),\%var, "EventsCalendar/Event");
}
1;

View file

@ -15,6 +15,7 @@ use Tie::CPHash;
use WebGUI::HTMLForm;
use WebGUI::Icon;
use WebGUI::International;
use WebGUI::Page;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::SQL;
@ -42,7 +43,7 @@ sub _traversePageTree {
}
$sth = WebGUI::SQL->read("select urlizedTitle, menuTitle, title, pageId, synopsis from page where parentId='$parent' and hideFromNavigation = 0 order by $orderBy");
while ($data = $sth->hashRef) {
if (($data->{pageId}<0 || $data->{pageId}>999 || $data->{pageId}==1) && WebGUI::Privilege::canViewPage($data->{pageId})) {
if (($data->{pageId}<0 || $data->{pageId}>999 || $data->{pageId}==1) && WebGUI::Page::canView($data->{pageId})) {
push(@pages,{
"page.indent" => $indentString,
"page.url" => WebGUI::URL::gateway($data->{urlizedTitle}),

View file

@ -563,7 +563,7 @@ sub www_editSubmission {
});
$var{'form.submit'} = WebGUI::Form::submit();
$var{'form.footer'} = '</form>';
return WebGUI::Template::process(WebGUI::Template::get($_[0]->get("submissionFormTemplateId"),"USS/SubmissionForm"), \%var);
return $_[0]->processTemplate($_[0]->get("submissionFormTemplateId"),\%var,"USS/SubmissionForm");
}
#-------------------------------------------------------------------
@ -891,7 +891,7 @@ sub www_viewSubmission {
{callback=>$callback,title=>$submission->{title},forumId=>$submission->{forumId}},
$submission->{forumId});
}
return WebGUI::Template::process(WebGUI::Template::get($_[0]->get("submissionTemplateId"),"USS/Submission"), \%var);
return $_[0]->processTemplate($_[0]->get("submissionTemplateId"),\%var,"USS/Submission");
}