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

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 10 Aug 2004 20:52:03 -0000


matthew		Tue Aug 10 16:52:03 2004 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Added part_display method to resource object.  Modified navmaps page to use
  this method.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.273 loncom/interface/lonnavmaps.pm:1.274
--- loncom/interface/lonnavmaps.pm:1.273	Tue Jul 27 19:35:34 2004
+++ loncom/interface/lonnavmaps.pm	Tue Aug 10 16:52:03 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.273 2004/07/27 23:35:34 www Exp $
+# $Id: lonnavmaps.pm,v 1.274 2004/08/10 20:52:03 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1077,9 +1077,7 @@
 
     if ($resource->is_problem() && $part ne '0' && 
         !$params->{'condensed'}) {
-	my $displaypart=&Apache::lonnet::EXT('resource.'.$part.'.display',
-					     $resource->symb());
-	unless ($displaypart) { $displaypart=$part; }
+	my $displaypart=$resource->part_display($part);
         $partLabel = " (Part: $displaypart)";
 	$link.='#'.&Apache::lonnet::escape($part);
         $title = "";
@@ -3674,7 +3672,16 @@
 				$self->symb(), $ENV{'user.domain'},
 				$ENV{'user.name'}, 
 				$ENV{'request.course.sec'});
-
+}
+sub part_display {
+    my $self= shift(); my $partID = shift();
+    if (! defined($partID)) { $partID = '0'; }
+    my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',
+                                     $self->symb);
+    if (! defined($display) || $display eq '') {
+        $display = $partID;
+    }
+    return $display;
 }
 
 # Multiple things need this