From 234b857c0cdf9e1c9a03964aa631dd68d2cd075f Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 4 Aug 2009 13:59:02 +0000 Subject: [PATCH] MDL-19756 Fixed regression in unit tests --- lib/outputlib.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index d2f9f5c06c..324fba299a 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -2689,7 +2689,7 @@ class moodle_core_renderer extends moodle_renderer_base { 'style' => $image->style, 'title' => $image->title, 'id' => $image->id); - + if (!empty($image->height) || !empty($image->width)) { $attributes['style'] .= $this->prepare_legacy_width_and_height($image); } @@ -2966,7 +2966,7 @@ class moodle_core_renderer extends moodle_renderer_base { } $option->prepare(); - $option->generate_id(); + $option->label->for = $option->id; $this->prepare_event_handlers($option); @@ -3699,9 +3699,11 @@ class moodle_select extends moodle_html_component { if (empty($this->id)) { $this->id = 'menu' . str_replace(array('[', ']'), '', $this->name); } + if (empty($this->classes)) { $this->set_classes(array('menu' . str_replace(array('[', ']'), '', $this->name))); } + if (is_null($this->nothinglabel)) { $this->nothinglabel = get_string('choosedots'); } @@ -3765,7 +3767,7 @@ class moodle_select extends moodle_html_component { foreach ($options as $value => $display) { if ($display == '--') { /// we are ending previous optgroup - $this->options[] = $optgroup; + // $this->options[] = $optgroup; $inoptgroup = false; continue; } else if (substr($display,0,2) == '--') { /// we are starting a new optgroup @@ -3805,10 +3807,6 @@ class moodle_select extends moodle_html_component { $option->value = s($value); - if (!empty($optionsextra[$value])) { - $optstr .= ' '.$optionsextra[$value]; - } - if ($inoptgroup) { $optgroup->options[] = $option; } else { -- 2.39.5