3 namespace MediaWiki\Widget
;
6 * Widget to select multiple titles.
8 * @copyright 2017 MediaWiki Widgets Team and others; see AUTHORS.txt
11 class TitlesMultiselectWidget
extends TagMultiselectWidget
{
13 protected $showMissing = null;
14 protected $excludeDynamicNamespaces = null;
17 * @param array $config Configuration options
18 * - bool $config['showMissing'] Show missing pages
19 * - bool $config['excludeDynamicNamespaces'] Exclude pages in negative namespaces
21 public function __construct( array $config = [] ) {
22 parent
::__construct( $config );
25 if ( isset( $config['showMissing'] ) ) {
26 $this->showMissing
= $config['showMissing'];
28 if ( isset( $config['excludeDynamicNamespaces'] ) ) {
29 $this->excludeDynamicNamespaces
= $config['excludeDynamicNamespaces'];
32 $this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] );
35 protected function getJavaScriptClassName() {
36 return 'mw.widgets.TitlesMultiselectWidget';
39 public function getConfig( &$config ) {
40 if ( $this->showMissing
!== null ) {
41 $config['showMissing'] = $this->showMissing
;
43 if ( $this->excludeDynamicNamespaces
!== null ) {
44 $config['excludeDynamicNamespaces'] = $this->excludeDynamicNamespaces
;
47 return parent
::getConfig( $config );