version 1.269.2.19, 2014/05/05 11:44:18
|
version 1.269.2.26, 2016/08/13 21:17:38
|
Line 128 package Apache::lonroles;
|
Line 128 package Apache::lonroles;
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonuserstate(); |
use Apache::lonuserstate(); |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common REDIRECT); |
use Apache::File(); |
use Apache::File(); |
use Apache::lonmenu; |
use Apache::lonmenu; |
use Apache::loncommon; |
use Apache::loncommon; |
Line 208 sub handler {
|
Line 208 sub handler {
|
|
|
my $r = shift; |
my $r = shift; |
|
|
|
# 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'); |
|
$r->header_out(Location => $url); |
|
return REDIRECT; |
|
} |
|
|
my $now=time; |
my $now=time; |
my $then=$env{'user.login.time'}; |
my $then=$env{'user.login.time'}; |
my $refresh=$env{'user.refresh.time'}; |
my $refresh=$env{'user.refresh.time'}; |
Line 253 sub handler {
|
Line 261 sub handler {
|
my $envkey; |
my $envkey; |
my %dcroles = (); |
my %dcroles = (); |
my $numdc = &check_fordc(\%dcroles,$update,$then); |
my $numdc = &check_fordc(\%dcroles,$update,$then); |
my $loncaparev = $Apache::lonnet::perlvar{'lonVersion'}; |
my $loncaparev = $r->dir_config('lonVersion'); |
|
|
# ================================================================== Roles Init |
# ================================================================== Roles Init |
if ($env{'form.selectrole'}) { |
if ($env{'form.selectrole'}) { |
Line 284 sub handler {
|
Line 292 sub handler {
|
&Apache::lonnet::put('email_status',\%temp); |
&Apache::lonnet::put('email_status',\%temp); |
&Apache::lonnet::delenv('user.state.'.$env{'request.course.id'}); |
&Apache::lonnet::delenv('user.state.'.$env{'request.course.id'}); |
} |
} |
&Apache::lonnet::appenv({"request.course.id" => '', |
&Apache::lonnet::appenv({"request.course.id" => '', |
"request.course.fn" => '', |
"request.course.fn" => '', |
"request.course.uri" => '', |
"request.course.uri" => '', |
"request.course.sec" => '', |
"request.course.sec" => '', |
"request.course.tied" => '', |
"request.course.tied" => '', |
"request.role" => 'cm', |
"request.course.timechecked" => '', |
"request.role.adv" => $env{'user.adv'}, |
"request.role" => 'cm', |
"request.role.domain" => $env{'user.domain'}}); |
"request.role.adv" => $env{'user.adv'}, |
|
"request.role.domain" => $env{'user.domain'}}); |
# Check if user is a DC trying to enter a course or author space and needs privs to be created |
# Check if user is a DC trying to enter a course or author space and needs privs to be created |
if ($numdc > 0) { |
if ($numdc > 0) { |
foreach my $envkey (keys(%env)) { |
foreach my $envkey (keys(%env)) { |
Line 380 sub handler {
|
Line 389 sub handler {
|
my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired'); |
my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired'); |
if ($curr_reqd_hash{'internal.releaserequired'} ne '') { |
if ($curr_reqd_hash{'internal.releaserequired'} ne '') { |
my ($switchserver,$switchwarning) = |
my ($switchserver,$switchwarning) = |
&check_release_required($loncaparev,$cdom.'_'.$cnum,$trolecode,$curr_reqd_hash{'internal.releaserequired'}); |
&Apache::loncommon::check_release_required($loncaparev,$cdom.'_'.$cnum,$trolecode, |
|
$curr_reqd_hash{'internal.releaserequired'}); |
if ($switchwarning ne '' || $switchserver ne '') { |
if ($switchwarning ne '' || $switchserver ne '') { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
my $end_page=&Apache::loncommon::end_page(); |
$r->print(&Apache::loncommon::check_release_result($switchwarning,$switchserver)); |
$r->print(&Apache::loncommon::start_page('Selected course unavailable on this server'). |
|
'<p class="LC_warning">'); |
|
if ($switchwarning) { |
|
$r->print($switchwarning.'<br /><a href="/adm/roles">'); |
|
if (&Apache::loncommon::show_course()) { |
|
$r->print(&mt('Display courses')); |
|
} else { |
|
$r->print(&mt('Display roles')); |
|
} |
|
$r->print('</a>'); |
|
} elsif ($switchserver) { |
|
$r->print(&mt('This course requires a newer version of LON-CAPA than is installed on this server.'). |
|
'<br />'. |
|
'<a href="/adm/switchserver?'.$switchserver.'">'. |
|
&mt('Switch Server'). |
|
'</a>'); |
|
} |
|
$r->print('</p>'.&Apache::loncommon::end_page()); |
|
return OK; |
return OK; |
} |
} |
} |
} |
Line 650 ENDENTERKEY
|
Line 642 ENDENTERKEY
|
} |
} |
} |
} |
&redirect_user($r, &mt('Entering [_1]', |
&redirect_user($r, &mt('Entering [_1]', |
$env{'course.'.$env{'request.course.id'}.'.description'}), |
$env{'course.'.$cdom.'_'.$cnum.'.description'}), |
$dest, $msg); |
$dest, $msg); |
return OK; |
return OK; |
} |
} |
Line 671 ENDENTERKEY
|
Line 663 ENDENTERKEY
|
} |
} |
} |
} |
# Are we allowed to look at the first resource? |
# Are we allowed to look at the first resource? |
|
my $access; |
if ($furl =~ m{^(/adm/wrapper|)/ext/}) { |
if ($furl =~ m{^(/adm/wrapper|)/ext/}) { |
# If it's an external resource, |
# If it's an external resource, |
# strip off the symb argument and possible query |
# strip off the symb argument and possible query |
Line 678 ENDENTERKEY
|
Line 671 ENDENTERKEY
|
# Unencode $symb |
# Unencode $symb |
$symb = &unescape($symb); |
$symb = &unescape($symb); |
# Then check for permission |
# Then check for permission |
if (!&Apache::lonnet::allowed('bre',$exturl,$symb)) { |
$access = &Apache::lonnet::allowed('bre',$exturl,$symb); |
$furl = &Apache::lonpageflip::first_accessible_resource(); |
|
} |
|
# For other resources just check for permission |
# 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(); |
$furl = &Apache::lonpageflip::first_accessible_resource(); |
|
} elsif ($access eq 'B') { |
|
$furl = '/adm/navmaps?showOnlyHomework=1'; |
} |
} |
|
|
$msg = &mt('Entering [_1] ...', |
$msg = &mt('Entering [_1] ...', |
$env{'course.'.$cdom.'_'.$cnum.'.description'}); |
$env{'course.'.$cdom.'_'.$cnum.'.description'}); |
&redirect_user($r, &mt('Entering [_1]', |
&redirect_user($r, &mt('Entering [_1]', |
Line 751 ENDENTERKEY
|
Line 746 ENDENTERKEY
|
my $showcount = &roles_from_env(\%roles_in_env,$update); |
my $showcount = &roles_from_env(\%roles_in_env,$update); |
|
|
my $swinfo=&Apache::lonmenu::rawconfig(); |
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 %domdefs=&Apache::lonnet::get_domain_defaults($env{'user.domain'}); |
my $cattype = 'std'; |
my $cattype = 'std'; |
if ($domdefs{'catauth'}) { |
if ($domdefs{'catauth'}) { |
$cattype = $domdefs{'catauth'}; |
$cattype = $domdefs{'catauth'}; |
} |
} |
my $funcs = &get_roles_functions($showcount,$cattype); |
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='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
|
|
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
Line 924 ENDHEADER
|
Line 925 ENDHEADER
|
|
|
# No active roles |
# No active roles |
if ($countactive==0) { |
if ($countactive==0) { |
if ($inrole) { |
&requestcourse_advice($r,$cattype,$inrole); |
$r->print('<h2>'.&mt('Currently no additional roles, courses or communities').'</h2>'); |
|
} else { |
|
$r->print('<h2>'.&mt('Currently no active roles, courses or communities').'</h2>'); |
|
} |
|
&requestcourse_advice($r,$cattype); |
|
$r->print('</form>'); |
$r->print('</form>'); |
if ($countfuture) { |
if ($countfuture) { |
$r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture)); |
$r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture)); |
Line 1070 ENDHEADER
|
Line 1066 ENDHEADER
|
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); |
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); |
$r->print('<p><small><i>' |
$r->print('<p><small><i>' |
.&mt('This LON-CAPA server is version [_1]',$r->dir_config('lonVersion')) |
.&mt('This LON-CAPA server is version [_1]',$r->dir_config('lonVersion')) |
.'</i><br />' |
.'</i></small></p>'); |
.'<a href="/adm/logout">'.&mt('Logout').'</a> ' |
|
.'<a href="/adm/coursecatalog?showdom='.$esc_dom.'">' |
|
.&mt('Course/Community Catalog') |
|
.'</a></small></p>'); |
|
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
Line 1218 sub gather_roles {
|
Line 1210 sub gather_roles {
|
my $required = $env{'course.'.$tcourseid.'.internal.releaserequired'}; |
my $required = $env{'course.'.$tcourseid.'.internal.releaserequired'}; |
if ($required ne '') { |
if ($required ne '') { |
($switchserver,$switchwarning) = |
($switchserver,$switchwarning) = |
&check_release_required($loncaparev,$tcourseid,$trolecode,$required); |
&Apache::loncommon::check_release_required($loncaparev,$tcourseid,$trolecode,$required); |
if ($switchserver || $switchwarning) { |
if ($switchserver || $switchwarning) { |
$button = 0; |
$button = 0; |
} |
} |
Line 1241 sub gather_roles {
|
Line 1233 sub gather_roles {
|
my $required = $newhash{'internal.releaserequired'}; |
my $required = $newhash{'internal.releaserequired'}; |
if ($required ne '') { |
if ($required ne '') { |
($switchserver,$switchwarning) = |
($switchserver,$switchwarning) = |
&check_release_required($loncaparev,$tcourseid,$trolecode,$required); |
&Apache::loncommon::check_release_required($loncaparev,$tcourseid,$trolecode,$required); |
if ($switchserver || $switchwarning) { |
if ($switchserver || $switchwarning) { |
$button = 0; |
$button = 0; |
} |
} |
Line 1342 sub roletable_headers {
|
Line 1334 sub roletable_headers {
|
my $doheaders; |
my $doheaders; |
if ((ref($sortrole) eq 'HASH') && (ref($roleclass) eq 'HASH')) { |
if ((ref($sortrole) eq 'HASH') && (ref($roleclass) eq 'HASH')) { |
$r->print('<br />' |
$r->print('<br />' |
.&Apache::loncommon::start_data_table() |
.&Apache::loncommon::start_data_table('LC_textsize_mobile') |
.&Apache::loncommon::start_data_table_header_row() |
.&Apache::loncommon::start_data_table_header_row() |
); |
); |
if (!$nochoose) { $r->print('<th> </th>'); } |
if (!$nochoose) { $r->print('<th> </th>'); } |
Line 1442 sub findcourse_advice {
|
Line 1434 sub findcourse_advice {
|
} |
} |
|
|
sub requestcourse_advice { |
sub requestcourse_advice { |
my ($r,$cattype) = @_; |
my ($r,$cattype,$inrole) = @_; |
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description'); |
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description'); |
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); |
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); |
&Apache::lonnet::check_can_request($env{'user.domain'},\%can_request,\%request_doms); |
if (keys(%request_doms) > 0) { |
if (keys(%request_doms) > 0) { |
my ($types,$typename) = &Apache::loncommon::course_types(); |
my ($types,$typename) = &Apache::loncommon::course_types(); |
if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) { |
if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) { |
$r->print('<h3>'.&mt('Request creation of a course or community').'</h3>'. |
|
'<p>'.&mt('You have rights to request the creation of courses and/or communities in the following domain(s):').'<ul>'); |
|
my (@reqdoms,@reqtypes); |
my (@reqdoms,@reqtypes); |
foreach my $type (sort(keys(%request_doms))) { |
foreach my $type (sort(keys(%request_doms))) { |
push(@reqtypes,$type); |
push(@reqtypes,$type); |
if (ref($request_doms{$type}) eq 'ARRAY') { |
if (ref($request_doms{$type}) eq 'ARRAY') { |
my $domstr = join(', ',map { &Apache::lonnet::domain($_) } sort(@{$request_doms{$type}})); |
my $domstr = join(', ',map { &Apache::lonnet::domain($_) } sort(@{$request_doms{$type}})); |
$r->print( |
$output .= |
'<li>' |
'<li>' |
.&mt('[_1]'.$typename->{$type}.'[_2] in domain: [_3]', |
.&mt('[_1]'.$typename->{$type}.'[_2] in domain: [_3]', |
'<i>', |
'<i>', |
'</i>', |
'</i>', |
'<b>'.$domstr.'</b>') |
'<b>'.$domstr.'</b>') |
.'</li>' |
.'</li>'; |
); |
|
foreach my $dom (@{$request_doms{$type}}) { |
foreach my $dom (@{$request_doms{$type}}) { |
unless (grep(/^\Q$dom\E/,@reqdoms)) { |
unless (grep(/^\Q$dom\E/,@reqdoms)) { |
push(@reqdoms,$dom); |
push(@reqdoms,$dom); |
Line 1487 sub requestcourse_advice {
|
Line 1476 sub requestcourse_advice {
|
} |
} |
if (@reqdoms == 1 || @showtypes > 0) { |
if (@reqdoms == 1 || @showtypes > 0) { |
$requrl .= '&state=crstype&action=new'; |
$requrl .= '&state=crstype&action=new'; |
} |
} |
$r->print('</ul>'.&mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.','<a href="'.$requrl.'">','</a>').'</p>'); |
if ($output) { |
|
$r->print('<h3>'.&mt('Request creation of a course or community').'</h3>'. |
|
'<p>'. |
|
&mt('You have rights to request the creation of courses and/or communities in the following domain(s):'). |
|
'<ul>'. |
|
$output. |
|
'</ul>'. |
|
&mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.', |
|
'<a href="'.$requrl.'">','</a>'). |
|
'</p>'); |
|
} |
} |
} |
} elsif (!$env{'user.adv'}) { |
} elsif (!$env{'user.adv'}) { |
|
if ($inrole) { |
|
$r->print('<h3>'.&mt('Currently no additional roles, courses or communities').'</h3>'); |
|
} else { |
|
$r->print('<h3>'.&mt('Currently no active roles, courses or communities').'</h3>'); |
|
} |
&findcourse_advice($r,$cattype); |
&findcourse_advice($r,$cattype); |
} |
} |
return; |
return; |
Line 1645 sub check_fordc {
|
Line 1649 sub check_fordc {
|
my ($dcroles,$update,$then) = @_; |
my ($dcroles,$update,$then) = @_; |
my $numdc = 0; |
my $numdc = 0; |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
foreach my $envkey (sort keys %env) { |
foreach my $envkey (sort(keys(%env))) { |
if ($envkey=~/^user\.role\.dc\.\/($match_domain)\/$/) { |
if ($envkey=~/^user\.role\.dc\.\/($match_domain)\/$/) { |
my $dcdom = $1; |
my $dcdom = $1; |
my $livedc = 1; |
my $livedc = 1; |
Line 1754 sub check_forcc {
|
Line 1758 sub check_forcc {
|
return $is_cc; |
return $is_cc; |
} |
} |
|
|
sub check_release_required { |
|
my ($loncaparev,$tcourseid,$trolecode,$required) = @_; |
|
my ($switchserver,$warning); |
|
if ($required ne '') { |
|
my ($reqdmajor,$reqdminor) = ($required =~ /^(\d+)\.(\d+)$/); |
|
my ($major,$minor) = ($loncaparev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/); |
|
if ($reqdmajor ne '' && $reqdminor ne '') { |
|
my $otherserver; |
|
if (($major eq '' && $minor eq '') || |
|
(($reqdmajor > $major) || (($reqdmajor == $major) && ($reqdminor > $minor)))) { |
|
my ($userdomserver) = &Apache::lonnet::choose_server($env{'user.domain'},undef,$required,1); |
|
my $switchlcrev = |
|
&Apache::lonnet::get_server_loncaparev($env{'user.domain'}, |
|
$userdomserver); |
|
my ($swmajor,$swminor) = ($switchlcrev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/); |
|
if (($swmajor eq '' && $swminor eq '') || ($reqdmajor > $swmajor) || |
|
(($reqdmajor == $swmajor) && ($reqdminor > $swminor))) { |
|
my $cdom = $env{'course.'.$tcourseid.'.domain'}; |
|
if ($cdom ne $env{'user.domain'}) { |
|
my ($coursedomserver,$coursehostname) = &Apache::lonnet::choose_server($cdom,undef,$required,1); |
|
my $serverhomeID = &Apache::lonnet::get_server_homeID($coursehostname); |
|
my $serverhomedom = &Apache::lonnet::host_domain($serverhomeID); |
|
my %defdomdefaults = &Apache::lonnet::get_domain_defaults($serverhomedom); |
|
my %udomdefaults = &Apache::lonnet::get_domain_defaults($env{'user.domain'}); |
|
my $remoterev = &Apache::lonnet::get_server_loncaparev($serverhomedom,$coursedomserver); |
|
my $canhost = |
|
&Apache::lonnet::can_host_session($env{'user.domain'}, |
|
$coursedomserver, |
|
$remoterev, |
|
$udomdefaults{'remotesessions'}, |
|
$defdomdefaults{'hostedsessions'}); |
|
|
|
if ($canhost) { |
|
$otherserver = $coursedomserver; |
|
} else { |
|
$warning = &mt('Requires LON-CAPA version [_1].',$env{'course.'.$tcourseid.'.internal.releaserequired'}).'<br />'. &mt("No suitable server could be found amongst servers in either your own domain or in the course's domain."); |
|
} |
|
} else { |
|
$warning = &mt('Requires LON-CAPA version [_1].',$env{'course.'.$tcourseid.'.internal.releaserequired'}).'<br />'.&mt("No suitable server could be found amongst servers in your own domain (which is also the course's domain)."); |
|
} |
|
} else { |
|
$otherserver = $userdomserver; |
|
} |
|
} |
|
if ($otherserver ne '') { |
|
$switchserver = 'otherserver='.$otherserver.'&role='.$trolecode; |
|
} |
|
} |
|
} |
|
return ($switchserver,$warning); |
|
} |
|
|
|
sub courselink { |
sub courselink { |
my ($dcdom,$rowtype) = @_; |
my ($dcdom,$rowtype) = @_; |
my $courseform=&Apache::loncommon::selectcourse_link |
my $courseform=&Apache::loncommon::selectcourse_link |
Line 1820 sub courselink {
|
Line 1772 sub courselink {
|
} |
} |
|
|
sub coursepick_jscript { |
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.", |
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.', |
youc => 'You can only use this screen to select courses and communities in the current domain.', |
); |
); |
|
&js_escape(\%js_lt); |
my $verify_script = <<"END"; |
my $verify_script = <<"END"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 1840 function verifyCoursePick(caller) {
|
Line 1793 function verifyCoursePick(caller) {
|
} |
} |
} |
} |
else { |
else { |
alert("$lt{'plsu'}"); |
alert("$js_lt{'plsu'}"); |
} |
} |
} |
} |
else { |
else { |
alert("$lt{'youc'}") |
alert("$js_lt{'youc'}") |
} |
} |
} |
} |
function getIndex(caller) { |
function getIndex(caller) { |
Line 1905 sub display_cc_role {
|
Line 1858 sub display_cc_role {
|
sub adhoc_roles_row { |
sub adhoc_roles_row { |
my ($dcdom,$rowtype) = @_; |
my ($dcdom,$rowtype) = @_; |
my $output = &Apache::loncommon::continue_data_table_row() |
my $output = &Apache::loncommon::continue_data_table_row() |
.' <td colspan="5">' |
.' <td colspan="5" class="LC_textsize_mobile">' |
.&mt('[_1]Ad hoc[_2] roles in domain [_3] --' |
.&mt('[_1]Ad hoc[_2] roles in domain [_3] --' |
,'<span class="LC_cusr_emph">','</span>',$dcdom) |
,'<span class="LC_cusr_emph">','</span>',$dcdom) |
.' '; |
.' '; |
Line 2747 sub get_roles_functions {
|
Line 2700 sub get_roles_functions {
|
unless ($cattype eq 'none') { |
unless ($cattype eq 'none') { |
push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]); |
push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]); |
} |
} |
my $funcs = &Apache::lonhtmlcommon::start_funclist(); |
my $funcs; |
foreach my $link (@links) { |
if ($env{'browser.mobile'}) { |
$funcs .= &Apache::lonhtmlcommon::add_item_funclist( |
my @functions; |
'<a href="'.$link->[0].'" class="LC_menubuttons_link">'. |
foreach my $link (@links) { |
'<img src="/res/adm/pages/'.$link->[1].'.png" class="LC_icon" alt="'.$link->[2].'" />'. |
push(@functions,[$link->[0],$link->[2]]); |
$link->[2].'</a>'); |
} |
|
my $title = 'Display options'; |
|
if ($env{'user.adv'}) { |
|
$title = 'Roles options'; |
|
} |
|
$funcs = &Apache::lonmenu::create_submenu('','',$title,\@functions,1,'LC_breadcrumbs_hoverable'); |
|
$funcs = '<ol class="LC_primary_menu LC_floatright">'.$funcs.'</ol>'; |
|
} else { |
|
$funcs = &Apache::lonhtmlcommon::start_funclist(); |
|
foreach my $link (@links) { |
|
$funcs .= &Apache::lonhtmlcommon::add_item_funclist( |
|
'<a href="'.$link->[0].'" class="LC_menubuttons_link">'. |
|
'<img src="/res/adm/pages/'.$link->[1].'.png" class="LC_icon" alt="'.$link->[2].'" />'. |
|
$link->[2].'</a>'); |
|
} |
|
$funcs .= &Apache::lonhtmlcommon::end_funclist(); |
|
$funcs = &Apache::loncommon::head_subbox($funcs); |
} |
} |
$funcs .= &Apache::lonhtmlcommon::end_funclist(); |
return $funcs; |
return &Apache::loncommon::head_subbox($funcs); |
|
} |
} |
|
|
sub get_queued { |
sub get_queued { |