35 $this->revision = static::initRevision(
$list,
$row );
54 return 'rev_timestamp';
62 return 'rev_user_text';
70 return $this->revision->userCan(
71 RevisionRecord::DELETED_RESTRICTED, $this->list->getUser()
76 return $this->revision->userCan(
77 RevisionRecord::DELETED_TEXT, $this->list->getUser()
82 return $this->revision->getVisibility();
88 $dbw->update(
'revision',
89 [
'rev_deleted' => $bits ],
91 'rev_id' => $this->revision->getId(),
92 'rev_page' => $this->revision->getPage(),
93 'rev_deleted' => $this->getBits()
97 if ( !$dbw->affectedRows() ) {
102 $dbw->update(
'recentchanges',
104 'rc_deleted' => $bits,
105 'rc_patrolled' => RecentChange::PRC_AUTOPATROLLED
108 'rc_this_oldid' => $this->revision->getId(),
110 'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ),
119 return $this->revision->isDeleted( RevisionRecord::DELETED_TEXT );
123 return ( $newBits & RevisionRecord::DELETED_TEXT )
124 && $this->list->getCurrent() == $this->
getId();
133 $date = $this->list->getLanguage()->userTimeAndDate(
134 $this->revision->getTimestamp(), $this->list->getUser() );
137 return htmlspecialchars( $date );
145 'oldid' => $this->revision->getId(),
158 return $this->list->msg(
'diff' )->escaped();
162 $this->list->msg(
'diff' )->text(),
165 'diff' => $this->revision->getId(),
178 $difflink = $this->list->msg(
'parentheses' )
184 $revlink =
"<span class=\"history-deleted\">$revlink</span>";
186 $content =
"$difflink $revlink $userlink $comment";
193 $this->list->getContext()
196 $attribs[
'class'] = implode(
' ', $classes );
198 return Xml::tags(
'li', $attribs,
$content );
205 return $this->row->ts_tags;
210 $user = $this->list->
getUser();
212 'id' => $rev->getId(),
213 'timestamp' =>
wfTimestamp( TS_ISO_8601, $rev->getTimestamp() ),
214 'userhidden' => (bool)$rev->isDeleted( RevisionRecord::DELETED_USER ),
215 'commenthidden' => (bool)$rev->isDeleted( RevisionRecord::DELETED_COMMENT ),
216 'texthidden' => (bool)$rev->isDeleted( RevisionRecord::DELETED_TEXT ),
218 if ( $rev->userCan( RevisionRecord::DELETED_USER, $user ) ) {
220 'userid' => $rev->getUser( RevisionRecord::FOR_THIS_USER ),
221 'user' => $rev->getUserText( RevisionRecord::FOR_THIS_USER ),
224 if ( $rev->userCan( RevisionRecord::DELETED_COMMENT, $user ) ) {
226 'comment' => $rev->getComment( RevisionRecord::FOR_THIS_USER ),
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
This class represents the result of the API operations.
static revComment(Revision $rev, $local=false, $isPublic=false, $useParentheses=true)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
static revUserLink( $rev, $isPublic=false)
Generate a user link if the current user is allowed to view it.
Abstract base class for deletable items.
setBits( $bits)
Set the visibility of the item.
canViewContent()
Returns true if the current user can view the item text/file.
getTimestampField()
Get the DB field name storing timestamps.
canView()
Returns true if the current user can view the item.
getAuthorActorField()
Get the DB field name storing actor ids.
getBits()
Get the current deletion bitfield value.
getAuthorNameField()
Get the DB field name storing user names.
getApiData(ApiResult $result)
Get the return information about the revision for the API.
getAuthorIdField()
Get the DB field name storing user ids.
getRevisionLink()
Get the HTML link to the revision text.
isHideCurrentOp( $newBits)
Returns true if the item is "current", and the operation to set the given bits can't be executed for ...
getIdField()
Get the DB field name associated with the ID list.
getDiffLink()
Get the HTML link to the diff.
static initRevision( $list, $row)
Create revision object from $row sourced from $list.
__construct( $list, $row)
$row
The database result row.
RevisionListBase $list
The parent.
getId()
Get the ID, as it would appear in the ids URL parameter.
getLinkRenderer()
Returns an instance of LinkRenderer.
getUser( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision's user id if it's available to the specified audience.