43 parent::__construct(
'Diff' );
44 $this->mAllowedRedirectParams = [];
52 $parts = $subpage !==
null ? explode(
'/', $subpage ) : [];
55 if ( count( $parts ) === 1 && $parts[0] !==
'' ) {
56 $this->mAddedRedirectParams[
'diff'] = $parts[0];
57 } elseif ( count( $parts ) === 2 ) {
58 $this->mAddedRedirectParams[
'oldid'] = $parts[0];
59 $this->mAddedRedirectParams[
'diff'] = $parts[1];
74 private function showForm() {
75 $form = HTMLForm::factory(
'ooui', [
79 'label-message' =>
'diff-form-oldid',
84 'type' =>
'selectorother',
85 'options-messages' => [
86 'diff-form-other-revid' =>
'other',
91 'label-message' =>
'diff-form-revid',
93 'validation-callback' =>
function ( $value ) {
94 $value = trim( $value ??
'' );
95 if ( preg_match(
'/^\d*$/', $value )
96 || in_array( $value, [
'prev',
'cur',
'next' ],
true )
100 return $this->
msg(
'diff-form-error-revid' );
104 $form->setSubmitTextMsg(
'diff-form-submit' );
105 $form->setSubmitCallback( [ $this,
'onFormSubmit' ] );
111 if ( $formData[
'oldid'] ) {
112 $params[] = $formData[
'oldid'];
114 if ( $formData[
'diff'] ) {
116 $params[] = trim( $formData[
'diff'] );
119 $url = $title->getFullUrlForRedirect();
125 return $this->
msg(
'diff-form' );
142class_alias( SpecialDiff::class,
'SpecialDiff' );
array $params
The job parameters.
Shortcut to construct a special page alias.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getPageTitle( $subpage=false)
Get a self-referential title object.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages By default the message key is the canonical name of...
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.