r114166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114165‎ | r114166 | r114167 >
Date:18:45, 19 March 2012
Author:wikinaut
Status:new (Comments)
Tags:
Comment:
removed the redundant code for handling tracking categories. By using '-' for the message text ajaxpoll-tracking-category , this can be disabled easily.
Modified paths:
  • /trunk/extensions/AJAXPoll/AJAXPoll.php (modified) (history)
  • /trunk/extensions/AJAXPoll/AJAXPoll_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AJAXPoll/AJAXPoll_body.php
@@ -30,17 +30,11 @@
3131
3232 # The callback function for converting the input text to HTML output
3333 static function AJAXPollRender( $input, $params = array(), Parser $parser ) {
34 - global $wgUser, $wgOut, $wgTitle, $wgScriptPath, $wgUseAjax,
35 - $wgAJAXPollTrackingCategory;
 34+ global $wgUser, $wgOut, $wgTitle, $wgScriptPath, $wgUseAjax;
3635
3736 $parser->disableCache();
 37+ $parser->addTrackingCategory( 'ajaxpoll-tracking-category' );
3838
39 - if ( $wgAJAXPollTrackingCategory === true ) {
40 - $parser->addTrackingCategory( 'ajaxpoll-tracking-category' );
41 - } elseif ( is_string( $wgAJAXPollTrackingCategory ) ) {
42 - $parser->addTrackingCategory( $wgAJAXPollTrackingCategory );
43 - }
44 -
4539 if ( $wgUser->getName() == '' ) {
4640 $user = wfGetIP();
4741 } else {
Index: trunk/extensions/AJAXPoll/AJAXPoll.php
@@ -19,7 +19,7 @@
2020 * @author Jack Phoenix <jack@countervandalism.net>
2121 * @author Thomas Gries
2222 * @maintainer Thomas Gries
23 - * @version 1.77
 23+ * @version 1.78
2424 * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation
2525 */
2626
@@ -31,7 +31,7 @@
3232 $wgExtensionCredits['parserhook'][] = array(
3333 'path' => __FILE__,
3434 'name' => 'AJAX Poll',
35 - 'version' => '1.77 20120318',
 35+ 'version' => '1.78 20120319',
3636 'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ),
3737 'descriptionmsg' => 'ajaxpoll-desc',
3838 'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll',
@@ -70,16 +70,3 @@
7171 # in your LocalSettings.php after calling the AJAXPoll extension:
7272 # $wgGroupPermissions['*']['ajaxpoll-vote'] = false;
7373 # $wgGroupPermissions['user']['ajaxpoll-vote'] = true;
74 -
75 -// Parameter to enable the automatic tracking category
76 -// for all pages using this parser extension
77 -//
78 -// Category name [[MediaWiki:Ajaxpoll-tracking-category]] (default)
79 -// $wgAJAXPollTrackingCategory = true;
80 -//
81 -// you can assign a specific category name [[MediaWiki:Ajaxpoll-mycategory]]
82 -// $wgAJAXPollTrackingCategory = 'ajaxpoll-mycategory';
83 -//
84 -// you can disable the use of a tracking category
85 -// $wgAJAXPollTrackingCategory = false;
86 -$wgAJAXPollTrackingCategory = true;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113502add tracking category feature (enabled by default). Each page using this exte...wikinaut19:23, 9 March 2012

Comments

#Comment by Jeroen De Dauw (talk | contribs)   01:21, 20 March 2012

Note that this is not equivalent: if you had $wgAJAXPollTrackingCategory = 'some category name', it will no longer work, and you won't be able to get it to work with that category.

#Comment by Wikinaut (talk | contribs)   07:06, 20 March 2012

Yes, I know, thank you. The setting was only for a very short time present in the code.

Status & tagging log