removed old template system and replaced with template asset
This commit is contained in:
parent
023ce77917
commit
4798ba497d
50 changed files with 614 additions and 660 deletions
|
|
@ -19,7 +19,7 @@ use WebGUI::Grouping;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Style;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
=head1 NAME
|
||||
|
|
@ -218,15 +218,6 @@ sub getAdminFunction {
|
|||
op=>"editSettings",
|
||||
group=>"3"
|
||||
},
|
||||
"templates"=>{
|
||||
title=>{
|
||||
id=>"templates",
|
||||
namespace=>"WebGUI"
|
||||
},
|
||||
icon=>"templates.gif",
|
||||
op=>"listTemplates",
|
||||
group=>"8"
|
||||
},
|
||||
"themes"=>{
|
||||
title=>{
|
||||
id=>"themes",
|
||||
|
|
@ -389,7 +380,7 @@ sub render {
|
|||
$var{"console.icon"} = $acParams->{icon};
|
||||
$var{"help.url"} = $self->{_helpUrl};
|
||||
$var{"application_loop"} = $self->getAdminFunction;
|
||||
return WebGUI::Style::process(WebGUI::Template::process($session{setting}{AdminConsoleTemplate}, "AdminConsole", \%var),"adminConsole");
|
||||
return WebGUI::Style::process(WebGUI::Asset::Template->new($session{setting}{AdminConsoleTemplate})->process(\%var),"PBtmpl0000000000000137");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use WebGUI::Asset;
|
|||
use WebGUI::HTTP;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset);
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ sub getBox {
|
|||
$var{"attachment.name"} = $self->get("filename");
|
||||
$var{"attachment.size"} = $self->getStorageLocation->getSize;
|
||||
$var{"attachment.type"} = $self->getStorageLocation->getFileExtension;
|
||||
return WebGUI::Template::process(1,"AttachmentBox",\%var);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000003")->process(\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ sub view {
|
|||
$var{controls} = $self->getToolbar;
|
||||
$var{fileUrl} = $self->getFileUrl;
|
||||
$var{fileIcon} = $self->getFileIconUrl;
|
||||
return WebGUI::Template::process("1","FileAsset",\%var);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000024")->process(\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,12 @@ package WebGUI::Asset::File::Image;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Asset::File;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::HTTP;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Utility;
|
||||
|
||||
|
||||
# do a check to see if they've installed Image::Magick
|
||||
my $hasImageMagick = 1;
|
||||
eval " use Image::Magick; "; $hasImageMagick=0 if $@;
|
||||
|
|
@ -206,7 +208,7 @@ sub view {
|
|||
$var{fileUrl} = $self->getFileUrl;
|
||||
$var{fileIcon} = $self->getFileIconUrl;
|
||||
$var{thumbnail} = $self->getThumbnailUrl;
|
||||
return WebGUI::Template::process("1","ImageAsset",\%var);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000088")->process(\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ use WebGUI::Session;
|
|||
use WebGUI::SQL;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::TabForm;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Template;
|
||||
package WebGUI::Asset::Template;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
|
|
@ -14,38 +14,32 @@ package WebGUI::Template;
|
|||
|
||||
=cut
|
||||
|
||||
|
||||
|
||||
use File::Path;
|
||||
use HTML::Template;
|
||||
use strict;
|
||||
use WebGUI::Attachment;
|
||||
use WebGUI::ErrorHandler;
|
||||
use WebGUI::Id;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::HTTP;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Storage;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset);
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Template
|
||||
Package WebGUI::Asset::Template
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This package contains utility methods for WebGUI's template system.
|
||||
Provides a mechanism to provide a templating system in WebGUI.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI::Template;
|
||||
$hashRef = WebGUI::Template::get($templateId, $namespace);
|
||||
$hashRef = WebGUI::Template::getList($namespace);
|
||||
$templateId = WebGUI::Template::getIdByName($name,$namespace);
|
||||
$html = WebGUI::Template::process($templateId, $namespace, $vars);
|
||||
$templateId = WebGUI::Template::set(\%data);
|
||||
use WebGUI::Asset::Template;
|
||||
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These subroutines are available from this package:
|
||||
These methods are available from this class:
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -53,8 +47,7 @@ These subroutines are available from this package:
|
|||
#-------------------------------------------------------------------
|
||||
sub _getTemplateFile {
|
||||
my $templateId = shift;
|
||||
my $namespace = shift;
|
||||
my $filename = $namespace."-".$templateId.".tmpl";
|
||||
my $filename = $templateId.".tmpl";
|
||||
$filename =~ s/\//-/g;
|
||||
$filename =~ s/ /-/g;
|
||||
return WebGUI::Attachment->new($filename,"temp","templates");
|
||||
|
|
@ -88,86 +81,134 @@ sub _execute {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 get ( templateId, namespace )
|
||||
=head2 definition ( definition )
|
||||
|
||||
Returns a hash reference containing all of the template parameters.
|
||||
Defines the properties of this asset.
|
||||
|
||||
=head3 templateId
|
||||
=head3 definition
|
||||
|
||||
Specify the templateId of the template to retrieve.
|
||||
|
||||
=head3 namespace
|
||||
|
||||
Specify the namespace of the template to retrieve.
|
||||
A hash reference passed in from a subclass definition.
|
||||
|
||||
=cut
|
||||
|
||||
sub get {
|
||||
my $templateId = shift;
|
||||
my $namespace = shift;
|
||||
return WebGUI::SQL->quickHashRef("select * from template where templateId=".quote($templateId)." and namespace=".quote($namespace),WebGUI::SQL->getSlave);
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $definition = shift;
|
||||
push(@{$definition}, {
|
||||
tableName=>'template',
|
||||
className=>'WebGUI::Asset::Template',
|
||||
properties=>{
|
||||
template=>{
|
||||
fieldType=>'codearea',
|
||||
defaultValue=>undef
|
||||
},
|
||||
isEditable=>{
|
||||
fieldType=>'hidden',
|
||||
defaultValue=>1
|
||||
},
|
||||
showInForms=>{
|
||||
fieldType=>'yesNo',
|
||||
defaultValue=>1
|
||||
},
|
||||
namespace=>{
|
||||
fieldType=>'hidden',
|
||||
defaultValue=>undef
|
||||
}
|
||||
}
|
||||
});
|
||||
return $class->SUPER::definition($definition);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getList ( [ namespace ] )
|
||||
=head2 getEditForm ()
|
||||
|
||||
Returns the TabForm object that will be used in generating the edit page for this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
$tabform->getTab("properties")->raw('<input type="hidden" name="op2" value="'.$session{form}{afterEdit}.'" />');
|
||||
if ($session{form}{tid} eq "new") {
|
||||
my $namespaces = WebGUI::SQL->buildHashRef("select distinct(namespace),namespace
|
||||
from template order by namespace");
|
||||
$tabform->getTab("properties")->selectList(
|
||||
-name=>"namespace",
|
||||
-options=>$namespaces,
|
||||
-label=>WebGUI::International::get(721),
|
||||
-value=>[$session{form}{namespace}]
|
||||
);
|
||||
}
|
||||
$tabform->getTab("display")->yesNo(
|
||||
-name=>"showInForms",
|
||||
-value=>$self->getValue("showInForms"),
|
||||
-label=>"Show in forms?"
|
||||
);
|
||||
$tabform->getTab("properties")->codearea(
|
||||
-name=>"template",
|
||||
-label=>WebGUI::International::get(504),
|
||||
-value=>$self->getValue("template")
|
||||
);
|
||||
return $tabform;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getIcon {
|
||||
my $self = shift;
|
||||
my $small = shift;
|
||||
return $session{config}{extrasURL}.'/assets/small/template.gif' if ($small);
|
||||
return $session{config}{extrasURL}.'/assets/template.gif';
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getList ( namespace )
|
||||
|
||||
Returns a hash reference containing template ids and template names of all the templates in the specified namespace.
|
||||
|
||||
NOTE: This is a class method.
|
||||
|
||||
=head3 namespace
|
||||
|
||||
Defaults to "page". Specify the namespace to build the list for.
|
||||
Specify the namespace to build the list for.
|
||||
|
||||
=cut
|
||||
|
||||
sub getList {
|
||||
my $namespace = $_[0] || "page";
|
||||
my $class = shift;
|
||||
my $namespace = shift;
|
||||
return WebGUI::SQL->buildHashRef("select templateId,name from template where namespace=".quote($namespace)." and showInForms=1 order by name",WebGUI::SQL->getSlave);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getIdByName ( name, namespace ) {
|
||||
=head2 getName
|
||||
|
||||
Returns a template ID by looking up the name for it.
|
||||
|
||||
=head3 name
|
||||
|
||||
The name to look up.
|
||||
|
||||
=head3 namespace
|
||||
|
||||
The namespace to focus on when searching.
|
||||
Returns the displayable name of this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub getIdByName {
|
||||
my $name = shift;
|
||||
my $namespace = shift;
|
||||
my ($templateId) = WebGUI::SQL->quickArray("select templateId from template where namespace=".quote($namespace)." and name=".quote($name),WebGUI::SQL->getSlave);
|
||||
return $templateId;
|
||||
}
|
||||
|
||||
sub getName {
|
||||
return "Template";
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 process ( templateId, namespace, vars )
|
||||
=head2 process ( vars )
|
||||
|
||||
Evaluate a template replacing template commands for HTML.
|
||||
|
||||
=head3 templateId
|
||||
|
||||
Specify the templateId of the template to retrieve.
|
||||
|
||||
=head3 namespace
|
||||
|
||||
Specify the namespace of the template to retrieve.
|
||||
|
||||
=head3 vars
|
||||
|
||||
A hash reference containing template variables and loops. Automatically includes the entire WebGUI session.
|
||||
|
|
@ -175,10 +216,11 @@ A hash reference containing template variables and loops. Automatically includes
|
|||
=cut
|
||||
|
||||
sub process {
|
||||
my $templateId = shift;
|
||||
my $namespace = shift;
|
||||
my $self = shift;
|
||||
my $vars = shift;
|
||||
my $file = _getTemplateFile($templateId,$namespace);
|
||||
return $self->processRaw($self->get("template"),$vars);
|
||||
# skip all the junk below here for now until we have time to bring it inline with the new system
|
||||
my $file = _getTemplateFile($self->get("templateId"));
|
||||
my $fileCacheDir = $session{config}{uploadsPath}.$session{os}{slash}."temp".$session{os}{slash}."templatecache";
|
||||
my %params = (
|
||||
filename=>$file->getPath,
|
||||
|
|
@ -213,12 +255,10 @@ sub process {
|
|||
} elsif ($session{config}{templateCacheType} eq "memory-file" && not $error) {
|
||||
$params{double_file_cache} = 1;
|
||||
}
|
||||
|
||||
my $template;
|
||||
unless (-f $file->getPath) {
|
||||
($template) = WebGUI::SQL->quickArray("select template from template where templateId=".quote($templateId)." and namespace=".quote($namespace),WebGUI::SQL->getSlave);
|
||||
$file->saveFromScalar($template);
|
||||
unless (-f $file->getPath) {
|
||||
unless (-e $file->getPath) {
|
||||
$file->saveFromScalar($self->get("template"));
|
||||
unless (-e $file->getPath) {
|
||||
WebGUI::ErrorHandler::warn("Could not create file ".$file->getPath."\nTemplate file caching is disabled");
|
||||
$params{scalarref} = \$template;
|
||||
delete $params{filename};
|
||||
|
|
@ -227,11 +267,16 @@ sub process {
|
|||
return _execute(\%params,$vars);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 processRaw ( template, vars )
|
||||
|
||||
Evaluate a template replacing template commands for HTML.
|
||||
Evaluate a template replacing template commands for HTML.
|
||||
|
||||
NOTE: This is a class method, no instance data required.
|
||||
|
||||
=head3 template
|
||||
|
||||
|
|
@ -244,6 +289,7 @@ A hash reference containing template variables and loops. Automatically includes
|
|||
=cut
|
||||
|
||||
sub processRaw {
|
||||
my $class = shift;
|
||||
my $template = shift;
|
||||
my $vars = shift;
|
||||
return _execute({
|
||||
|
|
@ -256,45 +302,31 @@ sub processRaw {
|
|||
},$vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 set ( data )
|
||||
|
||||
Store a template and it's metadata.
|
||||
|
||||
=head3 data
|
||||
|
||||
A hash reference containing the data to be stored. At minimum the hash reference must include "templateId" and "namespace". The following are the elements allowed to be stored.
|
||||
|
||||
templateId - The unique id for the template. If set to "new" then a new one will be generated.
|
||||
|
||||
namespace - The namespace division for this template.
|
||||
|
||||
template - The content of the template.
|
||||
|
||||
name - A human friendly name for the template.
|
||||
|
||||
showInForms - A boolean indicating whether this template should appear when using the "template" subroutine in WebGUI::Form.
|
||||
|
||||
isEditable - A boolean indicating whether this template should be editable through the template manager.
|
||||
|
||||
=cut
|
||||
|
||||
sub set {
|
||||
my $data = shift;
|
||||
if ($data->{templateId} eq "new") {
|
||||
$data->{templateId} = WebGUI::Id::generate();
|
||||
WebGUI::SQL->write("insert into template (templateId,namespace) values (".quote($data->{templateId}).",".quote($data->{namespace}).")");
|
||||
}
|
||||
my @pairs;
|
||||
foreach my $key (keys %{$data}) {
|
||||
push(@pairs, $key."=".quote($data->{$key})) unless ($key eq "namespace" || $key eq "templateId");
|
||||
}
|
||||
WebGUI::SQL->write("update template set ".join(",",@pairs)." where templateId=".quote($data->{templateId})." and namespace=".quote($data->{namespace}));
|
||||
my $file = _getTemplateFile($data->{templateId},$data->{namespace});
|
||||
$file->delete;
|
||||
return $data->{templateId};
|
||||
sub view {
|
||||
my $self = shift;
|
||||
return $self->get("template");
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless $self->canEdit;
|
||||
$self->getAdminConsole->setHelp("template add/edit");
|
||||
return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get(507));
|
||||
}
|
||||
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::noAccess() unless $self->canView;
|
||||
if ($session{var}{adminOn}) {
|
||||
return $self->www_edit;
|
||||
}
|
||||
return $self->view;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ use WebGUI::Session;
|
|||
use WebGUI::Style;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::TabForm;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::MetaData;
|
||||
|
|
@ -86,10 +86,6 @@ sub definition {
|
|||
fieldType=>'interval',
|
||||
defaultValue=>600
|
||||
},
|
||||
templateId=>{
|
||||
fieldType=>'template',
|
||||
defaultValue=>undef
|
||||
},
|
||||
styleTemplateId=>{
|
||||
fieldType=>'template',
|
||||
defaultValue=>undef
|
||||
|
|
@ -241,11 +237,6 @@ sub getEditForm {
|
|||
-value=>$self->getValue("displayTitle"),
|
||||
-uiLevel=>5
|
||||
);
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue("templateId"),
|
||||
-namespace=>$self->get("namespace"),
|
||||
-afterEdit=>'func=edit&wid='.$self->get("wobjectId")."&namespace=".$self->get("namespace")
|
||||
);
|
||||
$tabform->getTab("display")->template(
|
||||
-name=>"styleTemplateId",
|
||||
-label=>WebGUI::International::get(1073),
|
||||
|
|
@ -444,7 +435,7 @@ sub processPropertiesFromFormPost {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 processTemplate ( vars, namespace [ , templateId ] )
|
||||
=head2 processTemplate ( vars, templateId )
|
||||
|
||||
Returns the content generated from this template.
|
||||
|
||||
|
|
@ -452,21 +443,16 @@ Returns the content generated from this template.
|
|||
|
||||
A hash reference containing variables and loops to pass to the template engine.
|
||||
|
||||
=head3 namespace
|
||||
|
||||
A namespace to use for the template. Defaults to the wobject's namespace.
|
||||
|
||||
=head3 templateId
|
||||
|
||||
An id referring to a particular template in the templates table. Defaults to $self->get("templateId").
|
||||
An id referring to a particular template in the templates table.
|
||||
|
||||
=cut
|
||||
|
||||
sub processTemplate {
|
||||
my $self = shift;
|
||||
my $var = shift;
|
||||
my $namespace = shift;
|
||||
my $templateId = shift || $self->get("templateId");
|
||||
my $templateId = shift;
|
||||
my $meta = WebGUI::MetaData::getMetaDataFields($self->get("wobjectId"));
|
||||
foreach my $field (keys %$meta) {
|
||||
$var->{$meta->{$field}{fieldName}} = $meta->{$field}{value};
|
||||
|
|
@ -481,7 +467,7 @@ sub processTemplate {
|
|||
my ($originalPageURL) = WebGUI::SQL->quickArray("select url from asset where assetId=".quote($self->getId),WebGUI::SQL->getSlave);
|
||||
$vars{originalURL} = WebGUI::URL::gateway($originalPageURL."#".$self->getId);
|
||||
}
|
||||
return WebGUI::Template::process($templateId,$namespace, \%vars);
|
||||
return WebGUI::Asset::Template->new($templateId)->process(\%vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ sub definition {
|
|||
tableName=>'Article',
|
||||
className=>'WebGUI::Asset::Wobject::Article',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000002'
|
||||
},
|
||||
linkURL=>{
|
||||
fieldType=>'url',
|
||||
defaultValue=>undef
|
||||
|
|
@ -54,6 +58,10 @@ sub definition {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"Article"
|
||||
);
|
||||
$tabform->getTab("properties")->text(
|
||||
-name=>"linkTitle",
|
||||
-label=>WebGUI::International::get(7,"Article"),
|
||||
|
|
@ -169,7 +177,7 @@ sub view {
|
|||
forumId=>$self->get("forumId")
|
||||
});
|
||||
} else {
|
||||
return $self->processTemplate(\%var, "Article", $templateId);
|
||||
return $self->processTemplate(\%var, $templateId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,10 @@ sub definition {
|
|||
tableName=>'DataForm',
|
||||
className=>'WebGUI::Asset::Wobject::DataForm',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000020'
|
||||
},
|
||||
acknowledgement=>{
|
||||
fieldType=>"textarea",
|
||||
defaultValue=>undef
|
||||
|
|
@ -188,6 +192,10 @@ sub duplicate {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm;
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"DataForm"
|
||||
);
|
||||
$tabform->getTab("display")->template(
|
||||
-name=>"emailTemplateId",
|
||||
-value=>$self->getValue("emailTemplateId"),
|
||||
|
|
@ -563,7 +571,7 @@ sub purge {
|
|||
sub sendEmail {
|
||||
my $self = shift;
|
||||
my $var = shift;
|
||||
my $message = WebGUI::Macro::process($self->processTemplate($var,"DataForm",$self->get("emailTemplateId")));
|
||||
my $message = WebGUI::Macro::process($self->processTemplate($var,$self->get("emailTemplateId")));
|
||||
my ($to, $subject, $from, $bcc, $cc);
|
||||
foreach my $row (@{$var->{field_loop}}) {
|
||||
if ($row->{"field.name"} eq "to") {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ sub definition {
|
|||
tableName=>'HttpProxy',
|
||||
className=>'WebGUI::Asset::Wobject::HttpProxy',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000033'
|
||||
},
|
||||
proxiedUrl=>{
|
||||
fieldType=>"url",
|
||||
defaultValue=>'http://'
|
||||
|
|
@ -94,6 +98,10 @@ sub getCookieJar {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"HttpProxy"
|
||||
);
|
||||
my %hash;
|
||||
tie %hash, 'Tie::IxHash';
|
||||
%hash=(5=>5,10=>10,20=>20,30=>30,60=>60);
|
||||
|
|
@ -191,7 +199,7 @@ sub view {
|
|||
|
||||
$redirect=0;
|
||||
|
||||
return $self->processTemplate({},"HttpProxy",$self->get("templateId")) unless ($proxiedUrl ne "");
|
||||
return $self->processTemplate({},$self->get("templateId")) unless ($proxiedUrl ne "");
|
||||
|
||||
my $cachedContent = WebGUI::Cache->new($proxiedUrl,"URL");
|
||||
my $cachedHeader = WebGUI::Cache->new($proxiedUrl,"HEADER");
|
||||
|
|
@ -328,7 +336,7 @@ sub view {
|
|||
WebGUI::HTTP::setMimeType($var{header});
|
||||
return $var{content};
|
||||
} else {
|
||||
return $self->processTemplate(\%var,"HttpProxy",$self->get("templateId"));
|
||||
return $self->processTemplate(\%var,$self->get("templateId"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,9 +59,13 @@ sub definition {
|
|||
my $class = shift;
|
||||
my $definition = shift;
|
||||
push(@{$definition}, {
|
||||
tableName=>'layout',
|
||||
tableName=>'Layout',
|
||||
className=>'WebGUI::Asset::Wobject::Layout',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000054'
|
||||
},
|
||||
contentPositions => {
|
||||
defaultValue=>undef,
|
||||
fieldType=>"hidden"
|
||||
|
|
@ -84,6 +88,10 @@ Returns the TabForm object that will be used in generating the edit page for thi
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"Layout"
|
||||
);
|
||||
if ($self->get("assetId") eq "new") {
|
||||
$tabform->getTab("properties")->whatNext(
|
||||
-options=>{
|
||||
|
|
@ -191,7 +199,7 @@ sub view {
|
|||
';
|
||||
}
|
||||
|
||||
return $self->processTemplate(\%vars, "page");
|
||||
return $self->processTemplate(\%vars,$self->get("templateId"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ sub definition {
|
|||
tableName=>'Navigation',
|
||||
className=>'WebGUI::Asset::Wobject::Navigation',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000048'
|
||||
},
|
||||
assetsToInclude=>{
|
||||
fieldType=>'checkList',
|
||||
defaultValue=>"descendants"
|
||||
|
|
@ -70,6 +74,10 @@ sub definition {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm;
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"Navigation"
|
||||
);
|
||||
my ($descendantsChecked, $selfChecked, $pedigreeChecked, $siblingsChecked);
|
||||
my @assetsToInclude = split("\n",$self->getValue("assetsToInclude"));
|
||||
my $afterScript;
|
||||
|
|
@ -337,7 +345,7 @@ sub view {
|
|||
}
|
||||
push(@{$var->{page_loop}}, $pageData);
|
||||
}
|
||||
return $self->processTemplate($var,"Navigation",$self->get("templateId"));
|
||||
return $self->processTemplate($var,$self->get("templateId"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ sub definition {
|
|||
tableName=>'Poll',
|
||||
className=>'WebGUI::Asset::Wobject::Poll',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000055'
|
||||
},
|
||||
active=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>1
|
||||
|
|
@ -165,6 +169,10 @@ sub duplcate {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm;
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"Poll"
|
||||
);
|
||||
my ($i, $answers);
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
if ($self->get('a'.$i) =~ /\C/) {
|
||||
|
|
@ -346,7 +354,7 @@ sub view {
|
|||
}
|
||||
randomizeArray(\@answers) if ($self->get("randomizeAnswers"));
|
||||
$var{answer_loop} = \@answers;
|
||||
return $self->processTemplate(\%var,"Poll",$self->get("templateId"));
|
||||
return $self->processTemplate(\%var,$self->get("templateId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@ sub definition {
|
|||
tableName=>'SQLReport',
|
||||
className=>'WebGUI::Asset::Wobject::SQLReport',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000059'
|
||||
},
|
||||
paginateAfter=>{
|
||||
fieldType=>"integer",
|
||||
defaultValue=>50
|
||||
|
|
@ -132,6 +136,10 @@ sub definition {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"SQLReport"
|
||||
);
|
||||
$tabform->getTab("properties")->yesNo(
|
||||
-name=>"debugMode",
|
||||
-label=>WebGUI::International::get(16,"SQLReport"),
|
||||
|
|
@ -253,7 +261,7 @@ sub www_view {
|
|||
# Add debug loop to template vars
|
||||
$var->{'debug_loop'} = $self->{_debug_loop};
|
||||
#use Data::Dumper; return '<pre>'.Dumper($var).'</pre>';
|
||||
return $self->processTemplate($self->get("templateId"),$var);
|
||||
return $self->processTemplate($var, $self->get("templateId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ sub definition {
|
|||
tableName=>'SyndicatedContent',
|
||||
className=>'WebGUI::Asset::Wobject::SyndicatedContent',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000065'
|
||||
},
|
||||
rssUrl=>{
|
||||
defaultValue=>undef,
|
||||
fieldType=>"url"
|
||||
|
|
@ -77,6 +81,10 @@ sub getUiLevel {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"SyndicatedContent"
|
||||
);
|
||||
$tabform->getTab("properties")->url(
|
||||
-name=>"rssUrl",
|
||||
-label=>WebGUI::International::get(1,"SyndicatedContent"),
|
||||
|
|
|
|||
|
|
@ -66,6 +66,10 @@ sub definition {
|
|||
tableName=>'USS',
|
||||
className=>'WebGUI::Asset::Wobject::USS',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000066'
|
||||
},
|
||||
submissionsPerPage=>{
|
||||
fieldType=>"integer",
|
||||
defaultValue=>50
|
||||
|
|
@ -160,6 +164,10 @@ sub duplicate {
|
|||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->getEditForm;
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue('templateId'),
|
||||
-namespace=>"USS"
|
||||
);
|
||||
$tabform->getTab("display")->template(
|
||||
-name=>"submissionTemplateId",
|
||||
-value=>$self->getValue("submissionTemplateId"),
|
||||
|
|
@ -460,7 +468,7 @@ sub view {
|
|||
}
|
||||
$var{submissions_loop} = \@submission;
|
||||
$p->appendTemplateVars(\%var);
|
||||
return $_[0]->processTemplate(\%var,"USS",$_[0]->get("templateId"));
|
||||
return $_[0]->processTemplate(\%var,$_[0]->get("templateId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ sub definition {
|
|||
tableName=>'USS_submission',
|
||||
className=>'WebGUI::Asset::Wobject::USS_submission',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000067'
|
||||
},
|
||||
submissionsPerPage=>{
|
||||
fieldType=>"integer",
|
||||
defaultValue=>50
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ sub definition {
|
|||
tableName=>'WSClient',
|
||||
className=>'WebGUI::Asset::Wobject::WSClient',
|
||||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000069'
|
||||
},
|
||||
callMethod => {
|
||||
fieldType => 'textarea',
|
||||
defaultValue=>undef
|
||||
|
|
@ -138,7 +142,7 @@ sub getEditForm {
|
|||
$tabform->getTab("display")->template(
|
||||
-name => 'templateId',
|
||||
-value => $self->getValue('templateId'),
|
||||
-namespace => "WSClient",
|
||||
-namespace => "WSClient"
|
||||
);
|
||||
$tabform->getTab("display")->yesNo (
|
||||
-name => 'preprocessMacros',
|
||||
|
|
@ -275,7 +279,7 @@ sub view {
|
|||
|
||||
WebGUI::ErrorHandler::warn("disabling soap call $call");
|
||||
$var{'disableWobject'} = 1;
|
||||
return $self->processTemplate(\%var,"WSClient",$self->get("templateId"));
|
||||
return $self->processTemplate(\%var,$self->get("templateId"));
|
||||
}
|
||||
|
||||
# advanced use, if you want to pass SOAP results to a single, particular
|
||||
|
|
@ -484,7 +488,7 @@ sub view {
|
|||
}
|
||||
|
||||
$var{'results'} = \@result;
|
||||
return $self->processTemplate(\%var, "WSClient",$self->get("templateId"));
|
||||
return $self->processTemplate(\%var, $self->get("templateId"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ use WebGUI::Macro;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::TabForm;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Operation::Shared;
|
||||
|
|
@ -174,7 +174,7 @@ sub authMethod {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 createAccount ( method [,vars,template] )
|
||||
=head2 createAccount ( method [,vars] )
|
||||
|
||||
Superclass method that performs general functionality for creating new accounts.
|
||||
|
||||
|
|
@ -186,17 +186,12 @@ Auth method that the form for creating users should call
|
|||
|
||||
Array ref of template vars from subclass
|
||||
|
||||
=head3 template
|
||||
|
||||
Template that this class should use for display purposes
|
||||
|
||||
=cut
|
||||
|
||||
sub createAccount {
|
||||
my $self = shift;
|
||||
my $method = $_[0];
|
||||
my $vars = $_[1];
|
||||
my $template = $_[2] || 'Auth/'.$self->authMethod.'/Create';
|
||||
$vars->{title} = WebGUI::International::get(54);
|
||||
|
||||
$vars->{'create.form.header'} = WebGUI::Form::formHeader({});
|
||||
|
|
@ -212,7 +207,7 @@ sub createAccount {
|
|||
$vars->{'login.url'} = WebGUI::URL::page('op=auth&method=init');
|
||||
$vars->{'login.label'} = WebGUI::International::get(58);
|
||||
|
||||
return WebGUI::Template::process(1,$template, $vars);
|
||||
return WebGUI::Asset::Template->new($self->getCreateAccountTemplateId)->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -294,7 +289,7 @@ sub deactivateAccount {
|
|||
$var{'yes.label'} = WebGUI::International::get(44);
|
||||
$var{'no.url'} = WebGUI::URL::page();
|
||||
$var{'no.label'} = WebGUI::International::get(45);
|
||||
return WebGUI::Template::process(1,"prompt", \%var);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000057")->process(\%var);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -329,7 +324,7 @@ sub deleteParams {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 displayAccount ( method [,vars,template] )
|
||||
=head2 displayAccount ( method [,vars] )
|
||||
|
||||
Superclass method that performs general functionality for viewing editable fields related to a user's account.
|
||||
|
||||
|
|
@ -341,17 +336,12 @@ Auth method that the form for updating a user's account should call
|
|||
|
||||
Array ref of template vars from subclass
|
||||
|
||||
=head3 template
|
||||
|
||||
Template that this class should use for display purposes
|
||||
|
||||
=cut
|
||||
|
||||
sub displayAccount {
|
||||
my $self = shift;
|
||||
my $method = $_[0];
|
||||
my $vars = $_[1];
|
||||
my $template = $_[2] || 'Auth/'.$self->authMethod.'/Account';
|
||||
|
||||
$vars->{title} = WebGUI::International::get(61);
|
||||
|
||||
|
|
@ -366,12 +356,12 @@ sub displayAccount {
|
|||
$vars->{'account.form.footer'} = WebGUI::Form::formFooter();
|
||||
|
||||
$vars->{'account.options'} = WebGUI::Operation::Shared::accountOptions();
|
||||
return WebGUI::Template::process(1,$template, $vars);
|
||||
return WebGUI::Asset::Template->new($self->getAccountTemplateId)->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 displayLogin ( [method,vars,template] )
|
||||
=head2 displayLogin ( [method,vars] )
|
||||
|
||||
Superclass method that performs general functionality for creating new accounts.
|
||||
|
||||
|
|
@ -383,17 +373,12 @@ Auth method that the form for performing the login routine should call
|
|||
|
||||
Array ref of template vars from subclass
|
||||
|
||||
=head3 template
|
||||
|
||||
Template that this class should use for display purposes
|
||||
|
||||
=cut
|
||||
|
||||
sub displayLogin {
|
||||
my $self = shift;
|
||||
my $method = $_[0] || "login";
|
||||
my $vars = $_[1];
|
||||
my $template = $_[2] || 'Auth/'.$self->authMethod.'/Login';
|
||||
unless ($session{env}{REQUEST_URI} =~ "displayLogin" || $session{env}{REQUEST_URI} =~ "displayAccount" ||
|
||||
$session{env}{REQUEST_URI} =~ "logout" || $session{env}{REQUEST_URI} =~ "deactivateAccount"){
|
||||
WebGUI::Session::setScratch("redirectAfterLogin",$session{env}{REQUEST_URI});
|
||||
|
|
@ -416,7 +401,7 @@ sub displayLogin {
|
|||
$vars->{'anonymousRegistration.isAllowed'} = ($session{setting}{anonymousRegistration});
|
||||
$vars->{'createAccount.url'} = WebGUI::URL::page('op=createAccount');
|
||||
$vars->{'createAccount.label'} = WebGUI::International::get(67);
|
||||
return WebGUI::Template::process(1,$template, $vars);
|
||||
return WebGUI::Asset::Template->new($self->getLoginTemplateId)->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -460,6 +445,42 @@ sub error {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getAccountTemplateId ()
|
||||
|
||||
This method should be overridden by the subclass and should return the template ID for the display/edit account screen.
|
||||
|
||||
=cut
|
||||
|
||||
sub getAccountTemplateId {
|
||||
return "PBtmpl0000000000000010";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getAccountTemplateId ()
|
||||
|
||||
This method should be overridden by the subclass and should return the template ID for the create account screen.
|
||||
|
||||
=cut
|
||||
|
||||
sub getCreateAccountTemplateId {
|
||||
return "PBtmpl0000000000000011";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getAccountTemplateId ()
|
||||
|
||||
This method should be overridden by the subclass and should return the template ID for the login screen.
|
||||
|
||||
=cut
|
||||
|
||||
sub getLoginTemplateId {
|
||||
return "PBtmpl0000000000000013";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getParams ()
|
||||
|
||||
Returns a hash reference with the user's authentication information. This method uses data stored in the instance of the object.
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use WebGUI::Mail;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Operation::Shared;
|
||||
use WebGUI::Asset::Template;
|
||||
use URI;
|
||||
use Net::LDAP;
|
||||
|
||||
|
|
@ -260,7 +261,7 @@ sub displayAccount {
|
|||
$vars->{'account.form.karma.label'} = WebGUI::International::get(537);
|
||||
}
|
||||
$vars->{'account.options'} = WebGUI::Operation::Shared::accountOptions();
|
||||
return WebGUI::Template::process(1,'Auth/LDAP/Account', $vars);
|
||||
return WebGUI::Asset::Template->new($self->getAccountTemplateId)->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -327,6 +328,21 @@ sub editUserSettingsForm {
|
|||
return $f->printRowsOnly;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getAccountTemplateId {
|
||||
return "PBtmpl0000000000000004";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getCreateAccountTemplateId {
|
||||
return "PBtmpl0000000000000005";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getLoginTemplateId {
|
||||
return "PBtmpl0000000000000006";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub login {
|
||||
my $self = shift;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ package WebGUI::Auth::SMB;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Auth;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Form;
|
||||
|
|
@ -169,7 +170,7 @@ sub displayAccount {
|
|||
$vars->{'account.form.karma.label'} = WebGUI::International::get(537);
|
||||
}
|
||||
$vars->{'account.options'} = WebGUI::Operation::Shared::accountOptions();
|
||||
return WebGUI::Template::process(1,'Auth/SMB/Account', $vars);
|
||||
return WebGUI::Asset::Template->new($self->getAccountTemplateId)->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -234,6 +235,21 @@ sub editUserSettingsForm {
|
|||
return $f->printRowsOnly;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getAccountTemplateId {
|
||||
return "PBtmpl0000000000000007";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getCreateAccountTemplateId {
|
||||
return "PBtmpl0000000000000008";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getLoginTemplateId {
|
||||
return "PBtmpl0000000000000009";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub login {
|
||||
my $self = shift;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Auth::WebGUI;
|
|||
|
||||
use Digest::MD5;
|
||||
use strict;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Auth;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::HTMLForm;
|
||||
|
|
@ -348,6 +349,32 @@ sub editUserSettingsForm {
|
|||
return $f->printRowsOnly;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getAccountTemplateId {
|
||||
return "PBtmpl0000000000000010";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getCreateAccountTemplateId {
|
||||
return "PBtmpl0000000000000011";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getExpiredPasswordTemplateId {
|
||||
return "PBtmpl0000000000000012";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getLoginTemplateId {
|
||||
return "PBtmpl0000000000000013";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getPasswordRecoveryTemplateId {
|
||||
return "PBtmpl0000000000000014";
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub login {
|
||||
my $self = shift;
|
||||
|
|
@ -402,7 +429,7 @@ sub recoverPassword {
|
|||
$vars->{'recover.message'} = $_[0] if ($_[0]);
|
||||
$vars->{'recover.form.email'} = WebGUI::Form::text({"name"=>"email"});
|
||||
$vars->{'recover.form.email.label'} = WebGUI::International::get(56);
|
||||
return WebGUI::Template::process(1,$template, $vars);
|
||||
return WebGUI::Asset::Template->new($self->getPasswordRecoveryTemplateId)->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -460,7 +487,7 @@ sub resetExpiredPassword {
|
|||
$vars->{'expired.form.submit'} = WebGUI::Form::submit({});
|
||||
$vars->{'expired.form.footer'} = WebGUI::Form::formFooter();
|
||||
|
||||
return WebGUI::Template::process(1,'AuthWebGUI/Expired', $vars);
|
||||
return WebGUI::Asset::Template->new($self->getExpiredPasswordTemplateId)->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use WebGUI::International;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Style;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
|
||||
|
|
@ -1084,7 +1084,7 @@ sub HTMLArea {
|
|||
if ($session{user}{richEditor} eq 'none') {
|
||||
return $var{textarea};
|
||||
} else {
|
||||
return WebGUI::Template::process($session{user}{richEditor},'richEditor',\%var);
|
||||
return WebGUI::Asset::Template->new($session{user}{richEditor})->process(\%var);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1517,7 +1517,7 @@ sub template {
|
|||
my $name = $params->{name} || "templateId";
|
||||
return selectList({
|
||||
name=>$name,
|
||||
options=>WebGUI::Template::getList($params->{namespace}),
|
||||
options=>WebGUI::Asset::Template->getList($params->{namespace}),
|
||||
value=>[$templateId],
|
||||
extras=>$params->{extras}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ use strict qw(refs vars);
|
|||
use Tie::CPHash;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
|
|
@ -26,7 +28,7 @@ use WebGUI::Utility;
|
|||
sub process {
|
||||
return "" unless ($session{var}{adminOn});
|
||||
my @param = WebGUI::Macro::getParams($_[0]);
|
||||
my $templateId = $param[0] || 1;
|
||||
my $templateId = $param[0] || "PBtmpl0000000000000090";
|
||||
my %var;
|
||||
my (%cphash, %hash2, %hash, $r, @item, $query);
|
||||
tie %hash, "Tie::IxHash";
|
||||
|
|
@ -97,7 +99,7 @@ sub process {
|
|||
$i++;
|
||||
}
|
||||
$var{'admin_loop'} = \@admin;
|
||||
return WebGUI::Template::process($templateId,"Macro/AdminBar",\%var);
|
||||
return WebGUI::Asset::Template->new($templateId)->process(\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use WebGUI::Grouping;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -32,7 +32,11 @@ sub process {
|
|||
$var{'toggle.url'} = WebGUI::URL::page('op=switchOnAdmin');
|
||||
$var{'toggle.text'} = $turnOn;
|
||||
}
|
||||
return WebGUI::Template::process(WebGUI::Template::getIdByName($templateName,"Macro/AdminToggle")||1,"Macro/AdminToggle",\%var);
|
||||
if (defined $templateName) {
|
||||
return WebGUI::Asset::Template->newByUrl($templateName)->process(\%var);
|
||||
} else {
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000036")->process(\%var);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use WebGUI::Grouping;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -32,7 +32,7 @@ sub process {
|
|||
$var{'toggle.url'} = WebGUI::URL::page('op=switchOnAdmin');
|
||||
$var{'toggle.text'} = $turnOn;
|
||||
}
|
||||
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/EditableToggle"),"Macro/EditableToggle",\%var);
|
||||
return WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use WebGUI::Group;
|
|||
use WebGUI::Grouping;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -31,7 +31,7 @@ sub process {
|
|||
my %var = ();
|
||||
$var{'group.url'} = WebGUI::URL::page("op=autoAddToGroup&groupId=".$g->groupId);
|
||||
$var{'group.text'} = $param[1];
|
||||
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/GroupAdd"), "Macro/GroupAdd", \%var);
|
||||
return WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use WebGUI::Group;
|
|||
use WebGUI::Grouping;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -31,7 +31,7 @@ sub process {
|
|||
my %var = ();
|
||||
$var{'group.url'} = WebGUI::URL::page("op=autoDeleteFromGroup&groupId=".$g->groupId);
|
||||
$var{'group.text'} = $param[1];
|
||||
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/GroupDelete"),"Macro/GroupDelete", \%var);
|
||||
return WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ package WebGUI::Macro::H_homeLink;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -34,7 +35,11 @@ sub process {
|
|||
} else {
|
||||
$var{'homeLink.text'} = WebGUI::International::get(47);
|
||||
}
|
||||
$temp = WebGUI::Template::process(WebGUI::Template::getIdByName($param[1],"Macro/H_homeLink"), "Macro/H_homeLink", \%var);
|
||||
if (defined $param[1]) {
|
||||
$temp = WebGUI::Asset::Template->newByUrl($param[1])->process(\%var);
|
||||
} else {
|
||||
$temp = WebGUI::Asset::Template->new("PBtmpl0000000000000042")->process(\%var);
|
||||
}
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use WebGUI::Form;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -26,7 +26,7 @@ sub _createURL {
|
|||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my @param = WebGUI::Macro::getParams($_[0]);
|
||||
my $templateId = $param[2] || 1;
|
||||
my $templateId = $param[2] || "PBtmpl0000000000000092";
|
||||
my %var;
|
||||
$var{'user.isVisitor'} = ($session{user}{userId} eq "1");
|
||||
$var{'customText'} = $param[1];
|
||||
|
|
@ -69,7 +69,7 @@ sub process {
|
|||
$var{'account.create.url'} = WebGUI::URL::page('op=createAccount');
|
||||
$var{'account.create.label'} = WebGUI::International::get(407);
|
||||
$var{'form.footer'} = WebGUI::Form::formFooter();
|
||||
return WebGUI::Template::process($templateId,"Macro/L_loginBox",\%var);
|
||||
return WebGUI::Asset::Template->new($templateId)->process(\%var);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use strict;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -32,7 +32,11 @@ sub process {
|
|||
$var{'toggle.url'} = WebGUI::URL::page('op=logout');
|
||||
$var{'toggle.text'} = $logout;
|
||||
}
|
||||
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[3],"Macro/LoginToggle")||1, "Macro/LoginToggle", \%var);
|
||||
if ($param[3]) {
|
||||
return WebGUI::Asset::Template->newByUrl($param[3])->process(\%var);
|
||||
} else {
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000043")->process(\%var);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package WebGUI::Macro::SubscriptionItem;
|
||||
|
||||
use strict;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
|
|
@ -8,11 +9,9 @@ use WebGUI::URL;
|
|||
sub process {
|
||||
my ($subscriptionId, $templateId, %var);
|
||||
($subscriptionId, $templateId) = WebGUI::Macro::getParams(@_);
|
||||
|
||||
%var = WebGUI::SQL->quickHash('select * from subscription where subscriptionId='.quote($subscriptionId));
|
||||
|
||||
$var{url} = WebGUI::URL::page('op=purchaseSubscription&sid='.$subscriptionId);
|
||||
return WebGUI::Template::process($templateId || 1, 'Macro/SubscriptionItem', \%var);
|
||||
return WebGUI::Asset::Template->new($templateId || "PBtmpl0000000000000046")->process(\%var);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use strict;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -24,7 +24,7 @@ sub process {
|
|||
return WebGUI::URL::page("op=displayAccount") if ($param[0] eq "linkonly");
|
||||
$var{'account.url'} = WebGUI::URL::page('op=displayAccount');
|
||||
$var{'account.text'} = $param[0] || WebGUI::International::get(46);
|
||||
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[1],"Macro/a_account"),"Macro/a_account",\%var);
|
||||
return WebGUI::Asset::Template->newByUrl($param[1])->process(\%var);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use strict;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
|
||||
|
|
@ -28,10 +28,7 @@ sub process {
|
|||
}
|
||||
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},$append);
|
||||
if ($param[1] ne "") {
|
||||
($styleId) = WebGUI::Template::getIdByName($param[1],"style");
|
||||
if ($styleId != 0) {
|
||||
$temp = WebGUI::URL::append($temp,'styleId='.$styleId);
|
||||
}
|
||||
$temp = WebGUI::URL::append($temp,'styleId='.$param[1]);
|
||||
}
|
||||
if ($param[0] ne "linkonly") {
|
||||
my %var;
|
||||
|
|
@ -41,7 +38,11 @@ sub process {
|
|||
} else {
|
||||
$var{'printable.text'} = WebGUI::International::get(53);
|
||||
}
|
||||
$temp = WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/r_printable"), "Macro/r_printable", \%var);
|
||||
if ($param[2]) {
|
||||
$temp = WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
|
||||
} else {
|
||||
$temp = WebGUI::Asset::Template->new("PBtmpl0000000000000109")->process(\%var);
|
||||
}
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,12 +158,6 @@ sub getOperations {
|
|||
'makePrintable' => 'WebGUI::Operation::Style',
|
||||
'setPersonalStyle' => 'WebGUI::Operation::Style',
|
||||
'unsetPersonalStyle' => 'WebGUI::Operation::Style',
|
||||
'copyTemplate' => 'WebGUI::Operation::Template',
|
||||
'deleteTemplate' => 'WebGUI::Operation::Template',
|
||||
'deleteTemplateConfirm' => 'WebGUI::Operation::Template',
|
||||
'editTemplate' => 'WebGUI::Operation::Template',
|
||||
'editTemplateSave' => 'WebGUI::Operation::Template',
|
||||
'listTemplates' => 'WebGUI::Operation::Template',
|
||||
'viewTheme' => 'WebGUI::Operation::Theme',
|
||||
'deleteThemeComponent' => 'WebGUI::Operation::Theme',
|
||||
'deleteThemeComponentConfirm' => 'WebGUI::Operation::Theme',
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use WebGUI::Commerce;
|
|||
use WebGUI::Operation;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::HTTP;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Form;
|
||||
|
|
@ -55,7 +55,7 @@ sub www_cancelTransaction {
|
|||
|
||||
$var{message} = WebGUI::International::get('checkout canceled message', 'Commerce');
|
||||
|
||||
return WebGUI::Template::process($session{setting}{commerceCheckoutCanceledTemplateId}, 'Commerce/CheckoutCanceled', \%var);
|
||||
return WebGUI::Asset::Template->new($session{setting}{commerceCheckoutCanceledTemplateId})->process(\%var);
|
||||
}
|
||||
|
||||
# This operation is here for easier future extensions to the commerce system.
|
||||
|
|
@ -103,7 +103,7 @@ sub www_checkoutConfirm {
|
|||
$var{form} = $f->print;
|
||||
$var{title} = $i18n->get('checkout confirm title');
|
||||
|
||||
return WebGUI::Template::process($session{setting}{commerceConfirmCheckoutTemplateId}, 'Commerce/ConfirmCheckout', \%var);
|
||||
return WebGUI::Asset::Template->new($session{setting}{commerceConfirmCheckoutTemplateId})->process(\%var);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -212,7 +212,7 @@ sub www_checkoutSubmit {
|
|||
return WebGUI::Operation::execute('viewPurchaseHistory') unless ($checkoutError);
|
||||
|
||||
# If an error has occurred show the template errorlog
|
||||
return WebGUI::Template::process($session{setting}{commerceTransactionErrorTemplateId}, 'Commerce/TransactionError', \%param);
|
||||
return WebGUI::Asset::Template->new($session{setting}{commerceTransactionErrorTemplateId})->process(\%param);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -417,7 +417,7 @@ sub www_selectPaymentGateway {
|
|||
$var{formSubmit} = WebGUI::Form::submit({value=>$i18n->get('payment gateway select')});
|
||||
$var{formFooter} = WebGUI::Form::formFooter;
|
||||
|
||||
return WebGUI::Template::process($session{setting}{commerceSelectPaymentGatewayTemplateId}, 'Commerce/SelectPaymentGateway', \%var);
|
||||
return WebGUI::Asset::Template->new($session{setting}{commerceSelectPaymentGatewayTemplateId})->process(\%var);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use WebGUI::Paginator;
|
|||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::User;
|
||||
use WebGUI::Utility;
|
||||
|
|
@ -64,7 +64,7 @@ sub www_viewMessageLog {
|
|||
$vars->{'message.multiplePages'} = ($p->getNumberOfPages > 1);
|
||||
$vars->{'message.accountOptions'} = WebGUI::Operation::Shared::accountOptions();
|
||||
|
||||
return WebGUI::Template::process(1,'Operation/MessageLog/View', $vars);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000050")->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -91,7 +91,7 @@ sub www_viewMessageLogMessage {
|
|||
|
||||
$vars->{'message.text'} = $data->{message};
|
||||
$vars->{'message.accountOptions'} = WebGUI::Operation::Shared::accountOptions();
|
||||
return WebGUI::Template::process(1,'Operation/MessageLog/Message', $vars);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000049")->process($vars);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Operation::Profile;
|
|||
|
||||
use strict qw(vars subs);
|
||||
use URI;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Operation::Auth;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::ErrorHandler;
|
||||
|
|
@ -192,7 +193,7 @@ sub www_editProfile {
|
|||
$vars->{'profile.form.elements'} = \@array;
|
||||
$vars->{'profile.form.submit'} = WebGUI::Form::submit({});
|
||||
$vars->{'profile.accountOptions'} = WebGUI::Operation::Shared::accountOptions();
|
||||
return WebGUI::Template::process(1,'Operation/Profile/Edit', $vars);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000051")->process($vars);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -255,7 +256,7 @@ sub www_viewProfile {
|
|||
if ($session{user}{userId} eq $session{form}{uid}) {
|
||||
$vars->{'profile.accountOptions'} = WebGUI::Operation::Shared::accountOptions();
|
||||
}
|
||||
return WebGUI::Template::process(1,'Operation/Profile/View', $vars);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000052")->process($vars);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use WebGUI::FormProcessor;
|
|||
use WebGUI::Subscription;
|
||||
use WebGUI::Commerce::ShoppingCart;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ sub www_redeemSubscriptionCode {
|
|||
$f->submit;
|
||||
$var{codeForm} = $f->print;
|
||||
|
||||
return WebGUI::Template::process(1, 'Operation/RedeemSubscription', \%var);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000053")->process(\%var);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -1,192 +0,0 @@
|
|||
package WebGUI::Operation::Template;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2004 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::HTML;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Icon;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _submenu {
|
||||
my $workarea = shift;
|
||||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new("templates");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editTemplate&tid=new&namespace='.$session{form}{namespace}), WebGUI::International::get(505));
|
||||
if ($session{form}{op} eq "editTemplate" && ($session{form}{tid} ne "new" || $session{form}{op} ne "deleteTemplateConfirm")) {
|
||||
$ac->addSubmenuItem(
|
||||
WebGUI::URL::page('op=editTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace}),
|
||||
WebGUI::International::get(851)
|
||||
);
|
||||
$ac->addSubmenuItem(
|
||||
WebGUI::URL::page('op=copyTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace}),
|
||||
WebGUI::International::get(852)
|
||||
);
|
||||
$ac->addSubmenuItem(
|
||||
WebGUI::URL::page('op=deleteTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace}),
|
||||
WebGUI::International::get(853)
|
||||
);
|
||||
$ac->addSubmenuItem(
|
||||
WebGUI::URL::page('op=listTemplates&namespace='.$session{form}{namespace}),
|
||||
WebGUI::International::get(854)
|
||||
);
|
||||
}
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=listTemplates'), WebGUI::International::get(855));
|
||||
return $ac->render($workarea, $title);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_copyTemplate {
|
||||
if (WebGUI::Grouping::isInGroup(8)) {
|
||||
my $template = WebGUI::Template::get($session{form}{tid},$session{form}{namespace});
|
||||
$template->{name} .= " (copy)";
|
||||
$template->{templateId} = "new";
|
||||
WebGUI::Template::set($template);
|
||||
return www_listTemplates();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteTemplateConfirm {
|
||||
my ($a, $pageId);
|
||||
if ($session{form}{tid} =~ /^\d+$/ && $session{form}{tid} < 1000 && $session{form}{tid} > 0) {
|
||||
return _submenu(WebGUI::Privilege::vitalComponent());
|
||||
} elsif (WebGUI::Grouping::isInGroup(8)) {
|
||||
if ($session{form}{namespace} eq "Page") {
|
||||
$a = WebGUI::SQL->read("select * from page where templateId=".quote($session{form}{tid}));
|
||||
while (($pageId) = $a->array) {
|
||||
WebGUI::SQL->write("update wobject set templatePosition=1 where pageId=".quote($pageId));
|
||||
}
|
||||
$a->finish;
|
||||
WebGUI::SQL->write("update page set templateId=2 where templateId=".quote($session{form}{tid}));
|
||||
}
|
||||
WebGUI::SQL->write("delete from template where templateId=".quote($session{form}{tid})
|
||||
." and namespace=".quote($session{form}{namespace}));
|
||||
return www_listTemplates();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editTemplate {
|
||||
my ($namespaces, %template, $f);
|
||||
tie %template, 'Tie::CPHash';
|
||||
if (WebGUI::Grouping::isInGroup(8)) {
|
||||
if ($session{form}{tid} eq "new" || $session{form}{tid} eq "") {
|
||||
if ($session{form}{namespace} eq "Page") {
|
||||
$template{template} = "<table>\n <tr>\n <td>\n\n<tmpl_var page.position1>\n\n".
|
||||
"</td>\n </tr>\n</table>\n";
|
||||
} else {
|
||||
$template{template} = "<h1><tmpl_var title></h1>\n\n";
|
||||
}
|
||||
} else {
|
||||
%template = WebGUI::SQL->quickHash("select * from template where templateId=".quote($session{form}{tid})." and
|
||||
namespace=".quote($session{form}{namespace}));
|
||||
}
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("op","editTemplateSave");
|
||||
$f->readOnly($session{form}{tid},WebGUI::International::get(503));
|
||||
$f->raw('<input type="hidden" name="op2" value="'.$session{form}{afterEdit}.'" />');
|
||||
if ($session{form}{tid} eq "new") {
|
||||
$namespaces = WebGUI::SQL->buildHashRef("select distinct(namespace),namespace
|
||||
from template order by namespace");
|
||||
$f->selectList("namespace",$namespaces,WebGUI::International::get(721),[$session{form}{namespace}]);
|
||||
} else {
|
||||
$f->hidden("namespace",$session{form}{namespace});
|
||||
}
|
||||
$f->hidden("tid",$session{form}{tid});
|
||||
$f->text("name",WebGUI::International::get(528),$template{name});
|
||||
$f->codearea(
|
||||
-name=>"template",
|
||||
-label=>WebGUI::International::get(504),
|
||||
-value=>$template{template},
|
||||
-rows=>(5+$session{setting}{textAreaRows})
|
||||
);
|
||||
$f->submit;
|
||||
return _submenu($f->print,'507',"template add/edit");
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editTemplateSave {
|
||||
if (WebGUI::Grouping::isInGroup(8)) {
|
||||
if ($session{form}{template} eq "" && $session{form}{namespace} eq "Page") {
|
||||
$session{form}{template} = "<table>\n<tr>\n<td>\n\n<tmpl_var page.position1>\n\n</td>\n </tr>\n</table>\n";
|
||||
}
|
||||
$session{form}{tid} = WebGUI::Template::set({
|
||||
templateId=>$session{form}{tid},
|
||||
namespace=>$session{form}{namespace},
|
||||
name=>$session{form}{name},
|
||||
template=>$session{form}{template}
|
||||
});
|
||||
if ($session{form}{op2} eq "") {
|
||||
return www_listTemplates();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_listTemplates {
|
||||
my ($output, $sth, @data, @row, $i, $p, $where);
|
||||
if (WebGUI::Grouping::isInGroup(8)) {
|
||||
$where = "and namespace=".quote($session{form}{namespace}) if ($session{form}{namespace});
|
||||
$sth = WebGUI::SQL->read("select templateId,name,namespace from template where isEditable=1 $where order by namespace,name");
|
||||
while (@data = $sth->array) {
|
||||
$row[$i] = '<tr><td valign="top" class="tableData">'
|
||||
.deleteIcon('op=deleteTemplateConfirm&tid='.$data[0].'&namespace='.$data[2],'',WebGUI::International::get(502))
|
||||
.editIcon('op=editTemplate&tid='.$data[0].'&namespace='.$data[2])
|
||||
.copyIcon('op=copyTemplate&tid='.$data[0].'&namespace='.$data[2])
|
||||
.'</td>';
|
||||
$row[$i] .= '<td valign="top" class="tableData">'.$data[1].'</td>';
|
||||
$row[$i] .= '<td valign="top" class="tableData">'.$data[2].'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=listTemplates&namespace='.$session{form}{namespace}));
|
||||
$p->setDataByArrayRef(\@row);
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
return _submenu($output,'506',"templates manage");
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
|
@ -3,7 +3,7 @@ package WebGUI::Operation::TransactionLog;
|
|||
use strict;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Commerce::Transaction;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Operation;
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ sub www_viewPurchaseHistory {
|
|||
|
||||
$var{purchaseHistoryLoop} = \@historyLoop;
|
||||
|
||||
return WebGUI::Template::process(1, 'Commerce/ViewPurchaseHistory', \%var);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000019")->process(\%var);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use Tie::CPHash;
|
|||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Template;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
=head1 NAME
|
||||
|
|
@ -88,23 +88,6 @@ sub generateAdditionalHeadTags {
|
|||
return $tags;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getTemplate ( [ templateId ] )
|
||||
|
||||
Retrieves the template for this style.
|
||||
|
||||
=head3 templateId
|
||||
|
||||
The unique identifier for the template to retrieve. Defaults to the style template tied to the current page.
|
||||
|
||||
=cut
|
||||
|
||||
sub getTemplate {
|
||||
my $templateId = shift || $session{page}{styleId};
|
||||
return WebGUI::Template::get($templateId,"style");
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
@ -155,7 +138,7 @@ sub process {
|
|||
}
|
||||
$var{'head.tags'} .= generateAdditionalHeadTags();
|
||||
$var{'head.tags'} .= "\n<!-- macro head tags -->\n";
|
||||
my $output = WebGUI::Template::process($templateId,"style",\%var);
|
||||
my $output = WebGUI::Asset::Template->new($templateId)->process(\%var);
|
||||
$output = WebGUI::Macro::process($output);
|
||||
my $macroHeadTags = generateAdditionalHeadTags();
|
||||
$macroHeadTags = WebGUI::Macro::process($macroHeadTags);
|
||||
|
|
|
|||
|
|
@ -1,130 +0,0 @@
|
|||
package WebGUI::i18n::English::CommercePaymentPayFlowPro;
|
||||
|
||||
our $I18N = {
|
||||
'name' => {
|
||||
message => q|Name|,
|
||||
lastUpdated => 1101772168,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'address' => {
|
||||
message => q|Address|,
|
||||
lastUpdated => 1101772170,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'city' => {
|
||||
message => q|City|,
|
||||
lastUpdated => 1101772171,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'state' => {
|
||||
message => q|State|,
|
||||
lastUpdated => 1101772173,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'zipcode' => {
|
||||
message => q|Zipcode|,
|
||||
lastUpdated => 1101772174,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'email' => {
|
||||
message => q|Email|,
|
||||
lastUpdated => 1101772176,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'cardNumber' => {
|
||||
message => q|Credit card number|,
|
||||
lastUpdated => 1101772177,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'expiration date' => {
|
||||
message => q|Expiration date|,
|
||||
lastUpdated => 1101772180,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
'cvv2' => {
|
||||
message => q|Verification number (ie. CVV2)|,
|
||||
lastUpdated => 1101772182,
|
||||
context => q|Form label in the checkout form of the PayFlowPro module.|
|
||||
},
|
||||
|
||||
'vendor' => {
|
||||
message => q|Vendor|,
|
||||
lastUpdated => 0,
|
||||
context => q|Form label in the configuration form of the PayFlowPro module.|
|
||||
},
|
||||
'partner' => {
|
||||
message => q|Partner|,
|
||||
lastUpdated => 0,
|
||||
context => q|Form label in the configuration form of the PayFlowPro module.|
|
||||
},
|
||||
'username' => {
|
||||
message => q|Username|,
|
||||
lastUpdated => 0,
|
||||
context => q|Form label in the configuration form of the PayFlowPro module.|
|
||||
},
|
||||
'password' => {
|
||||
message => q|Password|,
|
||||
lastUpdated => 0,
|
||||
context => q|Form label in the configuration form of the PayFlowPro module.|
|
||||
},
|
||||
'test mode' => {
|
||||
message => q|Use test mode|,
|
||||
lastUpdated => 0,
|
||||
context => q|Form label in the configuration form of the PayFlowPro module.|
|
||||
},
|
||||
'test mode warning' => {
|
||||
message => q|Be sure to set this to 'No' when going live!|,
|
||||
lastUpdated => 0,
|
||||
context => q|Form label in the configuration form of the PayFlowPro module.|
|
||||
},
|
||||
'module name' => {
|
||||
message => q|Verisign Payflow Pro|,
|
||||
lastUpdated => 0,
|
||||
context => q|The displayed name of the Payflo Pro payment module.|
|
||||
},
|
||||
|
||||
'invalid name' => {
|
||||
message => q|You have to enter a valid name.|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid name has been entered.|
|
||||
},
|
||||
'invalid address' => {
|
||||
message => q|You have to enter a valid address.|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid street has been entered.|
|
||||
},
|
||||
'invalid city' => {
|
||||
message => q|You have to enter a valid city.|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid city has been entered.|
|
||||
},
|
||||
'invalid zip' => {
|
||||
message => q|You have to enter a valid zipcode.|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid zipcode has been entered.|
|
||||
},
|
||||
'invalid email' => {
|
||||
message => q|You have to enter a valid email address.|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid email address has been entered.|
|
||||
},
|
||||
'invalid card number' => {
|
||||
message => q|You have to enter a valid credit card number.|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid credit card number has been entered.|
|
||||
},
|
||||
'invalid cvv2' => {
|
||||
message => q|You have to enter a valid card security code (ie. cvv2).|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid card security code has been entered.|
|
||||
},
|
||||
'invalid expiration date' => {
|
||||
message => q|You have to enter a valid expiration date.|,
|
||||
lastUpdated => 0,
|
||||
context => q|An error indicating that an invalid expiration date has been entered.|
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -1511,11 +1511,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
|
|||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'851' => {
|
||||
message => q|Edit this template.|,
|
||||
lastUpdated => 1039926394
|
||||
},
|
||||
|
||||
'927' => {
|
||||
message => q|Import Theme|,
|
||||
lastUpdated => 1050265139
|
||||
|
|
@ -1897,11 +1892,6 @@ The user id of the currently logged in user.
|
|||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'853' => {
|
||||
message => q|Delete this template.|,
|
||||
lastUpdated => 1039926459
|
||||
},
|
||||
|
||||
'138' => {
|
||||
message => q|Yes|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
@ -2638,11 +2628,6 @@ The Groups page displays all groups that you are allowed to edit. The form on t
|
|||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'854' => {
|
||||
message => q|List all templates like this one.|,
|
||||
lastUpdated => 1039926488
|
||||
},
|
||||
|
||||
'969' => {
|
||||
message => q|If you choose to empty your clipboard, any items contained in it will be moved to the trash.
|
||||
|,
|
||||
|
|
@ -3671,11 +3656,6 @@ Large sites using external group data will be making many calls to the external
|
|||
lastUpdated => 1052850265
|
||||
},
|
||||
|
||||
'502' => {
|
||||
message => q|Are you certain you wish to delete this template and set all pages using this template to the default template?|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'307' => {
|
||||
message => q|Use default meta tags?|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
@ -3857,11 +3837,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
|
|||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'855' => {
|
||||
message => q|List all templates.|,
|
||||
lastUpdated => 1039926498
|
||||
},
|
||||
|
||||
'1029' => {
|
||||
message => q|Edited at|,
|
||||
lastUpdated => 1047842180
|
||||
|
|
@ -4565,11 +4540,6 @@ A list of links to the 10 nearest in the paginator relative to the current page.
|
|||
lastUpdated => 1036892946
|
||||
},
|
||||
|
||||
'503' => {
|
||||
message => q|Template ID|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'68' => {
|
||||
message => q|The account information you supplied is invalid. Either the account does not exist or the username/password combination was incorrect.|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
@ -5475,11 +5445,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
|
|||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'852' => {
|
||||
message => q|Copy this template.|,
|
||||
lastUpdated => 1039926448
|
||||
},
|
||||
|
||||
'63' => {
|
||||
message => q|Turn admin on.|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
@ -5544,10 +5509,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
|
|||
message => q|Manage trash.|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'505' => {
|
||||
message => q|Add a new template.|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'929' => {
|
||||
message => q|Import!|,
|
||||
|
|
@ -6048,11 +6009,6 @@ A randomly generated number. This is often used on images (such as banner ads) t
|
|||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'528' => {
|
||||
message => q|Template Name|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'164' => {
|
||||
message => q|Authentication Method|,
|
||||
lastUpdated => 1031514049
|
||||
|
|
@ -6206,12 +6162,6 @@ config file.</p>
|
|||
context => q|Title of the package manager for the admin console.|
|
||||
},
|
||||
|
||||
'templates' => {
|
||||
message => q|Templates|,
|
||||
lastUpdated =>1092930637,
|
||||
context => q|Title of the templates manager for the admin console.|
|
||||
},
|
||||
|
||||
'themes' => {
|
||||
message => q|Themes|,
|
||||
lastUpdated =>1092930637,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue