summaryrefslogtreecommitdiff
blob: bd91a77e9ffb6132c3a31f6464e03e3bbd83faf5 (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
<?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 );
	}
}