--- loncom/interface/domainprefs.pm 2007/04/04 00:10:01 1.7 +++ loncom/interface/domainprefs.pm 2007/04/05 21:36:15 1.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.7 2007/04/04 00:10:01 albertel Exp $ +# $Id: domainprefs.pm,v 1.8 2007/04/05 21:36:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -139,10 +139,6 @@ sub handler { $item,$domconfig{$item->{'action'}}); } $r->print(' - - - - '); @@ -277,7 +273,7 @@ function changePage(formname,newphase) { $js)); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Domain Settings')); $r->print(' -
+ @@ -360,23 +356,16 @@ sub print_login { } } } else { - $designs{'domlogo'} = ''; - if (-e '/home/httpd/html/adm/lonDomLogos/'.$dom.'.gif') { - $designs{'domlogo'} = '/home/httpd/html/adm/lonDomLogos/'.$dom.'.gif'; - $is_custom{'domlogo'} = 1; - } - if ($designhash{$dom.'.login.img'} ne '') { - $designs{'img'} = $designhash{$dom.'.login.img'}; - $is_custom{'img'} = 1; - } - if ($designhash{$dom.'.login.logo'} ne '') { - $designs{'logo'} = $designhash{$dom.'.login.logo'}; - $is_custom{'logo'} = 1; - } if ($designhash{$dom.'.login.font'} ne '') { $designs{'font'} = $designhash{$dom.'.login.font'}; $is_custom{'font'} = 1; } + foreach my $item (@images) { + if ($designhash{$dom.'.login.'.$item} ne '') { + $designs{$item} = $designhash{$dom.'.login.'.$item}; + $is_custom{$item} = 1; + } + } foreach my $item (@bgs) { if ($designhash{$dom.'.login.'.$item} ne '') { $designs{'bgs'}{$item} = $designhash{$dom.'.login.'.$item}; @@ -398,20 +387,20 @@ sub print_login { my $datatable = ''.$choices{'coursecatalog'}. ''. - ''.&mt('Yes').' '. - ''.&mt('No').''. + ' '. + ''. ''; $itemcount ++; $css_class = $itemcount%2?' class="LC_odd_row"':''; $datatable .= ''. ''.$choices{'adminmail'}.''. - ''. - ''.&mt('Yes').' '. - ''.&mt('No').''; + ''. + ' '. + ''; $itemcount ++; $datatable .= &display_color_options($dom,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text); $datatable .= ''; @@ -506,7 +495,7 @@ sub print_rolecolors { } } my $itemcount = 1; - my $datatable = display_color_options($dom,$phase,$role,$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text); + my $datatable = &display_color_options($dom,$phase,$role,$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text); $datatable .= ''; return $datatable; } @@ -524,14 +513,14 @@ sub display_color_options { $datatable .= ' '; } my $fontlink = &color_pick($phase,$role,'font',$choices->{'font'},$designs->{'font'}); - $datatable .= ''. + $datatable .= ''. ' '.$fontlink. - ''; + ' value="'.$designs->{'font'}.'" /> '.$fontlink. + ''; foreach my $img (@{$images}) { $itemcount ++; $css_class = $itemcount%2?' class="LC_odd_row"':''; - $datatable .= ''. + $datatable .= ''. ''.$choices->{$img}.''; my $imgfile; if ($designs->{$img} ne '') { @@ -578,8 +567,9 @@ sub display_color_options { $datatable.= ''.
                              $alt_text->{$img}.''; if ($is_custom->{$img}) { - $datatable.=''. - &mt('Delete?').' '.&mt('Replace:').'
'; + $datatable.=' '.&mt('Replace:').'
'; } else { $datatable.=''.&mt('Upload:').'
'; } @@ -591,7 +581,7 @@ sub display_color_options { $datatable .= '
'. &mt('Upload:'); } - $datatable .= ' '; + $datatable .= ' '; } $itemcount ++; $css_class = $itemcount%2?' class="LC_odd_row"':''; @@ -604,7 +594,7 @@ sub display_color_options { } } if ($bgs_def) { - $datatable .= ''.&mt('Default(s) in use').'
'.$bgs_def.'
'; + $datatable .= ''.&mt('Default(s) in use:').'
'.$bgs_def.'
'; } else { $datatable .= ' '; } @@ -631,7 +621,7 @@ sub display_color_options { } } if ($links_def) { - $datatable .= ''.&mt('Default(s) in use').'
'.$links_def.'
'; + $datatable .= ''.&mt('Default(s) in use:').'
'.$links_def.'
'; } else { $datatable .= ' '; } @@ -710,10 +700,10 @@ sub print_quotas { $css_class = $typecount%2?' class="LC_odd_row"':''; $datatable .= ''. ''.$usertypes->{$type}.''. - ''. + ''. ' Mb'; + '" size="5" /> Mb'; } } $othertitle = "Other users"; @@ -728,9 +718,9 @@ sub print_quotas { $css_class = $typecount%2?' class="LC_odd_row"':''; $datatable .= ''. ''.&mt($othertitle).''. - ''. + ''. ' Mb'; + $defaultquota.'" size="5" /> Mb'; return $datatable; } @@ -764,19 +754,19 @@ sub print_autoenroll { my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1); my $datatable=''. ''.&mt('Auto-enrollment active?').''. - ''. + ''. + $runon.' value="1" />'.&mt('Yes').' '. + ''. ''. ''.&mt('Notification messages - sender'). - ''. + ''. &mt('username').': '. '  '.&mt('domain'). - ': '.$domform.''; + ': '.$domform.''; return $datatable; } @@ -804,18 +794,18 @@ sub print_autoupdate { ); $datatable = ''. ''.&mt($title{'run'}).''. - ''. - ''.&mt('Yes').' '. + ''. + $updateon.' value="1" />'.&mt('Yes').' '. + ''. ''. ''.&mt($title{'classlists'}).''. - ''. - ''.&mt('Yes').' '. - ''.&mt('No').''. + ''. + ' '. + ''. ''; } else { my ($usertypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($dom); @@ -892,10 +882,10 @@ sub usertype_update_row { } else { $datatable .= ''; } - $datatable .= ''. - $fieldtitles->{$fields->[$i]}.''; + $datatable .= ''; } $datatable .= ''; } @@ -1017,7 +1007,7 @@ sub modify_colors { foreach my $item (@bgs,@links) { $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item}; } - foreach my $img (@images) { + foreach my $img (@images) { if ($env{'form.'.$role.'_'.$img.'.filename'} ne '') { my $configuserok; if (&Apache::lonnet::homeserver($configuname,$dom) eq 'no_host') { @@ -1043,8 +1033,12 @@ sub modify_colors { } } else { my $error = &mt("Upload of image [_1] for $role page(s) failed because a Domain Configuation user ([_2]) could not be created in domain: [_3]. Error was: [_4].",$img,$configuname,$dom,$configuserok); - &Apache::lonnet::logthis($error); - $errors .= '
  • '.$error.'
  • '; + &Apache::lonnet::logthis($error); + $errors .= '
  • '.$error.'
  • '; + } + } elsif ($domconfig->{$role}{$img} ne '') { + if ($domconfig->{$role}{$img} !~ m|^/uploaded/\Q$dom\E/\Q$dom\E\-domainconfig/portfolio/\$img/.+|) { + #FIXME copy file to target directory } } }