Converting to use standard admin navigation.

This commit is contained in:
JT Smith 2002-12-15 03:15:26 +00:00
parent b240822489
commit a1127cc7ec
3 changed files with 31 additions and 6 deletions

View file

@ -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<p/>\r\n\r\n<b>page_loop</b><br/>\r\nThis loop contains all of the pages in the site map.\r\n<blockquote>\r\n\r\n<b>page.indent</b><br/>\r\nThe indent spacer for this page indicating the depth of the page in the tree.\r\n<p/>\r\n\r\n<b>page.url</b><br/>\r\nThe URL to the page.\r\n<p/>\r\n\r\n<b>page.id</b><br/>\r\nThe unique identifier for this page that WebGUI uses internally.\r\n<p/>\r\n\r\n<b>page.title</b><br/>\r\nThe title of this page.\r\n<p/>\r\n\r\n<b>page.menutitle</b><br/>\r\nThe title of this page that appears in navigation.\r\n<p/>\r\n\r\n<b>page.synopsis</b><br/>\r\nThe description of the contents of this page (if any).\r\n<p/>\r\n\r\n<b>page.isRoot</b><br/>\r\nA condition indicating whether or not this page is a root.\r\n<p/>\r\n\r\n</blockquote>\r\n<p/>', 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);

View file

@ -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);

View file

@ -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).'</a>';
$output .= '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.WebGUI::URL::page('op=listTemplates&namespace='
.$session{form}{namespace}).'">'.WebGUI::International::get(45).'</a></div>';
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 .= '<h1>'.WebGUI::International::get(506).'</h1>';
$output .= '<div align="center"><a href="'.WebGUI::URL::page('op=editTemplate&tid=new').
'">'.WebGUI::International::get(505).'</a><p/></div>';
$sth = WebGUI::SQL->read("select templateId,name,namespace from template $where order by namespace,name");
while (@data = $sth->array) {
$row[$i] = '<tr><td valign="top" class="tableData">'
@ -187,7 +206,7 @@ sub www_listTemplates {
$output .= $p->getPage($session{form}{pn});
$output .= '</table>';
$output .= $p->getBarTraditional($session{form}{pn});
return $output;
return _submenu($output);
} else {
return WebGUI::Privilege::insufficient();
}