--- rat/lonpage.pm 2024/07/02 18:53:26 1.111.2.15
+++ rat/lonpage.pm 2024/07/03 02:38:40 1.111.2.16
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Page Handler
#
-# $Id: lonpage.pm,v 1.111.2.15 2024/07/02 18:53:26 raeburn Exp $
+# $Id: lonpage.pm,v 1.111.2.16 2024/07/03 02:38:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -101,7 +101,9 @@ sub tracetable {
} else {
$sofar++;
if ($hash{'src_'.$rid}) {
- my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$rid});
+ my ($mapid,$resid)=split(/\./,$rid);
+ my $symb = &Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$hash{'src_'.$rid});
+ my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$rid},$symb);
if (($brepriv eq '2') || ($brepriv eq 'F')) {
if (defined($rows[$sofar])) {
$rows[$sofar].='&'.$rid;
@@ -609,7 +611,7 @@ ENDEXT
# ---------------------------------------------------------------- End SSI cell
}
}
- }
+ }
}
unless ($contents) {
&Apache::loncommon::content_type($r,'text/html');
@@ -875,9 +877,30 @@ ENDEXT
}
# ------------------------------------------------------------- End render page
} else {
- &Apache::loncommon::content_type($r,'text/html');
- $r->send_http_header;
- &Apache::lonsequence::viewmap($r,$requrl);
+ if ($hash{'map_type_'.$hash{'map_pc_'.$requrl}} eq 'none') {
+ &Apache::loncommon::content_type($r,'text/html');
+ $r->send_http_header;
+ $r->print(&Apache::loncommon::start_page(undef,undef,
+ {'force_register' => 1,}));
+ my $crstype = &Apache::loncommon::course_type();
+ if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+ $r->print(''.&mt('Missing composite page file.').'
'.
+ &mt("You may want to use the $crstype Editor to remove this item."));
+ } else {
+ if ($crstype eq 'Placement') {
+ $r->print(''.&mt('Missing page').'');
+ } else {
+ $r->print(''.
+ &mt('This resource was unavailable when your '.lc($crstype).' session was loaded').'
'.
+ &mt("Please use 'Contents' to list items available in the $crstype.").'');
+ }
+ }
+ $r->print(&Apache::loncommon::end_page());
+ } else {
+ &Apache::loncommon::content_type($r,'text/html');
+ $r->send_http_header;
+ &Apache::lonsequence::viewmap($r,$requrl);
+ }
}
# ------------------------------------------------------------------ Untie hash
unless (untie(%hash)) {