41 parent::__construct(
'Diff' );
42 $this->mAllowedRedirectParams = [];
50 $parts = explode(
'/', $subpage );
53 if ( count( $parts ) === 1 && $parts[0] !==
'' ) {
54 $this->mAddedRedirectParams[
'diff'] = $parts[0];
55 } elseif ( count( $parts ) === 2 ) {
56 $this->mAddedRedirectParams[
'oldid'] = $parts[0];
57 $this->mAddedRedirectParams[
'diff'] = $parts[1];
77 'label-message' =>
'diff-form-oldid',
82 'type' =>
'selectorother',
83 'options-messages' => [
84 'diff-form-other-revid' =>
'other',
89 'label-message' =>
'diff-form-revid',
91 'validation-callback' =>
function ( $value ) {
92 $value = trim( $value );
93 if ( preg_match(
'/^\d*$/', $value )
94 || in_array( $value, [
'prev',
'cur',
'next' ],
true )
98 return $this->
msg(
'diff-form-error-revid' );
102 $form->setSubmitTextMsg(
'diff-form-submit' );
103 $form->setSubmitCallback( [ $this,
'onFormSubmit' ] );
109 if ( $formData[
'oldid'] ) {
110 $params[] = $formData[
'oldid'];
112 if ( $formData[
'diff'] ) {
114 $params[] = trim( $formData[
'diff'] );
117 $url =
$title->getFullUrlForRedirect();
123 return $this->
msg(
'diff-form' )->text();
Shortcut to construct a special page alias.
Redirect from Special:Diff/### to index.php?diff=### and from Special:Diff/###/### to index....
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be l...
isListed()
Whether this special page is listed in Special:SpecialPages.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getName()
Get the name of this Special Page.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getPageTitle( $subpage=false)
Get a self-referential title object.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.