more admin console stuff

This commit is contained in:
JT Smith 2004-11-03 02:45:44 +00:00
parent 9d1a4f2be8
commit 53bb04d2d1
3 changed files with 25 additions and 28 deletions

View file

@ -180,7 +180,7 @@ sub www_emptyClipboardConfirm {
WebGUI::ErrorHandler::audit("emptied user clipboard to trash"); WebGUI::ErrorHandler::audit("emptied user clipboard to trash");
} }
WebGUI::Session::refreshPageInfo($session{page}{pageId}); WebGUI::Session::refreshPageInfo($session{page}{pageId});
return ""; return www_manageClipboard();
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------

View file

@ -12,10 +12,11 @@ package WebGUI::Operation::Trash;
use strict qw(vars subs); use strict qw(vars subs);
use Tie::CPHash; use Tie::CPHash;
use WebGUI::AdminConsole;
use WebGUI::DateTime; use WebGUI::DateTime;
use WebGUI::Grouping; use WebGUI::Grouping;
use WebGUI::Icon; use WebGUI::Icon;
use WebGUI::Operation::Shared; use WebGUI::Page;
use WebGUI::Paginator; use WebGUI::Paginator;
use WebGUI::Privilege; use WebGUI::Privilege;
use WebGUI::Session; use WebGUI::Session;
@ -111,19 +112,26 @@ sub _recursePageTree {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub _submenu { sub _submenu {
my (%menu); my $workarea = shift;
tie %menu, 'Tie::IxHash'; my $title = shift;
$menu{WebGUI::URL::page('op=manageTrash')} = WebGUI::International::get(10); $title = WebGUI::International::get($title) if ($title);
my $help = shift;
my $ac = WebGUI::AdminConsole->new;
if ($help) {
$ac->setHelp($help);
}
$ac->setAdminFunction("trash");
$ac->addSubmenuItem(WebGUI::URL::page('op=manageTrash'), WebGUI::International::get(10));
if ($session{form}{systemTrash} ne "1") { if ($session{form}{systemTrash} ne "1") {
$menu{WebGUI::URL::page('op=emptyTrash')} = WebGUI::International::get(11); $ac->addSubmenuItem(WebGUI::URL::page('op=emptyTrash'), WebGUI::International::get(11));
} }
if ( ($session{setting}{sharedTrash} ne "1") && (WebGUI::Grouping::isInGroup(3)) ) { if ( ($session{setting}{sharedTrash} ne "1") && (WebGUI::Grouping::isInGroup(3)) ) {
$menu{WebGUI::URL::page('op=manageTrash&systemTrash=1')} = WebGUI::International::get(964); $ac->addSubmenuItem(WebGUI::URL::page('op=manageTrash&systemTrash=1'), WebGUI::International::get(964));
if ($session{form}{systemTrash} eq "1") { if ($session{form}{systemTrash} eq "1") {
$menu{WebGUI::URL::page('op=emptyTrash&systemTrash=1')} = WebGUI::International::get(967); $ac->addSubmenuItem(WebGUI::URL::page('op=emptyTrash&systemTrash=1'), WebGUI::International::get(967));
} }
} }
return menuWrapper($_[0],\%menu); return $ac->render($workarea, $title);
} }
@ -168,7 +176,6 @@ sub www_deleteTrashItem {
} elsif ($session{form}{pageId} ne "") { } elsif ($session{form}{pageId} ne "") {
$output .= helpIcon("page delete"); $output .= helpIcon("page delete");
} }
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(966).'<p>'; $output .= WebGUI::International::get(966).'<p>';
if ($session{form}{wid} ne "") { if ($session{form}{wid} ne "") {
$output .= '<div align="center"><a href="'.WebGUI::URL::page('op=deleteTrashItemConfirm&wid=' $output .= '<div align="center"><a href="'.WebGUI::URL::page('op=deleteTrashItemConfirm&wid='
@ -179,7 +186,7 @@ sub www_deleteTrashItem {
} }
$output .= '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.WebGUI::URL::page().'">' $output .= '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.WebGUI::URL::page().'">'
.WebGUI::International::get(45).'</a></div>'; .WebGUI::International::get(45).'</a></div>';
return $output; return _submenu($output,'42');
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -219,8 +226,6 @@ sub www_deleteTrashItemConfirm {
sub www_emptyTrash { sub www_emptyTrash {
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4)); return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4));
my ($output); my ($output);
$output = helpIcon("trash empty");
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(162).'<p>'; $output .= WebGUI::International::get(162).'<p>';
$output .= WebGUI::International::get(651).'<p>'; $output .= WebGUI::International::get(651).'<p>';
if ($session{form}{systemTrash} eq "1") { if ($session{form}{systemTrash} eq "1") {
@ -232,7 +237,7 @@ sub www_emptyTrash {
} }
$output .= '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.WebGUI::URL::page().'">' $output .= '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.WebGUI::URL::page().'">'
.WebGUI::International::get(45).'</a></div>'; .WebGUI::International::get(45).'</a></div>';
return $output; return _submenu($output,'42',"trash empty");
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -263,7 +268,7 @@ sub www_emptyTrashConfirm {
WebGUI::ErrorHandler::audit("emptied user trash"); WebGUI::ErrorHandler::audit("emptied user trash");
} }
WebGUI::Session::refreshPageInfo($session{page}{pageId}); WebGUI::Session::refreshPageInfo($session{page}{pageId});
return ""; return www_manageTrash();
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -271,19 +276,16 @@ sub www_manageTrash {
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4)); return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4));
my ($sth, @data, @row, @sorted_row, $i, $p, $allUsers); my ($sth, @data, @row, @sorted_row, $i, $p, $allUsers);
my $output = helpIcon("trash manage"); my ($title,$output);
# Add appropriate html page header # Add appropriate html page header
if ($session{setting}{sharedTrash} eq "1") { if ($session{setting}{sharedTrash} eq "1") {
$allUsers = 1; $allUsers = 1;
$output .= '<h1>'. WebGUI::International::get(962) .'</h1>';
} elsif ($session{form}{systemTrash} eq "1") { } elsif ($session{form}{systemTrash} eq "1") {
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
$allUsers = 1; $allUsers = 1;
$output .= '<h1>'. WebGUI::International::get(965) .'</h1>'; $title = '<h1>'. WebGUI::International::get(965) .'</h1>';
} else { } else {
$allUsers = 0; $allUsers = 0;
$output .= '<h1>'. WebGUI::International::get(962) .'</h1>';
} }
# Generate list of pages in trash # Generate list of pages in trash
@ -420,7 +422,7 @@ sub www_manageTrash {
$output .= $p->getPage($session{form}{pn}); $output .= $p->getPage($session{form}{pn});
$output .= '</table>'; $output .= '</table>';
$output .= $p->getBarTraditional($session{form}{pn}); $output .= $p->getBarTraditional($session{form}{pn});
return _submenu($output); return _submenu($output,$title,"trash manage");
} }
1; 1;

View file

@ -1612,8 +1612,8 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
}, },
'965' => { '965' => {
message => q|Manage System Trash|, message => q|System Trash|,
lastUpdated => 1052850265 lastUpdated => 1099050265
}, },
'824' => { '824' => {
@ -5364,11 +5364,6 @@ The headings of columns on things like message boards and user contributions.
lastUpdated => 1070030223 lastUpdated => 1070030223
}, },
'962' => {
message => q|Manage Trash|,
lastUpdated => 1052850265
},
'328' => { '328' => {
message => q|Home Phone|, message => q|Home Phone|,
lastUpdated => 1031514049 lastUpdated => 1031514049