r60882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60881‎ | r60882 | r60883 >
Date:01:25, 10 January 2010
Author:ashley
Status:deferred
Tags:
Comment:
WikiTextLoggedInOut: fixes, fixes
Modified paths:
  • /trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.i18n.php (modified) (history)
  • /trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php
@@ -5,38 +5,44 @@
66 * that will display different output depending if the user
77 * is logged in or not.
88 *
9 - * @author Wikia, Inc.
 9+ * @file
 10+ * @ingroup Extensions
 11+ * @author Aaron Wright
 12+ * @author David Pean
 13+ * @author Jack Phoenix <jack@countervandalism.net>
1014 * @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
1217 */
1318
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
1820 $wgExtensionCredits['parserhook'][] = array(
1921 'path' => __FILE__,
2022 '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' ),
2325 'description' => 'Two parser hooks, <tt>&lt;loggedin&gt;</tt> and <tt>&lt;loggedout&gt;</tt> to show different text depending on the users\' login state',
2426 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut',
2527 'descriptionmsg' => 'wikitextloggedinout-desc'
2628 );
2729
 30+$dir = dirname( __FILE__ ) . '/';
 31+$wgExtensionMessagesFiles['WikiTextLoginInOut'] = $dir . 'WikiTextLoggedInOut.i18n.php';
 32+
 33+$wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedIn';
2834 function wfWikiTextLoggedIn( &$parser ) {
2935 $parser->setHook( 'loggedin', 'OutputLoggedInText' );
3036 return true;
3137 }
3238
33 -function OutputLoggedInText( $input, $args, &$parser ) {
34 - global $wgUser, $wgOut;
 39+function OutputLoggedInText( $input, $args, $parser ) {
 40+ global $wgUser;
3541
36 - if( $wgUser->isLoggedIn() ){
37 - return $parser->recursiveTagParse($input);
 42+ if( $wgUser->isLoggedIn() ) {
 43+ return $parser->recursiveTagParse( $input );
3844 }
3945
40 - return "";
 46+ return '';
4147 }
4248
4349 $wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedOut';
@@ -46,12 +52,12 @@
4753 return true;
4854 }
4955
50 -function OutputLoggedOutText( $input, $args, &$parser ) {
51 - global $wgUser, $wgOut;
 56+function OutputLoggedOutText( $input, $args, $parser ) {
 57+ global $wgUser;
5258
53 - if( !$wgUser->isLoggedIn() ){
54 - return $parser->recursiveTagParse($input);
 59+ if( !$wgUser->isLoggedIn() ) {
 60+ return $parser->recursiveTagParse( $input );
5561 }
5662
57 - return "";
 63+ return '';
5864 }
Index: trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.i18n.php
@@ -1,8 +1,14 @@
22 <?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+ */
49
510 $messages = array();
611
 12+/** English */
713 $messages['en'] = array(
814 'wikitextloggedinout-desc' => 'Two parser hooks, <tt>&lt;loggedin&gt;</tt> and <tt>&lt;loggedout&gt;</tt> to show different text depending on the users\' login state',
915 );

Status & tagging log