--- loncom/interface/domainprefs.pm 2024/02/24 23:41:44 1.434 +++ 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.434 2024/02/24 23:41:44 raeburn Exp $ +# $Id: domainprefs.pm,v 1.447 2024/12/31 19:28:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -386,7 +386,7 @@ sub handler { help => 'Domain_Configuration_Quotas', header => [{col1 => 'User affiliation', col2 => 'Available tools', - col3 => 'Portfilo quota (MB)',}], + col3 => 'Portfolio quota (MB)',}], print => \&print_quotas, modify => \&modify_quotas, }, @@ -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, @@ -670,7 +672,7 @@ sub handler { {col1 => 'Rules for shared secrets', col2 => 'Settings'}, {col1 => 'Link Protectors in Courses', - col2 => 'Values'}, + col2 => 'Values'}, {col1 => 'Link Protectors', col2 => 'Settings'}, {col1 => 'Consumers', @@ -686,7 +688,7 @@ sub handler { print => \&print_ipaccess, modify => \&modify_ipaccess, }, - 'authordefaults' => + 'authordefaults' => {text => 'Authoring Space defaults', help => 'Domain_Configuration_Author_Defaults', header => [{col1 => 'Defaults which can be overridden by Author', @@ -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'}, ); @@ -6917,6 +6911,7 @@ sub print_coursedefaults { domexttool => 'External Tools defined in the domain may be used in courses/communities (by type)', exttool => 'External Tools can be defined and configured in courses/communities (by type)', crsauthor => 'Standard LON-CAPA problems can be created within a course/community (by type)', + crseditors => 'Available editors for web pages and/or problems created in a course/community', ); my %staticdefaults = ( anonsurvey_threshold => 10, @@ -6927,6 +6922,7 @@ sub print_coursedefaults { domexttool => 1, exttool => 0, crsauthor => 1, + crseditors => ['edit','xml'], ); if ($position eq 'top') { %defaultchecked = ( @@ -7048,6 +7044,7 @@ sub print_coursedefaults { my %domexttool; my %exttool; my %crsauthor; + my %crseditors; my @types = ('official','unofficial','community','textbook','placement'); if (ref($settings) eq 'HASH') { if ($settings->{'ltiauth'}) { @@ -7086,6 +7083,15 @@ sub print_coursedefaults { } } } + if (ref($settings->{'crseditors'}) eq 'ARRAY') { + foreach my $editor (@{$settings->{'crseditors'}}) { + $crseditors{$editor} = ' checked="checked"'; + } + } else { + foreach my $editor (@{$staticdefaults{'crseditors'}}) { + $crseditors{$editor} = ' checked="checked"'; + } + } $currdefresponder = $settings->{'anonsurvey_threshold'}; if (ref($settings->{'uploadquota'}) eq 'HASH') { foreach my $type (keys(%{$settings->{'uploadquota'}})) { @@ -7149,6 +7155,9 @@ sub print_coursedefaults { $crsauthor{$type} = ' checked="checked"'; } } + foreach my $editor (@{$staticdefaults{'crseditors'}}) { + $crseditors{$editor} = ' checked="checked"'; + } } if (!$currdefresponder) { $currdefresponder = $staticdefaults{'anonsurvey_threshold'}; @@ -7276,9 +7285,9 @@ sub print_coursedefaults { foreach my $type (@types) { $datatable .= ''. ''. - ''. - &mt($type).''."\n"; + &mt($type).''."\n"; } $datatable .= ''."\n"; $itemcount ++; @@ -7291,9 +7300,9 @@ sub print_coursedefaults { foreach my $type (@types) { $datatable .= ''. ''. - ''. - &mt($type).''."\n"; + &mt($type).''."\n"; } $datatable .= ''."\n"; $itemcount ++; @@ -7306,9 +7315,26 @@ sub print_coursedefaults { foreach my $type (@types) { $datatable .= ''. ''. - ''. - &mt($type).''."\n"; + &mt($type).''."\n"; + } + $datatable .= ''."\n"; + $itemcount ++; + $css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; + $datatable .= ''. + $choices{'crseditors'}. + ''. + ''. + ''; + my @editors = ('edit','xml','daxe'); + my %editornames = &crseditor_titles(); + foreach my $editor (@editors) { + $datatable .= ''."\n"; } $datatable .= '
'. + ''. + '
'."\n"; } @@ -7316,6 +7342,14 @@ sub print_coursedefaults { return $datatable; } +sub crseditor_titles { + return &Apache::lonlocal::texthash( + edit => 'Standard editor (Edit)', + xml => 'Text editor (EditXML)', + daxe => 'Daxe editor (Daxe)', + ); +} + sub print_authordefaults { my ($position,$dom,$settings,$rowtotal) = @_; my ($css_class,$datatable,%checkedon,%checkedoff); @@ -7324,9 +7358,10 @@ sub print_authordefaults { if ($position eq 'top') { my %defaultchecked = ( 'nocodemirror' => 'off', + 'daxecollapse' => 'off', 'domcoordacc' => 'on', ); - my @toggles = ('nocodemirror','domcoordacc'); + my @toggles = ('nocodemirror','daxecollapse','domcoordacc'); ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, \%titles,$itemcount); my %staticdefaults = ( @@ -7445,7 +7480,7 @@ sub print_authordefaults { my $checkedno = ' checked="checked"'; my ($checkedon,$checkedoff); if (ref($quotas{'webdav'}) eq 'HASH') { - if ($quotas{'webdav'}{'_LC_adv'} =~ /^0|1$/) { + if ($quotas{'webdav'}{'_LC_adv'} =~ /^0|1$/) { if ($quotas{'webdav'}{'_LC_adv'}) { $checkedon = $checkedno; } else { @@ -7474,7 +7509,7 @@ sub print_authordefaults { $text = $titles{'overon'}; $val = 1; $checked = $checkedon; - } + } $datatable .= '