Index: trunk/extensions/OpenID/SpecialOpenID.body.php |
— | — | @@ -75,17 +75,8 @@ |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
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'); |
90 | 81 | } |
91 | 82 | |
92 | 83 | function interwikiExpand($openid_url) { |
Index: trunk/extensions/OpenID/OpenID.i18n.php |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | 'openidlogin' => 'Login with OpenID', |
34 | 34 | 'openidfinish' => 'Finish OpenID login', |
35 | 35 | 'openidserver' => 'OpenID server', |
| 36 | + 'openidxrds' => 'Yadis file', |
36 | 37 | 'openidconvert' => 'OpenID converter', |
37 | 38 | 'openiderror' => 'Verification error', |
38 | 39 | 'openiderrortext' => 'An error occured during verification of the OpenID URL.', |
Index: trunk/extensions/OpenID/OpenID.setup.php |
— | — | @@ -123,30 +123,44 @@ |
124 | 124 | |
125 | 125 | # Gets stored in the session, needs to be reified before our setup |
126 | 126 | $wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = OpenIDGetServerPath(); |
| 127 | +$wgExtensionMessagesFiles['OpenID'] = dirname(__FILE__) . '/OpenID.i18n.php'; |
| 128 | +# Autoload for special pages |
127 | 129 | |
| 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 | + |
128 | 147 | function setupOpenID() { |
129 | | - global $wgHooks, $wgAutoloadClasses, $wgSpecialPages, $wgExtensionCredits; |
| 148 | + # Doesn't do anything! |
| 149 | +} |
130 | 150 | |
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(); |
132 | 155 | |
133 | 156 | 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(); |
136 | 162 | } |
137 | 163 | |
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; |
151 | 165 | } |
152 | 166 | |
153 | 167 | # Hook is called whenever an article is being viewed |