MediaWiki  master
SpecialListusers.php
Go to the documentation of this file.
1 <?php
32 
33  public function __construct() {
34  parent::__construct( 'Listusers' );
35  }
36 
42  public function execute( $par ) {
43  $this->setHeaders();
44  $this->outputHeader();
45 
46  $up = new UsersPager( $this->getContext(), $par, $this->including() );
47 
48  # getBody() first to check, if empty
49  $usersbody = $up->getBody();
50 
51  $s = '';
52  if ( !$this->including() ) {
53  $s = $up->getPageHeader();
54  }
55 
56  if ( $usersbody ) {
57  $s .= $up->getNavigationBar();
58  $s .= Html::rawElement( 'ul', [], $usersbody );
59  $s .= $up->getNavigationBar();
60  } else {
61  $s .= $this->msg( 'listusers-noresult' )->parseAsBlock();
62  }
63 
64  $this->getOutput()->addHTML( $s );
65  }
66 
72  public function getSubpagesForPrefixSearch() {
73  return User::getAllGroups();
74  }
75 
76  protected function getGroupName() {
77  return 'users';
78  }
79 }
80 
87  function __construct() {
88  parent::__construct( 'Listadmins', 'Listusers', 'sysop' );
89  }
90 }
91 
98  function __construct() {
99  parent::__construct( 'Listbots', 'Listusers', 'bot' );
100  }
101 }
This class is used to get a list of user.
Definition: UsersPager.php:33
getContext()
Gets the context this SpecialPage is executed in.
including( $x=null)
Whether the special page is being evaluated via transclusion.
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept.
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:210
getOutput()
Get the OutputPage being used for this instance.
Redirect page: Special:ListAdmins –> Special:ListUsers/sysop.
static getAllGroups()
Return the set of defined explicit groups.
Definition: User.php:5131
Shortcut to construct an includable special page.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes! ...
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
execute( $par)
Show the special page.
msg( $key)
Wrapper around wfMessage that sets the current context.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Redirect page: Special:ListBots –> Special:ListUsers/bot.