*
* @param $selected Mixed: Namespace which should be pre-selected
* @param $all Mixed: Value of an item denoting all namespaces, or null to omit
- * @param $hidden Mixed: Include hidden namespaces? [WTF? --RC]
* @param $element_name String: value of the "name" attribute of the select tag
+ * @param $label String: optional label to add to the field
* @return string
*/
- public static function namespaceSelector( $selected = '', $all = null, $hidden = false, $element_name = 'namespace' ) {
+ public static function namespaceSelector( $selected = '', $all = null, $element_name = 'namespace', $label = null ) {
global $wgContLang;
$namespaces = $wgContLang->getFormattedNamespaces();
$options = array();
$options[] = self::option( $name, $index, $index === $selected );
}
- return Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => $element_name,
+ $ret = Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => $element_name,
'class' => 'namespaceselector' ) )
. "\n"
. implode( "\n", $options )
. "\n"
. Xml::closeElement( 'select' );
+ if ( !is_null( $label ) ) {
+ $ret = Xml::label( $label, $element_name ) . ' ' . $ret;
+ }
+ return $ret;
}
/**
function wfCloseElement( $element ) {
return "</$element>";
}
-function HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) {
- return Xml::namespaceSelector( $selected, $allnamespaces, $includehidden );
+function HTMLnamespaceselector($selected = '', $allnamespaces = null ) {
+ return Xml::namespaceSelector( $selected, $allnamespaces );
}
function wfSpan( $text, $class, $attribs=array() ) {
return Xml::span( $text, $class, $attribs );
false, $wgRequest->getVal( 'user' ) );
$s .= '<p>';
$s .= Xml::label( wfMsgHtml( 'listuserrestrictions-namespace' ), 'namespace' ) . ' ' .
- Xml::namespaceSelector( $wgRequest->getVal( 'namespace' ), '', false, 'namespace' );
+ Xml::namespaceSelector( $wgRequest->getVal( 'namespace' ), '', 'namespace' );
$s .= ' ';
$s .= Xml::inputLabel( wfMsgHtml( 'listuserrestrictions-page' ), 'page', 'page',
false, $wgRequest->getVal( 'page' ) );