--- loncom/interface/domainprefs.pm 2007/04/10 20:49:07 1.9 +++ loncom/interface/domainprefs.pm 2007/05/29 15:58:41 1.17 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.9 2007/04/10 20:49:07 raeburn Exp $ +# $Id: domainprefs.pm,v 1.17 2007/05/29 15:58:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -145,7 +145,7 @@ sub handler { '); - &print_footer($r,$phase,'process','Store changes'); + &print_footer($r,$phase,'process','Save changes'); } return OK; } @@ -550,6 +550,7 @@ sub display_color_options { $showfile = ''; } } elsif ($imgfile =~ m-^/(adm/[^/]+)/([^/]+)$-) { + $showfile = $imgfile; my $imgdir = $1; my $filename = $2; if (-e "/home/httpd/html/$imgdir/tn-".$filename) { @@ -559,12 +560,17 @@ sub display_color_options { my $output = '/home/httpd/html/'.$imgdir.'/tn-'.$filename; if (!-e $output) { my ($width,$height) = &thumb_dimensions(); - my $size = $width.'x'.$height; - system("convert -sample $size $input $output"); + my ($fullwidth,$fullheight) = &check_dimensions($input); + if ($fullwidth ne '' && $fullheight ne '') { + if ($fullwidth > $width && $fullheight > $height) { + my $size = $width.'x'.$height; + system("convert -sample $size $input $output"); + $showfile = '/'.$imgdir.'/tn-'.$filename; + } + } } - $showfile = '/'.$imgdir.'/tn-'.$filename; } - } + } if ($showfile) { $showfile = &Apache::loncommon::lonhttpdurl($showfile); $fullsize = &Apache::loncommon::lonhttpdurl($imgfile); @@ -733,16 +739,15 @@ sub print_quotas { $datatable .= ''. ''.&mt($othertitle).''. ''. - ' Mb'; return $datatable; } sub print_autoenroll { my ($dom,$settings) = @_; - my $defdom = $dom; my $autorun = &Apache::lonnet::auto_run(undef,$dom), - my ($runon,$runoff); + my ($defdom,$runon,$runoff); if (ref($settings) eq 'HASH') { if (exists($settings->{'run'})) { if ($settings->{'run'} eq '0') { @@ -764,6 +769,14 @@ sub print_autoenroll { if (exists($settings->{'sender_domain'})) { $defdom = $settings->{'sender_domain'}; } + } else { + if ($autorun) { + $runon = ' checked="checked" '; + $runoff = ' '; + } else { + $runoff = ' checked="checked" '; + $runon = ' '; + } } my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1); my $datatable=''. @@ -772,7 +785,7 @@ sub print_autoenroll { ''.&mt('Yes').' '. ''. + $runoff.' value="0" />'.&mt('No').''. ''. ''.&mt('Notification messages - sender'). ''. @@ -951,7 +964,8 @@ sub modify_login { $resulttext = &mt('No changes made to log-in page settings'); } } else { - $resulttext = &mt('An error occurred: [_1]',$putresult); + $resulttext = ''. + &mt('An error occurred: [_1]',$putresult).''; } if ($errors) { $resulttext .= '
'.&mt('The following errors occurred: ').'