Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | ); |
57 | 57 | # Display dropdown as needed |
58 | 58 | if( count($wgFlaggedRevsNamespaces) > 1 ) { |
59 | | - $wgOut->addHTML( FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' ' ); |
| 59 | + $wgOut->addHTML( FlaggedRevsXML::getNamespaceMenu( $this->namespace, '' ) . ' ' ); |
60 | 60 | } |
61 | 61 | $wgOut->addHTML( |
62 | 62 | Xml::label( wfMsg("oldreviewed-category"), 'wpCategory' ) . ' ' . |
— | — | @@ -258,8 +258,8 @@ |
259 | 259 | if( !is_null($namespace) ) { |
260 | 260 | $namespace = intval($namespace); |
261 | 261 | } |
262 | | - if( is_null($namespace) || !in_array($namespace,$wgFlaggedRevsNamespaces) ) { |
263 | | - $namespace = empty($wgFlaggedRevsNamespaces) ? -1 : $wgFlaggedRevsNamespaces[0]; |
| 262 | + if( !in_array($namespace,$wgFlaggedRevsNamespaces) ) { |
| 263 | + $namespace = ''; |
264 | 264 | } |
265 | 265 | $this->namespace = $namespace; |
266 | 266 | $this->category = $category ? str_replace(' ','_',$category) : NULL; |
— | — | @@ -290,7 +290,9 @@ |
291 | 291 | $conds[] = 'rev_page = fp_page_id AND rev_id = fp_stable'; |
292 | 292 | $conds[] = 'fp_pending_since IS NOT NULL'; |
293 | 293 | # Filter namespace |
294 | | - $conds['page_namespace'] = $this->namespace; |
| 294 | + if( $this->namespace !== NULL ) { |
| 295 | + $conds['page_namespace'] = $this->namespace; |
| 296 | + } |
295 | 297 | $useIndex = array('flaggedpages' => 'fp_pending_since','page' => 'PRIMARY'); |
296 | 298 | # Filter by category |
297 | 299 | if( $this->category ) { |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -4,8 +4,10 @@ |
5 | 5 | /** |
6 | 6 | * Get a selector of reviewable namespaces |
7 | 7 | * @param int $selected, namespace selected |
| 8 | + * @param $all Mixed: Value of an item denoting all namespaces, or null to omit |
| 9 | + * @returns string |
8 | 10 | */ |
9 | | - public static function getNamespaceMenu( $selected=null ) { |
| 11 | + public static function getNamespaceMenu( $selected=null, $all=null ) { |
10 | 12 | global $wgContLang, $wgFlaggedRevsNamespaces; |
11 | 13 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
12 | 14 | $s = "<label for='namespace'>" . wfMsgHtml('namespace') . "</label>"; |
— | — | @@ -20,9 +22,12 @@ |
21 | 23 | } |
22 | 24 | $s .= "\n<select id='namespace' name='namespace' class='namespaceselector'>\n"; |
23 | 25 | $arr = $wgContLang->getFormattedNamespaces(); |
| 26 | + if( !is_null($all) ) { |
| 27 | + $arr = array( $all => wfMsg( 'namespacesall' ) ) + $arr; // should be first |
| 28 | + } |
24 | 29 | foreach( $arr as $index => $name ) { |
25 | | - # Content only |
26 | | - if($index < NS_MAIN || !in_array($index, $wgFlaggedRevsNamespaces) ) { |
| 30 | + # Content pages only (except 'all') |
| 31 | + if( $index !== $all && !in_array($index, $wgFlaggedRevsNamespaces) ) { |
27 | 32 | continue; |
28 | 33 | } |
29 | 34 | $name = $index !== 0 ? $name : wfMsg('blanknamespace'); |