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 }
Base class for widgets to select multiple users, titles, namespaces, etc.