MediaWiki REL1_39
SpecialListUsers.php
Go to the documentation of this file.
1<?php
31
36
38 private $linkBatchFactory;
39
41 private $loadBalancer;
42
44 private $userGroupManager;
45
51 public function __construct(
52 LinkBatchFactory $linkBatchFactory,
53 ILoadBalancer $loadBalancer,
54 UserGroupManager $userGroupManager
55 ) {
56 parent::__construct( 'Listusers' );
57 $this->linkBatchFactory = $linkBatchFactory;
58 $this->loadBalancer = $loadBalancer;
59 $this->userGroupManager = $userGroupManager;
60 }
61
65 public function execute( $par ) {
66 $this->setHeaders();
67 $this->outputHeader();
68
69 $up = new UsersPager(
70 $this->getContext(),
71 $this->getHookContainer(),
72 $this->linkBatchFactory,
73 $this->loadBalancer,
74 $this->userGroupManager,
75 $par,
76 $this->including()
77 );
78
79 # getBody() first to check, if empty
80 $usersbody = $up->getBody();
81
82 $s = '';
83 if ( !$this->including() ) {
84 $s = $up->getPageHeader();
85 }
86
87 if ( $usersbody ) {
88 $s .= $up->getNavigationBar();
89 $s .= Html::rawElement( 'ul', [], $usersbody );
90 $s .= $up->getNavigationBar();
91 } else {
92 $s .= $this->msg( 'listusers-noresult' )->parseAsBlock();
93 }
94
95 $out = $this->getOutput();
96 $out->addHTML( $s );
97 $out->addModuleStyles( 'mediawiki.interface.helpers.styles' );
98 }
99
105 public function getSubpagesForPrefixSearch() {
106 return $this->userGroupManager->listAllGroups();
107 }
108
109 protected function getGroupName() {
110 return 'users';
111 }
112}
Shortcut to construct an includable special page.
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer, UserGroupManager $userGroupManager)
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.
Create and track the database connections and transactions for a given database cluster.
foreach( $mmfl['setupFiles'] as $fileName) if($queue) if(empty( $mmfl['quiet'])) $s