Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | '<fieldset><legend>' . wfMsgHtml('qualityoversight-legend') . '</legend><p>' . |
72 | 72 | Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ) . |
73 | 73 | FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' ' . |
74 | | - FlaggedRevsXML::getLevelMenu( $this->level ) . ' ' . |
| 74 | + FlaggedRevsXML::getLevelMenu( $this->level, 'all', 1 ) . ' ' . |
75 | 75 | Xml::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 20, $this->user ) . '<br/>' . |
76 | 76 | FlaggedRevsXML::getStatusFilterMenu( $this->status ) . ' ' . |
77 | 77 | FlaggedRevsXML::getAutoFilterMenu( $this->automatic ) . ' ' . |
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php |
— | — | @@ -21,8 +21,8 @@ |
22 | 22 | # Check if there is a featured level |
23 | 23 | $maxType = FlaggedRevs::pristineVersions() ? 2 : 1; |
24 | 24 | $this->namespace = $wgRequest->getInt( 'namespace' ); |
25 | | - $this->type = $wgRequest->getInt( 'level' ); |
26 | | - $this->type = $this->type <= $maxType ? $this->type : 0; |
| 25 | + $this->type = $wgRequest->getInt( 'level', -1 ); |
| 26 | + $this->type = min($this->type,$maxType); |
27 | 27 | |
28 | 28 | $this->showForm(); |
29 | 29 | $this->showPageList(); |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | if( count($wgFlaggedRevsNamespaces) > 1 ) { |
40 | 40 | $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' '; |
41 | 41 | } |
42 | | - $form .= self::getLevelMenu( $this->type ); |
| 42 | + $form .= FlaggedRevsXML::getLevelMenu( $this->type ); |
43 | 43 | |
44 | 44 | $form .= " ".Xml::submitButton( wfMsg( 'go' ) ); |
45 | 45 | $form .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ); |
— | — | @@ -84,21 +84,6 @@ |
85 | 85 | |
86 | 86 | return "<li>$link $stxt ($list) [$best]</li>"; |
87 | 87 | } |
88 | | - |
89 | | - /** |
90 | | - * Get a selector of review levels |
91 | | - * @param int $selected, selected level |
92 | | - */ |
93 | | - public static function getLevelMenu( $selected=null ) { |
94 | | - $form = Xml::openElement( 'select', array('name' => 'level') ); |
95 | | - $form .= Xml::option( wfMsg( "reviewedpages-lev-0" ), 0, $selected==0 ); |
96 | | - if( FlaggedRevs::qualityVersions() ) |
97 | | - $form .= Xml::option( wfMsg( "reviewedpages-lev-1" ), 1, $selected==1 ); |
98 | | - if( FlaggedRevs::pristineVersions() ) |
99 | | - $form .= Xml::option( wfMsg( "reviewedpages-lev-2" ), 2, $selected==2 ); |
100 | | - $form .= Xml::closeElement('select')."\n"; |
101 | | - return $form; |
102 | | - } |
103 | 88 | } |
104 | 89 | |
105 | 90 | /** |
— | — | @@ -131,13 +116,17 @@ |
132 | 117 | function getQueryInfo() { |
133 | 118 | $conds = $this->mConds; |
134 | 119 | $conds[] = 'page_id = fp_page_id'; |
135 | | - $conds['fp_quality'] = $this->type; |
136 | | - $conds['page_namespace'] = $this->namespace; |
| 120 | + $index = 'PRIMARY'; |
| 121 | + if( $this->type >= 0 ) { |
| 122 | + $conds['fp_quality'] = $this->type; |
| 123 | + $index = 'fp_quality_page'; |
| 124 | + } |
| 125 | + $conds['page_namespace'] = $this->namespace; // Sanity check NS |
137 | 126 | return array( |
138 | 127 | 'tables' => array('flaggedpages','page'), |
139 | 128 | 'fields' => 'page_namespace,page_title,page_len,fp_page_id', |
140 | 129 | 'conds' => $conds, |
141 | | - 'options' => array( 'USE INDEX' => array('flaggedpages' => 'fp_quality_page') ) |
| 130 | + 'options' => array( 'USE INDEX' => array('flaggedpages' => $index) ) |
142 | 131 | ); |
143 | 132 | } |
144 | 133 | |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -44,15 +44,20 @@ |
45 | 45 | /** |
46 | 46 | * Get a selector of review levels |
47 | 47 | * @param int $selected, selected level |
| 48 | + * @param bool $all all selector? |
| 49 | + * @param int $max max level? |
48 | 50 | */ |
49 | | - public static function getLevelMenu( $selected=null ) { |
| 51 | + public static function getLevelMenu( $selected=null, $all='all', $max=2 ) { |
50 | 52 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
51 | 53 | $s = "<label for='wpLevel'>" . wfMsgHtml('revreview-levelfilter') . "</label> "; |
52 | 54 | $s .= Xml::openElement( 'select', array('name' => 'level','id' => 'wpLevel') ); |
53 | | - $s .= Xml::option( wfMsg( "revreview-filter-all" ), -1, $selected===-1 ); |
| 55 | + if( $all === 'all' ) |
| 56 | + $s .= Xml::option( wfMsg( "revreview-filter-all" ), -1, $selected===-1 ); |
54 | 57 | $s .= Xml::option( wfMsg( 'revreview-lev-sighted' ), 0, $selected===0 ); |
55 | 58 | if( FlaggedRevs::qualityVersions() ) |
56 | 59 | $s .= Xml::option( wfMsg( 'revreview-lev-quality' ), 1, $selected===1 ); |
| 60 | + if( $max >= 2 && FlaggedRevs::pristineVersions() ) |
| 61 | + $s .= Xml::option( wfMsg( 'revreview-lev-pristine' ), 2, $selected===2 ); |
57 | 62 | # Note: Pristine not tracked at sp:QualityOversight (counts as quality) |
58 | 63 | $s .= Xml::closeElement('select')."\n"; |
59 | 64 | return $s; |