r51104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51103‎ | r51104 | r51105 >
Date:08:21, 28 May 2009
Author:aaron
Status:ok
Tags:
Comment:
Minor S&R code cleanup
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsXML.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiReview.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/LikedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/svggraph/svgGraph.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -582,7 +582,7 @@
583583 $wgExtNewFields[] = array( 'reader_feedback', 'rfb_ratings', "$base/archives/patch-rfb_ratings.sql" );
584584 $wgExtNewFields[] = array( 'flaggedpage_config', 'fpc_level', "$base/archives/patch-fpc_level.sql" );
585585 $wgExtNewTables[] = array( 'flaggedpage_pending', "$base/archives/patch-flaggedpage_pending.sql" );
586 - } else if( $wgDBtype == 'postgres' ) {
 586+ } elseif( $wgDBtype == 'postgres' ) {
587587 $wgExtNewTables[] = array( 'flaggedrevs', "$base/FlaggedRevs.pg.sql" ); // Initial install tables
588588 $wgExtPGNewFields[] = array('flaggedpage_config', 'fpc_expiry', "TIMESTAMPTZ NULL" );
589589 $wgExtNewIndexes[] = array('flaggedpage_config', 'fpc_expiry', "$base/postgres/patch-expiry-index.sql" );
Index: trunk/extensions/FlaggedRevs/svggraph/svgGraph.php
@@ -541,7 +541,7 @@
542542 if ($this->rotTagsX == 0) {
543543 $transform = "transform='translate(0, $innerPadding)'";
544544 $this->svgPlot .= "<text text-anchor='middle' $transform dy='1em' x='$u' y='$bottom'>$text</text>\n";
545 - } else if($this->rotTagsX > 0) {
 545+ } elseif($this->rotTagsX > 0) {
546546 $transform = "transform='translate(0, $innerPadding) rotate({$this->rotTagsX} $u $bottom)'";
547547 $this->svgPlot .= "<text text-anchor='start' $transform x='$u' y='$bottom'>$text</text>\n";
548548 } else {
Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc
@@ -58,7 +58,7 @@
5959 $file = $crow ? $row->page_title : null;
6060 }
6161 # Leave it alone if already set
62 - } else if( $row->fr_img_name && $row->page_namespace == NS_IMAGE ) {
 62+ } elseif( $row->fr_img_name && $row->page_namespace == NS_IMAGE ) {
6363 $time = $row->fr_img_timestamp;
6464 $sha1 = $row->fr_img_sha1;
6565 $file = $row->fr_img_name;
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -18,7 +18,7 @@
1919 global $wgArticle, $wgTitle;
2020 if( !empty( $wgArticle ) ) {
2121 return self::getInstance( $wgArticle );
22 - } else if( !empty( $wgTitle ) ) {
 22+ } elseif( !empty( $wgTitle ) ) {
2323 return self::getTitleInstance( $wgTitle );
2424 }
2525 return null;
@@ -95,7 +95,7 @@
9696 # Viewer sees stable by default
9797 return !( $wgRequest->getIntOrNull('stable') === 0 );
9898 # We are explicity requesting the stable version?
99 - } else if( $wgRequest->getIntOrNull('stable') === 1 ) {
 99+ } elseif( $wgRequest->getIntOrNull('stable') === 1 ) {
100100 return true;
101101 }
102102 return false;
@@ -172,7 +172,7 @@
173173 global $wgFlaggedRevsReviewForDefault;
174174 if( !FlaggedRevs::isPageReviewable( $this->parent->getTitle() ) ) {
175175 return false;
176 - } else if( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) {
 176+ } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) {
177177 return false;
178178 }
179179 return true;
@@ -187,7 +187,7 @@
188188 global $wgFlaggedRevsReviewForDefault;
189189 if( FlaggedRevs::isPagePatrollable( $this->parent->getTitle() ) ) {
190190 return true;
191 - } else if( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) {
 191+ } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) {
192192 return true;
193193 }
194194 return false;
@@ -298,7 +298,7 @@
299299 if( $this->isPageLocked() ) {
300300 $prot = "<span class='fr-icon-locked' title=\"".
301301 wfMsgHtml('revreview-locked-title')."\"></span>";
302 - } else if( $this->isPageUnlocked() ) {
 302+ } elseif( $this->isPageUnlocked() ) {
303303 $prot = "<span class='fr-icon-unlocked' title=\"".
304304 wfMsgHtml('revreview-unlocked-title')."\"></span>";
305305 }
@@ -378,7 +378,7 @@
379379 $pcache = false;
380380 // Looking at some specific old revision (&oldid=x) or if FlaggedRevs is not
381381 // set to override given the relevant conditions (like &action=protect).
382 - } else if( !$stable && !$this->pageOverride() ) {
 382+ } elseif( !$stable && !$this->pageOverride() ) {
383383 $revsSince = FlaggedRevs::getRevCountSince( $this->parent, $srev->getRevId() );
384384 $synced = false;
385385 # We only care about syncing if not viewing an old stable version
@@ -479,7 +479,7 @@
480480 if( $synced ) {
481481 # uses messages 'revreview-quality-same', 'revreview-basic-same'
482482 $msg .= '-same';
483 - } else if( $revsSince == 0 ) {
 483+ } elseif( $revsSince == 0 ) {
484484 # uses messages 'revreview-quality-i', 'revreview-basic-i'
485485 $msg .= '-i';
486486 }
@@ -502,9 +502,9 @@
503503 }
504504 # Some checks for which tag CSS to use
505505 if( FlaggedRevs::useSimpleUI() ) $tagClass = 'flaggedrevs_short';
506 - else if( $simpleTag ) $tagClass = 'flaggedrevs_notice';
507 - else if( $pristine ) $tagClass = 'flaggedrevs_pristine';
508 - else if( $quality ) $tagClass = 'flaggedrevs_quality';
 506+ elseif( $simpleTag ) $tagClass = 'flaggedrevs_notice';
 507+ elseif( $pristine ) $tagClass = 'flaggedrevs_pristine';
 508+ elseif( $quality ) $tagClass = 'flaggedrevs_quality';
509509 else $tagClass = 'flaggedrevs_basic';
510510 # Wrap tag contents in a div
511511 if( $tag !='' ) {
@@ -533,7 +533,7 @@
534534 $time = false;
535535 if( $reqId = $wgRequest->getVal('stableid') ) {
536536 $frev = FlaggedRevision::newFromTitle( $this->parent->getTitle(), $reqId );
537 - } else if( $this->pageOverride() ) {
 537+ } elseif( $this->pageOverride() ) {
538538 $frev = $this->getStableRev();
539539 }
540540 if( !is_null($frev) ) {
@@ -607,7 +607,7 @@
608608 wfMsgExt($msg,array('parseinline')) . "</div>";
609609 }
610610 # Let new users know about review procedure a tag
611 - } else if( !$wgUser->getId() && $this->showStableByDefault() ) {
 611+ } elseif( !$wgUser->getId() && $this->showStableByDefault() ) {
612612 wfLoadExtensionMessages( 'FlaggedRevs' );
613613 $warning = "<div id='mw-editwarningtag' class='flaggedrevs_editnotice plainlinks'>" .
614614 wfMsgExt('revreview-editnotice',array('parseinline')) . "</div>";
@@ -624,7 +624,7 @@
625625 if( $this->isPageLocked() ) {
626626 $prot = "<span class='fr-icon-locked' title=\"".
627627 wfMsgHtml('revreview-locked-title')."\"></span>";
628 - } else if( $this->isPageUnlocked() ) {
 628+ } elseif( $this->isPageUnlocked() ) {
629629 $prot = "<span class='fr-icon-unlocked' title=\"".
630630 wfMsgHtml('revreview-unlocked-title')."\"></span>";
631631 }
@@ -716,7 +716,7 @@
717717 $this->parent->getTitle()->getPrefixedText(), '', 1 );
718718 $wgOut->addHTML( "</div>" );
719719 # ...or unstable
720 - } else if( $this->isPageUnlocked() ) {
 720+ } elseif( $this->isPageUnlocked() ) {
721721 wfLoadExtensionMessages( 'FlaggedRevs' );
722722 $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>" );
723723 $wgOut->addWikiMsg( 'revreview-unlocked' );
@@ -826,7 +826,7 @@
827827 $wgOut->prependHTML( "<span class='plainlinks'>" .
828828 wfMsgExt( 'revreview-visibility',array('parseinline'),
829829 $title->getPrefixedText() ) . "</span>" );
830 - } else if( $frev ) {
 830+ } elseif( $frev ) {
831831 $wgOut->prependHTML( "<span class='plainlinks'>" .
832832 wfMsgExt( 'revreview-visibility2',array('parseinline'),
833833 $title->getPrefixedText() ) . "</span>" );
@@ -901,7 +901,7 @@
902902 $draftTabCss = '';
903903 $stableTabCss = 'selected';
904904 // We are looking at the talk page or diffs/hist/oldids
905 - } else if( !(self::isViewAction($action) || $action=='edit') || $skin->mTitle->isTalkPage() ) {
 905+ } elseif( !(self::isViewAction($action) || $action=='edit') || $skin->mTitle->isTalkPage() ) {
906906 $draftTabCss = '';
907907 $stableTabCss = '';
908908 // We are looking at the current revision or in edit mode
@@ -1063,7 +1063,7 @@
10641064 $notice = '';
10651065 if( count($changeList) > 0 ) {
10661066 $notice = '<br/>' . wfMsgExt('revreview-update-use', array('parseinline'));
1067 - } else if( !$synced ) {
 1067+ } elseif( !$synced ) {
10681068 $diff->mTitle->invalidateCache(); // bad cache, said they were not synced
10691069 }
10701070
@@ -1071,12 +1071,12 @@
10721072 if( empty($changeList) && $wgUser->isAllowed('review') ) {
10731073 $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" .
10741074 wfMsgExt('revreview-update-none', array('parseinline')).$notice.'</div>' );
1075 - } else if( !empty($changeList) && $wgUser->isAllowed('review') ) {
 1075+ } elseif( !empty($changeList) && $wgUser->isAllowed('review') ) {
10761076 $changeList = implode(', ',$changeList);
10771077 $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" .
10781078 wfMsgExt('revreview-update', array('parseinline')).'&nbsp;'.
10791079 $changeList.$notice.'</div>' );
1080 - } else if( !empty($changeList) ) {
 1080+ } elseif( !empty($changeList) ) {
10811081 $changeList = implode(', ',$changeList);
10821082 $wgOut->addHTML( "<div id='mw-difftostable' class='flaggedrevs_diffnotice plainlinks'>" .
10831083 wfMsgExt('revreview-update-includes', array('parseinline')).'&nbsp;'.
@@ -1409,7 +1409,7 @@
14101410 }
14111411 $form .= Xml::closeElement('select')."\n";
14121412 # If there are more than two qualities (none, 1 and more) current user gets radio buttons
1413 - } else if( $quantity > 2 ) {
 1413+ } elseif( $quantity > 2 ) {
14141414 foreach( $label as $i => $name ) {
14151415 $attribs = array( 'class' => "fr-rating-option-$i", 'onchange' => "updateRatingForm()" );
14161416 $form .= Xml::radioLabel( FlaggedRevs::getTagMsg($name), "wp$quality", $i, "wp$quality".$i,
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -121,7 +121,7 @@
122122 foreach( $wgFlaggedRevsExceptions as $group ) {
123123 if( $group == 'user' ) {
124124 return ( !$wgUser->isAnon() );
125 - } else if( in_array( $group, $wgUser->getGroups() ) ) {
 125+ } elseif( in_array( $group, $wgUser->getGroups() ) ) {
126126 return true;
127127 }
128128 }
@@ -615,7 +615,7 @@
616616 $value = self::getMemcValue( $wgMemc->get($key), $article );
617617 if( $value === "true" ) {
618618 return true;
619 - } else if( $value === "false" ) {
 619+ } elseif( $value === "false" ) {
620620 return false;
621621 }
622622 # If parseroutputs not given, fetch them...
@@ -663,7 +663,7 @@
664664 # If this is the case, the current revision will have a newer template or image version used somewhere.
665665 if( $currentOutput->fr_newestImageTime > $stableOutput->fr_newestImageTime ) {
666666 $synced = false;
667 - } else if( $currentOutput->fr_newestTemplateID > $stableOutput->fr_newestTemplateID ) {
 667+ } elseif( $currentOutput->fr_newestTemplateID > $stableOutput->fr_newestTemplateID ) {
668668 $synced = false;
669669 } else {
670670 $synced = true;
@@ -1063,7 +1063,7 @@
10641064 public static function getLevelTier( $flags ) {
10651065 if( self::isPristine($flags ) )
10661066 return FR_PRISTINE;
1067 - else if( self::isQuality($flags ) )
 1067+ elseif( self::isQuality($flags ) )
10681068 return FR_QUALITY;
10691069 else
10701070 return 0;
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -33,7 +33,7 @@
3434 $this->mTitle = isset($row->page_namespace) && isset($row->page_title) ?
3535 Title::makeTitleSafe( $row->page_namespace, $row->page_title ) : null;
3636 $this->mFlags = isset($row->fr_flags) ? explode(',',$row->fr_flags) : null;
37 - } else if( is_array($row) ) {
 37+ } elseif( is_array($row) ) {
3838 $this->mRevId = intval( $row['fr_rev_id'] );
3939 $this->mPageId = intval( $row['fr_page_id'] );
4040 $this->mTimestamp = $row['fr_timestamp'];
@@ -160,7 +160,7 @@
161161 if( $row && $config['select'] == FLAGGED_VIS_PRISTINE ) {
162162 // we have what we want already
163163 # Look for the latest quality revision...
164 - } else if( FlaggedRevs::qualityVersions() && $config['select'] != FLAGGED_VIS_LATEST ) {
 164+ } elseif( FlaggedRevs::qualityVersions() && $config['select'] != FLAGGED_VIS_LATEST ) {
165165 // If we found a pristine rev above, this one must be newer...
166166 $newerClause = $row ? "fr_rev_id > {$row->fr_rev_id}" : "1 = 1";
167167 $qrow = $dbw->selectRow( array('flaggedrevs','revision'),
@@ -245,8 +245,8 @@
246246 * @returns Array basic select fields (not including text/text flags)
247247 */
248248 public static function selectFields() {
249 - return array('fr_rev_id','fr_page_id','fr_user','fr_timestamp','fr_comment','fr_quality',
250 - 'fr_tags','fr_img_name', 'fr_img_sha1', 'fr_img_timestamp');
 249+ return array('fr_rev_id','fr_page_id','fr_user','fr_timestamp','fr_comment',
 250+ 'fr_quality','fr_tags','fr_img_name', 'fr_img_sha1', 'fr_img_timestamp');
251251 }
252252
253253 /**
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -24,9 +24,9 @@
2525 if( $wgRequest->wasPosted() ) {
2626 if( $wgUser->isBlocked( !$confirm ) ) {
2727 return $wgOut->blockedPage();
28 - } else if( !$this->isAllowed ) {
 28+ } elseif( !$this->isAllowed ) {
2929 return $wgOut->permissionRequired( 'stablesettings' );
30 - } else if( wfReadOnly() ) {
 30+ } elseif( wfReadOnly() ) {
3131 return $wgOut->readOnlyPage();
3232 }
3333 }
@@ -41,10 +41,10 @@
4242 # We need a page...
4343 if( is_null($this->page) ) {
4444 return $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
45 - } else if( !$this->page->exists() ) {
 45+ } elseif( !$this->page->exists() ) {
4646 return $wgOut->addHTML( wfMsgExt( 'stabilization-notexists', array('parseinline'),
4747 $this->page->getPrefixedText() ) );
48 - } else if( !FlaggedRevs::isPageReviewable( $this->page ) ) {
 48+ } elseif( !FlaggedRevs::isPageReviewable( $this->page ) ) {
4949 return $wgOut->addHTML( wfMsgExt( 'stabilization-notcontent', array('parseinline'),
5050 $this->page->getPrefixedText() ) );
5151 }
@@ -118,7 +118,7 @@
119119 if( val == 'existing' )
120120 document.getElementById('mwStabilize-expiry').value = ".
121121 Xml::encodeJsVar($this->oldExpiry).";
122 - else if( val != 'othertime' )
 122+ elseif( val != 'othertime' )
123123 document.getElementById('mwStabilize-expiry').value = val;
124124 }
125125 </script>"
@@ -359,7 +359,7 @@
360360 $changed = ($dbw->affectedRows() != 0); // did this do anything?
361361 # Otherwise, add a row unless we are just setting it as the site default,
362362 # or it is the same the current one...
363 - } else if( !$reset ) {
 363+ } elseif( !$reset ) {
364364 if( !$row || $row->fpc_select != $this->select || $row->fpc_override != $this->override
365365 || $row->fpc_level != $this->autoreview || $row->fpc_expiry != $expiry )
366366 {
@@ -441,7 +441,7 @@
442442 FlaggedRevs::autoReviewEdit( $article, $wgUser, $text, $nullRevision, $flags, true );
443443 $invalidate = false; // already done with auto-review
444444 // ...otherwise, go to diff if possible
445 - } else if( $frev ) {
 445+ } elseif( $frev ) {
446446 $query = "oldid={$frev->getRevId()}&diff=cur&diffonly=0";
447447 } else {
448448 // can't autoreview and no diff to show...
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemPages_body.php
@@ -62,7 +62,7 @@
6363 $wgOut->addHTML( $pager->getNavigationBar() );
6464 $wgOut->addHTML( $pager->getBody() );
6565 $wgOut->addHTML( $pager->getNavigationBar() );
66 - } else if( $this->tag ) { // must select first...
 66+ } elseif( $this->tag ) { // must select first...
6767 $wgOut->addHTML( wfMsgExt('problempages-none', array('parse') ) );
6868 }
6969 }
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -99,7 +99,7 @@
100100 $this->dims[$tag] = $wgRequest->getIntOrNull( "wp$tag" );
101101 if( $this->dims[$tag] === 0 ) {
102102 $this->unapprovedTags++;
103 - } else if( is_null($this->dims[$tag]) ) {
 103+ } elseif( is_null($this->dims[$tag]) ) {
104104 # This happens if we uncheck a checkbox
105105 $this->unapprovedTags++;
106106 $this->dims[$tag] = 0;
@@ -117,7 +117,7 @@
118118 $valid = true;
119119 if( $this->unapprovedTags && $this->unapprovedTags < count( FlaggedRevs::getDimensions() ) ) {
120120 $valid = false;
121 - } else if( !$wgUser->matchEditToken( $wgRequest->getVal('wpEditToken') ) ) {
 121+ } elseif( !$wgUser->matchEditToken( $wgRequest->getVal('wpEditToken') ) ) {
122122 $valid = false;
123123 }
124124 # Submit or display info on failure
@@ -128,11 +128,11 @@
129129 $wgOut->setPageTitle( wfMsgHtml('actioncomplete') );
130130 $wgOut->addHTML( $this->showSuccess( $approved, true ) );
131131 // Sync failure for flagging
132 - } else if( is_array($status) && $approved ) {
 132+ } elseif( is_array($status) && $approved ) {
133133 $wgOut->setPageTitle( wfMsgHtml('internalerror') );
134134 $wgOut->addHTML( $this->showSyncFailure( $status, true ) );
135135 // Failure for unflagging
136 - } else if( $status === false && !$approved ) {
 136+ } elseif( $status === false && !$approved ) {
137137 $wgOut->redirect( $this->page->getFullUrl() );
138138 // Any other fail...
139139 } else {
@@ -265,9 +265,9 @@
266266 list($approved,$status) = $form->submit();
267267 if( $status === true ) {
268268 return '<suc#>'.$form->showSuccess( $approved );
269 - } else if( $approved && is_array($status) ) {
 269+ } elseif( $approved && is_array($status) ) {
270270 return '<err#>'.$form->showSyncFailure( $status );
271 - } else if( $approved ) {
 271+ } elseif( $approved ) {
272272 return '<err#>' . wfMsg( 'revreview-revnotfound' );
273273 } else { // hmmm?
274274 return '<err#>';
@@ -589,15 +589,15 @@
590590 $synced = true;
591591 if( $stableOutput->fr_newestImageTime != $flaggedOutput->fr_newestImageTime )
592592 $synced = false;
593 - else if( $stableOutput->fr_newestTemplateID != $flaggedOutput->fr_newestTemplateID )
 593+ elseif( $stableOutput->fr_newestTemplateID != $flaggedOutput->fr_newestTemplateID )
594594 $synced = false;
595 - else if( $oldfrev->getTags() != $flags )
 595+ elseif( $oldfrev->getTags() != $flags )
596596 $synced = false;
597 - else if( $oldfrev->getFileSha1() != @$fileData['sha1'] )
 597+ elseif( $oldfrev->getFileSha1() != @$fileData['sha1'] )
598598 $synced = false;
599 - else if( $oldfrev->getComment() != $this->notes )
 599+ elseif( $oldfrev->getComment() != $this->notes )
600600 $synced = false;
601 - else if( $oldfrev->getQuality() != $quality )
 601+ elseif( $oldfrev->getQuality() != $quality )
602602 $synced = false;
603603 # Don't review if the same
604604 if( $synced ) {
@@ -653,7 +653,7 @@
654654 $includesSynced = true;
655655 if( $poutput->fr_newestImageTime > $stableOutput->fr_newestImageTime ) {
656656 $includesSynced = false;
657 - } else if( $poutput->fr_newestTemplateID > $stableOutput->fr_newestTemplateID ) {
 657+ } elseif( $poutput->fr_newestTemplateID > $stableOutput->fr_newestTemplateID ) {
658658 $includesSynced = false;
659659 }
660660 $u->fr_stableRev = $sv; // no need to re-fetch this!
@@ -801,9 +801,9 @@
802802 $highest = count($levels) - 1; // highest valid level
803803 if( !self::userCan($qal,$level,$config) ) {
804804 return false;
805 - } else if( isset($oldflags[$qal]) && !self::userCan($qal,$oldflags[$qal]) ) {
 805+ } elseif( isset($oldflags[$qal]) && !self::userCan($qal,$oldflags[$qal]) ) {
806806 return false;
807 - } else if( $level < 0 || $level > $highest ) {
 807+ } elseif( $level < 0 || $level > $highest ) {
808808 return false;
809809 }
810810 }
@@ -902,7 +902,7 @@
903903 $action = (FlaggedRevs::isQuality($dims) || FlaggedRevs::isQuality($oldDims)) ? 'approve2' : 'approve';
904904 if( !$stableId ) { // first time
905905 $action .= $isAuto ? "-ia" : "-i";
906 - } else if( $isAuto ) { // automatic
 906+ } elseif( $isAuto ) { // automatic
907907 $action .= "-a";
908908 }
909909 } else { // depreciated
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -93,7 +93,7 @@
9494 $actions['approve2'] = 0;
9595 $actions['approve2-i'] = 0;
9696 $actions['unapprove2'] = 0;
97 - } else if( $this->level === 1 ) { // quality revisions
 97+ } elseif( $this->level === 1 ) { // quality revisions
9898 $actions['approve'] = 0;
9999 $actions['approve-a'] = 0;
100100 $actions['approve-i'] = 0;
@@ -106,13 +106,13 @@
107107 $actions['approve2'] = 0;
108108 $actions['unapprove'] = 0;
109109 $actions['unapprove2'] = 0;
110 - } else if( $this->status === 2 ) { // re-approved
 110+ } elseif( $this->status === 2 ) { // re-approved
111111 $actions['approve-i'] = 0;
112112 $actions['approve-ia'] = 0;
113113 $actions['approve2-i'] = 0;
114114 $actions['unapprove'] = 0;
115115 $actions['unapprove2'] = 0;
116 - } else if( $this->status === 3 ) { // depreciated
 116+ } elseif( $this->status === 3 ) { // depreciated
117117 $actions['approve'] = 0;
118118 $actions['approve-a'] = 0;
119119 $actions['approve-i'] = 0;
@@ -123,7 +123,7 @@
124124 if( $this->automatic === 0 ) { // manual review
125125 $actions['approve-a'] = 0;
126126 $actions['approve-ia'] = 0;
127 - } else if( $this->automatic === 1 ) { // auto-reviewed
 127+ } elseif( $this->automatic === 1 ) { // auto-reviewed
128128 $actions['approve'] = 0;
129129 $actions['approve-i'] = 0;
130130 $actions['approve2'] = 0;
Index: trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php
@@ -37,7 +37,7 @@
3838 if( is_null($this->page) ) {
3939 $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
4040 return;
41 - } else if( !FlaggedRevs::isPageRateable( $this->page ) ) {
 41+ } elseif( !FlaggedRevs::isPageRateable( $this->page ) ) {
4242 $wgOut->addHTML( wfMsgExt('readerfeedback-main',array('parse')) );
4343 return;
4444 }
@@ -128,7 +128,7 @@
129129 // ...if not, then regenerate it
130130 if( $sExt === 'svg' && !$exists ) {
131131 $exists = $this->makeSvgGraph($tag,$filePath);
132 - } else if( $sExt === 'png' && !$exists ) {
 132+ } elseif( $sExt === 'png' && !$exists ) {
133133 $exists = $this->makePngGraph($tag,$filePath);
134134 }
135135 if( $exists ) $data = true;
@@ -166,7 +166,7 @@
167167 $table = fread( $fp, filesize($filePath) );
168168 fclose( $fp );
169169 $html .= '<h2>' . wfMsgHtml("readerfeedback-$tag") . '</h2>' . $table . "\n";
170 - } else if( $table = $this->makeHTMLTable( $tag, $filePath ) ) {
 170+ } elseif( $table = $this->makeHTMLTable( $tag, $filePath ) ) {
171171 $html .= '<h2>' . wfMsgHtml("readerfeedback-$tag") . '</h2>' . $table . "\n";
172172 }
173173 break;
@@ -564,7 +564,7 @@
565565 global $wgSvgGraphDir, $wgPHPlotDir;
566566 if( $wgSvgGraphDir ) {
567567 $ext = 'svg';
568 - } else if( $wgPHPlotDir ) {
 568+ } elseif( $wgPHPlotDir ) {
569569 $ext = 'png';
570570 } else {
571571 $ext = 'html';
Index: trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php
@@ -55,7 +55,7 @@
5656 if( $this->dims[$tag] === NULL ) { // nothing sent at all :(
5757 $wgOut->redirect( $this->page->getLocalUrl() );
5858 return;
59 - } else if( $this->dims[$tags] === -1 ) {
 59+ } elseif( $this->dims[$tags] === -1 ) {
6060 $unsureCount++;
6161 }
6262 }
@@ -146,7 +146,7 @@
147147 $form->dims[$p] = intval($val);
148148 if( $form->dims[$p] === NULL ) { // nothing sent at all :(
149149 return '<err#>' . wfMsg('formerror'); // bad range
150 - } else if( $form->dims[$p] === -1 ) {
 150+ } elseif( $form->dims[$p] === -1 ) {
151151 $unsureCount++;
152152 }
153153 }
Index: trunk/extensions/FlaggedRevs/specialpages/LikedPages_body.php
@@ -62,7 +62,7 @@
6363 $wgOut->addHTML( $pager->getNavigationBar() );
6464 $wgOut->addHTML( $pager->getBody() );
6565 $wgOut->addHTML( $pager->getNavigationBar() );
66 - } else if( $this->tag ) { // must select first...
 66+ } elseif( $this->tag ) { // must select first...
6767 $wgOut->addHTML( wfMsgExt('likedpages-none', array('parse') ) );
6868 }
6969 }
Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php
@@ -230,7 +230,7 @@
231231 $days = round($hours/24,0);
232232 $age = wfMsgExt('oldreviewedpages-days',array('parsemag'),$days);
233233 // If one or more hours, use hours
234 - } else if( $hours >= 1 ) {
 234+ } elseif( $hours >= 1 ) {
235235 $hours = round($hours,0);
236236 $age = wfMsgExt('oldreviewedpages-hours',array('parsemag'),$hours);
237237 } else {
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -68,7 +68,7 @@
6969
7070 if( intval($row->fpc_select) === FLAGGED_VIS_PRISTINE ) {
7171 $type = wfMsgHtml('stablepages-prec-pristine');
72 - } else if( intval($row->fpc_select) === FLAGGED_VIS_QUALITY ) {
 72+ } elseif( intval($row->fpc_select) === FLAGGED_VIS_QUALITY ) {
7373 $type = wfMsgHtml('stablepages-prec-quality');
7474 } else {
7575 $type = wfMsgHtml('stablepages-prec-none');
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php
@@ -207,7 +207,7 @@
208208 if( $pristine ) {
209209 $tagClass = 'flaggedrevs-box3';
210210 $color = 'flaggedrevs-color-3';
211 - } else if( $quality ) {
 211+ } elseif( $quality ) {
212212 $tagClass = 'flaggedrevs-box2';
213213 $color = 'flaggedrevs-color-2';
214214 } else {
@@ -218,7 +218,7 @@
219219 if( $synced ) {
220220 $msg = $quality ? 'revreview-quality-same' : 'revreview-basic-same';
221221 $html = wfMsgExt($msg, array('parseinline'), $frev->getRevId(), $time, $revsSince );
222 - } else if( $old ) {
 222+ } elseif( $old ) {
223223 $msg = $quality ? 'revreview-quality-old' : 'revreview-basic-old';
224224 $html = wfMsgExt($msg, array('parseinline'), $frev->getRevId(), $time );
225225 } else {
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -450,7 +450,7 @@
451451 if( $isKnownLocal ) {
452452 $isLocalFile = true; // no need to check
453453 # Load the image if needed (note that time === '0' means we have no image)
454 - } else if( $time !== "0" ) {
 454+ } elseif( $time !== "0" ) {
455455 $file = $file ? $file : self::getLocalFile( $title, $time ); # FIXME: would be nice not to double fetch!
456456 $isLocalFile = $file && $file->exists() && $file->isLocal();
457457 }
@@ -536,7 +536,7 @@
537537 if( $isKnownLocal ) {
538538 $isLocalFile = true; // no need to check
539539 # Load the image if needed (note that time === '0' means we have no image)
540 - } else if( $time !== "0" ) {
 540+ } elseif( $time !== "0" ) {
541541 $file = $file ? $file : self::getLocalFile( $nt, $time ); # FIXME: would be nice not to double fetch!
542542 $isLocalFile = $file && $file->exists() && $file->isLocal();
543543 }
@@ -775,7 +775,7 @@
776776 if( !$prevRevId ) {
777777 $reviewableNewPage = (bool)$wgFlaggedRevsAutoReviewNew;
778778 // Edits to existing pages
779 - } else if( $baseRevId ) {
 779+ } elseif( $baseRevId ) {
780780 $frev = FlaggedRevision::newFromTitle( $title, $baseRevId, FR_MASTER );
781781 # If the base revision was not reviewed, check if the previous one was.
782782 # This should catch null edits as well as normal ones.
@@ -1462,11 +1462,11 @@
14631463 global $wgFlaggedRevsNamespaces;
14641464 if( !in_array($row->page_namespace,$wgFlaggedRevsNamespaces) ) {
14651465 // do nothing
1466 - } else if( isset($row->fr_quality) ) {
 1466+ } elseif( isset($row->fr_quality) ) {
14671467 $ret = '<span class="'.FlaggedRevsXML::getQualityColor($row->fr_quality).'">'.$ret.'</span>';
1468 - } else if( isset($row->fp_stable) && $row->rev_id > $row->fp_stable ) {
 1468+ } elseif( isset($row->fp_stable) && $row->rev_id > $row->fp_stable ) {
14691469 $ret = '<span class="flaggedrevs-unreviewed">'.$ret.'</span>';
1470 - } else if( !isset($row->fp_stable) ) {
 1470+ } elseif( !isset($row->fp_stable) ) {
14711471 $ret = '<span class="flaggedrevs-unreviewed2">'.$ret.'</span>';
14721472 }
14731473 return true;
Index: trunk/extensions/FlaggedRevs/api/ApiReview.php
@@ -105,9 +105,9 @@
106106 list( $approved, $status ) = $form->submit();
107107 if( $status === true ) {
108108 $this->getResult()->addValue( null, $this->getModuleName(), array( 'result' => 'Success' ) );
109 - } else if( $approved && is_array( $status ) ) {
 109+ } elseif( $approved && is_array( $status ) ) {
110110 $this->dieUsage( "A sync failure has occured while reviewing. Please try again.", 'syncfailure' );
111 - } else if( $approved ) {
 111+ } elseif( $approved ) {
112112 $this->dieUsage( "Cannot find a revision with the specified ID.", 'notarget' );
113113 } else {
114114 $this->dieUsageMsg( array( 'unknownerror' ) );

Status & tagging log