From f0ef40c55f941591b0e2960d8d2f2e74bfcb1de9 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Tue, 17 Oct 2006 04:46:34 +0000 Subject: [PATCH] merged proper fix for MDL-6926 --- mod/forum/discuss.php | 7 +++---- mod/forum/lib.php | 5 +---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index c0355b4422..5a66d82bc6 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -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); @@ -192,7 +192,6 @@ } - /// Print the controls across the top echo '
'; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index ce8ee11444..d0e91bb39a 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -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 "
"; if ($forumtype == 'single') { -- 2.39.5