]> git.mjollnir.org Git - moodle.git/commitdiff
Fix the display when USER display mode is flat, and a parent is selected.
authormartin <martin>
Mon, 2 Sep 2002 05:03:54 +0000 (05:03 +0000)
committermartin <martin>
Mon, 2 Sep 2002 05:03:54 +0000 (05:03 +0000)
In this case, the display is temporarily changed to nested

mod/forum/discuss.php

index 520d13a9fa3bf974901c1114ac01b622cab8952d..2aa2a876abe259cce3c30dcb88d95802f5428484 100644 (file)
 
     forum_set_display_mode($mode);
 
-    if (abs($USER->mode) == 1) {  // If flat display then display the lot.
-        $parent = 0;  
-    }
+    $displaymode = $USER->mode;
 
-    if (!$parent) {
+    if ($parent) {
+        if (abs($USER->mode) == 1) {  // If flat AND parent, then force nested display this time
+            $displaymode = 3;
+        }
+    } else {
         $parent = $discussion->firstpost;
         $navtail = "$discussion->name";
     }
@@ -67,7 +69,7 @@
                  "$navmiddle -> $navtail", "", "", true, $updatebutton);
     }
 
-    forum_print_discussion($course, $forum, $discussion, $post, $USER->mode);
+    forum_print_discussion($course, $forum, $discussion, $post, $displaymode);
 
     print_footer($course);