--- loncom/interface/domainprefs.pm 2007/05/29 15:58:41 1.17 +++ loncom/interface/domainprefs.pm 2007/06/01 01:14:51 1.18 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.17 2007/05/29 15:58:41 raeburn Exp $ +# $Id: domainprefs.pm,v 1.18 2007/06/01 01:14:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -522,13 +522,14 @@ sub display_color_options { ''; my $switchserver = &check_switchserver($dom,$confname); foreach my $img (@{$images}) { - $itemcount ++; + $itemcount ++; $css_class = $itemcount%2?' class="LC_odd_row"':''; $datatable .= ''. ''.$choices->{$img}.''; - my $imgfile; + my ($imgfile, $img_import); if ($designs->{$img} ne '') { $imgfile = $designs->{$img}; + $img_import = ($imgfile =~ m{^/adm/}); } else { $imgfile = $defaults->{$img}; } @@ -578,6 +579,9 @@ sub display_color_options { if (!$is_custom->{$img}) { $datatable .= &mt('Default in use:').'
'; } + if ($img_import) { + $datatable.= ''; + } $datatable.= ''.$alt_text->{$img}.
                              ''; @@ -1052,6 +1056,15 @@ sub modify_colors { } my ($width,$height) = &thumb_dimensions(); foreach my $img (@images) { + if ( ! $env{'form.'.$role.'_'.$img.'.filename'} + && !defined($domconfig->{$role}{$img}) + && !$env{'form.'.$role.'_del_'.$img} + && $env{'form.'.$role.'_import_'.$img}) { + # import the old configured image from the .tab setting + # if they haven't provided a new one + $domconfig->{$role}{$img} = + $env{'form.'.$role.'_import_'.$img}; + } if ($env{'form.'.$role.'_'.$img.'.filename'} ne '') { my $error; if ($configuserok eq 'ok') { @@ -1091,6 +1104,7 @@ sub modify_colors { $dom,$confname,$img,$width,$height); if ($result eq 'ok') { $confhash->{$role}{$img} = $logourl; + $changes{$role}{'images'}{$img} = 1; } } } @@ -1505,6 +1519,7 @@ sub check_switchserver { } my @ids=&Apache::lonnet::current_machine_ids(); foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } + $allowed=0; if (!$allowed) { $switchserver=''.&mt('Switch Server').''; }