[LON-CAPA-cvs] cvs: loncom /interface domainstatus.pm lonmodifycourse.pm /localize/localize de.pm
bisitz
bisitz@source.lon-capa.org
Tue, 18 May 2010 16:13:48 -0000
This is a MIME encoded message
--bisitz1274199228
Content-Type: text/plain
bisitz Tue May 18 16:13:48 2010 EDT
Modified files:
/loncom/interface domainstatus.pm lonmodifycourse.pm
/loncom/localize/localize de.pm
Log:
Bug 6273 - Consistent menus (use generate_menu)
- View/Modify settings for a course (DC settings)
- Status of domain servers
- Use category icon for each menu item (planned to be replaced with individual version)
Included changes:
- lonmodifycourse.pm:
- XHTML - escape "&" in Link URLs
- XHTML/context - enclose form elements in form
- Localization: optimized &mt() usage in headline
- domainstatus.pm:
- Removed now unnecessary divs to float header and footer
- de.pm:
- Added translations
--bisitz1274199228
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20100518161348.txt"
Index: loncom/interface/domainstatus.pm
diff -u loncom/interface/domainstatus.pm:1.2 loncom/interface/domainstatus.pm:1.3
--- loncom/interface/domainstatus.pm:1.2 Thu Dec 25 01:52:50 2008
+++ loncom/interface/domainstatus.pm Tue May 18 16:13:31 2010
@@ -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.3 2010/05/18 16:13:31 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -74,15 +74,19 @@
text=>"Server Status Information"});
$r->print(&Apache::loncommon::start_page('Server Status').
- &Apache::lonhtmlcommon::breadcrumbs('Server Status Information').
- '<div class="LC_clear_float_header"></div>');
+ &Apache::lonhtmlcommon::breadcrumbs('Server Status Information'));
if (keys(%candisplay) > 0) {
$r->print('<h2>'.&mt('Server Utilities for Domain: [_1]','<i>'.$domdesc.'</i>').
'</h2>'.&print_status_menu(\%candisplay));
} else {
- $r->print('<h2>'.&mt('No information available').'</h2>'.
- '<span class="LC_error">'.&mt('Your current role and/or IP address does not have permission to display information about server status for servers in the domain: [_1].','<b>'.$domdesc.'</b> ('.$dom.')').'</span>');
+ $r->print(
+ '<h2>'.&mt('No information available').'</h2>'
+ .'<p class="LC_warning">'
+ .&mt('Your current role and/or IP address does not have permission to display information about server status for servers in the domain: [_1].',
+ '<b>'.$domdesc.'</b> ('.$dom.')')
+ .'</p>'
+ );
}
$r->print(&Apache::loncommon::end_page());
return OK;
@@ -91,39 +95,8 @@
sub print_status_menu {
my ($candisplay) = @_;
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 .= '<span class="LC_parm_menu_item">';
- if ($page->{'help'} ne '') {
- $display .=
- &Apache::loncommon::help_open_topic($page->{'help'});
- }
- $display .= '<a href="'.$page->{'url'}.'" title="'.
- &mt($page->{'linktitle'}).'">'.
- &mt($page->{'linktext'}).
- '</a></span><br /><br />';
- }
- }
- }
- }
- if ($display) {
- $menu_html .= '<div class="LC_left_float">'.
- '<h3>'.&mt($item->{'categorytitle'}).'</h3>'.
- $display.'</div>';
- }
- }
- }
- if ($menu_html) {
- $menu_html .= '<div class="LC_clear_float_footer"></div>';
- }
- return $menu_html;
+ return &Apache::lonhtmlcommon::generate_menu(
+ &servermenu_items($candisplay));
}
sub servermenu_items {
@@ -137,7 +110,7 @@
items =>
[{
linktext => $linknames->{'userstatus'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Userstatus',
url => '/cgi-bin/userstatus.pl',
permission => $candisplay->{'userstatus'},
@@ -145,7 +118,7 @@
},
{
linktext => $linknames->{'lonstatus'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Connection_Status',
url => '/lon-status/',
permission => $candisplay->{'lonstatus'},
@@ -153,7 +126,7 @@
},
{
linktext => $linknames->{'server-status'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Apache_Status',
url => '/server-status',
permission => $candisplay->{'server-status'},
@@ -161,7 +134,7 @@
},
{
linktext => $linknames->{'clusterstatus'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Apache_Status',
url => '/cgi-bin/clusterstatus.pl',
permission => $candisplay->{'clusterstatus'},
@@ -169,7 +142,7 @@
},
{
linktext => $linknames->{'codeversions'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Code_Versions',
url => '/cgi-bin/lonversions.pl',
permission => $candisplay->{'codeversions'},
@@ -177,7 +150,7 @@
},
{
linktext => $linknames->{'showenv'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_User_Environment',
url => '/adm/test',
permission => $candisplay->{'showenv'},
@@ -187,7 +160,7 @@
items =>
[{
linktext => $linknames->{'loncron'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Connection_Reload',
url => '/cgi-bin/loncron.pl',
permission => $candisplay->{'loncron'},
@@ -195,7 +168,7 @@
},
{
linktext => $linknames->{'takeoffline'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Server_Offline',
url => '/cgi-bin/takeoffline.pl',
permission => $candisplay->{'takeoffline'},
@@ -203,7 +176,7 @@
},
{
linktext => $linknames->{'takeonline'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Server_Online',
url => '/cgi-bin/takeonline.pl',
permission => $candisplay->{'takeonline'},
@@ -213,7 +186,7 @@
items =>
[{
linktext => $linknames->{'metadata_keywords'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Metadata_Keywords',
url => '/cgi-bin/metadata_keywords.pl',
permission => $candisplay->{'metadata_keywords'},
@@ -221,7 +194,7 @@
},
{
linktext => $linknames->{'metadata_harvest'},
- #icon => '',
+ icon => 'srvr.png',
#help => 'Domain_Coordination_Metadata_Harvest',
url => '/cgi-bin/metadata_harvest.pl',
permission => $candisplay->{'metadata_harvest'},
Index: loncom/interface/lonmodifycourse.pm
diff -u loncom/interface/lonmodifycourse.pm:1.53 loncom/interface/lonmodifycourse.pm:1.54
--- loncom/interface/lonmodifycourse.pm:1.53 Wed Mar 31 20:09:07 2010
+++ loncom/interface/lonmodifycourse.pm Tue May 18 16:13:31 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.53 2010/03/31 20:09:07 raeburn Exp $
+# $Id: lonmodifycourse.pm,v 1.54 2010/05/18 16:13:31 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -208,53 +208,81 @@
sub print_modification_menu {
my ($r,$cdesc,$domdesc,$dom,$type) = @_;
&print_header($r,$type);
- my ($ccrole,$setquota_text,$setparams_text,$cat_text);
+ my ($ccrole,$categorytitle,$setquota_text,$setparams_text,$cat_text);
if ($type eq 'Community') {
$ccrole = 'co';
} else {
$ccrole = 'cc';
}
- my $action = '/adm/modifycourse';
if ($type eq 'Community') {
+ $categorytitle = 'View/Modify Community Settings';
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.');
$setparams_text = 'View/Modify community owner';
$cat_text = 'View/Modify catalog settings for community';
} else {
+ $categorytitle = 'View/Modify Course Settings';
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.');
$setparams_text = 'View/Modify course owner, institutional code, and default authentication';
$cat_text = 'View/Modify catalog settings for course';
}
- my @menu =
- (
- { text => $setparams_text,
- phase => 'setparms',
- },
- { text => 'View/Modify quota for group portfolio files',
- phase => 'setquota',
- }
- );
+
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom);
my @additional_params = &catalog_settable($domconf{'coursecategories'},$type);
- if (@additional_params > 0) {
- push (@menu, { text => $cat_text,
- phase => 'catsettings',
- });
+
+ sub phaseurl {
+ my $phase = shift;
+ return "javascript:changePage(document.menu,'$phase')"
}
- unless ($type eq 'Community') {
- push(@menu,
- { text => 'Display current settings for automated enrollment',
- phase => 'viewparms',
- }
+ my @menu =
+ ({ categorytitle => $categorytitle,
+ items => [
+ {
+ linktext => $setparams_text,
+ url => &phaseurl('setparms'),
+ permission => 1,
+ #help => '',
+ icon => 'mcrs.png',
+ linktitle => ''
+ },
+ {
+ linktext => 'View/Modify quota for group portfolio files',
+ url => &phaseurl('setquota'),
+ permission => 1,
+ #help => '',
+ icon => 'mcrs.png',
+ linktitle => ''
+ },
+ {
+ linktext => $cat_text,
+ url => &phaseurl('catsettings'),
+ permission => (@additional_params > 0),
+ #help => '',
+ icon => 'mcrs.png',
+ linktitle => ''
+ },
+ {
+ linktext => 'Display current settings for automated enrollment',
+ url => &phaseurl('viewparms'),
+ permission => ($type ne 'Community'),
+ #help => '',
+ icon => 'mcrs.png',
+ linktitle => ''
+ },
+ ]
+ },
);
- }
- my $menu_html = '<h3>'.&mt('View/Modify settings for: ').
- ' <span class="LC_nobreak">'.$cdesc.'</span></h3>'."\n";
+
+ my $menu_html =
+ '<h3>'
+ .&mt('View/Modify settings for: [_1]',
+ '<span class="LC_nobreak">'.$cdesc.'</span>')
+ .'</h3>'."\n".'<p>';
if ($type eq 'Community') {
$menu_html .= &mt('Although almost all community settings can be modified by a Coordinator, the following may only be set or modified by a Domain Coordinator:');
} else {
$menu_html .= &mt('Although almost all course settings can be modified by a Course Coordinator, the following may only be set or modified by a Domain Coordinator:');
}
- $menu_html .= '<ul>';
+ $menu_html .= '</p>'."\n".'<ul>';
if ($type eq 'Community') {
$menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>';
} else {
@@ -265,30 +293,27 @@
foreach my $item (@additional_params) {
if ($type eq 'Community') {
if ($item eq 'togglecats') {
- $menu_html .= ' <li>'.&mt('Hiding/unhiding a community from the catalog (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
+ $menu_html .= ' <li>'.&mt('Hiding/unhiding a community from the catalog (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
} elsif ($item eq 'categorize') {
- $menu_html .= ' <li>'.&mt('Manual cataloging of a community (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
+ $menu_html .= ' <li>'.&mt('Manual cataloging of a community (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
}
} else {
if ($item eq 'togglecats') {
- $menu_html .= ' <li>'.&mt('Hiding/unhiding a course from the course catalog (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
+ $menu_html .= ' <li>'.&mt('Hiding/unhiding a course from the course catalog (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
} elsif ($item eq 'categorize') {
- $menu_html .= ' <li>'.&mt('Manual cataloging of a course (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
+ $menu_html .= ' <li>'.&mt('Manual cataloging of a course (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
}
}
}
- $menu_html .= ' </ul>
-<form name="menu" method="post" action="'.$action.'" />'."\n".
- &hidden_form_elements();
- foreach my $menu_item (@menu) {
- $menu_html.='<h3>';
- $menu_html.=
- qq|<a href="javascript:changePage(document.menu,'$menu_item->{'phase'}')">|;
- $menu_html.= &mt($menu_item->{'text'}).'</a>';
- $menu_html.='</h3>';
- }
+ $menu_html .=
+ ' </ul>'
+ .'<form name="menu" method="post" action="/adm/modifycourse">'
+ ."\n"
+ .&hidden_form_elements();
$r->print($menu_html);
+ $r->print(&Apache::lonhtmlcommon::generate_menu(@menu));
+ $r->print('</form>');
return;
}
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.381 loncom/localize/localize/de.pm:1.382
--- loncom/localize/localize/de.pm:1.381 Mon May 17 14:05:00 2010
+++ loncom/localize/localize/de.pm Tue May 18 16:13:47 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# German Localization Lexicon
#
-# $Id: de.pm,v 1.381 2010/05/17 14:05:00 bisitz Exp $
+# $Id: de.pm,v 1.382 2010/05/18 16:13:47 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -9414,8 +9414,8 @@
'Back to options page'
=> 'Zurück zum Funktionsauswahlmenü',
- 'View/Modify settings for: '
-=> 'Betrachten/Ändern der Einstellungen für ',
+ 'View/Modify settings for: [_1]'
+=> 'Anzeigen/ändern der Einstellungen für [_1]',
'Modify quota for group portfolio'
=> 'Ändern des Speicherplatzes für das Gruppen-Portfolio',
@@ -18837,6 +18837,9 @@
'View/Modify catalog settings for course'
=> 'Einstellungen des Kurses für die Kurs-/Community-Übersicht ansehen/ändern',
+ 'View/Modify catalog settings for community'
+=> 'Einstellungen der Community für die Kurs-/Community-Übersicht ansehen/ändern',
+
'If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]"'
=> 'Wenn die automatische Kursbelegung für "[_1]" aktiviert ist, dann könnte die automatische Kursbelegung für "[_2]" - Sektion: [_3], fehlschlagen. Der Grund dafür ist: "[_4]"',
@@ -19436,6 +19439,9 @@
'Course Settings'
=> 'Kurs-Einstellungen',
+ 'Community Settings'
+=> 'Community-Einstellungen',
+
'Course/Community Creation'
=> 'Kurs/Community-Erstellung',
@@ -19707,10 +19713,10 @@
=> 'Absender von Benachrichtigungs-Nachrichten',
'Offline - replace Log-in page'
-=> 'Offline - Login-Seite ersetzen',
+=> '-Offline- Login-Seite ersetzen',
'Online - restore Log-in page'
-=> 'Online - Login-Seite wiederherstellen',
+=> '-Online- Login-Seite wiederherstellen',
'Replace log-in page with offline notice'
=> 'Login-Seite durch Offline-Hinweis ersetzen',
@@ -19862,12 +19868,24 @@
'View or modify a course or community'
=> 'Einen Kurs oder eine Community anzeigen oder ändern',
+ 'View/Modify Course Settings'
+=> 'Anzeigen/ändern der Kurs-Einstellungen',
+
+ 'View/Modify Community Settings'
+=> 'Anzeigen/ändern der Community-Einstellungen',
+
'View/Modify Course/Community Settings'
=> 'Anzeigen/ändern der Kurs-/Community-Einstellungen',
'View/Modify course owner, institutional code, and default authentication'
=> 'Kurs-Eigentümer, institutionellen Code und voreingestellte Authentifizierung anzeigen/ändern',
+ 'View/Modify course owner'
+=> 'Kurseigentümer anzeigen/ändern',
+
+ 'View/Modify community owner'
+=> 'Community-Eigentümer anzeigen/ändern',
+
'View/Modify quota for group portfolio files'
=> 'Speicherplatz für Gruppen-Portfolio-Dateien anzeigen/ändern',
--bisitz1274199228--