+ $s .= "\n<hr class='sep' />";
+ $articleExists = $title->getArticleId();
+ if ( $this->data['isarticle'] || $action == 'edit' || $action == 'history' || $wpPreview ) {
+ if( $this->data['isarticle'] ) {
+ $s .= '<strong>' . $this->editThisPage() . '</strong>';
+ } else { # backlink to the article in edit or history mode
+ if( $articleExists ){ # no backlink if no article
+ switch( $tns ) {
+ case NS_TALK:
+ case NS_USER_TALK:
+ case NS_PROJECT_TALK:
+ case NS_FILE_TALK:
+ case NS_MEDIAWIKI_TALK:
+ case NS_TEMPLATE_TALK:
+ case NS_HELP_TALK:
+ case NS_CATEGORY_TALK:
+ $text = wfMsg('viewtalkpage');
+ break;
+ case NS_MAIN:
+ $text = wfMsg( 'articlepage' );
+ break;
+ case NS_USER:
+ $text = wfMsg( 'userpage' );
+ break;
+ case NS_PROJECT:
+ $text = wfMsg( 'projectpage' );
+ break;
+ case NS_FILE:
+ $text = wfMsg( 'imagepage' );
+ break;
+ case NS_MEDIAWIKI:
+ $text = wfMsg( 'mediawikipage' );
+ break;
+ case NS_TEMPLATE:
+ $text = wfMsg( 'templatepage' );
+ break;
+ case NS_HELP:
+ $text = wfMsg( 'viewhelppage' );
+ break;
+ case NS_CATEGORY:
+ $text = wfMsg( 'categorypage' );
+ break;
+ default:
+ $text = wfMsg( 'articlepage' );
+ }
+
+ $link = $title->getText();
+ $nstext = $wgContLang->getNsText( $tns );
+ if( $nstext ) { # add namespace if necessary
+ $link = $nstext . ':' . $link;
+ }
+
+ $s .= Linker::link( Title::newFromText( $link ), $text );
+ } elseif( $title->getNamespace() != NS_SPECIAL ) {
+ # we just throw in a "New page" text to tell the user that he's in edit mode,
+ # and to avoid messing with the separator that is prepended to the next item
+ $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
+ }
+ }
+
+ # "Post a comment" link
+ if( ( $title->isTalkPage() || $this->getSkin()->getOutput()->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
+ $s .= '<br />' . Linker::link(
+ $title,
+ wfMsg( 'postcomment' ),
+ array(),
+ array(
+ 'action' => 'edit',
+ 'section' => 'new'
+ )
+ );