2018-08-30 00:33:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Widget;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Widget to select multiple titles.
|
|
|
|
|
*
|
|
|
|
|
* @copyright 2017 MediaWiki Widgets Team and others; see AUTHORS.txt
|
|
|
|
|
* @license MIT
|
|
|
|
|
*/
|
2018-12-12 15:57:57 +00:00
|
|
|
class TitlesMultiselectWidget extends TagMultiselectWidget {
|
2018-08-30 00:33:32 +00:00
|
|
|
|
2018-11-08 13:52:55 +00:00
|
|
|
protected $showMissing = null;
|
2018-08-30 00:33:32 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param array $config Configuration options
|
2018-11-08 13:52:55 +00:00
|
|
|
* - bool $config['showMissing'] Show missing pages
|
2018-08-30 00:33:32 +00:00
|
|
|
*/
|
|
|
|
|
public function __construct( array $config = [] ) {
|
|
|
|
|
parent::__construct( $config );
|
|
|
|
|
|
|
|
|
|
// Properties
|
2018-11-08 13:52:55 +00:00
|
|
|
if ( isset( $config['showMissing'] ) ) {
|
|
|
|
|
$this->showMissing = $config['showMissing'];
|
|
|
|
|
}
|
2018-11-12 16:00:11 +00:00
|
|
|
|
2018-08-30 00:33:32 +00:00
|
|
|
$this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function getJavaScriptClassName() {
|
|
|
|
|
return 'mw.widgets.TitlesMultiselectWidget';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getConfig( &$config ) {
|
2018-11-08 13:52:55 +00:00
|
|
|
if ( $this->showMissing !== null ) {
|
|
|
|
|
$config['showMissing'] = $this->showMissing;
|
|
|
|
|
}
|
2018-08-30 00:33:32 +00:00
|
|
|
|
|
|
|
|
return parent::getConfig( $config );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|