Index: trunk/phase3/includes/templates/Userlogin.php |
— | — | @@ -97,6 +97,15 @@ |
98 | 98 | * @ingroup Templates |
99 | 99 | */ |
100 | 100 | class UsercreateTemplate extends QuickTemplate { |
| 101 | + function addInputItem( $name, $value, $type, $msg ) { |
| 102 | + $this->data['extraInput'][] = array( |
| 103 | + 'name' => $name, |
| 104 | + 'value' => $value, |
| 105 | + 'type' => $type, |
| 106 | + 'msg' => $msg, |
| 107 | + ); |
| 108 | + } |
| 109 | + |
101 | 110 | function execute() { |
102 | 111 | if( $this->data['message'] ) { |
103 | 112 | ?> |
— | — | @@ -197,15 +206,57 @@ |
198 | 207 | /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label> |
199 | 208 | </td> |
200 | 209 | </tr> |
| 210 | +<?php |
| 211 | + $tabIndex = 8; |
| 212 | + if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) { |
| 213 | + foreach ( $this->data['extraInput'] as $inputItem ) { ?> |
201 | 214 | <tr> |
| 215 | + <?php |
| 216 | + if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) { |
| 217 | + ?><td class="mw-label"><label for="<?php |
| 218 | + echo htmlspecialchars( $inputItem['name'] ); ?>"><?php |
| 219 | + $this->msgWiki( $inputItem['msg'] ) ?></label><?php |
| 220 | + } else { |
| 221 | + ?><td><?php |
| 222 | + } |
| 223 | + ?></td> |
| 224 | + <td class="mw-input"> |
| 225 | + <input type="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name="<?php |
| 226 | + echo htmlspecialchars( $inputItem['name'] ); ?>" |
| 227 | + tabindex="<?php echo $tabIndex++; ?>" |
| 228 | + value="<?php |
| 229 | + if ( $inputItem['type'] != 'checkbox' ) { |
| 230 | + echo htmlspecialchars( $inputItem['value'] ); |
| 231 | + } else { |
| 232 | + echo '1'; |
| 233 | + } |
| 234 | + ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" |
| 235 | + <?php |
| 236 | + if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) ) |
| 237 | + echo 'checked="checked"'; |
| 238 | + ?> /> <?php |
| 239 | + if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) { |
| 240 | + ?> |
| 241 | + <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php |
| 242 | + $this->msg( $inputItem['msg'] ) ?></label><?php |
| 243 | + } |
| 244 | + ?> |
| 245 | + </td> |
| 246 | + </tr> |
| 247 | +<?php |
| 248 | + |
| 249 | + } |
| 250 | + } |
| 251 | +?> |
| 252 | + <tr> |
202 | 253 | <td></td> |
203 | 254 | <td class="mw-submit"> |
204 | 255 | <input type='submit' name="wpCreateaccount" id="wpCreateaccount" |
205 | | - tabindex="8" |
| 256 | + tabindex="<?php echo $tabIndex++; ?>" |
206 | 257 | value="<?php $this->msg('createaccount') ?>" /> |
207 | 258 | <?php if( $this->data['createemail'] ) { ?> |
208 | 259 | <input type='submit' name="wpCreateaccountMail" id="wpCreateaccountMail" |
209 | | - tabindex="9" |
| 260 | + tabindex="<?php echo $tabIndex++; ?>" |
210 | 261 | value="<?php $this->msg('createaccountmail') ?>" /> |
211 | 262 | <?php } ?> |
212 | 263 | </td> |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -171,7 +171,8 @@ |
172 | 172 | * (bugs 4832, 9481, 12890) Special:Recentchangeslinked now has all options that |
173 | 173 | are in Special:Recentchanges |
174 | 174 | * Allow an $error message to be passed to ArticleDelete hook |
175 | | - |
| 175 | +* Allow extensions to modify the user creation form by calling addInputItem(); |
| 176 | + |
176 | 177 | === Bug fixes in 1.13 === |
177 | 178 | |
178 | 179 | * (bug 10677) Add link to the file description page on the shared repository |