]> git.mjollnir.org Git - moodle.git/commitdiff
merged proper fix for MDL-6926
authortoyomoyo <toyomoyo>
Tue, 17 Oct 2006 04:46:34 +0000 (04:46 +0000)
committertoyomoyo <toyomoyo>
Tue, 17 Oct 2006 04:46:34 +0000 (04:46 +0000)
mod/forum/discuss.php
mod/forum/lib.php

index c0355b44229c569cf406dbbc3f113435b34b2f26..5a66d82bc6b3129ecd8444df8fb14ded430c4f04 100644 (file)
@@ -4,8 +4,7 @@
 //  If no post is given, displays all posts in a discussion
 
     require_once("../../config.php");
-    require_once("lib.php");
-
+    
     $d      = required_param('d', PARAM_INT);                // Discussion ID
     $parent = optional_param('parent', 0, PARAM_INT);        // If set, then display this post and all children.
     $mode   = optional_param('mode', 0, PARAM_INT);          // If set, changes the layout of the thread
@@ -29,7 +28,8 @@
     if (!$cm = get_coursemodule_from_instance('forum', $forum->id, $course->id)) {
         error('Course Module ID was incorrect');
     }
-
+    // move this down fix for MDL-6926
+    require_once("lib.php");
     require_course_login($course, false, $cm);
 
     $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
     }
 
 
-
 /// Print the controls across the top
 
     echo '<table width="100%"><tr><td width="33%">';
index ce8ee11444cf43598876c9f2c6c0707b1b550320..d0e91bb39a33ccbef0f58d36f3ac674493dee84f 100644 (file)
@@ -2410,10 +2410,7 @@ function forum_print_rating_menu($postid, $userid, $scale) {
  * @param $forumtype - optional
  */
 function forum_print_mode_form($id, $mode, $forumtype='') {
-    $FORUM_LAYOUT_MODES = array ( FORUM_MODE_FLATOLDEST => get_string('modeflatoldestfirst', 'forum'),
-                              FORUM_MODE_FLATNEWEST => get_string('modeflatnewestfirst', 'forum'),
-                              FORUM_MODE_THREADED   => get_string('modethreaded', 'forum'),
-                              FORUM_MODE_NESTED     => get_string('modenested', 'forum') );
+    global $FORUM_LAYOUT_MODES;
 
     echo "<div align=\"center\">";
     if ($forumtype == 'single') {