33 private $commentStore;
49 $this->commentStore = $commentStore;
50 $this->dbProvider = $dbProvider;
58 return 'log_timestamp';
66 return 'log_user_text';
74 return LogEventsList::userCan(
75 $this->row, LogPage::DELETED_RESTRICTED, $this->list->getAuthority()
84 return (
int)$this->row->log_deleted;
88 $dbw = $this->dbProvider->getPrimaryDatabase();
90 $dbw->newUpdateQueryBuilder()
92 ->set( [
'log_deleted' => $bits ] )
94 'log_id' => $this->row->log_id,
95 'log_deleted' => $this->getBits()
97 ->caller( __METHOD__ )->execute();
99 if ( !$dbw->affectedRows() ) {
104 $dbw->newUpdateQueryBuilder()
105 ->update(
'recentchanges' )
107 'rc_deleted' => $bits,
108 'rc_patrolled' => RecentChange::PRC_AUTOPATROLLED
111 'rc_logid' => $this->row->log_id,
112 'rc_timestamp' => $this->row->log_timestamp
114 ->caller( __METHOD__ )->execute();
120 $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
121 $this->row->log_timestamp, $this->list->getUser() ) );
122 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
123 $formatter = LogFormatter::newFromRow( $this->row );
124 $formatter->setContext( $this->list->getContext() );
125 $formatter->setAudience( LogFormatter::FOR_THIS_USER );
129 SpecialPage::getTitleFor(
'Log' ),
130 $this->list->msg(
'log' )->text(),
132 [
'page' => $title->getPrefixedText() ]
134 $loglink = $this->list->msg(
'parentheses' )->rawParams( $loglink )->escaped();
136 $action = $formatter->getActionText();
138 $comment = $this->list->getLanguage()->getDirMark() .
139 $formatter->getComment();
141 $content =
"$loglink $date $action $comment";
143 if ( $this->row->ts_tags ) {
147 $this->list->getContext()
149 $content .=
" $tagSummary";
150 $attribs[
'class'] = implode(
' ', $classes );
152 return Xml::tags(
'li', $attribs, $content );
156 $logEntry = DatabaseLogEntry::newFromRow( $this->row );
157 $user = $this->list->getAuthority();
159 'id' => $logEntry->getId(),
160 'type' => $logEntry->getType(),
161 'action' => $logEntry->getSubtype(),
162 'userhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_USER ),
163 'commenthidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_COMMENT ),
164 'actionhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_ACTION ),
167 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
168 $ret[
'params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi();
170 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
172 'userid' => $this->row->log_user ?? 0,
173 'user' => $this->row->log_user_text,
176 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
178 '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)
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.