Debian Codegraph @

includes/widget/NamespacesMultiselectWidget.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Widget;
4
5 /**
6 * Widget to select multiple namespaces.
7 *
8 * @copyright 2017 MediaWiki Widgets Team and others; see AUTHORS.txt
9 * @license MIT
10 */
11 class NamespacesMultiselectWidget extends TagMultiselectWidget {
12
13 /** @var bool|null */
14 protected $allowEditTags = null;
15
16 /**
17 * @param array $config Configuration options
18 * - bool $config['allowEditTags'] Allow editing of the tags by clicking them
19 */
20 public function __construct( array $config = [] ) {
21 parent::__construct( $config );
22
23 if ( isset( $config['allowEditTags'] ) ) {
24 $this->allowEditTags = $config['allowEditTags'];
25 }
26
27 $this->addClasses( [ 'mw-widgets-namespacesMultiselectWidget' ] );
28 }
29
30 protected function getJavaScriptClassName() {
31 return 'mw.widgets.NamespacesMultiselectWidget';
32 }
33
34 public function getConfig( &$config ) {
35 if ( $this->allowEditTags !== null ) {
36 $config['allowEditTags'] = $this->allowEditTags;
37 }
38
39 return parent::getConfig( $config );
40 }
41
42 }