--- loncom/interface/domainprefs.pm 2010/04/14 04:27:20 1.134
+++ loncom/interface/domainprefs.pm 2010/05/21 15:54:44 1.135
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.134 2010/04/14 04:27:20 raeburn Exp $
+# $Id: domainprefs.pm,v 1.135 2010/05/21 15:54:44 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -756,7 +756,6 @@ sub print_login {
$checkedon{$item} = ' ';
}
}
- my $loginheader = 'image';
my @images = ('img','logo','domlogo','login');
my @logintext = ('textcol','bgcol');
my @bgs = ('pgbg','mainbg','sidebg');
@@ -805,9 +804,6 @@ sub print_login {
$is_custom{$item} = 1;
}
}
- if ($settings->{'loginheader'} ne '') {
- $loginheader = $settings->{'loginheader'};
- }
if ($settings->{'font'} ne '') {
$designs{'font'} = $settings->{'font'};
$is_custom{'font'} = 1;
@@ -866,7 +862,7 @@ sub print_login {
'';
$itemcount ++;
}
- $datatable .= &display_color_options($dom,$confname,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,\@logintext,$loginheader);
+ $datatable .= &display_color_options($dom,$confname,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,\@logintext);
$datatable .= '';
return $datatable;
}
@@ -986,7 +982,7 @@ sub print_rolecolors {
sub display_color_options {
my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs,
- $images,$bgs,$links,$alt_text,$rowtotal,$logintext,$loginheader) = @_;
+ $images,$bgs,$links,$alt_text,$rowtotal,$logintext) = @_;
my $css_class = $itemcount%2?' class="LC_odd_row"':'';
my $datatable = '
'.
''.$choices->{'font'}.' | ';
@@ -1028,8 +1024,7 @@ sub display_color_options {
if ($role eq 'login') {
if ($img eq 'login') {
$login_hdr_pick =
- &login_header_options($img,$role,$defaults,$is_custom,$choices,
- $loginheader);
+ &login_header_options($img,$role,$defaults,$is_custom,$choices);
$logincolors =
&login_text_colors($img,$role,$logintext,$phase,$choices,
$designs);
@@ -1106,8 +1101,8 @@ sub display_color_options {
}
$datatable .= '';
if ($img eq 'login') {
- $datatable .= $login_hdr_pick;
- }
+ $datatable .= $login_hdr_pick;
+ }
$datatable .= &image_changes($is_custom->{$img},$alt_text->{$img},$img_import,
$showfile,$fullsize,$role,$img,$imgfile,$logincolors);
} else {
@@ -1121,7 +1116,9 @@ sub display_color_options {
if ($switchserver) {
$datatable .= &mt('Upload to library server: [_1]',$switchserver);
} else {
- $datatable .=' ';
+ if ($img ne 'login') { # suppress file selection for Log-in header
+ $datatable .=' ';
+ }
}
$datatable .= ' |
';
}
@@ -1210,20 +1207,10 @@ sub logo_display_options {
}
sub login_header_options {
- my ($img,$role,$defaults,$is_custom,$choices,$loginheader) = @_;
- my $image_checked = ' checked="checked" ';
- my $text_checked = ' ';
- if ($loginheader eq 'text') {
- $image_checked = ' ';
- $text_checked = ' checked="checked" ';
- }
- my $output = ' '.
- '
'."\n";
+ my ($img,$role,$defaults,$is_custom,$choices) = @_;
+ my $output = '';
if ((!$is_custom->{'textcol'}) || (!$is_custom->{'bgcol'})) {
- $output .= &mt('Text default(s)').':
';
+ $output .= &mt('Text default(s):').'
';
if (!$is_custom->{'textcol'}) {
$output .= $choices->{'textcol'}.': '.$defaults->{'logintext'}{'textcol'}.
' ';
@@ -1259,25 +1246,31 @@ sub login_text_colors {
sub image_changes {
my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_;
my $output;
- if (!$is_custom) {
+ if ($img eq 'login') {
+ # suppress image for Log-in header
+ } elsif (!$is_custom) {
if ($img ne 'domlogo') {
$output .= &mt('Default image:').'
';
} else {
$output .= &mt('Default in use:').'
';
}
}
- if ($img_import) {
- $output .= '';
- }
- $output .= '';
- if ($is_custom) {
- $output .= ''.$logincolors.' '.&mt('Replace:').' ';
+ if ($img eq 'login') { # suppress image for Log-in header
+ $output .= ' | '.$logincolors;
} else {
- $output .= ' | '.$logincolors.&mt('Upload:').' ';
+ if ($img_import) {
+ $output .= '';
+ }
+ $output .= ' | ';
+ if ($is_custom) {
+ $output .= ''.$logincolors.' '.&mt('Replace:').' ';
+ } else {
+ $output .= ' | '.$logincolors.&mt('Upload:').' ';
+ }
}
return $output;
}
@@ -3708,22 +3701,12 @@ sub modify_login {
}
}
}
- if (($domconfig{'login'}{'loginheader'} eq 'text') &&
- ($env{'form.loginheader'} eq 'image')) {
- $changes{'loginheader'} = 1;
- } elsif (($domconfig{'login'}{'loginheader'} eq '' ||
- $domconfig{'login'}{'loginheader'} eq 'image') &&
- ($env{'form.loginheader'} eq 'text')) {
- $changes{'loginheader'} = 1;
- }
}
if (keys(%changes) > 0 || $colchgtext) {
&Apache::loncommon::devalidate_domconfig_cache($dom);
$resulttext = &mt('Changes made:').'';
foreach my $item (sort(keys(%changes))) {
- if ($item eq 'loginheader') {
- $resulttext .= '- '.&mt("$title{$item} set to $env{'form.loginheader'}").'
';
- } elsif ($item eq 'loginvia') {
+ if ($item eq 'loginvia') {
if (ref($changes{$item}) eq 'HASH') {
$resulttext .= '- '.&mt('Log-in page availability:').'
';
foreach my $lonhost (sort(keys(%{$changes{$item}}))) {
|