This commit is contained in:
Cyberes 2020-10-24 19:10:53 -06:00
parent 1244b00cf8
commit 980b19591b
3 changed files with 69 additions and 52 deletions

View File

@ -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"
}
}

View File

@ -0,0 +1,8 @@
<?php
class ContactPageHooks
{
public static function onBeforePageDisplay(OutputPage $out, Skin $skin)
{
$out->addScriptFile('https://www.google.com/recaptcha/api.js');
}
}

View File

@ -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(