I desire to minorly change the HTML output of the following default PHP configuration, of the MediaWiki extension ContactPage, by adding it an HTML select list.
This is the entire default PHP configuration available in my LocalSettings.php
file:
wfLoadExtension( 'ContactPage' );
$wgContactConfig['default'] = array(
'RecipientUser' => 'WikiUser', // Must be the name of a valid account which also has a verified e-mail-address added to it.
'SenderName' => 'Contact Form on ' . $wgSitename, // "Contact Form on" needs to be translated
'SenderEmail' => null, // Defaults to $wgPasswordSender, may be changed as required
'RequireDetails' => true, // Either "true" or "false" as required
'IncludeIP' => false, // Either "true" or "false" as required
'MustBeLoggedIn' => true, // Check if the user is logged in before rendering the form
'AdditionalFields' => array(
'Text' => array(
'label-message' => 'emailmessage',
'type' => 'textarea',
'rows' => 20,
'required' => true, // Either "true" or "false" as required
),
),
// Added in MW 1.26
'DisplayFormat' => 'table', // See HTMLForm documentation for available values.
'RLModules' => array(), // Resource loader modules to add to the form display page.
'RLStyleModules' => array(), // Resource loader CSS modules to add to the form display page.
);
I have read the extension's README file, but it is unclear to me how could I add an HTML select list such as the following, to the code:
<select name="fruit">
<option value ="none">Nothing</option>
<option value ="guava">Guava</option>
<option value ="lychee">Lychee</option>
<option value ="papaya">Papaya</option>
</select>
As a non PHP programmer I ask, how could one include such an HTML select list in the PHP?
The ContactForm extension is based on MediaWikis HTMLForm system.
An example of how to add different types of fields by utilizing this system, can be found in the HTMLForm tutorial on mediawiki.org here: https://www.mediawiki.org/wiki/HTMLForm