/**
* Constructor
- * @param IContextSource $context context to use, anything else will be ignored
- * @param int $old old ID we want to show and diff with.
- * @param string|int $new either revision ID or 'prev' or 'next'. Default: 0.
+ * @param IContextSource $context Context to use, anything else will be ignored
+ * @param int $old Old ID we want to show and diff with.
+ * @param string|int $new Either revision ID or 'prev' or 'next'. Default: 0.
* @param int $rcid Deprecated, no longer used!
* @param bool $refreshCache If set, refreshes the diff cache
* @param bool $unhide If set, allow viewing deleted revs
'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;
}
}
wfRunHooks( '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 );
*
* @todo move this to TextDifferenceEngine, make DifferenceEngine abstract. At some point.
*
- * @param string $otext old text, must be already segmented
- * @param string $ntext new text, must be already segmented
+ * @param string $otext Old text, must be already segmented
+ * @param string $ntext New text, must be already segmented
*
* @return bool|string
*/
}
// Sanity: don't show the notice if too many rows must be scanned
- // @TODO: show some special message for that case
+ // @todo show some special message for that case
$nEdits = $this->mNewPage->countRevisionsBetween( $oldRev, $newRev, 1000 );
if ( $nEdits > 0 && $nEdits <= 1000 ) {
$limit = 100; // use diff-multi-manyusers if too many users
$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',
/**
* Use specified text instead of loading from the database
+ * @param Content $oldContent
+ * @param Content $newContent
* @since 1.21
*/
public function setContent( Content $oldContent, Content $newContent ) {
/**
* Set the language in which the diff text is written
* (Defaults to page content language).
+ * @param Language|string $lang
* @since 1.19
*/
public function setTextLanguage( $lang ) {