Index: trunk/extensions/AJAXPoll/AJAXPoll.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * @author Jack Phoenix <jack@countervandalism.net> |
21 | 21 | * @author Thomas Gries |
22 | 22 | * @maintainer Thomas Gries |
23 | | - * @version 1.603 |
| 23 | + * @version 1.61 |
24 | 24 | * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation |
25 | 25 | */ |
26 | 26 | |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | $wgExtensionCredits['parserhook'][] = array( |
33 | 33 | 'path' => __FILE__, |
34 | 34 | 'name' => 'AJAX Poll', |
35 | | - 'version' => '1.604 20120222', |
| 35 | + 'version' => '1.61 20120309', |
36 | 36 | 'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ), |
37 | 37 | 'descriptionmsg' => 'ajaxpoll-desc', |
38 | 38 | 'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll', |
— | — | @@ -43,3 +43,16 @@ |
44 | 44 | $wgAutoloadClasses['AJAXPoll'] = $dir . 'AJAXPoll_body.php'; |
45 | 45 | $wgAjaxExportList[] = 'AJAXPoll::submitVote'; |
46 | 46 | $wgHooks['ParserFirstCallInit'][] = 'AJAXPoll::AJAXPollParserInit'; |
| 47 | + |
| 48 | +// Parameter to enable the automatic tracking category |
| 49 | +// for all pages using this parser extension |
| 50 | +// |
| 51 | +// Category name [[MediaWiki:Ajaxpoll-tracking-category]] (default) |
| 52 | +// $wgAJAXPollTrackingCategory = true; |
| 53 | +// |
| 54 | +// you can assign a specific category name [[MediaWiki:Ajaxpoll-mycategory]] |
| 55 | +// $wgAJAXPollTrackingCategory = 'ajaxpoll-mycategory'; |
| 56 | +// |
| 57 | +// you can disable the use of a tracking category |
| 58 | +// $wgAJAXPollTrackingCategory = false; |
| 59 | +$wgAJAXPollTrackingCategory = true; |
Index: trunk/extensions/AJAXPoll/AJAXPoll_body.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * @author Jack Phoenix <jack@countervandalism.net> |
12 | 12 | * @author Thomas Gries |
13 | 13 | * @maintainer Thomas Gries |
14 | | - * @version 1.603 |
| 14 | + * @version 1.61 |
15 | 15 | * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation |
16 | 16 | */ |
17 | 17 | |
— | — | @@ -29,10 +29,17 @@ |
30 | 30 | |
31 | 31 | # The callback function for converting the input text to HTML output |
32 | 32 | static function AJAXPollRender( $input ) { |
33 | | - global $wgParser, $wgUser, $wgOut, $wgTitle, $wgScriptPath; |
| 33 | + global $wgParser, $wgUser, $wgOut, $wgTitle, $wgScriptPath, |
| 34 | + $wgAJAXPollTrackingCategory; |
34 | 35 | |
35 | 36 | $wgParser->disableCache(); |
36 | 37 | |
| 38 | + if ( $wgAJAXPollTrackingCategory === true ) { |
| 39 | + $wgParser->addTrackingCategory( 'ajaxpoll-tracking-category' ); |
| 40 | + } elseif ( is_string( $wgAJAXPollTrackingCategory ) ) { |
| 41 | + $wgParser->addTrackingCategory( $wgAJAXPollTrackingCategory ); |
| 42 | + } |
| 43 | + |
37 | 44 | if ( $wgUser->getName() == '' ) { |
38 | 45 | $user = wfGetIP(); |
39 | 46 | } else { |
— | — | @@ -53,7 +60,7 @@ |
54 | 61 | }*/ |
55 | 62 | |
56 | 63 | $dbw = wfGetDB( DB_MASTER ); |
57 | | - $dbw->begin( __METHOD__ ); |
| 64 | + $dbw->begin(); |
58 | 65 | /** |
59 | 66 | * Register poll in the database |
60 | 67 | */ |
— | — | @@ -76,7 +83,7 @@ |
77 | 84 | __METHOD__ |
78 | 85 | ); |
79 | 86 | } |
80 | | - $dbw->commit( __METHOD__ ); |
| 87 | + $dbw->commit(); |
81 | 88 | |
82 | 89 | // Add CSS |
83 | 90 | $wgOut->addExtensionStyle( $wgScriptPath . '/extensions/AJAXPoll/AJAXPoll.css' ); |
Index: trunk/extensions/AJAXPoll/AJAXPoll.i18n.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | */ |
15 | 15 | $messages['en'] = array( |
16 | 16 | 'ajaxpoll-desc' => 'Allows AJAX-based polls with <tt><poll></tt> tag', |
| 17 | + 'ajaxpoll-tracking-category' => 'Poll', |
17 | 18 | 'ajaxpoll-vote-update' => 'Your vote has been updated.', |
18 | 19 | 'ajaxpoll-vote-add' => 'Your vote has been added.', |
19 | 20 | 'ajaxpoll-vote-error' => 'There was a problem with processing your vote, please try again.', |
— | — | @@ -25,6 +26,7 @@ |
26 | 27 | |
27 | 28 | /** Message documentation (Message documentation) */ |
28 | 29 | $messages['qqq'] = array( |
| 30 | + 'ajaxpoll-tracking-category' => 'The name of a category for all pages which use the <poll> parser extension tag. The category is automatically added unless the feature is disabled.', |
29 | 31 | 'ajaxpoll-percent-votes' => '$1 is the percentage number of the votes', |
30 | 32 | 'ajaxpoll-your-vote' => '$1 is the answer name, $2 is the date when the answer was casted', |
31 | 33 | 'ajaxpoll-info' => '$1 is the number of votes, $2 is when the poll was started', |