Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -135,8 +135,7 @@ |
136 | 136 | * @returns bool |
137 | 137 | */ |
138 | 138 | public function limitedUI() { |
139 | | - global $wgFlaggedRevsUIForDefault; |
140 | | - return ( $wgFlaggedRevsUIForDefault && !$this->showStableByDefault() ); |
| 139 | + return ( FlaggedRevs::forDefaultVersionOnly() && !$this->showStableByDefault() ); |
141 | 140 | } |
142 | 141 | |
143 | 142 | /** |
— | — | @@ -169,10 +168,9 @@ |
170 | 169 | * @param bool $titleOnly, only check if title is in reviewable namespace |
171 | 170 | */ |
172 | 171 | public function isReviewable( $titleOnly = false ) { |
173 | | - global $wgFlaggedRevsReviewForDefault; |
174 | 172 | if( !FlaggedRevs::isPageReviewable( $this->parent->getTitle() ) ) { |
175 | 173 | return false; |
176 | | - } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) { |
| 174 | + } elseif( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() && !$this->showStableByDefault() ) { |
177 | 175 | return false; |
178 | 176 | } |
179 | 177 | return true; |
— | — | @@ -184,10 +182,9 @@ |
185 | 183 | * @return bool |
186 | 184 | */ |
187 | 185 | public function isPatrollable( $titleOnly = false ) { |
188 | | - global $wgFlaggedRevsReviewForDefault; |
189 | 186 | if( FlaggedRevs::isPagePatrollable( $this->parent->getTitle() ) ) { |
190 | 187 | return true; |
191 | | - } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) { |
| 188 | + } elseif( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() && !$this->showStableByDefault() ) { |
192 | 189 | return true; |
193 | 190 | } |
194 | 191 | return false; |
— | — | @@ -924,8 +921,8 @@ |
925 | 922 | * SkinTemplateTabs, to inlude flagged revs UI elements |
926 | 923 | */ |
927 | 924 | public function setActionTabs( $skin, &$actions ) { |
928 | | - global $wgRequest, $wgUser, $wgFlaggedRevTabs; |
929 | | - |
| 925 | + global $wgRequest, $wgUser; |
| 926 | + |
930 | 927 | $title = $this->parent->getTitle()->getSubjectPage(); |
931 | 928 | if ( !FlaggedRevs::isPageReviewable( $title ) ) { |
932 | 929 | return true; // Only reviewable pages need these tabs |
— | — | @@ -958,7 +955,7 @@ |
959 | 956 | * SkinTemplateTabs, to inlude flagged revs UI elements |
960 | 957 | */ |
961 | 958 | public function setViewTabs( $skin, &$views ) { |
962 | | - global $wgRequest, $wgUser, $wgFlaggedRevTabs; |
| 959 | + global $wgRequest, $wgUser; |
963 | 960 | |
964 | 961 | $title = $this->parent->getTitle()->getSubjectPage(); |
965 | 962 | $article = new Article( $title ); |
— | — | @@ -993,7 +990,7 @@ |
994 | 991 | } |
995 | 992 | } |
996 | 993 | } |
997 | | - if ( !$wgFlaggedRevTabs || $synced ) { |
| 994 | + if ( !FlaggedRevs::showVersionTabs() || $synced ) { |
998 | 995 | // Exit, since either the flagged revisions tabs should not be shown |
999 | 996 | // or the page is already the most current revision |
1000 | 997 | return true; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -88,6 +88,15 @@ |
89 | 89 | global $wgUser, $wgSimpleFlaggedRevsUI; |
90 | 90 | return $wgUser->getOption( 'flaggedrevssimpleui', intval($wgSimpleFlaggedRevsUI) ); |
91 | 91 | } |
| 92 | + |
| 93 | + /** |
| 94 | + * Should pages have stable/draft tabs when not synced? |
| 95 | + * @returns bool |
| 96 | + */ |
| 97 | + public static function showVersionTabs() { |
| 98 | + global $wgFlaggedRevTabs; |
| 99 | + return (bool)$wgFlaggedRevTabs; |
| 100 | + } |
92 | 101 | |
93 | 102 | /** |
94 | 103 | * Should this user see stable versions by default? |