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

www lon-capa-cvs@mail.lon-capa.org
Tue, 24 Feb 2004 16:09:30 -0000


www		Tue Feb 24 11:09:30 2004 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Bug #2728: for resources in a page, always link to page.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.247 loncom/interface/lonnavmaps.pm:1.248
--- loncom/interface/lonnavmaps.pm:1.247	Fri Feb 13 15:31:40 2004
+++ loncom/interface/lonnavmaps.pm	Tue Feb 24 11:09:30 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.247 2004/02/13 20:31:40 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.248 2004/02/24 16:09:30 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -290,8 +290,15 @@
 
     # Check to see if there are any pages in the stack
     foreach $res (@$stack) {
-        if (defined($res) && $res->is_page()) {
-            return $res->src();
+        if (defined($res)) {
+	    if ($res->is_page()) {
+		return $res->src();
+	    }
+            # in case folder was skipped over as "only sequence"
+	    my ($map,$id,$src)=&Apache::lonnet::decode_symb($res->symb());
+	    if ($map=~/\.page$/) {
+		return &Apache::lonnet::clutter($map);
+	    }
         }
     }