From 6cb1e6428e02f94994501d288c0884c6b6f2f538 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Sat, 15 Jan 2011 14:45:40 +0000 Subject: [PATCH] Some cleanup to this horrible piece of code --- includes/specials/SpecialAllpages.php | 28 +++++++++++++-------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 3393914f6e..e8f60e4bad 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -409,7 +409,7 @@ class SpecialAllpages extends IncludableSpecialPage { $nsForm . ' ' . - $sk->link( $self, wfMsgHtml ( 'allpages' ), array(), array(), 'known' ); + $sk->link( $self, wfMsgHtml ( 'allpages' ) ); # Do we put a previous link ? if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) { @@ -420,7 +420,7 @@ class SpecialAllpages extends IncludableSpecialPage { $prevLink = $sk->linkKnown( $self, - htmlspecialchars( wfMsg( 'prevpage', $pt ) ), + wfMessage( 'prevpage', $pt )->escaped(), array(), $query ); @@ -437,7 +437,7 @@ class SpecialAllpages extends IncludableSpecialPage { $nextLink = $sk->linkKnown( $self, - htmlspecialchars( wfMsg( 'nextpage', $t->getText() ) ), + wfMessage( 'nextpage', $t->getText() )->escaped(), array(), $query ); @@ -447,19 +447,17 @@ class SpecialAllpages extends IncludableSpecialPage { } $wgOut->addHTML( $out2 . $out ); - if( isset($prevLink) or isset($nextLink) ) { - $wgOut->addHTML( '

' ); - if( isset( $prevLink ) ) { - $wgOut->addHTML( $prevLink ); - } - if( isset( $prevLink ) && isset( $nextLink ) ) { - $wgOut->addHTML( wfMsgExt( 'pipe-separator' , 'escapenoentities' ) ); - } - if( isset( $nextLink ) ) { - $wgOut->addHTML( $nextLink ); - } - $wgOut->addHTML( '

' ); + $links = array(); + if ( isset( $prevLink ) ) $links[] = $prevLink; + if ( isset( $nextLink ) ) $links[] = $nextLink; + + if ( count( $links ) ) { + $wgOut->addHTML( + Html::element( 'hr' ) . + Html::rawElement( 'div', array( 'class' => 'mw-allpages-nav' ), + $wgLang->pipeList( $links ) + ) ); } } -- 2.20.1