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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 22 Dec 2005 21:09:16 -0000


albertel		Thu Dec 22 16:09:16 2005 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/interface	lonnavmaps.pm 
  Log:
  - backport 1.354
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.349.2.2 loncom/interface/lonnavmaps.pm:1.349.2.3
--- loncom/interface/lonnavmaps.pm:1.349.2.2	Mon Dec  5 16:37:19 2005
+++ loncom/interface/lonnavmaps.pm	Thu Dec 22 16:09:15 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.349.2.2 2005/12/05 21:37:19 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.349.2.3 2005/12/22 21:09:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2265,6 +2265,25 @@
     $self->{RETRIEVED_USER_DATA} = 1;
 }
 
+sub get_discussion_data {
+    my $self = shift;
+    if ($self->{RETRIEVED_DISCUSSION_DATA}) {
+         return  $self->{DISCUSSION_DATA};
+    }
+                                                                                
+    my $cid=$env{'request.course.id'};
+    my $cdom=$env{'course.'.$cid.'.domain'};
+    my $cnum=$env{'course.'.$cid.'.num'};
+                                                                                
+    # Retrieve discussion data for resources in course
+    my %discussion_data = &Apache::lonnet::dump($cid,$cdom,$cnum);
+                                                                                
+    $self->{DISCUSSION_DATA} = \%discussion_data;
+    $self->{RETRIEVED_DISCUSSION_DATA} = 1;
+    return $self->{DISCUSSION_DATA};
+}
+
+
 # Internal function: Takes a key to look up in the nav hash and implements internal
 # memory caching of that key.
 sub navhash {