Go to the documentation of this file.
40 parent::__construct(
'ComparePages' );
51 $this->
getOutput()->addModuleStyles(
'mediawiki.special' );
58 'label-message' =>
'compare-page1',
61 'validation-callback' => [ $this,
'checkExistingTitle' ],
67 'label-message' =>
'compare-rev1',
70 'validation-callback' => [ $this,
'checkExistingRevision' ],
75 'label-message' =>
'compare-page2',
78 'validation-callback' => [ $this,
'checkExistingTitle' ],
84 'label-message' =>
'compare-rev2',
87 'validation-callback' => [ $this,
'checkExistingRevision' ],
102 $form->setSubmitTextMsg(
'compare-submit' );
103 $form->suppressReset();
104 $form->setMethod(
'get' );
105 $form->setSubmitCallback( [ __CLASS__,
'showDiff' ] );
108 $form->displayForm(
'' );
116 if ( $rev1 && $rev2 ) {
120 $contentHandler = $revision->getContentHandler();
121 $de = $contentHandler->createDifferenceEngine( $form->
getContext(),
125 ( $data[
'Action'] ==
'purge' ),
126 ( $data[
'Unhide'] ==
'1' )
128 $de->showDiffPage(
true );
139 return $title->getLatestRevID();
147 if ( $value ===
'' || $value ===
null ) {
152 return $this->
msg(
'compare-invalid-title' )->parseAsBlock();
154 if ( !
$title->exists() ) {
155 return $this->
msg(
'compare-title-not-exists' )->parseAsBlock();
162 if ( $value ===
'' || $value ===
null ) {
166 if ( $revision ===
null ) {
167 return $this->
msg(
'compare-revision-not-exists' )->parseAsBlock();
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
getContext()
Get the base IContextSource object.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
getOutput()
Get the OutputPage being used for this instance.
checkExistingRevision( $value, $alldata)
checkExistingTitle( $value, $alldata)
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Implements Special:ComparePages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
static showDiff( $data, HTMLForm $form)
getContext()
Gets the context this SpecialPage is executed in.
Parent class for all special pages.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Represents a title within MediaWiki.
execute( $par)
Show a form for filtering namespace and username.
static revOrTitle( $revision, $title)
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...