--- loncom/interface/lonconfigsettings.pm 2014/04/23 10:26:37 1.21.4.6 +++ loncom/interface/lonconfigsettings.pm 2012/12/07 16:12:18 1.23 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.21.4.6 2014/04/23 10:26:37 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.23 2012/12/07 16:12:18 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,10 +35,11 @@ use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; +use Apache::lonparmset(); sub print_header { my ($r,$phase,$context,$jscript,$container) = @_; - my ($pagetitle,$brcrumtitle,$action,$call_category_check,$crstype); + my ($pagetitle,$brcrumtitle,$action,$call_category_check); if ($context eq 'domain') { ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings'); $action = '/adm/domainprefs'; @@ -55,8 +56,7 @@ sub print_header { } } } else { - $crstype = &Apache::loncommon::course_type(); - if ($crstype eq 'Community') { + if (&Apache::loncommon::course_type() eq 'Community') { ($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration'); } else { ($pagetitle,$brcrumtitle) = ('Course Configuration','Course Configuration'); @@ -94,11 +94,11 @@ function changePage(formname,newphase) { formname.submit(); }'."\n"; if ($phase eq 'pickactions') { - $js .= &Apache::lonhtmlcommon::color_picker(); + $js .= &Apache::lonhtmlcommon::color_picker(); $js .= &Apache::lonhtmlcommon::set_form_elements({actions => 'checkbox'})."\n"; } elsif ($phase eq 'display') { - $js .= &Apache::lonhtmlcommon::color_picker(); + $js .= &Apache::lonhtmlcommon::color_picker(); $js .= &color_pick_js()."\n"; } $js .= &Apache::loncommon::viewport_size_js().' @@ -129,6 +129,9 @@ $jscript '); + if ($container) { + &Apache::lonparmset::startSettingsScreen($r,$container); + } $r->print('
'); return; @@ -165,6 +168,9 @@ sub print_footer { } if ($phase eq 'process') { $r->print('
'); + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); } return; @@ -181,7 +187,7 @@ sub make_changes { {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Updated"}); &print_header($r,$phase,$context,undef,$container); - my ($crstype,%lastact); + my $crstype; if ($context eq 'course') { $crstype = &Apache::loncommon::course_type(); } @@ -192,7 +198,7 @@ sub make_changes { if ($context eq 'domain') { $r->print('

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

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

'); - return \%lastact; } sub display_settings { @@ -258,44 +263,16 @@ 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},$settings); + $phase,$item,$prefs->{$item},$values->{$item}); } else { ($output{$item},$rowtotal{$item}) = &Apache::courseprefs::print_config_box($r,$dom,$phase,