45 $msgs = [
'deletionlog',
'undeleteviewlink',
'diff' ];
46 foreach ( $msgs as $msg ) {
47 $this->messages[$msg] = $this->
msg( $msg )->text();
55 $query = parent::getDefaultQuery();
64 ActorMigration::newMigration()->getWhere(
71 if ( !$user->isAllowed(
'deletedhistory' ) ) {
73 } elseif ( !$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
78 $commentQuery = CommentStore::getStore()->getJoin(
'ar_comment' );
79 $actorQuery = ActorMigration::newMigration()->getJoin(
'ar_user' );
82 'tables' => [
'archive' ] + $commentQuery[
'tables'] + $actorQuery[
'tables'],
84 'ar_rev_id',
'ar_namespace',
'ar_title',
'ar_timestamp',
85 'ar_minor_edit',
'ar_deleted'
86 ] + $commentQuery[
'fields'] + $actorQuery[
'fields'],
89 'join_conds' => $commentQuery[
'joins'] + $actorQuery[
'joins'],
103 $data = [ parent::reallyDoQuery( $offset, $limit, $descending ) ];
108 'DeletedContribsPager::reallyDoQuery',
109 [ &$data, $this, $offset, $limit, $descending ]
115 foreach ( $data as
$query ) {
116 foreach (
$query as $i => $row ) {
130 $result = array_slice( $result, 0, $limit );
133 $result = array_values( $result );
139 return 'ar_timestamp';
151 if ( isset( $this->mNavigationBar ) ) {
152 return $this->mNavigationBar;
156 'prev' => $this->msg(
'pager-newer-n' )->numParams( $this->mLimit )->escaped(),
157 'next' => $this->msg(
'pager-older-n' )->numParams( $this->mLimit )->escaped(),
158 'first' => $this->msg(
'histlast' )->escaped(),
159 'last' => $this->msg(
'histfirst' )->escaped()
162 $pagingLinks = $this->getPagingLinks( $linkTexts );
163 $limitLinks = $this->getLimitLinks();
164 $lang = $this->getLanguage();
165 $limits =
$lang->pipeList( $limitLinks );
167 $firstLast =
$lang->pipeList( [ $pagingLinks[
'first'], $pagingLinks[
'last'] ] );
168 $firstLast = $this->msg(
'parentheses' )->rawParams( $firstLast )->escaped();
169 $prevNext = $this->msg(
'viewprevnext' )
171 $pagingLinks[
'prev'],
172 $pagingLinks[
'next'],
175 $separator = $this->msg(
'word-separator' )->escaped();
176 $this->mNavigationBar = $firstLast . $separator . $prevNext;
178 return $this->mNavigationBar;
182 if ( $this->
namespace !==
'' ) {
183 return [
'ar_namespace' => (int)$this->
namespace ];
208 Wikimedia\suppressWarnings();
211 $validRevision = (bool)
$rev->getId();
212 }
catch ( Exception
$e ) {
213 $validRevision =
false;
215 Wikimedia\restoreWarnings();
217 if ( $validRevision ) {
219 $ret = $this->formatRevisionRow( $row );
223 Hooks::run(
'DeletedContributionsLineEnding', [ $this, &
$ret, $row, &$classes, &
$attribs ] );
225 [ Sanitizer::class,
'isReservedDataAttribute' ],
229 if ( $classes === [] &&
$attribs === [] &&
$ret ===
'' ) {
230 wfDebug(
"Dropping Special:DeletedContribution row that could not be formatted\n" );
231 $ret =
"<!-- Could not format Special:DeletedContribution row. -->\n";
253 $page = Title::makeTitle( $row->ar_namespace, $row->ar_title );
255 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
259 'id' => $row->ar_rev_id,
260 'comment' => CommentStore::getStore()->getComment(
'ar_comment', $row )->text,
261 'user' => $row->ar_user,
262 'user_text' => $row->ar_user_text,
263 'actor' => $row->ar_actor ??
null,
264 'timestamp' => $row->ar_timestamp,
265 'minor_edit' => $row->ar_minor_edit,
266 'deleted' => $row->ar_deleted,
269 $undelete = SpecialPage::getTitleFor(
'Undelete' );
271 $logs = SpecialPage::getTitleFor(
'Log' );
274 $this->messages[
'deletionlog'],
278 'page' => $page->getPrefixedText()
283 SpecialPage::getTitleFor(
'Undelete', $page->getPrefixedDBkey() ),
284 $this->messages[
'undeleteviewlink']
287 $user = $this->getUser();
289 if ( $user->isAllowed(
'deletedtext' ) ) {
292 $this->messages[
'diff'],
295 'target' => $page->getPrefixedText(),
296 'timestamp' =>
$rev->getTimestamp(),
301 $last = htmlspecialchars( $this->messages[
'diff'] );
305 $date = $this->getLanguage()->userTimeAndDate(
$rev->getTimestamp(), $user );
308 $link = htmlspecialchars( $date );
313 [
'class' =>
'mw-changeslist-date' ],
315 'target' => $page->getPrefixedText(),
316 'timestamp' =>
$rev->getTimestamp()
322 $link =
'<span class="history-deleted">' .
$link .
'</span>';
328 [
'class' =>
'mw-changeslist-title' ]
331 if (
$rev->isMinor() ) {
343 $tools = Html::rawElement(
345 [
'class' =>
'mw-deletedcontribs-tools' ],
346 $this->msg(
'parentheses' )->rawParams( $this->getLanguage()->pipeList(
347 [
$last, $dellog, $reviewlink ] ) )->escaped()
350 $separator =
'<span class="mw-changeslist-separator">. .</span>';
351 $ret =
"{$del}{$link} {$tools} {$separator} {$mflag} {$pagelink} {$comment}";
353 # Denote if username is redacted for this edit
355 $ret .=
" <strong>" . $this->msg(
'rev-deleted-user-contribs' )->escaped() .
"</strong>";
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static flag( $flag, IContextSource $context=null)
Make an "<abbr>" element for a given change flag.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
static revComment(Revision $rev, $local=false, $isPublic=false)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
static getRevDeleteLink(User $user, Revision $rev, Title $title)
Get a revision-deletion link, or disabled link, or nothing, depending on user permissions & the setti...
static newFromArchiveRow( $row, $overrides=[])
Make a fake revision object from an archive table row.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
usually copyright or history_copyright This message must be in HTML not wikitext & $link
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
returning false will NOT prevent logging $e
Interface for objects which can provide a MediaWiki context on request.
if(!isset( $args[0])) $lang