--- loncom/interface/domainprefs.pm 2014/04/05 23:22:19 1.160.6.37 +++ loncom/interface/domainprefs.pm 2014/03/29 20:25:28 1.230 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.160.6.37 2014/04/05 23:22:19 raeburn Exp $ +# $Id: domainprefs.pm,v 1.230 2014/03/29 20:25:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -164,7 +164,6 @@ use Apache::lonhtmlcommon(); use Apache::lonlocal; use Apache::lonmsg(); use Apache::lonconfigsettings; -use Apache::lonuserutils(); use LONCAPA qw(:DEFAULT :match); use LONCAPA::Enrollment; use LONCAPA::lonauthcgi(); @@ -212,15 +211,15 @@ sub handler { 'quotas','autoenroll','autoupdate','autocreate', 'directorysrch','usercreation','usermodification', 'contacts','defaults','scantron','coursecategories', - 'serverstatuses','requestcourses','coursedefaults', - 'usersessions','loadbalancing',requestauthor', - 'selfenrollment'],$dom); + 'serverstatuses','requestcourses','helpsettings', + 'coursedefaults','usersessions','loadbalancing', + 'requestauthor'],$dom); my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', 'autoupdate','autocreate','directorysrch','contacts', 'usercreation','selfcreation','usermodification','scantron', 'requestcourses','requestauthor','coursecategories', - 'serverstatuses','coursedefaults','selfenrollment', - 'usersessions'); + 'serverstatuses','helpsettings', + 'coursedefaults','usersessions'); my %existing; if (ref($domconfig{'loadbalancing'}) eq 'HASH') { %existing = %{$domconfig{'loadbalancing'}}; @@ -400,7 +399,15 @@ sub handler { print => \&print_serverstatuses, modify => \&modify_serverstatuses, }, - 'coursedefaults' => + 'helpsettings' => + {text => 'Help page settings', + help => 'Domain_Configuration_Help_Settings', + header => [{col1 => 'Help Settings (logged-in users)', + col2 => 'Value'}], + print => \&print_helpsettings, + modify => \&modify_helpsettings, + }, + 'coursedefaults' => {text => 'Course/Community defaults', help => 'Domain_Configuration_Course_Defaults', header => [{col1 => 'Defaults which can be overridden in each course by a CC', @@ -410,17 +417,13 @@ sub handler { print => \&print_coursedefaults, modify => \&modify_coursedefaults, }, - 'selfenrollment' => - {text => 'Self-enrollment in Course/Community', - help => 'Domain_Configuration_Selfenrollment', - header => [{col1 => 'Configuration Rights', - col2 => 'Configured by Course Personnel or Domain Coordinator?'}, - {col1 => 'Defaults', - col2 => 'Value'}, - {col1 => 'Self-enrollment validation (optional)', - col2 => 'Value'},], - print => \&print_selfenrollment, - modify => \&modify_selfenrollment, + 'privacy' => + {text => 'User Privacy', + help => 'Domain_Configuration_User_Privacy', + header => [{col1 => 'Setting', + col2 => 'Value',}], + print => \&print_privacy, + modify => \&modify_privacy, }, 'usersessions' => {text => 'User session hosting/offloading', @@ -606,10 +609,10 @@ sub process_changes { $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); } elsif ($action eq 'requestauthor') { $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); + } elsif ($action eq 'helpsettings') { + $output = &modify_helpsettings($r,$dom,$confname,%domconfig); } elsif ($action eq 'coursedefaults') { $output = &modify_coursedefaults($dom,$lastactref,%domconfig); - } elsif ($action eq 'selfenrollment') { - $output = &modify_selfenrollment($dom,$lastactref,%domconfig) } elsif ($action eq 'usersessions') { $output = &modify_usersessions($dom,$lastactref,%domconfig); } elsif ($action eq 'loadbalancing') { @@ -657,8 +660,8 @@ sub print_config_box { '; $rowtotal ++; if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') || - ($action eq 'usermodification') || ($action eq 'selfenrollment') || - ($action eq 'usersessions')) { + ($action eq 'usermodification') || ($action eq 'coursedefaults') || + ($action eq 'selfenrollment') || ($action eq 'usersessions')) { $output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); } elsif ($action eq 'coursecategories') { $output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal); @@ -2816,191 +2819,6 @@ sub print_coursedefaults { return $datatable; } -sub print_selfenrollment { - my ($position,$dom,$settings,$rowtotal) = @_; - my ($css_class,$datatable); - my $itemcount = 1; - my @types = ('official','unofficial','community','textbook'); - if (($position eq 'top') || ($position eq 'middle')) { - my ($rowsref,$titlesref) = &Apache::lonuserutils::get_selfenroll_titles(); - my %descs = &Apache::lonuserutils::selfenroll_default_descs(); - my @rows; - my $key; - if ($position eq 'top') { - $key = 'admin'; - if (ref($rowsref) eq 'ARRAY') { - @rows = @{$rowsref}; - } - } elsif ($position eq 'middle') { - $key = 'default'; - @rows = ('types','registered','approval','limit'); - } - foreach my $row (@rows) { - if (defined($titlesref->{$row})) { - $itemcount ++; - $css_class = $itemcount%2?' class="LC_odd_row"':''; - $datatable .= '
'.&mt($type).' | '; - } - } - unless (($row eq 'registered') && ($key eq 'default')) { - $datatable .= '
---|
';
- if ($position eq 'top') {
- my %checked;
- if ($current{$type} eq '0') {
- $checked{'0'} = ' checked="checked"';
- } else {
- $checked{'1'} = ' checked="checked"';
- }
- foreach my $role ('1','0') {
- $datatable .= ' ';
- }
- } else {
- if ($row eq 'types') {
- my %checked;
- if ($current{$type} =~ /^(all|dom)$/) {
- $checked{$1} = ' checked="checked"';
- } else {
- $checked{''} = ' checked="checked"';
- }
- foreach my $val ('','dom','all') {
- $datatable .= ' ';
- }
- } elsif ($row eq 'registered') {
- my %checked;
- if ($current{$type} eq '1') {
- $checked{'1'} = ' checked="checked"';
- } else {
- $checked{'0'} = ' checked="checked"';
- }
- foreach my $val ('0','1') {
- $datatable .= ' ';
- }
- } elsif ($row eq 'approval') {
- my %checked;
- if ($current{$type} =~ /^([12])$/) {
- $checked{$1} = ' checked="checked"';
- } else {
- $checked{'0'} = ' checked="checked"';
- }
- for my $val (0..2) {
- $datatable .= ' ';
- }
- } elsif ($row eq 'limit') {
- my %checked;
- if ($current{$type} =~ /^(allstudents|selfenrolled)$/) {
- $checked{$1} = ' checked="checked"';
- } else {
- $checked{'none'} = ' checked="checked"';
- }
- my $cap;
- if ($currentcap{$type} =~ /^\d+$/) {
- $cap = $currentcap{$type};
- }
- foreach my $val ('none','allstudents','selfenrolled') {
- $datatable .= ' ';
- }
- $datatable .= ' '. - ''.&mt('Maximum allowed: '). - ''. - ''; - } - } - $datatable .= ' | ';
- }
- $datatable .= '
'.$changes{$key}{$item}.'').'