summaryrefslogtreecommitdiff
blob: ea9c8a3828fd85b2fab28259e14e7c770d08945a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?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 );
	}
}

class_alias( LanguagesMultiselectWidget::class, '\MediaWiki\Extensions\Translate\LanguagesMultiselectWidget' );