link to non-existant talk page is edit link now
authorGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 15 Apr 2004 11:22:36 +0000 (11:22 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 15 Apr 2004 11:22:36 +0000 (11:22 +0000)
includes/SkinPHPTal.php

index ad1981e..d6b18c8 100644 (file)
                                $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}" : '';