--- loncom/interface/lonconfigsettings.pm 2015/05/22 16:52:16 1.21.4.7 +++ loncom/interface/lonconfigsettings.pm 2016/07/25 19:50:30 1.32 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.21.4.7 2015/05/22 16:52:16 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.32 2016/07/25 19:50:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,8 +35,9 @@ use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; +use Apache::lonparmset(); use Apache::courseclassifier(); -use LONCAPA qw(:DEFAULT :match); +use LONCAPA qw(:DEFAULT :match); sub print_header { my ($r,$phase,$context,$jscript,$container) = @_; @@ -74,6 +75,7 @@ sub print_header { \@code_order); if (@code_order) { my $noinstcodestr = &mt('You indicated cloning based on category, but did not select any categories.'); + &js_escape(\$noinstcodestr); $instcode_check = <<"ENDSCRIPT"; if (formname == document.display) { if (formname.cloners_instcode.length) { @@ -90,7 +92,7 @@ sub print_header { var gotcode = 0; for (var i=0; i '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().' @@ -184,7 +187,7 @@ $jscript } } elsif ($context eq 'course') { if (grep(/^courseinfo$/,@actions)) { - if (@code_order) { + if (@code_order) { $additem = { add_entries => {'onload' => "courseSet('','load');toggleCloners(document.display.cloners_instcode);"}, }; @@ -201,6 +204,9 @@ $jscript '); + if ($container) { + &Apache::lonparmset::startSettingsScreen($r,$container,$crstype); + } $r->print('
'); return; @@ -237,6 +243,9 @@ sub print_footer { } if ($phase eq 'process') { $r->print('
'); + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); } return; @@ -329,21 +338,24 @@ sub display_settings { if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { if (@actions > 0) { my $rowsum = 0; - my (%output,%rowtotal,@items); + my (%output,%rowtotal,@items,$got_check_uncheck); foreach my $item (@{$prefs_order}) { if (grep(/^\Q$item\E$/,@actions)) { push(@items,$item); if ($context eq 'domain') { my $settings; - if (ref($values) eq 'HASH') { + if (ref($values) eq 'HASH') { $settings = $values->{$item}; } - if ($item eq 'usersessions') { - $r->print(''."\n"); + if (($item eq 'usersessions') || ($item eq 'ssl')) { + unless ($got_check_uncheck) { + $r->print(''."\n"); + $got_check_uncheck = 1; + } } elsif ($item eq 'selfcreation') { if (ref($values) eq 'HASH') { $settings = $values->{'usercreation'}; @@ -360,7 +372,7 @@ sub display_settings { my $inststatus = { inststatustypes => $usertypes, inststatusorder => $types, - inststatusguest => [], + inststatusguest => [], }; if (ref($values->{defaults}) eq 'HASH') { $settings = {%{$inststatus},%{$values->{'defaults'}}}; @@ -393,6 +405,9 @@ sub display_settings { } $r->print(''); } + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); return; } @@ -449,6 +464,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; }