MediaWiki 1.43.1
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
59 protected function getJavaScriptClassName() {
60 return 'mw.widgets.UsersMultiselectWidget';
61 }
62
63 public function getConfig( &$config ) {
64 if ( $this->ipAllowed !== null ) {
65 $config['ipAllowed'] = $this->ipAllowed;
66 }
67
68 if ( $this->ipRangeAllowed !== null ) {
69 $config['ipRangeAllowed'] = $this->ipRangeAllowed;
70 }
71
72 if ( $this->ipRangeLimits !== null ) {
73 $config['ipRangeLimits'] = $this->ipRangeLimits;
74 }
75
76 if ( $this->excludeNamed !== null ) {
77 $config['excludeNamed'] = $this->excludeNamed;
78 }
79
80 if ( $this->excludeTemp !== null ) {
81 $config['excludeTemp'] = $this->excludeTemp;
82 }
83
84 return parent::getConfig( $config );
85 }
86
87}
Base class for widgets to select multiple users, titles, namespaces, etc.