Allow an element name to be specified in Xml::namespaceSelector.
authorAndrew Garrett <werdna@users.mediawiki.org>
Sat, 1 Sep 2007 12:38:54 +0000 (12:38 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Sat, 1 Sep 2007 12:38:54 +0000 (12:38 +0000)
includes/Xml.php

index d7261a1..fe4bb0c 100644 (file)
@@ -99,7 +99,7 @@ class Xml {
         * @param bool $hidden Include hidden namespaces? [WTF? --RC]
         * @return string
         */
-       public static function namespaceSelector( $selected = '', $all = null, $hidden = false ) {
+       public static function namespaceSelector( $selected = '', $all = null, $hidden = false, $element_name = 'namespace' ) {
                global $wgContLang;
                $namespaces = $wgContLang->getFormattedNamespaces();
                $options = array();
@@ -114,7 +114,7 @@ class Xml {
                        $options[] = self::option( $name, $index, $index === $selected );
                }
                
-               return Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => 'namespace',
+               return Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => $element_name,
                        'class' => 'namespaceselector' ) )
                        . "\n"
                        . implode( "\n", $options )