--- loncom/interface/domainprefs.pm 2009/04/24 04:58:27 1.94
+++ loncom/interface/domainprefs.pm 2009/08/06 15:14:08 1.100
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.94 2009/04/24 04:58:27 raeburn Exp $
+# $Id: domainprefs.pm,v 1.100 2009/08/06 15:14:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -162,7 +162,7 @@ sub handler {
col2 => 'Information settable when self-creating account (if directory data blank)'}],
},
'scantron' =>
- { text => 'Scantron format file',
+ { text => 'Bubblesheet format file',
help => 'Domain_Configuration_Scantron_Format',
header => [ {col1 => 'Item',
col2 => '',
@@ -634,6 +634,7 @@ sub print_rolecolors {
my %defaults = (
img => $defaultdesign{$role.'.img'},
font => $defaultdesign{$role.'.font'},
+ fontmenu => $defaultdesign{$role.'.fontmenu'},
);
foreach my $item (@bgs) {
$defaults{'bgs'}{$item} = $defaultdesign{$role.'.'.$item};
@@ -651,6 +652,10 @@ sub print_rolecolors {
$designs{'font'} = $settings->{$role}->{'font'};
$is_custom{'font'} = 1;
}
+ if ($settings->{$role}->{'fontmenu'} ne '') {
+ $designs{'fontmenu'} = $settings->{$role}->{'fontmenu'};
+ $is_custom{'fontmenu'} = 1;
+ }
foreach my $item (@bgs) {
if ($settings->{$role}->{$item} ne '') {
$designs{'bgs'}{$item} = $settings->{$role}->{$item};
@@ -669,6 +674,10 @@ sub print_rolecolors {
$designs{img} = $designhash{$dom.'.'.$role.'.img'};
$is_custom{'img'} = 1;
}
+ if ($designhash{$dom.'.'.$role.'.fontmenu'} ne '') {
+ $designs{fontmenu} = $designhash{$dom.'.'.$role.'.fontmenu'};
+ $is_custom{'fontmenu'} = 1;
+ }
if ($designhash{$dom.'.'.$role.'.font'} ne '') {
$designs{font} = $designhash{$dom.'.'.$role.'.font'};
$is_custom{'font'} = 1;
@@ -697,7 +706,7 @@ sub display_color_options {
my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs,
$images,$bgs,$links,$alt_text,$rowtotal,$logintext,$loginheader) = @_;
my $css_class = $itemcount%2?' class="LC_odd_row"':'';
- my $datatable = '
'.
+ my $datatable = '
'.
''.$choices->{'font'}.' | ';
if (!$is_custom->{'font'}) {
$datatable .= ''.&mt('Default in use:').' '.$defaults->{'font'}.' | ';
@@ -711,6 +720,20 @@ sub display_color_options {
' '.
'
';
+ $datatable .= ''.
+ ''.$choices->{'fontmenu'}.' | ';
+ if (!$is_custom->{'fontmenu'}) {
+ $datatable .= ''.&mt('Default in use:').' '.$defaults->{'fontmenu'}.' | ';
+ } else {
+ $datatable .= ' | ';
+ }
+ $fontlink = &color_pick($phase,$role,'fontmenu',$choices->{'fontmenu'},$designs->{'fontmenu'});
+ $datatable .= ''.
+ ' '.$fontlink.
+ ' '.
+ ' |
';
my $switchserver = &check_switchserver($dom,$confname);
foreach my $img (@{$images}) {
$itemcount ++;
@@ -996,7 +1019,7 @@ sub print_quotas {
my $typecount = 0;
my $css_class;
if ($context eq 'requestcourses') {
- @usertools = ('official','unofficial');
+ @usertools = ('official','unofficial','community');
} else {
@usertools = ('aboutme','blog','portfolio');
}
@@ -1094,7 +1117,9 @@ sub print_quotas {
$typecount ++;
$css_class = $typecount%2?' class="LC_odd_row"':'';
$datatable .= ''.
- ' '.&mt('LON-CAPA Advanced Users').' | '.
+ ''.&mt('LON-CAPA Advanced Users').
+ ' ('.
+ &mt('overrides affiliation').') | '.
' ';
foreach my $item (@usertools) {
my $checked;
@@ -1115,8 +1140,7 @@ sub print_quotas {
'" value="_LC_adv" '.$checked.'/>'.$titles{$item}.
' ';
}
- $datatable .= '('.&mt('overrides affiliation').
- ') |
';
+ $datatable .= '';
$$rowtotal += $typecount;
return $datatable;
}
@@ -1448,6 +1472,7 @@ sub tool_titles {
portfolio => 'Portfolio',
official => 'Official courses (with institutional codes)',
unofficial => 'Unofficial courses',
+ community => 'Communities',
);
return %titles;
}
@@ -1493,7 +1518,7 @@ sub print_usercreation {
$rowcount ++;
}
} elsif ($position eq 'middle') {
- my @creators = ('author','course','selfcreate');
+ my @creators = ('author','course','requestcrs','selfcreate');
my ($rules,$ruleorder) =
&Apache::lonnet::inst_userrules($dom,'username');
my %lt = &usercreation_types();
@@ -1574,7 +1599,11 @@ sub print_usercreation {
&Apache::loncommon::sorted_inst_types($dom);
if (ref($usertypes) eq 'HASH') {
if (keys(%{$usertypes}) > 0) {
- $datatable .= &insttypes_row($settings->{cancreate},$types,$usertypes,
+ my $createsettings;
+ if (ref($settings) eq 'HASH') {
+ $createsettings = $settings->{cancreate};
+ }
+ $datatable .= &insttypes_row($createsettings,$types,$usertypes,
$dom,$numinrow,$othertitle,
'statustocreate');
$$rowtotal ++;
@@ -1692,6 +1721,7 @@ sub usercreation_types {
my %lt = &Apache::lonlocal::texthash (
author => 'When adding a co-author',
course => 'When adding a user to a course',
+ requestcrs => 'When requesting a course',
selfcreate => 'User creates own account',
any => 'Any',
official => 'Institutional only ',
@@ -1833,8 +1863,8 @@ sub print_scantronformat {
%confhash);
my $switchserver = &check_switchserver($dom,$confname);
my %lt = &Apache::lonlocal::texthash (
- default => 'Default scantron format file error',
- custom => 'Custom scantron format file error',
+ default => 'Default bubblesheet format file error',
+ custom => 'Custom bubblesheet format file error',
);
my %scantronfiles = (
default => 'default.tab',
@@ -1907,7 +1937,7 @@ sub print_scantronformat {
}
}
} else {
- $error{'default'} = &mt("Unable to copy default scantron formatfile to domain's RES space: [_1]",$switchserver);
+ $error{'default'} = &mt("Unable to copy default bubblesheet formatfile to domain's RES space: [_1]",$switchserver);
}
}
if (ref($settings) eq 'HASH') {
@@ -2495,12 +2525,14 @@ sub insttypes_row {
$output .= '';
}
my $check = ' ';
- if (ref($settings->{$context}) eq 'ARRAY') {
- if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) {
+ if (ref($settings) eq 'HASH') {
+ if (ref($settings->{$context}) eq 'ARRAY') {
+ if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) {
+ $check = ' checked="checked" ';
+ }
+ } elsif ($context eq 'statustocreate') {
$check = ' checked="checked" ';
}
- } elsif ($context eq 'statustocreate') {
- $check = ' checked="checked" ';
}
$output .= ''.
' |