35 private $commentStore;
51 $this->commentStore = $commentStore;
52 $this->dbProvider = $dbProvider;
60 return 'log_timestamp';
68 return 'log_user_text';
76 return LogEventsList::userCan(
77 $this->row, LogPage::DELETED_RESTRICTED, $this->list->getAuthority()
86 return (
int)$this->row->log_deleted;
90 $dbw = $this->dbProvider->getPrimaryDatabase();
92 $dbw->newUpdateQueryBuilder()
94 ->set( [
'log_deleted' => $bits ] )
96 'log_id' => $this->row->log_id,
97 'log_deleted' => $this->getBits()
99 ->caller( __METHOD__ )->execute();
101 if ( !$dbw->affectedRows() ) {
106 $dbw->newUpdateQueryBuilder()
107 ->update(
'recentchanges' )
109 'rc_deleted' => $bits,
110 'rc_patrolled' => RecentChange::PRC_AUTOPATROLLED
113 'rc_logid' => $this->row->log_id,
114 'rc_timestamp' => $this->row->log_timestamp
116 ->caller( __METHOD__ )->execute();
122 $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
123 $this->row->log_timestamp, $this->list->getUser() ) );
124 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
125 $formatter = LogFormatter::newFromRow( $this->row );
126 $formatter->setContext( $this->list->getContext() );
127 $formatter->setAudience( LogFormatter::FOR_THIS_USER );
131 SpecialPage::getTitleFor(
'Log' ),
132 $this->list->msg(
'log' )->text(),
134 [
'page' => $title->getPrefixedText() ]
136 $loglink = $this->list->msg(
'parentheses' )->rawParams( $loglink )->escaped();
138 $action = $formatter->getActionText();
140 $comment = $this->list->getLanguage()->getDirMark() .
141 $formatter->getComment();
143 $content =
"$loglink $date $action $comment";
145 if ( $this->row->ts_tags ) {
149 $this->list->getContext()
151 $content .=
" $tagSummary";
152 $attribs[
'class'] = implode(
' ', $classes );
154 return Xml::tags(
'li', $attribs, $content );
158 $logEntry = DatabaseLogEntry::newFromRow( $this->row );
159 $user = $this->list->getAuthority();
161 'id' => $logEntry->getId(),
162 'type' => $logEntry->getType(),
163 'action' => $logEntry->getSubtype(),
164 'userhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_USER ),
165 'commenthidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_COMMENT ),
166 'actionhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_ACTION ),
169 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
170 $ret[
'params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi();
172 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
174 'userid' => $this->row->log_user ?? 0,
175 'user' => $this->row->log_user_text,
178 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
180 'comment' => $this->commentStore->getComment(
'log_comment', $this->row )->text,
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.
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.
__construct(RevisionListBase $list, $row, CommentStore $commentStore, IConnectionProvider $dbProvider)