Index: trunk/phase3/includes/Xml.php |
— | — | @@ -112,11 +112,11 @@ |
113 | 113 | * |
114 | 114 | * @param $selected Mixed: Namespace which should be pre-selected |
115 | 115 | * @param $all Mixed: Value of an item denoting all namespaces, or null to omit |
116 | | - * @param $hidden Mixed: Include hidden namespaces? [WTF? --RC] |
117 | 116 | * @param $element_name String: value of the "name" attribute of the select tag |
| 117 | + * @param $label String: optional label to add to the field |
118 | 118 | * @return string |
119 | 119 | */ |
120 | | - public static function namespaceSelector( $selected = '', $all = null, $hidden = false, $element_name = 'namespace' ) { |
| 120 | + public static function namespaceSelector( $selected = '', $all = null, $element_name = 'namespace', $label = null ) { |
121 | 121 | global $wgContLang; |
122 | 122 | $namespaces = $wgContLang->getFormattedNamespaces(); |
123 | 123 | $options = array(); |
— | — | @@ -139,12 +139,16 @@ |
140 | 140 | $options[] = self::option( $name, $index, $index === $selected ); |
141 | 141 | } |
142 | 142 | |
143 | | - return Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => $element_name, |
| 143 | + $ret = Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => $element_name, |
144 | 144 | 'class' => 'namespaceselector' ) ) |
145 | 145 | . "\n" |
146 | 146 | . implode( "\n", $options ) |
147 | 147 | . "\n" |
148 | 148 | . Xml::closeElement( 'select' ); |
| 149 | + if ( !is_null( $label ) ) { |
| 150 | + $ret = Xml::label( $label, $element_name ) . ' ' . $ret; |
| 151 | + } |
| 152 | + return $ret; |
149 | 153 | } |
150 | 154 | |
151 | 155 | /** |
Index: trunk/phase3/includes/XmlFunctions.php |
— | — | @@ -15,8 +15,8 @@ |
16 | 16 | function wfCloseElement( $element ) { |
17 | 17 | return "</$element>"; |
18 | 18 | } |
19 | | -function HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) { |
20 | | - return Xml::namespaceSelector( $selected, $allnamespaces, $includehidden ); |
| 19 | +function HTMLnamespaceselector($selected = '', $allnamespaces = null ) { |
| 20 | + return Xml::namespaceSelector( $selected, $allnamespaces ); |
21 | 21 | } |
22 | 22 | function wfSpan( $text, $class, $attribs=array() ) { |
23 | 23 | return Xml::span( $text, $class, $attribs ); |
Index: trunk/phase3/includes/specials/SpecialListUserRestrictions.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | false, $wgRequest->getVal( 'user' ) ); |
37 | 37 | $s .= '<p>'; |
38 | 38 | $s .= Xml::label( wfMsgHtml( 'listuserrestrictions-namespace' ), 'namespace' ) . ' ' . |
39 | | - Xml::namespaceSelector( $wgRequest->getVal( 'namespace' ), '', false, 'namespace' ); |
| 39 | + Xml::namespaceSelector( $wgRequest->getVal( 'namespace' ), '', 'namespace' ); |
40 | 40 | $s .= ' '; |
41 | 41 | $s .= Xml::inputLabel( wfMsgHtml( 'listuserrestrictions-page' ), 'page', 'page', |
42 | 42 | false, $wgRequest->getVal( 'page' ) ); |