r24574 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24573‎ | r24574 | r24575 >
Date:12:20, 4 August 2007
Author:robchurch
Status:old
Tags:
Comment:
* (bug 10798) Exclude MediaWiki namespace from filtering options on Special:Protectedpages (implicit protection, doesn't make sense to have it)
* Introduce a fourth evil parameter to Xml::namespaceSelector() to exclude namespaces. Pure coincidence, not at all related to the above...
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialProtectedpages.php (modified) (history)
  • /trunk/phase3/includes/Xml.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Xml.php
@@ -96,9 +96,10 @@
9797 * @param $selected Mixed: the namespace which should be selected, default ''
9898 * @param $allnamespaces String: value of a special item denoting all namespaces. Null to not include (default)
9999 * @param $includehidden Bool: include hidden namespaces?
 100+ * @param array $exclude Array of namespace indexes to exclude
100101 * @return String: Html string containing the namespace selector
101102 */
102 - public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {
 103+ public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false, $exclude = array() ) {
103104 global $wgContLang;
104105 if( is_null( $selected ) )
105106 $selected = '';
@@ -108,7 +109,8 @@
109110 $arr = array($allnamespaces => wfMsg('namespacesall')) + $arr;
110111 }
111112 foreach ($arr as $index => $name) {
112 - if ($index < NS_MAIN) continue;
 113+ if( $index < NS_MAIN || in_array( $index, $exclude ) )
 114+ continue;
113115
114116 $name = $index !== 0 ? $name : wfMsg('blanknamespace');
115117
Index: trunk/phase3/includes/SpecialProtectedpages.php
@@ -119,10 +119,19 @@
120120 "</fieldset></form>";
121121 }
122122
123 - function getNamespaceMenu( $namespace=NULL ) {
124 - return "<label for='namespace'>" . wfMsgHtml('namespace') . "</label>" . HTMLnamespaceselector($namespace, '');
 123+ /**
 124+ * Prepare the namespace filter drop-down; standard namespace
 125+ * selector, sans the MediaWiki namespace
 126+ *
 127+ * @param mixed $namespace Pre-select namespace
 128+ * @return string
 129+ */
 130+ function getNamespaceMenu( $namespace = null ) {
 131+ return Xml::label( wfMsg( 'namespace' ), 'namespace' )
 132+ . '&nbsp;'
 133+ . Xml::namespaceSelector( $namespace, '', false, array( NS_MEDIAWIKI, NS_MEDIAWIKI_TALK ) );
125134 }
126 -
 135+
127136 /**
128137 * @return string Formatted HTML
129138 * @private
Index: trunk/phase3/RELEASE-NOTES
@@ -161,7 +161,9 @@
162162 * (bug 10701) Link to Special:Listusers in default Special:Statistics messages
163163 * Improved file history presentation
164164 * (bug 10739) Users can now enter comments when reverting files
165 -* Improved handling of permissions errors.
 165+* Improved handling of permissions errors
 166+* (bug 10798) Exclude MediaWiki namespace from filtering options on
 167+ Special:Protectedpages (implicit protection, doesn't make sense to have it)
166168
167169 == Bugfixes since 1.10 ==
168170

Follow-up revisions

RevisionCommit summaryAuthorDate
r24631Merged revisions 24480-24600 via svnmerge from...david18:39, 6 August 2007
r24680Revert r24574 and r24667 per Brion on bug 10798robchurch17:46, 8 August 2007
r24705Merged revisions 24632-24693 via svnmerge from...david19:15, 9 August 2007

Status & tagging log