}
$out->setPageTitle( $this->msg( 'errorpagetitle' ) );
- $out->addWikiMsg( 'difference-missing-revision',
- $this->getLanguage()->listToText( $missing ), count( $missing ) );
+ $msg = $this->msg( 'difference-missing-revision' )
+ ->params( $this->getLanguage()->listToText( $missing ) )
+ ->numParams( count( $missing ) )
+ ->parseAsBlock();
+ $out->addHtml( $msg );
}
public function showDiffPage( $diffOnly = false ) {
$samePage = true;
$oldHeader = '';
} else {
- wfRunHooks( 'DiffViewHeader', array( $this, $this->mOldRev, $this->mNewRev ) );
+ Hooks::run( 'DiffViewHeader', array( $this, $this->mOldRev, $this->mNewRev ) );
if ( $this->mNewPage->equals( $this->mOldPage ) ) {
$out->setPageTitle( $this->msg( 'difference-title', $this->mNewPage->getPrefixedText() ) );
'undoafter' => $this->mOldid,
'undo' => $this->mNewid
) ),
- 'title' => Linker::titleAttrib( 'undo' )
+ 'title' => Linker::titleAttrib( 'undo' ),
),
$this->msg( 'editundo' )->text()
);
- $revisionTools[] = $undoLink;
+ $revisionTools['mw-diff-undo'] = $undoLink;
}
}
$rdel = $this->revisionDeleteLink( $this->mNewRev );
# Allow extensions to define their own revision tools
- wfRunHooks( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools, $this->mOldRev ) );
+ Hooks::run( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools, $this->mOldRev ) );
$formattedRevisionTools = array();
// Put each one in parentheses (poor man's button)
- foreach ( $revisionTools as $tool ) {
- $formattedRevisionTools[] = $this->msg( 'parentheses' )->rawParams( $tool )->escaped();
+ foreach ( $revisionTools as $key => $tool ) {
+ $toolClass = is_string( $key ) ? $key : 'mw-diff-tool';
+ $element = Html::rawElement(
+ 'span',
+ array( 'class' => $toolClass ),
+ $this->msg( 'parentheses' )->rawParams( $tool )->escaped()
+ );
+ $formattedRevisionTools[] = $element;
}
$newRevisionHeader = $this->getRevisionHeader( $this->mNewRev, 'complete' ) .
' ' . implode( ' ', $formattedRevisionTools );
<h2 class='diff-currentversion-title'>{$revHeader}</h2>\n" );
# Page content may be handled by a hooked call instead...
# @codingStandardsIgnoreStart Ignoring long lines.
- if ( wfRunHooks( 'ArticleContentOnDiff', array( $this, $out ) ) ) {
+ if ( Hooks::run( 'ArticleContentOnDiff', array( $this, $out ) ) ) {
$this->loadNewText();
$out->setRevisionId( $this->mNewid );
$out->setRevisionTimestamp( $this->mNewRev->getTimestamp() );
$out->addParserOutputContent( $po );
}
}
- } elseif ( !wfRunHooks( 'ArticleContentViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+ } elseif ( !Hooks::run( 'ArticleContentViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
// Handled by extension
} elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
// NOTE: deprecated hook, B/C only
$difftext = $this->generateContentDiffBody( $this->mOldContent, $this->mNewContent );
// Save to cache for 7 days
- if ( !wfRunHooks( 'AbortDiffCache', array( &$this ) ) ) {
+ if ( !Hooks::run( 'AbortDiffCache', array( &$this ) ) ) {
wfIncrStats( 'diff_uncacheable' );
} elseif ( $key !== false && $difftext !== false ) {
wfIncrStats( 'diff_cache_miss' );
$key = $title->quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold';
$msg = $this->msg( $key )->escaped();
- $header .= ' ' . $this->msg( 'parentheses' )->rawParams(
- Linker::linkKnown( $title, $msg, array(), $editQuery ) )->plain();
+ $editLink = $this->msg( 'parentheses' )->rawParams(
+ Linker::linkKnown( $title, $msg, array( ), $editQuery ) )->plain();
+ $header .= ' ' . Html::rawElement(
+ 'span',
+ array( 'class' => 'mw-diff-edit' ),
+ $editLink
+ );
if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
$header = Html::rawElement(
'span',
$this->mNewid = 0;
}
- wfRunHooks(
+ Hooks::run(
'NewDifferenceEngine',
array( $this->getTitle(), &$this->mOldid, &$this->mNewid, $old, $new )
);