--- loncom/interface/domainprefs.pm 2024/04/17 01:02:47 1.439 +++ loncom/interface/domainprefs.pm 2024/12/31 19:28:29 1.447 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.439 2024/04/17 01:02:47 raeburn Exp $ +# $Id: domainprefs.pm,v 1.447 2024/12/31 19:28:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -472,6 +472,8 @@ sub handler { header => [{col1 => 'Target user has role', col2 => 'User information updatable in author context'}, {col1 => 'Target user has role', + col2 => 'User information updatable by co-author manager'}, + {col1 => 'Target user has role', col2 => 'User information updatable in course context'}], print => \&print_usermodification, modify => \&modify_usermodification, @@ -1031,7 +1033,7 @@ sub print_config_box { ($action eq 'usersessions') || ($action eq 'coursecategories') || ($action eq 'trust') || ($action eq 'contacts') || ($action eq 'defaults') || ($action eq 'privacy') || ($action eq 'passwords') || ($action eq 'lti') || - ($action eq 'ltitools')) { + ($action eq 'ltitools') || ($action eq 'usermodification')) { if ($action eq 'coursecategories') { $output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal); $colspan = ' colspan="2"'; @@ -1135,9 +1137,9 @@ sub print_config_box { } } $rowtotal ++; - } elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') || + } elsif (($action eq 'coursedefaults') || ($action eq 'authordefaults') || ($action eq 'directorysrch') || ($action eq 'helpsettings') || - ($action eq 'wafproxy') || ($action eq 'authordefaults')) { + ($action eq 'wafproxy')) { $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); } elsif ($action eq 'scantron') { $output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal); @@ -2007,10 +2009,11 @@ sub commblocktype_text { 'passwd' => 'Change Password', 'grades' => 'Gradebook', 'search' => 'Course search', + 'index' => 'Course content index', 'wishlist' => 'Stored links', 'annotate' => 'Annotations', ); - my $typeorder = ['com','chat','boards','port','groups','blogs','about','wishlist','printout','grades','search','annotate','passwd']; + my $typeorder = ['com','chat','boards','port','groups','blogs','about','wishlist','printout','grades','search','index','annotate','passwd']; return ($typeorder,\%types); } @@ -2019,7 +2022,7 @@ sub print_rolecolors { my %choices = &color_font_choices(); my @bgs = ('pgbg','tabbg','sidebg'); my @links = ('link','alink','vlink'); - my @images = ('img'); + my @images = (); my %alt_text = &Apache::lonlocal::texthash(img => "Banner for $role role"); my %designhash = &Apache::loncommon::get_domainconf($dom); my %defaultdesign = %Apache::loncommon::defaultdesign; @@ -2027,10 +2030,6 @@ sub print_rolecolors { my %defaults = &role_defaults($role,\@bgs,\@links,\@images); if (ref($settings) eq 'HASH') { if (ref($settings->{$role}) eq 'HASH') { - if ($settings->{$role}->{'img'} ne '') { - $designs{'img'} = $settings->{$role}->{'img'}; - $is_custom{'img'} = 1; - } if ($settings->{$role}->{'font'} ne '') { $designs{'font'} = $settings->{$role}->{'font'}; $is_custom{'font'} = 1; @@ -2053,10 +2052,6 @@ sub print_rolecolors { } } } else { - if ($designhash{$dom.'.'.$role.'.img'} ne '') { - $designs{img} = $designhash{$dom.'.'.$role.'.img'}; - $is_custom{'img'} = 1; - } if ($designhash{$dom.'.'.$role.'.fontmenu'} ne '') { $designs{fontmenu} = $designhash{$dom.'.'.$role.'.fontmenu'}; $is_custom{'fontmenu'} = 1; @@ -2106,7 +2101,6 @@ sub role_defaults { } } else { %defaults = ( - img => $defaultdesign{$role.'.img'}, font => $defaultdesign{$role.'.font'}, fontmenu => $defaultdesign{$role.'.fontmenu'}, ); @@ -7523,6 +7517,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 +7549,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', ); } @@ -10714,6 +10718,15 @@ sub print_usermodification { $$rowtotal ++; $rowcount ++; } + } elsif ($position eq 'middle') { + $rowcount = 0; + $context = 'coauthor'; + foreach my $role ('ca','aa') { + $datatable .= &modifiable_userdata_row($context,$role,$settings, + $numinrow,$rowcount); + $$rowtotal ++; + $rowcount ++; + } } elsif ($position eq 'bottom') { $context = 'course'; $rowcount = 0; @@ -12219,6 +12232,8 @@ sub modifiable_userdata_row { } else { if ($context eq 'lti') { $prefix = 'lti'; + } elsif ($context eq 'coauthor') { + $prefix = 'cacanmodify'; } elsif ($context eq 'privacy') { $prefix = 'privacy'; } @@ -13111,7 +13126,6 @@ sub check_exempt_addresses { sub color_font_choices { my %choices = &Apache::lonlocal::texthash ( - img => "Header", bgs => "Background colors", links => "Link colors", images => "Images", @@ -13166,13 +13180,15 @@ sub modify_ipaccess { foreach my $idx (@items) { my $itemid = $itemids{$idx}; next unless ($itemid); - my %current; - unless ($idx eq 'add') { + my ($position,%current); + if ($idx eq 'add') { + $position = $env{'form.ipaccess_pos_add'}; + } else { + $position = $env{'form.ipaccess_pos_'.$itemid}; if (ref($domconfig{'ipaccess'}{$itemid}) eq 'HASH') { %current = %{$domconfig{'ipaccess'}{$itemid}}; } } - my $position = $env{'form.ipaccess_pos_'.$itemid}; $position =~ s/\D+//g; if ($position ne '') { $allpos[$position] = $itemid; @@ -13428,9 +13444,10 @@ sub modify_authordefaults { '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 +13491,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 +13513,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; } @@ -13593,7 +13610,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) { @@ -13625,6 +13642,9 @@ sub modify_authordefaults { } else { $shown = $titles{'none'}; } + } elsif ($key eq 'archive') { + $domdefaults{$key} = $confhash{$key}; + $shown = ($confhash{$key} ? &mt('Yes') : &mt('No')); } $resulttext .= '