diff options
author | stang <pmx42@live.cn> | 2022-03-04 21:40:26 +0000 |
---|---|---|
committer | stang <pmx42@live.cn> | 2022-03-20 21:15:26 +0000 |
commit | 9c70df0cf6c2625ba6650a743a7c9da7e808cfb4 (patch) | |
tree | 64ce5185ec6a4f3520a3889a9fdfa9f03aff50b3 /includes/htmlform | |
parent | e6d7146e7ac3293171da6d59d45e1f132b4deea1 (diff) | |
download | mediawikicore-9c70df0cf6c2625ba6650a743a7c9da7e808cfb4.tar.gz mediawikicore-9c70df0cf6c2625ba6650a743a7c9da7e808cfb4.zip |
Fix uses of (error|warning|success)box in core
Replace HTML class for boxes with "mw-message-box-" style.
Bug: T300358
Change-Id: Iddb0fd3ae859714fb03d3a6d4586f8525becaac6
Diffstat (limited to 'includes/htmlform')
-rw-r--r-- | includes/htmlform/HTMLForm.php | 10 | ||||
-rw-r--r-- | includes/htmlform/HTMLFormField.php | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index d0eb5fc45646..368097318e2e 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -1515,9 +1515,13 @@ class HTMLForm extends ContextSource { } } - return $elementstr - ? Html::rawElement( 'div', [ 'class' => $elementsType . 'box' ], $elementstr ) - : ''; + if ( !$elementstr ) { + return ''; + } elseif ( $elementsType === 'error' ) { + return Html::errorBox( $elementstr ); + } else { // $elementsType can only be 'warning' + return Html::warningBox( $elementstr ); + } } /** diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 2e2382b4b892..75dbafa555cd 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -1293,7 +1293,7 @@ abstract class HTMLFormField { } } - return Html::rawElement( 'div', [ 'class' => 'errorbox' ], $errors ); + return Html::errorBox( $errors ); } /** |