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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Fri, 04 Apr 2003 19:08:46 -0000


bowersj2		Fri Apr  4 14:08:46 2003 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Some consistency changes for lonnavmaps.pm. 
  
  Some untested code for Matthew, "getBySymb" which retreives a resource object.
  It does compile, so no problems there. 
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.171 loncom/interface/lonnavmaps.pm:1.172
--- loncom/interface/lonnavmaps.pm:1.171	Fri Apr  4 13:13:44 2003
+++ loncom/interface/lonnavmaps.pm	Fri Apr  4 14:08:46 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.171 2003/04/04 18:13:44 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.172 2003/04/04 19:08:46 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -491,7 +491,7 @@
 
 =item * B<resource_part_count>: If true (default), the resource will show a part count if the full part list is not displayed. If false, the resource will never show a part count.
 
-=item * B<resource_no_folder_link>: If true, the resource's folder will not be clickable to open or close it. Default is false.
+=item * B<resource_no_folder_link>: If true, the resource's folder will not be clickable to open or close it. Default is false. True implies printCloseAll is false, since you can't close or open folders when this is on anyhow.
 
 =back
 
@@ -993,7 +993,7 @@
         $result .= '</tr></table>';
     }
 
-    if ($printCloseAll) {
+    if ($printCloseAll && !$args->{'resource_no_folder_link'}) {
         if ($condition) {
             $result.="<a href=\"navmaps?condition=0&filter=&$queryString" .
                 "&here=" . Apache::lonnet::escape($here) .
@@ -1497,6 +1497,14 @@
     return "Apache::lonnavmaps::resource"->new($self, $id);
 }
 
+sub getBySymb {
+    my $self = shift;
+    my $symb = shift;
+    my ($mapUrl, $id, $filename) = split (/___/, $symb);
+    my $map = $self->getResourceByUrl($mapUrl);
+    return $self->getById($map->map_pc() . '.' . $id);
+}
+
 =pod
 
 =item * B<firstResource>(): Returns a resource object reference corresponding to the first resource in the navmap.
@@ -1664,7 +1672,7 @@
 
     # Create the necessary iterator.
     if (!ref($map)) { # assume it's a url of a map.
-        $map = $self->getMapByUrl($map);
+        $map = $self->getResourceByUrl($map);
     }
 
     # Check the map's validity.