3 namespace MediaWiki\Widget
;
5 use OOUI\TextInputWidget
;
10 * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
13 class UserInputWidget
extends TextInputWidget
{
15 protected $excludeNamed;
18 protected $excludeTemp;
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'];
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 );