MediaWiki  master
SpecialListUsers.php
Go to the documentation of this file.
1 <?php
32 
33  public function __construct() {
34  parent::__construct( 'Listusers' );
35  }
36 
40  public function execute( $par ) {
41  $this->setHeaders();
42  $this->outputHeader();
43 
44  $up = new UsersPager( $this->getContext(), $par, $this->including() );
45 
46  # getBody() first to check, if empty
47  $usersbody = $up->getBody();
48 
49  $s = '';
50  if ( !$this->including() ) {
51  $s = $up->getPageHeader();
52  }
53 
54  if ( $usersbody ) {
55  $s .= $up->getNavigationBar();
56  $s .= Html::rawElement( 'ul', [], $usersbody );
57  $s .= $up->getNavigationBar();
58  } else {
59  $s .= $this->msg( 'listusers-noresult' )->parseAsBlock();
60  }
61 
62  $out = $this->getOutput();
63  $out->addHTML( $s );
64  $out->addModuleStyles( 'mediawiki.interface.helpers.styles' );
65  }
66 
72  public function getSubpagesForPrefixSearch() {
73  return User::getAllGroups();
74  }
75 
76  protected function getGroupName() {
77  return 'users';
78  }
79 }
This class is used to get a list of user.
Definition: UsersPager.php:35
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:209
getOutput()
Get the OutputPage being used for this instance.
static getAllGroups()
Return the set of defined explicit groups.
Definition: User.php:4805
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Shortcut to construct an includable special page.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes! ...
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...