From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/specialpage/FormSpecialPage.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'includes/specialpage/FormSpecialPage.php') diff --git a/includes/specialpage/FormSpecialPage.php b/includes/specialpage/FormSpecialPage.php index bf86ab2e..90567617 100644 --- a/includes/specialpage/FormSpecialPage.php +++ b/includes/specialpage/FormSpecialPage.php @@ -74,22 +74,29 @@ abstract class FormSpecialPage extends SpecialPage { return strtolower( $this->getName() ); } + /** + * Get display format for the form. See HTMLForm documentation for available values. + * + * @since 1.25 + * @return string + */ + protected function getDisplayFormat() { + return 'table'; + } + /** * Get the HTMLForm to control behavior * @return HTMLForm|null */ protected function getForm() { - $this->fields = $this->getFormFields(); - - $form = new HTMLForm( $this->fields, $this->getContext(), $this->getMessagePrefix() ); + $form = HTMLForm::factory( + $this->getDisplayFormat(), + $this->getFormFields(), + $this->getContext(), + $this->getMessagePrefix() + ); $form->setSubmitCallback( array( $this, 'onSubmit' ) ); - // If the form is a compact vertical form, then don't output this ugly - // fieldset surrounding it. - // XXX Special pages can setDisplayFormat to 'vform' in alterForm(), but that - // is called after this. - if ( !$form->isVForm() ) { - $form->setWrapperLegendMsg( $this->getMessagePrefix() . '-legend' ); - } + $form->setWrapperLegendMsg( $this->getMessagePrefix() . '-legend' ); $headerMsg = $this->msg( $this->getMessagePrefix() . '-text' ); if ( !$headerMsg->isDisabled() ) { @@ -106,7 +113,7 @@ abstract class FormSpecialPage extends SpecialPage { $this->alterForm( $form ); // Give hooks a chance to alter the form, adding extra fields or text etc - wfRunHooks( 'SpecialPageBeforeFormDisplay', array( $this->getName(), &$form ) ); + Hooks::run( 'SpecialPageBeforeFormDisplay', array( $this->getName(), &$form ) ); return $form; } -- cgit v1.2.3-54-g00ecf