dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add Database::unionConditionPermutations()"
[lhc/web/wiklou.git]
/
includes
/
actions
/
FormAction.php
diff --git
a/includes/actions/FormAction.php
b/includes/actions/FormAction.php
index
e94a188
..
0141b9e
100644
(file)
--- a/
includes/actions/FormAction.php
+++ b/
includes/actions/FormAction.php
@@
-58,6
+58,14
@@
abstract class FormAction extends Action {
protected function alterForm( HTMLForm $form ) {
}
protected function alterForm( HTMLForm $form ) {
}
+ /**
+ * Whether the form should use OOUI
+ * @return bool
+ */
+ protected function usesOOUI() {
+ return false;
+ }
+
/**
* Get the HTMLForm to control behavior
* @return HTMLForm|null
/**
* Get the HTMLForm to control behavior
* @return HTMLForm|null
@@
-68,7
+76,11
@@
abstract class FormAction extends Action {
// Give hooks a chance to alter the form, adding extra fields or text etc
Hooks::run( 'ActionModifyFormFields', [ $this->getName(), &$this->fields, $this->page ] );
// Give hooks a chance to alter the form, adding extra fields or text etc
Hooks::run( 'ActionModifyFormFields', [ $this->getName(), &$this->fields, $this->page ] );
- $form = new HTMLForm( $this->fields, $this->getContext(), $this->getName() );
+ if ( $this->usesOOUI() ) {
+ $form = HTMLForm::factory( 'ooui', $this->fields, $this->getContext(), $this->getName() );
+ } else {
+ $form = new HTMLForm( $this->fields, $this->getContext(), $this->getName() );
+ }
$form->setSubmitCallback( [ $this, 'onSubmit' ] );
$title = $this->getTitle();
$form->setSubmitCallback( [ $this, 'onSubmit' ] );
$title = $this->getTitle();