version 1.74, 2008/12/10 15:55:08
|
version 1.76.2.5, 2008/12/26 16:34:43
|
Line 39 use Apache::lonlocal;
|
Line 39 use Apache::lonlocal;
|
use Apache::lonmsg(); |
use Apache::lonmsg(); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA::Enrollment; |
use LONCAPA::Enrollment; |
use LONCAPA::loncgi(); |
use LONCAPA::lonauthcgi(); |
use File::Copy; |
use File::Copy; |
use Locale::Language; |
use Locale::Language; |
use DateTime::TimeZone; |
use DateTime::TimeZone; |
Line 271 sub handler {
|
Line 271 sub handler {
|
$r->print('<input type="hidden" name="phase" value="" />'. |
$r->print('<input type="hidden" name="phase" value="" />'. |
'<input type="hidden" name="numcols" value="'. |
'<input type="hidden" name="numcols" value="'. |
$env{'form.numcols'}.'" />'."\n". |
$env{'form.numcols'}.'" />'."\n". |
'<span clas="LC_error">'.&mt('No settings chosen'). |
'<span class="LC_error">'.&mt('No settings chosen'). |
'</span>'); |
'</span>'); |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
Line 817 sub login_choices {
|
Line 817 sub login_choices {
|
bgs => "Background colors", |
bgs => "Background colors", |
links => "Link colors", |
links => "Link colors", |
font => "Font color", |
font => "Font color", |
pgbg => "Header", |
pgbg => "Page", |
mainbg => "Page", |
mainbg => "Main panel", |
sidebg => "Login box", |
sidebg => "Side panel", |
link => "Link", |
link => "Link", |
alink => "Active link", |
alink => "Active link", |
vlink => "Visited link", |
vlink => "Visited link", |
Line 1246 sub print_quotas {
|
Line 1246 sub print_quotas {
|
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
foreach my $type (@{$types}) { |
foreach my $type (@{$types}) { |
my $currdefquota; |
my $currdefquota; |
if (ref($settings->{defaultquota}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
$currdefquota = $settings->{defaultquota}->{$type}; |
if (ref($settings->{defaultquota}) eq 'HASH') { |
} else { |
$currdefquota = $settings->{defaultquota}->{$type}; |
$currdefquota = $settings->{$type}; |
} else { |
|
$currdefquota = $settings->{$type}; |
|
} |
} |
} |
if (defined($usertypes->{$type})) { |
if (defined($usertypes->{$type})) { |
$typecount ++; |
$typecount ++; |
Line 1259 sub print_quotas {
|
Line 1261 sub print_quotas {
|
'<td class="LC_left_item">'; |
'<td class="LC_left_item">'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my $checked = 'checked="checked" '; |
my $checked = 'checked="checked" '; |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{$item}->{$type} == 0) { |
if (ref($settings->{$item}) eq 'HASH') { |
$checked = ''; |
if ($settings->{$item}->{$type} == 0) { |
|
$checked = ''; |
|
} |
} |
} |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
Line 1291 sub print_quotas {
|
Line 1295 sub print_quotas {
|
'<td class="LC_left_item">'; |
'<td class="LC_left_item">'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my $checked = 'checked="checked" '; |
my $checked = 'checked="checked" '; |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{$item}->{'default'} == 0) { |
if (ref($settings->{$item}) eq 'HASH') { |
$checked = ''; |
if ($settings->{$item}->{'default'} == 0) { |
|
$checked = ''; |
|
} |
} |
} |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
Line 1311 sub print_quotas {
|
Line 1317 sub print_quotas {
|
'<td class="LC_left_item" colspan="2"><br />'; |
'<td class="LC_left_item" colspan="2"><br />'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my $checked = 'checked="checked" '; |
my $checked = 'checked="checked" '; |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{$item}->{'_LC_adv'} == 0) { |
if (ref($settings->{$item}) eq 'HASH') { |
$checked = ''; |
if ($settings->{$item}->{'_LC_adv'} == 0) { |
|
$checked = ''; |
|
} |
} |
} |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
Line 2364 sub print_serverstatuses {
|
Line 2372 sub print_serverstatuses {
|
} |
} |
} |
} |
} |
} |
my $titles= &LONCAPA::loncgi::serverstatus_titles(); |
my $titles= &LONCAPA::lonauthcgi::serverstatus_titles(); |
my $rownum = 0; |
my $rownum = 0; |
my $css_class; |
my $css_class; |
foreach my $type (@pages) { |
foreach my $type (@pages) { |
Line 2874 sub color_font_choices {
|
Line 2882 sub color_font_choices {
|
links => "Link colors", |
links => "Link colors", |
images => "Images", |
images => "Images", |
font => "Font color", |
font => "Font color", |
pgbg => "Header", |
pgbg => "Page", |
tabbg => "Header", |
tabbg => "Header", |
sidebg => "Border", |
sidebg => "Border", |
link => "Link", |
link => "Link", |
Line 3603 sub modify_quotas {
|
Line 3611 sub modify_quotas {
|
} |
} |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
my %newenv; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
if (ref($changes{$item}) eq 'HASH') { |
if (ref($changes{$item}) eq 'HASH') { |
my $hashid = $env{'user.name'}.':'.$env{'user.domain'}; |
my $newacc = |
&Apache::lonnet::devalidate_cache_new('usertools.'.$item,$hashid); |
&Apache::lonnet::usertools_access($env{'user.name'}, |
|
$env{'user.domain'}, |
|
$item,'reload'); |
|
if ($env{'environment.availabletools.'.$item} ne $newacc) { |
|
$newenv{'environment.availabletools.'.$item} = $newacc; |
|
} |
$resulttext .= '<li>'.$titles{$item}.'<ul>'; |
$resulttext .= '<li>'.$titles{$item}.'<ul>'; |
foreach my $type (@{$types},'default','_LC_adv') { |
foreach my $type (@{$types},'default','_LC_adv') { |
if ($changes{$item}{$type}) { |
if ($changes{$item}{$type}) { |
Line 3627 sub modify_quotas {
|
Line 3641 sub modify_quotas {
|
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
|
if (keys(%newenv)) { |
|
&Apache::lonnet::appenv(\%newenv); |
|
} |
} else { |
} else { |
$resulttext = &mt('No changes made to availability of home pages, blogs, portfolios or default quotas'); |
$resulttext = &mt('No changes made to availability of home pages, blogs, portfolios or default quotas'); |
} |
} |
Line 4980 sub modify_serverstatuses {
|
Line 4997 sub modify_serverstatuses {
|
} |
} |
my @currmachines = split(/,/,$currserverstatus{$type}{'machines'}); |
my @currmachines = split(/,/,$currserverstatus{$type}{'machines'}); |
my @newmachines = split(/,/,$newserverstatus{$type}{'machines'}); |
my @newmachines = split(/,/,$newserverstatus{$type}{'machines'}); |
foreach my $item (@currmachines) { |
if (@currmachines > 0) { |
if (!grep(/^\Q$item\E$/,@newmachines)) { |
if (@newmachines > 0) { |
$changes{$type}{'machines'} = 1; |
foreach my $item (@currmachines) { |
last; |
if (!grep(/^\Q$item\E$/,@newmachines)) { |
} |
$changes{$type}{'machines'} = 1; |
} |
last; |
foreach my $item (@newmachines) { |
} |
if (!grep(/^\Q$item\E$/,@currmachines)) { |
} |
|
foreach my $item (@newmachines) { |
|
if (!grep(/^\Q$item\E$/,@currmachines)) { |
|
$changes{$type}{'machines'} = 1; |
|
last; |
|
} |
|
} |
|
} else { |
$changes{$type}{'machines'} = 1; |
$changes{$type}{'machines'} = 1; |
last; |
|
} |
} |
|
} elsif (@newmachines > 0) { |
|
$changes{$type}{'machines'} = 1; |
} |
} |
|
|
} |
} |
} |
} |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
my $titles= &LONCAPA::loncgi::serverstatus_titles(); |
my $titles= &LONCAPA::lonauthcgi::serverstatus_titles(); |
my $putresult = &Apache::lonnet::put_dom('configuration', |
my $putresult = &Apache::lonnet::put_dom('configuration', |
\%serverstatushash,$dom); |
\%serverstatushash,$dom); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |