class RevDelArchiveItem extends RevDelRevisionItem {
public function __construct( $list, $row ) {
RevDelItem::__construct( $list, $row );
- $this->revision = Revision::newFromArchiveRow( $row, array( 'page' => $this->list->title->getArticleID() ) );
+ $this->revision = Revision::newFromArchiveRow( $row,
+ array( 'page' => $this->list->title->getArticleID() ) );
}
public function getIdField() {
public function setBits( $bits ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->update( 'archive', array( 'ar_deleted' => $bits ), array( 'ar_namespace' => $this->list->title->getNamespace(), 'ar_title' => $this->list->title->getDBkey(), // use timestamp for index
- 'ar_timestamp' => $this->row->ar_timestamp, 'ar_rev_id' => $this->row->ar_rev_id, 'ar_deleted' => $this->getBits() ), __METHOD__ );
+ $dbw->update( 'archive',
+ array( 'ar_deleted' => $bits ),
+ array(
+ 'ar_namespace' => $this->list->title->getNamespace(),
+ 'ar_title' => $this->list->title->getDBkey(),
+ // use timestamp for index
+ 'ar_timestamp' => $this->row->ar_timestamp,
+ 'ar_rev_id' => $this->row->ar_rev_id,
+ 'ar_deleted' => $this->getBits()
+ ),
+ __METHOD__ );
- return (bool) $dbw->affectedRows();
+ return (bool)$dbw->affectedRows();
}
protected function getRevisionLink() {
- $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate( $this->revision->getTimestamp(), $this->list->getUser() ) );
+ $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
+ $this->revision->getTimestamp(), $this->list->getUser() ) );
if ( $this->isDeleted() && !$this->canViewContent() ) {
return $date;
}
- return Linker::link( SpecialPage::getTitleFor( 'Undelete' ), $date, array(), array( 'target' => $this->list->title->getPrefixedText(), 'timestamp' => $this->revision->getTimestamp() ) );
+ return Linker::link(
+ SpecialPage::getTitleFor( 'Undelete' ),
+ $date,
+ array(),
+ array(
+ 'target' => $this->list->title->getPrefixedText(),
+ 'timestamp' => $this->revision->getTimestamp()
+ )
+ );
}
protected function getDiffLink() {
return $this->list->msg( 'diff' )->escaped();
}
- return Linker::link( SpecialPage::getTitleFor( 'Undelete' ), $this->list->msg( 'diff' )->escaped(), array(), array( 'target' => $this->list->title->getPrefixedText(), 'diff' => 'prev', 'timestamp' => $this->revision->getTimestamp() ) );
+ return Linker::link(
+ SpecialPage::getTitleFor( 'Undelete' ),
+ $this->list->msg( 'diff' )->escaped(),
+ array(),
+ array(
+ 'target' => $this->list->title->getPrefixedText(),
+ 'diff' => 'prev',
+ 'timestamp' => $this->revision->getTimestamp()
+ )
+ );
}
-}
\ No newline at end of file
+}
$timestamps[] = $db->timestamp( $id );
}
- return $db->select( 'archive', Revision::selectArchiveFields(), array( 'ar_namespace' => $this->title->getNamespace(), 'ar_title' => $this->title->getDBkey(), 'ar_timestamp' => $timestamps ), __METHOD__, array( 'ORDER BY' => 'ar_timestamp DESC' ) );
+ return $db->select( 'archive', Revision::selectArchiveFields(),
+ array(
+ 'ar_namespace' => $this->title->getNamespace(),
+ 'ar_title' => $this->title->getDBkey(),
+ 'ar_timestamp' => $timestamps
+ ),
+ __METHOD__,
+ array( 'ORDER BY' => 'ar_timestamp DESC' )
+ );
}
public function newItem( $row ) {
public function doPostCommitUpdates() {
return Status::newGood();
}
-}
\ No newline at end of file
+}
public function setBits( $bits ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->update( 'filearchive', array( 'fa_deleted' => $bits ), array( 'fa_id' => $this->row->fa_id, 'fa_deleted' => $this->getBits(), ), __METHOD__ );
+ $dbw->update( 'filearchive',
+ array( 'fa_deleted' => $bits ),
+ array(
+ 'fa_id' => $this->row->fa_id,
+ 'fa_deleted' => $this->getBits(),
+ ),
+ __METHOD__
+ );
- return (bool) $dbw->affectedRows();
+ return (bool)$dbw->affectedRows();
}
protected function getLink() {
- $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate( $this->file->getTimestamp(), $this->list->getUser() ) );
+ $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
+ $this->file->getTimestamp(), $this->list->getUser() ) );
# Hidden files...
if ( !$this->canViewContent() ) {
} else {
$undelete = SpecialPage::getTitleFor( 'Undelete' );
$key = $this->file->getKey();
- $link = Linker::link( $undelete, $date, array(), array( 'target' => $this->list->title->getPrefixedText(), 'file' => $key, 'token' => $this->list->getUser()->getEditToken( $key ) ) );
+ $link = Linker::link( $undelete, $date, array(),
+ array(
+ 'target' => $this->list->title->getPrefixedText(),
+ 'file' => $key,
+ 'token' => $this->list->getUser()->getEditToken( $key )
+ )
+ );
}
if ( $this->isDeleted() ) {
$link = '<span class="history-deleted">' . $link . '</span>';
public function getApiData( ApiResult $result ) {
$file = $this->file;
$user = $this->list->getUser();
- $ret = array( 'title' => $this->list->title->getPrefixedText(), 'timestamp' => wfTimestamp( TS_ISO_8601, $file->getTimestamp() ), 'width' => $file->getWidth(), 'height' => $file->getHeight(), 'size' => $file->getSize(), );
+ $ret = array(
+ 'title' => $this->list->title->getPrefixedText(),
+ 'timestamp' => wfTimestamp( TS_ISO_8601, $file->getTimestamp() ),
+ 'width' => $file->getWidth(),
+ 'height' => $file->getHeight(),
+ 'size' => $file->getSize(),
+ );
$ret += $file->isDeleted( Revision::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
$ret += $file->isDeleted( Revision::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
$ret += $this->isDeleted() ? array( 'contenthidden' => '' ) : array();
if ( $this->canViewContent() ) {
- $ret += array( 'url' => SpecialPage::getTitleFor( 'Revisiondelete' )->getLinkURL( array( 'target' => $this->list->title->getPrefixedText(), 'file' => $file->getKey(), 'token' => $user->getEditToken( $file->getKey() ) ), false, PROTO_RELATIVE ), );
+ $ret += array(
+ 'url' => SpecialPage::getTitleFor( 'Revisiondelete' )->getLinkURL(
+ array(
+ 'target' => $this->list->title->getPrefixedText(),
+ 'file' => $file->getKey(),
+ 'token' => $user->getEditToken( $file->getKey() )
+ ),
+ false, PROTO_RELATIVE
+ ),
+ );
}
if ( $file->userCan( Revision::DELETED_USER, $user ) ) {
- $ret += array( 'userid' => $file->getUser( 'id' ), 'user' => $file->getUser( 'text' ), );
+ $ret += array(
+ 'userid' => $file->getUser( 'id' ),
+ 'user' => $file->getUser( 'text' ),
+ );
}
if ( $file->userCan( Revision::DELETED_COMMENT, $user ) ) {
- $ret += array( 'comment' => $file->getRawDescription(), );
+ $ret += array(
+ 'comment' => $file->getRawDescription(),
+ );
}
return $ret;
}
-}
\ No newline at end of file
+}
public function doQuery( $db ) {
$ids = array_map( 'intval', $this->ids );
- return $db->select( 'filearchive', ArchivedFile::selectFields(), array( 'fa_name' => $this->title->getDBkey(), 'fa_id' => $ids ), __METHOD__, array( 'ORDER BY' => 'fa_id DESC' ) );
+ return $db->select(
+ 'filearchive',
+ ArchivedFile::selectFields(),
+ array(
+ 'fa_name' => $this->title->getDBkey(),
+ 'fa_id' => $ids
+ ),
+ __METHOD__,
+ array( 'ORDER BY' => 'fa_id DESC' )
+ );
}
public function newItem( $row ) {
return new RevDelArchivedFileItem( $this, $row );
}
-}
\ No newline at end of file
+}
public function __construct( $list, $row ) {
RevDelItem::__construct( $list, $row );
- $this->revision = Revision::newFromArchiveRow( $row, array( 'page' => $this->list->title->getArticleID() ) );
+ $this->revision = Revision::newFromArchiveRow( $row,
+ array( 'page' => $this->list->title->getArticleID() ) );
}
public function getIdField() {
public function setBits( $bits ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->update( 'archive', array( 'ar_deleted' => $bits ), array( 'ar_rev_id' => $this->row->ar_rev_id, 'ar_deleted' => $this->getBits() ), __METHOD__ );
+ $dbw->update( 'archive',
+ array( 'ar_deleted' => $bits ),
+ array( 'ar_rev_id' => $this->row->ar_rev_id,
+ 'ar_deleted' => $this->getBits()
+ ),
+ __METHOD__ );
- return (bool) $dbw->affectedRows();
+ return (bool)$dbw->affectedRows();
}
-}
\ No newline at end of file
+}
# Newly undeleted
$key = $this->file->getStorageKey();
$srcRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
- $this->list->storeBatch[] = array( $this->file->repo->getVirtualUrl( 'deleted' ) . '/' . $srcRel, 'public', $this->file->getRel() );
+ $this->list->storeBatch[] = array(
+ $this->file->repo->getVirtualUrl( 'deleted' ) . '/' . $srcRel,
+ 'public',
+ $this->file->getRel()
+ );
$this->list->cleanupBatch[] = $key;
}
} elseif ( $bits & File::DELETED_FILE ) {
# Do the database operations
$dbw = wfGetDB( DB_MASTER );
- $dbw->update( 'oldimage', array( 'oi_deleted' => $bits ), array( 'oi_name' => $this->row->oi_name, 'oi_timestamp' => $this->row->oi_timestamp, 'oi_deleted' => $this->getBits() ), __METHOD__ );
+ $dbw->update( 'oldimage',
+ array( 'oi_deleted' => $bits ),
+ array(
+ 'oi_name' => $this->row->oi_name,
+ 'oi_timestamp' => $this->row->oi_timestamp,
+ 'oi_deleted' => $this->getBits()
+ ),
+ __METHOD__
+ );
- return (bool) $dbw->affectedRows();
+ return (bool)$dbw->affectedRows();
}
public function isDeleted() {
* @return string
*/
protected function getLink() {
- $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate( $this->file->getTimestamp(), $this->list->getUser() ) );
+ $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
+ $this->file->getTimestamp(), $this->list->getUser() ) );
if ( !$this->isDeleted() ) {
# Regular files...
if ( !$this->canViewContent() ) {
$link = $date;
} else {
- $link = Linker::link( SpecialPage::getTitleFor( 'Revisiondelete' ), $date, array(), array( 'target' => $this->list->title->getPrefixedText(), 'file' => $this->file->getArchiveName(), 'token' => $this->list->getUser()->getEditToken( $this->file->getArchiveName() ) ) );
+ $link = Linker::link(
+ SpecialPage::getTitleFor( 'Revisiondelete' ),
+ $date,
+ array(),
+ array(
+ 'target' => $this->list->title->getPrefixedText(),
+ 'file' => $this->file->getArchiveName(),
+ 'token' => $this->list->getUser()->getEditToken(
+ $this->file->getArchiveName() )
+ )
+ );
}
return '<span class="history-deleted">' . $link . '</span>';
}
public function getHTML() {
- $data = $this->list->msg( 'widthheight' )->numParams( $this->file->getWidth(), $this->file->getHeight() )->text() . ' (' . $this->list->msg( 'nbytes' )->numParams( $this->file->getSize() )->text() . ')';
+ $data =
+ $this->list->msg( 'widthheight' )->numParams(
+ $this->file->getWidth(), $this->file->getHeight() )->text() .
+ ' (' . $this->list->msg( 'nbytes' )->numParams( $this->file->getSize() )->text() . ')';
- return '<li>' . $this->getLink() . ' ' . $this->getUserTools() . ' ' . $data . ' ' . $this->getComment() . '</li>';
+ return '<li>' . $this->getLink() . ' ' . $this->getUserTools() . ' ' .
+ $data . ' ' . $this->getComment() . '</li>';
}
public function getApiData( ApiResult $result ) {
$file = $this->file;
$user = $this->list->getUser();
- $ret = array( 'title' => $this->list->title->getPrefixedText(), 'archivename' => $file->getArchiveName(), 'timestamp' => wfTimestamp( TS_ISO_8601, $file->getTimestamp() ), 'width' => $file->getWidth(), 'height' => $file->getHeight(), 'size' => $file->getSize(), );
+ $ret = array(
+ 'title' => $this->list->title->getPrefixedText(),
+ 'archivename' => $file->getArchiveName(),
+ 'timestamp' => wfTimestamp( TS_ISO_8601, $file->getTimestamp() ),
+ 'width' => $file->getWidth(),
+ 'height' => $file->getHeight(),
+ 'size' => $file->getSize(),
+ );
$ret += $file->isDeleted( Revision::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
$ret += $file->isDeleted( Revision::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
$ret += $this->isDeleted() ? array( 'contenthidden' => '' ) : array();
if ( !$this->isDeleted() ) {
- $ret += array( 'url' => $file->getUrl(), );
+ $ret += array(
+ 'url' => $file->getUrl(),
+ );
} elseif ( $this->canViewContent() ) {
- $ret += array( 'url' => SpecialPage::getTitleFor( 'Revisiondelete' )->getLinkURL( array( 'target' => $this->list->title->getPrefixedText(), 'file' => $file->getArchiveName(), 'token' => $user->getEditToken( $file->getArchiveName() ) ), false, PROTO_RELATIVE ), );
+ $ret += array(
+ 'url' => SpecialPage::getTitleFor( 'Revisiondelete' )->getLinkURL(
+ array(
+ 'target' => $this->list->title->getPrefixedText(),
+ 'file' => $file->getArchiveName(),
+ 'token' => $user->getEditToken( $file->getArchiveName() )
+ ),
+ false, PROTO_RELATIVE
+ ),
+ );
}
if ( $file->userCan( Revision::DELETED_USER, $user ) ) {
- $ret += array( 'userid' => $file->user, 'user' => $file->user_text, );
+ $ret += array(
+ 'userid' => $file->user,
+ 'user' => $file->user_text,
+ );
}
if ( $file->userCan( Revision::DELETED_COMMENT, $user ) ) {
- $ret += array( 'comment' => $file->description, );
+ $ret += array(
+ 'comment' => $file->description,
+ );
}
return $ret;
}
-}
\ No newline at end of file
+}
$archiveNames[] = $timestamp . '!' . $this->title->getDBkey();
}
- return $db->select( 'oldimage', OldLocalFile::selectFields(), array( 'oi_name' => $this->title->getDBkey(), 'oi_archive_name' => $archiveNames ), __METHOD__, array( 'ORDER BY' => 'oi_timestamp DESC' ) );
+ return $db->select(
+ 'oldimage',
+ OldLocalFile::selectFields(),
+ array(
+ 'oi_name' => $this->title->getDBkey(),
+ 'oi_archive_name' => $archiveNames
+ ),
+ __METHOD__,
+ array( 'ORDER BY' => 'oi_timestamp DESC' )
+ );
}
public function newItem( $row ) {
public function getSuppressBit() {
return File::DELETED_RESTRICTED;
}
-}
\ No newline at end of file
+}
public function setBits( $bits ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->update( 'recentchanges', array( 'rc_deleted' => $bits, 'rc_patrolled' => 1 ), array( 'rc_logid' => $this->row->log_id, 'rc_timestamp' => $this->row->log_timestamp // index
- ), __METHOD__ );
- $dbw->update( 'logging', array( 'log_deleted' => $bits ), array( 'log_id' => $this->row->log_id, 'log_deleted' => $this->getBits() ), __METHOD__ );
-
- return (bool) $dbw->affectedRows();
+ $dbw->update( 'recentchanges',
+ array(
+ 'rc_deleted' => $bits,
+ 'rc_patrolled' => 1
+ ),
+ array(
+ 'rc_logid' => $this->row->log_id,
+ 'rc_timestamp' => $this->row->log_timestamp // index
+ ),
+ __METHOD__
+ );
+ $dbw->update( 'logging',
+ array( 'log_deleted' => $bits ),
+ array(
+ 'log_id' => $this->row->log_id,
+ 'log_deleted' => $this->getBits()
+ ),
+ __METHOD__
+ );
+
+ return (bool)$dbw->affectedRows();
}
public function getHTML() {
- $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate( $this->row->log_timestamp, $this->list->getUser() ) );
+ $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
+ $this->row->log_timestamp, $this->list->getUser() ) );
$title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
$formatter = LogFormatter::newFromRow( $this->row );
$formatter->setContext( $this->list->getContext() );
$formatter->setAudience( LogFormatter::FOR_THIS_USER );
// Log link for this page
- $loglink = Linker::link( SpecialPage::getTitleFor( 'Log' ), $this->list->msg( 'log' )->escaped(), array(), array( 'page' => $title->getPrefixedText() ) );
+ $loglink = Linker::link(
+ SpecialPage::getTitleFor( 'Log' ),
+ $this->list->msg( 'log' )->escaped(),
+ array(),
+ array( 'page' => $title->getPrefixedText() )
+ );
$loglink = $this->list->msg( 'parentheses' )->rawParams( $loglink )->escaped();
// User links and action text
$action = $formatter->getActionText();
// Comment
- $comment = $this->list->getLanguage()->getDirMark() . Linker::commentBlock( $this->row->log_comment );
+ $comment = $this->list->getLanguage()->getDirMark()
+ . Linker::commentBlock( $this->row->log_comment );
if ( LogEventsList::isDeleted( $this->row, LogPage::DELETED_COMMENT ) ) {
$comment = '<span class="history-deleted">' . $comment . '</span>';
public function getApiData( ApiResult $result ) {
$logEntry = DatabaseLogEntry::newFromRow( $this->row );
$user = $this->list->getUser();
- $ret = array( 'id' => $logEntry->getId(), 'type' => $logEntry->getType(), 'action' => $logEntry->getSubtype(), );
- $ret += $logEntry->isDeleted( LogPage::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
- $ret += $logEntry->isDeleted( LogPage::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
- $ret += $logEntry->isDeleted( LogPage::DELETED_ACTION ) ? array( 'actionhidden' => '' ) : array();
+ $ret = array(
+ 'id' => $logEntry->getId(),
+ 'type' => $logEntry->getType(),
+ 'action' => $logEntry->getSubtype(),
+ );
+ $ret += $logEntry->isDeleted( LogPage::DELETED_USER )
+ ? array( 'userhidden' => '' )
+ : array();
+ $ret += $logEntry->isDeleted( LogPage::DELETED_COMMENT )
+ ? array( 'commenthidden' => '' )
+ : array();
+ $ret += $logEntry->isDeleted( LogPage::DELETED_ACTION )
+ ? array( 'actionhidden' => '' )
+ : array();
if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
- ApiQueryLogEvents::addLogParams( $result, $ret, $logEntry->getParameters(), $logEntry->getType(), $logEntry->getSubtype(), $logEntry->getTimestamp(), $logEntry->isLegacy() );
+ ApiQueryLogEvents::addLogParams(
+ $result,
+ $ret,
+ $logEntry->getParameters(),
+ $logEntry->getType(),
+ $logEntry->getSubtype(),
+ $logEntry->getTimestamp(),
+ $logEntry->isLegacy()
+ );
}
if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
- $ret += array( 'userid' => $this->row->log_user, 'user' => $this->row->log_user_text, );
+ $ret += array(
+ 'userid' => $this->row->log_user,
+ 'user' => $this->row->log_user_text,
+ );
}
if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
- $ret += array( 'comment' => $this->row->log_comment, );
+ $ret += array(
+ 'comment' => $this->row->log_comment,
+ );
}
return $ret;
}
-}
\ No newline at end of file
+}
}
public static function suggestTarget( $target, array $ids ) {
- $result = wfGetDB( DB_SLAVE )->select( 'logging', 'log_type', array( 'log_id' => $ids ), __METHOD__, array( 'DISTINCT' ) );
+ $result = wfGetDB( DB_SLAVE )->select( 'logging',
+ 'log_type',
+ array( 'log_id' => $ids ),
+ __METHOD__,
+ array( 'DISTINCT' )
+ );
if ( $result->numRows() == 1 ) {
// If there's only one type, the target can be set to include it.
return SpecialPage::getTitleFor( 'Log', $result->current()->log_type );
public function doQuery( $db ) {
$ids = array_map( 'intval', $this->ids );
- return $db->select( 'logging', array( 'log_id', 'log_type', 'log_action', 'log_timestamp', 'log_user', 'log_user_text', 'log_namespace', 'log_title', 'log_page', 'log_comment', 'log_params', 'log_deleted' ), array( 'log_id' => $ids ), __METHOD__, array( 'ORDER BY' => 'log_id DESC' ) );
+ return $db->select( 'logging', array(
+ 'log_id',
+ 'log_type',
+ 'log_action',
+ 'log_timestamp',
+ 'log_user',
+ 'log_user_text',
+ 'log_namespace',
+ 'log_title',
+ 'log_page',
+ 'log_comment',
+ 'log_params',
+ 'log_deleted'
+ ),
+ array( 'log_id' => $ids ),
+ __METHOD__,
+ array( 'ORDER BY' => 'log_id DESC' )
+ );
}
public function newItem( $row ) {
}
public function getLogParams( $params ) {
- return array( implode( ',', $params['ids'] ), "ofield={$params['oldBits']}", "nfield={$params['newBits']}" );
+ return array(
+ implode( ',', $params['ids'] ),
+ "ofield={$params['oldBits']}",
+ "nfield={$params['newBits']}"
+ );
}
-}
\ No newline at end of file
+}
public function setBits( $bits ) {
$dbw = wfGetDB( DB_MASTER );
// Update revision table
- $dbw->update( 'revision', array( 'rev_deleted' => $bits ), array( 'rev_id' => $this->revision->getId(), 'rev_page' => $this->revision->getPage(), 'rev_deleted' => $this->getBits() ), __METHOD__ );
+ $dbw->update( 'revision',
+ array( 'rev_deleted' => $bits ),
+ array(
+ 'rev_id' => $this->revision->getId(),
+ 'rev_page' => $this->revision->getPage(),
+ 'rev_deleted' => $this->getBits()
+ ),
+ __METHOD__
+ );
if ( !$dbw->affectedRows() ) {
// Concurrent fail!
return false;
}
// Update recentchanges table
- $dbw->update( 'recentchanges', array( 'rc_deleted' => $bits, 'rc_patrolled' => 1 ), array( 'rc_this_oldid' => $this->revision->getId(), // condition
+ $dbw->update( 'recentchanges',
+ array(
+ 'rc_deleted' => $bits,
+ 'rc_patrolled' => 1
+ ),
+ array(
+ 'rc_this_oldid' => $this->revision->getId(), // condition
// non-unique timestamp index
- 'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ), ), __METHOD__ );
+ 'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ),
+ ),
+ __METHOD__
+ );
return true;
}
}
public function isHideCurrentOp( $newBits ) {
- return ( $newBits & Revision::DELETED_TEXT ) && $this->list->getCurrent() == $this->getId();
+ return ( $newBits & Revision::DELETED_TEXT )
+ && $this->list->getCurrent() == $this->getId();
}
/**
* @return string
*/
protected function getRevisionLink() {
- $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate( $this->revision->getTimestamp(), $this->list->getUser() ) );
+ $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
+ $this->revision->getTimestamp(), $this->list->getUser() ) );
if ( $this->isDeleted() && !$this->canViewContent() ) {
return $date;
}
- return Linker::linkKnown( $this->list->title, $date, array(), array( 'oldid' => $this->revision->getId(), 'unhide' => 1 ) );
+ return Linker::linkKnown(
+ $this->list->title,
+ $date,
+ array(),
+ array(
+ 'oldid' => $this->revision->getId(),
+ 'unhide' => 1
+ )
+ );
}
/**
if ( $this->isDeleted() && !$this->canViewContent() ) {
return $this->list->msg( 'diff' )->escaped();
} else {
- return Linker::linkKnown( $this->list->title, $this->list->msg( 'diff' )->escaped(), array(), array( 'diff' => $this->revision->getId(), 'oldid' => 'prev', 'unhide' => 1 ) );
+ return Linker::linkKnown(
+ $this->list->title,
+ $this->list->msg( 'diff' )->escaped(),
+ array(),
+ array(
+ 'diff' => $this->revision->getId(),
+ 'oldid' => 'prev',
+ 'unhide' => 1
+ )
+ );
}
}
public function getApiData( ApiResult $result ) {
$rev = $this->revision;
$user = $this->list->getUser();
- $ret = array( 'id' => $rev->getId(), 'timestamp' => wfTimestamp( TS_ISO_8601, $rev->getTimestamp() ), );
+ $ret = array(
+ 'id' => $rev->getId(),
+ 'timestamp' => wfTimestamp( TS_ISO_8601, $rev->getTimestamp() ),
+ );
$ret += $rev->isDeleted( Revision::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
$ret += $rev->isDeleted( Revision::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
$ret += $rev->isDeleted( Revision::DELETED_TEXT ) ? array( 'texthidden' => '' ) : array();
if ( $rev->userCan( Revision::DELETED_USER, $user ) ) {
- $ret += array( 'userid' => $rev->getUser( Revision::FOR_THIS_USER ), 'user' => $rev->getUserText( Revision::FOR_THIS_USER ), );
+ $ret += array(
+ 'userid' => $rev->getUser( Revision::FOR_THIS_USER ),
+ 'user' => $rev->getUserText( Revision::FOR_THIS_USER ),
+ );
}
if ( $rev->userCan( Revision::DELETED_COMMENT, $user ) ) {
- $ret += array( 'comment' => $rev->getComment( Revision::FOR_THIS_USER ), );
+ $ret += array(
+ 'comment' => $rev->getComment( Revision::FOR_THIS_USER ),
+ );
}
return $ret;
}
-}
\ No newline at end of file
+}