version 1.138.2.1, 2010/08/13 05:45:05
|
version 1.138.2.2, 2010/08/26 08:07:42
|
Line 202 sub handler {
|
Line 202 sub handler {
|
'quotas','autoenroll','autoupdate','autocreate', |
'quotas','autoenroll','autoupdate','autocreate', |
'directorysrch','usercreation','usermodification', |
'directorysrch','usercreation','usermodification', |
'contacts','defaults','scantron','coursecategories', |
'contacts','defaults','scantron','coursecategories', |
'serverstatuses','requestcourses','usersessions'],$dom); |
'serverstatuses','requestcourses','coursedefaults', |
|
'usersessions'],$dom); |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
'autoupdate','autocreate','directorysrch','contacts', |
'autoupdate','autocreate','directorysrch','contacts', |
'usercreation','usermodification','scantron', |
'usercreation','usermodification','scantron', |
'requestcourses','coursecategories','serverstatuses', |
'requestcourses','coursecategories','serverstatuses', |
'usersessions'); |
'coursedefaults','usersessions'); |
my %prefs = ( |
my %prefs = ( |
'rolecolors' => |
'rolecolors' => |
{ text => 'Default color schemes', |
{ text => 'Default color schemes', |
Line 336 sub handler {
|
Line 337 sub handler {
|
{col1 => 'Unauthenticated Help Settings', |
{col1 => 'Unauthenticated Help Settings', |
col2 => ''}], |
col2 => ''}], |
}, |
}, |
'coursedefaults' => |
'coursedefaults' => |
{text => 'Course/Community defaults', |
{text => 'Course/Community defaults', |
help => 'Domain_Configuration_Course_Defaults', |
help => 'Domain_Configuration_Course_Defaults', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Defaults which can be overridden for each course by a DC', |
col2 => 'Value',}], |
col2 => 'Value',}, |
}, |
}, |
'privacy' => |
'privacy' => |
{text => 'User Privacy', |
{text => 'User Privacy', |
Line 454 sub process_changes {
|
Line 455 sub process_changes {
|
$output = &modify_serverstatuses($dom,%domconfig); |
$output = &modify_serverstatuses($dom,%domconfig); |
} elsif ($action eq 'requestcourses') { |
} elsif ($action eq 'requestcourses') { |
$output = &modify_quotas($dom,$action,%domconfig); |
$output = &modify_quotas($dom,$action,%domconfig); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output = &modify_coursedefaults($dom,%domconfig); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
$output = &modify_usersessions($dom,%domconfig); |
$output = &modify_usersessions($dom,%domconfig); |
} |
} |
Line 661 sub print_config_box {
|
Line 664 sub print_config_box {
|
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'serverstatuses') { |
} elsif ($action eq 'serverstatuses') { |
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal); |
} |
} |
} |
} |
$output .= ' |
$output .= ' |
Line 2231 sub radiobutton_prefs {
|
Line 2236 sub radiobutton_prefs {
|
} |
} |
|
|
sub print_coursedefaults { |
sub print_coursedefaults { |
my ($dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($css_class,$datatable); |
my ($css_class,$datatable); |
my $itemcount = 1; |
my $itemcount = 1; |
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles); |
if ($position eq 'top') { |
%choices = |
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles); |
&Apache::lonlocal::texthash ( |
%choices = |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
&Apache::lonlocal::texthash ( |
); |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
%defaultchecked = ('canuse_pdfforms' => 'off'); |
); |
@toggles = ('canuse_pdfforms',); |
%defaultchecked = ('canuse_pdfforms' => 'off'); |
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
@toggles = ('canuse_pdfforms',); |
|
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
\%choices,$itemcount); |
\%choices,$itemcount); |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
|
} else { |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
my %choices = |
|
&Apache::lonlocal::texthash ( |
|
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys', |
|
); |
|
my $currdefresponder; |
|
if (ref($settings) eq 'HASH') { |
|
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
|
} |
|
if (!$currdefresponder) { |
|
$currdefresponder = 10; |
|
} elsif ($currdefresponder < 1) { |
|
$currdefresponder = 1; |
|
} |
|
$datatable .= |
|
'<tr'.$css_class.'><td><span class="LC_nobreak">'.$choices{'anonsurvey_threshold'}. |
|
'</span></td>'. |
|
'<td class="LC_right_item"><span class="LC_nobreak">'. |
|
'<input type="text" name="anonsurvey_threshold"'. |
|
' value="'.$currdefresponder.'" size="5" /></span>'. |
|
'</td></tr>'; |
|
} |
return $datatable; |
return $datatable; |
} |
} |
|
|
Line 6626 sub modify_coursedefaults {
|
Line 6655 sub modify_coursedefaults {
|
my ($resulttext,$errors,%changes,%defaultshash); |
my ($resulttext,$errors,%changes,%defaultshash); |
my %defaultchecked = ('canuse_pdfforms' => 'off'); |
my %defaultchecked = ('canuse_pdfforms' => 'off'); |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
my @toggles = ('canuse_pdfforms'); |
my @toggles = (); |
|
|
$defaultshash{'coursedefaults'} = {}; |
$defaultshash{'coursedefaults'} = {}; |
|
|
Line 6655 sub modify_coursedefaults {
|
Line 6684 sub modify_coursedefaults {
|
} |
} |
$defaultshash{'coursedefaults'}{$item} = $env{'form.'.$item}; |
$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, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
$dom); |
$dom); |
Line 6674 sub modify_coursedefaults {
|
Line 6715 sub modify_coursedefaults {
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('Course/Community users can create/upload PDF forms set to "off"').'</li>'; |
$resulttext .= '<li>'.&mt('Course/Community users can create/upload PDF forms set to "off"').'</li>'; |
} |
} |
|
} elsif ($item eq 'anonsurvey_threshold') { |
|
$resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>'; |
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |