Index: trunk/extensions/ConfirmAccount/UserCredentials_body.php |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | } else { |
33 | 33 | $this->showForm(); |
34 | 34 | } |
| 35 | + $wgOut->addModules( 'ext.confirmAccount' ); // CSS |
35 | 36 | } |
36 | 37 | |
37 | 38 | function showForm() { |
Index: trunk/extensions/ConfirmAccount/ConfirmAccount.php |
— | — | @@ -143,19 +143,18 @@ |
144 | 144 | $wgExtensionMessagesFiles['ConfirmAccount'] = $dir . 'ConfirmAccount.i18n.php'; |
145 | 145 | $wgExtensionAliasesFiles['ConfirmAccount'] = $dir . 'ConfirmAccount.alias.php'; |
146 | 146 | |
147 | | -function efLoadConfirmAccount() { |
148 | | - global $wgUser; |
149 | | - # Don't load unless needed |
150 | | - if ( $wgUser->getId() && $wgUser->isAllowed( 'confirmaccount' ) ) { |
151 | | - efConfirmAccountInjectStyle(); |
152 | | - } |
153 | | -} |
| 147 | +$wgResourceModules['ext.confirmAccount'] = array( |
| 148 | + 'styles' => 'confirmaccount.css', |
| 149 | + 'localBasePath' => dirname( __FILE__ ), |
| 150 | + 'remoteExtPath' => 'ConfirmAccount', |
| 151 | +); |
154 | 152 | |
155 | 153 | function efAddRequestLoginText( &$template ) { |
156 | | - global $wgUser; |
| 154 | + global $wgUser, $wgOut; |
157 | 155 | # Add a link to RequestAccount from UserLogin |
158 | 156 | if ( !$wgUser->isAllowed( 'createaccount' ) ) { |
159 | | - $template->set( 'header', wfMsgExt( 'requestaccount-loginnotice', array( 'parse' ) ) ); |
| 157 | + $template->set( 'header', wfMsgExt( 'requestaccount-loginnotice', 'parse' ) ); |
| 158 | + $wgOut->addModules( 'ext.confirmAccount' ); // CSS |
160 | 159 | } |
161 | 160 | return true; |
162 | 161 | } |
— | — | @@ -183,19 +182,7 @@ |
184 | 183 | return true; |
185 | 184 | } |
186 | 185 | |
187 | | -function efConfirmAccountInjectStyle() { |
188 | | - global $wgOut, $wgUser, $wgScriptPath; |
189 | | - # FIXME: find better load place |
190 | | - # UI CSS |
191 | | - $wgOut->addLink( array( |
192 | | - 'rel' => 'stylesheet', |
193 | | - 'type' => 'text/css', |
194 | | - 'media' => 'screen', |
195 | | - 'href' => $wgScriptPath . '/extensions/ConfirmAccount/confirmaccount.css', |
196 | | - ) ); |
197 | | - return true; |
198 | | -} |
199 | | - |
| 186 | +// FIXME: don't just take on to general site notice |
200 | 187 | function efConfirmAccountsNotice( $notice ) { |
201 | 188 | global $wgConfirmAccountNotice, $wgUser; |
202 | 189 | if ( !$wgConfirmAccountNotice || !$wgUser->isAllowed( 'confirmaccount' ) ) { |
— | — | @@ -209,7 +196,9 @@ |
210 | 197 | if ( !$count ) { |
211 | 198 | $dbw = wfGetDB( DB_MASTER ); |
212 | 199 | $count = $dbw->selectField( 'account_requests', 'COUNT(*)', |
213 | | - array( 'acr_deleted' => 0, 'acr_held IS NULL', 'acr_email_authenticated IS NOT NULL' ), |
| 200 | + array( 'acr_deleted' => 0, |
| 201 | + 'acr_held IS NULL', |
| 202 | + 'acr_email_authenticated IS NOT NULL' ), |
214 | 203 | __METHOD__ ); |
215 | 204 | # Use '-' for zero, to avoid any confusion over key existence |
216 | 205 | if ( !$count ) { |
— | — | @@ -220,8 +209,9 @@ |
221 | 210 | } |
222 | 211 | if ( $count !== '-' ) { |
223 | 212 | $message = wfMsgExt( 'confirmaccount-newrequests', array( 'parsemag' ), $count ); |
224 | | - |
225 | | - $notice .= '<div id="mw-confirmaccount-msg" class="mw-confirmaccount-bar">' . $wgOut->parse( $message ) . '</div>'; |
| 213 | + $notice .= '<div id="mw-confirmaccount-msg" class="mw-confirmaccount-bar">' . |
| 214 | + $wgOut->parse( $message ) . '</div>'; |
| 215 | + $wgOut->addModules( 'ext.confirmAccount' ); // CSS |
226 | 216 | } |
227 | 217 | return true; |
228 | 218 | } |
— | — | @@ -240,7 +230,6 @@ |
241 | 231 | $wgAutoloadClasses['UserCredentialsPage'] = $dir . 'UserCredentials_body.php'; |
242 | 232 | $wgSpecialPageGroups['UserCredentials'] = 'users'; |
243 | 233 | |
244 | | -$wgExtensionFunctions[] = 'efLoadConfirmAccount'; |
245 | 234 | # Make sure "login / create account" notice still as "create account" |
246 | 235 | $wgHooks['PersonalUrls'][] = 'efSetRequestLoginLinks'; |
247 | 236 | # Add notice of where to request an account at UserLogin |
Index: trunk/extensions/ConfirmAccount/RequestAccount_body.php |
— | — | @@ -74,6 +74,7 @@ |
75 | 75 | } else { |
76 | 76 | $this->showForm(); |
77 | 77 | } |
| 78 | + $wgOut->addModules( 'ext.confirmAccount' ); // CSS |
78 | 79 | } |
79 | 80 | |
80 | 81 | protected function showForm( $msg = '', $forgotFile = 0 ) { |
Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | parent::__construct('ConfirmAccounts','confirmaccount'); |
14 | 14 | } |
15 | 15 | |
| 16 | + // @TODO: split out listlink mess |
16 | 17 | function execute( $par ) { |
17 | 18 | global $wgRequest, $wgOut, $wgUser, $wgAccountRequestTypes, $wgLang; |
18 | 19 | |
— | — | @@ -145,6 +146,7 @@ |
146 | 147 | } else { |
147 | 148 | $this->showQueues(); |
148 | 149 | } |
| 150 | + $wgOut->addModules( 'ext.confirmAccount' ); // CSS |
149 | 151 | } |
150 | 152 | |
151 | 153 | protected function showQueues() { |
— | — | @@ -323,7 +325,7 @@ |
324 | 326 | $form .= self::parseLinks($row->acr_urls); |
325 | 327 | } |
326 | 328 | if( $wgUser->isAllowed( 'requestips' ) ) { |
327 | | - $blokip = SpecialPage::getTitleFor( 'blockip' ); |
| 329 | + $blokip = SpecialPage::getTitleFor( 'Blockip' ); |
328 | 330 | $form .= "<p>".wfMsgHtml('confirmaccount-ip')." ".htmlspecialchars($row->acr_ip). |
329 | 331 | " (" . $this->skin->makeKnownLinkObj( $blokip, wfMsgHtml('blockip'), |
330 | 332 | 'ip=' . $row->acr_ip . '&wpCreateAccount=1' ).")</p>\n"; |