--- loncom/interface/domainprefs.pm 2014/05/09 17:49:47 1.160.6.47
+++ loncom/interface/domainprefs.pm 2014/05/09 15:02:31 1.242
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.47 2014/05/09 17:49:47 raeburn Exp $
+# $Id: domainprefs.pm,v 1.242 2014/05/09 15:02:31 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -213,15 +213,15 @@ sub handler {
'quotas','autoenroll','autoupdate','autocreate',
'directorysrch','usercreation','usermodification',
'contacts','defaults','scantron','coursecategories',
- 'serverstatuses','requestcourses','coursedefaults',
- 'usersessions','loadbalancing','requestauthor',
- 'selfenrollment','inststatus'],$dom);
+ 'serverstatuses','requestcourses','helpsettings',
+ 'coursedefaults','usersessions','loadbalancing',
+ 'requestauthor','selfenrollment','inststatus'],$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','selfenrollment','usersessions');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -409,6 +409,14 @@ sub handler {
print => \&print_serverstatuses,
modify => \&modify_serverstatuses,
},
+ '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',
@@ -431,6 +439,14 @@ sub handler {
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',
help => 'Domain_Configuration_User_Sessions',
@@ -615,6 +631,8 @@ 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') {
@@ -668,7 +686,7 @@ sub print_config_box {
';
$rowtotal ++;
if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') ||
- ($action eq 'usermodification') || ($action eq 'defaults') ||
+ ($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') ||
($action eq 'selfenrollment') || ($action eq 'usersessions')) {
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal);
} elsif ($action eq 'coursecategories') {
@@ -2117,12 +2135,11 @@ sub print_textbookcourses {
my $key = $ordered{$items[$i]};
my %coursehash=&Apache::lonnet::coursedescription($key);
my $coursetitle = $coursehash{'description'};
- my ($subject,$title,$author,$publisher,$image,$imgsrc,$cdom,$cnum);
+ my ($subject,$title,$author,$image,$imgsrc,$cdom,$cnum);
if (ref($bookshash->{$key}) eq 'HASH') {
$subject = $bookshash->{$key}->{'subject'};
$title = $bookshash->{$key}->{'title'};
if ($type eq 'textbooks') {
- $publisher = $bookshash->{$key}->{'publisher'};
$author = $bookshash->{$key}->{'author'};
$image = $bookshash->{$key}->{'image'};
if ($image ne '') {
@@ -2152,8 +2169,6 @@ sub print_textbookcourses {
''.&mt('Title:').' ';
if ($type eq 'textbooks') {
$datatable .= (' 'x2).
- ''.&mt('Publisher:').' '.
- (' 'x2).
''.&mt('Author(s):').' '.
(' 'x2).
''.&mt('Thumbnail:');
@@ -2197,9 +2212,7 @@ sub print_textbookcourses {
''.&mt('Title:').' '."\n".
(' 'x2);
if ($type eq 'textbooks') {
- $datatable .= ''.&mt('Publisher:').' '."\n".
- (' 'x2).
- ''.&mt('Author(s):').' '."\n".
+ $datatable .= ''.&mt('Author(s):').' '."\n".
(' 'x2).
''.&mt('Image:').' ';
if ($switchserver) {
@@ -6955,9 +6968,8 @@ sub modify_quotas {
} else {
my $newpos = $env{'form.'.$itemid};
$newpos =~ s/\D+//g;
- foreach my $item ('subject','title','publisher','author') {
- next if ((($item eq 'author') || ($item eq 'publisher')) &&
- ($type eq 'templates'));
+ foreach my $item ('subject','title','author') {
+ next if (($item eq 'author') && ($type eq 'templates'));
$confhash{$type}{$key}{$item} = $env{'form.'.$type.'_'.$item.'_'.$i};
if ($domconfig{$action}{$type}{$key}{$item} ne $confhash{$type}{$key}{$item}) {
$changes{$type}{$key} = 1;
@@ -7002,9 +7014,8 @@ sub modify_quotas {
foreach my $type ('textbooks','templates') {
if ($newbook{$type}) {
$changes{$type}{$newbook{$type}} = 1;
- foreach my $item ('subject','title','publisher','author') {
- next if ((($item eq 'author') || ($item eq 'publisher')) &&
- ($type eq 'template'));
+ foreach my $item ('subject','title','author') {
+ next if (($item eq 'author') && ($type eq 'template'));
$env{'form.'.$type.'_addbook_'.$item} =~ s/(`)/'/g;
if ($env{'form.'.$type.'_addbook_'.$item}) {
$confhash{$type}{$newbook{$type}}{$item} = $env{'form.'.$type.'_addbook_'.$item};
@@ -7418,9 +7429,8 @@ sub modify_quotas {
my $coursetitle = $coursehash{'description'};
my $position = $confhash{$type}{$key}{'order'} + 1;
$resulttext .= '';
- foreach my $item ('subject','title','publisher','author') {
- next if ((($item eq 'author') || ($item eq 'publisher')) &&
- ($type eq 'templates'));
+ foreach my $item ('subject','title','author') {
+ next if (($item eq 'author') && ($type eq 'templates'));
my $name = $item.':';
$name =~ s/^(\w)/\U$1/;
$resulttext .= &mt($name).' '.$confhash{$type}{$key}{$item}.'
';