Revert "Rename template variables in the Account and Admin Toggle templates to not use underscores."
This reverts commit 0b4e8d5460.
This commit is contained in:
parent
9ddc54be42
commit
1b9edbf545
8 changed files with 9 additions and 85 deletions
|
|
@ -25,14 +25,6 @@ save you many hours of grief.
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
* WebGUI now depends on PerlIO::eol, for doing line ending translation.
|
* WebGUI now depends on PerlIO::eol, for doing line ending translation.
|
||||||
|
|
||||||
* As part of the migration to Template::Toolkit, we will be changing template
|
|
||||||
variables from using dots to underscores. All templates using that namespace were
|
|
||||||
automatically upgraded to use the new variables.
|
|
||||||
|
|
||||||
In this version, these templates were updated:
|
|
||||||
Account Macro template
|
|
||||||
Admin Toggle Macro template
|
|
||||||
|
|
||||||
7.10.0
|
7.10.0
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
* Due to a bug in the 7.8.24-7.9.11 upgrade, the ordering of template
|
* Due to a bug in the 7.8.24-7.9.11 upgrade, the ordering of template
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,6 @@ templates, you will need to apply these changes manually to your copies.
|
||||||
|
|
||||||
7.10.1
|
7.10.1
|
||||||
|
|
||||||
* Account Macro template variables renamed:
|
|
||||||
account.url => account_url
|
|
||||||
account.text => account_text
|
|
||||||
|
|
||||||
* AdminToggle Macro template variables renamed:
|
|
||||||
toggle.url => toggle_url
|
|
||||||
toggle.text => toggle_text
|
|
||||||
|
|
||||||
* Asset Report Template - asset-report/asset-report-default-template
|
* Asset Report Template - asset-report/asset-report-default-template
|
||||||
Remove the empty template attachment
|
Remove the empty template attachment
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ sub repackTemplates {
|
||||||
template => $asset->get('template'),
|
template => $asset->get('template'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
print "\t... DONE!\n" unless $quiet;
|
print "DONE!\n" unless $quiet;
|
||||||
|
|
||||||
print "\tRepacking head tags in all assets, this may take a while..." unless $quiet;
|
print "\tRepacking head tags in all assets, this may take a while..." unless $quiet;
|
||||||
$sth = $session->db->read( "SELECT assetId, revisionDate FROM assetData where usePackedHeadTags=1" );
|
$sth = $session->db->read( "SELECT assetId, revisionDate FROM assetData where usePackedHeadTags=1" );
|
||||||
|
|
@ -118,7 +118,7 @@ sub repackTemplates {
|
||||||
extraHeadTags => $asset->get('extraHeadTags'),
|
extraHeadTags => $asset->get('extraHeadTags'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
print "\t... DONE!\n" unless $quiet;
|
print "DONE!\n" unless $quiet;
|
||||||
|
|
||||||
print "\tRepacking all snippets, this may take a while..." unless $quiet;
|
print "\tRepacking all snippets, this may take a while..." unless $quiet;
|
||||||
$sth = $session->db->read( "SELECT assetId, revisionDate FROM snippet" );
|
$sth = $session->db->read( "SELECT assetId, revisionDate FROM snippet" );
|
||||||
|
|
@ -130,50 +130,10 @@ sub repackTemplates {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\t... DONE!\n" unless $quiet;
|
print "DONE!\n" unless $quiet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
|
||||||
# Rename template variables
|
|
||||||
sub renameAccountMacroTemplateVariables {
|
|
||||||
my $session = shift;
|
|
||||||
|
|
||||||
print "\tRename Account Macro template variables..." unless $quiet;
|
|
||||||
my $sth = $session->db->read( q|SELECT assetId, revisionDate FROM template where namespace="Macro/a_account"| );
|
|
||||||
while ( my ($assetId, $revisionDate) = $sth->array ) {
|
|
||||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
|
|
||||||
next unless $asset;
|
|
||||||
my $template = $asset->get('template');
|
|
||||||
$template =~ s/account\.url/account_url/msg;
|
|
||||||
$template =~ s/account\.text/account_text/msg;
|
|
||||||
$asset->update({
|
|
||||||
template => $template,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
print "\t... DONE!\n" unless $quiet;
|
|
||||||
}
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
|
||||||
# Rename template variables
|
|
||||||
sub renameAdminToggleMacroTemplateVariables {
|
|
||||||
my $session = shift;
|
|
||||||
|
|
||||||
print "\tRename Admin Toggle Macro template variables..." unless $quiet;
|
|
||||||
my $sth = $session->db->read( q|SELECT assetId, revisionDate FROM template where namespace="Macro/AdminToggle"| );
|
|
||||||
while ( my ($assetId, $revisionDate) = $sth->array ) {
|
|
||||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
|
|
||||||
next unless $asset;
|
|
||||||
my $template = $asset->get('template');
|
|
||||||
$template =~ s/toggle\.url/toggle_url/msg;
|
|
||||||
$template =~ s/toggle\.text/toggle_text/msg;
|
|
||||||
$asset->update({
|
|
||||||
template => $template,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
print "\t... DONE!\n" unless $quiet;
|
|
||||||
}
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Describe what our function does
|
# Describe what our function does
|
||||||
#sub exampleFunction {
|
#sub exampleFunction {
|
||||||
|
|
@ -237,8 +197,6 @@ sub finish {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
updateTemplates($session);
|
updateTemplates($session);
|
||||||
repackTemplates( $session );
|
repackTemplates( $session );
|
||||||
renameAccountMacroTemplateVariables( $session );
|
|
||||||
renameAdminToggleMacroTemplateVariables( $session );
|
|
||||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
$versionTag->commit;
|
$versionTag->commit;
|
||||||
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
|
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,7 @@ our $HELP = {
|
||||||
'admin toggle' => {
|
'admin toggle' => {
|
||||||
title => 'admin toggle title',
|
title => 'admin toggle title',
|
||||||
body => '',
|
body => '',
|
||||||
variables => [
|
variables => [ { 'name' => 'toggle.url' }, { 'name' => 'toggle.text' } ],
|
||||||
{
|
|
||||||
name => 'toggle_url',
|
|
||||||
description => 'toggle.url',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name => 'toggle_text',
|
|
||||||
description => 'toggle.text',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
fields => [],
|
fields => [],
|
||||||
related => []
|
related => []
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,7 @@ our $HELP = {
|
||||||
title => 'account title',
|
title => 'account title',
|
||||||
body => '',
|
body => '',
|
||||||
fields => [],
|
fields => [],
|
||||||
variables => [
|
variables => [ { 'name' => 'account.url' }, { 'name' => 'account.text' } ],
|
||||||
{
|
|
||||||
name => 'account_url',
|
|
||||||
description => 'account.url',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name => 'account_text',
|
|
||||||
description => 'account.text',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
related => []
|
related => []
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,8 @@ sub process {
|
||||||
my @param = @_;
|
my @param = @_;
|
||||||
return $session->url->page("op=auth;method=init") if ($param[0] eq "linkonly");
|
return $session->url->page("op=auth;method=init") if ($param[0] eq "linkonly");
|
||||||
my $i18n = WebGUI::International->new($session,'Macro_a_account');
|
my $i18n = WebGUI::International->new($session,'Macro_a_account');
|
||||||
$var{'account_url'} = $session->url->page('op=auth;method=init');
|
$var{'account.url'} = $session->url->page('op=auth;method=init');
|
||||||
$var{'account_text'} = $param[0] || $i18n->get(46);
|
$var{'account.text'} = $param[0] || $i18n->get(46);
|
||||||
if ($param[1]) {
|
if ($param[1]) {
|
||||||
return WebGUI::Asset::Template->newByUrl($session, $param[1])->process(\%var);
|
return WebGUI::Asset::Template->newByUrl($session, $param[1])->process(\%var);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ sub addTemplate {
|
||||||
className => 'WebGUI::Asset::Template',
|
className => 'WebGUI::Asset::Template',
|
||||||
url => 'admintoggle-test',
|
url => 'admintoggle-test',
|
||||||
namespace => 'Macro/AdminToggle',
|
namespace => 'Macro/AdminToggle',
|
||||||
template => "HREF=<tmpl_var toggle_url>\nLABEL=<tmpl_var toggle_text>",
|
template => "HREF=<tmpl_var toggle.url>\nLABEL=<tmpl_var toggle.text>",
|
||||||
id => 'AdminToggleTemplate--Z',
|
id => 'AdminToggleTemplate--Z',
|
||||||
usePacked => 0,
|
usePacked => 0,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ sub addTemplate {
|
||||||
className => 'WebGUI::Asset::Template',
|
className => 'WebGUI::Asset::Template',
|
||||||
url => 'a_account-test',
|
url => 'a_account-test',
|
||||||
namespace => 'Macro/a_account',
|
namespace => 'Macro/a_account',
|
||||||
template => "HREF=<tmpl_var account_url>\nLABEL=<tmpl_var account_text>",
|
template => "HREF=<tmpl_var account.url>\nLABEL=<tmpl_var account.text>",
|
||||||
id => 'testTemplatea_account1',
|
id => 'testTemplatea_account1',
|
||||||
usePacked => 1,
|
usePacked => 1,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue