Index: trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | $wgExtensionCredits['parserhook'][] = array( |
21 | 21 | 'path' => __FILE__, |
22 | 22 | 'name' => 'WikiTextLoggedInOut', |
23 | | - 'version' => '1.1', |
| 23 | + 'version' => '1.2', |
24 | 24 | 'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ), |
25 | 25 | 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut', |
26 | 26 | 'descriptionmsg' => 'wikitextloggedinout-desc' |
— | — | @@ -28,35 +28,30 @@ |
29 | 29 | $dir = dirname( __FILE__ ) . '/'; |
30 | 30 | $wgExtensionMessagesFiles['WikiTextLoginInOut'] = $dir . 'WikiTextLoggedInOut.i18n.php'; |
31 | 31 | |
32 | | -$wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedIn'; |
33 | | -function wfWikiTextLoggedIn( &$parser ) { |
| 32 | +$wgHooks['ParserFirstCallInit'][] = 'efWikiTextLoggedInOut'; |
| 33 | +function efWikiTextLoggedIn( &$parser ) { |
34 | 34 | $parser->setHook( 'loggedin', 'OutputLoggedInText' ); |
| 35 | + $parser->setHook( 'loggedout', 'OutputLoggedOutText' ); |
35 | 36 | return true; |
36 | 37 | } |
37 | 38 | |
38 | | -function OutputLoggedInText( $input, $args, $parser ) { |
| 39 | +function OutputLoggedInText( $input, $args, $parser, $frame ) { |
39 | 40 | global $wgUser; |
40 | 41 | |
41 | 42 | if( $wgUser->isLoggedIn() ) { |
42 | | - return $parser->recursiveTagParse( $input ); |
| 43 | + return $parser->recursiveTagParse( $input, $frame ); |
43 | 44 | } |
44 | 45 | |
45 | 46 | return ''; |
46 | 47 | } |
47 | 48 | |
48 | | -$wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedOut'; |
49 | | - |
50 | | -function wfWikiTextLoggedOut( &$parser ) { |
51 | | - $parser->setHook( 'loggedout', 'OutputLoggedOutText' ); |
52 | | - return true; |
53 | | -} |
54 | | - |
55 | | -function OutputLoggedOutText( $input, $args, $parser ) { |
| 49 | +function OutputLoggedOutText( $input, $args, $parser, $frame ) { |
56 | 50 | global $wgUser; |
57 | 51 | |
58 | 52 | if( !$wgUser->isLoggedIn() ) { |
59 | | - return $parser->recursiveTagParse( $input ); |
| 53 | + return $parser->recursiveTagParse( $input, $frame ); |
60 | 54 | } |
61 | 55 | |
62 | 56 | return ''; |
63 | 57 | } |
| 58 | + |