From: jamiesensei Date: Thu, 11 Jan 2007 04:57:57 +0000 (+0000) Subject: some xhtml validity fixes for the case that select and text elements are 'frozen' X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0709d4d5f5cf168bc6b4ff304dae3a22a91d47d5;p=moodle.git some xhtml validity fixes for the case that select and text elements are 'frozen' --- diff --git a/lib/form/select.php b/lib/form/select.php index d4f3df8ac6..e96d1f2216 100644 --- a/lib/form/select.php +++ b/lib/form/select.php @@ -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 diff --git a/lib/form/text.php b/lib/form/text.php index dc9e0db5ba..b0eccb4f89 100644 --- a/lib/form/text.php +++ b/lib/form/text.php @@ -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