various patches added
This commit is contained in:
parent
2e791c9dd5
commit
c0bf7e46f0
16 changed files with 136 additions and 108 deletions
|
|
@ -23,21 +23,8 @@ sub process {
|
|||
if (WebGUI::Grouping::isInGroup(12)) {
|
||||
my %var;
|
||||
my @param = WebGUI::Macro::getParams($_[0]);
|
||||
my $templateId = 1; ##Set default template in the namespace
|
||||
##1 param means use my template with default text
|
||||
my ($turnOff, $turnOn) = (WebGUI::International::get(517),WebGUI::International::get(516));
|
||||
if (@param == 1) {
|
||||
$templateId = WebGUI::Template::getIdByName($param[0],"Macro/AdminToggle");
|
||||
}
|
||||
##2 params means use my text with the default template
|
||||
elsif (@param == 2) {
|
||||
($turnOff, $turnOn) = @param;
|
||||
}
|
||||
##3 or more params means use my text and template, other args ignored
|
||||
elsif (@param >= 3) {
|
||||
($turnOff, $turnOn) = @param[1,2];
|
||||
$templateId = WebGUI::Template::getIdByName($param[0],"Macro/AdminToggle");
|
||||
}
|
||||
my $turnOn = $param[0] || WebGUI::International::get(516);
|
||||
my $turnOff = $param[1] || WebGUI::International::get(517);
|
||||
if ($session{var}{adminOn}) {
|
||||
$var{'toggle.url'} = WebGUI::URL::page('op=switchOffAdmin');
|
||||
$var{'toggle.text'} = $turnOff;
|
||||
|
|
@ -45,8 +32,7 @@ sub process {
|
|||
$var{'toggle.url'} = WebGUI::URL::page('op=switchOnAdmin');
|
||||
$var{'toggle.text'} = $turnOn;
|
||||
}
|
||||
$templateId = 1 if $templateId == 0;
|
||||
return WebGUI::Template::process($templateId,"Macro/AdminToggle",\%var);
|
||||
return WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/AdminToggle"),"Macro/AdminToggle",\%var);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue