Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / widget / UserInputWidget.php
blob874f05f668693e197d9cfa70a7803ea01616d46d
1 <?php
3 namespace MediaWiki\Widget;
5 use OOUI\TextInputWidget;
7 /**
8 * User input widget.
10 * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
11 * @license MIT
13 class UserInputWidget extends TextInputWidget {
14 /** @var bool */
15 protected $excludeNamed;
17 /** @var bool */
18 protected $excludeTemp;
20 /**
21 * @param array $config Configuration options
23 public function __construct( array $config = [] ) {
24 parent::__construct( $config );
26 if ( isset( $config['excludenamed'] ) ) {
27 $this->excludeNamed = $config['excludenamed'];
30 if ( isset( $config['excludetemp'] ) ) {
31 $this->excludeTemp = $config['excludetemp'];
34 // Initialization
35 $this->addClasses( [ 'mw-widget-userInputWidget' ] );
38 protected function getJavaScriptClassName() {
39 return 'mw.widgets.UserInputWidget';
42 public function getConfig( &$config ) {
43 $config['$overlay'] = true;
45 if ( $this->excludeNamed !== null ) {
46 $config['excludenamed'] = $this->excludeNamed;
49 if ( $this->excludeTemp !== null ) {
50 $config['excludetemp'] = $this->excludeTemp;
53 return parent::getConfig( $config );