diff options
Diffstat (limited to 'Translate/src/Utilities/LanguagesMultiselectWidget.php')
-rw-r--r-- | Translate/src/Utilities/LanguagesMultiselectWidget.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Translate/src/Utilities/LanguagesMultiselectWidget.php b/Translate/src/Utilities/LanguagesMultiselectWidget.php new file mode 100644 index 00000000..bd91a77e --- /dev/null +++ b/Translate/src/Utilities/LanguagesMultiselectWidget.php @@ -0,0 +1,33 @@ +<?php +declare( strict_types = 1 ); + +namespace MediaWiki\Extension\Translate\Utilities; + +use MediaWiki\Widget\TagMultiselectWidget; + +/** + * Widget to select multiple languages. + * + * @author Niklas Laxström + * @license GPL-2.0-or-later + * @since 2020.07 + */ +class LanguagesMultiselectWidget extends TagMultiselectWidget { + /** @var array */ + private $languages; + + public function __construct( array $config = [] ) { + parent::__construct( $config ); + $this->languages = $config['languages']; + } + + protected function getJavaScriptClassName() { + return 'LanguagesMultiselectWidget'; + } + + public function getConfig( &$config ) { + $config['languages'] = $this->languages; + + return parent::getConfig( $config ); + } +} |