--- loncom/interface/domainprefs.pm 2013/12/24 19:15:10 1.216
+++ loncom/interface/domainprefs.pm 2014/01/05 21:24:12 1.222
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.216 2013/12/24 19:15:10 raeburn Exp $
+# $Id: domainprefs.pm,v 1.222 2014/01/05 21:24:12 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -420,7 +420,7 @@ sub handler {
if ($phase eq 'process') {
my $result = &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,
\%prefs,\%domconfig,$confname,\@roles);
- if (ref($result) eq 'HASH') {
+ if ((ref($result) eq 'HASH') && (keys(%{$result}))) {
$r->rflush();
&devalidate_remote_domconfs($dom,$result);
}
@@ -2022,14 +2022,28 @@ sub print_requestmail {
sub print_studentcode {
my ($settings,$rowtotal) = @_;
my $rownum = 0;
- my %choices;
- $choices{'uniquecode'} = &mt('Generate unique six character code as course identifier?');
- my @toggles = ('uniquecode');
- my %defaultchecked = ('uniquecode' => 'off');
- (my $reports,$rownum) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
- \%choices,$rownum);
- $$rowtotal += $rownum;
- return $reports;
+ my ($output,%current);
+ my @crstypes = ('official','unofficial','community','textbook');
+ if (ref($settings->{'uniquecode'}) eq 'HASH') {
+ foreach my $type (@crstypes) {
+ $current{$type} = $settings->{'uniquecode'}{$type};
+ }
+ }
+ $output .= '
'.
+ ''.&mt('Generate unique six character code as course identifier?').' | '.
+ '';
+ foreach my $type (@crstypes) {
+ my $check = ' ';
+ if ($current{$type}) {
+ $check = ' checked="checked" ';
+ }
+ $output .= ''.(' 'x2).' ';
+ }
+ $output .= ' |
';
+ $$rowtotal ++;
+ return $output;
}
sub print_textbookcourses {
@@ -2054,7 +2068,7 @@ sub print_textbookcourses {
my $confname = $dom.'-domainconfig';
my $switchserver = &check_switchserver($dom,$confname);
my $maxnum = scalar(keys(%ordered));
- my $datatable;
+ my $datatable = &textbookcourses_javascript(\%ordered);
if (keys(%ordered)) {
my @items = sort { $a <=> $b } keys(%ordered);
for (my $i=0; $i<@items; $i++) {
@@ -2074,7 +2088,7 @@ sub print_textbookcourses {
$imgsrc = '';
}
}
- my $chgstr = ' onchange="javascript:reorderBooks(this.form,'."'','$key','$i'".');"';
+ my $chgstr = ' onchange="javascript:reorderBooks(this.form,'."'$key'".');"';
$datatable .= ''
.' |