Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -118,10 +118,8 @@ |
119 | 119 | if( !is_null($this->stableRev) ) { |
120 | 120 | return $this->stableRev; |
121 | 121 | } |
122 | | - # Get the content page, skip talk |
123 | | - $title = $this->getTitle()->getSubjectPage(); |
124 | 122 | # Do we have one? |
125 | | - $srev = FlaggedRevision::newFromStable( $title, $flags ); |
| 123 | + $srev = FlaggedRevision::newFromStable( $this->getTitle(), $flags ); |
126 | 124 | if( $srev ) { |
127 | 125 | $this->stableRev = $srev; |
128 | 126 | $this->flags[$srev->getRevId()] = $srev->getTags(); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -927,26 +927,26 @@ |
928 | 928 | * SkinTemplateTabs, to inlude flagged revs UI elements |
929 | 929 | */ |
930 | 930 | public function setViewTabs( $skin, &$views ) { |
931 | | - global $wgRequest, $wgUser, $wgFlaggedRevTabs; |
| 931 | + global $wgRequest, $wgUser; |
932 | 932 | $this->load(); |
| 933 | + // Get the actual content page |
| 934 | + $title = $this->article->getTitle()->getSubjectPage(); |
| 935 | + $fa = FlaggedArticle::getTitleInstance( $title ); |
933 | 936 | |
934 | | - $title = $this->article->getTitle()->getSubjectPage(); // Get the actual content page |
935 | | - $article = new Article( $title ); |
936 | 937 | $action = $wgRequest->getVal( 'action', 'view' ); |
937 | | - $fa = FlaggedArticle::getTitleInstance( $title ); |
938 | | - if ( !$fa->isReviewable() || $this->article->limitedUI() ) { |
939 | | - // This isn't a reviewable page or the UI is hidden |
940 | | - return true; |
| 938 | + if ( !$fa->isReviewable() || $fa->limitedUI() ) { |
| 939 | + return true; // Not a reviewable page or the UI is hidden |
941 | 940 | } |
942 | | - $srev = $this->article->getStableRev( $action == 'rollback' ? FR_MASTER : 0 ); |
943 | | - if( is_null( $srev ) ) { |
| 941 | + $flags = ($action == 'rollback') ? FR_MASTER : 0; |
| 942 | + $srev = $fa->getStableRev( $flags ); |
| 943 | + if( !$srev ) { |
944 | 944 | return true; // No stable revision exists |
945 | 945 | } |
946 | | - $synced = FlaggedRevs::stableVersionIsSynced( $srev, $article ); |
| 946 | + $synced = FlaggedRevs::stableVersionIsSynced( $srev, $fa ); |
947 | 947 | // Set draft tab as needed... |
948 | 948 | if ( !$skin->mTitle->isTalkPage() && !$synced ) { |
949 | 949 | if ( isset( $views['edit'] ) ) { |
950 | | - if ( $this->article->showStableByDefault() ) { |
| 950 | + if ( $fa->showStableByDefault() ) { |
951 | 951 | $views['edit']['text'] = wfMsg('revreview-edit'); |
952 | 952 | } |
953 | 953 | if ( $this->pageOverride() ) { |
— | — | @@ -954,7 +954,7 @@ |
955 | 955 | } |
956 | 956 | } |
957 | 957 | if ( isset( $views['viewsource'] ) ) { |
958 | | - if ( $this->article->showStableByDefault() ) { |
| 958 | + if ( $fa->showStableByDefault() ) { |
959 | 959 | $views['viewsource']['text'] = wfMsg('revreview-source'); |
960 | 960 | } |
961 | 961 | if ( $this->pageOverride() ) { |
— | — | @@ -962,7 +962,7 @@ |
963 | 963 | } |
964 | 964 | } |
965 | 965 | } |
966 | | - if ( !$wgFlaggedRevTabs || $synced ) { |
| 966 | + if ( !FlaggedRevs::showVersionTabs() || $synced ) { |
967 | 967 | // Exit, since either the stable/draft tabs should not be shown |
968 | 968 | // or the page is already the most current revision |
969 | 969 | return true; |