From: Geoffrey Mon Date: Sun, 13 Sep 2015 23:00:37 +0000 (+0000) Subject: Use XmlSelect in SpecialEditTags X-Git-Tag: 1.31.0-rc.0~10023^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=36a53afd1fada7c2ff9322f94014a64702653fa0 Use XmlSelect in SpecialEditTags Bug: T93234 Change-Id: I758691f230cff04540b358e9881fe2bfac2d1b9e --- diff --git a/includes/specials/SpecialEditTags.php b/includes/specials/SpecialEditTags.php index f41a1f1ded..54f50d9ed7 100644 --- a/includes/specials/SpecialEditTags.php +++ b/includes/specials/SpecialEditTags.php @@ -349,20 +349,18 @@ class SpecialEditTags extends UnlistedSpecialPage { protected function getTagSelect( $selectedTags, $label ) { $result = array(); $result[0] = Xml::label( $label, 'mw-edittags-tag-list' ); - $result[1] = Xml::openElement( 'select', array( - 'name' => 'wpTagList[]', - 'id' => 'mw-edittags-tag-list', - 'multiple' => 'multiple', - 'size' => '8', - ) ); + + $select = new XmlSelect( 'wpTagList[]', 'mw-edittags-tag-list', $selectedTags ); + $select->setAttribute( 'multiple', 'multiple' ); + $select->setAttribute( 'size', '8' ); $tags = ChangeTags::listExplicitlyDefinedTags(); $tags = array_unique( array_merge( $tags, $selectedTags ) ); - foreach ( $tags as $tag ) { - $result[1] .= Xml::option( $tag, $tag, in_array( $tag, $selectedTags ) ); - } - $result[1] .= Xml::closeElement( 'select' ); + // Values of $tags are also used as