--- loncom/interface/domainprefs.pm 2024/04/14 17:12:27 1.438 +++ loncom/interface/domainprefs.pm 2024/05/01 15:18:58 1.440 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.438 2024/04/14 17:12:27 raeburn Exp $ +# $Id: domainprefs.pm,v 1.440 2024/05/01 15:18:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7523,6 +7523,15 @@ sub print_authordefaults { } $datatable .= ''; $itemcount ++; + my %defchecked = ( + 'archive' => 'off', + ); + my @toggles = ('archive'); + (my $archive,$itemcount) = &radiobutton_prefs($settings,['archive'], + {'archive' => 'off'}, + \%titles,$itemcount); + $datatable .= $archive."\n"; + $itemcount ++; } $$rowtotal += $itemcount; return $datatable; @@ -7546,6 +7555,7 @@ sub authordefaults_titles { none => 'No override set', overon => 'Override -- webDAV on', overoff => 'Override -- webDAV off', + archive => 'Authors can download tar.gz file of Authoring Space', ); } @@ -13425,12 +13435,13 @@ sub modify_authordefaults { 'nocodemirror' => 'off', 'daxecollapse' => 'off', 'domcoordacc' => 'on', - 'editors' => ['edit','xml']. + 'editors' => ['edit','xml'], 'authorquota' => 500, 'webdav' => 0, + 'archive' => 'off', ); my %titles = &authordefaults_titles(); - foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { + foreach my $item ('nocodemirror','daxecollapse','domcoordacc','archive') { if ($env{'form.'.$item} =~ /^(0|1)$/) { $confhash{$item} = $env{'form.'.$item}; } @@ -13474,7 +13485,7 @@ sub modify_authordefaults { $save_quotas{'webdav'}{'_LC_adv'} = $env{'form.webdav_LC_adv'}; } if (ref($domconfig{'authordefaults'}) eq 'HASH') { - foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail') { + foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail','archive') { if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { $changes{$item} = 1; } @@ -13496,7 +13507,7 @@ sub modify_authordefaults { } } else { my @offon = ('off','on'); - foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { + foreach my $item ('nocodemirror','daxecollapse','domcoordacc','archive') { if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { $changes{$item} = 1; } @@ -13506,6 +13517,12 @@ sub modify_authordefaults { $changes{$item} = 1; } } + my @diffs = + &Apache::loncommon::compare_arrays($confhash{'editors'}, + $staticdefaults{'editors'}); + unless (@diffs == 0) { + $changes{'editors'} = 1; + } } foreach my $key ('authorquota','webdav') { if (ref($curr_quotas{$key}) eq 'HASH') { @@ -13587,7 +13604,7 @@ sub modify_authordefaults { $resulttext .= ''; } my $domcoordoverride; - foreach my $key ('editors','authorquota','webdav','webdav_LC_adv') { + foreach my $key ('editors','authorquota','webdav','webdav_LC_adv','archive') { if (exists($changes{$key})) { my $shown; unless ($domcoordoverride) { @@ -13619,6 +13636,8 @@ sub modify_authordefaults { } else { $shown = $titles{'none'}; } + } elsif ($key eq 'archive') { + $shown = ($confhash{$key} ? &mt('Yes') : &mt('No')); } $resulttext .= '
  • '.&mt('[_1] set to: [_2]',$titles{$key},$shown).'
  • '; } @@ -13626,6 +13645,7 @@ sub modify_authordefaults { if ($domcoordoverride) { $resulttext .= ''; } + $resulttext .= ''; my $cachetime = 24*60*60; &Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); if (ref($lastactref) eq 'HASH') {