Index: trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php |
— | — | @@ -5,38 +5,44 @@ |
6 | 6 | * that will display different output depending if the user |
7 | 7 | * is logged in or not. |
8 | 8 | * |
9 | | - * @author Wikia, Inc. |
| 9 | + * @file |
| 10 | + * @ingroup Extensions |
| 11 | + * @author Aaron Wright |
| 12 | + * @author David Pean |
| 13 | + * @author Jack Phoenix <jack@countervandalism.net> |
10 | 14 | * @version 1.0 |
11 | | - * @link http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut |
| 15 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 16 | + * @link http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut Documentation |
12 | 17 | */ |
13 | 18 | |
14 | | -$wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedIn'; |
15 | | -$dir = dirname(__FILE__) . '/'; |
16 | | -$wgExtensionMessagesFiles['WikiTextLoginInOut'] = $dir . 'WikiTextLoggedInOut.i18n.php'; |
17 | | - |
| 19 | +// Extension credits that will show up on Special:Version |
18 | 20 | $wgExtensionCredits['parserhook'][] = array( |
19 | 21 | 'path' => __FILE__, |
20 | 22 | 'name' => 'WikiTextLoggedInOut', |
21 | | - 'version' => '1.0', |
22 | | - 'author' => 'Wikia New York Team', |
| 23 | + 'version' => '1.1', |
| 24 | + 'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ), |
23 | 25 | 'description' => 'Two parser hooks, <tt><loggedin></tt> and <tt><loggedout></tt> to show different text depending on the users\' login state', |
24 | 26 | 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut', |
25 | 27 | 'descriptionmsg' => 'wikitextloggedinout-desc' |
26 | 28 | ); |
27 | 29 | |
| 30 | +$dir = dirname( __FILE__ ) . '/'; |
| 31 | +$wgExtensionMessagesFiles['WikiTextLoginInOut'] = $dir . 'WikiTextLoggedInOut.i18n.php'; |
| 32 | + |
| 33 | +$wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedIn'; |
28 | 34 | function wfWikiTextLoggedIn( &$parser ) { |
29 | 35 | $parser->setHook( 'loggedin', 'OutputLoggedInText' ); |
30 | 36 | return true; |
31 | 37 | } |
32 | 38 | |
33 | | -function OutputLoggedInText( $input, $args, &$parser ) { |
34 | | - global $wgUser, $wgOut; |
| 39 | +function OutputLoggedInText( $input, $args, $parser ) { |
| 40 | + global $wgUser; |
35 | 41 | |
36 | | - if( $wgUser->isLoggedIn() ){ |
37 | | - return $parser->recursiveTagParse($input); |
| 42 | + if( $wgUser->isLoggedIn() ) { |
| 43 | + return $parser->recursiveTagParse( $input ); |
38 | 44 | } |
39 | 45 | |
40 | | - return ""; |
| 46 | + return ''; |
41 | 47 | } |
42 | 48 | |
43 | 49 | $wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedOut'; |
— | — | @@ -46,12 +52,12 @@ |
47 | 53 | return true; |
48 | 54 | } |
49 | 55 | |
50 | | -function OutputLoggedOutText( $input, $args, &$parser ) { |
51 | | - global $wgUser, $wgOut; |
| 56 | +function OutputLoggedOutText( $input, $args, $parser ) { |
| 57 | + global $wgUser; |
52 | 58 | |
53 | | - if( !$wgUser->isLoggedIn() ){ |
54 | | - return $parser->recursiveTagParse($input); |
| 59 | + if( !$wgUser->isLoggedIn() ) { |
| 60 | + return $parser->recursiveTagParse( $input ); |
55 | 61 | } |
56 | 62 | |
57 | | - return ""; |
| 63 | + return ''; |
58 | 64 | } |
Index: trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.i18n.php |
— | — | @@ -1,8 +1,14 @@ |
2 | 2 | <?php |
3 | | -#Internationalization file fo Wiki Text Logged In Out extenstion |
| 3 | +/** |
| 4 | + * Internationalization file for WikiTextLoggedInOut extension. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + */ |
4 | 9 | |
5 | 10 | $messages = array(); |
6 | 11 | |
| 12 | +/** English */ |
7 | 13 | $messages['en'] = array( |
8 | 14 | 'wikitextloggedinout-desc' => 'Two parser hooks, <tt><loggedin></tt> and <tt><loggedout></tt> to show different text depending on the users\' login state', |
9 | 15 | ); |