--- loncom/auth/lonroles.pm 2014/05/20 20:46:13 1.305 +++ loncom/auth/lonroles.pm 2014/05/31 12:49:12 1.308 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.305 2014/05/20 20:46:13 raeburn Exp $ +# $Id: lonroles.pm,v 1.308 2014/05/31 12:49:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -202,7 +202,7 @@ sub handler { my $r = shift; - # Check for critical messages and redirect if present. + # Check for critical messages and redirect if present. my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); if ($redirect) { &Apache::loncommon::content_type($r,'text/html'); @@ -926,12 +926,7 @@ ENDHEADER # No active roles if ($countactive==0) { - if ($inrole) { - $r->print('

'.&mt('Currently no additional roles, courses or communities').'

'); - } else { - $r->print('

'.&mt('Currently no active roles, courses or communities').'

'); - } - &requestcourse_advice($r,$cattype); + &requestcourse_advice($r,$cattype,$inrole); $r->print(''); if ($countfuture) { $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture)); @@ -1072,11 +1067,7 @@ ENDHEADER my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); $r->print('

' .&mt('This LON-CAPA server is version [_1]',$r->dir_config('lonVersion')) - .'
' - .''.&mt('Logout').'  ' - .'' - .&mt('Course/Community Catalog') - .'

'); + .'

'); } $r->print(&Apache::loncommon::end_page()); return OK; @@ -1444,29 +1435,26 @@ sub findcourse_advice { } sub requestcourse_advice { - my ($r,$cattype) = @_; + my ($r,$cattype,$inrole) = @_; my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description'); my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); - my (%can_request,%request_doms); + my (%can_request,%request_doms,$output); &Apache::lonnet::check_can_request($env{'user.domain'},\%can_request,\%request_doms); if (keys(%request_doms) > 0) { my ($types,$typename) = &Apache::loncommon::course_types(); if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) { - $r->print('

'.&mt('Request creation of a course or community').'

'. - '

'.&mt('You have rights to request the creation of courses and/or communities in the following domain(s):').'

'.&mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.','','').'

'); + } + if ($output) { + $r->print('

'.&mt('Request creation of a course or community').'

'. + '

'. + &mt('You have rights to request the creation of courses and/or communities in the following domain(s):'). + '

'. + &mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.', + '',''). + '

'); + } } } elsif (!$env{'user.adv'}) { + if ($inrole) { + $r->print('

'.&mt('Currently no additional roles, courses or communities').'

'); + } else { + $r->print('

'.&mt('Currently no active roles, courses or communities').'

'); + } &findcourse_advice($r,$cattype); } return;