--- loncom/interface/lonconfigsettings.pm 2020/04/09 20:34:29 1.21.4.9.6.1 +++ loncom/interface/lonconfigsettings.pm 2016/10/11 22:58:55 1.33 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.21.4.9.6.1 2020/04/09 20:34:29 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.33 2016/10/11 22:58:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,11 +35,12 @@ 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,$instcode,$dom,$values) = @_; + my ($r,$phase,$context,$jscript,$container) = @_; my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check, $crstype,@actions,@code_order); if ($phase eq 'display') { @@ -91,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,20 +185,9 @@ $jscript ); $additem = {'add_entries' => \%loaditems,}; } - if (grep(/^ltitools$/,@actions)) { - $onload .= "toggleLTITools(document.display,'user','add');"; - if (ref($values) eq 'HASH') { - if (ref($values->{'ltitools'}) eq 'HASH') { - my $numltitools = scalar(keys(%{$values->{'ltitools'}})); - for (my $i=0; $i<$numltitools; $i++) { - $onload .= "toggleLTITools(document.display,'user','$i');"; - } - } - } - } } 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);"}, }; @@ -214,6 +204,9 @@ $jscript '); + if ($container) { + &Apache::lonparmset::startSettingsScreen($r,$container,$crstype); + } $r->print('
'); return; @@ -254,10 +247,13 @@ sub print_footer { if ($showbutton) { $r->print('

'); - } + } } if ($phase eq 'process') { $r->print('
'); + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); } return; @@ -346,26 +342,29 @@ sub display_settings { if (ref($values) eq 'HASH') { $instcode = $values->{'internal.coursecode'}; } - &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom,$values); + &print_header($r,$phase,$context,$jscript,$container,$instcode); my $divwidth = 900; 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'}; @@ -382,7 +381,7 @@ sub display_settings { my $inststatus = { inststatustypes => $usertypes, inststatusorder => $types, - inststatusguest => [], + inststatusguest => [], }; if (ref($values->{defaults}) eq 'HASH') { $settings = {%{$inststatus},%{$values->{'defaults'}}}; @@ -415,6 +414,9 @@ sub display_settings { } $r->print(''); } + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); return; } @@ -477,6 +479,9 @@ sub display_choices { } $r->print(&print_footer($r,$phase,'display','Display',undef,$container,$parm_permission)); $r->print(''); + if ($container) { + &Apache::lonparmset::endSettingsScreen($r); + } $r->print(&Apache::loncommon::end_page()); return; }