MediaWiki REL1_34
TitlesMultiselectWidget.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Widget;
4
12
13 protected $showMissing = null;
14 protected $excludeDynamicNamespaces = null;
15
21 public function __construct( array $config = [] ) {
22 parent::__construct( $config );
23
24 // Properties
25 if ( isset( $config['showMissing'] ) ) {
26 $this->showMissing = $config['showMissing'];
27 }
28 if ( isset( $config['excludeDynamicNamespaces'] ) ) {
29 $this->excludeDynamicNamespaces = $config['excludeDynamicNamespaces'];
30 }
31
32 $this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] );
33 }
34
35 protected function getJavaScriptClassName() {
36 return 'mw.widgets.TitlesMultiselectWidget';
37 }
38
39 public function getConfig( &$config ) {
40 if ( $this->showMissing !== null ) {
41 $config['showMissing'] = $this->showMissing;
42 }
43 if ( $this->excludeDynamicNamespaces !== null ) {
44 $config['excludeDynamicNamespaces'] = $this->excludeDynamicNamespaces;
45 }
46
47 return parent::getConfig( $config );
48 }
49
50}
Abstract base class for widgets to select multiple users, titles, namespaces, etc.