Index: trunk/extensions/Purge/Purge.php |
— | — | @@ -16,20 +16,21 @@ |
17 | 17 | ); |
18 | 18 | |
19 | 19 | $dir = dirname( __FILE__ ) . '/'; |
20 | | -$wgHooks['SkinTemplateContentActions'][] = 'PurgeActionExtension::contentHook'; |
| 20 | +$wgHooks['SkinTemplateNavigation::Universal'][] = 'PurgeActionExtension::contentHook'; |
21 | 21 | $wgExtensionMessagesFiles['Purge'] = $dir . 'Purge.i18n.php'; |
22 | 22 | |
23 | 23 | class PurgeActionExtension{ |
24 | | - public static function contentHook( array &$content_actions ) { |
25 | | - global $wgRequest, $wgTitle, $wgUser; |
| 24 | + public static function contentHook( $skin, array &$content_actions ) { |
| 25 | + global $wgRequest, $wgUser; |
26 | 26 | |
27 | | - if ( $wgTitle->getNamespace() !== NS_SPECIAL && $wgUser->isAllowed( 'purge' ) ) { |
| 27 | + $title = $skin->getTitle(); |
| 28 | + if ( $title->getNamespace() !== NS_SPECIAL && $wgUser->isAllowed( 'purge' ) ) { |
28 | 29 | $action = $wgRequest->getText( 'action' ); |
29 | 30 | |
30 | | - $content_actions['purge'] = array( |
| 31 | + $content_actions['actions']['purge'] = array( |
31 | 32 | 'class' => $action === 'purge' ? 'selected' : false, |
32 | 33 | 'text' => wfMsg( 'purge' ), |
33 | | - 'href' => $wgTitle->getLocalUrl( 'action=purge' ) |
| 34 | + 'href' => $title->getLocalUrl( 'action=purge' ) |
34 | 35 | ); |
35 | 36 | } |
36 | 37 | |