From 1a09fa6dfa4f0dffe2cd25a3fb742e2a00b414c8 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 13 Jan 2011 19:27:28 +0000 Subject: [PATCH] html_writer MDL-25971 Support disabled => boolean, as well as disabled => disabled in html_writer::select. --- lib/outputcomponents.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 3ffed7cbd6592..917e4196ecb8e 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -1038,6 +1038,12 @@ public static function select(array $options, $name, $selected = '', $nothing = $attributes['name'] = $name; + if (!empty($attributes['disabled'])) { + $attributes['disabled'] = 'disabled'; + } else { + unset($attributes['disabled']); + } + $output = ''; foreach ($options as $value=>$label) { if (is_array($label)) {