jenkins-bot has submitted this change and it was merged. Change subject: Add extension.json ......................................................................
Add extension.json Bug: T87901 Change-Id: Iba8dccbf5ec5b303610c89bb82ff13d86dc5883a --- M ContactPage.php M ContactPage_body.php A extension.json 3 files changed, 63 insertions(+), 0 deletions(-) Approvals: Alex Monk: Looks good to me, approved jenkins-bot: Verified diff --git a/ContactPage.php b/ContactPage.php index ebbe44a..e2ae761 100644 --- a/ContactPage.php +++ b/ContactPage.php @@ -15,6 +15,11 @@ die( 1 ); } +/** + * This PHP entry point is deprecated. Please use wfLoadExtension() and the extension.json file instead. + * See https://www.mediawiki.org/wiki/Manual:Extension_registration for more details. + */ + // Extension credits that will show up on Special:Version $wgExtensionCredits['specialpage'][] = array( 'path' => __FILE__, @@ -64,6 +69,7 @@ // The name to be used with SenderEmail. // This will be shown in the recipient's email program + // Defaults to "Contact Form on $wgSitename" 'SenderName' => 'Contact Form on ' . $wgSitename, // If true, users will be required to supply a name and an email address diff --git a/ContactPage_body.php b/ContactPage_body.php index 492174a..3931395 100644 --- a/ContactPage_body.php +++ b/ContactPage_body.php @@ -15,6 +15,16 @@ * @ingroup SpecialPage */ class SpecialContact extends UnlistedSpecialPage { + + /** + * Set default value after registration + */ + public static function onRegistration() { + global $wgContactConfig, $wgSitename; + if ( $wgContactConfig['default']['SenderName'] === null ) { + $wgContactConfig['default']['SenderName'] = "Contact Form on $wgSitename"; + } + } /** * Constructor */ diff --git a/extension.json b/extension.json new file mode 100644 index 0000000..cc3c58a --- /dev/null +++ b/extension.json @@ -0,0 +1,47 @@ +{ + "name": "ContactPage", + "version": 2.2, + "author": [ + "Daniel Kinzler", + "Sam Reed" + ], + "url": "https://www.mediawiki.org/wiki/Extension:ContactPage", + "descriptionmsg": "contactpage-desc", + "license-name": "GPL-2.0+", + "type": "specialpage", + "ExtensionMessagesFiles": { + "ContactPageAliases": "ContactPage.alias.php" + }, + "MessagesDirs": { + "ContactPage": [ + "i18n" + ] + }, + "config": { + "ContactConfig": { + "default": { + "RecipientUser": null, + "SenderEmail": null, + "SenderName": null, + "RequireDetails": false, + "IncludeIP": false, + "AdditionalFields": { + "Text": { + "label-message": "emailmessage", + "type": "textarea", + "rows": 20, + "cols": 80, + "required": true + } + } + } + } + }, + "callback": "SpecialContact::onRegistration", + "SpecialPages": { + "Contact": "SpecialContact" + }, + "AutoloadClasses": { + "SpecialContact": "ContactPage_body.php" + } +} -- To view, visit https://gerrit.wikimedia.org/r/194031 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba8dccbf5ec5b303610c89bb82ff13d86dc5883a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContactPage Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Alex Monk <kren...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits