18 parent::__construct( $params );
20 if ( isset( $params[
'placeholder-message'] ) ) {
21 $this->mPlaceholder = $this->
getMessage( $params[
'placeholder-message'] )->text();
22 } elseif ( isset( $params[
'placeholder'] ) ) {
23 $this->mPlaceholder = $params[
'placeholder'];
26 if ( isset( $params[
'useeditfont'] ) ) {
27 $this->mUseEditFont = $params[
'useeditfont'];
32 return $this->mParams[
'cols'] ?? static::DEFAULT_COLS;
36 return $this->mParams[
'rows'] ?? static::DEFAULT_ROWS;
40 $val = $this->mParams[
'spellcheck'] ??
null;
41 if ( is_bool( $val ) ) {
43 return $val ===
true ?
'true' :
'false';
58 if ( $this->mClass !==
'' ) {
59 array_push( $classes, $this->mClass );
61 if ( $this->mUseEditFont ) {
68 'mw-editfont-' . $this->mParent->getUser()->getOption(
'editfont' )
70 $this->mParent->getOutput()->addModuleStyles(
'mediawiki.editfont.styles' );
72 if ( $this->mPlaceholder !==
'' ) {
75 if ( count( $classes ) ) {
76 $attribs[
'class'] = implode(
' ', $classes );
94 if ( isset( $this->mParams[
'cols'] ) ) {
95 throw new Exception(
"OOUIHTMLForm does not support the 'cols' parameter for textareas" );
100 if ( $this->mClass !==
'' ) {
101 array_push( $classes, $this->mClass );
103 if ( $this->mUseEditFont ) {
110 'mw-editfont-' . $this->mParent->getUser()->getOption(
'editfont' )
112 $this->mParent->getOutput()->addModuleStyles(
'mediawiki.editfont.styles' );
114 if ( $this->mPlaceholder !==
'' ) {
117 if ( count( $classes ) ) {
118 $attribs[
'classes'] = $classes;
129 $attribs += OOUI\Element::configFromHtmlAttributes(
133 return new OOUI\MultilineTextInputWidget( [
135 'name' => $this->mName,