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

raeburn raeburn at source.lon-capa.org
Wed Jan 16 16:49:39 EST 2019


raeburn		Wed Jan 16 21:49:39 2019 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - Bug 6400
    - deeplink parameter incorporates three components:
      (a) In Contents or Gradebook?, (b) Access scope via deep-link,
      (c) Supported Link Types.
    - Allowed values for (a) 'full','absent','grades','details','datestatus'
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.546 loncom/interface/lonnavmaps.pm:1.547
--- loncom/interface/lonnavmaps.pm:1.546	Wed Jan 16 20:23:37 2019
+++ loncom/interface/lonnavmaps.pm	Wed Jan 16 21:49:39 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.546 2019/01/16 20:23:37 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.547 2019/01/16 21:49:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1831,7 +1831,7 @@
                     }
                 } else {
                     my $deeplink = $navmap->get_mapparam(undef,$mapname,"0.deeplink");
-                    if (($deeplink eq 'absent') || ($deeplink eq 'grades')) {
+                    if ($deeplink =~ /^(absent|grades),/) {
                         if ($userCanSeeHidden) {
                             $args->{'mapUnlisted'} = 1;
                         } else {
@@ -1902,10 +1902,10 @@
             }
         }
         # If deep-link parameter is set (and is not set to full) suppress link
-        # unless priviliged user, or calling context is sequence, and parameter
+        # unless privileged user, or calling context is sequence, and parameter
         # set at map level
         if ((!$curRes->deeplink($args->{'caller'})) ||
-            ($curRes->deeplink($args->{'caller'}) eq 'full') || &advancedUser()) {
+            ($curRes->deeplink($args->{'caller'}) =~ /^full,/) || &advancedUser()) {
             $args->{'resource_nolink'} = 0;
         } else {
             $args->{'resource_nolink'} = 1;
@@ -5149,14 +5149,17 @@
 }
 sub deeplink {
     my ($self,$caller) = @_;
-    if ($caller eq 'sequence') {
-        my @deeplink = $self->parmval("deeplink");
-        if ($deeplink[1] eq 'resource') {
-            return $deeplink[0];
+    my $value = $self->parmval("deeplink");
+    if ($value) {
+        my @deeplink = split(/,/,$value);
+        if ($caller eq 'sequence') {
+            if ($deeplink[1] ne 'res') {
+                return;
+            }
         }
-    } else {
-        return $self->parmval("deeplink");
+        return $deeplink[0];
     }
+    return;
 }
 
 # Multiple things need this




More information about the LON-CAPA-cvs mailing list