removed the redundant code for handling tracking categories. By using '-' for the message text ajaxpoll-tracking-category , this can be disabled easily.

This commit is contained in:
Thomas Gries 2012-03-19 18:45:57 +00:00
parent 7071ff5967
commit f7533800ee
Notes: Thomas Gries 2012-03-19 18:45:57 +00:00
2 changed files with 4 additions and 23 deletions

View file

@ -19,7 +19,7 @@
* @author Jack Phoenix <jack@countervandalism.net>
* @author Thomas Gries
* @maintainer Thomas Gries
* @version 1.77
* @version 1.78
* @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation
*/
@ -31,7 +31,7 @@ if( !defined( 'MEDIAWIKI' ) ) {
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'AJAX Poll',
'version' => '1.77 20120318',
'version' => '1.78 20120319',
'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ),
'descriptionmsg' => 'ajaxpoll-desc',
'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll',
@ -70,16 +70,3 @@ $wgGroupPermissions['*']['ajaxpoll-vote'] = true;
# in your LocalSettings.php after calling the AJAXPoll extension:
# $wgGroupPermissions['*']['ajaxpoll-vote'] = false;
# $wgGroupPermissions['user']['ajaxpoll-vote'] = true;
// 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;

View file

@ -30,16 +30,10 @@ class AJAXPoll {
# The callback function for converting the input text to HTML output
static function AJAXPollRender( $input, $params = array(), Parser $parser ) {
global $wgUser, $wgOut, $wgTitle, $wgScriptPath, $wgUseAjax,
$wgAJAXPollTrackingCategory;
global $wgUser, $wgOut, $wgTitle, $wgScriptPath, $wgUseAjax;
$parser->disableCache();
if ( $wgAJAXPollTrackingCategory === true ) {
$parser->addTrackingCategory( 'ajaxpoll-tracking-category' );
} elseif ( is_string( $wgAJAXPollTrackingCategory ) ) {
$parser->addTrackingCategory( $wgAJAXPollTrackingCategory );
}
$parser->addTrackingCategory( 'ajaxpoll-tracking-category' );
if ( $wgUser->getName() == '' ) {
$user = wfGetIP();