Do not show new section link when viewing old talk page rev
authorKatie Filbert <aude@users.mediawiki.org>
Sat, 13 Jun 2009 14:27:16 +0000 (14:27 +0000)
committerKatie Filbert <aude@users.mediawiki.org>
Sat, 13 Jun 2009 14:27:16 +0000 (14:27 +0000)
includes/SkinTemplate.php
skins/Vector.php

index 42e4f3a..8100611 100644 (file)
@@ -662,7 +662,7 @@ class SkinTemplate extends Skin {
         * @private
         */
        function buildContentActionUrls() {
-               global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest;
+               global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
 
                wfProfileIn( __METHOD__ );
 
@@ -705,15 +705,16 @@ class SkinTemplate extends Skin {
                                        'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
                                );
 
-                               if ( $istalk || $wgOut->showNewSectionLink() ) {
+                               // adds new section link if page is a current revision of a talk page or 
+                               if ( ( $wgArticle->isCurrent() && $istalk ) || $wgOut->showNewSectionLink() ) {
                                        if ( !$wgOut->forceHideNewSectionLink() ) {
                                                $content_actions['addsection'] = array(
                                                        'class' => $section == 'new' ? 'selected' : false,
                                                        'text' => wfMsg( 'addsection' ),
                                                        'href' => $this->mTitle->getLocalUrl( 'action=edit&section=new' )
-                                               );
+                                               );                                      
                                        }
-                               }
+                               }  
                        } elseif ( $this->mTitle->isKnown() ) {
                                $content_actions['viewsource'] = array(
                                        'class' => ($action == 'edit') ? 'selected' : false,
@@ -1118,4 +1119,4 @@ class QuickTemplate {
                $msg = $this->translator->translate( $str );
                return ( $msg != '-' ) && ( $msg != '' ); # ????
        }
-}
\ No newline at end of file
+}
index 6d68b9d..9338fd6 100644 (file)
@@ -47,7 +47,7 @@ class SkinVector extends SkinTemplate {
         * @private
         */
        function buildNavigationUrls() {
-               global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest;
+               global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
                global $wgDisableLangConversion;
 
                wfProfileIn( __METHOD__ );
@@ -126,9 +126,9 @@ class SkinVector extends SkinTemplate {
                                        'href' =>
                                                $this->mTitle->getLocalUrl( $this->editUrlOptions() )
                                );
-                               // Checks if this is a talk page and we should show a new
+                               // Checks if this is a current rev of talk page and we should show a new
                                // section link
-                               if ( $isTalk || $wgOut->showNewSectionLink() ) {
+                               if ( ( $isTalk && $wgArticle->isCurrent() ) || ( $wgOut->showNewSectionLink() ) ) {
                                        // Checks if we should ever show a new section link
                                        if ( !$wgOut->forceHideNewSectionLink() ) {
                                                // Adds new section link