--- loncom/interface/lonconfigsettings.pm 2022/03/12 23:11:47 1.21.4.13.2.5 +++ loncom/interface/lonconfigsettings.pm 2024/07/06 17:30:45 1.21.4.16 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.21.4.13.2.5 2022/03/12 23:11:47 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.21.4.16 2024/07/06 17:30:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,9 +39,9 @@ use Apache::courseclassifier(); use LONCAPA qw(:DEFAULT :match); sub print_header { - my ($r,$phase,$context,$jscript,$container,$instcode,$dom,$confname,$values) = @_; + my ($r,$phase,$context,$jscript,$container,$instcode,$dom) = @_; my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check, - $linkprot_check,$crstype,@actions,@code_order); + $crstype,@actions,@code_order); if ($phase eq 'display') { @actions = &Apache::loncommon::get_env_multiple('form.actions'); } @@ -115,113 +115,6 @@ sub print_header { ENDSCRIPT } } - if (($context eq 'course') && ($phase eq 'display') && - (grep(/^linkprot$/,@actions))) { - my $allowed; - my $home = &Apache::lonnet::homeserver($confname,$dom); - unless ($home eq 'no_host') { - my @ids=&Apache::lonnet::current_machine_ids(); - foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } - } - if ($allowed) { - my (@changeable,@settable); - if (ref($values->{'linkprot'}) eq 'HASH') { - if (keys(%{$values->{'linkprot'}})) { - my @current = sort { $a <=> $b } keys(%{$values->{'linkprot'}}); - if (@current) { - for (my $i=0; $i<@current; $i++) { - my $num = $current[$i]; - if (ref($values->{'linkprot'}->{$num}) eq 'HASH') { - if ($values->{'linkprot'}->{$num}->{'usable'}) { - push(@changeable,$i); - } else { - push(@settable,$i); - } - } - } - } - } - } - my ($numrules,$intargjs); -$linkprot_check .= <{'ltitools'}) eq 'HASH') { - my $numltitools = scalar(keys(%{$values->{'ltitools'}})); - for (my $i=0; $i<$numltitools; $i++) { - $onload .= "toggleLTITools(document.display,'user','$i');"; - } - } - } - } if (grep(/^wafproxy$/,@actions)) { $onload .= "toggleWAF();checkWAF();updateWAF();"; } @@ -370,43 +245,8 @@ $jscript $onload = "courseSet('','load');toggleCloners(document.display.cloners_instcode);"; } } - if (grep(/^linkprot$/,@actions)) { - if (ref($values) eq 'HASH') { - if (ref($values->{'linkprot'}) eq 'HASH') { - my $ltiauth; - if (exists($env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'})) { - $ltiauth = $env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'}; - } else { - my %domdefs = &Apache::lonnet::get_domain_defaults($dom); - $ltiauth = $domdefs{'crsltiauth'}; - } - my $ishome; - my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; - unless (($chome eq 'no_host') || ($chome eq '')) { - my @ids=&Apache::lonnet::current_machine_ids(); - foreach my $id (@ids) { if ($id eq $chome) { $ishome=1; } } - } - my $posslti = scalar(keys(%{$values->{'linkprot'}})); - for (my $i=0; $i<=$posslti; $i++) { - my $num = $i; - if ($i == $posslti) { - $num = 'add'; - } - if (ref($values->{'linkprot'}->{$i}) eq 'HASH') { - if ($values->{'linkprot'}->{$i}->{'usable'}) { - $onload .= "toggleLinkProt(document.display,'$num','secret');"; - } - } - if ($ltiauth) { - $onload .= "toggleLinkProtReqUser(document.display,'requser','optional','1','block','$num');". - "toggleLinkProtReqUser(document.display,'mapuser','userfield','other','inline-block','$num');"; - } - if ($ishome) { - $onload .= "uncheckLinkProtMakeVis('visible','$num');"; - } - } - } - } + if (grep(/^grading$/,@actions)) { + $onload .= 'toggleGrading(document.display);toggleHiddenTotalsSec(document.display);'; } if ($onload) { my %loaditems = ( @@ -561,7 +401,7 @@ sub display_settings { if (ref($values) eq 'HASH') { $instcode = $values->{'internal.coursecode'}; } - &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom,$confname,$values); + &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom); my $divwidth = 900; if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { if (@actions > 0) { @@ -605,10 +445,6 @@ sub display_settings { $settings = $inststatus; } } - } elsif ($item eq 'lti') { - if (ref($values->{'ltisec'}) eq 'HASH') { - $settings = $values->{'ltisec'}; - } } ($output{$item},$rowtotal{$item}) = &Apache::domainprefs::print_config_box($r,$dom,$confname,