--- loncom/interface/domainprefs.pm 2009/05/19 20:00:24 1.96 +++ loncom/interface/domainprefs.pm 2009/08/02 07:21:18 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.96 2009/05/19 20:00:24 raeburn Exp $ +# $Id: domainprefs.pm,v 1.99 2009/08/02 07:21:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -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; } @@ -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 ++; @@ -2495,12 +2524,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 .= ''. '