--- loncom/interface/domainprefs.pm 2007/12/16 17:45:20 1.35 +++ loncom/interface/domainprefs.pm 2008/01/01 18:48:17 1.38 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.35 2007/12/16 17:45:20 raeburn Exp $ +# $Id: domainprefs.pm,v 1.38 2008/01/01 18:48:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -281,11 +281,24 @@ sub handler { ' />  '. '

'); + ' />

'); + my ($numitems,$midpoint,$seconddiv,$count); + $numitems = @prefs_order; + $midpoint = int($numitems/2); + if ($numitems%2) { + $midpoint ++; + } + $count = 0; foreach my $item (@prefs_order) { - $r->print('

'); + $r->print('

'); + $count ++; + if ((!$seconddiv) && ($count >= $midpoint)) { + $r->print('
'."\n".'
'."\n"); + $seconddiv = 1; + } } - $r->print('

'.&mt('Display options').'

'."\n". + $r->print('

'. + &mt('Display options').'

'."\n". '

'.&mt('Display using: ')."\n". '  '. @@ -1333,6 +1346,8 @@ sub print_usercreation { } } elsif ($position eq 'middle') { my @creators = ('author','course'); + my ($rules,$ruleorder) = + &Apache::lonnet::inst_userrules($dom,'username'); my %lt = &usercreation_types(); my %checked; if (ref($settings) eq 'HASH') { @@ -1363,7 +1378,14 @@ sub print_usercreation { $datatable .= ''. ''.$lt{$item}. ''; - foreach my $option ('any','official','unofficial','none') { + my @options = ('any'); + if (ref($rules) eq 'HASH') { + if (keys(%{$rules}) > 0) { + push(@options,('official','unofficial')); + } + } + push(@options,'none'); + foreach my $option (@options) { my $check = ' '; if ($checked{$item} eq $option) { $check = ' checked="checked" '; @@ -1393,7 +1415,7 @@ sub print_usercreation { } } else { foreach my $item (@contexts) { - foreach my $type (@authtypes) { + foreach my $auth (@authtypes) { $checked{$item}{$auth} = ' checked="checked" '; } } @@ -2109,7 +2131,7 @@ sub check_configuser { sub check_authorstatus { my ($dom,$confname,%currroles) = @_; my $author_ok; - if (!$currroles{':'.$dom.':au'}) { + if (!$currroles{$confname.':'.$dom.':au'}) { my $start = time; my $end = 0; $author_ok =