From dae0123fae1752cd636ac27a5ec27824f048c010 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 27 Jun 2004 14:47:37 +0000 Subject: [PATCH] fixed a bug caused by changing the template api --- lib/WebGUI/Page.pm | 7 ++++--- lib/WebGUI/Template.pm | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/WebGUI/Page.pm b/lib/WebGUI/Page.pm index bc454b064..8db7a0684 100644 --- a/lib/WebGUI/Page.pm +++ b/lib/WebGUI/Page.pm @@ -451,7 +451,7 @@ sub generate { WebGUI::ErrorHandler::fatalError("Wobject runtime error: ${$wobject}{namespace}. Root cause: ".$@) if($@); } $sth->finish; - return WebGUI::Template::process($session{page}{templateId},"Page",\%var); + return WebGUI::Template::process($session{page}{templateId},"page",\%var); } @@ -484,8 +484,9 @@ The id of the page template you wish to retrieve. Defaults to the current page's =cut sub getTemplate { - my $templateId = $_[0] || $session{page}{templateId}; - return WebGUI::Template::get($templateId,"page"); + my $templateId = shift || $session{page}{templateId}; + my $template = WebGUI::Template::get($templateId,"page"); + return $template->{template}; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Template.pm b/lib/WebGUI/Template.pm index 2155ca710..d584a901c 100644 --- a/lib/WebGUI/Template.pm +++ b/lib/WebGUI/Template.pm @@ -99,7 +99,7 @@ Defaults to "1". Specify the templateId of the template to retrieve. =item namespace -Defaults to "Page". Specify the namespace of the template to retrieve. +Defaults to "page". Specify the namespace of the template to retrieve. =back @@ -107,7 +107,7 @@ Defaults to "Page". Specify the namespace of the template to retrieve. sub get { my $templateId = shift || 1; - my $namespace = shift || "Page"; + my $namespace = shift || "page"; return WebGUI::SQL->quickHashRef("select * from template where templateId=".$templateId." and namespace=".quote($namespace)); } @@ -122,14 +122,14 @@ Returns a hash reference containing template ids and template names of all the t =item namespace -Defaults to "Page". Specify the namespace to build the list for. +Defaults to "page". Specify the namespace to build the list for. =back =cut sub getList { - my $namespace = $_[0] || "Page"; + my $namespace = $_[0] || "page"; return WebGUI::SQL->buildHashRef("select templateId,name from template where namespace=".quote($namespace)." and showInForms=1 order by name"); } @@ -148,7 +148,7 @@ Defaults to "1". Specify the templateId of the template to retrieve. =item namespace -Defaults to "Page". Specify the namespace of the template to retrieve. +Defaults to "page". Specify the namespace of the template to retrieve. =item vars @@ -160,7 +160,7 @@ A hash reference containing template variables and loops. Automatically includes sub process { my $templateId = shift || 1; - my $namespace = shift || "Page"; + my $namespace = shift || "page"; my $vars = shift; my $file = _getTemplateFile($templateId,$namespace); my %params = (