| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Widget; |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class TitlesMultiselectWidget extends TagMultiselectWidget { |
| 12 |
|
| 13 |
|
| 14 |
protected $showMissing = null; |
| 15 |
|
| 16 |
protected $excludeDynamicNamespaces = null; |
| 17 |
|
| 18 |
protected $allowEditTags = null; |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public function __construct( array $config = [] ) { |
| 28 |
parent::__construct( $config ); |
| 29 |
|
| 30 |
|
| 31 |
if ( isset( $config['showMissing'] ) ) { |
| 32 |
$this->showMissing = $config['showMissing']; |
| 33 |
} |
| 34 |
if ( isset( $config['excludeDynamicNamespaces'] ) ) { |
| 35 |
$this->excludeDynamicNamespaces = $config['excludeDynamicNamespaces']; |
| 36 |
} |
| 37 |
if ( isset( $config['allowEditTags'] ) ) { |
| 38 |
$this->allowEditTags = $config['allowEditTags']; |
| 39 |
} |
| 40 |
|
| 41 |
$this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] ); |
| 42 |
} |
| 43 |
|
| 44 |
protected function getJavaScriptClassName() { |
| 45 |
return 'mw.widgets.TitlesMultiselectWidget'; |
| 46 |
} |
| 47 |
|
| 48 |
public function getConfig( &$config ) { |
| 49 |
if ( $this->showMissing !== null ) { |
| 50 |
$config['showMissing'] = $this->showMissing; |
| 51 |
} |
| 52 |
if ( $this->excludeDynamicNamespaces !== null ) { |
| 53 |
$config['excludeDynamicNamespaces'] = $this->excludeDynamicNamespaces; |
| 54 |
} |
| 55 |
if ( $this->allowEditTags !== null ) { |
| 56 |
$config['allowEditTags'] = $this->allowEditTags; |
| 57 |
} |
| 58 |
|
| 59 |
return parent::getConfig( $config ); |
| 60 |
} |
| 61 |
|
| 62 |
} |