]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8144 Fixed can not force free format selection
authorskodak <skodak>
Thu, 11 Jan 2007 09:41:13 +0000 (09:41 +0000)
committerskodak <skodak>
Thu, 11 Jan 2007 09:41:13 +0000 (09:41 +0000)
lib/form/format.php

index 6d8e31586357f5d7480b9336208bdb274da2faaa..7fad587b2d2bcc5005e1741c10f656bd4efbea60 100644 (file)
@@ -36,15 +36,18 @@ class MoodleQuickForm_format extends MoodleQuickForm_select{
             $elementLabel = get_string('format');
         }
         HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
-        $this->_persistantFreeze = true;
         $this->_type = 'format';
 
         $this->_useHtmlEditor=$useHtmlEditor;
-        if ($this->_useHtmlEditor==null){
+        if ($this->_useHtmlEditor === null){
             $this->_useHtmlEditor=can_use_html_editor();
         }
+
+        $this->setPersistantFreeze($this->_useHtmlEditor);
         if ($this->_useHtmlEditor){
             $this->freeze();
+        } else {
+            $this->unfreeze();
         }
     } //end constructor