--- loncom/interface/domainprefs.pm 2007/04/03 18:47:23 1.6
+++ loncom/interface/domainprefs.pm 2007/04/10 21:40:12 1.10
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.6 2007/04/03 18:47:23 raeburn Exp $
+# $Id: domainprefs.pm,v 1.10 2007/04/10 21:40:12 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,7 @@ use Apache::lonhtmlcommon();
use Apache::lonlocal;
use LONCAPA();
use LONCAPA::Enrollment;
+use File::Copy;
sub handler {
my $r=shift;
@@ -111,6 +112,7 @@ sub handler {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'display')",
text=>"Domain Configuration"});
+ my $confname = $dom.'-domainconfig';
if ($phase eq 'process') {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:changePage(document.$phase,'$phase')",
@@ -118,7 +120,8 @@ sub handler {
&print_header($r,$phase);
foreach my $item (@prefs) {
$r->print('
'.&mt($item->{'text'}).'
'.
- &process_changes($r,$dom,$item->{'action'},\@roles,%domconfig));
+ &process_changes($r,$dom,$confname,
+ $item->{'action'},\@roles,%domconfig));
}
$r->print('');
&print_footer($r,$phase,'display','Back to actions menu');
@@ -135,14 +138,10 @@ sub handler {
if ($item->{'action'} eq 'login') {
$r->print('
| ');
}
- &print_config_box($r,$dom,$phase,$item->{'action'},
+ &print_config_box($r,$dom,$confname,$phase,$item->{'action'},
$item,$domconfig{$item->{'action'}});
}
$r->print('
-
- |
-
-
');
@@ -152,12 +151,13 @@ sub handler {
}
sub process_changes {
- my ($r,$dom,$action,$roles,%domconfig) = @_;
+ my ($r,$dom,$confname,$action,$roles,%domconfig) = @_;
my $output;
if ($action eq 'login') {
- $output = &modify_login($r,$dom,%domconfig);
+ $output = &modify_login($r,$dom,$confname,%domconfig);
} elsif ($action eq 'rolecolors') {
- $output = &modify_rolecolors($r,$dom,$roles,%domconfig);
+ $output = &modify_rolecolors($r,$dom,$confname,$roles,
+ %domconfig);
} elsif ($action eq 'quotas') {
$output = &modify_quotas($dom,%domconfig);
} elsif ($action eq 'autoenroll') {
@@ -169,7 +169,7 @@ sub process_changes {
}
sub print_config_box {
- my ($r,$dom,$phase,$action,$item,$settings) = @_;
+ my ($r,$dom,$confname,$phase,$action,$item,$settings) = @_;
$r->print('
@@ -189,7 +189,7 @@ sub print_config_box {
if ($action eq 'autoupdate') {
$r->print(&print_autoupdate('top',$dom,$settings));
} else {
- $r->print(&print_rolecolors($phase,'student',$dom,$settings));
+ $r->print(&print_rolecolors($phase,'student',$dom,$confname,$settings));
}
$r->print('
@@ -205,7 +205,7 @@ sub print_config_box {
if ($action eq 'autoupdate') {
$r->print(&print_autoupdate('bottom',$dom,$settings));
} else {
- $r->print(&print_rolecolors($phase,'coordinator',$dom,$settings).'
+ $r->print(&print_rolecolors($phase,'coordinator',$dom,$confname,$settings).'
@@ -216,7 +216,7 @@ sub print_config_box {
'.$item->{'header'}->[2]->{'col1'}.' |
'.$item->{'header'}->[2]->{'col2'}.' |
'.
- &print_rolecolors($phase,'author',$dom,$settings).'
+ &print_rolecolors($phase,'author',$dom,$confname,$settings).'
@@ -227,7 +227,7 @@ sub print_config_box {
'.$item->{'header'}->[3]->{'col1'}.' |
'.$item->{'header'}->[3]->{'col2'}.' |
'.
- &print_rolecolors($phase,'admin',$dom,$settings));
+ &print_rolecolors($phase,'admin',$dom,$confname,$settings));
}
} else {
$r->print('
@@ -246,7 +246,7 @@ sub print_config_box {
'.$item->{'header'}->[0]->{'col2'}.' |
');
if ($action eq 'login') {
- $r->print(&print_login($dom,$phase,$settings));
+ $r->print(&print_login($dom,$confname,$phase,$settings));
} elsif ($action eq 'quotas') {
$r->print(&print_quotas($dom,$settings));
} elsif ($action eq 'autoenroll') {
@@ -277,7 +277,7 @@ function changePage(formname,newphase) {
$js));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Domain Settings'));
$r->print('
-