From: rkingdon Date: Wed, 23 Jun 2004 14:16:30 +0000 (+0000) Subject: Dialogue entries now use the HTML editor. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=352ab98fa0d850cfcf05db06acd34a8dadcf8098;p=moodle.git Dialogue entries now use the HTML editor. --- diff --git a/mod/dialogue/dialogues.php b/mod/dialogue/dialogues.php index df8d4816b3..f7d29b8383 100644 --- a/mod/dialogue/dialogues.php +++ b/mod/dialogue/dialogues.php @@ -28,14 +28,15 @@ error("Course is misconfigured"); } - require_login($course->id); - if (! $dialogue = get_record("dialogue", "id", $cm->instance)) { error("Course module dialogue is incorrect"); } require_login($course->id); + // set up some general variables + $usehtmleditor = can_use_html_editor(); + $navigation = ""; if ($course->category) { $navigation = "id\">$course->shortname ->"; diff --git a/mod/dialogue/locallib.php b/mod/dialogue/locallib.php index 6be792ab15..56d3fdb7dc 100644 --- a/mod/dialogue/locallib.php +++ b/mod/dialogue/locallib.php @@ -338,11 +338,12 @@ function dialogue_list_conversations_self($dialogue) { 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 "
\n"; echo "\n"; @@ -395,7 +396,8 @@ function dialogue_list_conversations_self($dialogue) { } echo "
"; - 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 "\n"; @@ -424,23 +426,19 @@ function dialogue_list_conversations_self($dialogue) { echo "\n"; helpbutton("writing", get_string("helpwriting"), "dialogue", true, true); echo "
"; - if ($showemoticon) { - emoticonhelpbutton("replies", "reply$conversation->id"); - $showemoticon = false; - } echo "\n"; - // use a cumbersome name on the textarea as the emoticonhelp doesn't like an "array" name - echo "\n"; + // use a cumbersome name on the textarea is just historical :-) + print_textarea($usehtmleditor, 20, 75, 630, 300, "reply$conversation->id"); echo ""; echo "
\n"; } print_simple_box_end(); - if ($showbutton) { - echo "
\n"; - echo "
\n"; - } - echo "\n"; + use_html_editor(); + if ($showbutton) { + echo "
\n"; + echo "
\n"; + } + echo "\n"; } } @@ -459,8 +457,6 @@ function dialogue_print_conversation($dialogue, $conversation) { $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 "
\n"; echo "\n"; @@ -520,14 +516,11 @@ function dialogue_print_conversation($dialogue, $conversation) { echo "\n"; helpbutton("writing", get_string("helpwriting"), "dialogue", true, true); echo "
"; - if ($showemoticon) { - emoticonhelpbutton("replies", "reply$conversation->id"); - $showemoticon = false; - } echo "\n"; - // use a cumbersome name on the textarea as the emoticonhelp doesn't like an "array" name - echo "\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 ""; echo "
\n"; print_simple_box_end(); diff --git a/mod/dialogue/view.php b/mod/dialogue/view.php index 31d8bf136f..9cf1c65585 100644 --- a/mod/dialogue/view.php +++ b/mod/dialogue/view.php @@ -14,18 +14,21 @@ 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 = "id\">$course->shortname ->"; } @@ -133,13 +136,9 @@ echo "\n"; helpbutton("writing", get_string("helpwriting"), "dialogue", true, true); echo "
"; - $showemoticon = false; - if ($showemoticon) { - emoticonhelpbutton("replies", "firstentry"); - } echo "\n"; - echo "\n"; + print_textarea($usehtmleditor, 20, 75, 630, 300, "firstentry"); + use_html_editor(); echo ""; echo "\n";