32 private $commentStore;
45 $this->commentStore = $commentStore;
53 return 'log_timestamp';
61 return 'log_user_text';
69 return LogEventsList::userCan(
70 $this->row, LogPage::DELETED_RESTRICTED, $this->list->getAuthority()
79 return (
int)$this->row->log_deleted;
85 $dbw->newUpdateQueryBuilder()
87 ->set( [
'log_deleted' => $bits ] )
89 'log_id' => $this->row->log_id,
90 'log_deleted' => $this->getBits()
92 ->caller( __METHOD__ )->execute();
94 if ( !$dbw->affectedRows() ) {
99 $dbw->newUpdateQueryBuilder()
100 ->update(
'recentchanges' )
102 'rc_deleted' => $bits,
103 'rc_patrolled' => RecentChange::PRC_AUTOPATROLLED
106 'rc_logid' => $this->row->log_id,
107 'rc_timestamp' => $this->row->log_timestamp
109 ->caller( __METHOD__ )->execute();
115 $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
116 $this->row->log_timestamp, $this->list->getUser() ) );
117 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
118 $formatter = LogFormatter::newFromRow( $this->row );
119 $formatter->setContext( $this->list->getContext() );
120 $formatter->setAudience( LogFormatter::FOR_THIS_USER );
124 SpecialPage::getTitleFor(
'Log' ),
125 $this->list->msg(
'log' )->text(),
127 [
'page' => $title->getPrefixedText() ]
129 $loglink = $this->list->msg(
'parentheses' )->rawParams( $loglink )->escaped();
131 $action = $formatter->getActionText();
133 $comment = $this->list->getLanguage()->getDirMark() .
134 $formatter->getComment();
136 $content =
"$loglink $date $action $comment";
138 if ( $this->row->ts_tags ) {
142 $this->list->getContext()
145 $attribs[
'class'] = implode(
' ', $classes );
147 return Xml::tags(
'li', $attribs,
$content );
151 $logEntry = DatabaseLogEntry::newFromRow( $this->row );
152 $user = $this->list->getAuthority();
154 'id' => $logEntry->getId(),
155 'type' => $logEntry->getType(),
156 'action' => $logEntry->getSubtype(),
157 'userhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_USER ),
158 'commenthidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_COMMENT ),
159 'actionhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_ACTION ),
162 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
163 $ret[
'params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi();
165 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
167 'userid' => $this->row->log_user ?? 0,
168 'user' => $this->row->log_user_text,
171 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
173 'comment' => $this->commentStore->getComment(
'log_comment', $this->row )->text,
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
This class represents the result of the API operations.
Parent class for all special pages.
Abstract base class for deletable items.
Item class for a logging table row.
getAuthorActorField()
Get the DB field name storing actor ids.
__construct(RevisionListBase $list, $row, CommentStore $commentStore)
getIdField()
Get the DB field name associated with the ID list.
getBits()
Get the current deletion bitfield value.
getAuthorNameField()
Get the DB field name storing user names.
setBits( $bits)
Set the visibility of the item.
canViewContent()
Returns true if the current user can view the item text/file.
getHTML()
Get the HTML of the list item.
canView()
Returns true if the current user can view the item.
getAuthorIdField()
Get the DB field name storing user ids.
getApiData(ApiResult $result)
Get the return information about the revision for the API.
getTimestampField()
Get the DB field name storing timestamps.
stdClass $row
The database result row.
RevisionListBase $list
The parent.
getLinkRenderer()
Returns an instance of LinkRenderer.
List for revision table items for a single page.