version 1.134, 2010/04/14 04:27:20
|
version 1.135, 2010/05/21 15:54:44
|
Line 756 sub print_login {
|
Line 756 sub print_login {
|
$checkedon{$item} = ' '; |
$checkedon{$item} = ' '; |
} |
} |
} |
} |
my $loginheader = 'image'; |
|
my @images = ('img','logo','domlogo','login'); |
my @images = ('img','logo','domlogo','login'); |
my @logintext = ('textcol','bgcol'); |
my @logintext = ('textcol','bgcol'); |
my @bgs = ('pgbg','mainbg','sidebg'); |
my @bgs = ('pgbg','mainbg','sidebg'); |
Line 805 sub print_login {
|
Line 804 sub print_login {
|
$is_custom{$item} = 1; |
$is_custom{$item} = 1; |
} |
} |
} |
} |
if ($settings->{'loginheader'} ne '') { |
|
$loginheader = $settings->{'loginheader'}; |
|
} |
|
if ($settings->{'font'} ne '') { |
if ($settings->{'font'} ne '') { |
$designs{'font'} = $settings->{'font'}; |
$designs{'font'} = $settings->{'font'}; |
$is_custom{'font'} = 1; |
$is_custom{'font'} = 1; |
Line 866 sub print_login {
|
Line 862 sub print_login {
|
'</tr>'; |
'</tr>'; |
$itemcount ++; |
$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 .= '</tr></table></td></tr>'; |
$datatable .= '</tr></table></td></tr>'; |
return $datatable; |
return $datatable; |
} |
} |
Line 986 sub print_rolecolors {
|
Line 982 sub print_rolecolors {
|
|
|
sub display_color_options { |
sub display_color_options { |
my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs, |
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 $css_class = $itemcount%2?' class="LC_odd_row"':''; |
my $datatable = '<tr'.$css_class.'>'. |
my $datatable = '<tr'.$css_class.'>'. |
'<td>'.$choices->{'font'}.'</td>'; |
'<td>'.$choices->{'font'}.'</td>'; |
Line 1028 sub display_color_options {
|
Line 1024 sub display_color_options {
|
if ($role eq 'login') { |
if ($role eq 'login') { |
if ($img eq 'login') { |
if ($img eq 'login') { |
$login_hdr_pick = |
$login_hdr_pick = |
&login_header_options($img,$role,$defaults,$is_custom,$choices, |
&login_header_options($img,$role,$defaults,$is_custom,$choices); |
$loginheader); |
|
$logincolors = |
$logincolors = |
&login_text_colors($img,$role,$logintext,$phase,$choices, |
&login_text_colors($img,$role,$logintext,$phase,$choices, |
$designs); |
$designs); |
Line 1106 sub display_color_options {
|
Line 1101 sub display_color_options {
|
} |
} |
$datatable .= '<td>'; |
$datatable .= '<td>'; |
if ($img eq 'login') { |
if ($img eq 'login') { |
$datatable .= $login_hdr_pick; |
$datatable .= $login_hdr_pick; |
} |
} |
$datatable .= &image_changes($is_custom->{$img},$alt_text->{$img},$img_import, |
$datatable .= &image_changes($is_custom->{$img},$alt_text->{$img},$img_import, |
$showfile,$fullsize,$role,$img,$imgfile,$logincolors); |
$showfile,$fullsize,$role,$img,$imgfile,$logincolors); |
} else { |
} else { |
Line 1121 sub display_color_options {
|
Line 1116 sub display_color_options {
|
if ($switchserver) { |
if ($switchserver) { |
$datatable .= &mt('Upload to library server: [_1]',$switchserver); |
$datatable .= &mt('Upload to library server: [_1]',$switchserver); |
} else { |
} else { |
$datatable .=' <input type="file" name="'.$role.'_'.$img.'" />'; |
if ($img ne 'login') { # suppress file selection for Log-in header |
|
$datatable .=' <input type="file" name="'.$role.'_'.$img.'" />'; |
|
} |
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
} |
} |
Line 1210 sub logo_display_options {
|
Line 1207 sub logo_display_options {
|
} |
} |
|
|
sub login_header_options { |
sub login_header_options { |
my ($img,$role,$defaults,$is_custom,$choices,$loginheader) = @_; |
my ($img,$role,$defaults,$is_custom,$choices) = @_; |
my $image_checked = ' checked="checked" '; |
my $output = ''; |
my $text_checked = ' '; |
|
if ($loginheader eq 'text') { |
|
$image_checked = ' '; |
|
$text_checked = ' checked="checked" '; |
|
} |
|
my $output = '<span class="LC_nobreak"><label><input type="radio" name="'. |
|
'loginheader" value="image" '.$image_checked.'/>'. |
|
&mt('use image').'</label> '. |
|
'<label><input type="radio" name="loginheader" value="text"'. |
|
$text_checked.'/>'.&mt('use text').'</label><br />'."\n"; |
|
if ((!$is_custom->{'textcol'}) || (!$is_custom->{'bgcol'})) { |
if ((!$is_custom->{'textcol'}) || (!$is_custom->{'bgcol'})) { |
$output .= &mt('Text default(s)').':<br />'; |
$output .= &mt('Text default(s):').'<br />'; |
if (!$is_custom->{'textcol'}) { |
if (!$is_custom->{'textcol'}) { |
$output .= $choices->{'textcol'}.': '.$defaults->{'logintext'}{'textcol'}. |
$output .= $choices->{'textcol'}.': '.$defaults->{'logintext'}{'textcol'}. |
' '; |
' '; |
Line 1259 sub login_text_colors {
|
Line 1246 sub login_text_colors {
|
sub image_changes { |
sub image_changes { |
my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_; |
my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_; |
my $output; |
my $output; |
if (!$is_custom) { |
if ($img eq 'login') { |
|
# suppress image for Log-in header |
|
} elsif (!$is_custom) { |
if ($img ne 'domlogo') { |
if ($img ne 'domlogo') { |
$output .= &mt('Default image:').'<br />'; |
$output .= &mt('Default image:').'<br />'; |
} else { |
} else { |
$output .= &mt('Default in use:').'<br />'; |
$output .= &mt('Default in use:').'<br />'; |
} |
} |
} |
} |
if ($img_import) { |
if ($img eq 'login') { # suppress image for Log-in header |
$output .= '<input type="hidden" name="'.$role.'_import_'.$img.'" value="'.$imgfile.'" />'; |
$output .= '<td>'.$logincolors; |
} |
|
$output .= '<a href="'.$fullsize.'" target="_blank"><img src="'. |
|
$showfile.'" alt="'.$alt_text.'" border="0" /></a></td>'; |
|
if ($is_custom) { |
|
$output .= '<td>'.$logincolors.'<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'. |
|
$role.'_del_'.$img.'" value="1" />'.&mt('Delete?'). |
|
'</label> '.&mt('Replace:').'</span><br />'; |
|
} else { |
} else { |
$output .= '<td valign="bottom">'.$logincolors.&mt('Upload:').'<br />'; |
if ($img_import) { |
|
$output .= '<input type="hidden" name="'.$role.'_import_'.$img.'" value="'.$imgfile.'" />'; |
|
} |
|
$output .= '<a href="'.$fullsize.'" target="_blank"><img src="'. |
|
$showfile.'" alt="'.$alt_text.'" border="0" /></a></td>'; |
|
if ($is_custom) { |
|
$output .= '<td>'.$logincolors.'<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="'. |
|
$role.'_del_'.$img.'" value="1" />'.&mt('Delete?'). |
|
'</label> '.&mt('Replace:').'</span><br />'; |
|
} else { |
|
$output .= '<td valign="bottom">'.$logincolors.&mt('Upload:').'<br />'; |
|
} |
} |
} |
return $output; |
return $output; |
} |
} |
Line 3708 sub modify_login {
|
Line 3701 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) { |
if (keys(%changes) > 0 || $colchgtext) { |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
foreach my $item (sort(keys(%changes))) { |
foreach my $item (sort(keys(%changes))) { |
if ($item eq 'loginheader') { |
if ($item eq 'loginvia') { |
$resulttext .= '<li>'.&mt("$title{$item} set to $env{'form.loginheader'}").'</li>'; |
|
} elsif ($item eq 'loginvia') { |
|
if (ref($changes{$item}) eq 'HASH') { |
if (ref($changes{$item}) eq 'HASH') { |
$resulttext .= '<li>'.&mt('Log-in page availability:').'<ul>'; |
$resulttext .= '<li>'.&mt('Log-in page availability:').'<ul>'; |
foreach my $lonhost (sort(keys(%{$changes{$item}}))) { |
foreach my $lonhost (sort(keys(%{$changes{$item}}))) { |