--- loncom/interface/domainprefs.pm 2016/09/18 19:22:48 1.160.6.71
+++ loncom/interface/domainprefs.pm 2014/05/31 04:00:02 1.247
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.71 2016/09/18 19:22:48 raeburn Exp $
+# $Id: domainprefs.pm,v 1.247 2014/05/31 04:00:02 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'}};
@@ -250,8 +250,6 @@ sub handler {
header => [{col1 => 'Log-in Page Items',
col2 => '',},
{col1 => 'Log-in Help',
- col2 => 'Value'},
- {col1 => 'Custom HTML in document head',
col2 => 'Value'}],
print => \&print_login,
modify => \&modify_login,
@@ -411,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',
@@ -433,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',
@@ -465,8 +479,6 @@ sub handler {
{col1 => 'Log-in Page Items',
col2 => ''},
{col1 => 'Log-in Help',
- col2 => 'Value'},
- {col1 => 'Custom HTML in document head',
col2 => 'Value'}],
print => \&print_login,
modify => \&modify_login,
@@ -619,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') {
@@ -656,7 +670,7 @@ sub print_config_box {
my $colspan = '';
my $rightcolspan = '';
if (($action eq 'rolecolors') || ($action eq 'defaults') ||
- (($action eq 'login') && ($numheaders < 4))) {
+ (($action eq 'login') && ($numheaders < 3))) {
$colspan = ' colspan="2"';
}
if ($action eq 'usersessions') {
@@ -678,7 +692,7 @@ sub print_config_box {
} elsif ($action eq 'coursecategories') {
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 4) {
+ if ($numheaders == 3) {
$colspan = ' colspan="2"';
$output .= &print_login('service',$dom,$confname,$phase,$settings,\$rowtotal);
} else {
@@ -731,7 +745,7 @@ sub print_config_box {
($action eq 'defaults')) {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 4) {
+ if ($numheaders == 3) {
$output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
@@ -747,27 +761,6 @@ sub print_config_box {
} else {
$output .= &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);
}
- $output .= '
-
-
-
-
-
-
- ';
- if ($numheaders == 4) {
- $output .= '
- '.&mt($item->{'header'}->[3]->{'col1'}).' |
- '.&mt($item->{'header'}->[3]->{'col2'}).' |
- ';
- } else {
- $output .= '
- '.&mt($item->{'header'}->[2]->{'col1'}).' |
- '.&mt($item->{'header'}->[2]->{'col2'}).' |
- ';
- }
- $rowtotal ++;
- $output .= &print_login('headtag',$dom,$confname,$phase,$settings,\$rowtotal);
} elsif ($action eq 'requestcourses') {
$output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
$rowtotal ++;
@@ -1188,57 +1181,6 @@ sub print_login {
$itemcount ++;
}
$datatable .= &captcha_choice('login',$settings,$itemcount);
- } elsif ($caller eq 'headtag') {
- my %domservers = &Apache::lonnet::get_servers($dom);
- my $choice = $choices{'headtag'};
- $css_class = ' class="LC_odd_row"';
- $datatable .= ''.$choice.' | '.
- ' | ';
}
return $datatable;
}
@@ -1272,9 +1214,6 @@ sub login_choices {
link => "Link",
alink => "Active link",
vlink => "Visited link",
- headtag => "Custom markup",
- action => "Action",
- current => "Current",
);
return %choices;
}
@@ -2145,11 +2084,9 @@ sub print_studentcode {
my $rownum = 0;
my ($output,%current);
my @crstypes = ('official','unofficial','community','textbook');
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{'uniquecode'}) eq 'HASH') {
- foreach my $type (@crstypes) {
- $current{$type} = $settings->{'uniquecode'}{$type};
- }
+ if (ref($settings->{'uniquecode'}) eq 'HASH') {
+ foreach my $type (@crstypes) {
+ $current{$type} = $settings->{'uniquecode'}{$type};
}
}
$output .= ''.
@@ -2398,7 +2335,7 @@ ENDSCRIPT
sub print_autoenroll {
my ($dom,$settings,$rowtotal) = @_;
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
- my ($defdom,$runon,$runoff,$coownerson,$coownersoff,$failsafe);
+ my ($defdom,$runon,$runoff,$coownerson,$coownersoff);
if (ref($settings) eq 'HASH') {
if (exists($settings->{'run'})) {
if ($settings->{'run'} eq '0') {
@@ -2432,9 +2369,6 @@ sub print_autoenroll {
if (exists($settings->{'sender_domain'})) {
$defdom = $settings->{'sender_domain'};
}
- if (exists($settings->{'autofailsafe'})) {
- $failsafe = $settings->{'autofailsafe'};
- }
} else {
if ($autorun) {
$runon = ' checked="checked" ';
@@ -2470,12 +2404,8 @@ sub print_autoenroll {
$coownerson.' value="1" />'.&mt('Yes').' '.
''.
- ' '.
- ''.&mt('Failsafe for no drops when institutional data missing').' | '.
- ''.
- ' | ';
- $$rowtotal += 4;
+ '';
+ $$rowtotal += 3;
return $datatable;
}
@@ -2833,7 +2763,7 @@ sub print_helpsettings {
sub radiobutton_prefs {
my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick,
- $additional,$align) = @_;
+ $additional) = @_;
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') &&
(ref($choices) eq 'HASH'));
@@ -2867,14 +2797,8 @@ sub radiobutton_prefs {
$datatable .=
''.
''.$choices->{$item}.
- ' | ';
- if ($align eq 'left') {
- $datatable .= '';
- } else {
- $datatable .= ' | ';
- }
- $datatable .=
- ''.
+ ' | '.
+ ''.
' | '."\n".
+ $currpriv.'" size="40" /> |
'."\n".
'';
return $output;
}
@@ -4811,8 +4551,11 @@ sub print_defaults {
my $includeempty = 1;
$datatable .= &Apache::loncommon::select_datelocale($item,$defaults{$item},undef,$includeempty);
} elsif ($item eq 'lang_def') {
- my $includeempty = 1;
- $datatable .= &Apache::loncommon::select_language($item,$defaults{$item},$includeempty);
+ my %langchoices = &get_languages_hash();
+ $langchoices{''} = 'No language preference';
+ %langchoices = &Apache::lonlocal::texthash(%langchoices);
+ $datatable .= &Apache::loncommon::select_form($defaults{$item},$item,
+ \%langchoices);
} else {
my $size;
if ($item eq 'portal_def') {
@@ -4881,7 +4624,7 @@ sub print_defaults {
$datatable .= '';
}
$datatable .= ' '.&mt('Internal ID:').
- ''.
+ ''.
' '.&mt('(new)').
''.
&mt('Name displayed:').
@@ -5418,19 +5161,19 @@ sub serverstatus_pages {
return ('userstatus','lonstatus','loncron','server-status','codeversions',
'checksums','clusterstatus','metadata_keywords','metadata_harvest',
'takeoffline','takeonline','showenv','toggledebug','ping','domconf',
- 'uniquecodes','diskusage','coursecatalog');
+ 'uniquecodes','diskusage');
}
sub defaults_javascript {
my ($settings) = @_;
- return unless (ref($settings) eq 'HASH');
+ my ($output,$jstext);
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
my $maxnum = scalar(@{$settings->{'inststatusorder'}});
if ($maxnum eq '') {
$maxnum = 0;
}
$maxnum ++;
- my $jstext = ' var inststatuses = Array('."'".join("','",@{$settings->{'inststatusorder'}})."'".');';
+ $jstext = ' var inststatuses = Array('."'".join("','",@{$settings->{'inststatusorder'}})."'".');';
return <<"ENDSCRIPT";
|