--- loncom/interface/domainprefs.pm 2024/02/27 15:48:01 1.436 +++ loncom/interface/domainprefs.pm 2024/04/14 17:12:27 1.438 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.436 2024/02/27 15:48:01 raeburn Exp $ +# $Id: domainprefs.pm,v 1.438 2024/04/14 17:12:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6917,6 +6917,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 +6928,7 @@ sub print_coursedefaults { domexttool => 1, exttool => 0, crsauthor => 1, + crseditors => ['edit','xml'], ); if ($position eq 'top') { %defaultchecked = ( @@ -7048,6 +7050,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 +7089,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 +7161,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 +7291,9 @@ sub print_coursedefaults { foreach my $type (@types) { $datatable .= ''. ''. - ''. - &mt($type).''."\n"; + &mt($type).''."\n"; } $datatable .= ''."\n"; $itemcount ++; @@ -7291,9 +7306,9 @@ sub print_coursedefaults { foreach my $type (@types) { $datatable .= ''. ''. - ''. - &mt($type).''."\n"; + &mt($type).''."\n"; } $datatable .= ''."\n"; $itemcount ++; @@ -7306,9 +7321,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 +7348,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 +7364,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 = ( @@ -7495,6 +7536,7 @@ sub authordefaults_titles { webdav => 'WebDAV', authorquota => 'Authoring Space quotas (MB)', nocodemirror => 'Deactivate CodeMirror for EditXML editor', + daxecollapse => 'Daxe editor: LON-CAPA standard menus start collapsed', domcoordacc => 'Dom. Coords. can enter Authoring Spaces in domain', edit => 'Standard editor (Edit)', xml => 'Text editor (EditXML)', @@ -13381,13 +13423,14 @@ sub modify_authordefaults { 'copyright' => 'default', 'sourceavail' => 'closed', 'nocodemirror' => 'off', + 'daxecollapse' => 'off', 'domcoordacc' => 'on', 'editors' => ['edit','xml']. 'authorquota' => 500, 'webdav' => 0, ); my %titles = &authordefaults_titles(); - foreach my $item ('nocodemirror','domcoordacc') { + foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { if ($env{'form.'.$item} =~ /^(0|1)$/) { $confhash{$item} = $env{'form.'.$item}; } @@ -13431,7 +13474,7 @@ sub modify_authordefaults { $save_quotas{'webdav'}{'_LC_adv'} = $env{'form.webdav_LC_adv'}; } if (ref($domconfig{'authordefaults'}) eq 'HASH') { - foreach my $item ('nocodemirror','domcoordacc','copyright','sourceavail') { + foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail') { if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { $changes{$item} = 1; } @@ -13453,7 +13496,7 @@ sub modify_authordefaults { } } else { my @offon = ('off','on'); - foreach my $item ('nocodemirror','domcoordacc') { + foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { $changes{$item} = 1; } @@ -13522,7 +13565,7 @@ sub modify_authordefaults { } $resulttext = &mt('Changes made:').'