version 1.41, 2008/01/16 20:42:48
|
version 1.42, 2008/02/15 17:02:31
|
Line 568 sub print_footer {
|
Line 568 sub print_footer {
|
sub print_login { |
sub print_login { |
my ($dom,$confname,$phase,$settings,$rowtotal) = @_; |
my ($dom,$confname,$phase,$settings,$rowtotal) = @_; |
my %choices = &login_choices(); |
my %choices = &login_choices(); |
my ($catalogon,$catalogoff,$adminmailon,$adminmailoff,$loginheader); |
my %defaultchecked = ( |
$catalogon = ' checked="checked" '; |
'coursecatalog' => 'on', |
$adminmailoff = ' checked="checked" '; |
'adminmail' => 'off', |
$loginheader = 'image'; |
); |
|
my @toggles = ('coursecatalog','adminmail'); |
|
my (%checkedon,%checkedoff); |
|
foreach my $item (@toggles) { |
|
if ($defaultchecked{$item} eq 'on') { |
|
$checkedon{$item} = ' checked="checked" '; |
|
$checkedoff{$item} = ' '; |
|
} elsif ($defaultchecked{$item} eq 'off') { |
|
$checkedoff{$item} = ' checked="checked" '; |
|
$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 595 sub print_login {
|
Line 607 sub print_login {
|
$defaults{'links'}{$item} = $defaultdesign{'login.'.$item}; |
$defaults{'links'}{$item} = $defaultdesign{'login.'.$item}; |
} |
} |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{'coursecatalog'} eq '0') { |
foreach my $item (@toggles) { |
$catalogoff = $catalogon; |
if ($settings->{$item} eq '1') { |
$catalogon = ' '; |
$checkedon{$item} = ' checked="checked" '; |
} |
$checkedoff{$item} = ' '; |
if ($settings->{'adminmail'} eq '1') { |
} elsif ($settings->{$item} eq '0') { |
$adminmailon = $adminmailoff; |
$checkedoff{$item} = ' checked="checked" '; |
$adminmailoff = ' '; |
$checkedon{$item} = ' '; |
|
} |
} |
} |
foreach my $item (@images) { |
foreach my $item (@images) { |
if ($settings->{$item} ne '') { |
if ($settings->{$item} ne '') { |
Line 663 sub print_login {
|
Line 676 sub print_login {
|
domlogo => 'Domain Logo', |
domlogo => 'Domain Logo', |
login => 'Login box'); |
login => 'Login box'); |
my $itemcount = 1; |
my $itemcount = 1; |
my $css_class = $itemcount%2?' class="LC_odd_row"':''; |
my ($css_class,$datatable); |
my $datatable = |
foreach my $item (@toggles) { |
'<tr'.$css_class.'><td colspan="2">'.$choices{'coursecatalog'}. |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
'</td><td>'. |
$datatable .= |
'<span class="LC_nobreak"><label><input type="radio" name="coursecatalog"'. |
'<tr'.$css_class.'><td colspan="2">'.$choices{$item}. |
$catalogon.' value="1" />'.&mt('Yes').'</label> '. |
'</td><td>'. |
'<label><input type="radio" name="coursecatalog"'. |
'<span class="LC_nobreak"><label><input type="radio" name="'. |
$catalogoff.'value="0" />'.&mt('No').'</label></span></td>'. |
$item.'"'.$checkedon{$item}.' value="1" />'.&mt('Yes'). |
'</tr>'; |
'</label> <label><input type="radio" name="'.$item.'"'. |
$itemcount ++; |
$checkedoff{$item}.' value="0" />'.&mt('No').'</label></span></td>'. |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
'</tr>'; |
$datatable .= '<tr'.$css_class.'>'. |
$itemcount ++; |
'<td colspan="2">'.$choices{'adminmail'}.'</td>'. |
} |
'<td><span class="LC_nobreak">'. |
|
'<label><input type="radio" name="adminmail"'. |
|
$adminmailon.' value="1" />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="adminmail"'. |
|
$adminmailoff.'value="0" />'.&mt('No').'</label></span></td></tr>'; |
|
$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,$loginheader); |
$datatable .= '</tr></table></td></tr>'; |
$datatable .= '</tr></table></td></tr>'; |
return $datatable; |
return $datatable; |
Line 1906 sub modify_login {
|
Line 1913 sub modify_login {
|
my %loginhash; |
my %loginhash; |
($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], |
($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], |
\%domconfig,\%loginhash); |
\%domconfig,\%loginhash); |
$loginhash{login}{coursecatalog} = $env{'form.coursecatalog'}; |
my @toggles = ('coursecatalog','adminmail'); |
$loginhash{login}{adminmail} = $env{'form.adminmail'}; |
foreach my $item (@toggles) { |
|
$loginhash{login}{$item} = $env{'form.'.$item}; |
|
} |
$loginhash{login}{loginheader} = $env{'form.loginheader'}; |
$loginhash{login}{loginheader} = $env{'form.loginheader'}; |
if (ref($colchanges{'login'}) eq 'HASH') { |
if (ref($colchanges{'login'}) eq 'HASH') { |
$colchgtext = &display_colorchgs($dom,\%colchanges,['login'], |
$colchgtext = &display_colorchgs($dom,\%colchanges,['login'], |
Line 1916 sub modify_login {
|
Line 1925 sub modify_login {
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash, |
$dom); |
$dom); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (($domconfig{'login'}{'coursecatalog'} eq '0') && |
my @toggles = ('coursecatalog','adminmail'); |
($env{'form.coursecatalog'} eq '1')) { |
my %defaultchecked = ( |
$changes{'coursecatalog'} = 1; |
'coursecatalog' => 'on', |
} elsif (($domconfig{'login'}{'coursecatalog'} eq '' || |
'adminmail' => 'off', |
$domconfig{'login'}{'coursecatalog'} eq '1') && |
); |
($env{'form.coursecatalog'} eq '0')) { |
foreach my $item (@toggles) { |
$changes{'coursecatalog'} = 1; |
if ($defaultchecked{$item} eq 'on') { |
} |
if (($domconfig{'login'}{$item} eq '0') && |
if (($domconfig{'login'}{'adminmail'} eq '1') && |
($env{'form.'.$item} eq '1')) { |
($env{'form.adminmail'} eq '0')) { |
$changes{$item} = 1; |
$changes{'adminmail'} = 1; |
} elsif (($domconfig{'login'}{$item} eq '' || |
} elsif (($domconfig{'login'}{'adminmail'} eq '' || |
$domconfig{'login'}{$item} eq '1') && |
$domconfig{'login'}{'adminmail'} eq '0') && |
($env{'form.'.$item} eq '0')) { |
($env{'form.adminmail'} eq '1')) { |
$changes{$item} = 1; |
$changes{'adminmail'} = 1; |
} |
|
} elsif ($defaultchecked{$item} eq 'off') { |
|
if (($domconfig{'login'}{$item} eq '1') && |
|
($env{'form.'.$item} eq '0')) { |
|
$changes{$item} = 1; |
|
} elsif (($domconfig{'login'}{$item} eq '' || |
|
$domconfig{'login'}{$item} eq '0') && |
|
($env{'form.'.$item} eq '1')) { |
|
$changes{$item} = 1; |
|
} |
|
} |
} |
} |
if (($domconfig{'login'}{'loginheader'} eq 'text') && |
if (($domconfig{'login'}{'loginheader'} eq 'text') && |
($env{'form.loginheader'} eq 'image')) { |
($env{'form.loginheader'} eq 'image')) { |