[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm
raeburn
raeburn@source.lon-capa.org
Tue, 05 Oct 2010 18:42:45 -0000
raeburn Tue Oct 5 18:42:45 2010 EDT
Modified files:
/loncom/interface domainprefs.pm
Log:
- Special message in domain configuration display
for "Hosting of users from other domains" where the cluster has only
one institution (e.g., standalone cluster).
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.139 loncom/interface/domainprefs.pm:1.140
--- loncom/interface/domainprefs.pm:1.139 Tue Aug 24 13:37:50 2010
+++ loncom/interface/domainprefs.pm Tue Oct 5 18:42:45 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.139 2010/08/24 13:37:50 raeburn Exp $
+# $Id: domainprefs.pm,v 1.140 2010/10/05 18:42:45 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2287,9 +2287,17 @@
sub print_usersessions {
my ($position,$dom,$settings,$rowtotal) = @_;
my ($css_class,$datatable,%checked,%choices);
+ my (%by_ip,%by_location,@intdoms);
+ &build_location_hashes(\@intdoms,\%by_ip,\%by_location);
+ if (keys(%by_location) == 0) {
+ if ($position eq 'top') {
+ $datatable .= '<tr'.$css_class.'><td colspan="2">'.
+ &mt('Nothing to set here, as the cluster to which this domain belongs only contains this institution.');
+ }
+ }
my %lt = &usersession_titles();
my $itemcount = 1;
- my $numinrow = 6;
+ my $numinrow = 5;
my $prefix;
my @types;
if ($position eq 'top') {
@@ -2301,8 +2309,6 @@
}
my (%current,%checkedon,%checkedoff);
my @lcversions = &Apache::lonnet::all_loncaparevs();
- my (%by_ip,%by_location,@intdoms);
- &build_location_hashes(\@intdoms,\%by_ip,\%by_location);
my @locations = sort(keys(%by_location));
foreach my $type (@types) {
$checkedon{$type} = '';
@@ -2325,6 +2331,7 @@
}
}
foreach my $type (@types) {
+ next if ($type ne 'version' && !@locations);
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
$datatable .= '<tr'.$css_class.'>
<td><span class="LC_nobreak">'.$lt{$type}.'</span><br />
@@ -6725,7 +6732,7 @@
}
} elsif ($item eq 'anonsurvey_threshold') {
$resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>';
- }
+ }
}
$resulttext .= '</ul>';
} else {