Index: trunk/extensions/content_action.php |
— | — | @@ -16,10 +16,11 @@ |
17 | 17 | function wfAddaction() { |
18 | 18 | global $wgHooks, $wgMessageCache; |
19 | 19 | $wgMessageCache->addMessage( 'myact', 'My action' ); |
20 | | - $wgHooks['SkinTemplateContentActions'][] = 'wfAddactionHook'; |
| 20 | + $wgHooks['SkinTemplateContentActions'][] = 'wfAddactionContentHook'; |
| 21 | + $wgHooks['UnknownAction'][] = 'wfAddactActionHook'; |
21 | 22 | } |
22 | 23 | |
23 | | -function wfAddActionHook( &$content_actions ) { |
| 24 | +function wfAddActionContentHook( &$content_actions ) { |
24 | 25 | global $wgRequest, $wgRequest, $wgTitle; |
25 | 26 | |
26 | 27 | $action = $wgRequest->getText( 'action' ); |
— | — | @@ -32,3 +33,12 @@ |
33 | 34 | ); |
34 | 35 | } |
35 | 36 | } |
| 37 | + |
| 38 | +function wfAddactActionHook( $action, &$wgArticle ) { |
| 39 | + global $wgOut; |
| 40 | + |
| 41 | + $title = $wgArticle->getTitle(); |
| 42 | + |
| 43 | + if ($action == 'myact') |
| 44 | + $wgOut->addHTML( 'The page name is ' . $title->getText() . ' and you are ' . $wgArticle->getUserText() ); |
| 45 | +} |