--- loncom/interface/lonconfigsettings.pm 2013/04/08 23:21:15 1.24 +++ 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.24 2013/04/08 23:21:15 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.29 2014/04/23 10:11:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -188,7 +188,7 @@ sub make_changes { {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Updated"}); &print_header($r,$phase,$context,undef,$container); - my $crstype; + my ($crstype,%lastact); if ($context eq 'course') { $crstype = &Apache::loncommon::course_type(); } @@ -199,7 +199,7 @@ sub make_changes { if ($context eq 'domain') { $r->print('

'.&mt($prefs->{$item}{'text'}).'

'. &Apache::domainprefs::process_changes($r,$dom, - $confname,$item,$roles,$values)); + $confname,$item,$roles,$values,\%lastact)); } else { $changes{$item} = {}; &Apache::courseprefs::process_changes($dom,$item,$values, @@ -244,6 +244,7 @@ sub make_changes { } &print_footer($r,$phase,'display',$footer_text,\@actions,$container); $r->print('

'); + return \%lastact; } sub display_settings { @@ -264,16 +265,44 @@ sub display_settings { if (grep(/^\Q$item\E$/,@actions)) { push(@items,$item); if ($context eq 'domain') { + my $settings; + if (ref($values) eq 'HASH') { + $settings = $values->{$item}; + } if ($item eq 'usersessions') { $r->print(''."\n"); + } elsif ($item eq 'selfcreation') { + 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, - $phase,$item,$prefs->{$item},$values->{$item}); + $phase,$item,$prefs->{$item},$settings); } else { ($output{$item},$rowtotal{$item}) = &Apache::courseprefs::print_config_box($r,$dom,$phase, @@ -295,6 +324,9 @@ sub display_settings { } $r->print(''); } + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); return; } @@ -351,6 +383,9 @@ sub display_choices { } $r->print(&print_footer($r,$phase,'display','Display',undef,$container)); $r->print(''); + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); return; }