--- loncom/interface/lonmenu.pm 2023/09/27 14:07:47 1.537 +++ loncom/interface/lonmenu.pm 2023/09/28 15:56:48 1.538 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.537 2023/09/27 14:07:47 raeburn Exp $ +# $Id: lonmenu.pm,v 1.538 2023/09/28 15:56:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1105,15 +1105,17 @@ sub innerregister { $leftvis = 'inline'; $defdom = $cdom; } - my $sellink = &Apache::loncommon::selectstudent_link('userview','vuname','vudom'); + my $sellink = &Apache::loncommon::selectstudent_link('userview','vuname','vudom','','','vuidentifier'); my $selscript=&Apache::loncommon::studentbrowser_javascript(); my $shownsymb = &HTML::Entities::encode(&Apache::lonenc::check_encrypt($env{'request.symb'}),'<>&"'); - my $input = &mt('User: [_1] or ID: [_2] at: [_3]', - '', - '', - &Apache::loncommon::select_dom_form($defdom,'vudom')). - '', - ''; + my $input = &mt('[_1]Username:[_2] or [_3]ID:[_4] | ', + '', + ''). + ''. + '', + ''; my $chooser = < @@ -2380,6 +2382,7 @@ function toggleViewAsUser(change) { seluserid.style.display = 'inline'; document.getElementById('usexpand').innerHTML=''; document.getElementById('uscollapse').innerHTML='◄ '; + toggleIdentifier(document.userview); } } } @@ -2389,7 +2392,7 @@ function toggleViewAsUser(change) { function validCourseUser(form,change) { var possuname = form.elements['vuname'].value; var possuid = form.elements['vid'].value; - var possudom = form.elements['vudom'].options[form.elements['vudom'].selectedIndex].value; + var possudom = form.elements['vudom'].value; if ((possuname == '') && (possuid == '')) { if (change == 'off') { form.elements['LC_viewas'].value = ''; @@ -2425,6 +2428,30 @@ function validCourseUser(form,change) { return false; } +function toggleIdentifier(form) { + if ((document.getElementById('LC_vuname')) && (document.getElementById('LC_vid'))) { + var radioelem = form.elements['vuidentifier']; + if (radioelem.length > 0) { + var i; + for (i=0; i