* @var boolean $selected Whether or not this option is selected
*/
public $selected = false;
+ /**
+ * @var boolean $disabled Whether or not this option is disabled
+ */
+ public $disabled = false;
public function __construct() {
$this->label = new html_label();
/**
* @var boolean $header Whether or not this cell is a header cell
*/
- public $header = false;
+ public $header = null;
/**
* @see lib/moodle_html_component#prepare()
'name' => $name,
'id' => $option->id,
'alt' => $option->alt,
+ 'disabled' => $option->disabled,
'class' => $option->get_classes_string(),
'checked' => $option->selected));
$output .= $this->label($option->label);
if ($option instanceof html_select_option) {
return $this->output_tag('option', array(
'value' => $option->value,
+ 'disabled' => $option->disabled,
'class' => $option->get_classes_string(),
'selected' => $option->selected), $option->text);
} else if ($option instanceof html_select_optgroup) {
$heading->text = $headingtext;
$heading->header = true;
}
+
+ if ($heading->header !== false) {
+ $heading->header = true;
+ }
$this->prepare_event_handlers($heading);
'scope' => $heading->scope,
'colspan' => $heading->colspan);
- $output .= $this->output_tag('th', $attributes, $heading->text) . "\n";
+ $tagtype = 'td';
+ if ($heading->header === true) {
+ $tagtype = 'th';
+ }
+ $output .= $this->output_tag($tagtype, $attributes, $heading->text) . "\n";
}
$output .= $this->output_end_tag('tr') . "\n";
$output .= $this->output_end_tag('thead') . "\n";
'abbr' => $cell->abbr,
'scope' => $cell->scope);
$tagtype = 'td';
- if ($cell->header) {
+ if ($cell->header === true) {
$tagtype = 'th';
}
$output .= $this->output_tag($tagtype, $tdattributes, $cell->text) . "\n";