--- loncom/interface/domainprefs.pm 2008/02/24 23:18:40 1.43 +++ loncom/interface/domainprefs.pm 2008/02/29 19:07:06 1.44 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.43 2008/02/24 23:18:40 raeburn Exp $ +# $Id: domainprefs.pm,v 1.44 2008/02/29 19:07:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1110,7 +1110,7 @@ ENDCOL sub print_quotas { my ($dom,$settings,$rowtotal) = @_; my $datatable; - my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); + my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); my $typecount = 0; my $css_class; if (ref($types) eq 'ARRAY') { @@ -1240,7 +1240,7 @@ sub print_autoupdate { ''; $$rowtotal += 2; } else { - my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); + my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); my @fields = ('lastname','firstname','middlename','gen', 'permanentemail','id'); my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); @@ -1300,7 +1300,7 @@ sub print_directorysrch { } } my ($searchtitles,$titleorder) = &sorted_searchtitles(); - my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); + my ($othertitle,$usertypes,$types) = &Apache::Loncommon::sorted_inst_types($dom); my $numinrow = 4; my $cansrchrow = 0; @@ -1906,25 +1906,6 @@ sub users_cansearch_row { return $output; } -sub sorted_inst_types { - my ($dom) = @_; - my ($usertypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($dom); - my $othertitle = &mt('All users'); - my @types; - if (ref($order) eq 'ARRAY') { - @types = @{$order}; - } - if (@types == 0) { - if (ref($usertypes) eq 'HASH') { - @types = sort(keys(%{$usertypes})); - } - } - if (keys(%{$usertypes}) > 0) { - $othertitle = &mt('Other users'); - } - return ($othertitle,$usertypes,\@types); -} - sub sorted_searchtitles { my %searchtitles = &Apache::lonlocal::texthash( 'uname' => 'username', @@ -2661,7 +2642,7 @@ END sub modify_quotas { my ($dom,%domconfig) = @_; my ($resulttext,%changes); - my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); + my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); my %formhash; foreach my $key (keys(%env)) { if ($key =~ /^form\.quota_(.+)$/) { @@ -2796,7 +2777,7 @@ sub modify_autoupdate { run => 'Auto-update:', classlists => 'Updates to user information in classlists?' ); - my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); + my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); my %fieldtitles = &Apache::lonlocal::texthash ( id => 'Student/Employee ID', permanentemail => 'E-mail address', @@ -2925,7 +2906,7 @@ sub modify_directorysrch { my @cansearch = &Apache::loncommon::get_env_multiple('form.cansearch'); my @searchby = &Apache::loncommon::get_env_multiple('form.searchby'); - my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); + my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); if (keys(%{$usertypes}) == 0) { @cansearch = ('default'); } else {