Go to the documentation of this file.
36 parent::__construct(
'DeletedContributions',
'deletedhistory' );
52 $out->setPageTitle( $this->
msg(
'deletedcontributions-title' ) );
56 $opts->add(
'target',
'' );
57 $opts->add(
'namespace',
'' );
58 $opts->add(
'limit', 20 );
60 $opts->fetchValuesFromRequest( $this->
getRequest() );
61 $opts->validateIntBounds(
'limit', 0, $this->
getConfig()->
get(
'QueryPageDefaultLimit' ) );
63 if ( $par !==
null ) {
66 $opts->setValue(
'target', (
string)$par );
69 $ns = $opts->getValue(
'namespace' );
70 if ( $ns !==
null && $ns !==
'' ) {
71 $opts->setValue(
'namespace', intval( $ns ) );
76 $target = trim( $opts->getValue(
'target' ) );
77 if ( !strlen( $target ) ) {
89 $this->
getSkin()->setRelevantUser( $userObj );
91 $target = $userObj->getName();
92 $out->addSubtitle( $this->
getSubTitle( $userObj ) );
98 if ( !$pager->getNumRows() ) {
99 $out->addWikiMsg(
'nocontribs' );
104 # Show a message about replica DB lag, if applicable
105 $lag = $pager->
getDatabase()->getSessionLagStatus()[
'lag'];
107 $out->showLagWarning( $lag );
111 '<p>' . $pager->getNavigationBar() .
'</p>' .
113 '<p>' . $pager->getNavigationBar() .
'</p>' );
115 # If there were contributions, and it was a valid user or IP, show
116 # the appropriate "footer" message - WHOIS tools, etc.
118 'sp-contributions-footer-anon' :
119 'sp-contributions-footer';
121 if ( !$this->
msg( $message )->isDisabled() ) {
123 "<div class='mw-contributions-footer'>\n$1\n</div>",
124 [ $message, $target ]
136 if ( $userObj->isAnon() ) {
137 $user = htmlspecialchars( $userObj->getName() );
139 $user =
$linkRenderer->makeLink( $userObj->getUserPage(), $userObj->getName() );
142 $nt = $userObj->getUserPage();
143 $talk = $nt->getTalkPage();
149 $this->
msg(
'sp-deletedcontributions-contribs' )->text()
151 if ( isset( $tools[
'deletedcontribs'] ) ) {
154 $tools, [
'contribs' => $contributionsLink ],
'deletedcontribs' );
155 unset( $tools[
'deletedcontribs'] );
157 $tools[
'contribs'] = $contributionsLink;
163 $block = DatabaseBlock::newFromTarget( $userObj, $userObj );
164 if ( !is_null( $block ) && $block->getType() != DatabaseBlock::TYPE_AUTO ) {
165 if ( $block->getType() == DatabaseBlock::TYPE_RANGE ) {
166 $nt = MediaWikiServices::getInstance()->getNamespaceInfo()->
167 getCanonicalName(
NS_USER ) .
':' . $block->getTarget();
179 'showIfEmpty' =>
false,
181 'sp-contributions-blocked-notice',
182 $userObj->getName() # Support GENDER in
'sp-contributions-blocked-notice'
184 'offset' =>
'' # don
't use $this->getRequest() parameter offset
190 return $this->msg( 'contribsub2
' )->rawParams( $user, $links )->params( $userObj->getName() );
197 $opts = $this->mOpts;
203 'label-message
' => 'sp-contributions-username
',
204 'default' => $opts->getValue( 'target
' ),
209 'type
' => 'namespaceselect
',
210 'name
' => 'namespace',
211 'label-message
' => 'namespace',
216 HTMLForm::factory( 'ooui
', $formDescriptor, $this->getContext() )
217 ->setWrapperLegendMsg( 'sp-contributions-search
' )
218 ->setSubmitTextMsg( 'sp-contributions-submit
' )
219 // prevent setting subpage and 'target
' parameter at the same time
220 ->setAction( $this->getPageTitle()->getLocalURL() )
223 ->displayForm( false );
234 public function prefixSearchSubpages( $search, $limit, $offset ) {
235 $user = User::newFromName( $search );
237 // No prefix suggestion for invalid user
240 // Autocomplete subpage as user list - public to allow caching
241 return UserNamePrefixSearch::search( 'public', $search, $limit, $offset );
244 protected function getGroupName() {
wfArrayInsertAfter(array $array, array $insert, $after)
Insert array into another array after the specified KEY
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
static getUserLinks(SpecialPage $sp, User $target)
Links to different places.
getOutput()
Get the OutputPage being used for this instance.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
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,...
getSkin()
Shortcut to get the skin 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.
getConfig()
Shortcut to get main config object.
getSubTitle( $userObj)
Generates the subheading with links.
execute( $par)
Special page "deleted user contributions".
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
getContext()
Gets the context this SpecialPage is executed in.
Implements Special:DeletedContributions to display archived revisions.
Parent class for all special pages.
getRequest()
Get the WebRequest being used for this instance.
static getCanonicalName( $name, $validate='valid')
Given unvalidated user input, return a canonical username, or false if the username is invalid.
getForm()
Generates the namespace selector form with hidden attributes.
MediaWiki Linker LinkRenderer null $linkRenderer
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
static isIPAddress( $ip)
Determine if a string is as valid IP address or network (CIDR prefix).