r80398 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80397‎ | r80398 | r80399 >
Date:14:45, 15 January 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Some cleanup to this horrible piece of code
Modified paths:
  • /trunk/phase3/includes/specials/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialAllpages.php
@@ -409,7 +409,7 @@
410410 $nsForm .
411411 '</td>
412412 <td class="mw-allpages-nav">' .
413 - $sk->link( $self, wfMsgHtml ( 'allpages' ), array(), array(), 'known' );
 413+ $sk->link( $self, wfMsgHtml ( 'allpages' ) );
414414
415415 # Do we put a previous link ?
416416 if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
@@ -420,7 +420,7 @@
421421
422422 $prevLink = $sk->linkKnown(
423423 $self,
424 - htmlspecialchars( wfMsg( 'prevpage', $pt ) ),
 424+ wfMessage( 'prevpage', $pt )->escaped(),
425425 array(),
426426 $query
427427 );
@@ -437,7 +437,7 @@
438438
439439 $nextLink = $sk->linkKnown(
440440 $self,
441 - htmlspecialchars( wfMsg( 'nextpage', $t->getText() ) ),
 441+ wfMessage( 'nextpage', $t->getText() )->escaped(),
442442 array(),
443443 $query
444444 );
@@ -447,19 +447,17 @@
448448 }
449449
450450 $wgOut->addHTML( $out2 . $out );
451 - if( isset($prevLink) or isset($nextLink) ) {
452 - $wgOut->addHTML( '<hr /><p class="mw-allpages-nav">' );
453 - if( isset( $prevLink ) ) {
454 - $wgOut->addHTML( $prevLink );
455 - }
456 - if( isset( $prevLink ) && isset( $nextLink ) ) {
457 - $wgOut->addHTML( wfMsgExt( 'pipe-separator' , 'escapenoentities' ) );
458 - }
459 - if( isset( $nextLink ) ) {
460 - $wgOut->addHTML( $nextLink );
461 - }
462 - $wgOut->addHTML( '</p>' );
463451
 452+ $links = array();
 453+ if ( isset( $prevLink ) ) $links[] = $prevLink;
 454+ if ( isset( $nextLink ) ) $links[] = $nextLink;
 455+
 456+ if ( count( $links ) ) {
 457+ $wgOut->addHTML(
 458+ Html::element( 'hr' ) .
 459+ Html::rawElement( 'div', array( 'class' => 'mw-allpages-nav' ),
 460+ $wgLang->pipeList( $links )
 461+ ) );
464462 }
465463
466464 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r85179Followup r80398: fix overspecific css rules which brokenikerabbit08:22, 2 April 2011

Comments

#Comment by Happy-melon (talk | contribs)   23:14, 23 March 2011

Changing the ‎<p> to ‎<div> breaks CSS in monobook/rtl.css and /resources/mediawiki.special/mediawiki.special.css.

#Comment by Nikerabbit (talk | contribs)   11:11, 24 March 2011

Will fix later if nobody else fixes the rules.

Status & tagging log