From: Katie Filbert Date: Sat, 13 Jun 2009 14:27:16 +0000 (+0000) Subject: Do not show new section link when viewing old talk page rev X-Git-Tag: 1.31.0-rc.0~41387 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=93a93f19a395c7ff944428a3422fb7823f45044f;p=lhc%2Fweb%2Fwiklou.git Do not show new section link when viewing old talk page rev --- diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 42e4f3ab9b..8100611782 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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§ion=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 +} diff --git a/skins/Vector.php b/skins/Vector.php index 6d68b9d88c..9338fd6b8a 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -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