Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -964,23 +964,23 @@ |
965 | 965 | * SkinTemplateTabs, to inlude flagged revs UI elements |
966 | 966 | */ |
967 | 967 | public function setViewTabs( $skin, &$views ) { |
968 | | - global $wgRequest, $wgUser; |
969 | | - |
970 | | - $title = $this->parent->getTitle()->getSubjectPage(); |
| 968 | + global $wgRequest, $wgUser, $wgFlaggedRevTabs; |
| 969 | + |
| 970 | + $title = $this->parent->getTitle()->getSubjectPage(); // Get the actual content page |
971 | 971 | $article = new Article( $title ); |
972 | 972 | $action = $wgRequest->getVal( 'action', 'view' ); |
973 | 973 | $fa = FlaggedArticle::getTitleInstance( $title ); |
974 | 974 | if ( !$fa->isReviewable() || $this->limitedUI() ) { |
975 | | - // Exit, since this isn't a reviewable page or the UI is hidden |
| 975 | + // This isn't a reviewable page or the UI is hidden |
976 | 976 | return true; |
977 | 977 | } |
978 | 978 | $srev = $this->getStableRev( $action == 'rollback' ? FR_MASTER : 0 ); |
979 | 979 | if( is_null( $srev ) ) { |
980 | | - // Exit, since no stable revision exists |
981 | | - return true; |
| 980 | + return true; // No stable revision exists |
982 | 981 | } |
983 | 982 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
984 | 983 | $synced = FlaggedRevs::stableVersionIsSynced( $srev, $article ); |
| 984 | + // Set draft tab as needed... |
985 | 985 | if ( !$skin->mTitle->isTalkPage() && !$synced ) { |
986 | 986 | if ( isset( $views['edit'] ) ) { |
987 | 987 | if ( $this->showStableByDefault() ) { |
— | — | @@ -999,14 +999,14 @@ |
1000 | 1000 | } |
1001 | 1001 | } |
1002 | 1002 | } |
1003 | | - if ( !FlaggedRevs::showVersionTabs() || $synced ) { |
1004 | | - // Exit, since either the flagged revisions tabs should not be shown |
| 1003 | + if ( !$wgFlaggedRevTabs || $synced ) { |
| 1004 | + // Exit, since either the stable/draft tabs should not be shown |
1005 | 1005 | // or the page is already the most current revision |
1006 | 1006 | return true; |
1007 | 1007 | } |
1008 | 1008 | $tabs = array( |
1009 | 1009 | 'stable' => array( |
1010 | | - 'text' => wfMsg( 'revreview-stable' ), |
| 1010 | + 'text' => wfMsg( 'revreview-stable' ), // unused |
1011 | 1011 | 'href' => $title->getLocalUrl( 'stable=1' ), |
1012 | 1012 | 'class' => '' |
1013 | 1013 | ), |
— | — | @@ -1029,13 +1029,16 @@ |
1030 | 1030 | $first = true; |
1031 | 1031 | $newViews = array(); |
1032 | 1032 | foreach ( $views as $tabAction => $data ) { |
1033 | | - if ( $first ) { |
| 1033 | + // Very first tab (page link) |
| 1034 | + if( $first ) { |
1034 | 1035 | if( $synced ) { |
1035 | 1036 | // Use existing first tabs when synced |
1036 | 1037 | $newViews[$tabAction] = $data; |
1037 | 1038 | } else { |
1038 | 1039 | // Use split current and stable tabs when not synced |
1039 | | - $newViews['stable'] = $tabs['stable']; |
| 1040 | + $newViews[$tabAction]['text'] = $data['text']; // keep tab name |
| 1041 | + $newViews[$tabAction]['href'] = $tabs['stable']['href']; |
| 1042 | + $newViews[$tabAction]['class'] = $tabs['stable']['class']; |
1040 | 1043 | $newViews['current'] = $tabs['current']; |
1041 | 1044 | } |
1042 | 1045 | $first = false; |