Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | global $wgMessageCache, $RevisionreviewMessages, $wgOut, $wgJsMimeType; |
44 | 44 | # Internationalization |
45 | 45 | require( dirname( __FILE__ ) . '/FlaggedRevsPage.i18n.php' ); |
46 | | - foreach ( $RevisionreviewMessages as $lang => $langMessages ) { |
| 46 | + foreach( $RevisionreviewMessages as $lang => $langMessages ) { |
47 | 47 | $wgMessageCache->addMessages( $langMessages, $lang ); |
48 | 48 | } |
49 | 49 | # UI CSS |
— | — | @@ -155,6 +155,15 @@ |
156 | 156 | |
157 | 157 | return $wgSimpleFlaggedRevsUI; |
158 | 158 | } |
| 159 | + |
| 160 | + /** |
| 161 | + * Should comments be allowed on pages and forms? |
| 162 | + */ |
| 163 | + static function allowComments() { |
| 164 | + global $wgFlaggedRevComments; |
| 165 | + |
| 166 | + return $wgFlaggedRevComments; |
| 167 | + } |
159 | 168 | |
160 | 169 | /** |
161 | 170 | * @param string $text |
— | — | @@ -457,7 +466,7 @@ |
458 | 467 | public static function isQuality( $flags ) { |
459 | 468 | global $wgFlaggedRevTags; |
460 | 469 | |
461 | | - foreach ( $wgFlaggedRevTags as $f => $v ) { |
| 470 | + foreach( $wgFlaggedRevTags as $f => $v ) { |
462 | 471 | if( !isset($flags[$f]) || $v > $flags[$f] ) return false; |
463 | 472 | } |
464 | 473 | return true; |
— | — | @@ -470,7 +479,7 @@ |
471 | 480 | public static function isPristine( $flags ) { |
472 | 481 | global $wgFlaggedRevValues; |
473 | 482 | |
474 | | - foreach ( $flags as $f => $v ) { |
| 483 | + foreach( $flags as $f => $v ) { |
475 | 484 | if( $v < $wgFlaggedRevValues ) return false; |
476 | 485 | } |
477 | 486 | return true; |
— | — | @@ -484,7 +493,7 @@ |
485 | 494 | global $wgFlaggedRevValues; |
486 | 495 | |
487 | 496 | $min = false; |
488 | | - foreach ( $flags as $f => $v ) { |
| 497 | + foreach( $flags as $f => $v ) { |
489 | 498 | if( $min==false || $v < $min ) $min = $v; |
490 | 499 | } |
491 | 500 | return $min; |
— | — | @@ -579,7 +588,7 @@ |
580 | 589 | return true; |
581 | 590 | } |
582 | 591 | |
583 | | - function maybeUpdateMainCache( &$article, &$outputDone, &$pcache ) { |
| 592 | + function maybeUpdateMainCache( $article, &$outputDone, &$pcache ) { |
584 | 593 | global $wgUser, $action; |
585 | 594 | // Only trigger on article view for content pages, not for protect/delete/hist |
586 | 595 | if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' ) |
— | — | @@ -601,7 +610,7 @@ |
602 | 611 | return true; |
603 | 612 | } |
604 | 613 | |
605 | | - function updateFromMove( &$movePageForm , &$oldtitle , &$newtitle ) { |
| 614 | + function updateFromMove( $movePageForm, $oldtitle, $newtitle ) { |
606 | 615 | $dbw = wfGetDB( DB_MASTER ); |
607 | 616 | $dbw->update( 'flaggedrevs', |
608 | 617 | array('fr_namespace' => $newtitle->getNamespace(), 'fr_title' => $newtitle->getDBkey() ), |
— | — | @@ -611,7 +620,7 @@ |
612 | 621 | return true; |
613 | 622 | } |
614 | 623 | |
615 | | - public static function articleLinksUpdate( &$title ) { |
| 624 | + public static function articleLinksUpdate( $title ) { |
616 | 625 | global $wgUser, $wgParser; |
617 | 626 | |
618 | 627 | $article = new Article( $title ); |
— | — | @@ -630,7 +639,7 @@ |
631 | 640 | return true; |
632 | 641 | } |
633 | 642 | |
634 | | - public function extraLinksUpdate( &$linksUpdate ) { |
| 643 | + public function extraLinksUpdate( $linksUpdate ) { |
635 | 644 | $fname = 'FlaggedRevs::extraLinksUpdate'; |
636 | 645 | wfProfileIn( $fname ); |
637 | 646 | |
— | — | @@ -668,7 +677,7 @@ |
669 | 678 | return true; |
670 | 679 | } |
671 | 680 | |
672 | | - static function parserFetchStableTemplate( &$parser, &$title, &$skip, &$id ) { |
| 681 | + static function parserFetchStableTemplate( $parser, $title, &$skip, &$id ) { |
673 | 682 | // Trigger for stable version parsing only |
674 | 683 | if( !isset($parser->isStable) || !$parser->isStable ) |
675 | 684 | return true; |
— | — | @@ -689,7 +698,7 @@ |
690 | 699 | return true; |
691 | 700 | } |
692 | 701 | |
693 | | - static function parserMakeStableImageLink( &$parser, &$nt, &$skip, &$time ) { |
| 702 | + static function parserMakeStableImageLink( $parser, $nt, &$skip, &$time ) { |
694 | 703 | // Trigger for stable version parsing only |
695 | 704 | if( !isset($parser->isStable) || !$parser->isStable ) |
696 | 705 | return true; |
— | — | @@ -710,7 +719,7 @@ |
711 | 720 | return true; |
712 | 721 | } |
713 | 722 | |
714 | | - static function galleryFindStableFileTime( &$ig, &$nt, &$time ) { |
| 723 | + static function galleryFindStableFileTime( $ig, $nt, &$time ) { |
715 | 724 | // Trigger for stable version parsing only |
716 | 725 | if( !isset($ig->isStable) || !$ig->isStable ) |
717 | 726 | return true; |
— | — | @@ -724,7 +733,7 @@ |
725 | 734 | return true; |
726 | 735 | } |
727 | 736 | |
728 | | - static function parserMakeGalleryStable( &$parser, &$ig ) { |
| 737 | + static function parserMakeGalleryStable( $parser, $ig ) { |
729 | 738 | // Trigger for stable version parsing only |
730 | 739 | if( !isset($parser->isStable) || !$parser->isStable ) |
731 | 740 | return true; |
— | — | @@ -734,7 +743,7 @@ |
735 | 744 | return true; |
736 | 745 | } |
737 | 746 | |
738 | | - static function parserInjectImageTimestamps( &$parser, &$text ) { |
| 747 | + static function parserInjectImageTimestamps( $parser, &$text ) { |
739 | 748 | $parser->mOutput->mImageTimestamps = array(); |
740 | 749 | # Fetch the timestamps of the images |
741 | 750 | if( !empty($parser->mOutput->mImages) ) { |
— | — | @@ -750,7 +759,7 @@ |
751 | 760 | return true; |
752 | 761 | } |
753 | 762 | |
754 | | - static function outputInjectImageTimestamps( &$out, &$parserOutput ) { |
| 763 | + static function outputInjectImageTimestamps( $out, $parserOutput ) { |
755 | 764 | $out->mImageTimestamps = $parserOutput->mImageTimestamps; |
756 | 765 | |
757 | 766 | return true; |
— | — | @@ -760,7 +769,7 @@ |
761 | 770 | * Callback that autopromotes user according to the setting in |
762 | 771 | * $wgFlaggedRevsAutopromote |
763 | 772 | */ |
764 | | - public static function autoPromoteUser( &$article, &$user, &$text, &$summary, &$isminor, &$iswatch, &$section ) { |
| 773 | + public static function autoPromoteUser( $article, $user, &$text, &$summary, &$isminor, &$iswatch, &$section ) { |
765 | 774 | global $wgUser, $wgFlaggedRevsAutopromote; |
766 | 775 | |
767 | 776 | if( !$wgFlaggedRevsAutopromote ) |
— | — | @@ -806,19 +815,19 @@ |
807 | 816 | |
808 | 817 | static function pageOverride() { return false; } |
809 | 818 | |
810 | | - function setPageContent( &$article, &$outputDone, &$pcache ) {} |
| 819 | + function setPageContent( $article, $outputDone, &$pcache ) {} |
811 | 820 | |
812 | | - function addToEditView( &$editform ) {} |
| 821 | + function addToEditView( $editform ) {} |
813 | 822 | |
814 | | - function addReviewForm( &$out ) {} |
| 823 | + function addReviewForm( $out ) {} |
815 | 824 | |
816 | | - function setPermaLink( &$sktmp, &$nav_urls, &$revid, &$revid ) {} |
| 825 | + function setPermaLink( $sktmp, &$nav_urls, &$revid, &$revid ) {} |
817 | 826 | |
818 | | - function setCurrentTab( &$sktmp, &$content_actions ) {} |
| 827 | + function setCurrentTab( $sktmp, &$content_actions ) {} |
819 | 828 | |
820 | | - function addToPageHist( &$article ) {} |
| 829 | + function addToPageHist( $article ) {} |
821 | 830 | |
822 | | - function addToHistLine( &$row, &$s ) {} |
| 831 | + function addToHistLine( $row, &$s ) {} |
823 | 832 | |
824 | 833 | function addQuickReview( $id=NULL, $out ) {} |
825 | 834 | |
— | — | @@ -857,7 +866,7 @@ |
858 | 867 | * Adds stable version status/info tags and notes |
859 | 868 | * Adds a quick review form on the bottom if needed |
860 | 869 | */ |
861 | | - function setPageContent( &$article, &$outputDone, &$pcache ) { |
| 870 | + function setPageContent( $article, &$outputDone, &$pcache ) { |
862 | 871 | global $wgRequest, $wgTitle, $wgOut, $action, $wgUser; |
863 | 872 | // Only trigger on article view for content pages, not for protect/delete/hist |
864 | 873 | if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' ) |
— | — | @@ -969,7 +978,7 @@ |
970 | 979 | wfMsgExt('revreview-quick-none',array('parseinline')); |
971 | 980 | $tag = '<div id="mwrevisiontag" class="flaggedrevs_short plainlinks">'.$tag.'</div>'; |
972 | 981 | } else { |
973 | | - $tag = '<div id="mwrevisiontag" class="mw-warning plainlinks">' . |
| 982 | + $tag = '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">' . |
974 | 983 | wfMsgExt('revreview-noflagged', array('parseinline')) . '</div>'; |
975 | 984 | } |
976 | 985 | $wgOut->addHTML( $tag ); |
— | — | @@ -977,7 +986,7 @@ |
978 | 987 | return true; |
979 | 988 | } |
980 | 989 | |
981 | | - function addToEditView( &$editform ) { |
| 990 | + function addToEditView( $editform ) { |
982 | 991 | global $wgRequest, $wgTitle, $wgOut; |
983 | 992 | // Talk pages cannot be validated |
984 | 993 | if( !$editform->mArticle || !$wgTitle->isContentPage() ) |
— | — | @@ -1013,7 +1022,7 @@ |
1014 | 1023 | return true; |
1015 | 1024 | } |
1016 | 1025 | |
1017 | | - function addReviewForm( &$out ) { |
| 1026 | + function addReviewForm( $out ) { |
1018 | 1027 | global $wgArticle, $action; |
1019 | 1028 | |
1020 | 1029 | if( !$wgArticle || !$wgArticle->exists() || !$wgArticle->mTitle->isContentPage() || $action !='view' ) |
— | — | @@ -1039,7 +1048,7 @@ |
1040 | 1049 | return true; |
1041 | 1050 | } |
1042 | 1051 | |
1043 | | - function setPermaLink( &$sktmp, &$nav_urls, &$revid, &$revid ) { |
| 1052 | + function setPermaLink( $sktmp, &$nav_urls, &$revid, &$revid ) { |
1044 | 1053 | // Non-content pages cannot be validated |
1045 | 1054 | if( !$this->pageOverride() ) return true; |
1046 | 1055 | // Check for an overridabe revision |
— | — | @@ -1065,7 +1074,7 @@ |
1066 | 1075 | return true; |
1067 | 1076 | } |
1068 | 1077 | |
1069 | | - function setCurrentTab( &$sktmp, &$content_actions ) { |
| 1078 | + function setCurrentTab( $sktmp, &$content_actions ) { |
1070 | 1079 | global $wgRequest, $wgFlaggedRevsAnonOnly, $wgFlaggedRevsOverride, $wgUser, $action; |
1071 | 1080 | // Get the subject page, not all skins have it :( |
1072 | 1081 | if( !isset($sktmp->mTitle) ) |
— | — | @@ -1172,7 +1181,7 @@ |
1173 | 1182 | return true; |
1174 | 1183 | } |
1175 | 1184 | |
1176 | | - function addToPageHist( &$article ) { |
| 1185 | + function addToPageHist( $article ) { |
1177 | 1186 | global $wgUser; |
1178 | 1187 | |
1179 | 1188 | $this->pageFlaggedRevs = array(); |
— | — | @@ -1189,7 +1198,7 @@ |
1190 | 1199 | return true; |
1191 | 1200 | } |
1192 | 1201 | |
1193 | | - function addToHistLine( &$row, &$s ) { |
| 1202 | + function addToHistLine( $row, &$s ) { |
1194 | 1203 | global $wgUser; |
1195 | 1204 | |
1196 | 1205 | if( isset($this->pageFlaggedRevs) && array_key_exists($row->rev_id,$this->pageFlaggedRevs) ) { |