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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Tue, 16 Sep 2003 20:00:57 -0000


bowersj2		Tue Sep 16 16:00:57 2003 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  Allows helpers to use the status display.
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.45 loncom/interface/lonhelper.pm:1.46
--- loncom/interface/lonhelper.pm:1.45	Fri Sep  5 12:15:54 2003
+++ loncom/interface/lonhelper.pm	Tue Sep 16 16:00:57 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.45 2003/09/05 16:15:54 bowersj2 Exp $
+# $Id: lonhelper.pm,v 1.46 2003/09/16 20:00:57 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1667,7 +1667,8 @@
 to false. The "suppressEmptySequences" attribute reflects the 
 suppressEmptySequences argument to the render routine, which will cause
 folders that have all of their contained resources filtered out to also
-be filtered out.
+be filtered out. The 'addstatus' attribute, if true, will add the icon
+and long status display columns to the display.
 
 =head3 SUB-TAGS
 
@@ -1730,6 +1731,7 @@
     $paramHash->{'multichoice'} = $token->[2]{'multichoice'};
     $paramHash->{'suppressEmptySequences'} = $token->[2]{'suppressEmptySequences'};
     $paramHash->{'toponly'} = $token->[2]{'toponly'};
+    $paramHash->{'addstatus'} = $token->[2]{'addstatus'};
     return '';
 }
 
@@ -1895,9 +1897,13 @@
     };
 
     $ENV{'form.condition'} = !$self->{'toponly'};
+    my $cols = [$renderColFunc, Apache::lonnavmaps::resource()];
+    if ($self->{'addstatus'}) {
+	push @$cols, (Apache::lonnavmaps::part_status_summary());
+	
+    }
     $result .= 
-        &Apache::lonnavmaps::render( { 'cols' => [$renderColFunc, 
-                                                  Apache::lonnavmaps::resource()],
+        &Apache::lonnavmaps::render( { 'cols' => $cols,
                                        'showParts' => 0,
                                        'filterFunc' => $filterFunc,
                                        'resource_no_folder_link' => 1,