MediaWiki  master
UsersMultiselectWidget.php
Go to the documentation of this file.
1 <?php
2 
3 namespace MediaWiki\Widget;
4 
13  protected $ipAllowed;
14 
16  protected $ipRangeAllowed;
17 
19  protected $ipRangeLimits;
20 
27  public function __construct( array $config = [] ) {
28  parent::__construct( $config );
29 
30  if ( isset( $config['ipAllowed'] ) ) {
31  $this->ipAllowed = $config['ipAllowed'];
32  }
33 
34  if ( isset( $config['ipRangeAllowed'] ) ) {
35  $this->ipRangeAllowed = $config['ipRangeAllowed'];
36  }
37 
38  if ( isset( $config['ipRangeLimits'] ) ) {
39  $this->ipRangeLimits = $config['ipRangeLimits'];
40  }
41  }
42 
43  protected function getJavaScriptClassName() {
44  return 'mw.widgets.UsersMultiselectWidget';
45  }
46 
47  public function getConfig( &$config ) {
48  if ( $this->ipAllowed !== null ) {
49  $config['ipAllowed'] = $this->ipAllowed;
50  }
51 
52  if ( $this->ipRangeAllowed !== null ) {
53  $config['ipRangeAllowed'] = $this->ipRangeAllowed;
54  }
55 
56  if ( $this->ipRangeLimits !== null ) {
57  $config['ipRangeLimits'] = $this->ipRangeLimits;
58  }
59 
60  return parent::getConfig( $config );
61  }
62 
63 }
MediaWiki\Widget\UsersMultiselectWidget\$ipRangeLimits
array $ipRangeLimits
Definition: UsersMultiselectWidget.php:19
MediaWiki\Widget\TagMultiselectWidget
Abstract base class for widgets to select multiple users, titles, namespaces, etc.
Definition: TagMultiselectWidget.php:14
MediaWiki\Widget\UsersMultiselectWidget\getConfig
getConfig(&$config)
Definition: UsersMultiselectWidget.php:47
MediaWiki\Widget\UsersMultiselectWidget
Widget to select multiple users.
Definition: UsersMultiselectWidget.php:11
MediaWiki\Widget
Definition: CheckMatrixWidget.php:3
MediaWiki\Widget\UsersMultiselectWidget\getJavaScriptClassName
getJavaScriptClassName()
Definition: UsersMultiselectWidget.php:43
MediaWiki\Widget\UsersMultiselectWidget\$ipAllowed
bool $ipAllowed
Definition: UsersMultiselectWidget.php:13
MediaWiki\$config
Config $config
Definition: MediaWiki.php:42
MediaWiki\Widget\UsersMultiselectWidget\__construct
__construct(array $config=[])
Definition: UsersMultiselectWidget.php:27
MediaWiki\Widget\UsersMultiselectWidget\$ipRangeAllowed
bool $ipRangeAllowed
Definition: UsersMultiselectWidget.php:16