Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/90156
Change subject: Fix default value of domain select box in templates
......................................................................
Fix default value of domain select box in templates
There is no such thing as <select value="">. Use XmlSelect class to
properly build the selector instead.
Change-Id: If23071f29bf1ca8d7364453ec6c464127fecb509
---
M includes/templates/Usercreate.php
M includes/templates/Userlogin.php
2 files changed, 8 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/56/90156/1
diff --git a/includes/templates/Usercreate.php
b/includes/templates/Usercreate.php
index 6dd5f35..2bf4551 100644
--- a/includes/templates/Usercreate.php
+++ b/includes/templates/Usercreate.php
@@ -113,17 +113,16 @@
<?php
if ( $this->data['usedomain'] ) {
- $doms = "";
+ $select = new XmlSelect( 'wpDomain', false,
$this->data['domain'] );
+ $select->setAttribute( 'tabindex', 4 );
foreach ( $this->data['domainnames'] as $dom ) {
- $doms .= "<option>" . htmlspecialchars(
$dom ) . "</option>";
+ $select->addOption( $dom );
}
?>
<div id="mw-user-domain-section">
<label for="wpDomain"><?php $this->msg(
'yourdomainname' ); ?></label>
<div class="mw-input">
- <select name="wpDomain"
value="<?php $this->text( 'domain' ); ?>" tabindex="4">
- <?php echo $doms ?>
- </select>
+ <?php echo $select->getHTML();
?>
</div>
</div>
<?php } ?>
diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php
index 9ab353d..71227a1 100644
--- a/includes/templates/Userlogin.php
+++ b/includes/templates/Userlogin.php
@@ -113,16 +113,15 @@
<?php
if ( isset( $this->data['usedomain'] ) &&
$this->data['usedomain'] ) {
- $doms = "";
+ $select = new XmlSelect( 'wpDomain', false,
$this->data['domain'] );
+ $select->setAttribute( 'tabindex', 3 );
foreach ( $this->data['domainnames'] as $dom ) {
- $doms .= "<option>" . htmlspecialchars(
$dom ) . "</option>";
+ $select->addOption( $dom );
}
?>
<div id="mw-user-domain-section">
<label for='wpDomain'><?php $this->msg(
'yourdomainname' ); ?></label>
- <select name="wpDomain" value="<?php
$this->text( 'domain' ); ?>" tabindex="3">
- <?php echo $doms; ?>
- </select>
+ <?php echo $select->getHTML(); ?>
</div>
<?php } ?>
--
To view, visit https://gerrit.wikimedia.org/r/90156
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If23071f29bf1ca8d7364453ec6c464127fecb509
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits