34 private $commentStore;
50 $this->commentStore = $commentStore;
51 $this->dbProvider = $dbProvider;
59 return 'log_timestamp';
67 return 'log_user_text';
75 return LogEventsList::userCan(
76 $this->row, LogPage::DELETED_RESTRICTED, $this->list->getAuthority()
85 return (
int)$this->row->log_deleted;
89 $dbw = $this->dbProvider->getPrimaryDatabase();
91 $dbw->newUpdateQueryBuilder()
93 ->set( [
'log_deleted' => $bits ] )
95 'log_id' => $this->row->log_id,
96 'log_deleted' => $this->getBits()
98 ->caller( __METHOD__ )->execute();
100 if ( !$dbw->affectedRows() ) {
105 $dbw->newUpdateQueryBuilder()
106 ->update(
'recentchanges' )
108 'rc_deleted' => $bits,
109 'rc_patrolled' => RecentChange::PRC_AUTOPATROLLED
112 'rc_logid' => $this->row->log_id,
113 'rc_timestamp' => $this->row->log_timestamp
115 ->caller( __METHOD__ )->execute();
121 $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
122 $this->row->log_timestamp, $this->list->getUser() ) );
123 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
124 $formatter = LogFormatter::newFromRow( $this->row );
125 $formatter->setContext( $this->list->getContext() );
126 $formatter->setAudience( LogFormatter::FOR_THIS_USER );
130 SpecialPage::getTitleFor(
'Log' ),
131 $this->list->msg(
'log' )->text(),
133 [
'page' => $title->getPrefixedText() ]
135 $loglink = $this->list->msg(
'parentheses' )->rawParams( $loglink )->escaped();
137 $action = $formatter->getActionText();
139 $comment = $this->list->getLanguage()->getDirMark() .
140 $formatter->getComment();
142 $content =
"$loglink $date $action $comment";
144 if ( $this->row->ts_tags ) {
148 $this->list->getContext()
150 $content .=
" $tagSummary";
151 $attribs[
'class'] = implode(
' ', $classes );
153 return Xml::tags(
'li', $attribs, $content );
157 $logEntry = DatabaseLogEntry::newFromRow( $this->row );
158 $user = $this->list->getAuthority();
160 'id' => $logEntry->getId(),
161 'type' => $logEntry->getType(),
162 'action' => $logEntry->getSubtype(),
163 'userhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_USER ),
164 'commenthidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_COMMENT ),
165 'actionhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_ACTION ),
168 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
169 $ret[
'params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi();
171 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
173 'userid' => $this->row->log_user ?? 0,
174 'user' => $this->row->log_user_text,
177 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
179 '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.