r99358 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99357‎ | r99358 | r99359 >
Date:16:39, 9 October 2011
Author:kwisatz
Status:ok (Comments)
Tags:
Comment:
implemented alias and messages separation as requested in code review c24014
Modified paths:
  • /trunk/extensions/TwitterLogin/SpecialTwitterLogin.php (modified) (history)
  • /trunk/extensions/TwitterLogin/TwitterLogin.alias.php (added) (history)
  • /trunk/extensions/TwitterLogin/TwitterLogin.i18n.php (modified) (history)
  • /trunk/extensions/TwitterLogin/TwitterLogin.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TwitterLogin/TwitterLogin.i18n.php
@@ -8,25 +8,17 @@
99 * @author David Raison
1010 */
1111
12 -$aliases = array();
1312 $messages = array();
1413
1514 /** English
1615 * @author David Raison
1716 */
18 -$aliases['en'] = array(
19 - 'TwitterLogin' => array('TwitterLogin')
20 -);
21 -
22 -/** English
23 - * @author David Raison
24 - */
2517 $messages['en'] = array(
2618 'twitterlogin' => 'Sign in using Twitter',
27 - 'signuptwitter' => 'You can register to this wiki using your twitter account',
28 - 'tietoaccount' => 'You are currently logged into this wiki as $1.<br/>You may sign in with Twitter to tie your twitter account to your existing mediawiki account.',
 19+ 'twitterlogin-signup' => 'You can register to this wiki using your twitter account',
 20+ 'twiterlogin-tietoaccount' => 'You are currently logged into this wiki as $1.<br/>You may sign in with Twitter to tie your twitter account to your existing mediawiki account.',
2921 'twitterlogin-desc' => 'Register and log in to a mediawiki using your twitter account',
30 - 'alreadyloggedin' => 'You\'re already logged in.',
31 - 'couldnotconnect' => 'Could not connect to Twitter. Refresh the page or try again later.'
 22+ 'twitterlogin-alreadyloggedin' => 'You\'re already logged in.',
 23+ 'twitterlogin-couldnotconnect' => 'Could not connect to Twitter. Refresh the page or try again later.'
3224 );
3325
Index: trunk/extensions/TwitterLogin/TwitterLogin.php
@@ -34,10 +34,11 @@
3535 $wgAutoloadClasses['TwitterSigninUI'] = dirname(__FILE__) . '/TwitterLogin.body.php';
3636
3737 $wgExtensionMessagesFiles['TwitterLogin'] = dirname(__FILE__) .'/TwitterLogin.i18n.php';
 38+$wgExtensionAliasFiles['TwitterLogin'] = dirname(__FILE__) .'/TwitterLogin.alias.php';
 39+
3840 $wgSpecialPages['TwitterLogin'] = 'SpecialTwitterLogin';
3941 $wgSpecialPageGroups['TwitterLogin'] = 'login';
4042
41 -$wgHooks['LanguageGetMagic'][] = 'wfTwitterLoginLanguageGetMagic';
4243 $wgHooks['LoadExtensionSchemaUpdates'][] = 'efSetupTwitterLoginSchema';
4344
4445 $tsu = new TwitterSigninUI;
@@ -47,11 +48,6 @@
4849 $wgHooks['UserLoadFromSession'][] = array($stl,'efTwitterAuth');
4950 $wgHooks['UserLogoutComplete'][] = array($stl,'efTwitterLogout');
5051
51 -function wfTwitterLoginLanguageGetMagic( &$magicWords, $langCode = 'en' ) {
52 - $magicWords['twitterlogin'] = array( 0, 'twitterlogin' );
53 - return true;
54 -}
55 -
5652 function efSetupTwitterLoginSchema() {
5753 $updater->addExtensionUpdate( array( 'addTable', 'twitter_user',
5854 dirname(__FILE__) . '/twitter_user.sql', true ) );
Index: trunk/extensions/TwitterLogin/SpecialTwitterLogin.php
@@ -57,14 +57,14 @@
5858 $wgOut->setPagetitle("Twitter Login");
5959
6060 if ( !$wgUser->isLoggedIn() ) {
61 - $wgOut->addWikiText( wfMsg( 'signuptwitter') );
 61+ $wgOut->addWikiText( wfMsg( 'twitterlogin-signup') );
6262
6363 $wgOut->addHTML( '<a href="' . $wgScriptPath . '/index.php/Special:TwitterLogin/redirect">'
6464 .'<img src="' . $wgExtensionAssetsPath . '/TwitterLogin/' .
6565 'images/sign-in-with-twitter-d.png"/></a>' );
6666 } else {
67 - //$wgOut->addWikiText( wfMsg( 'tietoaccount', $wgUser->getName() ) );
68 - $wgOut->addWikiText( wfMsg( 'alreadyloggedin' ) );
 67+ //$wgOut->addWikiText( wfMsg( 'twitterlogin-tietoaccount', $wgUser->getName() ) );
 68+ $wgOut->addWikiText( wfMsg( 'twitterlogin-alreadyloggedin' ) );
6969 }
7070 return true;
7171 }
@@ -135,7 +135,7 @@
136136 header('Location: '. $url);
137137 break;
138138 default:
139 - $wgOut->addWikiText( wfMsg( 'couldnotconnect' ) );
 139+ $wgOut->addWikiText( wfMsg( 'twitterlogin-couldnotconnect' ) );
140140 break;
141141 }
142142 }
Index: trunk/extensions/TwitterLogin/TwitterLogin.alias.php
@@ -0,0 +1,17 @@
 2+<?php
 3+/**
 4+ * @file TwitterLogin.alias.php
 5+ * @ingroup TwitterLogin
 6+
 7+ * @author David Raison
 8+ */
 9+
 10+$aliases = array();
 11+
 12+/** English
 13+ * @author David Raison
 14+ */
 15+$aliases['en'] = array(
 16+ 'TwitterLogin' => array('TwitterLogin')
 17+);
 18+
Property changes on: trunk/extensions/TwitterLogin/TwitterLogin.alias.php
___________________________________________________________________
Added: svn:eol-style
119 + native

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99355initial import of TwitterLogin extensionkwisatz16:01, 9 October 2011

Comments

#Comment by Johnduhart (talk | contribs)   17:20, 9 October 2011

Please mention the revision number that this revision is a response to, so that it's linked in the follow-up revision section.

eg. "implemented alias and messages separation as requested in code review on r99358"

Or preferably so we can tell off the bat it's a follow-up

"Follow-up r99358, implemented alias and messages separation as requested in code review"

</nitpick>

#Comment by Johnduhart (talk | contribs)   17:21, 9 October 2011

Er...that should be r99355 :p

#Comment by Nikerabbit (talk | contribs)   21:14, 9 October 2011

Did you intend to remove the magic word code?

#Comment by Clausekwis (talk | contribs)   21:15, 9 October 2011

Already done so in a later revision ;)

#Comment by Clausekwis (talk | contribs)   21:20, 9 October 2011

Oh.. yes.. sorry, read "do" instead of "did". I intended to since this is not a parser function. Or was that incorrect?

#Comment by Nikerabbit (talk | contribs)   21:40, 9 October 2011

Seems to make sense.

Status & tagging log