Index: trunk/phase3/skins/monobook/main.css |
— | — | @@ -1015,59 +1015,10 @@ |
1016 | 1016 | margin-top: 2em; |
1017 | 1017 | } |
1018 | 1018 | |
1019 | | -div#userloginForm form, |
1020 | | -div#userlogin form#userlogin2 { |
1021 | | - margin: 0 3em 1em 0; |
1022 | | - border: 1px solid #aaa; |
1023 | | - clear: both; |
1024 | | - padding: 1.5em 2em; |
1025 | | - background-color: #f9f9f9; |
1026 | | - float: left; |
1027 | | -} |
1028 | | -.rtl div#userloginForm form, |
1029 | | -.rtl div#userlogin form#userlogin2 { |
1030 | | - float: right; |
1031 | | -} |
1032 | | - |
1033 | | -div#userloginForm table, |
1034 | | -div#userlogin form#userlogin2 table { |
1035 | | - background-color: #f9f9f9; |
1036 | | -} |
1037 | | - |
1038 | | -div#userloginForm h2, |
1039 | | -div#userlogin form#userlogin2 h2 { |
1040 | | - padding-top: 0; |
1041 | | -} |
1042 | | - |
1043 | | -div#userlogin .captcha, |
1044 | | -div#userloginForm .captcha { |
1045 | | - border: 1px solid #bbb; |
1046 | | - padding: 1.5em 2em; |
1047 | | - background-color: white; |
1048 | | -} |
1049 | | - |
1050 | | -#loginend, #signupend { |
1051 | | - clear: both; |
1052 | | -} |
1053 | | - |
1054 | 1019 | #userloginprompt, #languagelinks { |
1055 | 1020 | font-size: 85%; |
1056 | 1021 | } |
1057 | 1022 | |
1058 | | -#login-sectiontip { |
1059 | | - font-size: 85%; |
1060 | | - line-height: 1.2; |
1061 | | - padding-top: 2em; |
1062 | | -} |
1063 | | - |
1064 | | -#userlogin .loginText, #userlogin .loginPassword { |
1065 | | - width: 12em; |
1066 | | -} |
1067 | | - |
1068 | | -#userloginlink a, #wpLoginattempt, #wpCreateaccount { |
1069 | | - font-weight: bold; |
1070 | | -} |
1071 | | - |
1072 | 1023 | /* |
1073 | 1024 | ** IE/Mac fixes, hope to find a validating way to move this |
1074 | 1025 | ** to a separate stylesheet. This would work but doesn't validate: |
Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -73,17 +73,24 @@ |
74 | 74 | protected $mMessagePrefix; |
75 | 75 | protected $mFlatFields; |
76 | 76 | protected $mFieldTree; |
77 | | - protected $mShowReset; |
| 77 | + protected $mShowReset = false; |
78 | 78 | public $mFieldData; |
| 79 | + |
79 | 80 | protected $mSubmitCallback; |
80 | 81 | protected $mValidationErrorMessage; |
81 | | - protected $mIntro; |
| 82 | + |
| 83 | + protected $mPre = ''; |
| 84 | + protected $mHeader = ''; |
| 85 | + protected $mPost = ''; |
| 86 | + |
82 | 87 | protected $mSubmitID; |
83 | 88 | protected $mSubmitText; |
84 | 89 | protected $mTitle; |
85 | 90 | |
86 | 91 | protected $mHiddenFields = array(); |
87 | 92 | protected $mButtons = array(); |
| 93 | + |
| 94 | + protected $mWrapperLegend = false; |
88 | 95 | |
89 | 96 | /** |
90 | 97 | * Build a new HTMLForm from an array of field attributes |
— | — | @@ -127,8 +134,6 @@ |
128 | 135 | } |
129 | 136 | |
130 | 137 | $this->mFieldTree = $loadedDescriptor; |
131 | | - |
132 | | - $this->mShowReset = true; |
133 | 138 | } |
134 | 139 | |
135 | 140 | /** |
— | — | @@ -247,16 +252,32 @@ |
248 | 253 | function setValidationErrorMessage( $msg ) { |
249 | 254 | $this->mValidationErrorMessage = $msg; |
250 | 255 | } |
| 256 | + |
| 257 | + /** |
| 258 | + * Set the introductory message, overwriting any existing message. |
| 259 | + * @param $msg String complete text of message to display |
| 260 | + */ |
| 261 | + function setIntro( $msg ) { $this->mPre = $msg; } |
251 | 262 | |
252 | 263 | /** |
253 | | - * Set the introductory message |
| 264 | + * Add introductory text. |
254 | 265 | * @param $msg String complete text of message to display |
255 | 266 | */ |
256 | | - function setIntro( $msg ) { |
257 | | - $this->mIntro = $msg; |
258 | | - } |
| 267 | + function addPreText( $msg ) { $this->mPre .= $msg; } |
259 | 268 | |
260 | 269 | /** |
| 270 | + * Add header text, inside the form. |
| 271 | + * @param $msg String complete text of message to display |
| 272 | + */ |
| 273 | + function addHeaderText( $msg ) { $this->mHeader .= $msg; } |
| 274 | + |
| 275 | + /** |
| 276 | + * Add text to the end of the display. |
| 277 | + * @param $msg String complete text of message to display |
| 278 | + */ |
| 279 | + function addPostText( $msg ) { $this->mPost .= $msg; } |
| 280 | + |
| 281 | + /** |
261 | 282 | * Add a hidden field to the output |
262 | 283 | * @param $name String field name |
263 | 284 | * @param $value String field value |
— | — | @@ -281,21 +302,20 @@ |
282 | 303 | $this->displayErrors( $submitResult ); |
283 | 304 | } |
284 | 305 | |
285 | | - if ( isset( $this->mIntro ) ) { |
286 | | - $wgOut->addHTML( $this->mIntro ); |
287 | | - } |
| 306 | + $html = '' |
| 307 | + . $this->mHeader |
| 308 | + . $this->getBody() |
| 309 | + . $this->getHiddenFields() |
| 310 | + . $this->getButtons() |
| 311 | + ; |
288 | 312 | |
289 | | - $html = $this->getBody(); |
290 | | - |
291 | | - // Hidden fields |
292 | | - $html .= $this->getHiddenFields(); |
293 | | - |
294 | | - // Buttons |
295 | | - $html .= $this->getButtons(); |
296 | | - |
297 | 313 | $html = $this->wrapForm( $html ); |
298 | 314 | |
299 | | - $wgOut->addHTML( $html ); |
| 315 | + $wgOut->addHTML( '' |
| 316 | + . $this->mPre |
| 317 | + . $html |
| 318 | + . $this->mPost |
| 319 | + ); |
300 | 320 | } |
301 | 321 | |
302 | 322 | /** |
— | — | @@ -304,11 +324,18 @@ |
305 | 325 | * @return String wrapped HTML. |
306 | 326 | */ |
307 | 327 | function wrapForm( $html ) { |
| 328 | + |
| 329 | + # Include a <fieldset> wrapper for style, if requested. |
| 330 | + if( $this->mWrapperLegend !== false ){ |
| 331 | + $html = Xml::fieldset( $this->mWrapperLegend, $html ); |
| 332 | + } |
| 333 | + |
308 | 334 | return Html::rawElement( |
309 | 335 | 'form', |
310 | 336 | array( |
311 | 337 | 'action' => $this->getTitle()->getFullURL(), |
312 | 338 | 'method' => 'post', |
| 339 | + 'class' => 'visualClear', |
313 | 340 | ), |
314 | 341 | $html |
315 | 342 | ); |
— | — | @@ -447,6 +474,14 @@ |
448 | 475 | function setSubmitID( $t ) { |
449 | 476 | $this->mSubmitID = $t; |
450 | 477 | } |
| 478 | + |
| 479 | + /** |
| 480 | + * Prompt the whole form to be wrapped in a <fieldset>, with |
| 481 | + * this text as its <legend> element. |
| 482 | + * @param $legend String HTML to go inside the <legend> element. |
| 483 | + * Will be escaped |
| 484 | + */ |
| 485 | + public function setWrapperLegend( $legend ){ $this->mWrapperLegend = $legend; } |
451 | 486 | |
452 | 487 | /** |
453 | 488 | * Set the prefix for various default messages |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -222,10 +222,35 @@ |
223 | 223 | $form->setSubmitText( wfMsg( 'login' ) ); |
224 | 224 | $form->setSubmitId( 'wpLoginAttempt' ); |
225 | 225 | $form->suppressReset(); |
226 | | - $form->loadData(); |
| 226 | + $form->setWrapperLegend( wfMsg( 'userlogin' ) ); |
| 227 | + |
227 | 228 | $form->addHiddenField( 'returnto', $this->mReturnTo ); |
228 | 229 | $form->addHiddenField( 'returntoquery', $this->mReturnToQuery ); |
229 | 230 | |
| 231 | + $form->addHeaderText( '' |
| 232 | + . Html::rawElement( 'p', array( 'id' => 'userloginlink' ), |
| 233 | + $link ) |
| 234 | + . Html::rawElement( 'div', array( 'id' => 'userloginprompt' ), |
| 235 | + wfMsgExt( 'loginprompt', array( 'parseinline' ) ) ) |
| 236 | + . $this->mFormHeader |
| 237 | + . $langSelector |
| 238 | + ); |
| 239 | + $form->addPreText( '' |
| 240 | + . $msg |
| 241 | + . Html::rawElement( |
| 242 | + 'div', |
| 243 | + array( 'id' => 'loginstart' ), |
| 244 | + wfMsgExt( 'loginstart', array( 'parseinline' ) ) |
| 245 | + ) |
| 246 | + ); |
| 247 | + $form->addPostText( |
| 248 | + Html::rawElement( |
| 249 | + 'div', |
| 250 | + array( 'id' => 'loginend' ), |
| 251 | + wfMsgExt( 'loginend', array( 'parseinline' ) ) |
| 252 | + ) |
| 253 | + ); |
| 254 | + |
230 | 255 | # Add a 'mail reset' button if available |
231 | 256 | $buttons = ''; |
232 | 257 | if( $wgEnableEmail && $wgAuth->allowPasswordChange() ){ |
— | — | @@ -236,41 +261,14 @@ |
237 | 262 | ); |
238 | 263 | } |
239 | 264 | |
240 | | - $formContents = '' |
241 | | - . Html::rawElement( 'p', array( 'id' => 'userloginlink' ), |
242 | | - $link ) |
243 | | - . Html::rawElement( 'div', array( 'id' => 'userloginprompt' ), |
244 | | - wfMsgExt( 'loginprompt', array( 'parseinline' ) ) ) |
245 | | - . $this->mFormHeader |
246 | | - . $langSelector |
247 | | - . $form->getBody() |
248 | | - . $form->getHiddenFields() |
249 | | - . $form->getButtons() |
250 | | - ; |
| 265 | + $form->loadData(); |
251 | 266 | |
252 | 267 | $wgOut->setPageTitle( wfMsg( 'login' ) ); |
253 | 268 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
254 | 269 | $wgOut->setArticleRelated( false ); |
255 | 270 | $wgOut->disallowUserJs(); # Stop malicious userscripts sniffing passwords |
256 | 271 | |
257 | | - $wgOut->addHTML( |
258 | | - Html::rawElement( |
259 | | - 'div', |
260 | | - array( 'id' => 'loginstart' ), |
261 | | - wfMsgExt( 'loginstart', array( 'parseinline' ) ) |
262 | | - ) . |
263 | | - $msg . |
264 | | - Html::rawElement( |
265 | | - 'div', |
266 | | - array( 'id' => 'userloginForm' ), |
267 | | - $form->wrapForm( $formContents ) |
268 | | - ) . |
269 | | - Html::rawElement( |
270 | | - 'div', |
271 | | - array( 'id' => 'loginend' ), |
272 | | - wfMsgExt( 'loginend', array( 'parseinline' ) ) |
273 | | - ) |
274 | | - ); |
| 272 | + $form->displayForm( '' ); |
275 | 273 | } |
276 | 274 | |
277 | 275 | /** |
Index: trunk/phase3/includes/specials/SpecialCreateAccount.php |
— | — | @@ -377,10 +377,10 @@ |
378 | 378 | unset( $this->mFormFields['Email'] ); |
379 | 379 | } else { |
380 | 380 | if( $wgEmailConfirmToEdit ){ |
381 | | - $this->mFormFields['Email']['label-help'] = 'prefs-help-email-required'; |
| 381 | + $this->mFormFields['Email']['help-message'] = 'prefs-help-email-required'; |
382 | 382 | $this->mFormFields['Email']['required'] = ''; |
383 | 383 | } else { |
384 | | - $this->mFormFields['Email']['label-help'] = 'prefs-help-email'; |
| 384 | + $this->mFormFields['Email']['help-message'] = 'prefs-help-email'; |
385 | 385 | } |
386 | 386 | } |
387 | 387 | |
— | — | @@ -399,15 +399,39 @@ |
400 | 400 | $this->mFormFields['Remember']['checked'] = '1'; |
401 | 401 | } |
402 | 402 | |
403 | | - $form = new HTMLForm( $this->mFormFields, '' ); |
| 403 | + $form = new HTMLForm( $this->mFormFields ); |
| 404 | + |
404 | 405 | $form->setTitle( $this->getTitle() ); |
405 | 406 | $form->setSubmitText( wfMsg( 'createaccount' ) ); |
406 | 407 | $form->setSubmitId( 'wpCreateaccount' ); |
407 | 408 | $form->suppressReset(); |
408 | | - $form->loadData(); |
| 409 | + $form->setWrapperLegend( wfMsg( 'createaccount' ) ); |
| 410 | + |
409 | 411 | $form->addHiddenField( 'returnto', $this->mReturnTo ); |
410 | 412 | $form->addHiddenField( 'returntoquery', $this->mReturnToQuery ); |
411 | 413 | |
| 414 | + $form->addHeaderText( '' |
| 415 | + . Html::rawElement( 'p', array( 'id' => 'userloginlink' ), |
| 416 | + $link ) |
| 417 | + . $this->mFormHeader |
| 418 | + . $langSelector |
| 419 | + ); |
| 420 | + $form->addPreText( '' |
| 421 | + . $msg |
| 422 | + . Html::rawElement( |
| 423 | + 'div', |
| 424 | + array( 'id' => 'signupstart' ), |
| 425 | + wfMsgExt( 'loginstart', array( 'parseinline' ) ) |
| 426 | + ) |
| 427 | + ); |
| 428 | + $form->addPostText( |
| 429 | + Html::rawElement( |
| 430 | + 'div', |
| 431 | + array( 'id' => 'signupend' ), |
| 432 | + wfMsgExt( 'loginend', array( 'parseinline' ) ) |
| 433 | + ) |
| 434 | + ); |
| 435 | + |
412 | 436 | # Add a 'send password by email' button if available |
413 | 437 | if( $wgEnableEmail && $wgUser->isLoggedIn() ){ |
414 | 438 | $form->addButton( |
— | — | @@ -417,40 +441,16 @@ |
418 | 442 | ); |
419 | 443 | } |
420 | 444 | |
421 | | - $formContents = '' |
422 | | - . Html::rawElement( 'p', array( 'id' => 'userloginlink' ), |
423 | | - $link ) |
424 | | - . $this->mFormHeader |
425 | | - . $langSelector |
426 | | - . $form->getBody() |
427 | | - . $form->getHiddenFields() |
428 | | - . $form->getButtons() |
429 | | - ; |
| 445 | + $form->loadData(); |
430 | 446 | |
431 | 447 | $wgOut->setPageTitle( wfMsg( 'createaccount' ) ); |
432 | 448 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
433 | 449 | $wgOut->setArticleRelated( false ); |
434 | 450 | $wgOut->disallowUserJs(); # Stop malicious userscripts sniffing passwords |
435 | 451 | |
436 | | - $wgOut->addHTML( |
437 | | - Html::rawElement( |
438 | | - 'div', |
439 | | - array( 'id' => 'loginstart' ), |
440 | | - wfMsgExt( 'loginstart', array( 'parseinline' ) ) |
441 | | - ) . |
442 | | - $msg . |
443 | | - Html::rawElement( |
444 | | - 'div', |
445 | | - array( 'id' => 'userloginForm' ), |
446 | | - $form->wrapForm( $formContents ) |
447 | | - ) . |
448 | | - Html::rawElement( |
449 | | - 'div', |
450 | | - array( 'id' => 'loginend' ), |
451 | | - wfMsgExt( 'loginend', array( 'parseinline' ) ) |
452 | | - ) |
453 | | - ); |
454 | 452 | |
| 453 | + $form->displayForm( false ); |
| 454 | + |
455 | 455 | } |
456 | 456 | |
457 | 457 | /** |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1048,10 +1048,10 @@ |
1049 | 1049 | 'logout' => 'Log out', |
1050 | 1050 | 'userlogout' => 'Log out', |
1051 | 1051 | 'notloggedin' => 'Not logged in', |
1052 | | -'nologin' => "Don't have an account? $1.", |
| 1052 | +'nologin' => "Don't have an account? '''$1'''.", |
1053 | 1053 | 'nologinlink' => 'Create an account', |
1054 | 1054 | 'createaccount' => 'Create account', |
1055 | | -'gotaccount' => 'Already have an account? $1.', |
| 1055 | +'gotaccount' => "Already have an account? '''$1'''.", |
1056 | 1056 | 'gotaccountlink' => 'Log in', |
1057 | 1057 | 'createaccountmail' => 'by e-mail', |
1058 | 1058 | 'badretype' => 'The passwords you entered do not match.', |