]> git.mjollnir.org Git - moodle.git/commitdiff
Better default options, and hiding of moodle-text help when htmlediting is operational
authormoodler <moodler>
Thu, 10 Oct 2002 09:27:49 +0000 (09:27 +0000)
committermoodler <moodler>
Thu, 10 Oct 2002 09:27:49 +0000 (09:27 +0000)
mod/forum/post.html
mod/forum/post.php

index 614377cc462c6411b69ee7fb2765794fc3a387d7..9d378d2598be42e2358ba1612e972c36921ec846 100644 (file)
     </td>
 </tr>
 <tr valign=top>
-    <td align=right><P><B><? print_string("message", "forum"); ?>:</B><BR><BR><? helpbutton("text", get_string("helptext")) ?></P></TD>
+    <td align=right><P><B><? print_string("message", "forum"); ?>:</B>
+    <? if (!$usehtmleditor) { ?>
+        <BR><BR><? helpbutton("text", get_string("helptext")) ?></P>
+     <? } ?>
+    </TD>
     <td>
     <? if ($usehtmleditor) { ?>
         <object id="richedit" style="BACKGROUND-COLOR: buttonface" data="../../lib/rte/richedit.html"
index 7d7b014efb4eef7af91930543c90d96f7f369c64..2c87a9259cf08e5276fef09ddbcf6d5157929f4f 100644 (file)
         die;
     }
 
+    if ($usehtmleditor = can_use_richtext_editor()) {
+        $defaultformat = FORMAT_HTML;
+        $onsubmit = "onsubmit=\"copyrichtext(theform.message);\"";
+    } else {
+        $defaultformat = FORMAT_MOODLE;
+    }
 
 
     if (isset($forum)) {      // User is starting a new discussion in a forum
@@ -90,6 +96,7 @@
         $post->subject = "";
         $post->user = $USER->id;
         $post->message = "";
+        $post->format = $defaultformat;
 
         forum_set_return();
 
         $post->subject = $parent->subject;
         $post->user = $USER->id;
         $post->message = "";
+        $post->format = $defaultformat;
 
         $strre = get_string("re", "forum");
         if (!(substr($post->subject, 0, 3) == $strre)) {
 
     $strforums = get_string("modulenameplural", "forum");
 
-    if ($usehtmleditor = can_use_richtext_editor()) {
-        $onsubmit = "onsubmit=\"copyrichtext(theform.message);\"";
-    }
 
     $navmiddle = "<A HREF=\"../forum/index.php?id=$course->id\">$strforums</A> -> <A HREF=\"view.php?f=$forum->id\">$forum->name</A>";