--- loncom/interface/domainprefs.pm 2018/07/06 13:43:14 1.333
+++ loncom/interface/domainprefs.pm 2018/07/26 14:59:48 1.336
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.333 2018/07/06 13:43:14 raeburn Exp $
+# $Id: domainprefs.pm,v 1.336 2018/07/26 14:59:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -781,6 +781,10 @@ sub print_config_box {
$output =
&Apache::lonuserutils::custom_roledefs_js($context,$crstype,$formname,\%full,
\@templateroles);
+ } elsif ($action eq 'ltitools') {
+ $output .= <itools_javascript($settings);
+ } elsif ($action eq 'lti') {
+ $output .= <i_javascript($settings);
}
$output .=
'
@@ -2482,7 +2486,7 @@ sub print_textbookcourses {
$datatable .= '';
}
$datatable .= ' '."\n".
- ''.&mt('Add').''."\n".
+ ''.&mt('Add').''."\n".
''.
''.&mt('Subject:').' '."\n".
(' 'x2).
@@ -2499,13 +2503,13 @@ sub print_textbookcourses {
} else {
$datatable .= '';
}
+ $datatable .= ''."\n";
}
- $datatable .= ''."\n".
- ''.&mt('LON-CAPA course:').' '.
+ $datatable .= ''.&mt('LON-CAPA course:').' '.
&Apache::loncommon::select_dom_form($env{'request.role.domain'},$type.'_addbook_cdom').
''.
&Apache::loncommon::selectcourse_link
- ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course');
+ ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course').
' | '."\n".
''."\n";
$itemcount ++;
@@ -3454,7 +3458,7 @@ sub print_contacts {
if ($currfield{$field} eq 'no') {
$display = ' style="display:none"';
}
- $datatable .= '
'.
+ $datatable .= ''.
''.&mt('Maximum size for upload (MB)').' | '.
'';
}
@@ -3499,7 +3503,7 @@ sub print_contacts {
'value="'.$bccemails{$type}.'" />'.
''.
' |
';
+ ''.
+ &helpsettings_javascript(\@roles_by_num,$maxnum,$hiddenstr,$formname).
+ '';
$count ++;
$$rowtotal += $count;
}
@@ -4168,7 +4173,7 @@ sub print_ltitools {
my $confname = $dom.'-domainconfig';
my $switchserver = &check_switchserver($dom,$confname);
my $maxnum = scalar(keys(%ordered));
- my $datatable = <itools_javascript($settings);
+ my $datatable;
my %lt = <itools_names();
my @courseroles = ('cc','in','ta','ep','st');
my @ltiroles = qw(Instructor ContentDeveloper TeachingAssistant Learner);
@@ -4269,9 +4274,9 @@ sub print_ltitools {
''.
(' 'x2);
}
- $datatable .= '
'.
+ $datatable .= '
'.
''.$lt{'linktext'}.'
'.
- '
'.
+ ''.
''.$lt{'explanation'}.'
'.
'
';
@@ -4442,7 +4447,7 @@ sub print_ltitools {
$datatable .= '';
}
$datatable .= ' '."\n".
- ''.&mt('Add').''."\n".
+ ''.&mt('Add').''."\n".
''.
' | '.
' | | '.
- '
'."\n".
+ ''."\n".
''."\n".
''."\n";
$itemcount ++;
@@ -4620,7 +4625,7 @@ sub print_lti {
}
}
my $maxnum = scalar(keys(%ordered));
- my $datatable = <i_javascript($settings);
+ my $datatable;
my %lt = <i_names();
if (keys(%ordered)) {
my @items = sort { $a <=> $b } keys(%ordered);
@@ -4685,7 +4690,7 @@ sub print_lti {
$datatable .= '';
}
$datatable .= ' '."\n".
- ''.&mt('Add').''."\n".
+ ''.&mt('Add').''."\n".
''.
''.
+ $output .= ''.
'';
# ''.
@@ -5519,7 +5524,7 @@ sub print_validation_rows {
' ';
}
} elsif ($item eq 'markup') {
- $datatable .= ' | ';
+ $datatable .= ' |
';
if ($numdc > 1) {
$datatable .= &mt('Course creation processed as: (choose Dom. Coord.)');
} else {
@@ -6844,7 +6849,7 @@ sub print_selfcreation {
$datatable .= ' |
'.
''.&mt('Mapping of Shibboleth environment variable names to user data fields (SSO auth)').' | '.
''."\n".
- ''."\n";
+ ''."\n";
for (my $i=0; $i<@fields; $i++) {
$rem = $i%($numperrow);
if ($rem == 0) {
@@ -8251,7 +8256,7 @@ sub print_serverstatuses {
''.
''.
- ''."\n";
+ ''."\n";
}
$$rowtotal += $rownum;
return $datatable;
@@ -8844,7 +8849,7 @@ sub insttypes_row {
}
$output .= ' ';
} else {
- if (($rem == 0) && (@{$types} > 0)) {
+ if ($rem == 0) {
$output .= '';
}
if ($colsleft > 1) {
@@ -16358,12 +16363,17 @@ sub modify_ssl {
if ($env{'form.'.$prefix.'_'.$type} =~ /^(no|req)$/) {
$value = $env{'form.'.$prefix.'_'.$type};
}
- if (ref($domconfig{$action}{$prefix}) eq 'HASH') {
- if ($domconfig{$action}{$prefix}{$type} ne '') {
- if ($value ne $domconfig{$action}{$prefix}{$type}) {
+ if (ref($domconfig{$action}) eq 'HASH') {
+ if (ref($domconfig{$action}{$prefix}) eq 'HASH') {
+ if ($domconfig{$action}{$prefix}{$type} ne '') {
+ if ($value ne $domconfig{$action}{$prefix}{$type}) {
+ $changes{$prefix}{$type} = 1;
+ }
+ $defaultshash{$action}{$prefix}{$type} = $value;
+ } else {
+ $defaultshash{$action}{$prefix}{$type} = $value;
$changes{$prefix}{$type} = 1;
}
- $defaultshash{$action}{$prefix}{$type} = $value;
} else {
$defaultshash{$action}{$prefix}{$type} = $value;
$changes{$prefix}{$type} = 1;
@@ -16433,6 +16443,17 @@ sub modify_ssl {
}
}
}
+ if (keys(%changes)) {
+ foreach my $prefix (keys(%changes)) {
+ if (ref($changes{$prefix}) eq 'HASH') {
+ if (scalar(keys(%{$changes{$prefix}})) == 0) {
+ delete($changes{$prefix});
+ }
+ } else {
+ delete($changes{$prefix});
+ }
+ }
+ }
my $nochgmsg = &mt('No changes made to LON-CAPA SSL settings');
if (keys(%changes) > 0) {
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash,
@@ -16443,10 +16464,10 @@ sub modify_ssl {
$domdefaults{'replication'} = $defaultshash{$action}{'replication'};
}
if (ref($defaultshash{$action}{'connto'}) eq 'HASH') {
- $domdefaults{'connto'} = $domconfig{$action}{'connto'};
+ $domdefaults{'connto'} = $defaultshash{$action}{'connto'};
}
if (ref($defaultshash{$action}{'connfrom'}) eq 'HASH') {
- $domdefaults{'connfrom'} = $domconfig{$action}{'connfrom'};
+ $domdefaults{'connfrom'} = $defaultshash{$action}{'connfrom'};
}
}
my $cachetime = 24*60*60;
|
|