From 72aa82ff94bdc63b68c9ac7507933bb6f9b51e66 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Thu, 15 Apr 2004 11:22:36 +0000 Subject: [PATCH] link to non-existant talk page is edit link now --- includes/SkinPHPTal.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index ad1981e7bb..d6b18c88a0 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -223,15 +223,24 @@ $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ? 'selected' : ''); $talktitle = Title::newFromText( $this->titletxt ); $talktitle = $talktitle->getTalkPage(); - $this->checkTitle(&$title, &$name); - $talk_class .= ($talktitle->getArticleId() != 0 ? '':' new'); - $content_actions['talk'] = array( - 'class' => $talk_class, - 'text' => wfMsg('talk'), - 'href' => $this->makeTalkUrl($this->titletxt), - 'ttip' => wfMsg('tooltip-talk'), - 'akey' => wfMsg('accesskey-talk') - ); + $this->checkTitle(&$talktitle, &$this->titletxt); + if($talktitle->getArticleId() != 0) { + $content_actions['talk'] = array( + 'class' => $talk_class, + 'text' => wfMsg('talk'), + 'href' => $this->makeTalkUrl($this->titletxt), + 'ttip' => wfMsg('tooltip-talk'), + 'akey' => wfMsg('accesskey-talk') + ); + } else { + $content_actions['talk'] = array( + 'class' => $talk_class.' new', + 'text' => wfMsg('talk'), + 'href' => $this->makeTalkUrl($this->titletxt,'action=edit'), + 'ttip' => wfMsg('tooltip-talk'), + 'akey' => wfMsg('accesskey-talk') + ); + } if ( $wgTitle->userCanEdit() ) { $oid = ( $oldid && ! isset( $diff ) ) ? "&oldid={$oldid}" : ''; -- 2.20.1