X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialComparePages.php;h=35cc6b84f22e0ed5c72d93ff1a3c18cfb782f8dc;hb=74426f3cf796b149f1ae445e41815bbe148640b2;hp=0f8b7291b1e77a071abc593946957d367abe4ec2;hpb=266dbe55e8c752654a1041a77063ae5d389c2f75;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialComparePages.php b/includes/specials/SpecialComparePages.php index 0f8b7291b1..35cc6b84f2 100644 --- a/includes/specials/SpecialComparePages.php +++ b/includes/specials/SpecialComparePages.php @@ -49,60 +49,58 @@ class SpecialComparePages extends SpecialPage { public function execute( $par ) { $this->setHeaders(); $this->outputHeader(); + $this->getOutput()->addModuleStyles( 'mediawiki.special.comparepages.styles' ); - # Form (.mw-searchInput enables suggestions) - $form = new HTMLForm( array( - 'Page1' => array( - 'type' => 'text', + $form = HTMLForm::factory( 'ooui', [ + 'Page1' => [ + 'type' => 'title', 'name' => 'page1', - 'cssclass' => 'mw-searchInput', 'label-message' => 'compare-page1', 'size' => '40', 'section' => 'page1', - 'validation-callback' => array( $this, 'checkExistingTitle' ), - ), - 'Revision1' => array( + 'validation-callback' => [ $this, 'checkExistingTitle' ], + ], + 'Revision1' => [ 'type' => 'int', 'name' => 'rev1', 'label-message' => 'compare-rev1', 'size' => '8', 'section' => 'page1', - 'validation-callback' => array( $this, 'checkExistingRevision' ), - ), - 'Page2' => array( - 'type' => 'text', + 'validation-callback' => [ $this, 'checkExistingRevision' ], + ], + 'Page2' => [ + 'type' => 'title', 'name' => 'page2', - 'cssclass' => 'mw-searchInput', 'label-message' => 'compare-page2', 'size' => '40', 'section' => 'page2', - 'validation-callback' => array( $this, 'checkExistingTitle' ), - ), - 'Revision2' => array( + 'validation-callback' => [ $this, 'checkExistingTitle' ], + ], + 'Revision2' => [ 'type' => 'int', 'name' => 'rev2', 'label-message' => 'compare-rev2', 'size' => '8', 'section' => 'page2', - 'validation-callback' => array( $this, 'checkExistingRevision' ), - ), - 'Action' => array( + 'validation-callback' => [ $this, 'checkExistingRevision' ], + ], + 'Action' => [ 'type' => 'hidden', 'name' => 'action', - ), - 'Diffonly' => array( + ], + 'Diffonly' => [ 'type' => 'hidden', 'name' => 'diffonly', - ), - 'Unhide' => array( + ], + 'Unhide' => [ 'type' => 'hidden', 'name' => 'unhide', - ), - ), $this->getContext(), 'compare' ); + ], + ], $this->getContext(), 'compare' ); $form->setSubmitTextMsg( 'compare-submit' ); $form->suppressReset(); $form->setMethod( 'get' ); - $form->setSubmitCallback( array( __CLASS__, 'showDiff' ) ); + $form->setSubmitCallback( [ __CLASS__, 'showDiff' ] ); $form->loadData(); $form->displayForm( '' );