--- loncom/auth/lonroles.pm 2006/06/07 20:07:09 1.156 +++ loncom/auth/lonroles.pm 2006/06/07 20:52:16 1.157 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.156 2006/06/07 20:07:09 albertel Exp $ +# $Id: lonroles.pm,v 1.157 2006/06/07 20:52:16 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -266,18 +266,14 @@ ENDENTERKEY } else { my $type = 'Course/Group'; if (!$env{'request.course.id'}) { - if (defined($env{'course.'. - $env{'request.course.id'}.'.type'})) { - $type = $env{'course.'. - $env{'request.course.id'}.'.type'}; - } + $type = &Apache::loncommon::course_type(); &Apache::lonnet::appenv( "request.course.id" => $cdom.'_'.$cnum); $furl='/adm/roles?tryagain=1'; $msg= - '

'. - &mt('Could not initialize [_1] at this time.',lc($type)). - '

'.&mt('Please try again.').'

'.$ferr; + '

'. + &mt('Could not initialize '.lc($type).' at this time.'). + '

'.&mt('Please try again.').'

'.$ferr; } if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; } &Apache::lonnet::appenv('request.role.adv'=>$tadv); @@ -305,7 +301,7 @@ ENDENTERKEY ) { my $startpage = &courseloadpage($courseid); unless ($startpage eq 'firstres') { - $msg = &mt('Entering [_1] ....',lc($type)); + $msg = &mt('Entering '.lc($type).' ....'); &redirect_user($r,&mt('New in course'), '/adm/whatsnew?refpage=start',$msg, $env{'environment.remotenavmap'}); @@ -318,8 +314,8 @@ ENDENTERKEY # Guess not ... $furl=&Apache::lonpageflip::first_accessible_resource(); } - $msg = &mt('Entering [_1] ...',lc($type)); - &redirect_user($r,&mt('Entering [_1]',$type), + $msg = &mt('Entering '.lc($type).' ...'); + &redirect_user($r,&mt('Entering '.$type), $furl,$msg, $env{'environment.remotenavmap'}); } @@ -424,8 +420,8 @@ ENDHEADER } else { if ($env{'user.error.msg'}) { $r->print( - '

'. - &mt('You need to choose another user role or enter a specific course for this function').'

'); + '

'. + &mt('You need to choose another user role or enter a specific course for this function').'

'); } } # -------------------------------------------------------- Choice or no choice? @@ -745,10 +741,8 @@ ENDHEADER $ttype='Construction Space'; $twhere='User: '.$trest.', Domain: '.$tdom; } else { - $ttype='Course'; - if (defined($env{'course.'.$tdom.'_'.$trest.'.type'})) { - $ttype = $env{'course.'.$tdom.'_'.$trest.'.type'}; - } + $ttype= + &Apache::loncommon::course_type($tdom.'_'.$trest); $twhere=$env{'course.'.$tdom.'_'.$trest.'.description'}; if ($tsec) { $twhere.=' (Section: '.$tsec.')';