Permalink
Browse files

Better default options, and hiding of moodle-text help when htmlediti…

…ng is operational
  • Loading branch information...
moodler
moodler committed Oct 10, 2002
1 parent c4a4cae commit 213e8cc67d6c5eef59bdc9b44b42555d95129541
Showing with 13 additions and 4 deletions.
  1. +5 −1 mod/forum/post.html
  2. +8 −3 mod/forum/post.php
View
@@ -10,7 +10,11 @@
</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"
View
@@ -63,6 +63,12 @@
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();
@@ -116,6 +123,7 @@
$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)) {
@@ -262,9 +270,6 @@
$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>";

0 comments on commit 213e8cc

Please sign in to comment.