Renamed namespaceForm to outputHTMLForm and make it protected Also made sure that this is the only place where it's used https://github.com/search?q=namespaceForm+%40wikimedia&ref=reposearch&type=Code Also make HTMLSelectNamespace's work when 'all' is set to null. Change-Id: Ia559b52464bceaf1202e3a6696728781bb62cdbc
36 lines
769 B
PHP
36 lines
769 B
PHP
<?php
|
|
/**
|
|
* Wrapper for Html::namespaceSelector to use in HTMLForm
|
|
*/
|
|
class HTMLSelectNamespace extends HTMLFormField {
|
|
public function __construct( $params ) {
|
|
parent::__construct( $params );
|
|
|
|
$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(
|
|
'value' => $value,
|
|
'name' => $this->mName,
|
|
'id' => $this->mID,
|
|
'includeAllValue' => $this->mAllValue,
|
|
) );
|
|
}
|
|
}
|