version 1.496, 2019/01/08 23:40:16
|
version 1.502, 2020/02/18 23:10:53
|
Line 448 sub secondary_menu {
|
Line 448 sub secondary_menu {
|
$showresv = 1; |
$showresv = 1; |
} |
} |
} |
} |
my %groups = &Apache::lonnet::get_active_groups( |
if ($env{'request.course.groups'} ne '') { |
$env{'user.domain'}, $env{'user.name'},$cdom,$cnum); |
foreach my $group (split(/:/,$env{'request.course.groups'})) { |
if (%groups) { |
next unless ($group =~ /^\w+$/); |
foreach my $group (keys(%groups)) { |
|
my @privs = split(/:/,$env{"user.priv.$env{'request.role'}./$cdom/$cnum/$group"}); |
my @privs = split(/:/,$env{"user.priv.$env{'request.role'}./$cdom/$cnum/$group"}); |
shift(@privs); |
shift(@privs); |
if (@privs) { |
if (@privs) { |
Line 1099 if ($env{'browser.mobile'}) {
|
Line 1098 if ($env{'browser.mobile'}) {
|
} |
} |
|
|
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) { |
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) { |
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && ($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/docs/}) && ($env{'request.noversionuri'} !~ m{^/adm/.+/ext\.tool$})) { |
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && |
|
($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/(docs/|default_\d+\.page$)}) && |
|
($env{'request.noversionuri'} !~ m{^/adm/.+/ext\.tool$})) { |
$menuitems.=(<<ENDREALRES); |
$menuitems.=(<<ENDREALRES); |
s&6&3&catalog.png&Info&info[_1]&catalog_info(currentURL,'$is_mobile')&Show Metadata |
s&6&3&catalog.png&Info&info[_1]&catalog_info(currentURL,'$is_mobile')&Show Metadata |
ENDREALRES |
ENDREALRES |
} |
} |
unless (($env{'request.noversionuri'} =~ m{^/uploaded/$match_domain/$match_courseid/docs/}) || |
unless (($env{'request.noversionuri'} =~ m{^/uploaded/$match_domain/$match_courseid/(docs/|default_\d+\.page$)}) || |
($env{'request.noversionuri'} =~ m{^\Q/adm/wrapper/\E(ext|uploaded)/}) || |
($env{'request.noversionuri'} =~ m{^\Q/adm/wrapper/\E(ext|uploaded)/}) || |
($env{'request.noversionuri'} =~ m{^/adm/.+/ext\.tool$})) { |
($env{'request.noversionuri'} =~ m{^/adm/.+/ext\.tool$})) { |
$menuitems.=(<<ENDREALRES); |
$menuitems.=(<<ENDREALRES); |
Line 1366 sub prepare_functions {
|
Line 1367 sub prepare_functions {
|
if ((($cfile eq '') || (!$editbutton)) && |
if ((($cfile eq '') || (!$editbutton)) && |
($resurl =~ /$LONCAPA::assess_re/)) { |
($resurl =~ /$LONCAPA::assess_re/)) { |
my $showurl = &Apache::lonnet::clutter($resurl); |
my $showurl = &Apache::lonnet::clutter($resurl); |
|
my $crs_sec = $env{'request.course.id'} . (($env{'request.course.sec'} ne '') |
|
? "/$env{'request.course.sec'}" |
|
: ''); |
if ((&Apache::lonnet::allowed('cre','/')) && |
if ((&Apache::lonnet::allowed('cre','/')) && |
(&Apache::lonnet::metadata($resurl,'sourceavail') eq 'open')) { |
(&Apache::lonnet::metadata($resurl,'sourceavail') eq 'open')) { |
$viewsrcbutton = 1; |
$viewsrcbutton = 1; |
} elsif (&Apache::lonnet::allowed('vxc',$env{'request.course.id'})) { |
} elsif (&Apache::lonnet::allowed('vxc',$crs_sec)) { |
if ($showurl =~ m{^\Q/res/$cdom/\E($match_username)/}) { |
if ($showurl =~ m{^\Q/res/$cdom/\E($match_username)/}) { |
my $auname = $1; |
my $auname = $1; |
if (($env{'request.course.adhocsrcaccess'} ne '') && |
if (($env{'request.course.adhocsrcaccess'} ne '') && |
(grep(/^\Q$auname\E$/,split(/,/,$env{'request.course.adhocsrcaccess'})))) { |
(grep(/^\Q$auname\E$/,split(/,/,$env{'request.course.adhocsrcaccess'})))) { |
$viewsrcbutton = 1; |
$viewsrcbutton = 1; |
} elsif ((&Apache::lonnet::metadata($resurl,'sourceavail') eq 'open') && |
} elsif ((&Apache::lonnet::metadata($resurl,'sourceavail') eq 'open') && |
(&Apache::lonnet::allowed('bre','/'))) { |
(&Apache::lonnet::allowed('bre',$crs_sec))) { |
$viewsrcbutton = 1; |
$viewsrcbutton = 1; |
} |
} |
} |
} |
Line 1911 sub done_button_js {
|
Line 1915 sub done_button_js {
|
my @resources=(); |
my @resources=(); |
if ($type eq 'map') { |
if ($type eq 'map') { |
my ($mapurl,$rid,$resurl)=&Apache::lonnet::decode_symb($env{'request.symb'}); |
my ($mapurl,$rid,$resurl)=&Apache::lonnet::decode_symb($env{'request.symb'}); |
@resources=$navmap->retrieveResources($mapurl,sub { $_[0]->is_problem() }); |
if ($env{'request.symb'} =~ /\.page$/) { |
|
@resources=$navmap->retrieveResources($resurl,sub { $_[0]->is_problem() }); |
|
} else { |
|
@resources=$navmap->retrieveResources($mapurl,sub { $_[0]->is_problem() }); |
|
} |
} else { |
} else { |
my $res = $navmap->getBySymb($env{'request.symb'}); |
my $res = $navmap->getBySymb($env{'request.symb'}); |
if (ref($res)) { |
if (ref($res)) { |