]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19611 fixing regression - video icon disappeared
authorskodak <skodak>
Thu, 25 Jun 2009 07:30:37 +0000 (07:30 +0000)
committerskodak <skodak>
Thu, 25 Jun 2009 07:30:37 +0000 (07:30 +0000)
course/modedit.php
course/moodleform_mod.php

index 782a9ff5acaac373de91c1204a40590c555a9cf9..c5987683f6ab9b1b500c94269cba542428e5df70 100644 (file)
     }
 
     $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()) {
index 26383c5f33e4d7f7384bc4b5e916a7140f1e7263..e4a3b6b8ae202ec3d95d3d16d5b352b60f55d6f9 100644 (file)
@@ -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');