Index: trunk/extensions/ContributorsAddon/ContributorsAddonClass.php |
— | — | @@ -1,17 +1,17 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class SpecialContributorsAddon extends SpecialContributors { |
5 | | - public function getContributorsText() { |
6 | | - global $wgUser, $wgLang, $wgTitle; |
7 | | - $this->target = $wgTitle; |
| 5 | + public function getContributorsText( $title ) { |
| 6 | + global $wgUser, $wgLang; |
| 7 | + $this->target = $title; |
8 | 8 | $contribText = ''; |
9 | 9 | |
10 | 10 | if( $this->target->exists() ) { |
11 | 11 | $total = 0; |
12 | | - $skin =& $wgUser->getSkin(); |
| 12 | + $skin = $wgUser->getSkin(); |
13 | 13 | $link = $skin->makeKnownLinkObj( $this->target ); |
14 | 14 | $contribText .= '<h2>' . wfMsgHtml( 'contributors-subtitle', $link ) . '</h2>'; |
15 | | - list( $contributors, $others ) = $this->getMainContributors($wgTitle); |
| 15 | + list( $contributors, $others ) = $this->getMainContributors( $title ); |
16 | 16 | $contribText .= '<ul>'; |
17 | 17 | foreach( $contributors as $username => $info ) { |
18 | 18 | list( $id, $count ) = $info; |
Index: trunk/extensions/ContributorsAddon/ContributorsAddon.php |
— | — | @@ -17,7 +17,6 @@ |
18 | 18 | exit( 1 ); |
19 | 19 | } |
20 | 20 | |
21 | | -$wgExtensionFunctions[] = 'efContributorsAddon'; |
22 | 21 | $wgExtensionCredits['other'][] = array( |
23 | 22 | 'path' => __FILE__, |
24 | 23 | 'name' => 'ContributorsAddon', |
— | — | @@ -30,18 +29,14 @@ |
31 | 30 | $wgExtensionMessagesFiles['ContributorsAddon'] = $dir . 'ContributorsAddon.i18n.php'; |
32 | 31 | $wgAutoloadClasses['SpecialContributorsAddon'] = $dir . 'ContributorsAddonClass.php'; |
33 | 32 | |
34 | | -function efContributorsAddon() { |
35 | | - global $wgHooks; |
36 | | - $wgHooks['OutputPageParserOutput'][] = 'efContributorsAddonSetup'; |
37 | | - return true; |
38 | | -} |
| 33 | +$wgHooks['OutputPageParserOutput'][] = 'efContributorsAddonSetup'; |
39 | 34 | |
40 | | -function efContributorsAddonSetup(&$out, $parseroutput) { |
| 35 | +function efContributorsAddonSetup( &$out, $parseroutput ) { |
41 | 36 | global $wgScriptPath; |
42 | 37 | $out->addScript( '<link rel="stylesheet" type="text/css" href="' . $wgScriptPath . '/extensions/ContributorsAddon/ContributorsAddon.css" />' ); |
43 | 38 | $out->addScript( '<script type="text/javascript" src="' . $wgScriptPath . '/extensions/ContributorsAddon/ContributorsAddon.js"><!-- ContributorsAddon js --></script>' ); |
44 | 39 | $spContribAddon = new SpecialContributorsAddon; |
45 | | - $out->addScript( "\n<script type=\"text/javascript\">\nvar contributorsText = \"". $spContribAddon->getContributorsText() . "\";\n</script>\n" ); |
| 40 | + $out->addScript( "\n<script type=\"text/javascript\">\nvar contributorsText = \"". $spContribAddon->getContributorsText( $out->getTitle() ) . "\";\n</script>\n" ); |
46 | 41 | return true; |
47 | 42 | } |
48 | 43 | |