43 private $commentStore;
62 $this->commentStore = $commentStore;
63 $this->dbProvider = $dbProvider;
64 $this->logFormatterFactory = $logFormatterFactory;
72 return 'log_timestamp';
80 return 'log_user_text';
88 return LogEventsList::userCan(
89 $this->row, LogPage::DELETED_RESTRICTED, $this->list->getAuthority()
98 return (
int)$this->row->log_deleted;
102 $dbw = $this->dbProvider->getPrimaryDatabase();
104 $dbw->newUpdateQueryBuilder()
105 ->update(
'logging' )
106 ->set( [
'log_deleted' => $bits ] )
108 'log_id' => $this->row->log_id,
109 'log_deleted' => $this->getBits()
111 ->caller( __METHOD__ )->execute();
113 if ( !$dbw->affectedRows() ) {
118 $dbw->newUpdateQueryBuilder()
119 ->update(
'recentchanges' )
121 'rc_deleted' => $bits,
122 'rc_patrolled' => RecentChange::PRC_AUTOPATROLLED
125 'rc_logid' => $this->row->log_id,
126 'rc_timestamp' => $this->row->log_timestamp
128 ->caller( __METHOD__ )->execute();
134 $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
135 $this->row->log_timestamp, $this->list->getUser() ) );
136 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
137 $formatter = $this->logFormatterFactory->newFromRow( $this->row );
138 $formatter->setContext( $this->list->getContext() );
139 $formatter->setAudience( LogFormatter::FOR_THIS_USER );
143 SpecialPage::getTitleFor(
'Log' ),
144 $this->list->msg(
'log' )->text(),
146 [
'page' => $title->getPrefixedText() ]
148 $loglink = $this->list->msg(
'parentheses' )->rawParams( $loglink )->escaped();
150 $action = $formatter->getActionText();
152 $dir = $this->list->getLanguage()->getDir();
153 $comment = Html::rawElement(
'bdi', [
'dir' => $dir ], $formatter->getComment() );
155 $content =
"$loglink $date $action $comment";
157 if ( $this->row->ts_tags ) {
158 [ $tagSummary, $classes ] = ChangeTags::formatSummaryRow(
161 $this->list->getContext()
163 $content .=
" $tagSummary";
164 $attribs[
'class'] = $classes;
166 return Html::rawElement(
'li', $attribs, $content );
170 $logEntry = DatabaseLogEntry::newFromRow( $this->row );
171 $user = $this->list->getAuthority();
173 'id' => $logEntry->getId(),
174 'type' => $logEntry->getType(),
175 'action' => $logEntry->getSubtype(),
176 'userhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_USER ),
177 'commenthidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_COMMENT ),
178 'actionhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_ACTION ),
181 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
182 $ret[
'params'] = $this->logFormatterFactory->newFromEntry( $logEntry )->formatParametersForApi();
184 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
186 'userid' => $this->row->log_user ?? 0,
187 'user' => $this->row->log_user_text,
190 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
192 'comment' => $this->commentStore->getComment(
'log_comment', $this->row )->text,
A value class to process existing log entries.
Class to simplify the use of log pages.
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.
__construct(RevisionListBase $list, $row, CommentStore $commentStore, IConnectionProvider $dbProvider, LogFormatterFactory $logFormatterFactory)
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.