3 * Creates a Html::namespaceSelector input field with a button assigned to the input field.
6 class HTMLAdvancedSelectNamespace
extends HTMLSelectNamespace
{
7 function getInputHTML( $value ) {
8 $allValue = ( isset( $this->mParams
['all'] ) ?
$this->mParams
['all'] : '' );
10 return parent
::getInputHTML( $value ) . ' ' .
12 $this->msg( 'invert' )->text(),
13 $this->mParams
['invertname'],
14 $this->mParams
['invertid'],
15 $this->mParams
['invertdefault'],
16 array( 'title' => $this->msg( 'tooltip-invert' )->text() )
19 $this->msg( 'namespace_association' )->text(),
20 $this->mParams
['associatedname'],
21 $this->mParams
['associatedid'],
22 $this->mParams
['associateddefault'],
23 array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
28 * Get the OOUI version of this field.
30 * @param string $value
31 * @return MediaWiki\\Widget\\NamespaceInputWidget A layout with all widget.
33 public function getInputOOUI( $value ) {
34 # There are more fields in this Widget as only one, so there are more values instead of only once.
35 # Filter the data from the request before creating the form to set the correct values to the
37 # Get WebRequest only, if there is an instance of HTMLForm, use default data instead
38 $invertdefault = false;
39 $associateddefault = false;
40 if ( $this->mParent
instanceof HTMLForm
) {
41 $request = $this->mParent
->getRequest();
42 if ( $request->getCheck( $this->mParams
['associatedname'] ) ) {
43 $associateddefault = true;
45 if ( $request->getCheck( $this->mParams
['invertname'] ) ) {
46 $invertdefault = true;
50 // Unsupported: invertid, associatedid
51 return new MediaWiki\Widget\
NamespaceInputWidget( array(
52 'valueNamespace' => $value,
53 'nameNamespace' => $this->mName
,
55 'includeAllValue' => $this->mAllValue
,
56 'nameInvert' => $this->mParams
['invertname'],
57 'labelInvert' => $this->msg( 'invert' )->text(),
58 'valueInvert' => $invertdefault,
59 'nameAssociated' => $this->mParams
['associatedname'],
60 'valueAssociated' => $associateddefault,
61 'labelAssociated' => $this->msg( 'namespace_association' )->text(),