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

www lon-capa-cvs@mail.lon-capa.org
Tue, 04 Nov 2003 03:32:55 -0000


www		Mon Nov  3 22:32:55 2003 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  Set up table for later display of threads.
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.66 loncom/interface/lonfeedback.pm:1.67
--- loncom/interface/lonfeedback.pm:1.66	Mon Nov  3 18:23:34 2003
+++ loncom/interface/lonfeedback.pm	Mon Nov  3 22:32:55 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.66 2003/11/03 23:23:34 www Exp $
+# $Id: lonfeedback.pm,v 1.67 2003/11/04 03:32:55 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -73,12 +73,14 @@
     my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
 			  $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
 			  $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+    my $visible=0;
     if ($contrib{'version'}) {
 	for (my $id=1;$id<=$contrib{'version'};$id++) {
 	    my $idx=$id;
 	    my $hidden=($contrib{'hidden'}=~/\.$idx\./);
 	    my $deleted=($contrib{'deleted'}=~/\.$idx\./);
 	    unless ((($hidden) && (!$seeid)) || ($deleted)) {
+		$visible++;
 		my $message=$contrib{$idx.':message'};
 		$message=~s/\n/\<br \/\>/g;
 		$message=&Apache::lontexconvert::msgtexconverted($message);
@@ -148,9 +150,14 @@
 	    } 
 	}
     }
-    my $discussion='<hr />';
-    foreach (sort { $a <=> $b } keys %discussionitems) {
-	$discussion.=$discussionitems{$_};
+    my $discussion='';
+    if ($visible) {
+	$discussion.='<table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';
+	foreach (sort { $a <=> $b } keys %discussionitems) {
+	    $discussion.="\n<tr bgcolor='#CCCCCC'><td>".$discussionitems{$_}.
+		"</td></tr>";
+	}
+        $discussion.='</table>';
     }
     if ($discussiononly) {
 	$discussion.=(<<ENDDISCUSS);