private $out;
public $flags;
- function __construct( $skin, $out, $flags = 0 ) {
+ public function __construct( $skin, $out, $flags = 0 ) {
$this->skin = $skin;
$this->out = $out;
$this->flags = $flags;
private function preCacheMessages() {
// Precache various messages
if( !isset( $this->message ) ) {
- $messages = 'revertmerge protect_change unblocklink change-blocklink revertmove undeletelink revdel-restore rev-delundel hist';
- foreach( explode( ' ', $messages ) as $msg ) {
- $this->message[$msg] = wfMsgExt( $msg, array( 'escape') );
+ $messages = array( 'revertmerge', 'protect_change', 'unblocklink', 'change-blocklink',
+ 'revertmove', 'undeletelink', 'revdel-restore', 'rev-delundel', 'hist', 'pipe-separator' );
+ foreach( $messages as $msg ) {
+ $this->message[$msg] = wfMsgExt( $msg, array( 'escape' ) );
}
}
}
array(),
array( 'action' => 'unblock', 'ip' => $row->log_title ),
'known' )
- . ' ' . wfMsg( 'pipe-separator' ) . ' ' .
+ . ' ' . $this->message['pipe-separator'] . ' ' .
$this->skin->link( SpecialPage::getTitleFor( 'Blockip', $row->log_title ),
$this->message['change-blocklink'],
array(), array(), 'known' ) .
')';
// Show change protection link
- } else if( self::typeAction($row,'protect',array('modify','protect','unprotect')) ) {
- $revert .= ' (' . $this->skin->makeKnownLinkObj( $title, $this->message['hist'],
- 'action=history&offset=' . urlencode($row->log_timestamp) ) . ')';
- if( $wgUser->isAllowed('protect') && $row->log_action != 'unprotect' ) {
- $revert .= ' (' . $this->skin->makeKnownLinkObj( $title, $this->message['protect_change'],
- 'action=unprotect' ) . ')';
+ } else if( self::typeAction( $row, 'protect', array( 'modify', 'protect', 'unprotect' ) ) ) {
+ $revert .= ' (' .
+ $this->skin->link( $title,
+ $this->message['hist'],
+ array(),
+ array( 'action' => 'history', 'offset' => $row->log_timestamp ) );
+ if( $wgUser->isAllowed( 'protect' ) ) {
+ $revert .= ' ' . $this->message['pipe-separator'] . ' ' .
+ $this->skin->link( $title,
+ $this->message['protect_change'],
+ array(),
+ array( 'action' => 'protect' ),
+ 'known' );
}
+ $revert .= ')';
// Show unmerge link
} else if( self::typeAction($row,'merge','merge','mergehistory') ) {
$merge = SpecialPage::getTitleFor( 'Mergehistory' );
$revert = $this->skin->userToolLinks( 1, $title->getDBkey() );
}
if( $time < '20080129000000' ) {
- # Suppress $comment from old entries (before 2008-01-29), not needed and can contain incorrect links
+ # Suppress $comment from old entries (before 2008-01-29),
+ # not needed and can contain incorrect links
$comment = '';
}
// Do nothing. The implementation is handled by the hook modifiying the passed-by-ref parameters.
if( self::isDeleted($row,LogPage::DELETED_ACTION) ) {
$action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';
} else {
- $action = LogPage::actionText( $row->log_type, $row->log_action, $title, $this->skin, $paramArray, true );
+ $action = LogPage::actionText( $row->log_type, $row->log_action, $title,
+ $this->skin, $paramArray, true );
+ }
+
+ if( $revert != '' ) {
+ $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
}
return "<li>$del$time $userLink $action $comment $revert</li>\n";
* @param $year Integer
* @param $month Integer
*/
- function __construct( $list, $type = '', $user = '', $title = '', $pattern = '',
- $conds = array(), $year = false, $month = false )
+ public function __construct( $list, $type = '', $user = '', $title = '', $pattern = '',
+ $conds = array(), $year = false, $month = false )
{
parent::__construct();
$this->mConds = $conds;
*/
function __construct( $request ) {
global $wgUser, $wgOut;
+ wfDeprecated(__FUNCTION__);
# Get parameters
$type = $request->getVal( 'type' );
$user = $request->getText( 'user' );
*/
function __construct( &$reader, $flags = 0 ) {
global $wgUser;
+ wfDeprecated(__FUNCTION__);
$this->reader =& $reader;
$this->reader->pager->mLogEventsList->flags = $flags;
# Aliases for shorter code...