ProtectedContactPage/ContactPage.php

58 lines
1.5 KiB
PHP
Raw Normal View History

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.
*
* @package MediaWiki
* @subpackage Extensions
* @author Daniel Kinzler, brightbyte.de
* @copyright © 2007 Daniel Kinzler
* @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 );
}
$wgExtensionCredits['specialpage'][] = array(
'name' => 'Contact',
'version' => '1.1',
'author' => 'Daniel Kinzler',
2007-02-15 08:35:27 -07:00
'url' => 'http://mediawiki.org/wiki/Extension:ContactPage',
2007-02-12 14:50:29 -07:00
'description' => 'contact form for visitors',
);
$wgAutoloadClasses['SpecialContact'] = dirname( __FILE__ ) . '/SpecialContact.php';
$wgSpecialPages['Contact'] = 'SpecialContact';
$wgHooks['LoadAllMessages'][] = 'loadContactPageI18n';
2007-02-12 14:50:29 -07:00
$wgContactUser = NULL;
$wgContactSender = 'apache@' . $wgServerName;
$wgContactSenderName = 'Contact Form on ' . $wgSitename;
/**
* load the ContactPage internationalization file
2007-02-12 14:50:29 -07:00
*/
function loadContactPageI18n() {
global $wgLang, $wgMessageCache;
static $initialized = false;
if ( $initialized ) return true;
2007-02-12 14:50:29 -07:00
$messages= array();
2007-02-12 14:50:29 -07:00
$f= dirname( __FILE__ ) . '/ContactPage.i18n.php';
include( $f );
2007-02-12 14:50:29 -07:00
$f= dirname( __FILE__ ) . '/ContactPage.i18n.' . $wgLang->getCode() . '.php';
if ( file_exists( $f ) ) include( $f );
$initialized = true;
$wgMessageCache->addMessages( $messages );
return true;
2007-02-12 14:50:29 -07:00
}