fixed bug 729711
This commit is contained in:
parent
3531838ace
commit
15aa3403bb
6 changed files with 54 additions and 6 deletions
38
lib/WebGUI/Macro/EditableToggle.pm
Normal file
38
lib/WebGUI/Macro/EditableToggle.pm
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package WebGUI::Macro::EditableToggle;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2003 Plain Black LLC.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($temp, @param, $turnOn, $turnOff);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
if ($session{var}{adminOn}) {
|
||||
$turnOff = $param[1] || WebGUI::International::get(517);
|
||||
$temp = '<a href="'.WebGUI::URL::page('op=switchOffAdmin').'">'.$turnOff.'</a>';
|
||||
} else {
|
||||
$turnOn = $param[0] || WebGUI::International::get(516);
|
||||
$temp = '<a href="'.WebGUI::URL::page('op=switchOnAdmin').'">'.$turnOn.'</a>';
|
||||
}
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue