--- loncom/interface/domainprefs.pm 2009/09/03 21:20:14 1.102.2.4 +++ loncom/interface/domainprefs.pm 2009/08/22 20:28:29 1.107 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.102.2.4 2009/09/03 21:20:14 raeburn Exp $ +# $Id: domainprefs.pm,v 1.107 2009/08/22 20:28:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -763,6 +763,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}; @@ -780,6 +781,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}; @@ -798,6 +803,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; @@ -826,7 +835,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'}.''; @@ -840,6 +849,22 @@ sub display_color_options { '    '. ''; + unless ($role eq 'login') { + $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 ++; @@ -1126,7 +1151,7 @@ sub print_quotas { my ($css_class,%titles); if ($context eq 'requestcourses') { @usertools = ('official','unofficial','community'); - @options =('norequest','approval','autolimit','validate'); + @options =('norequest','approval','validate','autolimit'); %validations = &Apache::lonnet::auto_courserequest_checks($dom); %titles = &courserequest_titles(); } else { @@ -1201,10 +1226,10 @@ sub print_quotas { $item.'_limit_'.$type.'" size="1" '. 'value="'.$currlimit.'" />'; } + $cell{$item} .= '  '; if ($option eq 'autolimit') { - $cell{$item} .= $titles{'unlimited'}; + $cell{$item} .= $titles{'unlimited'} } - $cell{$item} .= '  '; } } else { my $checked = 'checked="checked" '; @@ -1226,7 +1251,7 @@ sub print_quotas { if ($context eq 'requestcourses') { $datatable .= ''; foreach my $item (@usertools) { - $datatable .= ''.$cell{$item}.''; + $datatable .= ''.$cell{$item}.''; } $datatable .= ''; } @@ -1309,7 +1334,7 @@ sub print_quotas { } $defcell{$item} .= '  '; if ($option eq 'autolimit') { - $defcell{$item} .= $titles{'unlimited'}; + $defcell{$item} .= $titles{'unlimited'} } } } else { @@ -1332,7 +1357,7 @@ sub print_quotas { if ($context eq 'requestcourses') { $datatable .= ''; foreach my $item (@usertools) { - $datatable .= ''.$defcell{$item}.''; + $datatable .= ''.$defcell{$item}.''; } $datatable .= ''; } @@ -1348,15 +1373,16 @@ sub print_quotas { $datatable .= ''. ''.&mt('LON-CAPA Advanced Users').' '; if ($context eq 'requestcourses') { - $datatable .= &mt('(overrides affiliation, if set)'). - ''. - ''. - ''; + $datatable .= &mt('(overrides affiliation, if set)'); } else { - $datatable .= &mt('(overrides affiliation, if checked)'). - ''. - ''. + '
'. - '
'; + $datatable .= &mt('(overrides affiliation, if checked)'); + } + $datatable .= '
'; + if ($context eq 'requestcourses') { + $datatable .= ''; + } else { + $datatable .= '
'; } my %advcell; foreach my $item (@usertools) { @@ -1412,7 +1438,7 @@ sub print_quotas { } $advcell{$item} .= '  '; if ($option eq 'autolimit') { - $advcell{$item} .= $titles{'unlimited'}; + $advcell{$item} .= $titles{'unlimited'} } } } else { @@ -1435,7 +1461,7 @@ sub print_quotas { if ($context eq 'requestcourses') { $datatable .= ''; foreach my $item (@usertools) { - $datatable .= ''; + $datatable .= ''; } $datatable .= '
'.$advcell{$item}.''.$advcell{$item}.'
'; } @@ -1873,7 +1899,7 @@ sub courserequest_titles { sub courserequest_conditions { my %conditions = &Apache::lonlocal::texthash ( - approval => '(Processing of request subject to approval by Domain Coordinator).', + approval => '(Processing of request subject to approval by Domain Coordinator).', validate => '(Processing of request subject to instittutional validation).', ); return %conditions; @@ -2660,7 +2686,6 @@ sub coursecategories_javascript { } $output = <<"ENDSCRIPT"; ENDSCRIPT @@ -3136,6 +3160,7 @@ sub color_font_choices { links => "Link colors", images => "Images", font => "Font color", + fontmenu => "Font Menu", pgbg => "Page", tabbg => "Header", sidebg => "Border", @@ -3193,6 +3218,7 @@ sub modify_colors { @logintext = ('textcol','bgcol'); } else { %choices = &color_font_choices(); + $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'}; } if ($role eq 'login') { @images = ('img','logo','domlogo','login'); @@ -3315,6 +3341,17 @@ sub modify_colors { $changes{$role}{'font'} = 1; } } + if ($role ne 'login') { + 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}) { @@ -3755,7 +3792,7 @@ sub modify_quotas { } if ($context eq 'requestcourses') { @usertools = ('official','unofficial','community'); - @options =('norequest','approval','autolimit','validate'); + @options =('norequest','approval','validate','autolimit'); %validations = &Apache::lonnet::auto_courserequest_checks($dom); %titles = &courserequest_titles(); $toolregexp = join('|',@usertools); @@ -3810,7 +3847,7 @@ sub modify_quotas { } foreach my $item (@usertools) { foreach my $type (@{$types},'default','_LC_adv') { - my $unset; + my $unset; if ($context eq 'requestcourses') { $unset = '0'; if ($type eq '_LC_adv') { @@ -3939,8 +3976,8 @@ sub modify_quotas { $env{'user.domain'}, $item,'reload',$context); if ($context eq 'requestcourses') { - if ($env{'environment.canrequest.'.$item} ne $newacc) { - $newenv{'environment.canrequest.'.$item} = $newacc; + if ($env{'environment.crsrequest.'.$item} ne $newacc) { + $newenv{'environment.crsrequest.'.$item} = $newacc; } } else { if ($env{'environment.availabletools.'.$item} ne $newacc) {