--- loncom/interface/lonuserutils.pm 2008/04/30 23:16:19 1.52 +++ loncom/interface/lonuserutils.pm 2008/05/09 17:55:25 1.53 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.52 2008/04/30 23:16:19 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.53 2008/05/09 17:55:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1252,34 +1252,11 @@ sub print_userlist { if ($env{'form.showrole'} eq 'Any') { $roleselected = ' selected="selected" '; } - my ($role_select,$cnum,$cdom); - if ($context eq 'domain') { - $role_select = &domain_roles_select(); - $r->print(''); - } else { - $role_select = ''; - $r->print(''); - if ($context eq 'course') { - ($cnum,$cdom) = &get_course_identity(); - $r->print(§ion_group_filter($cnum,$cdom)); - } + my ($cnum,$cdom); + $r->print(&role_filter($context)); + if ($context eq 'course') { + ($cnum,$cdom) = &get_course_identity(); + $r->print(§ion_group_filter($cnum,$cdom)); } if (!(($context eq 'domain') && ($env{'form.roletype'} eq 'course'))) { $r->print(' '.&list_submit_button(&mt('Update Display')). @@ -1451,6 +1428,41 @@ sub print_userlist { $env{'form.phase'}.'" />'); } +sub role_filter { + my ($context) = @_; + my $output; + my $roleselected = ''; + if ($env{'form.showrole'} eq 'Any') { + $roleselected = ' selected="selected" '; + } + my ($role_select); + if ($context eq 'domain') { + $role_select = &domain_roles_select(); + $output = ''; + } else { + $role_select = ''; + $output = ''; + } + return $output; +} + sub section_group_filter { my ($cnum,$cdom) = @_; my @filters;