Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | // Hooks |
25 | 25 | $wgAutoloadClasses['MarkAsHelpfulHooks'] = dirname(__FILE__).'/MarkAsHelpful.hooks.php'; |
26 | 26 | $wgHooks['BeforePageDisplay'][] = 'MarkAsHelpfulHooks::onPageDisplay'; |
| 27 | +$wgHooks['MakeGlobalVariablesScript'][] = 'MoodBarHooks::makeGlobalVariablesScript'; |
27 | 28 | |
28 | 29 | // Special pages |
29 | 30 | |
Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.hooks.php |
— | — | @@ -26,4 +26,11 @@ |
27 | 27 | |
28 | 28 | return true; |
29 | 29 | } |
| 30 | + |
| 31 | + public static function makeGlobalVariablesScript( &$vars ) { |
| 32 | + global $wgUser; |
| 33 | + $vars['mahEditToken'] = $wgUser->editToken(); |
| 34 | + return true; |
| 35 | + } |
| 36 | + |
30 | 37 | } |
\ No newline at end of file |
Index: trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | 'page': mw.config.get( 'wgPageName' ), |
81 | 81 | 'useragent': clientData.name + '/' + clientData.versionNumber, |
82 | 82 | 'system': clientData.platform, |
83 | | - 'token': mw.config.get('mbEditToken'), |
| 83 | + 'token': mw.config.get('mahEditToken'), |
84 | 84 | 'format': 'json' |
85 | 85 | }, props ); |
86 | 86 | |