From 7a12aab48b8d13e1cd8d7a02aebd2e990b0dc547 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 2 Aug 2002 09:50:53 +0000 Subject: [PATCH] Fixed up some forum functions and constants (consistency) --- course/social.php | 2 +- course/topics.php | 2 +- course/weeks.php | 2 +- mod/forum/index.php | 2 +- mod/forum/lib.php | 32 ++++++++++++++++---------------- mod/forum/mod.html | 4 ++-- mod/forum/search.php | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/course/social.php b/course/social.php index a5655282f9..590eb9c3d6 100644 --- a/course/social.php +++ b/course/social.php @@ -49,7 +49,7 @@ // Print a form to search forums print_simple_box("Search Discussions", $align="CENTER", $width="100%", $color="$THEME->cellheading"); echo "
"; - print_forum_search_form($course); + forum_print_search_form($course); echo "
"; // Print Admin links for teachers and admin. diff --git a/course/topics.php b/course/topics.php index e91c724950..b22e5fd06b 100644 --- a/course/topics.php +++ b/course/topics.php @@ -73,7 +73,7 @@ // Print a form to search forums print_simple_box("Search Discussions", $align="CENTER", $width="100%", $color="$THEME->cellheading"); echo "
"; - print_forum_search_form($course); + forum_print_search_form($course); echo "
"; // Admin links and controls diff --git a/course/weeks.php b/course/weeks.php index bbf93a68dd..8315eb8494 100644 --- a/course/weeks.php +++ b/course/weeks.php @@ -55,7 +55,7 @@ // Print a form to search forums print_simple_box("Search Discussions", $align="CENTER", $width="100%", $color="$THEME->cellheading"); echo "
"; - print_forum_search_form($course); + forum_print_search_form($course); echo "
"; // Admin links and controls diff --git a/mod/forum/index.php b/mod/forum/index.php index 9b51e9f1ea..1960be4db0 100644 --- a/mod/forum/index.php +++ b/mod/forum/index.php @@ -126,7 +126,7 @@ } echo "
"; - print_forum_search_form($course, $search); + forum_print_search_form($course, $search); echo "
"; print_footer($course); diff --git a/mod/forum/lib.php b/mod/forum/lib.php index a9fc2915a2..9e1bdcf6e4 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -4,15 +4,15 @@ $FORUM_DEFAULT_DISPLAY_MODE = 3; -$FORUM_DISCUSS_MODES = array ( "1" => "Display replies flat, with oldest first", - "-1" => "Display replies flat, wth newest first", - "2" => "Display replies in threaded form", - "3" => "Display replies in nested form"); +$FORUM_LAYOUT_MODES = array ( "1" => "Display replies flat, with oldest first", + "-1" => "Display replies flat, wth newest first", + "2" => "Display replies in threaded form", + "3" => "Display replies in nested form"); // These are course content forums that can be added to the course manually -$FORUM_TYPE = array ("general" => "General forum", - "eachuser" => "Each person posts one discussion", - "single" => "A single simple discussion"); +$FORUM_TYPES = array ("general" => "General forum", + "eachuser" => "Each person posts one discussion", + "single" => "A single simple discussion"); $FORUM_POST_RATINGS = array ("3" => "Shows a more connected approach", "2" => "Shows a more separate approach", @@ -202,9 +202,9 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link echo "

"; if ($rate && $USER->id) { if ($USER->id == $post->userid) { - print_forum_ratings($post->id); + forum_print_ratings($post->id); } else { - print_forum_rating($post->id, $USER->id); + forum_print_rating($post->id, $USER->id); } } @@ -242,7 +242,7 @@ function forum_shorten_post($message) { } -function print_forum_ratings($post) { +function forum_print_ratings($post) { global $CFG, $PHPSESSID; @@ -267,7 +267,7 @@ function print_forum_ratings($post) { } } -function print_forum_rating($post, $user) { +function forum_print_rating($post, $user) { global $FORUM_POST_RATINGS; if ($rs = get_record_sql("SELECT rating from forum_ratings WHERE user='$user' AND post='$post'")) { @@ -284,15 +284,15 @@ function print_forum_rating($post, $user) { } } -function print_forum_mode_form($discussion, $mode) { - GLOBAL $FORUM_DISCUSS_MODES; +function forum_print_mode_form($discussion, $mode) { + GLOBAL $FORUM_LAYOUT_MODES; echo "

"; - popup_form("discuss.php?d=$discussion&mode=", $FORUM_DISCUSS_MODES, "mode", $mode, ""); + popup_form("discuss.php?d=$discussion&mode=", $FORUM_LAYOUT_MODES, "mode", $mode, ""); echo "

\n"; } -function print_forum_search_form($course, $search="") { +function forum_print_search_form($course, $search="") { global $CFG; echo " diff --git a/mod/forum/search.php b/mod/forum/search.php index 9be619d277..9fb571d4ce 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -28,7 +28,7 @@ } echo "
"; - print_forum_search_form($course, $search); + forum_print_search_form($course, $search); echo "
"; if ($search) { -- 2.39.5
"; @@ -744,7 +744,7 @@ function forum_print_discussion($course, $discussion, $post, $mode) { forum_print_post($post, $course->id, $ownpost, $reply=true, $link=false, $rate=false); - print_forum_mode_form($discussion->id, $mode); + forum_print_mode_form($discussion->id, $mode); if ($discussion->assessed && $USER->id) { echo "
"; diff --git a/mod/forum/mod.html b/mod/forum/mod.html index 0ea1e13599..4e176e11e1 100644 --- a/mod/forum/mod.html +++ b/mod/forum/mod.html @@ -13,8 +13,8 @@ student); require("$CFG->dirroot/mod/forum/lib.php"); - asort($FORUM_TYPE); - choose_from_menu($FORUM_TYPE, "type", $form->type); + asort($FORUM_TYPES); + choose_from_menu($FORUM_TYPES, "type", $form->type); ?>