--- loncom/interface/domainprefs.pm 2024/03/03 02:21:32 1.160.6.118.2.21 +++ loncom/interface/domainprefs.pm 2024/09/01 02:45:08 1.160.6.118.2.25 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.160.6.118.2.21 2024/03/03 02:21:32 raeburn Exp $ +# $Id: domainprefs.pm,v 1.160.6.118.2.25 2024/09/01 02:45:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -457,6 +457,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, @@ -945,7 +947,7 @@ sub print_config_box { ($action eq 'usersessions') || ($action eq 'coursecategories') || ($action eq 'contacts') || ($action eq 'passwords') || ($action eq 'defaults') || ($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"'; @@ -1016,9 +1018,9 @@ sub print_config_box { $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); } $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); @@ -2304,7 +2306,7 @@ sub print_quotas { @options = ('norequest','approval','automatic'); %titles = &authorrequest_titles(); } else { - @usertools = ('aboutme','blog','portfolio','timezone'); + @usertools = ('aboutme','blog','portfolio','portaccess','timezone'); %titles = &tool_titles(); } if (ref($types) eq 'ARRAY') { @@ -6043,6 +6045,7 @@ sub print_coursedefaults { ltiauth => 'Student username in LTI launch of deep-linked URL can be accepted without re-authentication', 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)', + crseditors => 'Available editors for web pages and/or problems created in a course/community', ); my %staticdefaults = ( anonsurvey_threshold => 10, @@ -6052,6 +6055,7 @@ sub print_coursedefaults { mysqltables => 172800, domexttool => 1, exttool => 0, + crseditors => ['edit','xml'], ); if ($position eq 'top') { %defaultchecked = ( @@ -6171,6 +6175,7 @@ sub print_coursedefaults { my $ltiauth = 0; my %domexttool; my %exttool; + my %crseditors; my @types = ('official','unofficial','community','textbook'); if (ref($settings) eq 'HASH') { if ($settings->{'ltiauth'}) { @@ -6196,6 +6201,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'}})) { @@ -6256,6 +6270,9 @@ sub print_coursedefaults { $domexttool{$type} = ' checked="checked"'; } } + foreach my $editor (@{$staticdefaults{'crseditors'}}) { + $crseditors{$editor} = ' checked="checked"'; + } } if (!$currdefresponder) { $currdefresponder = $staticdefaults{'anonsurvey_threshold'}; @@ -6383,9 +6400,9 @@ sub print_coursedefaults { foreach my $type (@types) { $datatable .= ''. ''. - ''. - &mt($type).''."\n"; + &mt($type).''."\n"; } $datatable .= ''."\n"; $itemcount ++; @@ -6398,9 +6415,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"; } @@ -6408,6 +6442,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); @@ -6575,6 +6617,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; @@ -6598,6 +6649,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', ); } @@ -8496,6 +8548,7 @@ sub tool_titles { aboutme => 'Personal web page', blog => 'Blog', portfolio => 'Portfolio', + portaccess => 'Share portfolio files', timezone => 'Can set time zone', official => 'Official courses (with institutional codes)', unofficial => 'Unofficial courses', @@ -9396,6 +9449,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; @@ -10816,6 +10878,8 @@ sub modifiable_userdata_row { } else { if ($context eq 'lti') { $prefix = 'lti'; + } elsif ($context eq 'coauthor') { + $prefix = 'cacanmodify'; } $output .= '