--- loncom/interface/domainprefs.pm 2007/08/26 15:31:03 1.25 +++ loncom/interface/domainprefs.pm 2007/09/01 21:20:14 1.26 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.25 2007/08/26 15:31:03 raeburn Exp $ +# $Id: domainprefs.pm,v 1.26 2007/09/01 21:20:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -745,7 +745,7 @@ sub print_quotas { my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); my $typecount = 0; my $css_class; - if (@{$types} > 0) { + if (ref($types) eq 'ARRAY') { foreach my $type (@{$types}) { if (defined($usertypes->{$type})) { $typecount ++; @@ -768,7 +768,7 @@ sub print_quotas { $typecount ++; $css_class = $typecount%2?' class="LC_odd_row"':''; $datatable .= ''. - ''.&mt($othertitle).''. + ''.$othertitle.''. ''. ' Mb'; @@ -878,10 +878,12 @@ sub print_autoupdate { gen => 'Generation', ); my $numrows = 0; - if (@{$types} > 0) { - $datatable = - &usertype_update_row($settings,$usertypes,\%fieldtitles, - \@fields,$types,\$numrows); + if (ref($types) eq 'ARRAY') { + if (@{$types} > 0) { + $datatable = + &usertype_update_row($settings,$usertypes,\%fieldtitles, + \@fields,$types,\$numrows); + } } $datatable .= &usertype_update_row($settings,{'default' => $othertitle}, @@ -932,6 +934,7 @@ sub print_directorysrch { my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); my $numinrow = 4; + my $cansrchrow = 0; my $datatable=''. ''.&mt('Directory search available?').''. ''. ''; - $datatable .= &users_cansearch_row($settings,$types,$usertypes,$dom, - $numinrow,$othertitle); - $datatable .= ''. - ''.&mt('Supported search methods'). + if (ref($usertypes) eq 'HASH') { + if (keys(%{$usertypes}) > 0) { + $datatable .= &users_cansearch_row($settings,$types,$usertypes,$dom, + $numinrow,$othertitle); + $cansrchrow = 1; + } + } + if ($cansrchrow) { + $datatable .= ''; + } else { + $datatable .= ''; + } + $datatable .= ''.&mt('Supported search methods'). ''; foreach my $title (@{$titleorder}) { if (defined($searchtitles->{$title})) { @@ -967,9 +979,14 @@ sub print_directorysrch { $searchtitles->{$title}.''; } } - $datatable .= '
'. - ''.&mt('Search latitude').''. - ''. + $datatable .= ''; + if ($cansrchrow) { + $datatable .= ''; + } else { + $datatable .= ''; + } + $datatable .= ''.&mt('Search latitude').''. + ''. '