Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I1f306a3925d6768209a06e70082598b2f70cd319
42 lines
985 B
PHP
42 lines
985 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Widget;
|
|
|
|
/**
|
|
* Widget to select multiple namespaces.
|
|
*
|
|
* @copyright 2017 MediaWiki Widgets Team and others; see AUTHORS.txt
|
|
* @license MIT
|
|
*/
|
|
class NamespacesMultiselectWidget extends TagMultiselectWidget {
|
|
|
|
/** @var bool|null */
|
|
protected $allowEditTags = null;
|
|
|
|
/**
|
|
* @param array $config Configuration options
|
|
* - bool $config['allowEditTags'] Allow editing of the tags by clicking them
|
|
*/
|
|
public function __construct( array $config = [] ) {
|
|
parent::__construct( $config );
|
|
|
|
if ( isset( $config['allowEditTags'] ) ) {
|
|
$this->allowEditTags = $config['allowEditTags'];
|
|
}
|
|
|
|
$this->addClasses( [ 'mw-widgets-namespacesMultiselectWidget' ] );
|
|
}
|
|
|
|
protected function getJavaScriptClassName() {
|
|
return 'mw.widgets.NamespacesMultiselectWidget';
|
|
}
|
|
|
|
public function getConfig( &$config ) {
|
|
if ( $this->allowEditTags !== null ) {
|
|
$config['allowEditTags'] = $this->allowEditTags;
|
|
}
|
|
|
|
return parent::getConfig( $config );
|
|
}
|
|
|
|
}
|