Index: trunk/extensions/DeletedContributions/SpecialDeletedContributions.php |
— | — | @@ -15,10 +15,11 @@ |
16 | 16 | |
17 | 17 | # Internationalisation |
18 | 18 | $wgExtensionMessagesFiles['DeletedContributions'] = dirname(__FILE__) . '/DeletedContributions.i18n.php'; |
19 | | -$wgExtensionFunctions[] = 'efLoadDeletedContribsMessages'; |
| 19 | +$wgExtensionFunctions[] = 'efLoadDeletedContribs'; |
20 | 20 | |
21 | 21 | global $wgHooks; |
22 | 22 | $wgHooks['ContributionsToolLinks'][] = 'wfLoadContribsLink'; |
| 23 | +$wgHooks['SpecialPageExecuteBeforeHeader'][] = 'wfDeletedContributionsMessages'; |
23 | 24 | |
24 | 25 | /** |
25 | 26 | * Add a "Deleted contributions" link to Special:Contributions for sysops. |
— | — | @@ -26,6 +27,8 @@ |
27 | 28 | function wfLoadContribsLink( $id, $nt, &$links ) { |
28 | 29 | global $wgUser; |
29 | 30 | if( $wgUser->isAllowed( 'deletedhistory' ) ) { |
| 31 | + wfLoadExtensionMessages( 'DeletedContributions' ); |
| 32 | + |
30 | 33 | $links[] = $wgUser->getSkin()->makeKnownLinkObj( |
31 | 34 | SpecialPage::getTitleFor( 'DeletedContributions', $nt->getDBkey() ), |
32 | 35 | wfMsgHtml( 'deletedcontributions' ) |
— | — | @@ -34,9 +37,17 @@ |
35 | 38 | return true; |
36 | 39 | } |
37 | 40 | |
38 | | -function efLoadDeletedContribsMessages() { |
| 41 | +function wfDeletedContributionsMessages( $specialpage, $par, $func ) { |
| 42 | + if( $specialpage->name() == 'DeletedContributions' ) { |
| 43 | + wfLoadExtensionMessages( 'DeletedContributions' ); |
| 44 | + $specialpage->setHeaders(); // set again so that it actually has the fucking message |
| 45 | + } |
| 46 | + return true; |
| 47 | +} |
| 48 | + |
| 49 | +# Load once IndexPager and stuff is loaded |
| 50 | +function efLoadDeletedContribs() { |
39 | 51 | require( dirname( __FILE__ ) . '/DeletedContributions_body.php' ); |
40 | | - wfLoadExtensionMessages( 'DeletedContributions' ); |
41 | 52 | } |
42 | 53 | |
43 | 54 | $wgSpecialPages['DeletedContributions'] = array( 'SpecialPage', 'DeletedContributions', 'deletedhistory', |