27 parent::__construct( $params );
29 if ( isset( $params[
'placeholder-message'] ) ) {
30 $this->mPlaceholder = $this->
getMessage( $params[
'placeholder-message'] )->text();
31 } elseif ( isset( $params[
'placeholder'] ) ) {
32 $this->mPlaceholder = $params[
'placeholder'];
35 if ( isset( $params[
'useeditfont'] ) ) {
36 $this->mUseEditFont = $params[
'useeditfont'];
41 return $this->mParams[
'cols'] ?? static::DEFAULT_COLS;
45 return $this->mParams[
'rows'] ?? static::DEFAULT_ROWS;
49 $val = $this->mParams[
'spellcheck'] ??
null;
50 if ( is_bool( $val ) ) {
52 return $val ?
'true' :
'false';
71 if ( $this->mClass !==
'' ) {
74 if ( $this->mUseEditFont ) {
75 $userOptionsLookup = MediaWikiServices::getInstance()
76 ->getUserOptionsLookup();
83 $userOptionsLookup->getOption( $this->mParent->getUser(),
'editfont' );
84 $this->mParent->getOutput()->addModuleStyles(
'mediawiki.editfont.styles' );
86 if ( $this->mPlaceholder !==
'' ) {
90 $attribs[
'class'] = $classes;
102 return Html::textarea( $this->mName, $value, $attribs );
112 if ( isset( $this->mParams[
'cols'] ) ) {
113 throw new Exception(
"OOUIHTMLForm does not support the 'cols' parameter for textareas" );
118 if ( $this->mClass !==
'' ) {
121 if ( $this->mUseEditFont ) {
122 $userOptionsLookup = MediaWikiServices::getInstance()
123 ->getUserOptionsLookup();
130 $userOptionsLookup->getOption( $this->mParent->getUser(),
'editfont' );
131 $this->mParent->getOutput()->addModuleStyles(
'mediawiki.editfont.styles' );
133 if ( $this->mPlaceholder !==
'' ) {
136 if ( count( $classes ) ) {
137 $attribs[
'classes'] = $classes;
148 $attribs += OOUI\Element::configFromHtmlAttributes(
152 return new OOUI\MultilineTextInputWidget( [
154 'name' => $this->mName,
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself....
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.Defaults to false, which getOOUI will interpret as "...