]> git.mjollnir.org Git - moodle.git/commitdiff
When posting a new topic, display the forum description to help
authormoodler <moodler>
Tue, 14 Dec 2004 06:26:43 +0000 (06:26 +0000)
committermoodler <moodler>
Tue, 14 Dec 2004 06:26:43 +0000 (06:26 +0000)
orient the posting.  Also changed some headings slightly to make more
sense.

mod/forum/post.php

index 10bfc13526f98d1193717b692a0736b5cfccbdd3..078e1ffede512faeed0ebfcb7c8b2e7312d41a69 100644 (file)
             error("Could not find top parent of post $post->id");
         }
     } else {
-        $toppost->subject = get_string("yournewtopic", "forum");
+        $toppost->subject = ($forum->type == "news") ? get_string("addanewtopic", "forum") : 
+                                                       get_string("addanewdiscussion", "forum");
     }
 
     if (empty($post->subject)) {
 
     $cm = get_coursemodule_from_instance("forum", $forum->id, $course->id);
 
-    if (empty($discussion->name)) {
+    if (!empty($discussion) and empty($discussion->name)) {
         $discussion->name = $forum->name;
     }
 
         echo "<h2>".get_string("yourreply", "forum").":</h2>";
     } else {
         echo "<center>";
-        echo "<h2>".get_string("yournewtopic", "forum")."</h2>";
+        $forum->intro = trim($forum->intro);
+        if (!empty($forum->intro)) {
+            print_simple_box(format_text($forum->intro), 'center');
+        }
+        print_heading(get_string('yournewtopic', 'forum'));
     }
     if (!empty($post->error)) {
         notify($post->error);