2007-02-12 14:50:29 -07:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Setup for ContactPage extension, a special page that implements a contact form
|
|
|
|
* for use by anonymous visitors.
|
|
|
|
*
|
2009-01-11 05:16:13 -07:00
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
2007-02-12 14:50:29 -07:00
|
|
|
* @author Daniel Kinzler, brightbyte.de
|
2014-02-17 16:16:48 -07:00
|
|
|
* @copyright © 2007-2014 Daniel Kinzler, Sam Reed
|
2007-02-12 14:50:29 -07:00
|
|
|
* @licence GNU General Public Licence 2.0 or later
|
|
|
|
*/
|
|
|
|
|
2007-02-13 15:33:42 -07:00
|
|
|
if( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
|
|
|
|
die( 1 );
|
|
|
|
}
|
|
|
|
|
2015-03-02 19:51:39 -07:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2010-01-04 17:43:27 -07:00
|
|
|
// Extension credits that will show up on Special:Version
|
2008-02-03 07:37:27 -07:00
|
|
|
$wgExtensionCredits['specialpage'][] = array(
|
2009-04-26 21:15:19 -06:00
|
|
|
'path' => __FILE__,
|
2008-02-03 07:37:27 -07:00
|
|
|
'name' => 'ContactPage',
|
2014-02-17 16:16:48 -07:00
|
|
|
'author' => array( 'Daniel Kinzler', 'Sam Reed' ),
|
2011-12-13 16:49:33 -07:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:ContactPage',
|
2008-02-03 07:37:27 -07:00
|
|
|
'descriptionmsg' => 'contactpage-desc',
|
2015-02-01 15:14:50 -07:00
|
|
|
'version' => 2.2,
|
|
|
|
'license-name' => 'GPL-2.0+'
|
2007-02-12 14:50:29 -07:00
|
|
|
);
|
|
|
|
|
2010-01-04 17:43:27 -07:00
|
|
|
// Set up the new special page
|
2014-01-28 20:31:19 -07:00
|
|
|
$dir = __DIR__ . '/';
|
2014-03-26 05:56:54 -06:00
|
|
|
$wgMessagesDirs['ContactPage'] = __DIR__ . '/i18n';
|
2008-02-03 07:37:27 -07:00
|
|
|
$wgExtensionMessagesFiles['ContactPage'] = $dir . 'ContactPage.i18n.php';
|
2011-12-18 03:27:44 -07:00
|
|
|
$wgExtensionMessagesFiles['ContactPageAliases'] = $dir . 'ContactPage.alias.php';
|
2008-07-09 11:40:14 -06:00
|
|
|
|
2012-01-19 17:35:25 -07:00
|
|
|
$wgAutoloadClasses['SpecialContact'] = $dir . 'ContactPage_body.php';
|
2007-02-12 14:50:29 -07:00
|
|
|
$wgSpecialPages['Contact'] = 'SpecialContact';
|
|
|
|
|
2014-02-17 16:16:48 -07:00
|
|
|
/**
|
|
|
|
* Set all fields if adding additional contact forms.
|
|
|
|
*
|
|
|
|
* If an array key with the form type name isn't set,
|
|
|
|
* defaults will be used.
|
|
|
|
*
|
|
|
|
* Array key should be lowercase.
|
|
|
|
*
|
|
|
|
* @code
|
|
|
|
* $wgContactConfig['formname'] = array(
|
|
|
|
* 'RecipientUser' => 'WikiUser',
|
|
|
|
* 'SenderEmail' => 'user@email.com',
|
|
|
|
* 'SenderName' => 'User Email',
|
|
|
|
* 'RequireDetails' => true,
|
|
|
|
* 'IncludeIP' => true,
|
2014-02-19 15:14:19 -07:00
|
|
|
* 'AdditionalFields' => array(),
|
2014-02-17 16:16:48 -07:00
|
|
|
* );
|
|
|
|
* @endcode
|
|
|
|
*/
|
|
|
|
$wgContactConfig['default'] = array(
|
|
|
|
// Username of a registered wiki user who will receive the mails
|
|
|
|
'RecipientUser' => null,
|
|
|
|
|
|
|
|
// Email address used as the sender of the contact email, if the visitor does
|
|
|
|
// not supply an email address. Defaults to $wgPasswordSender.
|
|
|
|
'SenderEmail' => null,
|
2010-01-04 17:43:27 -07:00
|
|
|
|
2014-02-27 13:41:08 -07:00
|
|
|
// The name to be used with SenderEmail.
|
2014-02-17 16:16:48 -07:00
|
|
|
// This will be shown in the recipient's email program
|
2015-03-02 19:51:39 -07:00
|
|
|
// Defaults to "Contact Form on $wgSitename"
|
2014-02-17 16:16:48 -07:00
|
|
|
'SenderName' => 'Contact Form on ' . $wgSitename,
|
2008-07-05 15:20:32 -06:00
|
|
|
|
2014-02-17 16:16:48 -07:00
|
|
|
// If true, users will be required to supply a name and an email address
|
|
|
|
// on Special:Contact.
|
|
|
|
'RequireDetails' => false,
|
2010-03-10 10:01:38 -07:00
|
|
|
|
2014-02-17 16:16:48 -07:00
|
|
|
// If true, the form will include a checkbox offering to put the IP
|
|
|
|
// address of the submitter in the subject line
|
|
|
|
'IncludeIP' => false,
|
2014-02-19 15:14:19 -07:00
|
|
|
|
2015-04-30 08:42:16 -06:00
|
|
|
// Display format for the form. See HTMLForm documentation for available
|
|
|
|
// values.
|
|
|
|
'DisplayFormat' => 'table',
|
|
|
|
|
2015-04-30 13:56:41 -06:00
|
|
|
// Resource loader modules to add to the form display page.
|
|
|
|
'RLModules' => array(),
|
|
|
|
|
|
|
|
// Resource loader CSS modules to add to the form display page.
|
|
|
|
'RLStyleModules' => array(),
|
|
|
|
|
2014-02-19 15:14:19 -07:00
|
|
|
// Any additional fields to display on the contact form.
|
|
|
|
// Uses https://www.mediawiki.org/wiki/HTMLForm notation
|
|
|
|
// Using any of your own "AdditionalFields" will replce the large text box
|
|
|
|
// Copy the code below into your own config if still wanted
|
|
|
|
//
|
|
|
|
// 'type' => 'selectandother' currently isn't supported.
|
|
|
|
'AdditionalFields' => array(
|
|
|
|
'Text' => array(
|
|
|
|
'label-message' => 'emailmessage',
|
|
|
|
'type' => 'textarea',
|
|
|
|
'rows' => 20,
|
|
|
|
'cols' => 80,
|
|
|
|
'required' => true,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|