From a1127cc7ecc83c62ad920eab1fd07362f92c63dd Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 15 Dec 2002 03:15:26 +0000 Subject: [PATCH] Converting to use standard admin navigation. --- docs/upgrades/upgrade_4.9.2-4.9.3.sql | 6 ++++++ lib/WebGUI/Operation/Style.pm | 2 +- lib/WebGUI/Operation/Template.pm | 29 ++++++++++++++++++++++----- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/docs/upgrades/upgrade_4.9.2-4.9.3.sql b/docs/upgrades/upgrade_4.9.2-4.9.3.sql index 652cd4564..78c824cdf 100644 --- a/docs/upgrades/upgrade_4.9.2-4.9.3.sql +++ b/docs/upgrades/upgrade_4.9.2-4.9.3.sql @@ -2534,6 +2534,12 @@ drop table SiteMap; alter table SiteMap2 rename SiteMap; delete from international where languageId=1 and namespace='SiteMap' and internationalId=73; insert into international (internationalId,languageId,namespace,message,lastUpdated) values (73,1,'SiteMap','This is the list of template variables available for site map templates.\r\n

\r\n\r\npage_loop
\r\nThis loop contains all of the pages in the site map.\r\n

\r\n\r\npage.indent
\r\nThe indent spacer for this page indicating the depth of the page in the tree.\r\n

\r\n\r\npage.url
\r\nThe URL to the page.\r\n

\r\n\r\npage.id
\r\nThe unique identifier for this page that WebGUI uses internally.\r\n

\r\n\r\npage.title
\r\nThe title of this page.\r\n

\r\n\r\npage.menutitle
\r\nThe title of this page that appears in navigation.\r\n

\r\n\r\npage.synopsis
\r\nThe description of the contents of this page (if any).\r\n

\r\n\r\npage.isRoot
\r\nA condition indicating whether or not this page is a root.\r\n

\r\n\r\n

\r\n

', 1039910987); +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (855,1,'WebGUI','List all templates.', 1039926498); +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (854,1,'WebGUI','List all templates like this one.', 1039926488); +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (853,1,'WebGUI','Delete this template.', 1039926459); +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (852,1,'WebGUI','Copy this template.', 1039926448); +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (851,1,'WebGUI','Edit this template.', 1039926394); + diff --git a/lib/WebGUI/Operation/Style.pm b/lib/WebGUI/Operation/Style.pm index 5358dc739..64d72549e 100644 --- a/lib/WebGUI/Operation/Style.pm +++ b/lib/WebGUI/Operation/Style.pm @@ -32,7 +32,7 @@ sub _submenu { my (%menu); tie %menu, 'Tie::IxHash'; $menu{WebGUI::URL::page('op=editStyle&sid=new')} = WebGUI::International::get(158); - if (($session{form}{op} eq "editStyle" && $session{form}{sid} ne "new") || $session{form}{op} eq "deleteStyle") { + if (($session{form}{op} eq "editStyle" && $session{form}{sid} ne "new") || $session{form}{op} eq "deleteStyleConfirm") { $menu{WebGUI::URL::page('op=editStyle&sid='.$session{form}{sid})} = WebGUI::International::get(803); $menu{WebGUI::URL::page('op=copyStyle&sid='.$session{form}{sid})} = WebGUI::International::get(804); $menu{WebGUI::URL::page('op=deleteStyle&sid='.$session{form}{sid})} = WebGUI::International::get(805); diff --git a/lib/WebGUI/Operation/Template.pm b/lib/WebGUI/Operation/Template.pm index ac1a7e5f4..3f62032c8 100644 --- a/lib/WebGUI/Operation/Template.pm +++ b/lib/WebGUI/Operation/Template.pm @@ -17,6 +17,7 @@ use WebGUI::HTML; use WebGUI::HTMLForm; use WebGUI::Icon; use WebGUI::International; +use WebGUI::Operation::Shared; use WebGUI::Paginator; use WebGUI::Privilege; use WebGUI::Session; @@ -28,6 +29,26 @@ use WebGUI::Utility; our @ISA = qw(Exporter); our @EXPORT = qw(&www_copyTemplate &www_deleteTemplate &www_deleteTemplateConfirm &www_editTemplate &www_editTemplateSave &www_listTemplates); +#------------------------------------------------------------------- +sub _submenu { + my (%menu); + tie %menu, 'Tie::IxHash'; + $menu{WebGUI::URL::page('op=editTemplate&sid=new')} = WebGUI::International::get(505); + if (($session{form}{op} eq "editTemplate" && $session{form}{tid} ne "new") || $session{form}{op} eq "deleteTemplateConfirm") { + $menu{WebGUI::URL::page('op=editTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace})} = + WebGUI::International::get(851); + $menu{WebGUI::URL::page('op=copyTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace})} = + WebGUI::International::get(852); + $menu{WebGUI::URL::page('op=deleteTemplate&tid='.$session{form}{tid}.'&namespace='.$session{form}{namespace})} = + WebGUI::International::get(853); + $menu{WebGUI::URL::page('op=listTemplates&namespace='.$session{form}{namespace})} = + WebGUI::International::get(854); + } + $menu{WebGUI::URL::page('op=listTemplates')} = WebGUI::International::get(855); + return menuWrapper($_[0],\%menu); +} + + #------------------------------------------------------------------- sub www_copyTemplate { my (%template); @@ -58,7 +79,7 @@ sub www_deleteTemplate { .'">'.WebGUI::International::get(44).''; $output .= '    '.WebGUI::International::get(45).''; - return $output; + return _submenu($output); } else { return WebGUI::Privilege::adminOnly(); } @@ -128,7 +149,7 @@ sub www_editTemplate { } else { $output = WebGUI::Privilege::insufficient(); } - return $output; + return _submenu($output); } #------------------------------------------------------------------- @@ -168,8 +189,6 @@ sub www_listTemplates { $where = "where namespace=".quote($session{form}{namespace}) if ($session{form}{namespace}); $output = helpIcon(33); $output .= '

'.WebGUI::International::get(506).'

'; - $output .= '
'.WebGUI::International::get(505).'

'; $sth = WebGUI::SQL->read("select templateId,name,namespace from template $where order by namespace,name"); while (@data = $sth->array) { $row[$i] = '' @@ -187,7 +206,7 @@ sub www_listTemplates { $output .= $p->getPage($session{form}{pn}); $output .= ''; $output .= $p->getBarTraditional($session{form}{pn}); - return $output; + return _submenu($output); } else { return WebGUI::Privilege::insufficient(); }