Skip to content
Browse files

html_writer MDL-25971 Support disabled => boolean, as well as disable…

…d => disabled in html_writer::select.
  • Loading branch information...
1 parent 5a7f931 commit 1a09fa6dfa4f0dffe2cd25a3fb742e2a00b414c8 @timhunt timhunt committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/outputcomponents.php
View
6 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)) {

0 comments on commit 1a09fa6

Please sign in to comment.
Something went wrong with that request. Please try again.