MediaWiki master
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 protected $allowEditTags = null;
16
24 public function __construct( array $config = [] ) {
25 parent::__construct( $config );
26
27 // Properties
28 if ( isset( $config['showMissing'] ) ) {
29 $this->showMissing = $config['showMissing'];
30 }
31 if ( isset( $config['excludeDynamicNamespaces'] ) ) {
32 $this->excludeDynamicNamespaces = $config['excludeDynamicNamespaces'];
33 }
34 if ( isset( $config['allowEditTags'] ) ) {
35 $this->allowEditTags = $config['allowEditTags'];
36 }
37
38 $this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] );
39 }
40
41 protected function getJavaScriptClassName() {
42 return 'mw.widgets.TitlesMultiselectWidget';
43 }
44
45 public function getConfig( &$config ) {
46 if ( $this->showMissing !== null ) {
47 $config['showMissing'] = $this->showMissing;
48 }
49 if ( $this->excludeDynamicNamespaces !== null ) {
50 $config['excludeDynamicNamespaces'] = $this->excludeDynamicNamespaces;
51 }
52 if ( $this->allowEditTags !== null ) {
53 $config['allowEditTags'] = $this->allowEditTags;
54 }
55
56 return parent::getConfig( $config );
57 }
58
59}
Base class for widgets to select multiple users, titles, namespaces, etc.