- $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
- if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
- $content_actions[$nskey] = array('class' => ($is_active) ? 'selected' : false,
- 'text' => wfMsg($nskey),
- 'href' => $this->makeArticleUrl($this->thispage));
-
- /* set up the classes for the talk link */
- $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ? 'selected' : false);
- $talktitle = Title::newFromText( $this->titletxt );
- $talktitle = $talktitle->getTalkPage();
- $this->checkTitle($talktitle, $this->titletxt);
- if($talktitle->getArticleId() != 0) {
- $content_actions['talk'] = array(
- 'class' => $talk_class,
- 'text' => wfMsg('talk'),
- 'href' => $this->makeTalkUrl($this->titletxt)
- );
- } else {
- $content_actions['talk'] = array(
- 'class' => $talk_class?$talk_class.' new':'new',
- 'text' => wfMsg('talk'),
- 'href' => $this->makeTalkUrl($this->titletxt,'action=edit')
- );
- }
-
- if ( $wgTitle->userCanEdit() ) {
+ $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);
+
+ wfProfileIn( "$fname-edit" );
+ if ( $this->mTitle->userCanEdit() ) {