--- loncom/interface/domainprefs.pm 2010/12/05 21:56:38 1.123.2.3
+++ loncom/interface/domainprefs.pm 2010/01/02 20:26:10 1.124
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.123.2.3 2010/12/05 21:56:38 raeburn Exp $
+# $Id: domainprefs.pm,v 1.124 2010/01/02 20:26:10 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -328,10 +328,10 @@ sub handler {
{col1 => 'Unauthenticated Help Settings',
col2 => ''}],
},
- 'coursedefaults' =>
+ 'coursedefaults' =>
{text => 'Course/Community defaults',
help => 'Domain_Configuration_Course_Defaults',
- header => [{col1 => 'Defaults which can be overridden for each course by a DC',
+ header => [{col1 => 'Setting',
col2 => 'Value',}],
},
'privacy' =>
@@ -2092,27 +2092,14 @@ sub print_coursedefaults {
my ($css_class,$datatable);
my $itemcount = 1;
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles);
- $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- my %choices =
+ %choices =
&Apache::lonlocal::texthash (
- anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys',
+ canuse_pdfforms => 'Course/Community users can create/upload PDF forms',
);
- my $currdefresponder;
- if (ref($settings) eq 'HASH') {
- $currdefresponder = $settings->{'anonsurvey_threshold'};
- }
- if (!$currdefresponder) {
- $currdefresponder = 10;
- } elsif ($currdefresponder < 1) {
- $currdefresponder = 1;
- }
- $datatable .=
- '
'.$choices{'anonsurvey_threshold'}.
- ' | '.
- ''.
- ''.
- ' |
';
+ %defaultchecked = ('canuse_pdfforms' => 'off');
+ @toggles = ('canuse_pdfforms',);
+ ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
+ \%choices,$itemcount);
$$rowtotal += $itemcount;
return $datatable;
}
@@ -5437,15 +5424,6 @@ sub modify_defaults {
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def');
my @authtypes = ('internal','krb4','krb5','localauth');
- my @doms = &Apache::lonnet::current_machine_domains();
- my @langs;
- foreach my $dom (@doms) {
- if ($dom =~ /^(\w+c)itest$/) {
- push (@langs,$1.'t');
- } else {
- push(@langs,$dom);
- }
- }
foreach my $item (@items) {
$newvalues{$item} = $env{'form.'.$item};
if ($item eq 'auth_def') {
@@ -5458,8 +5436,7 @@ sub modify_defaults {
if ($newvalues{$item} ne '') {
if ($newvalues{$item} =~ /^(\w+)/) {
my $langcode = $1;
- if ((!grep(/^\Q$langcode\E,@langs)) &&
- ($langcode ne 'x_chef')) {
+ if ($langcode ne 'x_chef') {
if (code2language($langcode) eq '') {
push(@errors,$item);
}
@@ -5647,15 +5624,13 @@ sub modify_coursecategories {
} else {
$changes{'togglecats'} = 1;
$changes{'categorize'} = 1;
- $domconfig{'coursecategories'} = {
- togglecats => $env{'form.togglecats'},
- categorize => $env{'form.categorize'},
- };
$changes{'togglecatscomm'} = 1;
$changes{'categorizecomm'} = 1;
$domconfig{'coursecategories'} = {
- togglecats => $env{'form.togglecatscomm'},
- categorize => $env{'form.categorizecomm'},
+ togglecats => $env{'form.togglecats'},
+ categorize => $env{'form.categorize'},
+ togglecatscomm => $env{'form.togglecatscomm'},
+ categorizecomm => $env{'form.categorizecomm'},
};
}
if (ref($cathash) eq 'HASH') {
@@ -6129,18 +6104,6 @@ sub modify_coursedefaults {
}
$defaultshash{'coursedefaults'}{$item} = $env{'form.'.$item};
}
- my $currdefresponder = $domconfig{'coursedefaults'}{'anonsurvey_threshold'};
- my $newdefresponder = $env{'form.anonsurvey_threshold'};
- $newdefresponder =~ s/\D//g;
- if ($newdefresponder eq '' || $newdefresponder < 1) {
- $newdefresponder = 1;
- }
- $defaultshash{'coursedefaults'}{'anonsurvey_threshold'} = $newdefresponder;
- if ($currdefresponder ne $newdefresponder) {
- unless ($currdefresponder eq '' && $newdefresponder == 10) {
- $changes{'anonsurvey_threshold'} = 1;
- }
- }
}
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash,
$dom);
@@ -6160,10 +6123,7 @@ sub modify_coursedefaults {
} else {
$resulttext .= ''.&mt('Course/Community users can create/upload PDF forms set to "off"').'';
}
- } elsif ($item eq 'anonsurvey_threshold') {
- $resulttext .= ''.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'';
}
-
}
$resulttext .= '';
} else {