MediaWiki master
UsersMultiselectWidget.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Widget;
4
13 protected $ipAllowed;
14
16 protected $ipRangeAllowed;
17
19 protected $ipRangeLimits;
20
22 protected $excludeNamed;
23
25 protected $excludeTemp;
26
35 public function __construct( array $config = [] ) {
36 parent::__construct( $config );
37
38 if ( isset( $config['ipAllowed'] ) ) {
39 $this->ipAllowed = $config['ipAllowed'];
40 }
41
42 if ( isset( $config['ipRangeAllowed'] ) ) {
43 $this->ipRangeAllowed = $config['ipRangeAllowed'];
44 }
45
46 if ( isset( $config['ipRangeLimits'] ) ) {
47 $this->ipRangeLimits = $config['ipRangeLimits'];
48 }
49
50 if ( isset( $config['excludeNamed'] ) ) {
51 $this->excludeNamed = $config['excludeNamed'];
52 }
53
54 if ( isset( $config['excludeTemp'] ) ) {
55 $this->excludeTemp = $config['excludeTemp'];
56 }
57 }
58
60 protected function getJavaScriptClassName() {
61 return 'mw.widgets.UsersMultiselectWidget';
62 }
63
65 public function getConfig( &$config ) {
66 if ( $this->ipAllowed !== null ) {
67 $config['ipAllowed'] = $this->ipAllowed;
68 }
69
70 if ( $this->ipRangeAllowed !== null ) {
71 $config['ipRangeAllowed'] = $this->ipRangeAllowed;
72 }
73
74 if ( $this->ipRangeLimits !== null ) {
75 $config['ipRangeLimits'] = $this->ipRangeLimits;
76 }
77
78 if ( $this->excludeNamed !== null ) {
79 $config['excludeNamed'] = $this->excludeNamed;
80 }
81
82 if ( $this->excludeTemp !== null ) {
83 $config['excludeTemp'] = $this->excludeTemp;
84 }
85
86 return parent::getConfig( $config );
87 }
88
89}
Base class for widgets to select multiple users, titles, namespaces, etc.