MediaWiki REL1_40
SpecialListUsers.php
Go to the documentation of this file.
1<?php
33
38
40 private $linkBatchFactory;
41
43 private $loadBalancer;
44
46 private $userGroupManager;
47
49 private $userIdentityLookup;
50
57 public function __construct(
58 LinkBatchFactory $linkBatchFactory,
59 ILoadBalancer $loadBalancer,
60 UserGroupManager $userGroupManager,
61 UserIdentityLookup $userIdentityLookup
62 ) {
63 parent::__construct( 'Listusers' );
64 $this->linkBatchFactory = $linkBatchFactory;
65 $this->loadBalancer = $loadBalancer;
66 $this->userGroupManager = $userGroupManager;
67 $this->userIdentityLookup = $userIdentityLookup;
68 }
69
73 public function execute( $par ) {
74 $this->setHeaders();
75 $this->outputHeader();
76
77 $up = new UsersPager(
78 $this->getContext(),
79 $this->getHookContainer(),
80 $this->linkBatchFactory,
81 $this->loadBalancer,
82 $this->userGroupManager,
83 $this->userIdentityLookup,
84 $par,
85 $this->including()
86 );
87
88 # getBody() first to check, if empty
89 $usersbody = $up->getBody();
90
91 $s = '';
92 if ( !$this->including() ) {
93 $s = $up->getPageHeader();
94 }
95
96 if ( $usersbody ) {
97 $s .= $up->getNavigationBar();
98 $s .= Html::rawElement( 'ul', [], $usersbody );
99 $s .= $up->getNavigationBar();
100 } else {
101 $s .= $this->msg( 'listusers-noresult' )->parseAsBlock();
102 }
103
104 $out = $this->getOutput();
105 $out->addHTML( $s );
106 $out->addModuleStyles( 'mediawiki.interface.helpers.styles' );
107 }
108
114 public function getSubpagesForPrefixSearch() {
115 return $this->userGroupManager->listAllGroups();
116 }
117
118 protected function getGroupName() {
119 return 'users';
120 }
121}
Shortcut to construct an includable special page.
This class is a collection of static functions that serve two purposes:
Definition Html.php:55
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer, UserGroupManager $userGroupManager, UserIdentityLookup $userIdentityLookup)
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
including( $x=null)
Whether the special page is being evaluated via transclusion.
This class is used to get a list of user.
This class is a delegate to ILBFactory for a given database cluster.