]> git.mjollnir.org Git - moodle.git/commitdiff
some xhtml validity fixes for the case that select and text elements are 'frozen'
authorjamiesensei <jamiesensei>
Thu, 11 Jan 2007 04:57:57 +0000 (04:57 +0000)
committerjamiesensei <jamiesensei>
Thu, 11 Jan 2007 04:57:57 +0000 (04:57 +0000)
lib/form/select.php
lib/form/text.php

index d4f3df8ac6ffafc1b4bda4eab2e03f4e804314ed..e96d1f221601dc6379e805f9475cb9547ccb1da8 100644 (file)
@@ -108,6 +108,19 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{
     {
         $this->_options = array();
     } // end func removeOption
-
+    /**
+     * Slightly different container template when frozen. Don't want to use a label tag
+     * with a for attribute in that case for the element label but instead use a div.
+     * Templates are defined in renderer constructor.
+     *
+     * @return string
+     */
+    function getElementTemplateType(){
+        if ($this->_flagFrozen){
+            return 'static';
+        } else {
+            return 'default';
+        }
+    }
 }
 ?>
\ No newline at end of file
index dc9e0db5ba65806b75900ac9c13651a6e4ebf591..b0eccb4f897c2c4c8d5c8ed9e0f343ef4a020bbc 100644 (file)
@@ -75,4 +75,18 @@ class MoodleQuickForm_text extends HTML_QuickForm_text{
     function getHelpButton(){
         return $this->_helpbutton;
     }
+    /**
+     * Slightly different container template when frozen. Don't want to use a label tag
+     * with a for attribute in that case for the element label but instead use a div.
+     * Templates are defined in renderer constructor.
+     *
+     * @return string
+     */
+    function getElementTemplateType(){
+        if ($this->_flagFrozen){
+            return 'static';
+        } else {
+            return 'default';
+        }
+    }
 }
\ No newline at end of file