This commit is contained in:
parent
1244b00cf8
commit
980b19591b
105
extension.json
105
extension.json
|
@ -1,53 +1,56 @@
|
|||
{
|
||||
"name": "ContactPage",
|
||||
"version": "2.3",
|
||||
"author": [
|
||||
"Daniel Kinzler",
|
||||
"Sam Reed"
|
||||
],
|
||||
"url": "https://www.mediawiki.org/wiki/Extension:ContactPage",
|
||||
"descriptionmsg": "contactpage-desc",
|
||||
"license-name": "GPL-2.0-or-later",
|
||||
"type": "specialpage",
|
||||
"ExtensionMessagesFiles": {
|
||||
"ContactPageAliases": "ContactPage.alias.php"
|
||||
},
|
||||
"MessagesDirs": {
|
||||
"ContactPage": [
|
||||
"i18n"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"ContactConfig": {
|
||||
"value": {
|
||||
"default": {
|
||||
"RecipientUser": null,
|
||||
"SenderEmail": null,
|
||||
"SenderName": null,
|
||||
"RequireDetails": false,
|
||||
"IncludeIP": false,
|
||||
"MustBeLoggedIn": false,
|
||||
"RLModules": [],
|
||||
"RLStyleModules": [],
|
||||
"AdditionalFields": {
|
||||
"Text": {
|
||||
"label-message": "emailmessage",
|
||||
"type": "textarea",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"SpecialPages": {
|
||||
"Contact": "SpecialContact"
|
||||
},
|
||||
"AutoloadClasses": {
|
||||
"SpecialContact": "includes/SpecialContact.php"
|
||||
},
|
||||
"manifest_version": 2,
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.29.0"
|
||||
}
|
||||
"name": "ContactPage",
|
||||
"version": "2.3",
|
||||
"author": [
|
||||
"Daniel Kinzler",
|
||||
"Sam Reed"
|
||||
],
|
||||
"url": "https://www.mediawiki.org/wiki/Extension:ContactPage",
|
||||
"descriptionmsg": "contactpage-desc",
|
||||
"license-name": "GPL-2.0-or-later",
|
||||
"type": "specialpage",
|
||||
"ExtensionMessagesFiles": {
|
||||
"ContactPageAliases": "ContactPage.alias.php"
|
||||
},
|
||||
"MessagesDirs": {
|
||||
"ContactPage": [
|
||||
"i18n"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"ContactConfig": {
|
||||
"value": {
|
||||
"default": {
|
||||
"RecipientUser": null,
|
||||
"SenderEmail": null,
|
||||
"SenderName": null,
|
||||
"RequireDetails": false,
|
||||
"IncludeIP": false,
|
||||
"MustBeLoggedIn": false,
|
||||
"RLModules": [],
|
||||
"RLStyleModules": [],
|
||||
"AdditionalFields": {
|
||||
"Text": {
|
||||
"label-message": "emailmessage",
|
||||
"type": "textarea",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"SpecialPages": {
|
||||
"Contact": "SpecialContact"
|
||||
},
|
||||
"AutoloadClasses": {
|
||||
"SpecialContact": "includes/SpecialContact.php"
|
||||
},
|
||||
"manifest_version": 2,
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.29.0"
|
||||
},
|
||||
"Hooks": {
|
||||
"BeforePageDisplay": "ContactPageHooks::onBeforePageDisplay"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
class ContactPageHooks
|
||||
{
|
||||
public static function onBeforePageDisplay(OutputPage $out, Skin $skin)
|
||||
{
|
||||
$out->addScriptFile('https://www.google.com/recaptcha/api.js');
|
||||
}
|
||||
}
|
|
@ -178,7 +178,13 @@ class SpecialContact extends UnlistedSpecialPage
|
|||
'class' => 'HTMLHiddenField',
|
||||
'label' => 'Type',
|
||||
'default' => $this->formType,
|
||||
]
|
||||
],
|
||||
'Captcha' => [
|
||||
'type' => 'info',
|
||||
'label' => 'info',
|
||||
'default' => "<div class=\"g-recaptcha\" data-sitekey=\"{$wgReCaptchaSiteKey}\"></div>",
|
||||
'raw' => true,
|
||||
],
|
||||
];
|
||||
|
||||
$form = HTMLForm::factory(
|
||||
|
|
Loading…
Reference in New Issue