Index: trunk/phase3/includes/templates/Userlogin.php |
— | — | @@ -12,8 +12,6 @@ |
13 | 13 | */ |
14 | 14 | class UserloginTemplate extends QuickTemplate { |
15 | 15 | function execute() { |
16 | | - global $wgHtml5; |
17 | | - |
18 | 16 | if( $this->data['message'] ) { |
19 | 17 | ?> |
20 | 18 | <div class="<?php $this->text('messagetype') ?>box"> |
— | — | @@ -37,21 +35,29 @@ |
38 | 36 | <tr> |
39 | 37 | <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td> |
40 | 38 | <td class="mw-input"> |
41 | | - <input type='text' class='loginText' name="wpName" id="wpName1" |
42 | | - tabindex="1" |
43 | | - value="<?php $this->text('name'); ?>" size='20'<?php |
44 | | -if ( $wgHtml5 ) { |
45 | | - echo ' required="" autofocus=""'; |
46 | | -} |
47 | | -?>" /> |
| 39 | + <?php |
| 40 | + echo Html::input( 'wpName', $this->data['name'], 'text', array( |
| 41 | + 'class' => 'loginText', |
| 42 | + 'id' => 'wpName1', |
| 43 | + 'tabindex' => '1', |
| 44 | + 'size' => '20', |
| 45 | + 'required', |
| 46 | + 'autofocus' |
| 47 | + ) ); ?> |
| 48 | + |
48 | 49 | </td> |
49 | 50 | </tr> |
50 | 51 | <tr> |
51 | 52 | <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td> |
52 | 53 | <td class="mw-input"> |
53 | | - <input type='password' class='loginPassword' name="wpPassword" id="wpPassword1" |
54 | | - tabindex="2" |
55 | | - value="" size='20' /> |
| 54 | + <?php |
| 55 | + echo Html::input( 'wpPassword', null, 'password', array( |
| 56 | + 'class' => 'loginPassword', |
| 57 | + 'id' => 'wpPassword1', |
| 58 | + 'tabindex' => '2', |
| 59 | + 'size' => '20' |
| 60 | + ) ); ?> |
| 61 | + |
56 | 62 | </td> |
57 | 63 | </tr> |
58 | 64 | <?php if( $this->data['usedomain'] ) { |
— | — | @@ -74,21 +80,32 @@ |
75 | 81 | <tr> |
76 | 82 | <td></td> |
77 | 83 | <td class="mw-input"> |
78 | | - <input type='checkbox' name="wpRemember" |
79 | | - tabindex="4" |
80 | | - value="1" id="wpRemember" |
81 | | - <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?> |
82 | | - /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label> |
| 84 | + <?php |
| 85 | + echo Html::input( 'wpRemember', '1', 'checkbox', array( |
| 86 | + 'tabindex' => '4', |
| 87 | + 'id' => 'wpRemember' |
| 88 | + ) + ( $this->data['remember'] ? array( 'checked' ) : array() ) ); ?> |
| 89 | + |
| 90 | + <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label> |
83 | 91 | </td> |
84 | 92 | </tr> |
85 | | - <?php } ?> |
| 93 | +<?php } ?> |
86 | 94 | <tr> |
87 | 95 | <td></td> |
88 | 96 | <td class="mw-submit"> |
89 | | - <input type='submit' name="wpLoginattempt" id="wpLoginattempt" tabindex="5" value="<?php $this->msg('login') ?>" /> <?php if( $this->data['useemail'] && $this->data['canreset']) { ?><input type='submit' name="wpMailmypassword" id="wpMailmypassword" |
90 | | - tabindex="6" |
91 | | - value="<?php $this->msg('mailmypassword') ?>" /> |
92 | | - <?php } ?> |
| 97 | + <?php |
| 98 | + echo Html::input( 'wpLoginAttempt', wfMsg( 'login' ), 'submit', array( |
| 99 | + 'id' => 'wpLoginAttempt', |
| 100 | + 'tabindex' => '5' |
| 101 | + ) ); |
| 102 | + if ( $this->data['useemail'] && $this->data['canreset'] ) { |
| 103 | + echo ' '; |
| 104 | + echo Html::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array( |
| 105 | + 'id' => 'wpMailmypassword', |
| 106 | + 'tabindex' => '6' |
| 107 | + ) ); |
| 108 | + } ?> |
| 109 | + |
93 | 110 | </td> |
94 | 111 | </tr> |
95 | 112 | </table> |
— | — | @@ -115,7 +132,7 @@ |
116 | 133 | } |
117 | 134 | |
118 | 135 | function execute() { |
119 | | - global $wgHtml5, $wgMinimalPasswordLength; |
| 136 | + global $wgMinimalPasswordLength; |
120 | 137 | |
121 | 138 | if( $this->data['message'] ) { |
122 | 139 | ?> |
— | — | @@ -138,25 +155,26 @@ |
139 | 156 | <tr> |
140 | 157 | <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td> |
141 | 158 | <td class="mw-input"> |
142 | | - <input type='text' class='loginText' name="wpName" id="wpName2" |
143 | | - tabindex="1" |
144 | | - value="<?php $this->text('name') ?>" size='20'<?php |
145 | | -if ( $wgHtml5 ) { |
146 | | - echo ' required=""'; |
147 | | -} |
148 | | -?> /> |
| 159 | + <?php |
| 160 | + echo Html::input( 'wpName', $this->data['name'], 'text', array( |
| 161 | + 'class' => 'loginText', |
| 162 | + 'id' => 'wpName2', |
| 163 | + 'tabindex' => '1', |
| 164 | + 'size' => '20', |
| 165 | + 'required' |
| 166 | + ) ); ?> |
149 | 167 | </td> |
150 | 168 | </tr> |
151 | 169 | <tr> |
152 | 170 | <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td> |
153 | 171 | <td class="mw-input"> |
154 | | - <input type='password' class='loginPassword' name="wpPassword" id="wpPassword2" |
155 | | - tabindex="2" |
156 | | - value="" size='20'<?php |
157 | | -if ( $wgHtml5 && $wgMinimalPasswordLength > 0 ) { |
158 | | - echo ' required=""'; |
159 | | -} |
160 | | -?> /> |
| 172 | +<?php |
| 173 | + echo Html::input( 'wpPassword', null, 'password', array( |
| 174 | + 'class' => 'loginPassword', |
| 175 | + 'id' => 'wpPassword2', |
| 176 | + 'tabindex' => '2', |
| 177 | + 'size' => '20' |
| 178 | + ) + ( $wgMinimalPasswordLength > 0 ? array( 'required' ) : array() ) ); ?> |
161 | 179 | </td> |
162 | 180 | </tr> |
163 | 181 | <?php if( $this->data['usedomain'] ) { |
— | — | @@ -178,23 +196,26 @@ |
179 | 197 | <tr> |
180 | 198 | <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td> |
181 | 199 | <td class="mw-input"> |
182 | | - <input type='password' class='loginPassword' name="wpRetype" id="wpRetype" |
183 | | - tabindex="4" |
184 | | - value="" |
185 | | - size='20'<?php |
186 | | -if ( $wgHtml5 && $wgMinimalPasswordLength > 0 ) { |
187 | | - echo ' required=""'; |
188 | | -} |
189 | | -?> /> |
| 200 | + <?php |
| 201 | + echo Html::input( 'wpRetype', null, 'password', array( |
| 202 | + 'class' => 'loginPassword', |
| 203 | + 'id' => 'wpRetype', |
| 204 | + 'tabindex' => '4', |
| 205 | + 'size' => '20' |
| 206 | + ) + ( $wgMinimalPasswordLength > 0 ? array( 'required' ) : array() ) ); ?> |
190 | 207 | </td> |
191 | 208 | </tr> |
192 | 209 | <tr> |
193 | 210 | <?php if( $this->data['useemail'] ) { ?> |
194 | 211 | <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td> |
195 | 212 | <td class="mw-input"> |
196 | | - <input type='<?php echo $wgHtml5 ? 'email' : 'text' ?>' class='loginText' name="wpEmail" id="wpEmail" |
197 | | - tabindex="5" |
198 | | - value="<?php $this->text('email') ?>" size='20' /> |
| 213 | + <?php |
| 214 | + echo Html::input( 'wpEmail', $this->data['email'], 'email', array( |
| 215 | + 'class' => 'loginText', |
| 216 | + 'id' => 'wpEmail', |
| 217 | + 'tabindex' => '5', |
| 218 | + 'size' => '20' |
| 219 | + ) ); ?> |
199 | 220 | <div class="prefsectiontip"> |
200 | 221 | <?php if( $this->data['emailrequired'] ) { |
201 | 222 | $this->msgWiki('prefs-help-email-required'); |