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

raeburn raeburn at source.lon-capa.org
Fri Jul 8 12:10:35 EDT 2022


raeburn		Fri Jul  8 16:10:35 2022 EDT

  Modified files:              (Branch: version_2_11_4_msu)
    /loncom/interface	lonnavmaps.pm 
  Log:
  - For 2.11.4 (modified)
    Include changes in 1.559
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.509.2.14.2.2 loncom/interface/lonnavmaps.pm:1.509.2.14.2.3
--- loncom/interface/lonnavmaps.pm:1.509.2.14.2.2	Wed Jan  5 00:41:13 2022
+++ loncom/interface/lonnavmaps.pm	Fri Jul  8 16:10:35 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.509.2.14.2.2 2022/01/05 00:41:13 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.509.2.14.2.3 2022/07/08 16:10:35 raeburn Exp $
 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1400,6 +1400,37 @@
     my $condition = 0;
     if ($env{'form.condition'}) {
         $condition = 1;
+    } elsif (($env{'request.deeplink.login'}) && ($env{'request.course.id'}) && (!$userCanSeeHidden)) {
+        if (!defined($navmap)) {
+            $navmap = Apache::lonnavmaps::navmap->new();
+        }
+        if (defined($navmap)) {
+            my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+            my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+            my $symb = &Apache::loncommon::symb_from_tinyurl($env{'request.deeplink.login'},$cnum,$cdom);
+            if ($symb) {
+                my $deeplink;
+                my $res = $navmap->getBySymb($symb);
+                if ($res->is_map()) {
+                    my $mapname = &Apache::lonnet::declutter($res->src());
+                    $mapname = &Apache::lonnet::deversion($mapname);
+                    $deeplink = $navmap->get_mapparam(undef,$mapname,"0.deeplink");
+                } else {
+                    $deeplink = $res->deeplink();
+                }
+                if ($deeplink ne '') {
+                    if ((split(/,/,$deeplink))[1] eq 'hide') {
+                        if ($res->is_map()) {
+                            map { $filterHash->{$_} = 1 if $_ } split(/,/,$res->map_hierarchy());
+                        } else {
+                            my $mapurl = (&Apache::lonnet::decode_symb($symb))[0];
+                            my $map = $navmap->getResourceByUrl($mapurl);
+                            map { $filterHash->{$_} = 1 if $_ } split(/,/,$map->map_hierarchy());
+                        }
+                    }
+                }
+            }
+        }
     }
 
     if (!$env{'form.folderManip'} && !defined($args->{'iterator'})) {




More information about the LON-CAPA-cvs mailing list