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

raeburn raeburn at source.lon-capa.org
Sat Mar 17 00:55:10 EDT 2012


raeburn		Sat Mar 17 04:55:10 2012 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - Bug 6087.
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.349 loncom/interface/lonfeedback.pm:1.350
--- loncom/interface/lonfeedback.pm:1.349	Sat Mar 17 04:02:28 2012
+++ loncom/interface/lonfeedback.pm	Sat Mar 17 04:55:10 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.349 2012/03/17 04:02:28 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.350 2012/03/17 04:55:10 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -513,7 +513,9 @@
         my $currdepth = 0;
         my $firstidx = $alldiscussion{$showposts[0]};
         foreach my $post (@showposts) {
-            unless (($sortposts eq 'thread') || (($sortposts eq '') && ($env{'environment.threadeddiscussion'})) || ($outputtarget eq 'export')) {
+            unless (($sortposts eq 'thread') || 
+                    (($sortposts eq '') && (!$env{'environment.unthreadeddiscussion'})) || 
+                    ($outputtarget eq 'export')) {
                 $alldiscussion{$post} = $post;
             }
             unless ( ($notshown{$alldiscussion{$post}} eq '1') || ($shown{$alldiscussion{$post}} == 0) ) {
@@ -1117,7 +1119,8 @@
 	    my $origindex='0.';
             my $numoldver=0;
 	    if ($contrib{$idx.':replyto'}) {
-                if ( (($env{'environment.threadeddiscussion'}) && ($sortposts eq '')) || ($sortposts eq 'thread') || ($outputtarget eq 'export')) {
+                if ( ((!$env{'environment.unthreadeddiscussion'}) && ($sortposts eq '')) || 
+                     ($sortposts eq 'thread') || ($outputtarget eq 'export')) {
 # this is a follow-up message
 		    $original[$idx]=$original[$contrib{$idx.':replyto'}];
 		    $$depth[$idx]=$$depth[$contrib{$idx.':replyto'}]+1;
@@ -1330,7 +1333,8 @@
                 }
                 if ($outputtarget eq 'export' || $message) {
 		    my $thisindex=$idx;
-		    if ( (($env{'environment.threadeddiscussion'}) && ($sortposts eq '')) || ($sortposts eq 'thread') || ($outputtarget eq 'export')) {
+		    if ( ((!$env{'environment.unthreadeddiscussion'}) && ($sortposts eq '')) || 
+                         ($sortposts eq 'thread') || ($outputtarget eq 'export')) {
 			$thisindex=$origindex.substr('00'.$$replies[$$depth[$idx]],-2,2);
 		    }
 		    $$alldiscussion{$thisindex}=$idx;
@@ -4248,12 +4252,16 @@
       return OK;
   } elsif ($env{'form.cmd'}=~/^(threadedoff|threadedon)$/) {
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($env{'form.symb'});
-      if ($env{'form.cmd'} eq 'threadedon') {
+      if ($env{'form.cmd'} eq 'threadedoff') {
+	  &Apache::lonnet::put('environment',{'unthreadeddiscussion' => 'on'});
+	  &Apache::lonnet::appenv({'environment.unthreadeddiscussion' => 'on'});
+	  &Apache::lonnet::del('environment',['threadeddiscussion']);
+	  &Apache::lonnet::delenv('environment.threadeddiscussion');
+      } else {
 	  &Apache::lonnet::put('environment',{'threadeddiscussion' => 'on'});
 	  &Apache::lonnet::appenv({'environment.threadeddiscussion' => 'on'});
-      } else {
- 	  &Apache::lonnet::del('environment',['threadeddiscussion']);
-	  &Apache::lonnet::delenv('environment.threadeddiscussion');
+	  &Apache::lonnet::del('environment',['unthreadeddiscussion']);
+	  &Apache::lonnet::delenv('environment.unthreadeddiscussion');
       }
       &redirect_back($r,$feedurl,&mt('Changed discussion view mode').'<br />',
 		     '0','0','','',$env{'form.previous'},undef,undef,undef,




More information about the LON-CAPA-cvs mailing list