r60128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60127‎ | r60128 | r60129 >
Date:19:32, 16 December 2009
Author:aaron
Status:ok
Tags:
Comment:
* Don't show ProblemChanges if there are no tags
* ProblemChanges can now take no tag param, which will list items tag with anything
* Shorten legend a bit
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/ProblemChanges.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -519,22 +519,30 @@
520520 * Also sets $wgSpecialPages just to be consistent.
521521 */
522522 function efLoadFlaggedRevsSpecialPages( &$list ) {
523 - global $wgSpecialPages, $wgFlaggedRevsNamespaces, $wgFlaggedRevsOverride, $wgFlaggedRevsProtectLevels;
 523+ global $wgSpecialPages, $wgUseTagFilter;
 524+ global $wgFlaggedRevsNamespaces, $wgFlaggedRevsOverride, $wgFlaggedRevsProtectLevels;
 525+ // Show special pages only if FlaggedRevs is enabled on some namespaces
524526 if( !empty($wgFlaggedRevsNamespaces) ) {
525527 $list['RevisionReview'] = $wgSpecialPages['RevisionReview'] = 'RevisionReview';
526528 $list['StableVersions'] = $wgSpecialPages['StableVersions'] = 'StableVersions';
527 - if( empty($wgFlaggedRevsProtectLevels) )
 529+ // Protect levels define allowed stability settings
 530+ if( empty($wgFlaggedRevsProtectLevels) ) {
528531 $list['Stabilization'] = $wgSpecialPages['Stabilization'] = 'Stabilization';
 532+ }
529533 $list['UnreviewedPages'] = $wgSpecialPages['UnreviewedPages'] = 'UnreviewedPages';
530534 $list['OldReviewedPages'] = $wgSpecialPages['OldReviewedPages'] = 'OldReviewedPages';
531 - $list['ProblemChanges'] = $wgSpecialPages['ProblemChanges'] = 'ProblemChanges';
 535+ // Show tag filtered pending edit page if there are tags
 536+ if( $wgUseTagFilter && ChangeTags::listDefinedTags() ) {
 537+ $list['ProblemChanges'] = $wgSpecialPages['ProblemChanges'] = 'ProblemChanges';
 538+ }
532539 $list['ReviewedPages'] = $wgSpecialPages['ReviewedPages'] = 'ReviewedPages';
533540 $list['QualityOversight'] = $wgSpecialPages['QualityOversight'] = 'QualityOversight';
534541 $list['ValidationStatistics'] = $wgSpecialPages['ValidationStatistics'] = 'ValidationStatistics';
535 - if( !$wgFlaggedRevsOverride )
 542+ if( !$wgFlaggedRevsOverride ) {
536543 $list['StablePages'] = $wgSpecialPages['StablePages'] = 'StablePages';
537 - else
 544+ } else {
538545 $list['UnstablePages'] = $wgSpecialPages['UnstablePages'] = 'UnstablePages';
 546+ }
539547 }
540548 return true;
541549 }
Index: trunk/extensions/FlaggedRevs/language/ProblemChanges.i18n.php
@@ -9,7 +9,7 @@
1010
1111 $messages['en'] = array(
1212 'problemchanges' => 'Review tagged changes',
13 - 'problemchanges-legend' => 'List reviewed pages with tagged edits pending review',
 13+ 'problemchanges-legend' => 'List pages with tagged edits pending review',
1414 'problemchanges-none' => 'There are currently no pages meeting these criteria',
1515 'problemchanges-category' => 'Category:',
1616 );
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php
@@ -71,20 +71,19 @@
7272 "</fieldset></form>";
7373 # Add filter options
7474 $wgOut->addHTML( $form );
75 - # Add list output (skip if no tag given)
76 - $num = strlen($this->tag) && $pager->getNumRows();
77 - if( $num ) {
 75+ # Add list output
 76+ if( $pager->getNumRows() ) {
7877 $wgOut->addHTML( $pager->getNavigationBar() );
7978 $wgOut->addHTML( $pager->getBody() );
8079 $wgOut->addHTML( $pager->getNavigationBar() );
81 - } else if( strlen($this->tag) ) {
 80+ } else {
8281 $wgOut->addHTML( wfMsgExt('problemchanges-none', array('parse') ) );
8382 }
8483 // If this page is transcluded...
8584 } else {
86 - if( strlen($this->tag) && $pager->getNumRows() ) {
 85+ if( $pager->getNumRows() ) {
8786 $wgOut->addHTML( $pager->getBody() );
88 - } else if( strlen($this->tag) ) {
 87+ } else {
8988 $wgOut->addHTML( wfMsgExt('problemchanges-none', array('parse') ) );
9089 }
9190 }
@@ -299,7 +298,9 @@
300299 $conds[] = 'rev_page = fp_page_id';
301300 $conds[] = 'rev_id > fp_stable';
302301 $conds[] = 'ct_rev_id = rev_id';
303 - $conds['ct_tag'] = $this->tag;
 302+ if( $this->tag != '' ) {
 303+ $conds['ct_tag'] = $this->tag;
 304+ }
304305 $conds[] = 'page_id = fp_page_id';
305306 $useIndex = array('flaggedpages' => 'fp_pending_since', 'change_tag' => $ctIndex);
306307 # Filter by category

Status & tagging log