--- loncom/interface/domainprefs.pm 2009/05/26 20:39:22 1.97 +++ loncom/interface/domainprefs.pm 2009/08/02 07:21:18 1.99 @@ -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.99 2009/08/02 07:21:18 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; } @@ -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 ++; @@ -2518,12 +2524,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 .= ''. '