--- loncom/interface/lonconfigsettings.pm 2014/02/12 20:37:42 1.28 +++ loncom/interface/lonconfigsettings.pm 2014/04/23 10:11:26 1.29 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.28 2014/02/12 20:37:42 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.29 2014/04/23 10:11:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -265,7 +265,10 @@ sub display_settings { if (grep(/^\Q$item\E$/,@actions)) { push(@items,$item); if ($context eq 'domain') { - my $settings = $values->{$item}; + my $settings; + if (ref($values) eq 'HASH') { + $settings = $values->{$item}; + } if ($item eq 'usersessions') { $r->print(''."\n"); } elsif ($item eq 'selfcreation') { - $settings = $values->{'usercreation'}; + if (ref($values) eq 'HASH') { + $settings = $values->{'usercreation'}; + } + } elsif ($item eq 'defaults') { + if (ref($values->{'inststatus'}) eq 'HASH') { + if (ref($values->{'defaults'}) eq 'HASH') { + $settings = {%{$values->{'inststatus'}},%{$values->{'defaults'}}}; + } else { + $settings = $values->{'inststatus'}; + } + } else { + my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); + my $inststatus = { + inststatustypes => $usertypes, + inststatusorder => $types, + inststatusguest => [], + }; + if (ref($values->{defaults}) eq 'HASH') { + $settings = {%{$inststatus},%{$values->{'defaults'}}}; + } else { + $settings = $inststatus; + } + } } ($output{$item},$rowtotal{$item}) = &Apache::domainprefs::print_config_box($r,$dom,$confname,