2011-10-09 18:35:17 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* AJAX Poll extension for MediaWiki
|
|
|
|
* Created by Dariusz Siedlecki, based on the work by Eric David.
|
|
|
|
* Licensed under the GFDL.
|
|
|
|
*
|
|
|
|
* <poll>
|
|
|
|
* [Option]
|
|
|
|
* Question
|
|
|
|
* Answer 1
|
|
|
|
* Answer 2
|
2012-02-16 22:55:06 +00:00
|
|
|
* Answer ...
|
2011-10-09 18:35:17 +00:00
|
|
|
* Answer n
|
|
|
|
* </poll>
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @author Dariusz Siedlecki <datrio@gmail.com>
|
|
|
|
* @author Jack Phoenix <jack@countervandalism.net>
|
2012-02-16 06:27:52 +00:00
|
|
|
* @author Thomas Gries
|
2012-02-16 22:55:06 +00:00
|
|
|
* @maintainer Thomas Gries
|
2012-03-12 18:15:01 +00:00
|
|
|
* @version 1.64
|
2011-10-09 18:35:17 +00:00
|
|
|
* @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation
|
|
|
|
*/
|
|
|
|
|
|
|
|
if( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
die( "This is not a valid entry point.\n" );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Extension credits that will show up on Special:Version
|
|
|
|
$wgExtensionCredits['parserhook'][] = array(
|
2012-02-15 07:44:34 +00:00
|
|
|
'path' => __FILE__,
|
2011-10-09 18:35:17 +00:00
|
|
|
'name' => 'AJAX Poll',
|
2012-03-12 18:15:01 +00:00
|
|
|
'version' => '1.64 20120312',
|
2012-02-17 14:57:54 +00:00
|
|
|
'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ),
|
|
|
|
'descriptionmsg' => 'ajaxpoll-desc',
|
2012-02-15 07:44:34 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll',
|
2011-10-09 18:35:17 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// Internationalization + AJAX function
|
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
|
|
|
$wgExtensionMessagesFiles['AJAXPoll'] = $dir . 'AJAXPoll.i18n.php';
|
2012-02-19 19:31:24 +00:00
|
|
|
$wgAutoloadClasses['AJAXPoll'] = $dir . 'AJAXPoll_body.php';
|
2012-02-19 17:24:15 +00:00
|
|
|
$wgAjaxExportList[] = 'AJAXPoll::submitVote';
|
|
|
|
$wgHooks['ParserFirstCallInit'][] = 'AJAXPoll::AJAXPollParserInit';
|
2012-03-09 19:23:28 +00:00
|
|
|
|
2012-03-10 09:26:52 +00:00
|
|
|
# new user rights
|
|
|
|
$wgAvailableRights[] = 'ajaxpoll-vote';
|
|
|
|
|
2012-03-12 18:15:01 +00:00
|
|
|
# default: nobody can vote
|
2012-03-10 11:36:01 +00:00
|
|
|
$wgGroupPermissions['*']['ajaxpoll-vote'] = false;
|
2012-03-12 18:15:01 +00:00
|
|
|
# allow users to vote
|
2012-03-10 09:26:52 +00:00
|
|
|
# $wgGroupPermissions['user']['ajaxpoll-vote'] = true;
|
|
|
|
|
2012-03-09 19:23:28 +00:00
|
|
|
// Parameter to enable the automatic tracking category
|
|
|
|
// for all pages using this parser extension
|
|
|
|
//
|
|
|
|
// Category name [[MediaWiki:Ajaxpoll-tracking-category]] (default)
|
|
|
|
// $wgAJAXPollTrackingCategory = true;
|
|
|
|
//
|
|
|
|
// you can assign a specific category name [[MediaWiki:Ajaxpoll-mycategory]]
|
|
|
|
// $wgAJAXPollTrackingCategory = 'ajaxpoll-mycategory';
|
|
|
|
//
|
|
|
|
// you can disable the use of a tracking category
|
|
|
|
// $wgAJAXPollTrackingCategory = false;
|
|
|
|
$wgAJAXPollTrackingCategory = true;
|