Allow selection of HTMLForm display format
Add a 'DisplayFormat' configuration value that tells HTMLForm which output styling should be used. This can be used for example to change the form to the 'vform' style which uses the Mediawiki.ui css styles. Change-Id: I04d2959b80a44e31f1e04324b26e6dff5ea5b4a6
This commit is contained in:
parent
11f4950bd4
commit
c6913cee66
|
@ -80,6 +80,10 @@ $wgContactConfig['default'] = array(
|
|||
// address of the submitter in the subject line
|
||||
'IncludeIP' => false,
|
||||
|
||||
// Display format for the form. See HTMLForm documentation for available
|
||||
// values.
|
||||
'DisplayFormat' => 'table',
|
||||
|
||||
// Any additional fields to display on the contact form.
|
||||
// Uses https://www.mediawiki.org/wiki/HTMLForm notation
|
||||
// Using any of your own "AdditionalFields" will replce the large text box
|
||||
|
|
|
@ -201,7 +201,9 @@ class SpecialContact extends UnlistedSpecialPage {
|
|||
);
|
||||
}
|
||||
|
||||
$form = new HTMLForm( $formItems, $this->getContext(), "contactpage-{$this->formType}" );
|
||||
$form = HTMLForm::factory( $config['DisplayFormat'],
|
||||
$formItems, $this->getContext(), "contactpage-{$this->formType}"
|
||||
);
|
||||
$form->setWrapperLegendMsg( 'contactpage-legend' );
|
||||
$form->setSubmitTextMsg( 'emailsend' );
|
||||
if ( $this->formType != '' ) {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
"SenderName": null,
|
||||
"RequireDetails": false,
|
||||
"IncludeIP": false,
|
||||
"DisplayFormat": "table",
|
||||
"AdditionalFields": {
|
||||
"Text": {
|
||||
"label-message": "emailmessage",
|
||||
|
|
Loading…
Reference in New Issue