--- loncom/interface/domainprefs.pm 2009/05/19 20:00:24 1.96 +++ loncom/interface/domainprefs.pm 2009/07/25 14:44:50 1.98 @@ -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.98 2009/07/25 14:44:50 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; } @@ -2697,6 +2722,7 @@ sub color_font_choices { links => "Link colors", images => "Images", font => "Font color", + fontmenu => "Font Menu", pgbg => "Page", tabbg => "Header", sidebg => "Border", @@ -2763,6 +2789,7 @@ sub modify_colors { @bgs = ('pgbg','tabbg','sidebg'); } $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'}; + $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'}; foreach my $item (@bgs,@links,@logintext) { $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item}; } @@ -2876,6 +2903,15 @@ sub modify_colors { $changes{$role}{'font'} = 1; } } + if ($domconfig->{$role}{'fontmenu'} ne '') { + if ($confhash->{$role}{'fontmenu'} ne $domconfig->{$role}{'fontmenu'}) { + $changes{$role}{'fontmenu'} = 1; + } + } else { + if ($confhash->{$role}{'fontmenu'}) { + $changes{$role}{'fontmenu'} = 1; + } + } foreach my $item (@bgs) { if ($domconfig->{$role}{$item} ne '') { if ($confhash->{$role}{$item} ne $domconfig->{$role}{$item}) { @@ -3314,7 +3350,7 @@ sub modify_quotas { $context = $action; } if ($context eq 'requestcourses') { - @usertools = ('official','unofficial'); + @usertools = ('official','unofficial','community'); } else { @usertools = ('aboutme','blog','portfolio'); }