[LON-CAPA-cvs] cvs: rat(version_2_11_X) / lonpage.pm

raeburn raeburn at source.lon-capa.org
Tue Jul 2 22:38:40 EDT 2024


raeburn		Wed Jul  3 02:38:40 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /rat	lonpage.pm 
  Log:
  - For 2.11
    Backport 1.140, 1.142 
  
  
Index: rat/lonpage.pm
diff -u rat/lonpage.pm:1.111.2.15 rat/lonpage.pm:1.111.2.16
--- rat/lonpage.pm:1.111.2.15	Tue Jul  2 18:53:26 2024
+++ rat/lonpage.pm	Wed Jul  3 02:38:40 2024
@@ -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 @@
             } 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 @@
 # ---------------------------------------------------------------- End SSI cell
                           }
                       }
-                     } 
+                     }
                   }
                   unless ($contents) {
                       &Apache::loncommon::content_type($r,'text/html');
@@ -875,9 +877,30 @@
                   }                  
 # ------------------------------------------------------------- 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('<span class="LC_warning">'.&mt('Missing composite page file.').'</span><br />'.
+                                    &mt("You may want to use the $crstype Editor to remove this item."));
+                      } else {
+                          if ($crstype eq 'Placement') {
+                              $r->print('<span class="LC_warning">'.&mt('Missing page').'</span>');
+                          } else {
+                              $r->print('<span class="LC_info">'.
+                                        &mt('This resource was unavailable when your '.lc($crstype).' session was loaded').'<br />'.
+                                        &mt("Please use 'Contents' to list items available in the $crstype.").'</span>');
+                          }
+                      }
+                      $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)) {




More information about the LON-CAPA-cvs mailing list