From: jamiesensei <jamiesensei>
Date: Wed, 4 Apr 2007 10:16:22 +0000 (+0000)
Subject: fixes MDL-9195 mform->hardFreeze() doesn't remove id attribute of label for checkbox
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=db8e700b0a7d60ad253845b407da43973fdd0e9d;p=moodle.git

fixes MDL-9195 mform->hardFreeze() doesn't remove id attribute of label for checkbox
---

diff --git a/lib/form/checkbox.php b/lib/form/checkbox.php
index b62861b1de..294cd32284 100644
--- a/lib/form/checkbox.php
+++ b/lib/form/checkbox.php
@@ -99,5 +99,19 @@ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox{
         }
         return true;
     } // end func onQuickFormEvent
+    /**
+     * 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