* @param $filter: array
* @param $tagFilter: array?
*/
- public function showOptions( $types=array(), $user='', $page='', $pattern='', $year='',
+ public function showOptions( $types=array(), $user='', $page='', $pattern='', $year='',
$month = '', $filter = null, $tagFilter='' ) {
global $wgScript, $wgMiserMode;
$hideVal = 1 - intval($val);
$query[$queryKey] = $hideVal;
- $link = $this->skin->link(
- $this->out->getTitle(),
+ $link = Linker::link(
+ $this->getDisplayTitle(),
$messages[$hideVal],
array(),
$query,
return $this->mDefaultQuery;
}
+ /**
+ * Get the Title object of the page the links should point to.
+ * This is NOT the Title of the page the entries should be restricted to.
+ *
+ * @return Title object
+ */
+ public function getDisplayTitle() {
+ return $this->out->getTitle();
+ }
+
/**
* @param $queryTypes Array
* @return String: Formatted HTML
return Xml::tags( 'li', array( "class" => implode( ' ', $classes ) ),
$del . "$time $userLink $action $comment $revert $tagDisplay" ) . "\n";
}
-
+
private function logTimestamp( $row ) {
global $wgLang;
$time = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->log_timestamp ), true );
$userLinks = '<span class="history-deleted">' .
wfMsgHtml( 'rev-deleted-user' ) . '</span>';
} else {
- $userLinks = $this->skin->userLink( $row->log_user, $row->user_name );
+ $userLinks = Linker::userLink( $row->log_user, $row->user_name );
// Talk|Contribs links...
if( !( $this->flags & self::NO_EXTRA_USER_LINKS ) ) {
- $userLinks .= $this->skin->userToolLinks(
+ $userLinks .= Linker::userToolLinks(
$row->log_user, $row->user_name, true, 0, $row->user_editcount );
}
}
}
return $action;
}
-
+
private function logComment( $row ) {
- global $wgContLang;
if( self::isDeleted( $row, LogPage::DELETED_COMMENT ) ) {
$comment = '<span class="history-deleted">' .
wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
} else {
- $comment = $wgContLang->getDirMark() .
- $this->skin->commentBlock( $row->log_comment );
+ global $wgLang;
+ $comment = $wgLang->getDirMark() .
+ Linker::commentBlock( $row->log_comment );
}
return $comment;
}
if( self::typeAction( $row, 'move', 'move', 'move' ) && !empty( $paramArray[0] ) ) {
$destTitle = Title::newFromText( $paramArray[0] );
if( $destTitle ) {
- $revert = '(' . $this->skin->link(
+ $revert = '(' . Linker::link(
SpecialPage::getTitleFor( 'Movepage' ),
$this->message['revertmove'],
array(),
) . ')';
}
// Show undelete link
- } else if( self::typeAction( $row, array( 'delete', 'suppress' ), 'delete', 'deletedhistory' ) ) {
+ } elseif( self::typeAction( $row, array( 'delete', 'suppress' ), 'delete', 'deletedhistory' ) ) {
if( !$wgUser->isAllowed( 'undelete' ) ) {
$viewdeleted = $this->message['undeleteviewlink'];
} else {
$viewdeleted = $this->message['undeletelink'];
}
- $revert = '(' . $this->skin->link(
+ $revert = '(' . Linker::link(
SpecialPage::getTitleFor( 'Undelete' ),
$viewdeleted,
array(),
array( 'known', 'noclasses' )
) . ')';
// Show unblock/change block link
- } else if( self::typeAction( $row, array( 'block', 'suppress' ), array( 'block', 'reblock' ), 'block' ) ) {
+ } elseif( self::typeAction( $row, array( 'block', 'suppress' ), array( 'block', 'reblock' ), 'block' ) ) {
$revert = '(' .
- $this->skin->link(
+ Linker::link(
SpecialPage::getTitleFor( 'Unblock', $row->log_title ),
$this->message['unblocklink'],
array(),
'known'
) .
$this->message['pipe-separator'] .
- $this->skin->link(
+ Linker::link(
SpecialPage::getTitleFor( 'Block', $row->log_title ),
$this->message['change-blocklink'],
array(),
) .
')';
// Show change protection link
- } else if( self::typeAction( $row, 'protect', array( 'modify', 'protect', 'unprotect' ) ) ) {
+ } elseif( self::typeAction( $row, 'protect', array( 'modify', 'protect', 'unprotect' ) ) ) {
$revert .= ' (' .
- $this->skin->link( $title,
+ Linker::link( $title,
$this->message['hist'],
array(),
array(
);
if( $wgUser->isAllowed( 'protect' ) ) {
$revert .= $this->message['pipe-separator'] .
- $this->skin->link( $title,
+ Linker::link( $title,
$this->message['protect_change'],
array(),
array( 'action' => 'protect' ),
}
$revert .= ')';
// Show unmerge link
- } else if( self::typeAction( $row, 'merge', 'merge', 'mergehistory' ) ) {
- $revert = '(' . $this->skin->link(
+ } elseif( self::typeAction( $row, 'merge', 'merge', 'mergehistory' ) ) {
+ $revert = '(' . Linker::link(
SpecialPage::getTitleFor( 'MergeHistory' ),
$this->message['revertmerge'],
array(),
array( 'known', 'noclasses' )
) . ')';
// If an edit was hidden from a page give a review link to the history
- } else if( self::typeAction( $row, array( 'delete', 'suppress' ), 'revision', 'deletedhistory' ) ) {
+ } elseif( self::typeAction( $row, array( 'delete', 'suppress' ), 'revision', 'deletedhistory' ) ) {
$revert = RevisionDeleter::getLogLinks( $title, $paramArray,
$this->skin, $this->message );
// Hidden log items, give review link
- } else if( self::typeAction( $row, array( 'delete', 'suppress' ), 'event', 'deletedhistory' ) ) {
+ } elseif( self::typeAction( $row, array( 'delete', 'suppress' ), 'event', 'deletedhistory' ) ) {
if( count($paramArray) >= 1 ) {
$revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
// $paramArray[1] is a CSV of the IDs
$query = $paramArray[0];
// Link to each hidden object ID, $paramArray[1] is the url param
- $revert = '(' . $this->skin->link(
+ $revert = '(' . Linker::link(
$revdel,
- $this->message['revdel-restore'],
+ $this->message['revdel-restore'],
array(),
array(
'target' => $title->getPrefixedText(),
) . ')';
}
// Self-created users
- } else if( self::typeAction( $row, 'newusers', 'create2' ) ) {
+ } elseif( self::typeAction( $row, 'newusers', 'create2' ) ) {
if( isset( $paramArray[0] ) ) {
- $revert = $this->skin->userToolLinks( $paramArray[0], $title->getDBkey(), true );
+ $revert = Linker::userToolLinks( $paramArray[0], $title->getDBkey(), true );
} else {
# Fall back to a blue contributions link
- $revert = $this->skin->userToolLinks( 1, $title->getDBkey() );
+ $revert = Linker::userToolLinks( 1, $title->getDBkey() );
}
- $ts = wfTimestamp( TS_UNIX, $row->log_timestamp );
- if( $ts < '20080129000000' ) {
+ if( wfTimestamp( TS_MW, $row->log_timestamp ) < '20080129000000' ) {
# Suppress $comment from old entries (before 2008-01-29),
# not needed and can contain incorrect links
$comment = '';
}
$del = '';
// Don't show useless link to people who cannot hide revisions
- if( $wgUser->isAllowed( 'deletedhistory' ) ) {
+ if( $wgUser->isAllowed( 'deletedhistory' ) && !$wgUser->isBlocked() ) {
if( $row->log_deleted || $wgUser->isAllowed( 'deleterevision' ) ) {
$canHide = $wgUser->isAllowed( 'deleterevision' );
// If event was hidden from sysops
if( !self::userCan( $row, LogPage::DELETED_RESTRICTED ) ) {
- $del = $this->skin->revDeleteLinkDisabled( $canHide );
+ $del = Linker::revDeleteLinkDisabled( $canHide );
} else {
$target = SpecialPage::getTitleFor( 'Log', $row->log_type );
$query = array(
'type' => 'logging',
'ids' => $row->log_id,
);
- $del = $this->skin->revDeleteLink( $query,
+ $del = Linker::revDeleteLink( $query,
self::isDeleted( $row, LogPage::DELETED_RESTRICTED ), $canHide );
}
}
# If there is exactly one log type, we can link to Special:Log?type=foo
if ( count( $types ) == 1 )
$urlParam['type'] = $types[0];
- $s .= $wgUser->getSkin()->link(
+ $s .= Linker::link(
SpecialPage::getTitleFor( 'Log' ),
wfMsgHtml( 'log-fulllog' ),
array(),
return $query;
}
+ function getTitle() {
+ return $this->mLogEventsList->getDisplayTitle();
+ }
+
// Call ONLY after calling $this->limitType() already!
public function getFilterParams() {
global $wgFilterLogTypes, $wgUser, $wgRequest;
global $wgUser;
$this->mConds['log_user'] = $userid;
// Paranoia: avoid brute force searches (bug 17342)
- if( !$wgUser->isAllowed( 'deletedhistory' ) ) {
+ if( !$wgUser->isAllowed( 'deletedhistory' ) || $wgUser->isBlocked() ) {
$this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::DELETED_USER) . ' = 0';
- } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
+ } elseif( !$wgUser->isAllowed( 'suppressrevision' ) || $wgUser->isBlocked() ) {
$this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::SUPPRESSED_USER) .
' != ' . LogPage::SUPPRESSED_USER;
}
$this->mConds['log_title'] = $title->getDBkey();
}
// Paranoia: avoid brute force searches (bug 17342)
- if( !$wgUser->isAllowed( 'deletedhistory' ) ) {
+ if( !$wgUser->isAllowed( 'deletedhistory' ) || $wgUser->isBlocked() ) {
$this->mConds[] = $db->bitAnd('log_deleted', LogPage::DELETED_ACTION) . ' = 0';
- } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
+ } elseif( !$wgUser->isAllowed( 'suppressrevision' ) || $wgUser->isBlocked() ) {
$this->mConds[] = $db->bitAnd('log_deleted', LogPage::SUPPRESSED_ACTION) .
' != ' . LogPage::SUPPRESSED_ACTION;
}
# Avoid usage of the wrong index by limiting
# the choices of available indexes. This mainly
# avoids site-breaking filesorts.
- } else if( $this->title || $this->pattern || $this->user ) {
+ } elseif( $this->title || $this->pattern || $this->user ) {
$index['logging'] = array( 'page_time', 'user_time' );
if( count($this->types) == 1 ) {
$index['logging'][] = 'log_user_type_time';
}
- } else if( count($this->types) == 1 ) {
+ } elseif( count($this->types) == 1 ) {
$index['logging'] = 'type_time';
} else {
$index['logging'] = 'times';