r24304 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24303‎ | r24304 | r24305 >
Date:04:47, 21 July 2007
Author:aaron
Status:old
Tags:
Comment:
*Use consistent CSS, viciously murder and erase some ampersands. Some cleanup.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -42,7 +42,7 @@
4343 global $wgMessageCache, $RevisionreviewMessages, $wgOut, $wgJsMimeType;
4444 # Internationalization
4545 require( dirname( __FILE__ ) . '/FlaggedRevsPage.i18n.php' );
46 - foreach ( $RevisionreviewMessages as $lang => $langMessages ) {
 46+ foreach( $RevisionreviewMessages as $lang => $langMessages ) {
4747 $wgMessageCache->addMessages( $langMessages, $lang );
4848 }
4949 # UI CSS
@@ -155,6 +155,15 @@
156156
157157 return $wgSimpleFlaggedRevsUI;
158158 }
 159+
 160+ /**
 161+ * Should comments be allowed on pages and forms?
 162+ */
 163+ static function allowComments() {
 164+ global $wgFlaggedRevComments;
 165+
 166+ return $wgFlaggedRevComments;
 167+ }
159168
160169 /**
161170 * @param string $text
@@ -457,7 +466,7 @@
458467 public static function isQuality( $flags ) {
459468 global $wgFlaggedRevTags;
460469
461 - foreach ( $wgFlaggedRevTags as $f => $v ) {
 470+ foreach( $wgFlaggedRevTags as $f => $v ) {
462471 if( !isset($flags[$f]) || $v > $flags[$f] ) return false;
463472 }
464473 return true;
@@ -470,7 +479,7 @@
471480 public static function isPristine( $flags ) {
472481 global $wgFlaggedRevValues;
473482
474 - foreach ( $flags as $f => $v ) {
 483+ foreach( $flags as $f => $v ) {
475484 if( $v < $wgFlaggedRevValues ) return false;
476485 }
477486 return true;
@@ -484,7 +493,7 @@
485494 global $wgFlaggedRevValues;
486495
487496 $min = false;
488 - foreach ( $flags as $f => $v ) {
 497+ foreach( $flags as $f => $v ) {
489498 if( $min==false || $v < $min ) $min = $v;
490499 }
491500 return $min;
@@ -579,7 +588,7 @@
580589 return true;
581590 }
582591
583 - function maybeUpdateMainCache( &$article, &$outputDone, &$pcache ) {
 592+ function maybeUpdateMainCache( $article, &$outputDone, &$pcache ) {
584593 global $wgUser, $action;
585594 // Only trigger on article view for content pages, not for protect/delete/hist
586595 if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' )
@@ -601,7 +610,7 @@
602611 return true;
603612 }
604613
605 - function updateFromMove( &$movePageForm , &$oldtitle , &$newtitle ) {
 614+ function updateFromMove( $movePageForm, $oldtitle, $newtitle ) {
606615 $dbw = wfGetDB( DB_MASTER );
607616 $dbw->update( 'flaggedrevs',
608617 array('fr_namespace' => $newtitle->getNamespace(), 'fr_title' => $newtitle->getDBkey() ),
@@ -611,7 +620,7 @@
612621 return true;
613622 }
614623
615 - public static function articleLinksUpdate( &$title ) {
 624+ public static function articleLinksUpdate( $title ) {
616625 global $wgUser, $wgParser;
617626
618627 $article = new Article( $title );
@@ -630,7 +639,7 @@
631640 return true;
632641 }
633642
634 - public function extraLinksUpdate( &$linksUpdate ) {
 643+ public function extraLinksUpdate( $linksUpdate ) {
635644 $fname = 'FlaggedRevs::extraLinksUpdate';
636645 wfProfileIn( $fname );
637646
@@ -668,7 +677,7 @@
669678 return true;
670679 }
671680
672 - static function parserFetchStableTemplate( &$parser, &$title, &$skip, &$id ) {
 681+ static function parserFetchStableTemplate( $parser, $title, &$skip, &$id ) {
673682 // Trigger for stable version parsing only
674683 if( !isset($parser->isStable) || !$parser->isStable )
675684 return true;
@@ -689,7 +698,7 @@
690699 return true;
691700 }
692701
693 - static function parserMakeStableImageLink( &$parser, &$nt, &$skip, &$time ) {
 702+ static function parserMakeStableImageLink( $parser, $nt, &$skip, &$time ) {
694703 // Trigger for stable version parsing only
695704 if( !isset($parser->isStable) || !$parser->isStable )
696705 return true;
@@ -710,7 +719,7 @@
711720 return true;
712721 }
713722
714 - static function galleryFindStableFileTime( &$ig, &$nt, &$time ) {
 723+ static function galleryFindStableFileTime( $ig, $nt, &$time ) {
715724 // Trigger for stable version parsing only
716725 if( !isset($ig->isStable) || !$ig->isStable )
717726 return true;
@@ -724,7 +733,7 @@
725734 return true;
726735 }
727736
728 - static function parserMakeGalleryStable( &$parser, &$ig ) {
 737+ static function parserMakeGalleryStable( $parser, $ig ) {
729738 // Trigger for stable version parsing only
730739 if( !isset($parser->isStable) || !$parser->isStable )
731740 return true;
@@ -734,7 +743,7 @@
735744 return true;
736745 }
737746
738 - static function parserInjectImageTimestamps( &$parser, &$text ) {
 747+ static function parserInjectImageTimestamps( $parser, &$text ) {
739748 $parser->mOutput->mImageTimestamps = array();
740749 # Fetch the timestamps of the images
741750 if( !empty($parser->mOutput->mImages) ) {
@@ -750,7 +759,7 @@
751760 return true;
752761 }
753762
754 - static function outputInjectImageTimestamps( &$out, &$parserOutput ) {
 763+ static function outputInjectImageTimestamps( $out, $parserOutput ) {
755764 $out->mImageTimestamps = $parserOutput->mImageTimestamps;
756765
757766 return true;
@@ -760,7 +769,7 @@
761770 * Callback that autopromotes user according to the setting in
762771 * $wgFlaggedRevsAutopromote
763772 */
764 - public static function autoPromoteUser( &$article, &$user, &$text, &$summary, &$isminor, &$iswatch, &$section ) {
 773+ public static function autoPromoteUser( $article, $user, &$text, &$summary, &$isminor, &$iswatch, &$section ) {
765774 global $wgUser, $wgFlaggedRevsAutopromote;
766775
767776 if( !$wgFlaggedRevsAutopromote )
@@ -806,19 +815,19 @@
807816
808817 static function pageOverride() { return false; }
809818
810 - function setPageContent( &$article, &$outputDone, &$pcache ) {}
 819+ function setPageContent( $article, $outputDone, &$pcache ) {}
811820
812 - function addToEditView( &$editform ) {}
 821+ function addToEditView( $editform ) {}
813822
814 - function addReviewForm( &$out ) {}
 823+ function addReviewForm( $out ) {}
815824
816 - function setPermaLink( &$sktmp, &$nav_urls, &$revid, &$revid ) {}
 825+ function setPermaLink( $sktmp, &$nav_urls, &$revid, &$revid ) {}
817826
818 - function setCurrentTab( &$sktmp, &$content_actions ) {}
 827+ function setCurrentTab( $sktmp, &$content_actions ) {}
819828
820 - function addToPageHist( &$article ) {}
 829+ function addToPageHist( $article ) {}
821830
822 - function addToHistLine( &$row, &$s ) {}
 831+ function addToHistLine( $row, &$s ) {}
823832
824833 function addQuickReview( $id=NULL, $out ) {}
825834
@@ -857,7 +866,7 @@
858867 * Adds stable version status/info tags and notes
859868 * Adds a quick review form on the bottom if needed
860869 */
861 - function setPageContent( &$article, &$outputDone, &$pcache ) {
 870+ function setPageContent( $article, &$outputDone, &$pcache ) {
862871 global $wgRequest, $wgTitle, $wgOut, $action, $wgUser;
863872 // Only trigger on article view for content pages, not for protect/delete/hist
864873 if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' )
@@ -969,7 +978,7 @@
970979 wfMsgExt('revreview-quick-none',array('parseinline'));
971980 $tag = '<div id="mwrevisiontag" class="flaggedrevs_short plainlinks">'.$tag.'</div>';
972981 } else {
973 - $tag = '<div id="mwrevisiontag" class="mw-warning plainlinks">' .
 982+ $tag = '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">' .
974983 wfMsgExt('revreview-noflagged', array('parseinline')) . '</div>';
975984 }
976985 $wgOut->addHTML( $tag );
@@ -977,7 +986,7 @@
978987 return true;
979988 }
980989
981 - function addToEditView( &$editform ) {
 990+ function addToEditView( $editform ) {
982991 global $wgRequest, $wgTitle, $wgOut;
983992 // Talk pages cannot be validated
984993 if( !$editform->mArticle || !$wgTitle->isContentPage() )
@@ -1013,7 +1022,7 @@
10141023 return true;
10151024 }
10161025
1017 - function addReviewForm( &$out ) {
 1026+ function addReviewForm( $out ) {
10181027 global $wgArticle, $action;
10191028
10201029 if( !$wgArticle || !$wgArticle->exists() || !$wgArticle->mTitle->isContentPage() || $action !='view' )
@@ -1039,7 +1048,7 @@
10401049 return true;
10411050 }
10421051
1043 - function setPermaLink( &$sktmp, &$nav_urls, &$revid, &$revid ) {
 1052+ function setPermaLink( $sktmp, &$nav_urls, &$revid, &$revid ) {
10441053 // Non-content pages cannot be validated
10451054 if( !$this->pageOverride() ) return true;
10461055 // Check for an overridabe revision
@@ -1065,7 +1074,7 @@
10661075 return true;
10671076 }
10681077
1069 - function setCurrentTab( &$sktmp, &$content_actions ) {
 1078+ function setCurrentTab( $sktmp, &$content_actions ) {
10701079 global $wgRequest, $wgFlaggedRevsAnonOnly, $wgFlaggedRevsOverride, $wgUser, $action;
10711080 // Get the subject page, not all skins have it :(
10721081 if( !isset($sktmp->mTitle) )
@@ -1172,7 +1181,7 @@
11731182 return true;
11741183 }
11751184
1176 - function addToPageHist( &$article ) {
 1185+ function addToPageHist( $article ) {
11771186 global $wgUser;
11781187
11791188 $this->pageFlaggedRevs = array();
@@ -1189,7 +1198,7 @@
11901199 return true;
11911200 }
11921201
1193 - function addToHistLine( &$row, &$s ) {
 1202+ function addToHistLine( $row, &$s ) {
11941203 global $wgUser;
11951204
11961205 if( isset($this->pageFlaggedRevs) && array_key_exists($row->rev_id,$this->pageFlaggedRevs) ) {

Status & tagging log