--- loncom/interface/domainprefs.pm 2014/05/31 04:32:12 1.160.6.50
+++ loncom/interface/domainprefs.pm 2016/09/18 19:22:48 1.160.6.71
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.50 2014/05/31 04:32:12 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.71 2016/09/18 19:22:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -250,6 +250,8 @@ 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,
@@ -412,7 +414,9 @@ sub handler {
'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 => 'Defaults which can be overridden in each course by a CC',
+ col2 => 'Value',},
+ {col1 => 'Defaults which can be overridden for each course by a DC',
col2 => 'Value',},],
print => \&print_coursedefaults,
modify => \&modify_coursedefaults,
@@ -461,6 +465,8 @@ 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,
@@ -650,7 +656,7 @@ sub print_config_box {
my $colspan = '';
my $rightcolspan = '';
if (($action eq 'rolecolors') || ($action eq 'defaults') ||
- (($action eq 'login') && ($numheaders < 3))) {
+ (($action eq 'login') && ($numheaders < 4))) {
$colspan = ' colspan="2"';
}
if ($action eq 'usersessions') {
@@ -666,13 +672,13 @@ 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') {
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 3) {
+ if ($numheaders == 4) {
$colspan = ' colspan="2"';
$output .= &print_login('service',$dom,$confname,$phase,$settings,\$rowtotal);
} else {
@@ -721,10 +727,11 @@ sub print_config_box {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
}
$rowtotal ++;
- } elsif (($action eq 'usermodification') || ($action eq 'defaults')) {
+ } elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') ||
+ ($action eq 'defaults')) {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 3) {
+ if ($numheaders == 4) {
$output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
@@ -740,6 +747,27 @@ 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 ++;
@@ -864,8 +892,6 @@ sub print_config_box {
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'helpsettings') {
$output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal);
- } elsif ($action eq 'coursedefaults') {
- $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
}
}
$output .= '
@@ -1162,6 +1188,57 @@ 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;
}
@@ -1195,6 +1272,9 @@ sub login_choices {
link => "Link",
alink => "Active link",
vlink => "Visited link",
+ headtag => "Custom markup",
+ action => "Action",
+ current => "Current",
);
return %choices;
}
@@ -2065,9 +2145,11 @@ sub print_studentcode {
my $rownum = 0;
my ($output,%current);
my @crstypes = ('official','unofficial','community','textbook');
- if (ref($settings->{'uniquecode'}) eq 'HASH') {
- foreach my $type (@crstypes) {
- $current{$type} = $settings->{'uniquecode'}{$type};
+ if (ref($settings) eq 'HASH') {
+ if (ref($settings->{'uniquecode'}) eq 'HASH') {
+ foreach my $type (@crstypes) {
+ $current{$type} = $settings->{'uniquecode'}{$type};
+ }
}
}
$output .= ''.
@@ -2316,7 +2398,7 @@ ENDSCRIPT
sub print_autoenroll {
my ($dom,$settings,$rowtotal) = @_;
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
- my ($defdom,$runon,$runoff,$coownerson,$coownersoff);
+ my ($defdom,$runon,$runoff,$coownerson,$coownersoff,$failsafe);
if (ref($settings) eq 'HASH') {
if (exists($settings->{'run'})) {
if ($settings->{'run'} eq '0') {
@@ -2350,6 +2432,9 @@ 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" ';
@@ -2385,8 +2470,12 @@ sub print_autoenroll {
$coownerson.' value="1" />'.&mt('Yes').' '.
''.
- ' ';
- $$rowtotal += 3;
+ ''.
+ ''.&mt('Failsafe for no drops when institutional data missing').' | '.
+ ''.
+ ' | ';
+ $$rowtotal += 4;
return $datatable;
}
@@ -2744,7 +2833,7 @@ sub print_helpsettings {
sub radiobutton_prefs {
my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick,
- $additional) = @_;
+ $additional,$align) = @_;
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') &&
(ref($choices) eq 'HASH'));
@@ -2778,8 +2867,14 @@ sub radiobutton_prefs {
$datatable .=
''.
''.$choices->{$item}.
- ' | '.
- ''.
+ ' | ';
+ if ($align eq 'left') {
+ $datatable .= '';
+ } else {
+ $datatable .= ' | ';
+ }
+ $datatable .=
+ ''.
' | '."\n".
+ $currpriv.'" size="40" /> '.
+ ''.$vertext.' '."\n".
+ ' '.
+ ' |
'."\n".
'';
return $output;
}
@@ -4532,11 +4811,8 @@ sub print_defaults {
my $includeempty = 1;
$datatable .= &Apache::loncommon::select_datelocale($item,$defaults{$item},undef,$includeempty);
} elsif ($item eq 'lang_def') {
- my %langchoices = &get_languages_hash();
- $langchoices{''} = 'No language preference';
- %langchoices = &Apache::lonlocal::texthash(%langchoices);
- $datatable .= &Apache::loncommon::select_form($defaults{$item},$item,
- \%langchoices);
+ my $includeempty = 1;
+ $datatable .= &Apache::loncommon::select_language($item,$defaults{$item},$includeempty);
} else {
my $size;
if ($item eq 'portal_def') {
@@ -4605,7 +4881,7 @@ sub print_defaults {
$datatable .= '