X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLSelectNamespace.php;h=ef219690fd8a8ed467469672806de98a0529d7aa;hb=52e586a27020cf9ca3879a76e1103d8dfdc6f74b;hp=4efdfbf306febfb3ed536a14211e99ab7741040a;hpb=b60dded47b7c4437a21baea8ee0780243340abb6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLSelectNamespace.php b/includes/htmlform/HTMLSelectNamespace.php index 4efdfbf306..ef219690fd 100644 --- a/includes/htmlform/HTMLSelectNamespace.php +++ b/includes/htmlform/HTMLSelectNamespace.php @@ -5,28 +5,32 @@ class HTMLSelectNamespace extends HTMLFormField { public function __construct( $params ) { parent::__construct( $params ); - $this->mAllValue = isset( $this->mParams['all'] ) ? $this->mParams['all'] : 'all'; + + $this->mAllValue = array_key_exists( 'all', $params ) + ? $params['all'] + : 'all'; + } function getInputHTML( $value ) { return Html::namespaceSelector( - array( + [ 'selected' => $value, 'all' => $this->mAllValue - ), array( + ], [ 'name' => $this->mName, 'id' => $this->mID, 'class' => 'namespaceselector', - ) + ] ); } public function getInputOOUI( $value ) { - return new MediaWiki\Widget\NamespaceInputWidget( array( + return new MediaWiki\Widget\NamespaceInputWidget( [ 'value' => $value, 'name' => $this->mName, 'id' => $this->mID, 'includeAllValue' => $this->mAllValue, - ) ); + ] ); } }