--- loncom/interface/domainprefs.pm 2009/05/26 20:39:22 1.97
+++ loncom/interface/domainprefs.pm 2009/08/06 15:14:08 1.100
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.97 2009/05/26 20:39:22 tempelho Exp $
+# $Id: domainprefs.pm,v 1.100 2009/08/06 15:14:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1019,7 +1019,7 @@ sub print_quotas {
my $typecount = 0;
my $css_class;
if ($context eq 'requestcourses') {
- @usertools = ('official','unofficial');
+ @usertools = ('official','unofficial','community');
} else {
@usertools = ('aboutme','blog','portfolio');
}
@@ -1117,7 +1117,9 @@ sub print_quotas {
$typecount ++;
$css_class = $typecount%2?' class="LC_odd_row"':'';
$datatable .= '
'.
- ' '.&mt('LON-CAPA Advanced Users').' | '.
+ ''.&mt('LON-CAPA Advanced Users').
+ ' ('.
+ &mt('overrides affiliation').') | '.
' ';
foreach my $item (@usertools) {
my $checked;
@@ -1138,8 +1140,7 @@ sub print_quotas {
'" value="_LC_adv" '.$checked.'/>'.$titles{$item}.
' ';
}
- $datatable .= '('.&mt('overrides affiliation').
- ') |
';
+ $datatable .= '';
$$rowtotal += $typecount;
return $datatable;
}
@@ -1471,6 +1472,7 @@ sub tool_titles {
portfolio => 'Portfolio',
official => 'Official courses (with institutional codes)',
unofficial => 'Unofficial courses',
+ community => 'Communities',
);
return %titles;
}
@@ -1516,7 +1518,7 @@ sub print_usercreation {
$rowcount ++;
}
} elsif ($position eq 'middle') {
- my @creators = ('author','course','selfcreate');
+ my @creators = ('author','course','requestcrs','selfcreate');
my ($rules,$ruleorder) =
&Apache::lonnet::inst_userrules($dom,'username');
my %lt = &usercreation_types();
@@ -1597,7 +1599,11 @@ sub print_usercreation {
&Apache::loncommon::sorted_inst_types($dom);
if (ref($usertypes) eq 'HASH') {
if (keys(%{$usertypes}) > 0) {
- $datatable .= &insttypes_row($settings->{cancreate},$types,$usertypes,
+ my $createsettings;
+ if (ref($settings) eq 'HASH') {
+ $createsettings = $settings->{cancreate};
+ }
+ $datatable .= &insttypes_row($createsettings,$types,$usertypes,
$dom,$numinrow,$othertitle,
'statustocreate');
$$rowtotal ++;
@@ -1715,6 +1721,7 @@ sub usercreation_types {
my %lt = &Apache::lonlocal::texthash (
author => 'When adding a co-author',
course => 'When adding a user to a course',
+ requestcrs => 'When requesting a course',
selfcreate => 'User creates own account',
any => 'Any',
official => 'Institutional only ',
@@ -2518,12 +2525,14 @@ sub insttypes_row {
$output .= '';
}
my $check = ' ';
- if (ref($settings->{$context}) eq 'ARRAY') {
- if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) {
+ if (ref($settings) eq 'HASH') {
+ if (ref($settings->{$context}) eq 'ARRAY') {
+ if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) {
+ $check = ' checked="checked" ';
+ }
+ } elsif ($context eq 'statustocreate') {
$check = ' checked="checked" ';
}
- } elsif ($context eq 'statustocreate') {
- $check = ' checked="checked" ';
}
$output .= ''.
' |