MDL-19030 very ugly hack - do not try to add id to labels of element group - they do not have it

This commit is contained in:
skodak
2009-04-30 10:01:43 +00:00
parent 2ead96df61
commit fffe748c4c
@@ -186,7 +186,7 @@ class HTML_QuickForm_Renderer_Tableless extends HTML_QuickForm_Renderer_Default
} else {
$id = $element->getName();
}
if (!empty($id) and !$element->isFrozen()) { // moodle hack
if (!empty($id) and !$element->isFrozen() and !is_a($element, 'MoodleQuickForm_group')) { // moodle hack
$html = str_replace('<label', '<label for="' . $id . '"', $html);
$element_html = preg_replace('#name="' . $id . '#',
'id="' . $id . '" name="' . $id . '',