--- loncom/auth/lonroles.pm 2015/03/11 04:53:15 1.269.2.22 +++ loncom/auth/lonroles.pm 2016/08/13 21:17:38 1.269.2.26 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.269.2.22 2015/03/11 04:53:15 raeburn Exp $ +# $Id: lonroles.pm,v 1.269.2.26 2016/08/13 21:17:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -663,6 +663,7 @@ ENDENTERKEY } } # Are we allowed to look at the first resource? + my $access; if ($furl =~ m{^(/adm/wrapper|)/ext/}) { # If it's an external resource, # strip off the symb argument and possible query @@ -670,14 +671,16 @@ ENDENTERKEY # Unencode $symb $symb = &unescape($symb); # Then check for permission - if (!&Apache::lonnet::allowed('bre',$exturl,$symb)) { - $furl = &Apache::lonpageflip::first_accessible_resource(); - } + $access = &Apache::lonnet::allowed('bre',$exturl,$symb); # For other resources just check for permission - } elsif (!&Apache::lonnet::allowed('bre',$furl)) { + } else { + $access = &Apache::lonnet::allowed('bre',$furl); + } + if (!$access) { $furl = &Apache::lonpageflip::first_accessible_resource(); + } elsif ($access eq 'B') { + $furl = '/adm/navmaps?showOnlyHomework=1'; } - $msg = &mt('Entering [_1] ...', $env{'course.'.$cdom.'_'.$cnum.'.description'}); &redirect_user($r, &mt('Entering [_1]', @@ -743,14 +746,20 @@ ENDENTERKEY my $showcount = &roles_from_env(\%roles_in_env,$update); my $swinfo=&Apache::lonmenu::rawconfig(); - my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum}); my %domdefs=&Apache::lonnet::get_domain_defaults($env{'user.domain'}); my $cattype = 'std'; if ($domdefs{'catauth'}) { $cattype = $domdefs{'catauth'}; } my $funcs = &get_roles_functions($showcount,$cattype); - $standby=~s/\n/\\n/g; + my $crumbsright; + if ($env{'browser.mobile'}) { + $crumbsright = $funcs; + undef($funcs); + } + my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum, + bread_crumbs_component=>$crumbsright}); + &js_escape(\$standby); my $noscript='
'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'
'.&mt('As this is not the case, most functionality in the system will be unavailable.').'

'; $r->print(<print('
' - .&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table('LC_textsize_mobile') .&Apache::loncommon::start_data_table_header_row() ); if (!$nochoose) { $r->print(' '); } @@ -1763,10 +1772,11 @@ sub courselink { } sub coursepick_jscript { - my %lt = &Apache::lonlocal::texthash( + my %js_lt = &Apache::lonlocal::texthash( plsu => "Please use the 'Select Course/Community' link to open a separate pick course window where you may select the course or community you wish to enter.", youc => 'You can only use this screen to select courses and communities in the current domain.', ); + &js_escape(\%js_lt); my $verify_script = <<"END";