MediaWiki master
TitlesMultiselectWidget.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Widget;
4
12
14 protected $showMissing = null;
16 protected $excludeDynamicNamespaces = null;
18 protected $namespace = null;
20 protected $relative = null;
22 protected $allowEditTags = null;
23
33 public function __construct( array $config = [] ) {
34 parent::__construct( $config );
35
36 // Properties
37 if ( isset( $config['showMissing'] ) ) {
38 $this->showMissing = $config['showMissing'];
39 }
40 if ( isset( $config['excludeDynamicNamespaces'] ) ) {
41 $this->excludeDynamicNamespaces = $config['excludeDynamicNamespaces'];
42 }
43 if ( isset( $config['namespace'] ) ) {
44 $this->namespace = $config['namespace'];
45 }
46 if ( isset( $config['relative'] ) ) {
47 $this->relative = $config['relative'];
48 }
49 if ( isset( $config['allowEditTags'] ) ) {
50 $this->allowEditTags = $config['allowEditTags'];
51 }
52
53 $this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] );
54 }
55
56 protected function getJavaScriptClassName() {
57 return 'mw.widgets.TitlesMultiselectWidget';
58 }
59
60 public function getConfig( &$config ) {
61 if ( $this->showMissing !== null ) {
62 $config['showMissing'] = $this->showMissing;
63 }
64 if ( $this->excludeDynamicNamespaces !== null ) {
65 $config['excludeDynamicNamespaces'] = $this->excludeDynamicNamespaces;
66 }
67 if ( $this->namespace !== null ) {
68 $config['namespace'] = $this->namespace;
69 }
70 if ( $this->relative !== null ) {
71 $config['relative'] = $this->relative;
72 }
73 if ( $this->allowEditTags !== null ) {
74 $config['allowEditTags'] = $this->allowEditTags;
75 }
76
77 return parent::getConfig( $config );
78 }
79
80}
Base class for widgets to select multiple users, titles, namespaces, etc.