r31825 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r31824‎ | r31825 | r31826 >
Date:22:02, 11 March 2008
Author:evan
Status:old
Tags:
Comment:
I was making similar changes to siebrand's; they seem to be roughly
compatible.
Modified paths:
  • /trunk/extensions/OpenID/OpenID.i18n.php (modified) (history)
  • /trunk/extensions/OpenID/OpenID.setup.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenID.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/SpecialOpenID.body.php
@@ -75,17 +75,8 @@
7676 }
7777 }
7878
79 - function LocalizedPageName(&$specialPageArray, $code) {
80 -
81 - # The localized title of the special page is among the messages of the extension:
82 - wfLoadExtensionMessages( 'OpenID' );
83 - $text = wfMsg('openidlogin');
84 -
85 - # Convert from title in text form to DBKey and put it into the alias array:
86 - $title = Title::newFromText($text);
87 - $specialPageArray['Form'][] = $title->getDBKey();
88 -
89 - return true;
 79+ function loadMessages() {
 80+ wfLoadExtensionMessages('OpenID');
9081 }
9182
9283 function interwikiExpand($openid_url) {
Index: trunk/extensions/OpenID/OpenID.i18n.php
@@ -32,6 +32,7 @@
3333 'openidlogin' => 'Login with OpenID',
3434 'openidfinish' => 'Finish OpenID login',
3535 'openidserver' => 'OpenID server',
 36+ 'openidxrds' => 'Yadis file',
3637 'openidconvert' => 'OpenID converter',
3738 'openiderror' => 'Verification error',
3839 'openiderrortext' => 'An error occured during verification of the OpenID URL.',
Index: trunk/extensions/OpenID/OpenID.setup.php
@@ -123,30 +123,44 @@
124124
125125 # Gets stored in the session, needs to be reified before our setup
126126 $wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = OpenIDGetServerPath();
 127+$wgExtensionMessagesFiles['OpenID'] = dirname(__FILE__) . '/OpenID.i18n.php';
 128+# Autoload for special pages
127129
 130+foreach (array('Login', 'Finish', 'Convert', 'Server', 'XRDS') as $sub) {
 131+ $wgAutoloadClasses['SpecialOpenID' . $sub] = dirname(__FILE__) . '/SpecialOpenID' . $sub . '.body.php';
 132+ $wgSpecialPages['OpenID'.$sub] = array('SpecialOpenID'.$sub);
 133+}
 134+
 135+# Autoload common parent with utility methods
 136+
 137+$wgAutoloadClasses['SpecialOpenID'] = dirname(__FILE__) . '/SpecialOpenID.body.php';
 138+
 139+$wgHooks['PersonalUrls'][] = 'OpenIDPersonalUrls';
 140+$wgHooks['UserToggles'][] = 'OpenIDUserToggles';
 141+$wgHooks['ArticleViewHeader'][] = 'OpenIDArticleViewHeader';
 142+# Add any aliases for the special page.
 143+$wgHooks['LanguageGetSpecialPageAliases'][] = 'OpenIDLocalizedPageName';
 144+# Typo in versions of MW earlier than 1.11.x (?)
 145+$wgHooks['LangugeGetSpecialPageAliases'][] = 'OpenIDLocalizedPageName'; # Add any aliases for the special page.
 146+
128147 function setupOpenID() {
129 - global $wgHooks, $wgAutoloadClasses, $wgSpecialPages, $wgExtensionCredits;
 148+ # Doesn't do anything!
 149+}
130150
131 - # Autoload for special pages
 151+function OpenIDLocalizedPageName(&$specialPageArray, $code) {
 152+
 153+ # The localized title of the special page is among the messages of the extension:
 154+ SpecialOpenID::loadMessages();
132155
133156 foreach (array('Login', 'Finish', 'Convert', 'Server', 'XRDS') as $sub) {
134 - $wgAutoloadClasses['SpecialOpenID' . $sub] = dirname(__FILE__) . '/SpecialOpenID' . $sub . '.body.php';
135 - $wgSpecialPages['OpenID'.$sub] = array('SpecialOpenID'.$sub);
 157+ $text = wfMsg('openid' . strtolower($sub));
 158+ # Convert from title in text form to DBKey and put it into the alias array:
 159+ $title = Title::newFromText($text);
 160+ $specialPageArray['OpenID'.$sub][] = 'OpenID' . $sub;
 161+ $specialPageArray['OpenID'.$sub][] = $title->getDBKey();
136162 }
137163
138 - # Autoload common parent with utility methods
139 -
140 - $wgAutoloadClasses['SpecialOpenID'] = dirname(__FILE__) . '/SpecialOpenID.body.php';
141 -
142 - $wgHooks['PersonalUrls'][] = 'OpenIDPersonalUrls';
143 - $wgHooks['UserToggles'][] = 'OpenIDUserToggles';
144 - $wgHooks['ArticleViewHeader'][] = 'OpenIDArticleViewHeader';
145 - # Load the i18n messages
146 - wfLoadExtensionMessages( 'OpenID' );
147 - # Add any aliases for the special page.
148 - $wgHooks['LanguageGetSpecialPageAliases'][] = 'SpecialOpenID::LocalizedPageName';
149 - # Typo in versions of MW earlier than 1.11.x (?)
150 - $wgHooks['LangugeGetSpecialPageAliases'][] = 'SpecialOpenID::LocalizedPageName'; # Add any aliases for the special page.
 164+ return true;
151165 }
152166
153167 # Hook is called whenever an article is being viewed

Status & tagging log