Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -200,6 +200,7 @@ |
201 | 201 | 'revreview-filter-manual' => 'Manual', |
202 | 202 | 'revreview-filter-level-0' => 'Sighted versions', |
203 | 203 | 'revreview-filter-level-1' => 'Quality versions', |
| 204 | + 'revreview-filter-level-2' => 'Pristine versions', |
204 | 205 | 'revreview-statusfilter' => 'Status:', |
205 | 206 | 'revreview-typefilter' => 'Type:', |
206 | 207 | 'revreview-tagfilter' => 'Tag:', |
Index: trunk/extensions/FlaggedRevs/language/StablePages.i18n.php |
— | — | @@ -8,11 +8,15 @@ |
9 | 9 | $messages = array(); |
10 | 10 | |
11 | 11 | $messages['en'] = array( |
12 | | - 'stablepages' => 'Stable pages', |
13 | | - 'stablepages-stable' => 'stable version', |
14 | | - 'stablepages-text' => 'Below is a list of pages manually configured to show the stable version as the default page content for viewers.', |
15 | | - 'stablepages-none' => 'There are no pages in this list', |
16 | | - 'stablepages-config' => 'Configuration', |
| 12 | + 'stablepages' => 'Stable pages', |
| 13 | + 'stablepages-stable' => 'stable version', |
| 14 | + 'stablepages-text' => 'Below is a list of pages manually configured to show the stable version as the default page content for viewers.', |
| 15 | + 'stablepages-none' => 'There are no pages in this list', |
| 16 | + 'stablepages-config' => 'Configuration', |
| 17 | + 'stablepages-prec-none' => 'no precedence', |
| 18 | + 'stablepages-prec-quality' => 'quality precedence', |
| 19 | + 'stablepages-prec-pristine' => 'pristine precedence', |
| 20 | + 'stablepages-precedence' => 'Precedence:', |
17 | 21 | ); |
18 | 22 | |
19 | 23 | /** Message documentation (Message documentation) |
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | $this->skin = $wgUser->getSkin(); |
21 | 21 | |
22 | 22 | $this->namespace = $wgRequest->getInt( 'namespace' ); |
| 23 | + $this->precedence = $wgRequest->getInt( 'precedence', FlaggedRevs::getPrecedence() ); |
23 | 24 | |
24 | 25 | $this->showForm(); |
25 | 26 | $this->showPageList(); |
— | — | @@ -31,6 +32,8 @@ |
32 | 33 | $form = Xml::openElement( 'form', array( 'name' => 'stablepages', 'action' => $wgScript, 'method' => 'get' ) ); |
33 | 34 | $form .= "<fieldset><legend>".wfMsg('stablepages')."</legend>\n"; |
34 | 35 | $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' '; |
| 36 | + $form .= Xml::label( wfMsg('stablepages-precedence'), 'precedence', 'precedence' ) . ' '; |
| 37 | + $form .= FlaggedRevsXML::getPrecedenceMenu( $this->precedence ) . ' '; |
35 | 38 | $form .= " ".Xml::submitButton( wfMsg( 'go' ) ); |
36 | 39 | $form .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ); |
37 | 40 | $form .= "</fieldset></form>\n"; |
— | — | @@ -42,7 +45,7 @@ |
43 | 46 | global $wgOut, $wgUser, $wgLang; |
44 | 47 | # Take this opportunity to purge out expired configurations |
45 | 48 | FlaggedRevs::purgeExpiredConfigurations(); |
46 | | - $pager = new StablePagesPager( $this, array(), $this->namespace ); |
| 49 | + $pager = new StablePagesPager( $this, array(), $this->namespace, $this->precedence ); |
47 | 50 | if( $pager->getNumRows() ) { |
48 | 51 | $wgOut->addHTML( $pager->getNavigationBar() ); |
49 | 52 | $wgOut->addHTML( $pager->getBody() ); |
— | — | @@ -61,15 +64,23 @@ |
62 | 65 | $stitle = SpecialPage::getTitleFor( 'Stabilization' ); |
63 | 66 | $config = $this->skin->makeKnownLinkObj( $stitle, wfMsgHtml('stablepages-config'), |
64 | 67 | 'page=' . $title->getPrefixedUrl() ); |
65 | | - $stable = $this->skin->makeKnownLinkObj( $title, wfMsgHtml('stablepages-stable'), |
66 | | - 'stable=1' ); |
| 68 | + $stable = $this->skin->makeKnownLinkObj( $title, wfMsgHtml('stablepages-stable'), 'stable=1' ); |
| 69 | + |
| 70 | + if( intval($row->fpc_select) === FLAGGED_VIS_PRISTINE ) { |
| 71 | + $type = wfMsgHtml('stablepages-prec-pristine'); |
| 72 | + } else if( intval($row->fpc_select) === FLAGGED_VIS_NORMAL ) { |
| 73 | + $type = wfMsgHtml('stablepages-prec-quality'); |
| 74 | + } else { |
| 75 | + $type = wfMsgHtml('stablepages-prec-none'); |
| 76 | + } |
| 77 | + |
67 | 78 | if( $row->fpc_expiry != 'infinity' && strlen($row->fpc_expiry) ) { |
68 | 79 | $expiry_description = " (".wfMsgForContent( 'protect-expiring', $wgLang->timeanddate($row->fpc_expiry) ).")"; |
69 | 80 | } else { |
70 | 81 | $expiry_description = ""; |
71 | 82 | } |
72 | 83 | |
73 | | - return "<li>{$link} ({$config}) [{$stable}]{$expiry_description}</li>"; |
| 84 | + return "<li>{$link} ({$config}) [{$stable}] (<b>{$type}</b>) <i>{$expiry_description}</i></li>"; |
74 | 85 | } |
75 | 86 | } |
76 | 87 | |
— | — | @@ -79,7 +90,7 @@ |
80 | 91 | class StablePagesPager extends AlphabeticPager { |
81 | 92 | public $mForm, $mConds, $namespace; |
82 | 93 | |
83 | | - function __construct( $form, $conds = array(), $namespace=0 ) { |
| 94 | + function __construct( $form, $conds = array(), $namespace=0, $precedence=NULL ) { |
84 | 95 | $this->mForm = $form; |
85 | 96 | $this->mConds = $conds; |
86 | 97 | # Must be a content page... |
— | — | @@ -91,6 +102,7 @@ |
92 | 103 | $namespace = empty($wgFlaggedRevsNamespaces) ? -1 : $wgFlaggedRevsNamespaces[0]; |
93 | 104 | } |
94 | 105 | $this->namespace = $namespace; |
| 106 | + $this->precedence = $precedence; |
95 | 107 | parent::__construct(); |
96 | 108 | } |
97 | 109 | |
— | — | @@ -102,10 +114,13 @@ |
103 | 115 | $conds = $this->mConds; |
104 | 116 | $conds[] = 'page_id = fpc_page_id'; |
105 | 117 | $conds['fpc_override'] = 1; |
| 118 | + if( $this->precedence !== NULL && $this->precedence >= 0 ) { |
| 119 | + $conds['fpc_select'] = $this->precedence; |
| 120 | + } |
106 | 121 | $conds['page_namespace'] = $this->namespace; |
107 | 122 | return array( |
108 | 123 | 'tables' => array('flaggedpage_config','page'), |
109 | | - 'fields' => 'page_namespace,page_title,fpc_expiry,fpc_page_id', |
| 124 | + 'fields' => 'page_namespace,page_title,fpc_expiry,fpc_page_id,fpc_select', |
110 | 125 | 'conds' => $conds, |
111 | 126 | 'options' => array() |
112 | 127 | ); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -51,9 +51,24 @@ |
52 | 52 | $s .= Xml::option( wfMsg( "revreview-filter-level-0" ), 0, $selected===0 ); |
53 | 53 | if( FlaggedRevs::qualityVersions() ) |
54 | 54 | $s .= Xml::option( wfMsg( "revreview-filter-level-1" ), 1, $selected===1 ); |
| 55 | + # Pristine not tracked at sp:QualityOversight |
| 56 | + #if( FlaggedRevs::pristineVersions() ) |
| 57 | + # $s .= Xml::option( wfMsg( "revreview-filter-level-2" ), 2, $selected===2 ); |
55 | 58 | $s .= Xml::closeElement('select')."\n"; |
56 | 59 | return $s; |
57 | 60 | } |
| 61 | + |
| 62 | + public static function getPrecedenceMenu( $selected=null ) { |
| 63 | + wfLoadExtensionMessages( 'FlaggedRevs' ); |
| 64 | + $s = Xml::openElement( 'select', array('name' => 'precedence') ); |
| 65 | + $s .= Xml::option( wfMsg( "revreview-filter-level-0" ), FLAGGED_VIS_LATEST, $selected==FLAGGED_VIS_LATEST ); |
| 66 | + if( FlaggedRevs::qualityVersions() ) |
| 67 | + $s .= Xml::option( wfMsg( "revreview-filter-level-1" ), FLAGGED_VIS_NORMAL, $selected==FLAGGED_VIS_NORMAL ); |
| 68 | + if( FlaggedRevs::pristineVersions() ) |
| 69 | + $s .= Xml::option( wfMsg( "revreview-filter-level-2" ), FLAGGED_VIS_PRISTINE, $selected==FLAGGED_VIS_PRISTINE ); |
| 70 | + $s .= Xml::closeElement('select')."\n"; |
| 71 | + return $s; |
| 72 | + } |
58 | 73 | |
59 | 74 | /** |
60 | 75 | * Get a selector of "approved"/"unapproved" |