$lt{'preamble'} $lt{$type}
$lt{'miss'}
$lt{'proctor'}
-
@@ -1740,7 +1908,7 @@ END
@@ -1967,6 +2135,12 @@ function open_StoredLinks_Import(rat) {
newWin.focus();
}
+function open_source() {
+ var url = escape(window.location.pathname);
+ sourcewin=window.open('/adm/source?inhibitmenu=yes&viewonly=1&filename='+url,'LONsource',
+ 'height=500,width=600,resizable=yes,location=no,menubar=no,toolbar=no,scrollbars=yes');
+}
+
(function (\$) {
\$(document).ready(function () {
\$.single=function(a){return function(b){a[0]=b;return a}}(\$([1]));
@@ -2029,7 +2203,7 @@ sub roles_selector {
my ($cdom,$cnum,$httphost) = @_;
my $crstype = &Apache::loncommon::course_type();
my $now = time;
- my (%courseroles,%seccount,%courseprivs);
+ my (%courseroles,%seccount,%courseprivs,%roledesc);
my $is_cc;
my ($js,$form,$switcher);
my $ccrole;
@@ -2038,13 +2212,13 @@ sub roles_selector {
} else {
$ccrole = 'cc';
}
- my ($priv,$gotsymb,$destsymb);
+ my ($privref,$gotsymb,$destsymb);
my $destinationurl = $ENV{'REQUEST_URI'};
- if ($destinationurl =~ /\?symb=/) {
+ if ($destinationurl =~ /(\?|\&)symb=/) {
$gotsymb = 1;
} elsif ($destinationurl =~ m{^/enc/}) {
my $plainurl = &Apache::lonenc::unencrypted($destinationurl);
- if ($plainurl =~ /\?symb=/) {
+ if ($plainurl =~ /(\?|\&)symb=/) {
$gotsymb = 1;
}
}
@@ -2059,12 +2233,15 @@ sub roles_selector {
my $destination = $destinationurl;
$destination =~ s/(\?.*)$//;
if (exists($reqprivs->{$destination})) {
- $priv = $reqprivs->{$destination};
+ if ($reqprivs->{$destination} =~ /,/) {
+ @{$privref} = split(/,/,$reqprivs->{$destination});
+ } else {
+ $privref = [$reqprivs->{$destination}];
+ }
}
}
if ($env{'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum}) {
my ($start,$end) = split(/\./,$env{'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum});
-
if ((($start) && ($start<0)) ||
(($end) && ($end<$now)) ||
(($start) && ($now<$start))) {
@@ -2074,7 +2251,9 @@ sub roles_selector {
}
}
if ($is_cc) {
- &get_all_courseroles($cdom,$cnum,\%courseroles,\%seccount,\%courseprivs,$priv);
+ &get_all_courseroles($cdom,$cnum,\%courseroles,\%seccount,\%courseprivs);
+ } elsif ($env{'request.role'} =~ m{^\Qcr/$cdom/$cdom-domainconfig/\E(\w+)\.\Q/$cdom/$cnum\E}) {
+ &get_customadhoc_roles($cdom,$cnum,\%courseroles,\%seccount,\%courseprivs,\%roledesc,$privref);
} else {
my %gotnosection;
foreach my $item (keys(%env)) {
@@ -2090,7 +2269,7 @@ sub roles_selector {
$gotnosection{$role} = 1;
}
}
- if ($priv ne '') {
+ if ((ref($privref) eq 'ARRAY') && (@{$privref} > 0)) {
my $cnumsec = $cnum;
if ($sec ne '') {
$cnumsec .= "/$sec";
@@ -2128,7 +2307,7 @@ sub roles_selector {
}
if ((keys(%seccount) > 1) || ($numdiffsec > 1)) {
my @submenu;
- $js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,$priv);
+ $js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,\%roledesc,$privref);
$form =
'