r56742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56741‎ | r56742 | r56743 >
Date:23:46, 21 September 2009
Author:aaron
Status:ok (Comments)
Tags:
Comment:
* Use forDefaultVersionOnly()
* Made showVersionTabs()
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -135,8 +135,7 @@
136136 * @returns bool
137137 */
138138 public function limitedUI() {
139 - global $wgFlaggedRevsUIForDefault;
140 - return ( $wgFlaggedRevsUIForDefault && !$this->showStableByDefault() );
 139+ return ( FlaggedRevs::forDefaultVersionOnly() && !$this->showStableByDefault() );
141140 }
142141
143142 /**
@@ -169,10 +168,9 @@
170169 * @param bool $titleOnly, only check if title is in reviewable namespace
171170 */
172171 public function isReviewable( $titleOnly = false ) {
173 - global $wgFlaggedRevsReviewForDefault;
174172 if( !FlaggedRevs::isPageReviewable( $this->parent->getTitle() ) ) {
175173 return false;
176 - } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) {
 174+ } elseif( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() && !$this->showStableByDefault() ) {
177175 return false;
178176 }
179177 return true;
@@ -184,10 +182,9 @@
185183 * @return bool
186184 */
187185 public function isPatrollable( $titleOnly = false ) {
188 - global $wgFlaggedRevsReviewForDefault;
189186 if( FlaggedRevs::isPagePatrollable( $this->parent->getTitle() ) ) {
190187 return true;
191 - } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) {
 188+ } elseif( !$titleOnly && FlaggedRevs::forDefaultVersionOnly() && !$this->showStableByDefault() ) {
192189 return true;
193190 }
194191 return false;
@@ -924,8 +921,8 @@
925922 * SkinTemplateTabs, to inlude flagged revs UI elements
926923 */
927924 public function setActionTabs( $skin, &$actions ) {
928 - global $wgRequest, $wgUser, $wgFlaggedRevTabs;
929 -
 925+ global $wgRequest, $wgUser;
 926+
930927 $title = $this->parent->getTitle()->getSubjectPage();
931928 if ( !FlaggedRevs::isPageReviewable( $title ) ) {
932929 return true; // Only reviewable pages need these tabs
@@ -958,7 +955,7 @@
959956 * SkinTemplateTabs, to inlude flagged revs UI elements
960957 */
961958 public function setViewTabs( $skin, &$views ) {
962 - global $wgRequest, $wgUser, $wgFlaggedRevTabs;
 959+ global $wgRequest, $wgUser;
963960
964961 $title = $this->parent->getTitle()->getSubjectPage();
965962 $article = new Article( $title );
@@ -993,7 +990,7 @@
994991 }
995992 }
996993 }
997 - if ( !$wgFlaggedRevTabs || $synced ) {
 994+ if ( !FlaggedRevs::showVersionTabs() || $synced ) {
998995 // Exit, since either the flagged revisions tabs should not be shown
999996 // or the page is already the most current revision
1000997 return true;
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -88,6 +88,15 @@
8989 global $wgUser, $wgSimpleFlaggedRevsUI;
9090 return $wgUser->getOption( 'flaggedrevssimpleui', intval($wgSimpleFlaggedRevsUI) );
9191 }
 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+ }
92101
93102 /**
94103 * Should this user see stable versions by default?

Comments

#Comment by Tim Starling (talk | contribs)   02:07, 2 December 2009

Please commit your changes less often.

Status & tagging log