如何将HTML选择列表添加到MediaWiki ContactPage?

问题描述 投票:0回答:1

我希望通过添加以下HTML选择列表来稍微更改MediaWiki扩展名ContactPage的以下默认PHP配置的HTML输出。

这是我的LocalSettings.php文件中可用的全部默认PHP配置:

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.
);

我已经阅读了扩展名的README file,但是我不清楚如何向代码中添加如下所示的HTML选择列表:

<select name="fruit">
    <option value ="none">Nothing</option>
    <option value ="guava">Guava</option>
    <option value ="lychee">Lychee</option>
    <option value ="papaya">Papaya</option>
</select> 

作为非PHP程序员,我问,如何在PHP中包含这样的HTML选择列表?

php html output mediawiki contact-form
1个回答
1
投票

ContactForm扩展名基于MediaWikis HTMLForm系统。可以在mediawiki.org上的HTMLForm教程中找到如何利用此系统添加不同类型的字段的示例:https://www.mediawiki.org/wiki/HTMLForm

© www.soinside.com 2019 - 2024. All rights reserved.