* @license MIT
*/
class CheckMatrixWidget extends \OOUI\Widget {
-
- protected $name = '';
- protected $columns = [];
- protected $rows = [];
- protected $tooltips = [];
- protected $values = [];
- protected $forcedOn = [];
- protected $forcedOff = [];
+ /** @var string|null */
+ protected $name;
+ /** @var string|null */
+ protected $id;
+ /** @var array */
+ protected $columns;
+ /** @var array */
+ protected $rows;
+ /** @var array */
+ protected $tooltips;
+ /** @var array */
+ protected $values;
+ /** @var array */
+ protected $forcedOn;
+ /** @var array */
+ protected $forcedOff;
/**
- * CheckMatrixWidget constructor
- *
* Operates similarly to MultiSelectWidget, but instead of using an array of
* options, uses an array of rows and an array of columns to dynamically
* construct a matrix of options. The tags used to identify a particular cell
$tr->appendContent( $this->getCellTag( "\u{00A0}" ) );
foreach ( $this->columns as $columnLabel => $columnTag ) {
$tr->appendContent(
- $this->getCellTag( new \OOUI\HtmlSnippet( $columnLabel ) )
+ $this->getCellTag( new \OOUI\HtmlSnippet( $columnLabel ), 'th' )
);
}
$thead->appendContent( $tr );
* @param mixed $content Content for the <td> cell
* @return \OOUI\Tag Resulting cell
*/
- private function getCellTag( $content ) {
- $cell = new \OOUI\Tag( 'td' );
+ private function getCellTag( $content, $tagElement = 'td' ) {
+ $cell = new \OOUI\Tag( $tagElement );
$cell->appendContent( $content );
return $cell;
}