79 parent::__construct(
'DeletedContributions',
'deletedhistory' );
103 $opts->add(
'target',
'' );
104 $opts->add(
'namespace',
'' );
105 $opts->add(
'limit', 20 );
107 $opts->fetchValuesFromRequest( $this->
getRequest() );
108 $opts->validateIntBounds(
'limit', 0, $this->
getConfig()->
get(
'QueryPageDefaultLimit' ) );
110 if ( $par !==
null ) {
112 $par = $this->userNameUtils->getCanonical( $par, UserNameUtils::RIGOR_NONE );
113 $opts->setValue(
'target', (
string)$par );
116 $ns = $opts->getValue(
'namespace' );
117 if ( $ns !==
null && $ns !==
'' ) {
118 $opts->setValue(
'namespace', intval( $ns ) );
121 $this->mOpts = $opts;
123 $target = trim( $opts->getValue(
'target' ) );
124 if ( !strlen( $target ) ) {
136 $this->
getSkin()->setRelevantUser( $userObj );
138 $target = $userObj->getName();
141 $out->addSubtitle( $this->
getSubTitle( $userObj ) );
142 $out->setPageTitle( $this->
msg(
'deletedcontributions-title', $target ) );
149 $opts->getValue(
'namespace' ),
150 $this->getLinkRenderer(),
151 $this->getHookContainer(),
154 $this->revisionFactory
156 if ( !$pager->getNumRows() ) {
157 $out->addWikiMsg(
'nocontribs' );
162 # Show a message about replica DB lag, if applicable
163 $lag = $pager->getDatabase()->getSessionLagStatus()[
'lag'];
165 $out->showLagWarning( $lag );
169 '<p>' . $pager->getNavigationBar() .
'</p>' .
171 '<p>' . $pager->getNavigationBar() .
'</p>' );
173 # If there were contributions, and it was a valid user or IP, show
174 # the appropriate "footer" message - WHOIS tools, etc.
175 $message = IPUtils::isIPAddress( $target ) ?
176 'sp-contributions-footer-anon' :
177 'sp-contributions-footer';
179 if ( !$this->
msg( $message )->isDisabled() ) {
181 "<div class='mw-contributions-footer'>\n$1\n</div>",
182 [ $message, $target ]
194 if ( $userObj->isAnon() ) {
195 $user = htmlspecialchars( $userObj->getName() );
200 $nt = $userObj->getUserPage();
201 $talk = $nt->getTalkPage();
203 $tools = SpecialContributions::getUserLinks(
206 $this->permissionManager,
212 $this->msg(
'sp-deletedcontributions-contribs' )->text()
214 if ( isset( $tools[
'deletedcontribs'] ) ) {
217 $tools, [
'contribs' => $contributionsLink ],
'deletedcontribs' );
218 unset( $tools[
'deletedcontribs'] );
220 $tools[
'contribs'] = $contributionsLink;
226 $block = DatabaseBlock::newFromTarget( $userObj, $userObj );
227 if ( $block !==
null && $block->getType() != DatabaseBlock::TYPE_AUTO ) {
228 if ( $block->getType() == DatabaseBlock::TYPE_RANGE ) {
229 $nt = $this->namespaceInfo->getCanonicalName(
NS_USER )
230 .
':' . $block->getTargetName();
235 LogEventsList::showLogExtract(
242 'showIfEmpty' =>
false,
244 'sp-contributions-blocked-notice',
245 $userObj->getName() # Support GENDER in
'sp-contributions-blocked-notice'
247 'offset' =>
'' # don
't use $this->getRequest() parameter offset
253 return $this->msg( 'contribsub2
' )->rawParams( $user, $links )->params( $userObj->getName() );
259 private function getForm() {
260 $opts = $this->mOpts;
266 'label-message
' => 'sp-contributions-username
',
267 'default' => $opts->getValue( 'target
' ),
272 'type
' => 'namespaceselect
',
273 'name
' => 'namespace',
274 'label-message
' => 'namespace',
279 HTMLForm::factory( 'ooui
', $formDescriptor, $this->getContext() )
280 ->setWrapperLegendMsg( 'sp-contributions-search
' )
281 ->setSubmitTextMsg( 'sp-contributions-submit
' )
282 // prevent setting subpage and 'target
' parameter at the same time
283 ->setAction( $this->getPageTitle()->getLocalURL() )
286 ->displayForm( false );
297 public function prefixSearchSubpages( $search, $limit, $offset ) {
298 $search = $this->userNameUtils->getCanonical( $search );
300 // No prefix suggestion for invalid user
303 // Autocomplete subpage as user list - public to allow caching
304 return $this->userNamePrefixSearch
305 ->search( UserNamePrefixSearch::AUDIENCE_PUBLIC, $search, $limit, $offset );
308 protected function getGroupName() {
wfArrayInsertAfter(array $array, array $insert, $after)
Insert array into another array after the specified KEY
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Implements Special:DeletedContributions to display archived revisions.
UserNameUtils $userNameUtils
UserNamePrefixSearch $userNamePrefixSearch
ILoadBalancer $loadBalancer
NamespaceInfo $namespaceInfo
getSubTitle( $userObj)
Generates the subheading with links.
CommentStore $commentStore
execute( $par)
Special page "deleted user contributions".
RevisionFactory $revisionFactory
getForm()
Generates the namespace selector form with hidden attributes.
PermissionManager $permissionManager
__construct(PermissionManager $permissionManager, ILoadBalancer $loadBalancer, CommentStore $commentStore, RevisionFactory $revisionFactory, NamespaceInfo $namespaceInfo, UserNameUtils $userNameUtils, UserNamePrefixSearch $userNamePrefixSearch)
Parent class for all special pages.
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.
getSkin()
Shortcut to get the skin being used for this instance.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getContext()
Gets the context this SpecialPage is executed in.
LinkRenderer null $linkRenderer
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getRequest()
Get the WebRequest being used for this instance.
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
static newFromName( $name, $validate='valid')