+ $wgOut->addWikiText( wfMsg( 'linkshere', $this->target->getPrefixedText() ) );
+ }
+ $isredir = wfMsg( 'isredirect' );
+ $istemplate = wfMsg( 'istemplate' );
+
+ if( $level == 0 ) {
+ $prevnext = $this->getPrevNext( $limit, $prevId, $nextId );
+ $wgOut->addHTML( $prevnext );
+ }
+
+ $wgOut->addHTML( '<ul>' );
+ foreach ( $rows as $row ) {
+ $nt = Title::makeTitle( $row->page_namespace, $row->page_title );
+
+ if ( $row->page_is_redirect ) {
+ $extra = 'redirect=no';
+ } else {
+ $extra = '';
+ }
+
+ $link = $this->skin->makeKnownLinkObj( $nt, '', $extra );
+ $wgOut->addHTML( '<li>'.$link );
+
+ // Display properties (redirect or template)
+ $props = array();
+ if ( $row->page_is_redirect ) {
+ $props[] = $isredir;
+ }
+ if ( $row->is_template ) {
+ $props[] = $istemplate;
+ }
+ if ( count( $props ) ) {
+ // FIXME? Cultural assumption, hard-coded punctuation
+ $wgOut->addHTML( ' (' . implode( ', ', $props ) . ') ' );
+ }
+
+ if ( $row->page_is_redirect ) {
+ if ( $level < 2 ) {
+ $this->showIndirectLinks( $level + 1, $nt, 500 );
+ }
+ }
+ $wgOut->addHTML( "</li>\n" );
+ }
+ $wgOut->addHTML( "</ul>\n" );
+
+ if( $level == 0 ) {
+ $wgOut->addHTML( $prevnext );