X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMergeHistory.php;h=ef1fd73c6378e1b8266c2a5453bcbea6fb50df5a;hb=ba405dd13bd61b6da36beb4999ade6b2f47a1aae;hp=7edf961acd97d145e8a76de313bfe4e8d76d7f21;hpb=586effc0b7a0307ded8a7a587adca44b9b3febf9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index 7edf961acd..ef1fd73c63 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -61,6 +61,9 @@ class SpecialMergeHistory extends SpecialPage { /** @var Title */ protected $mDestObj; + /** @var int[] */ + public $prevId; + public function __construct() { parent::__construct( 'MergeHistory', 'mergehistory' ); } @@ -94,18 +97,6 @@ class SpecialMergeHistory extends SpecialPage { $this->mTargetObj = null; $this->mDestObj = null; } - $this->preCacheMessages(); - } - - /** - * As we use the same small set of messages in various methods and that - * they are called often, we call them once and save them in $this->message - */ - function preCacheMessages() { - // Precache various messages - if ( !isset( $this->message ) ) { - $this->message['last'] = $this->msg( 'last' )->escaped(); - } } public function execute( $par ) { @@ -283,7 +274,7 @@ class SpecialMergeHistory extends SpecialPage { $rev = new Revision( $row ); $stxt = ''; - $last = $this->message['last']; + $last = $this->msg( 'last' )->escaped(); $ts = wfTimestamp( TS_MW, $row->rev_timestamp ); $checkBox = Xml::radio( 'mergepoint', $ts, ( $this->mTimestamp === $ts ) ); @@ -302,11 +293,11 @@ class SpecialMergeHistory extends SpecialPage { # Last link if ( !$rev->userCan( Revision::DELETED_TEXT, $user ) ) { - $last = $this->message['last']; + $last = $this->msg( 'last' )->escaped(); } elseif ( isset( $this->prevId[$row->rev_id] ) ) { $last = Linker::linkKnown( $rev->getTitle(), - $this->message['last'], + $this->msg( 'last' )->escaped(), array(), array( 'diff' => $row->rev_id, @@ -485,10 +476,18 @@ class SpecialMergeHistory extends SpecialPage { $logId = $logEntry->insert(); $logEntry->publish( $logId ); - # @todo message should use redirect=no - $this->getOutput()->addWikiText( $this->msg( 'mergehistory-success', - $targetTitle->getPrefixedText(), $destTitle->getPrefixedText() )->numParams( - $count )->text() ); + $targetLink = Linker::link( + $targetTitle, + $targetTitle->getPrefixedText(), + array(), + array( 'redirect' => 'no' ) + ); + + $this->getOutput()->addWikiMsg( $this->msg( 'mergehistory-done' ) + ->rawParams( $targetLink ) + ->params( $destTitle->getPrefixedText() ) + ->numParams( $count ) + ); Hooks::run( 'ArticleMergeComplete', array( $targetTitle, $destTitle ) ); @@ -501,13 +500,13 @@ class SpecialMergeHistory extends SpecialPage { } class MergeHistoryPager extends ReverseChronologicalPager { - /** @var IContextSource */ + /** @var SpecialMergeHistory */ public $mForm; /** @var array */ public $mConds; - function __construct( $form, $conds, $source, $dest ) { + function __construct( SpecialMergeHistory $form, $conds, Title $source, Title $dest ) { $this->mForm = $form; $this->mConds = $conds; $this->title = $source;