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 }
SpecialPage\msg
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:800
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:716
SpecialListUsers\execute
execute( $par)
Definition: SpecialListUsers.php:40
SpecialListUsers
Definition: SpecialListUsers.php:31
$s
$s
Definition: mergeMessageFileList.php:185
IncludableSpecialPage
Shortcut to construct an includable special page.
Definition: IncludableSpecialPage.php:29
SpecialListUsers\__construct
__construct()
Definition: SpecialListUsers.php:33
UsersPager
This class is used to get a list of user.
Definition: UsersPager.php:35
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:551
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:689
User\getAllGroups
static getAllGroups()
Return the set of defined explicit groups.
Definition: User.php:4281
SpecialListUsers\getSubpagesForPrefixSearch
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept.
Definition: SpecialListUsers.php:72
SpecialListUsers\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialListUsers.php:76
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:209
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:636
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:243