| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Widget; |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class NamespacesMultiselectWidget extends TagMultiselectWidget { |
| 12 |
|
| 13 |
|
| 14 |
protected $allowEditTags = null; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 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 |
} |