47 parent::__construct(
'Diff' );
48 $this->mAllowedRedirectParams = [];
56 $parts = $subpage !==
null ? explode(
'/', $subpage ) : [];
59 if ( count( $parts ) === 1 && $parts[0] !==
'' ) {
60 $this->mAddedRedirectParams[
'diff'] = $parts[0];
61 } elseif ( count( $parts ) === 2 ) {
62 $this->mAddedRedirectParams[
'oldid'] = $parts[0];
63 $this->mAddedRedirectParams[
'diff'] = $parts[1];
78 private function showForm() {
79 $form = HTMLForm::factory(
'ooui', [
83 'label-message' =>
'diff-form-oldid',
88 'type' =>
'selectorother',
89 'options-messages' => [
90 'diff-form-other-revid' =>
'other',
95 'label-message' =>
'diff-form-revid',
97 'validation-callback' =>
function ( $value ) {
98 $value = trim( $value ??
'' );
99 if ( preg_match(
'/^\d*$/', $value )
100 || in_array( $value, [
'prev',
'cur',
'next' ],
true )
104 return $this->
msg(
'diff-form-error-revid' );
108 $form->setSubmitTextMsg(
'diff-form-submit' );
109 $form->setSubmitCallback( [ $this,
'onFormSubmit' ] );
115 if ( $formData[
'oldid'] ) {
116 $params[] = $formData[
'oldid'];
118 if ( $formData[
'diff'] ) {
120 $params[] = trim( $formData[
'diff'] );
123 $url = $title->getFullUrlForRedirect();
129 return $this->
msg(
'diff-form' );
146class_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 Per default the message key is the canonical name o...
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.