MediaWiki  1.28.0
SpecialListusers.php
Go to the documentation of this file.
1 <?php
35  public function __construct() {
36  parent::__construct( 'Listusers' );
37  }
38 
44  public function execute( $par ) {
45  $this->setHeaders();
46  $this->outputHeader();
47 
48  $up = new UsersPager( $this->getContext(), $par, $this->including() );
49 
50  # getBody() first to check, if empty
51  $usersbody = $up->getBody();
52 
53  $s = '';
54  if ( !$this->including() ) {
55  $s = $up->getPageHeader();
56  }
57 
58  if ( $usersbody ) {
59  $s .= $up->getNavigationBar();
60  $s .= Html::rawElement( 'ul', [], $usersbody );
61  $s .= $up->getNavigationBar();
62  } else {
63  $s .= $this->msg( 'listusers-noresult' )->parseAsBlock();
64  }
65 
66  $this->getOutput()->addHTML( $s );
67  }
68 
74  public function getSubpagesForPrefixSearch() {
75  return User::getAllGroups();
76  }
77 
78  protected function getGroupName() {
79  return 'users';
80  }
81 }
82 
89  function __construct() {
90  parent::__construct( 'Listadmins', 'Listusers', 'sysop' );
91  }
92 }
93 
100  function __construct() {
101  parent::__construct( 'Listbots', 'Listusers', 'bot' );
102  }
103 }
__construct()
Constructor.
This class is used to get a list of user.
Definition: UsersPager.php:33
getContext()
Gets the context this SpecialPage is executed in.
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:209
msg()
Wrapper around wfMessage that sets the current context.
including($x=null)
Whether the special page is being evaluated via transclusion.
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:4717
outputHeader($summaryMessageKey= '')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
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.
Redirect page: Special:ListBots –> Special:ListUsers/bot.