[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm rat lonpage.pm

raeburn raeburn at source.lon-capa.org
Thu Mar 5 11:45:36 EST 2020


raeburn		Thu Mar  5 16:45:36 2020 EDT

  Modified files:              
    /rat	lonpage.pm 
    /loncom/interface	lonnavmaps.pm 
  Log:
  - Support jumping to an item in a composite page from the Contents listing:
    (a) for resources without Info icon/link
    (b) for rescource for which encrypturl is in use.
  
  
Index: rat/lonpage.pm
diff -u rat/lonpage.pm:1.135 rat/lonpage.pm:1.136
--- rat/lonpage.pm:1.135	Wed Mar  4 16:33:31 2020
+++ rat/lonpage.pm	Thu Mar  5 16:45:32 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Page Handler
 #
-# $Id: lonpage.pm,v 1.135 2020/03/04 16:33:31 raeburn Exp $
+# $Id: lonpage.pm,v 1.136 2020/03/05 16:45:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -939,20 +939,26 @@
 sub get_buttons {
     my ($hash,$rid,$buttonshide,$hostname) = @_;
 
-    my $metainfo = '';
-    my $esrc=&Apache::lonnet::declutter($hash->{'src_'.$rid});
     my ($mapid,$resid)=split(/\./,$rid);
     my $symb=&Apache::lonnet::encode_symb($hash->{'map_id_'.$mapid},
 					  $resid,
 					  $hash->{'src_'.$rid});
+    my $aname;
+    if (($hash->{'encrypted_'.$rid}) && (!$env{'request.role.adv'})) {
+        $aname = 'LC_'.$rid;
+    } else {
+        $aname = &escape($symb);
+    }
+    my $metainfo = '<a name="'.$aname.'"></a>';
     unless ($env{'request.role.adv'}) {
         if ($buttonshide->{$symb} eq 'yes') {
-            return;
+            return $metainfo;
         }
     }
     my $crs_sec = $env{'request.course.id'} . (($env{'request.course.sec'} ne '')
                                                ? "/$env{'request.course.sec'}"
                                                : '');
+    my $esrc=&Apache::lonnet::declutter($hash->{'src_'.$rid});
     if ($hash->{'encrypted_'.$rid}) {
 	$esrc=&Apache::lonenc::encrypted($esrc);
     }
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.548 loncom/interface/lonnavmaps.pm:1.549
--- loncom/interface/lonnavmaps.pm:1.548	Tue Mar  3 01:17:48 2020
+++ loncom/interface/lonnavmaps.pm	Thu Mar  5 16:45:36 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.548 2020/03/03 01:17:48 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.549 2020/03/05 16:45:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -592,7 +592,11 @@
 	    my $anchor;
 	    if ($res->is_page()) {
 		foreach my $item (@$stack) { if (defined($item)) { $anchor = $item; }  }
-		$anchor=&escape($anchor->shown_symb());
+		if ($anchor->encrypted() && !&advancedUser()) {
+		    $anchor='LC_'.$anchor->id();
+		} else {
+		    $anchor=&escape($anchor->shown_symb());
+		}
 		return ($res->link(),$res->shown_symb(),$anchor);
 	    }
             # in case folder was skipped over as "only sequence"




More information about the LON-CAPA-cvs mailing list