* Introduce a fourth evil parameter to Xml::namespaceSelector() to exclude namespaces. Pure coincidence, not at all related to the above...
* (bug 10701) Link to Special:Listusers in default Special:Statistics messages
* Improved file history presentation
* (bug 10739) Users can now enter comments when reverting files
-* Improved handling of permissions errors.
+* Improved handling of permissions errors
+* (bug 10798) Exclude MediaWiki namespace from filtering options on
+ Special:Protectedpages (implicit protection, doesn't make sense to have it)
== Bugfixes since 1.10 ==
"</fieldset></form>";
}
- function getNamespaceMenu( $namespace=NULL ) {
- return "<label for='namespace'>" . wfMsgHtml('namespace') . "</label>" . HTMLnamespaceselector($namespace, '');
+ /**
+ * Prepare the namespace filter drop-down; standard namespace
+ * selector, sans the MediaWiki namespace
+ *
+ * @param mixed $namespace Pre-select namespace
+ * @return string
+ */
+ function getNamespaceMenu( $namespace = null ) {
+ return Xml::label( wfMsg( 'namespace' ), 'namespace' )
+ . ' '
+ . Xml::namespaceSelector( $namespace, '', false, array( NS_MEDIAWIKI, NS_MEDIAWIKI_TALK ) );
}
-
+
/**
* @return string Formatted HTML
* @private
* @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
*/
- public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {
+ public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false, $exclude = array() ) {
global $wgContLang;
if( is_null( $selected ) )
$selected = '';
$arr = array($allnamespaces => wfMsg('namespacesall')) + $arr;
}
foreach ($arr as $index => $name) {
- if ($index < NS_MAIN) continue;
+ if( $index < NS_MAIN || in_array( $index, $exclude ) )
+ continue;
$name = $index !== 0 ? $name : wfMsg('blanknamespace');