37 private $commentStore;
56 $this->commentStore = $commentStore;
57 $this->dbProvider = $dbProvider;
58 $this->logFormatterFactory = $logFormatterFactory;
66 return 'log_timestamp';
74 return 'log_user_text';
82 return LogEventsList::userCan(
83 $this->row, LogPage::DELETED_RESTRICTED, $this->list->getAuthority()
92 return (
int)$this->row->log_deleted;
96 $dbw = $this->dbProvider->getPrimaryDatabase();
98 $dbw->newUpdateQueryBuilder()
100 ->set( [
'log_deleted' => $bits ] )
102 'log_id' => $this->row->log_id,
103 'log_deleted' => $this->getBits()
105 ->caller( __METHOD__ )->execute();
107 if ( !$dbw->affectedRows() ) {
112 $dbw->newUpdateQueryBuilder()
113 ->update(
'recentchanges' )
115 'rc_deleted' => $bits,
116 'rc_patrolled' => RecentChange::PRC_AUTOPATROLLED
119 'rc_logid' => $this->row->log_id,
120 'rc_timestamp' => $this->row->log_timestamp
122 ->caller( __METHOD__ )->execute();
128 $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
129 $this->row->log_timestamp, $this->list->getUser() ) );
130 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
131 $formatter = $this->logFormatterFactory->newFromRow( $this->row );
132 $formatter->setContext( $this->list->getContext() );
133 $formatter->setAudience( LogFormatter::FOR_THIS_USER );
137 SpecialPage::getTitleFor(
'Log' ),
138 $this->list->msg(
'log' )->text(),
140 [
'page' => $title->getPrefixedText() ]
142 $loglink = $this->list->msg(
'parentheses' )->rawParams( $loglink )->escaped();
144 $action = $formatter->getActionText();
146 $dir = $this->list->getLanguage()->getDir();
147 $comment = Html::rawElement(
'bdi', [
'dir' => $dir ], $formatter->getComment() );
149 $content =
"$loglink $date $action $comment";
151 if ( $this->row->ts_tags ) {
155 $this->list->getContext()
157 $content .=
" $tagSummary";
158 $attribs[
'class'] = implode(
' ', $classes );
160 return Xml::tags(
'li', $attribs, $content );
164 $logEntry = DatabaseLogEntry::newFromRow( $this->row );
165 $user = $this->list->getAuthority();
167 'id' => $logEntry->getId(),
168 'type' => $logEntry->getType(),
169 'action' => $logEntry->getSubtype(),
170 'userhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_USER ),
171 'commenthidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_COMMENT ),
172 'actionhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_ACTION ),
175 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
176 $ret[
'params'] = $this->logFormatterFactory->newFromEntry( $logEntry )->formatParametersForApi();
178 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
180 'userid' => $this->row->log_user ?? 0,
181 'user' => $this->row->log_user_text,
184 if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
186 'comment' => $this->commentStore->getComment(
'log_comment', $this->row )->text,
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.