if (! $cm = get_coursemodule_from_instance("dialogue", $dialogue->id, $course->id)) {
error("Course Module ID was incorrect");
}
-
+
+ // set up some general variables
+ $usehtmleditor = can_use_html_editor();
+
$timenow = time();
$showbutton = false;
- $showemoticon = false; // never show emoticons for now - need to close or reload the popup
- // window to get the focus into the correct textarea on the second time round
echo "<form name=\"replies\" method=\"post\" action=\"dialogues.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"insertentries\">\n";
}
echo "<div></td></tr>";
- if ($entries = get_records_select("dialogue_entries", "conversationid = $conversation->id", "id")) {
+ if ($entries = get_records_select("dialogue_entries", "conversationid = $conversation->id",
+ "id")) {
foreach ($entries as $entry) {
if ($entry->userid == $USER->id) {
echo "<tr><td colspan=\"2\" bgcolor=\"#FFFFFF\">\n";
echo "<tr><td valign=\"top\" align=\"right\">\n";
helpbutton("writing", get_string("helpwriting"), "dialogue", true, true);
echo "<br />";
- if ($showemoticon) {
- emoticonhelpbutton("replies", "reply$conversation->id");
- $showemoticon = false;
- }
echo "</td><td>\n";
- // use a cumbersome name on the textarea as the emoticonhelp doesn't like an "array" name
- echo "<textarea name=\"reply$conversation->id\" rows=\"5\" cols=\"60\" wrap=\"virtual\">";
- echo "</textarea>\n";
+ // use a cumbersome name on the textarea is just historical :-)
+ print_textarea($usehtmleditor, 20, 75, 630, 300, "reply$conversation->id");
echo "</td></tr>";
echo "</table></center><br />\n";
}
print_simple_box_end();
- if ($showbutton) {
- echo "<hr />\n";
- echo "<br /><input type=\"submit\" value=\"".get_string("addmynewentries", "dialogue")."\">\n";
- }
- echo "</form>\n";
+ use_html_editor();
+ if ($showbutton) {
+ echo "<hr />\n";
+ echo "<br /><input type=\"submit\" value=\"".get_string("addmynewentries", "dialogue")."\">\n";
+ }
+ echo "</form>\n";
}
}
$timenow = time();
$showbutton = false;
- $showemoticon = false; // never show emoticons for now - need to close or reload the popup
- // window to get the focus into the correct textarea on the second time round
echo "<form name=\"replies\" method=\"post\" action=\"dialogues.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"insertentries\">\n";
echo "<tr><td valign=\"top\" align=\"right\">\n";
helpbutton("writing", get_string("helpwriting"), "dialogue", true, true);
echo "<br />";
- if ($showemoticon) {
- emoticonhelpbutton("replies", "reply$conversation->id");
- $showemoticon = false;
- }
echo "</td><td>\n";
- // use a cumbersome name on the textarea as the emoticonhelp doesn't like an "array" name
- echo "<textarea name=\"reply$conversation->id\" rows=\"5\" cols=\"60\" wrap=\"virtual\">";
- echo "</textarea>\n";
+ // use a cumbersome name on the textarea for historical reasons :-)
+ $usehtmleditor = can_use_html_editor();
+ print_textarea($usehtmleditor, 20, 75, 630, 300, "reply$conversation->id");
+ use_html_editor();
echo "</td></tr>";
echo "</table></center><br />\n";
print_simple_box_end();
error("Course is misconfigured");
}
- require_login($course->id);
-
if (! $dialogue = get_record("dialogue", "id", $cm->instance)) {
error("Course module is incorrect");
}
+ require_login($course->id);
+
add_to_log($course->id, "dialogue", "view", "view.php?id=$cm->id", $dialogue->id, $cm->id);
if (! $cw = get_record("course_sections", "id", $cm->section)) {
error("Course module is incorrect");
}
+ // set up some general variables
+ $usehtmleditor = can_use_html_editor();
+
if ($course->category) {
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
}
echo "<tr><td valign=\"top\" align=\"right\">\n";
helpbutton("writing", get_string("helpwriting"), "dialogue", true, true);
echo "<br />";
- $showemoticon = false;
- if ($showemoticon) {
- emoticonhelpbutton("replies", "firstentry");
- }
echo "</td><td>\n";
- echo "<textarea name=\"firstentry\" rows=\"5\" cols=\"60\" wrap=\"virtual\">";
- echo "</textarea>\n";
+ print_textarea($usehtmleditor, 20, 75, 630, 300, "firstentry");
+ use_html_editor();
echo "</td></tr>";
echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"".
get_string("opendialogue","dialogue")."\"></td></tr>\n";