--- loncom/interface/domainstatus.pm 2008/12/25 01:52:50 1.2
+++ loncom/interface/domainstatus.pm 2014/03/17 02:36:56 1.7
@@ -2,7 +2,7 @@
# Generate a menu page containing links to server status pages accessible
# to user.
#
-# $Id: domainstatus.pm,v 1.2 2008/12/25 01:52:50 raeburn Exp $
+# $Id: domainstatus.pm,v 1.7 2014/03/17 02:36:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -74,60 +74,33 @@ sub handler {
text=>"Server Status Information"});
$r->print(&Apache::loncommon::start_page('Server Status').
- &Apache::lonhtmlcommon::breadcrumbs('Server Status Information').
- '
');
+ &Apache::lonhtmlcommon::breadcrumbs('Server Status Information'));
if (keys(%candisplay) > 0) {
$r->print(''.&mt('Server Utilities for Domain: [_1]',''.$domdesc.'').
- '
'.&print_status_menu(\%candisplay));
+ ''.&print_status_menu(\%candisplay,$dom));
} else {
- $r->print(''.&mt('No information available').'
'.
- ''.&mt('Your current role and/or IP address does not have permission to display information about server status for servers in the domain: [_1].',''.$domdesc.' ('.$dom.')').'');
+ $r->print(
+ ''.&mt('No information available').'
'
+ .''
+ .&mt('Your current role and/or IP address does not have permission to display information about server status for servers in the domain: [_1].',
+ ''.$domdesc.' ('.$dom.')')
+ .'
'
+ );
}
$r->print(&Apache::loncommon::end_page());
return OK;
}
sub print_status_menu {
- my ($candisplay) = @_;
+ my ($candisplay,$dom) = @_;
return '' if (ref($candisplay) ne 'HASH');
- my $menu_html;
- my @menu = &servermenu_items($candisplay);
- foreach my $item (@menu) {
- if (ref($item) eq 'HASH') {
- my $display;
- if (ref($item->{'items'}) eq 'ARRAY') {
- foreach my $page (@{$item->{'items'}}) {
- if (ref($page) eq 'HASH') {
- if ($page->{'permission'} eq 'F') {
- $display .= '
';
- }
- }
- }
- }
- if ($display) {
- $menu_html .= ''.
- '
'.&mt($item->{'categorytitle'}).'
'.
- $display.'';
- }
- }
- }
- if ($menu_html) {
- $menu_html .= '';
- }
- return $menu_html;
+ return &Apache::lonhtmlcommon::generate_menu(
+ &servermenu_items($candisplay,$dom));
}
sub servermenu_items {
- my ($candisplay) = @_;
+ my ($candisplay,$dom) = @_;
my $titles = &LONCAPA::lonauthcgi::serverstatus_titles();
my $linknames = &serverstatus_links();
my @menu;
@@ -137,7 +110,8 @@ sub servermenu_items {
items =>
[{
linktext => $linknames->{'userstatus'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Userstatus',
url => '/cgi-bin/userstatus.pl',
permission => $candisplay->{'userstatus'},
@@ -145,7 +119,8 @@ sub servermenu_items {
},
{
linktext => $linknames->{'lonstatus'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Connection_Status',
url => '/lon-status/',
permission => $candisplay->{'lonstatus'},
@@ -153,7 +128,8 @@ sub servermenu_items {
},
{
linktext => $linknames->{'server-status'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Apache_Status',
url => '/server-status',
permission => $candisplay->{'server-status'},
@@ -161,7 +137,8 @@ sub servermenu_items {
},
{
linktext => $linknames->{'clusterstatus'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Apache_Status',
url => '/cgi-bin/clusterstatus.pl',
permission => $candisplay->{'clusterstatus'},
@@ -169,15 +146,44 @@ sub servermenu_items {
},
{
linktext => $linknames->{'codeversions'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Code_Versions',
url => '/cgi-bin/lonversions.pl',
permission => $candisplay->{'codeversions'},
linktitle => $titles->{'codeversions'},
},
{
+ linktext => $linknames->{'checksums'},
+ icon => '',
+ alttext => '',
+ #help => 'Domain_Coordination_Code_Checksums',
+ url => '/cgi-bin/lonmodulecheck.pl',
+ permission => $candisplay->{'checksums'},
+ linktitle => $titles->{'checksums'},
+ },
+ {
+ linktext => $linknames->{'diskusage'},
+ icon => '',
+ alttext => '',
+ #help => 'Domain_Coordination_Disk_Usage',
+ url => '/cgi-bin/quotacheck.pl?domain='.$dom,
+ permission => $candisplay->{'diskusage'},
+ linktitle => $titles->{'diskusage'},
+ },
+ {
+ linktext => $linknames->{'uniquecodes'},
+ icon => '',
+ alttext => '',
+ #help => 'Domain_Coordination_Uniquecodes',
+ url => '/cgi-bin/listcodes.pl?domain='.$dom.'&format=html',
+ permission => $candisplay->{'uniquecodes'},
+ linktitle => $titles->{'uniquecodes'},
+ },
+ {
linktext => $linknames->{'showenv'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_User_Environment',
url => '/adm/test',
permission => $candisplay->{'showenv'},
@@ -187,7 +193,8 @@ sub servermenu_items {
items =>
[{
linktext => $linknames->{'loncron'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Connection_Reload',
url => '/cgi-bin/loncron.pl',
permission => $candisplay->{'loncron'},
@@ -195,7 +202,8 @@ sub servermenu_items {
},
{
linktext => $linknames->{'takeoffline'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Server_Offline',
url => '/cgi-bin/takeoffline.pl',
permission => $candisplay->{'takeoffline'},
@@ -203,7 +211,8 @@ sub servermenu_items {
},
{
linktext => $linknames->{'takeonline'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Server_Online',
url => '/cgi-bin/takeonline.pl',
permission => $candisplay->{'takeonline'},
@@ -213,7 +222,8 @@ sub servermenu_items {
items =>
[{
linktext => $linknames->{'metadata_keywords'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Metadata_Keywords',
url => '/cgi-bin/metadata_keywords.pl',
permission => $candisplay->{'metadata_keywords'},
@@ -221,7 +231,8 @@ sub servermenu_items {
},
{
linktext => $linknames->{'metadata_harvest'},
- #icon => '',
+ icon => '',
+ alttext => '',
#help => 'Domain_Coordination_Metadata_Harvest',
url => '/cgi-bin/metadata_harvest.pl',
permission => $candisplay->{'metadata_harvest'},
@@ -239,8 +250,11 @@ sub serverstatus_links {
'server-status' => 'Apache Server Status',
'clusterstatus' => 'Domain Status',
'codeversions' => 'LON-CAPA Modules',
+ 'checksums' => 'Check for LON-CAPA Module changes',
+ 'diskusage' => 'Display quotas and usage for Course/Community Content',
'showenv' => 'User Environment for current log-in',
'loncron' => 'Update Connections and Refresh Status Information',
+ 'uniquecodes' => "List Domain's Courses with Assigned Six Character codes",
'takeoffline' => 'Replace log-in page with offline notice',
'takeonline' => 'Replace offline notice with log-in page',
'metadata_keywords' => 'Display Metadata Keywords',