From 11b0b2e7d3481a42ac6c79b169d01fb51a186426 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Wed, 25 Jan 2012 03:01:20 +0000 Subject: [PATCH] [Xml/Html] new method Html::namespaceSelector * Using params and option arrays instead of 4 random parameters like Xml::namespaceSelector did * Right now it's passing $selectAttribs['name'] to Xml::label, this is done because that's what Xml::namespaceSelector did. However it's wrong since labels associate over ID not NAME. Will fix in the next commit, making sure unit tests stay functional first. This bug has been in Xml::namespaceSelector for a long time but usually unnoticed as people kept either defaults. Although it was easy to get wrong as the NAME was configurable but the ID was hardcoded in Xml::namespaceSelector. * Deprecated Xml::namespaceSelector and made it cal Html::namespaceSelector * Follows-up r109974, r109698 * XmlTest.php still runs successfully --- RELEASE-NOTES-1.19 | 2 ++ includes/Html.php | 54 ++++++++++++++++++++++++++++++++++++++++++++++ includes/Xml.php | 45 ++++++++++---------------------------- 3 files changed, 67 insertions(+), 34 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 77900cafc5..17f93f7798 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -315,6 +315,8 @@ changes to languages because of Bugzilla reports. using Title::isCssJsSubpage() or checking Title::isWrongCaseCssJsPage(). * (bug 24430) Remove number of column for edit field in preference page. * Support for the deprecated hook MagicWordMagicWords was removed. +* The Xml::namespaceSelector method has been deprecated, please use + Html::namespaceSelector instead (note that the parameters have changed also). == Compatibility == diff --git a/includes/Html.php b/includes/Html.php index fb3f16789a..eaa244f394 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -699,6 +699,60 @@ class Html { } return self::element( 'textarea', $attribs, $spacedValue ); } + /** + * Build a drop-down box for selecting a namespace + * + * @param $params array: + * - selected: [optional] Id of namespace which should be pre-selected + * - all: [optional] Value of item for "all namespaces". If null or unset,