made adminbar work with admin console

This commit is contained in:
JT Smith 2004-11-03 23:00:44 +00:00
parent 858ac96f88
commit 09cd6060eb
7 changed files with 40 additions and 112 deletions

View file

@ -28,6 +28,14 @@ sub addSubmenuItem {
});
}
sub getAdminConsoleParams {
return { 'title' => WebGUI::International::get("admin console","AdminConsole"),
url => WebGUI::URL::page("op=adminConsole"),
canUse => WebGUI::Grouping::isInGroup("12"),
icon => $session{config}{extrasURL}."/adminConsole/adminConsole.gif"
};
}
sub getAdminFunction {
my $self = shift;
my $id = shift;
@ -216,7 +224,7 @@ sub new {
my $class = shift;
my $id = shift;
my %self;
$self{_function} = $class->getAdminFunction($id);
$self{_function} = $class->getAdminFunction($id) if ($id);
bless \%self, $class;
}
@ -234,10 +242,11 @@ sub render {
if (exists $self->{_submenuItem}) {
$var{submenu_loop} = $self->{_submenuItem};
}
$var{"console.title"} = WebGUI::International::get("admin console","AdminConsole");
$var{"console.url"} = WebGUI::URL::page("op=adminConsole");
$var{"console.canUse"} = WebGUI::Grouping::isInGroup("12");
$var{"console.icon"} = $session{config}{extrasURL}."/adminConsole/adminConsole.gif";
my $acParams = $self->getAdminConsoleParams;
$var{"console.title"} = $acParams->{title};
$var{"console.url"} = $acParams->{url};
$var{"console.canUse"} = $acParams->{canUse};
$var{"console.icon"} = $acParams->{icon};
$var{"help.url"} = $self->{_helpUrl};
$var{"application_loop"} = $self->getAdminFunction;
$session{page}{useAdminStyle} = 1;

View file

@ -13,6 +13,7 @@ package WebGUI::Macro::AdminBar;
use strict qw(refs vars);
use Tie::CPHash;
use Tie::IxHash;
use WebGUI::AdminConsole;
use WebGUI::Grouping;
use WebGUI::International;
use WebGUI::Macro;
@ -136,56 +137,18 @@ sub process {
}
$var{'clipboard_loop'} = \@clipboard;
#--admin functions
%hash = ();
if (WebGUI::Grouping::isInGroup(3)) {
%hash = (
WebGUI::URL::page('op=listGroups')=>WebGUI::International::get(5),
WebGUI::URL::page('op=manageSettings')=>WebGUI::International::get(4),
WebGUI::URL::page('op=listUsers')=>WebGUI::International::get(7),
WebGUI::URL::page('op=viewStatistics')=>WebGUI::International::get(144),
WebGUI::URL::page('op=listDatabaseLinks')=>WebGUI::International::get(981),
WebGUI::URL::page('op=listNavigation')=>WebGUI::International::get("manage navigation","Navigation")
%hash = (
'http://validator.w3.org/check?uri='.WebGUI::URL::escape(WebGUI::URL::page())=>WebGUI::International::get(399),
);
} elsif (WebGUI::Grouping::isInGroup(11)) {
%hash = (
WebGUI::URL::page('op=listGroupsSecondary')=>WebGUI::International::get(5),
WebGUI::URL::page('op=addUser')=>WebGUI::International::get(169),
%hash
);
}
if (WebGUI::Grouping::isInGroup(4)) {
%hash = (
WebGUI::URL::page('op=listRoots')=>WebGUI::International::get(410),
'http://validator.w3.org/check?uri='.WebGUI::URL::escape(WebGUI::URL::page())=>WebGUI::International::get(399),
WebGUI::URL::page('op=manageClipboard')=>WebGUI::International::get(949),
WebGUI::URL::page('op=listCollateral')=>WebGUI::International::get(394),
WebGUI::URL::page('op=viewPageTree')=>WebGUI::International::get(447),
WebGUI::URL::page('op=manageTrash')=>WebGUI::International::get(10),
%hash
);
}
if (WebGUI::Grouping::isInGroup(6)) {
%hash = (
WebGUI::URL::gateway('packages')=>WebGUI::International::get(374),
%hash
);
}
if (WebGUI::Grouping::isInGroup(8)) {
%hash = (
WebGUI::URL::page('op=listTemplates')=>WebGUI::International::get(508),
%hash
);
}
if (WebGUI::Grouping::isInGroup(9)) {
%hash = (
WebGUI::URL::page('op=listThemes')=>WebGUI::International::get(900),
%hash
);
}
%hash = (
WebGUI::URL::page('op=viewHelpIndex')=>WebGUI::International::get(13),
%hash
);
my $acParams = WebGUI::AdminConsole->getAdminConsoleParams;
$hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canUse});
# $acParams = WebGUI::AdminConsole->getAdminFunction("users");
# $hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canUse});
# $acParams = WebGUI::AdminConsole->getAdminFunction("groups");
# $hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canUse});
# $acParams = WebGUI::AdminConsole->getAdminFunction("assets");
# $hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canView});
%hash = sortHash(%hash);
%hash = (
WebGUI::URL::page('op=switchOffAdmin')=>WebGUI::International::get(12),

View file

@ -2,7 +2,7 @@ package WebGUI::i18n::English::AdminConsole;
our $I18N = {
'admin console' => {
message => q|WebGUI Admin Console|,
message => q|Admin Console|,
lastUpdated => 1099344172,
context => q|The title of the admin console.|
},

View file

@ -7,12 +7,6 @@ our $I18N = {
context => q|A submenu item in admin console that allows the user to add a new nav config.|
},
'manage navigation' => {
message => q|Manage Navigation|,
lastUpdated => 1077081255,
context=>q|Used in the Admin Bar|
},
'33' => {
message => q|Error: This identifier is already in use. Please use an unique value.|,
lastUpdated => 1077081255

View file

@ -1308,11 +1308,6 @@ How should this user be notified when they get a new WebGUI message?
lastUpdated => 1066073923
},
'410' => {
message => q|Manage roots.|,
lastUpdated => 1031514049
},
'999' => {
message => q|Database Link, Delete|,
lastUpdated => 1056151382
@ -1343,11 +1338,6 @@ How should this user be notified when they get a new WebGUI message?
lastUpdated => 1031514049
},
'447' => {
message => q|Manage page tree.|,
lastUpdated => 1031514049
},
'536' => {
message => q|A new user named ^@; has joined the site.|,
lastUpdated => 1031514049
@ -1453,11 +1443,6 @@ How should this user be notified when they get a new WebGUI message?
lastUpdated => 1031514049
},
'508' => {
message => q|Manage templates.|,
lastUpdated => 1031514049
},
'953' => {
message => q|Previous Location|,
lastUpdated => 1052850265
@ -2505,11 +2490,6 @@ will be modified to make it unique.|,
lastUpdated => 1031514049
},
'7' => {
message => q|Manage users.|,
lastUpdated => 1031514049
},
'26' => {
message => q|December|,
lastUpdated => 1031514049
@ -2705,11 +2685,6 @@ The password you use to connect to the DSN.
lastUpdated => 1031514049
},
'394' => {
message => q|Manage collateral.|,
lastUpdated => 1036954925
},
'48' => {
message => q|Hello|,
lastUpdated => 1031514049
@ -3601,11 +3576,6 @@ The translated label for the link to the home page or the text that you supply t
lastUpdated => 1050190959
},
'374' => {
message => q|Manage packages.|,
lastUpdated => 1031514049
},
'930' => {
message => q|View Theme|,
lastUpdated => 1050270912
@ -4270,11 +4240,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1047842180
},
'5' => {
message => q|Manage groups.|,
lastUpdated => 1031514049
},
'698' => {
message => q|Karma is a method of tracking the activity of your users, and potentially rewarding or punishing them for their level of activity. Once karma has been enabled, you'll notice that the menus of many things in WebGUI change to reflect karma.
<p>
@ -5650,11 +5615,6 @@ Start typing! Or better yet, copy the snippet from some other electronic documen
lastUpdated => 1031514049
},
'981' => {
message => q|Manage database links.|,
lastUpdated => 1056151382
},
'697' => {
message => q|Karma, Using|,
lastUpdated => 1031514049
@ -6676,11 +6636,6 @@ What group should be alerted when a new user registers?
lastUpdated => 1031514049
},
'13' => {
message => q|View help index.|,
lastUpdated => 1031514049
},
'972' => {
message => q|Date and Time|,
lastUpdated => 1053278234