Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | class OldReviewedPages extends SpecialPage |
9 | 9 | { |
10 | 10 | function __construct() { |
11 | | - parent::__construct( 'OldReviewedPages', 'unreviewedpages' ); |
| 11 | + parent::__construct( 'OldReviewedPages' ); |
12 | 12 | // $this->includable( true ); |
13 | 13 | wfLoadExtensionMessages( 'OldReviewedPages' ); |
14 | 14 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
— | — | @@ -16,10 +16,6 @@ |
17 | 17 | function execute( $par ) { |
18 | 18 | global $wgRequest, $wgUser, $wgOut; |
19 | 19 | $this->setHeaders(); |
20 | | - if( !$wgUser->isAllowed( 'unreviewedpages' ) ) { |
21 | | - $wgOut->permissionRequired( 'unreviewedpages' ); |
22 | | - return; |
23 | | - } |
24 | 20 | $this->skin = $wgUser->getSkin(); |
25 | 21 | $this->namespace = $wgRequest->getIntOrNull( 'namespace' ); |
26 | 22 | $this->category = trim( $wgRequest->getVal( 'category' ) ); |
— | — | @@ -44,7 +40,7 @@ |
45 | 41 | } |
46 | 42 | |
47 | 43 | function showList( $par ) { |
48 | | - global $wgOut, $wgScript, $wgTitle, $wgFlaggedRevsNamespaces; |
| 44 | + global $wgOut, $wgScript, $wgUser, $wgFlaggedRevsNamespaces; |
49 | 45 | $limit = $this->parseParams( $par ); |
50 | 46 | $pager = new OldReviewedPagesPager( $this, $this->namespace, $this->category, |
51 | 47 | $this->size, $this->watched ); |
— | — | @@ -55,7 +51,7 @@ |
56 | 52 | $wgOut->addHTML( |
57 | 53 | "<form action=\"$action\" method=\"get\">\n" . |
58 | 54 | '<fieldset><legend>' . wfMsg('oldreviewedpages-legend') . '</legend>' . |
59 | | - Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ) |
| 55 | + Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) |
60 | 56 | ); |
61 | 57 | # Display dropdown as needed |
62 | 58 | if( count($wgFlaggedRevsNamespaces) > 1 ) { |
— | — | @@ -66,8 +62,11 @@ |
67 | 63 | Xml::input( 'category', 35, $this->category, array('id' => 'wpCategory') ) . '<br/>' . |
68 | 64 | Xml::label( wfMsg('oldreviewed-size'), 'wpSize' ) . ' ' . |
69 | 65 | Xml::input( 'size', 5, $this->size, array( 'id' => 'wpSize' ) ) . ' ' . |
70 | | - Xml::label( wfMsg('oldreviewed-watched'), 'wpWatched' ) . ' ' . |
71 | | - Xml::check( 'watched', $this->watched, array( 'id' => 'wpWatched' ) ) . |
| 66 | + ( $wgUser->getId() ? |
| 67 | + Xml::label( wfMsg('oldreviewed-watched'), 'wpWatched' ) . ' ' . |
| 68 | + Xml::check( 'watched', $this->watched, array( 'id' => 'wpWatched' ) ) |
| 69 | + : "" |
| 70 | + ) . |
72 | 71 | ' ' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . |
73 | 72 | "</fieldset></form>" |
74 | 73 | ); |
— | — | @@ -173,17 +172,25 @@ |
174 | 173 | } |
175 | 174 | |
176 | 175 | public function formatRow( $result ) { |
177 | | - global $wgLang; |
| 176 | + global $wgLang, $wgUser; |
178 | 177 | |
179 | 178 | $title = Title::makeTitle( $result->page_namespace, $result->page_title ); |
180 | 179 | $link = $this->skin->makeKnownLinkObj( $title ); |
181 | 180 | $css = $stxt = $review = ''; |
182 | 181 | $stxt = ChangesList::showCharacterDifference( $result->rev_len, $result->page_len ); |
183 | 182 | $review = $this->skin->makeKnownLinkObj( $title, wfMsg('oldreviewed-diff'), |
184 | | - "diff=cur&oldid={$result->fp_stable}&diffonly=0" ); |
| 183 | + "diff=cur&oldid={$result->fp_stable}&diffonly=0" ); |
185 | 184 | $quality = $result->fp_quality ? wfMsgHtml('oldreviewedpages-quality') : wfMsgHtml('oldreviewedpages-stable'); |
186 | 185 | # Is anybody watching? |
187 | | - $uw = UnreviewedPages::usersWatching( $title ); |
| 186 | + if( $wgUser->isAllowed( 'unreviewedpages' ) ) { |
| 187 | + $uw = UnreviewedPages::usersWatching( $title ); |
| 188 | + $watching = $uw ? |
| 189 | + wfMsgExt('oldreviewedpages-watched','parsemag',$uw,$uw) : wfMsgHtml('oldreviewedpages-unwatched'); |
| 190 | + $watching = ' '.$watching; |
| 191 | + } else { |
| 192 | + $uw = -1; |
| 193 | + $watching = ''; // leave out data |
| 194 | + } |
188 | 195 | # Get how long the first unreviewed edit has been waiting... |
189 | 196 | if( $result->fp_pending_since ) { |
190 | 197 | static $currentTime; |
— | — | @@ -207,10 +214,8 @@ |
208 | 215 | } else { |
209 | 216 | $age = ""; // wtf? |
210 | 217 | } |
211 | | - $watching = $uw ? |
212 | | - wfMsgExt("oldreviewedpages-watched",array('parsemag'),$uw,$uw) : wfMsgHtml("oldreviewedpages-unwatched"); |
213 | 218 | |
214 | | - return( "<li{$css}>{$link} {$stxt} ({$review}) <i>{$age}</i> <strong>[{$quality}]</strong> {$watching}</li>" ); |
| 219 | + return( "<li{$css}>{$link} {$stxt} ({$review}) <i>{$age}</i> <strong>[{$quality}]</strong>{$watching}</li>" ); |
215 | 220 | } |
216 | 221 | |
217 | 222 | /** |
— | — | @@ -232,7 +237,7 @@ |
233 | 238 | } |
234 | 239 | |
235 | 240 | protected static function getLineClass( $hours, $uw ) { |
236 | | - if( !$uw ) |
| 241 | + if( $uw == 0 ) |
237 | 242 | return 'fr-unreviewed-unwatched'; |
238 | 243 | else |
239 | 244 | return ""; |