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() ) {
+ if ( $this->getDisplayFormat() !== 'ooui' ) {
+ // No legend and wrapper by default in OOUI forms, but can be set manually
+ // from alterForm()
$form->setWrapperLegendMsg( $this->getMessagePrefix() . '-legend' );
}
* Failures here must throw subclasses of ErrorPageError.
* @param User $user
* @throws UserBlockedError
- * @return bool True
*/
protected function checkExecutePermissions( User $user ) {
$this->checkPermissions();
if ( $this->requiresWrite() ) {
$this->checkReadOnly();
}
-
- return true;
}
/**