mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-18910 full support for module intro editor with embedded images
This commit is contained in:
parent
97498d1ec3
commit
9b010a102e
@ -2428,7 +2428,7 @@ function assignment_refresh_events($courseid = 0) {
|
||||
|
||||
foreach ($assignments as $assignment) {
|
||||
$cm = get_coursemodule_from_id('assignment', $assignment->id);
|
||||
$event = NULL;
|
||||
$event = new object();
|
||||
$event->name = $assignment->name;
|
||||
$event->description = format_module_intro('assignment', $assignment, $cm->id);
|
||||
$event->timestart = $assignment->timedue;
|
||||
|
@ -79,7 +79,7 @@ function chat_add_instance($chat) {
|
||||
|
||||
$event = NULL;
|
||||
$event->name = $chat->name;
|
||||
$event->description = $chat->intro;
|
||||
$event->description = format_module_intro('chat', $chat, $chat->coursemodule);
|
||||
$event->courseid = $chat->course;
|
||||
$event->groupid = 0;
|
||||
$event->userid = 0;
|
||||
@ -113,7 +113,7 @@ function chat_update_instance($chat) {
|
||||
if ($event->id = $DB->get_field('event', 'id', array('modulename'=>'chat', 'instance'=>$chat->id))) {
|
||||
|
||||
$event->name = $chat->name;
|
||||
$event->description = $chat->intro;
|
||||
$event->description = format_module_intro('chat', $chat, $chat->coursemodule);
|
||||
$event->timestart = $chat->chattime;
|
||||
|
||||
update_event($event);
|
||||
@ -399,9 +399,10 @@ function chat_refresh_events($courseid = 0) {
|
||||
$moduleid = $DB->get_field('modules', 'id', array('name'=>'chat'));
|
||||
|
||||
foreach ($chats as $chat) {
|
||||
$event = NULL;
|
||||
$cm = get_coursemodule_from_id('chat', $chat->id);
|
||||
$event = new object();
|
||||
$event->name = $chat->name;
|
||||
$event->description = $chat->intro;
|
||||
$event->description = format_module_intro('chat', $chat, $cm->id);
|
||||
$event->timestart = $chat->chattime;
|
||||
|
||||
if ($event->id = $DB->get_field('event', 'id', array('modulename'=>'chat', 'instance'=>$chat->id))) {
|
||||
@ -600,8 +601,6 @@ function chat_update_chat_times($chatid=0) {
|
||||
}
|
||||
|
||||
foreach ($chats as $chat) {
|
||||
unset($chat->name);
|
||||
unset($chat->intro);
|
||||
switch ($chat->schedule) {
|
||||
case 1: // Single event - turn off schedule and disable
|
||||
$chat->chattime = 0;
|
||||
|
@ -4,8 +4,7 @@ require_once ($CFG->dirroot.'/course/moodleform_mod.php');
|
||||
class mod_chat_mod_form extends moodleform_mod {
|
||||
|
||||
function definition() {
|
||||
global $CFG, $DB;
|
||||
$mform =& $this->_form;
|
||||
$mform = $this->_form;
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
$mform->addElement('header', 'general', get_string('general', 'form'));
|
||||
@ -18,10 +17,7 @@ class mod_chat_mod_form extends moodleform_mod {
|
||||
}
|
||||
$mform->addRule('name', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat'));
|
||||
$mform->setType('intro', PARAM_RAW);
|
||||
$mform->setHelpButton('intro', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton');
|
||||
$mform->addRule('intro', get_string('required'), 'required', null, 'client');
|
||||
$this->add_intro_editor(true, get_string('chatintro', 'chat'));
|
||||
|
||||
$mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat'));
|
||||
|
||||
@ -55,4 +51,3 @@ class mod_chat_mod_form extends moodleform_mod {
|
||||
$this->add_action_buttons();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -173,8 +173,7 @@
|
||||
}
|
||||
|
||||
if ($chat->intro) {
|
||||
$options = (object)array('noclean'=>true);
|
||||
print_box(format_text($chat->intro, $chat->introformat, $options), 'generalbox', 'intro');
|
||||
print_box(format_module_intro('chat', $chat, $cm->id), 'generalbox', 'intro');
|
||||
}
|
||||
|
||||
chat_delete_old_users();
|
||||
|
@ -19,21 +19,16 @@ class mod_choice_mod_form extends moodleform_mod {
|
||||
}
|
||||
$mform->addRule('name', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('htmleditor', 'intro', get_string('choicetext', 'choice'));
|
||||
$mform->setType('intro', PARAM_RAW);
|
||||
$mform->addRule('intro', null, 'required', null, 'client');
|
||||
$mform->setHelpButton('intro', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton');
|
||||
|
||||
$mform->addElement('format', 'introformat', get_string('format'));
|
||||
$this->add_intro_editor(true, get_string('chatintro', 'chat'));
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
$repeatarray=array();
|
||||
$repeatarray = array();
|
||||
$repeatarray[] = &MoodleQuickForm::createElement('header', '', get_string('option','choice').' {no}');
|
||||
$repeatarray[] = &MoodleQuickForm::createElement('text', 'option', get_string('option','choice'));
|
||||
$repeatarray[] = &MoodleQuickForm::createElement('text', 'limit', get_string('limit','choice'));
|
||||
$repeatarray[] = &MoodleQuickForm::createElement('hidden', 'optionid', 0);
|
||||
|
||||
$menuoptions=array();
|
||||
$menuoptions = array();
|
||||
$menuoptions[0] = get_string('disable');
|
||||
$menuoptions[1] = get_string('enable');
|
||||
$mform->addElement('header', 'timerestricthdr', get_string('limit', 'choice'));
|
||||
|
@ -79,8 +79,7 @@
|
||||
echo '<div class="clearer"></div>';
|
||||
|
||||
if ($choice->intro) {
|
||||
$options = (object)array('noclean'=>true);
|
||||
print_box(format_text($choice->intro, $choice->introformat, $options), 'generalbox', 'intro');
|
||||
print_box(format_module_intro('choice', $choice, $cm->id), 'generalbox', 'intro');
|
||||
}
|
||||
|
||||
$current = false; // Initialise for later
|
||||
|
Loading…
x
Reference in New Issue
Block a user