From: skodak Date: Thu, 25 Jun 2009 07:30:37 +0000 (+0000) Subject: MDL-19611 fixing regression - video icon disappeared X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=09f8d75e327c30079a39290c3c3fe65d09ab7855;p=moodle.git MDL-19611 fixing regression - video icon disappeared --- diff --git a/course/modedit.php b/course/modedit.php index 782a9ff5ac..c5987683f6 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -212,7 +212,7 @@ } $mformclassname = 'mod_'.$module->name.'_mod_form'; - $mform = new $mformclassname($form->instance, $cw->section, $cm); + $mform = new $mformclassname($form->instance, $cw->section, $cm, $course); $mform->set_data($form); if ($mform->is_cancelled()) { diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index 26383c5f33..e4a3b6b8ae 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -44,11 +44,19 @@ class moodleform_mod extends moodleform { * @var string name of module */ protected $_modname; + /** current context, course or module depends if already exists*/ + protected $context; - function moodleform_mod($instance, $section, $cm) { + function moodleform_mod($instance, $section, $cm, $course) { $this->_instance = $instance; $this->_section = $section; $this->_cm = $cm; + if ($this->_cm) { + $this->context = get_context_instance(CONTEXT_MODULE, $this->_cm->id); + } else { + $this->context = get_context_instance(CONTEXT_COURSE, $course->id); + } + // Guess module name $matches = array(); if (!preg_match('/^mod_([^_]+)_mod_form$/', get_class($this), $matches)) { @@ -581,7 +589,7 @@ class moodleform_mod extends moodleform { $mform = $this->_form; $label = is_null($customlabel) ? get_string('moduleintro') : $customlabel; - $mform->addElement('editor', 'introeditor', $label, null, array('maxfiles'=>EDITOR_UNLIMITED_FILES)); + $mform->addElement('editor', 'introeditor', $label, null, array('maxfiles'=>EDITOR_UNLIMITED_FILES, 'noclean'=>true, 'context'=>$this->context)); $mform->setType('introeditor', PARAM_RAW); // no XSS prevention here, users must be trusted if ($required) { $mform->addRule('introeditor', get_string('required'), 'required', null, 'client');