diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 2341cf9b4..5af668222 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,10 +1,17 @@ 6.3.0 - Migrated all wobjects to assets. - Migrated pages to the layout and redirect assets. + - Converted the navigation system to navigation assets. + - Converted the template system to template assets. - Converted site maps to navigation assets. - Converted file managers to layout assets with file and image assets attached. - - Added AssetProxy macro. + - Added AssetProxy macro, which replaces the Navigation, I, Snippet, and File + macros. + - Added the RandomAssetProxy macro, which replaces the RandomImage and + RandomSnippet macros. + - Renamed the i macro to FileUrl. + - Renamed the \ macro to PageUrl. - Converted page templates to use CSS-based layouts instead of tables. - Added a "Position" property to the DataForm Edit Field interface. This makes it easier to move a field to a certain position. (Len Kranendonk). - Added the variables "record.edit.icon", "record.delete.url" and "record.delete.icon" to the DataForm DataList template. (Len Kranendonk). diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 9b6cacf71..484759c7e 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -62,6 +62,9 @@ save you many hours of grief. PerlAccessHandler WebGUI::UploadsAccessHandler + * If you have any custom code, please check out docs/migration.txt as + there have been many changes to the API in this release. + 6.2.8 -------------------------------------------------------------------- diff --git a/docs/migration.txt b/docs/migration.txt index 722178cc7..8ff1d16d4 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -98,6 +98,10 @@ The following tips should also help make your migration easer: 1.2.14 The parameters for the wobject processTemplate() method have changed. + 1.2.15 If you were using the template system directly rather than + using the wobject processTemplate() method, please note that it has + been replaced by the WebGUI::Asset::Template asset. + 2. Macro Migration ------------------- @@ -126,7 +130,7 @@ write custom navigation macros. 3.1 Authentication Modules Changes -Authentication in WebGUI is now completely Object Oriented. The superclass WebGUI::Auth defines a loose set of rules by which +Authentication in 6.0 is now completely Object Oriented. The superclass WebGUI::Auth defines a loose set of rules by which to create authentication parameters. Subclasses MUST be WebGUI::Auth objects, however they can define thier own rules for authentication. No methods are required to be overwritten as it is up to the user to decide which methods may be called through WebGUI. The only method that MUST be calllable is the init routine which should define the starting point for authentication. @@ -143,6 +147,15 @@ www_recoverPassword There is no guarentee, however that any custom apps which call these routines will work for custom authentication instances. +3.2 Auth Templates + +As of 6.3 you must add three new methods to your authentication modules. They are +getAccountTemplateId(), getCreateAccountTemplateId(), and +getLoginTemplateId(). If you are not using the superclass methods associated +with these, then you can skip this. Also the template parameters for the +associated methods has been removed in favor of these methods. And finally, +take a look a WebGUI::Asset::Template for changes in the template system API. + 4. Scheduler Migration ----------------------- @@ -298,10 +311,16 @@ anyway. 5.15 Node/Attachment System Replaced -The file system storage mechanism of lib/WebGUI/Node.pm and +In 6.3 the file system storage mechanism of lib/WebGUI/Node.pm and lib/WebGUI/Attachment.pm have been replaced in favor of lib/WebGUI/Storage.pm. If you had anything using the old system we highly recommend migrating it into the new system as it is much more flexible. Alternatively you can copy the old system back into place (it should still work, but no guarantees). +5.16 Template System Replaced + +In 6.3 the template system has been replaced in favor of the new template +asset. Please see WebGUI::Asset::Template for details. + + diff --git a/docs/upgrades/upgrade_6.2.9-6.3.0.pl b/docs/upgrades/upgrade_6.2.9-6.3.0.pl index 991f447ac..ee4f65606 100644 --- a/docs/upgrades/upgrade_6.2.9-6.3.0.pl +++ b/docs/upgrades/upgrade_6.2.9-6.3.0.pl @@ -65,10 +65,6 @@ while (my $t = $sth->hashRef) { $sth->finish; -# this is here because we don't want to actually migrate stuff yet @@ -88,16 +84,19 @@ WebGUI::SQL->write("alter table DataForm_field add column assetId varchar(22)"); WebGUI::SQL->write("alter table DataForm_tab add column assetId varchar(22)"); # next 2 lines are for sitemap to nav migration WebGUI::SQL->write("alter table Navigation rename tempoldnav"); -WebGUI::SQL->write("create table Navigation (assetId varchar(22) not null primary key, assetsToInclude text, startType varchar(35), startPoint varchar(255), endPoint varchar(35), showSystemPages int not null default 0, showHiddenPages int not null default 0, showUnprivilegedPages int not null default 0)"); -my @wobjects = qw(Article Poll Survey USS WSClient DataForm FileManager EventsCalendar HttpProxy IndexedSearch MessageBoard Product SQLReport SyndicatedContent WobjectProxy); -foreach my $namespace (@wobjects) { +WebGUI::SQL->write("create table Navigation (assetId varchar(22) not null primary key, assetsToInclude text, startType varchar(35), startPoint varchar(255), endPoint varchar(35), showSystemPages int not null default 0, showHiddenPages int not null default 0, showUnprivilegedPages int not null default 0, templateId varchar(22) not null)"); +my @wobjects = qw(SiteMap Article Poll Survey USS WSClient DataForm FileManager EventsCalendar HttpProxy IndexedSearch MessageBoard Product SQLReport SyndicatedContent WobjectProxy); +my @otherWobjects = WebGUI::SQL->buildArray("select distinct(namespace) from wobject where namespace not in (".quoteAndJoin(\@wobjects).")"); +my @allWobjects = (@wobjects,@otherWobjects); +foreach my $namespace (@allWobjects) { WebGUI::SQL->write("alter table ".$namespace." add column assetId varchar(22) not null"); + WebGUI::SQL->write("alter table ".$namespace." add column templateId varchar(22) not null"); + my $sth = WebGUI::SQL->read("select wobjectId, templateId from wobject where namespace=".quote($namespace)); + while (my ($wid, $tid) = $sth->array) { + WebGUI::SQL->write("update ".$namespace." set templateId=".quote($tid)." where wobjectId=".quote($wid)); + } + $sth->finish; } -my $sth = WebGUI::SQL->read("select distinct(namespace) from wobject where namespace not in (".quoteAndJoin(\@wobjects).")"); -while (my ($namespace) = $sth->array) { - WebGUI::SQL->write("alter table ".$namespace." add column assetId varchar(22) not null"); -} -$sth->finish; walkTree('0','PBasset000000000000001','000001','1'); print "\t\tMaking second round of table structure changes\n" unless ($quiet); my $sth = WebGUI::SQL->read("select distinct(namespace) from wobject where namespace is not null"); @@ -115,6 +114,7 @@ while (my ($namespace) = $sth->array) { $sth->finish; WebGUI::SQL->write("alter table wobject drop column wobjectId"); WebGUI::SQL->write("alter table wobject add primary key (assetId)"); +WebGUI::SQL->write("alter table wobject drop column templateId"); WebGUI::SQL->write("alter table wobject drop column namespace"); WebGUI::SQL->write("alter table wobject drop column pageId"); WebGUI::SQL->write("alter table wobject drop column sequenceNumber"); @@ -153,8 +153,13 @@ WebGUI::SQL->write("alter table DataForm_entryData drop column wobjectId"); WebGUI::SQL->write("alter table DataForm_field drop column wobjectId"); WebGUI::SQL->write("alter table DataForm_tab drop column wobjectId"); + + my %migration; + + + print "\tConverting navigation system to asset tree\n" unless ($quiet); my ($navRootLineage) = WebGUI::SQL->quickArray("select lineage from asset where length(lineage)=12 order by lineage desc limit 1"); $navRootLineage = sprintf("%012d",($navRootLineage+1)); @@ -175,13 +180,13 @@ my $navRootId = WebGUI::SQL->setRow("asset","assetId",{ }); WebGUI::SQL->setRow("wobject","assetId",{ assetId=>$navRootId, - templateId=>"1", styleTemplateId=>"1", printableStyleTemplateId=>"3" },undef,$navRootId); WebGUI::SQL->setRow("Navigation","assetId",{ assetId=>$navRootId, startType=>"relativeToCurrentUrl", + templateId=>"1", startPoint=>"0", endPoint=>"55", assetsToInclude=>"descendants", @@ -206,7 +211,7 @@ while (my $data = $sth->hashRef) { $newAsset{lastUpdated} = time(); $newAsset{parentId} = $navRootId; $newAsset{lineage} = $navRootLineage.sprintf("%06d",$navRankCounter); - $newWobject{templateId} = $data->{templateId}; + $newNav{templateId} = $data->{templateId}; $newWobject{styleTemplateId}="1"; $newWobject{printableStyleTemplateId}="3"; $newWobject{displayTitle} = "0"; @@ -336,13 +341,13 @@ my $collateralRootId = WebGUI::SQL->setRow("asset","assetId",{ }); WebGUI::SQL->setRow("wobject","assetId",{ assetId=>$collateralRootId, - templateId=>"1", styleTemplateId=>"1", printableStyleTemplateId=>"3" },undef,$collateralRootId); WebGUI::SQL->setRow("Navigation","assetId",{ assetId=>$collateralRootId, startType=>"relativeToCurrentUrl", + templateId=>"1", startPoint=>"0", endPoint=>"55", assetsToInclude=>"descendants", @@ -371,12 +376,12 @@ while (my $data = $sth->hashRef) { }); WebGUI::SQL->setRow("wobject","assetId",{ assetId=>quote($folderId), - templateId=>'15', styleTemplateId=>"1", printableStyleTemplateId=>"3", description=>$data->{description} },undef,$folderId); - WebGUI::SQL->setRow("layout","assetId",{ + WebGUI::SQL->setRow("Layout","assetId",{ + templateId=>'15', assetId=>$folderId },undef,$folderId); $folderCache{$data->{collateralFolderId}} = { @@ -436,11 +441,126 @@ WebGUI::SQL->write("drop table collateral"); + + +print "\tConverting template system to asset tree\n" unless ($quiet); +WebGUI::SQL->write("update template set namespace='Layout' where namespace='page'"); +WebGUI::SQL->write("alter table template add column assetId varchar(22) not null"); +my ($tempRootLineage) = WebGUI::SQL->quickArray("select lineage from asset where length(lineage)=12 order by lineage desc limit 1"); +$tempRootLineage = sprintf("%012d",($tempRootLineage+1)); +my $tempRootId = WebGUI::SQL->setRow("asset","assetId",{ + assetId=>"new", + isHidden=>1, + title=>"Templates", + menuTitle=>"Templates", + url=>fixUrl('doesntexistyet',"Templates"), + ownerUserId=>"3", + groupIdView=>"4", + groupIdEdit=>"4", + parentId=>"PBasset000000000000001", + lineage=>$tempRootLineage, + lastUpdated=>time(), + className=>"WebGUI::Asset::Wobject::Navigation", + state=>"published" + }); +WebGUI::SQL->setRow("wobject","assetId",{ + assetId=>$tempRootId, + styleTemplateId=>"1", + printableStyleTemplateId=>"3" + },undef,$tempRootId); +WebGUI::SQL->setRow("Navigation","assetId",{ + assetId=>$tempRootId, + templateId=>"1", + startType=>"relativeToCurrentUrl", + startPoint=>"0", + endPoint=>"55", + assetsToInclude=>"descendants", + showHiddenPages=>1 + },undef,$tempRootId); +my $tempRankCounter = 1; +my %templateCache; +my $sth = WebGUI::SQL->read("select * from template"); +while (my $data = $sth->hashRef) { + print "\t\tConverting ".$data->{name}."\n" unless ($quiet); + my ($templateId ,%newAsset); + $templateId = $newAsset{assetId} = getNewId("tmpl",$data->{templateId},$data->{namespace}); + $newAsset{url} = fixUrl($newAsset{assetId},$data->{name}); + $newAsset{isHidden} = 1; + $newAsset{title} = $newAsset{menuTitle} = $data->{name}; + $newAsset{ownerUserId} = "3"; + $newAsset{groupIdView} = "7"; + $newAsset{groupIdEdit} = "4"; + $newAsset{className} = 'WebGUI::Asset::Template'; + $newAsset{state} = 'published'; + $newAsset{lastUpdated} = time(); + $newAsset{parentId} = $tempRootId; + $newAsset{lineage} = $tempRootLineage.sprintf("%06d",$tempRankCounter); + WebGUI::SQL->setRow("asset","assetId",\%newAsset,undef,$templateId); + WebGUI::SQL->write("update template set assetId=".quote($templateId)." where templateId=".quote($data->{templateId})." + and namespace=".quote($data->{namespace})); + $templateCache{$data->{namespace}}{$data->{templateId}} = $templateId; + $tempRankCounter++; +} +$sth->finish; +WebGUI::SQL->write("alter table template drop primary key"); +WebGUI::SQL->write("alter table template drop column templateId"); +WebGUI::SQL->write("alter table template drop column name"); +WebGUI::SQL->write("alter table template add primary key (assetId)"); +my @wobjectTypes = qw(Article Poll Survey USS WSClient DataForm Layout EventsCalendar Navigation HttpProxy IndexedSearch MessageBoard Product SQLReport SyndicatedContent WobjectProxy); +my @allWobjectTypes = (@wobjectTypes,@otherWobjects); +print "\t\tMigrating wobject templates to new IDs\n" unless ($quiet); +foreach my $type (@allWobjectTypes) { + print "\t\t\t$type\n" unless ($quiet); + my $sth = WebGUI::SQL->read("select assetId, templateId from $type"); + while (my ($assetId, $templateId) = $sth->array) { + WebGUI::SQL->setRow($type,"assetId",{ + assetId=>$assetId, + templateId=>$templateCache{$type}{$templateId} + }); + } + $sth->finish; +} +print "\t\tMigrating wobject style templates to new IDs\n" unless ($quiet); +my $sth = WebGUI::SQL->read("select assetId, styleTemplateId, printableStyleTemplateId from wobject"); +while (my ($assetId, $styleId, $printId) = $sth->array) { + WebGUI::SQL->setRow("wobject","assetId",{ + assetId=>$assetId, + styleTemplateId=>$templateCache{style}{$styleId}, + printableStyleTemplateId=>$templateCache{style}{$printId} + }); +} +$sth->finish; +print "\t\tMigrating DataForm templates to new IDs\n" unless ($quiet); +my $sth = WebGUI::SQL->read("select assetId,emailTemplateId,acknowlegementTemplateId,listTemplateId from DataForm"); +while (my ($assetId, $emailId, $ackId, $listId) = $sth->array) { + WebGUI::SQL->setRow("DataForm","assetId",{ + assetId=>$assetId, + emailTemplateId=>$templateCache{DataForm}{$emailId}, + acknowlegementTemplateId=>$templateCache{DataForm}{$ackId}, + listTemplateId=>$templateCache{"DataForm/List"}{$listId} + }); +} +$sth->finish; +print "\t\tMigrating USS templates to new IDs\n" unless ($quiet); +my $sth = WebGUI::SQL->read("select assetId, submissionTemplateId, submissionFormTemplateId from USS"); +while (my ($assetId, $subId, $formId) = $sth->array) { + WebGUI::SQL->setRow("USS","assetId",{ + assetId=>$assetId, + submissionTemplateId=>$templateCache{"USS/Submission"}{$subId}, + submissionFormTemplateId=>$templateCache{"USS/SubmissionForm"}{$formId} + }); +} +$sth->finish; + + + + + + print "\tReplacing some old macros with new ones\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select templateId, namespace, template from template"); -while (my ($id, $namespace, $template) = $sth->array) { - WebGUI::SQL->write("update template set template=".quote(replaceMacros($template))." where - templateId=".quote($id)." and namespace=".quote($namespace)); +my $sth = WebGUI::SQL->read("select assetId, template from template"); +while (my ($id, $template) = $sth->array) { + WebGUI::SQL->write("update template set template=".quote(replaceMacros($template))." where assetId=".quote($id)); } $sth->finish; my $sth = WebGUI::SQL->read("select assetId, description from wobject"); @@ -459,9 +579,12 @@ $sth->finish; + print "\tDeleting files which are no longer used.\n" unless ($quiet); #unlink("../../lib/WebGUI/Page.pm"); #unlink("../../lib/WebGUI/Operation/Page.pm"); +#unlink("../../lib/WebGUI/Template.pm"); +#unlink("../../lib/WebGUI/Operation/Template.pm"); #unlink("../../lib/WebGUI/Operation/Root.pm"); #unlink("../../lib/WebGUI/Navigation.pm"); #unlink("../../lib/WebGUI/Operation/Navigation.pm"); @@ -533,6 +656,7 @@ $conf->set("assets"=>[ 'WebGUI::Asset::Wobject::HttpProxy', 'WebGUI::Asset::Wobject::SQLReport', 'WebGUI::Asset::Redirect', + 'WebGUI::Asset::Template', 'WebGUI::Asset::FilePile', 'WebGUI::Asset::File', 'WebGUI::Asset::File::Image', @@ -599,6 +723,14 @@ $nestedMacro = qr /(\^ # Start with carat } elsif (isIn($searchString, qw(RandomSnippet RandomImage))) { my $url = (exists $macroCache{$parsed[0]}) ? $folderCache{$parsed[0]} : $parsed[0]; $result = '^RandomAssetProxy("'.$url.'");'; + } elsif (isIn($searchString, qw(AdminBar))) { + my $newId =$templateCache{"Macro/AdminBar"}{$parsed[0]}; + my $id = (defined $newId) ? $newId : $parsed[0]; + $result = '^AdminBarXXX("'.$id.'");'; + } elsif (isIn($searchString, qw(L))) { + my $newId =$templateCache{"Macro/L_loginBox"}{$parsed[2]}; + my $id = (defined $newId) ? $newId : $parsed[2]; + $result = '^LoginBoxXXX("'.$parsed[0].'","'.$parsed[1].'","'.$id.'");'; } elsif (isIn($searchString, qw(i))) { my $url = (exists $macroCache{$parsed[0]}) ? $macroCache{$parsed[0]} : $parsed[0]; $result = '^FileUrl("'.$url.'");'; @@ -609,6 +741,9 @@ $nestedMacro = qr /(\^ # Start with carat } $content =~ s/\Q$macro/$result/ges; } + # a nasty hack to stop an infinite loop + $content =~ s/AdminBarXXX/AdminBar/xg; + $content =~ s/LoginBoxXXX/L/xg; return $content; } @@ -646,12 +781,12 @@ sub walkTree { if ($page->{redirectURL} ne "") { WebGUI::SQL->write("insert into redirect (assetId, redirectUrl) values (".quote($pageId).",".quote($page->{redirectURL}).")"); } else { - WebGUI::SQL->write("insert into wobject (assetId, styleTemplateId, templateId, printableStyleTemplateId, + WebGUI::SQL->write("insert into wobject (assetId, styleTemplateId, printableStyleTemplateId, cacheTimeout, cacheTimeoutVisitor, displayTitle, namespace) values ( - ".quote($pageId).", ".quote($page->{styleId}).", ".quote($page->{templateId}).", + ".quote($pageId).", ".quote($page->{styleId}).", ".quote($page->{printableStyleId}).", ".quote($page->{cacheTimeout}).",".quote($page->{cacheTimeoutVisitor}).", 0,'Layout')"); - WebGUI::SQL->write("insert into layout (assetId) values (".quote($pageId).")"); + WebGUI::SQL->write("insert into Layout (assetId,templateId) values (".quote($pageId).", ".quote($page->{templateId}).")"); } my $rank = 1; print "\t\tFinding wobjects on page ".$page->{pageId}."\n" unless ($quiet); @@ -728,15 +863,16 @@ sub walkTree { endPoint=>$namespace->{depth}, startPoint=>$starturl, startType=>"specificUrl", + templateId=>"1", assetsToInclude=>"descendants" },undef,$wobjectId); WebGUI::SQL->write("update asset set className='WebGUI::Asset::Wobject::Navigation' where assetId=".quote($wobjectId)); - WebGUI::SQL->write("update wobject set namespace='Navigation', templateId='1' where assetId=".quote($wobjectId)); + WebGUI::SQL->write("update wobject set namespace='Navigation' where assetId=".quote($wobjectId)); } elsif ($wobject->{namespace} eq "FileManager") { print "\t\t\tConverting File Manager ".$wobject->{wobjectId}." into File Folder Layout\n" unless ($quiet); WebGUI::SQL->write("update asset set className='WebGUI::Asset::Layout' where assetId=".quote($wobjectId)); - WebGUI::SQL->write("insert into layout (assetId) values (".quote($wobjectId).")"); - WebGUI::SQL->write("update wobject set templateId='15', namespace='Layout' where wobjectId=".quote($wobjectId)); + WebGUI::SQL->write("insert into Layout (assetId,templateId) values (".quote($wobjectId).", '15')"); + WebGUI::SQL->write("update wobject set namespace='Layout' where wobjectId=".quote($wobjectId)); print "\t\t\tMigrating attachments for File Manager ".$wobject->{wobjectId}."\n" unless ($quiet); my $sth = WebGUI::SQL->read("select * from FileManager_file where wobjectId=".quote($wobjectId)." order by sequenceNumber"); my $rank = 1; @@ -809,7 +945,7 @@ sub walkTree { } $b->finish; my $contentPositions = join("\.",@positions); - WebGUI::SQL->write("update layout set contentPositions=".quote($contentPositions)." where assetId=".quote($pageId)); + WebGUI::SQL->write("update Layout set contentPositions=".quote($contentPositions)." where assetId=".quote($pageId)); } walkTree($page->{pageId},$pageId,$pageLineage,$rank); $myRank++; @@ -971,9 +1107,7 @@ sub getNewId { '6' => 'PBtmpl0000000000000132', 'adminConsole' => 'PBtmpl0000000000000137', '3' => 'PBtmpl0000000000000111', - '1001' => 'PBtmpl0000000000000076', '1' => 'PBtmpl0000000000000060', - '1000' => 'PBtmpl0000000000000072', '10' => 'PBtmpl0000000000000070' }, 'Macro/SubscriptionItem' => { @@ -1006,7 +1140,7 @@ sub getNewId { 'Auth/WebGUI/Create' => { '1' => 'PBtmpl0000000000000011' }, - 'page' => { + 'Layout' => { '6' => 'PBtmpl0000000000000131', '3' => 'PBtmpl0000000000000109', '7' => 'PBtmpl0000000000000135', @@ -1113,8 +1247,7 @@ sub getNewId { '1' => 'PBtmpl0000000000000051' }, 'SyndicatedContent' => { - '1' => 'PBtmpl0000000000000065', - '1000' => 'PBtmpl0000000000000073' + '1' => 'PBtmpl0000000000000065' }, 'USS/SubmissionForm' => { '4' => 'PBtmpl0000000000000122', diff --git a/docs/upgrades/upgrade_6.2.9-6.3.0.sql b/docs/upgrades/upgrade_6.2.9-6.3.0.sql index ed488c4be..e3be5a5bd 100644 --- a/docs/upgrades/upgrade_6.2.9-6.3.0.sql +++ b/docs/upgrades/upgrade_6.2.9-6.3.0.sql @@ -89,8 +89,9 @@ create table snippet ( snippet mediumtext ); -create table layout ( +create table Layout ( assetId varchar(22) not null primary key, + templateId varchar(22) not null, contentPositions text ); diff --git a/lib/WebGUI/AdminConsole.pm b/lib/WebGUI/AdminConsole.pm index 5ac9fa1d1..c047b5f33 100644 --- a/lib/WebGUI/AdminConsole.pm +++ b/lib/WebGUI/AdminConsole.pm @@ -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"); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index 0dfb373fb..f7d5da080 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -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); } diff --git a/lib/WebGUI/Asset/File/Image.pm b/lib/WebGUI/Asset/File/Image.pm index 669d0a90b..f6f56ea95 100644 --- a/lib/WebGUI/Asset/File/Image.pm +++ b/lib/WebGUI/Asset/File/Image.pm @@ -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); } diff --git a/lib/WebGUI/Asset/FilePile.pm b/lib/WebGUI/Asset/FilePile.pm index 06720bc65..b85f51705 100644 --- a/lib/WebGUI/Asset/FilePile.pm +++ b/lib/WebGUI/Asset/FilePile.pm @@ -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); diff --git a/lib/WebGUI/Template.pm b/lib/WebGUI/Asset/Template.pm similarity index 56% rename from lib/WebGUI/Template.pm rename to lib/WebGUI/Asset/Template.pm index c94f892f8..79639bfbe 100644 --- a/lib/WebGUI/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -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(''); + 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; diff --git a/lib/WebGUI/Asset/Wobject.pm b/lib/WebGUI/Asset/Wobject.pm index 62c50b8fa..11e888019 100644 --- a/lib/WebGUI/Asset/Wobject.pm +++ b/lib/WebGUI/Asset/Wobject.pm @@ -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); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index cf7fdfad6..99765441e 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -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); } } diff --git a/lib/WebGUI/Asset/Wobject/DataForm.pm b/lib/WebGUI/Asset/Wobject/DataForm.pm index 5514bf26b..6b963c0e2 100644 --- a/lib/WebGUI/Asset/Wobject/DataForm.pm +++ b/lib/WebGUI/Asset/Wobject/DataForm.pm @@ -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") { diff --git a/lib/WebGUI/Asset/Wobject/HttpProxy.pm b/lib/WebGUI/Asset/Wobject/HttpProxy.pm index 47e0de37e..7c4ddddc4 100644 --- a/lib/WebGUI/Asset/Wobject/HttpProxy.pm +++ b/lib/WebGUI/Asset/Wobject/HttpProxy.pm @@ -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")); } } diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 5d785ada7..b7e490565 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -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")); } diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index 5c5a94c70..97dc6f3b2 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -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")); } diff --git a/lib/WebGUI/Asset/Wobject/Poll.pm b/lib/WebGUI/Asset/Wobject/Poll.pm index c3e989091..ea37b4be2 100644 --- a/lib/WebGUI/Asset/Wobject/Poll.pm +++ b/lib/WebGUI/Asset/Wobject/Poll.pm @@ -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")); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm index fb1ed919c..3b0d01a56 100644 --- a/lib/WebGUI/Asset/Wobject/SQLReport.pm +++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm @@ -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 '
'.Dumper($var).'
'; - return $self->processTemplate($self->get("templateId"),$var); + return $self->processTemplate($var, $self->get("templateId")); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index 01d7a836e..5364d6f38 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -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"), diff --git a/lib/WebGUI/Asset/Wobject/USS.pm b/lib/WebGUI/Asset/Wobject/USS.pm index e07254b32..9d3b5f328 100644 --- a/lib/WebGUI/Asset/Wobject/USS.pm +++ b/lib/WebGUI/Asset/Wobject/USS.pm @@ -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")); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/USS_submission.pm b/lib/WebGUI/Asset/Wobject/USS_submission.pm index f85ce269a..7417c31d5 100644 --- a/lib/WebGUI/Asset/Wobject/USS_submission.pm +++ b/lib/WebGUI/Asset/Wobject/USS_submission.pm @@ -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 diff --git a/lib/WebGUI/Asset/Wobject/WSClient.pm b/lib/WebGUI/Asset/Wobject/WSClient.pm index 63da56d91..62bde10a4 100644 --- a/lib/WebGUI/Asset/Wobject/WSClient.pm +++ b/lib/WebGUI/Asset/Wobject/WSClient.pm @@ -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")); } diff --git a/lib/WebGUI/Auth.pm b/lib/WebGUI/Auth.pm index 4811a81ae..788087783 100644 --- a/lib/WebGUI/Auth.pm +++ b/lib/WebGUI/Auth.pm @@ -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. diff --git a/lib/WebGUI/Auth/LDAP.pm b/lib/WebGUI/Auth/LDAP.pm index 75c68ecff..0d04e530b 100644 --- a/lib/WebGUI/Auth/LDAP.pm +++ b/lib/WebGUI/Auth/LDAP.pm @@ -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; diff --git a/lib/WebGUI/Auth/SMB.pm b/lib/WebGUI/Auth/SMB.pm index d95738f47..e6a55ecc8 100644 --- a/lib/WebGUI/Auth/SMB.pm +++ b/lib/WebGUI/Auth/SMB.pm @@ -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; diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index a017d6157..8ebc59b1d 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -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); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index 5f2297dbb..0e6774e3b 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -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} }); diff --git a/lib/WebGUI/Macro/AdminBar.pm b/lib/WebGUI/Macro/AdminBar.pm index 384f2d4ee..9ccef4639 100644 --- a/lib/WebGUI/Macro/AdminBar.pm +++ b/lib/WebGUI/Macro/AdminBar.pm @@ -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); } diff --git a/lib/WebGUI/Macro/AdminToggle.pm b/lib/WebGUI/Macro/AdminToggle.pm index 30e868aa5..d50d6591a 100644 --- a/lib/WebGUI/Macro/AdminToggle.pm +++ b/lib/WebGUI/Macro/AdminToggle.pm @@ -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 ""; } diff --git a/lib/WebGUI/Macro/EditableToggle.pm b/lib/WebGUI/Macro/EditableToggle.pm index 0aebc28cd..0e21130cb 100644 --- a/lib/WebGUI/Macro/EditableToggle.pm +++ b/lib/WebGUI/Macro/EditableToggle.pm @@ -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 ""; } diff --git a/lib/WebGUI/Macro/GroupAdd.pm b/lib/WebGUI/Macro/GroupAdd.pm index e71b79d4f..2b628d65d 100644 --- a/lib/WebGUI/Macro/GroupAdd.pm +++ b/lib/WebGUI/Macro/GroupAdd.pm @@ -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); } diff --git a/lib/WebGUI/Macro/GroupDelete.pm b/lib/WebGUI/Macro/GroupDelete.pm index f7e830a3e..f5757772e 100644 --- a/lib/WebGUI/Macro/GroupDelete.pm +++ b/lib/WebGUI/Macro/GroupDelete.pm @@ -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); } diff --git a/lib/WebGUI/Macro/H_homeLink.pm b/lib/WebGUI/Macro/H_homeLink.pm index 6925f2d47..8c94be5c7 100644 --- a/lib/WebGUI/Macro/H_homeLink.pm +++ b/lib/WebGUI/Macro/H_homeLink.pm @@ -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; } diff --git a/lib/WebGUI/Macro/L_loginBox.pm b/lib/WebGUI/Macro/L_loginBox.pm index 9fdb4c69b..1d8d92da2 100644 --- a/lib/WebGUI/Macro/L_loginBox.pm +++ b/lib/WebGUI/Macro/L_loginBox.pm @@ -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; diff --git a/lib/WebGUI/Macro/LoginToggle.pm b/lib/WebGUI/Macro/LoginToggle.pm index c47be4c8b..10238e513 100644 --- a/lib/WebGUI/Macro/LoginToggle.pm +++ b/lib/WebGUI/Macro/LoginToggle.pm @@ -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); + } } diff --git a/lib/WebGUI/Macro/SubscriptionItem.pm b/lib/WebGUI/Macro/SubscriptionItem.pm index 3efa80387..aa2a443a6 100644 --- a/lib/WebGUI/Macro/SubscriptionItem.pm +++ b/lib/WebGUI/Macro/SubscriptionItem.pm @@ -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; diff --git a/lib/WebGUI/Macro/a_account.pm b/lib/WebGUI/Macro/a_account.pm index d4a8908d7..ff15e9d07 100644 --- a/lib/WebGUI/Macro/a_account.pm +++ b/lib/WebGUI/Macro/a_account.pm @@ -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); } diff --git a/lib/WebGUI/Macro/r_printable.pm b/lib/WebGUI/Macro/r_printable.pm index 02cedfb1d..1790caa05 100644 --- a/lib/WebGUI/Macro/r_printable.pm +++ b/lib/WebGUI/Macro/r_printable.pm @@ -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; } diff --git a/lib/WebGUI/Operation.pm b/lib/WebGUI/Operation.pm index 5c7952d59..cee3e3339 100644 --- a/lib/WebGUI/Operation.pm +++ b/lib/WebGUI/Operation.pm @@ -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', diff --git a/lib/WebGUI/Operation/Commerce.pm b/lib/WebGUI/Operation/Commerce.pm index 709e96eb3..63cec3356 100644 --- a/lib/WebGUI/Operation/Commerce.pm +++ b/lib/WebGUI/Operation/Commerce.pm @@ -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); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Operation/MessageLog.pm b/lib/WebGUI/Operation/MessageLog.pm index 28c356a94..87af435eb 100644 --- a/lib/WebGUI/Operation/MessageLog.pm +++ b/lib/WebGUI/Operation/MessageLog.pm @@ -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; diff --git a/lib/WebGUI/Operation/Profile.pm b/lib/WebGUI/Operation/Profile.pm index 8764960bb..285c6a17b 100644 --- a/lib/WebGUI/Operation/Profile.pm +++ b/lib/WebGUI/Operation/Profile.pm @@ -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; diff --git a/lib/WebGUI/Operation/Subscription.pm b/lib/WebGUI/Operation/Subscription.pm index 3c41967e5..9f0060fdc 100644 --- a/lib/WebGUI/Operation/Subscription.pm +++ b/lib/WebGUI/Operation/Subscription.pm @@ -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; diff --git a/lib/WebGUI/Operation/Template.pm b/lib/WebGUI/Operation/Template.pm deleted file mode 100644 index f74f0a21b..000000000 --- a/lib/WebGUI/Operation/Template.pm +++ /dev/null @@ -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} = "\n \n \n \n
\n\n\n\n". - "
\n"; - } else { - $template{template} = "

\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(''); - 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} = "\n\n\n \n
\n\n\n\n
\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] = '' - .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]) - .''; - $row[$i] .= ''.$data[1].''; - $row[$i] .= ''.$data[2].''; - $i++; - } - $sth->finish; - $p = WebGUI::Paginator->new(WebGUI::URL::page('op=listTemplates&namespace='.$session{form}{namespace})); - $p->setDataByArrayRef(\@row); - $output .= ''; - $output .= $p->getPage($session{form}{pn}); - $output .= '
'; - $output .= $p->getBarTraditional($session{form}{pn}); - return _submenu($output,'506',"templates manage"); - } else { - return WebGUI::Privilege::insufficient(); - } -} - - -1; diff --git a/lib/WebGUI/Operation/TransactionLog.pm b/lib/WebGUI/Operation/TransactionLog.pm index be88204a1..b28542854 100644 --- a/lib/WebGUI/Operation/TransactionLog.pm +++ b/lib/WebGUI/Operation/TransactionLog.pm @@ -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); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Style.pm b/lib/WebGUI/Style.pm index 38aa4cef4..202b2b5dc 100644 --- a/lib/WebGUI/Style.pm +++ b/lib/WebGUI/Style.pm @@ -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\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); diff --git a/lib/WebGUI/i18n/English/CommercePaymentPayFlowPro.pm b/lib/WebGUI/i18n/English/CommercePaymentPayFlowPro.pm deleted file mode 100755 index 15c43f3d6..000000000 --- a/lib/WebGUI/i18n/English/CommercePaymentPayFlowPro.pm +++ /dev/null @@ -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; - diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index e480925f6..a2f8a4828 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -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.

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, diff --git a/www/extras/adminConsole/small/templates.gif b/www/extras/assets/small/template.gif similarity index 100% rename from www/extras/adminConsole/small/templates.gif rename to www/extras/assets/small/template.gif diff --git a/www/extras/adminConsole/templates.gif b/www/extras/assets/template.gif similarity index 100% rename from www/extras/adminConsole/templates.gif rename to www/extras/assets/template.gif