fixed a bug caused by changing the template api

This commit is contained in:
JT Smith 2004-06-27 14:47:37 +00:00
parent 874cf16d29
commit dae0123fae
2 changed files with 10 additions and 9 deletions

View file

@ -451,7 +451,7 @@ sub generate {
WebGUI::ErrorHandler::fatalError("Wobject runtime error: ${$wobject}{namespace}. Root cause: ".$@) if($@); WebGUI::ErrorHandler::fatalError("Wobject runtime error: ${$wobject}{namespace}. Root cause: ".$@) if($@);
} }
$sth->finish; $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 =cut
sub getTemplate { sub getTemplate {
my $templateId = $_[0] || $session{page}{templateId}; my $templateId = shift || $session{page}{templateId};
return WebGUI::Template::get($templateId,"page"); my $template = WebGUI::Template::get($templateId,"page");
return $template->{template};
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------

View file

@ -99,7 +99,7 @@ Defaults to "1". Specify the templateId of the template to retrieve.
=item namespace =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 =back
@ -107,7 +107,7 @@ Defaults to "Page". Specify the namespace of the template to retrieve.
sub get { sub get {
my $templateId = shift || 1; 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)); 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 =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 =back
=cut =cut
sub getList { 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"); 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 =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 =item vars
@ -160,7 +160,7 @@ A hash reference containing template variables and loops. Automatically includes
sub process { sub process {
my $templateId = shift || 1; my $templateId = shift || 1;
my $namespace = shift || "Page"; my $namespace = shift || "page";
my $vars = shift; my $vars = shift;
my $file = _getTemplateFile($templateId,$namespace); my $file = _getTemplateFile($templateId,$namespace);
my %params = ( my %params = (