From 2552ae0528333ed11d406092992c0e9b2c6a2565 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 4 Aug 2007 12:50:43 +0000 Subject: [PATCH] Rewrite Xml::namespaceSelector() before it drives me to totemize somebody. --- includes/Xml.php | 52 ++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/includes/Xml.php b/includes/Xml.php index 8f178f5d94..a35d21bb45 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -91,41 +91,37 @@ class Xml { } /** - * Create a namespace selector + * Build a drop-down box for selecting a namespace * - * @param $selected Mixed: the namespace which should be selected, default '' - * @param $allnamespaces String: value of a special item denoting all namespaces. Null to not include (default) - * @param $includehidden Bool: include hidden namespaces? - * @param array $exclude Array of namespace indexes to exclude - * @return String: Html string containing the namespace selector + * @param mixed $selected Namespace which should be pre-selected + * @param mixed $all Value of an item denoting all namespaces, or null to omit + * @param bool $hidden Include hidden namespaces? [WTF? --RC] + * @param array $exclude Array of indexes to exclude + * @return string */ - public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false, $exclude = array() ) { + public static function namespaceSelector( $selected = '', $all = null, $hidden = false, $exclude = array() ) { global $wgContLang; - if( is_null( $selected ) ) - $selected = ''; - $s = "\n\n"; - return $s; + + return Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => 'namespace', + 'class' => 'namespaceselector' ) ) + . "\n" + . implode( "\n", $options ) + . "\n" + . Xml::closeElement( 'select' ); } - + /** * Create a date selector * -- 2.20.1