- $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
- if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
-
- $subjectTitle = $wgTitle->getSubjectPage();
- if( $subjectTitle->getArticleId() != 0 ) {
- $class = ($is_active) ? 'selected' : false;
- } else {
- $class = ($is_active) ? 'selected new' : 'new';
- }
- $content_actions[$nskey] = array('class' => $class,
- 'text' => wfMsg($nskey),
- 'href' => $this->makeArticleUrl($this->thispage));
-
- /* set up the classes for the talk link */
- wfProfileIn( "$fname-talk" );
- $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ? 'selected' : false);
- $talktitle = $wgTitle->getTalkPage();
- if( $talktitle->getArticleId() != 0 ) {
- $content_actions['talk'] = array(
- 'class' => $talk_class,
- 'text' => wfMsg('talk'),
- 'href' => $talktitle->getLocalUrl()
- );
- } else {
- $content_actions['talk'] = array(
- 'class' => $talk_class ? $talk_class.' new' : 'new',
- 'text' => wfMsg('talk'),
- 'href' => $talktitle->getLocalUrl( 'action=edit' )
- );
- }
- wfProfileOut( "$fname-talk" );
-
+ $content_actions[$nskey] = $this->tabAction(
+ $this->mTitle->getSubjectPage(),
+ $nskey,
+ !$this->mTitle->isTalkPage() );
+
+ $content_actions['talk'] = $this->tabAction(
+ $this->mTitle->getTalkPage(),
+ 'talk',
+ $this->mTitle->isTalkPage(),
+ '',
+ true);
+