Index: trunk/phase3/includes/Pager.php |
— | — | @@ -509,17 +509,25 @@ |
510 | 510 | wfMsgHtml( 'viewprevnext', $pagingLinks['prev'], |
511 | 511 | $pagingLinks['next'], $limits ); |
512 | 512 | |
513 | | - # Which direction should the link go? Opposite of the current. |
514 | | - $dir = $this->mDefaultDirection ? 'asc' : 'desc'; |
515 | | - $query = array( 'direction' => $dir ); |
516 | | - if( $this->mOrderType !== null ) { |
517 | | - $query['order'] = $this->mOrderType; |
| 513 | + $dirlinks = array(); |
| 514 | + # Note for grep: uses pager-sort-asc, pager-sort-desc (each in two |
| 515 | + # places) |
| 516 | + foreach( array( 'asc', 'desc' ) as $dir ) { |
| 517 | + if( ($this->mDefaultDirection ? 'desc' : 'asc' ) == $dir ) { |
| 518 | + # Don't print a link, just some text |
| 519 | + $dirlinks[$dir] = wfMsgHTML( "pager-sort-$dir" ); |
| 520 | + } else { |
| 521 | + $query = array( 'direction' => $dir ); |
| 522 | + if( $this->mOrderType !== null ) { |
| 523 | + $query['order'] = $this->mOrderType; |
| 524 | + } |
| 525 | + $dirlinks[$dir] = $this->makeLink( |
| 526 | + wfMsgHTML( "pager-sort-$dir" ), |
| 527 | + $query |
| 528 | + ); |
| 529 | + } |
518 | 530 | } |
519 | | - # Note for grep: uses pager-sort-asc, pager-sort-desc |
520 | | - $this->mNavigationBar .= ' (' . $this->makeLink( |
521 | | - wfMsgHTML( "pager-sort-$dir" ), |
522 | | - $query |
523 | | - ) . ')'; |
| 531 | + $this->mNavigationBar .= ' (' . implode( ' | ', $dirlinks ) . ')'; |
524 | 532 | |
525 | 533 | if( !is_array( $this->getIndexField() ) ) { |
526 | 534 | # Early return to avoid undue nesting |
— | — | @@ -530,17 +538,20 @@ |
531 | 539 | $first = true; |
532 | 540 | $msgs = $this->getOrderTypeMessages(); |
533 | 541 | foreach( array_keys( $msgs ) as $order ) { |
| 542 | + if( $first ) { |
| 543 | + $first = false; |
| 544 | + } else { |
| 545 | + $extra .= ' | '; |
| 546 | + } |
| 547 | + |
534 | 548 | if( $order == $this->mOrderType ) { |
535 | | - continue; |
| 549 | + $extra .= wfMsgHTML( $msgs[$order] ); |
| 550 | + } else { |
| 551 | + $extra .= $this->makeLink( |
| 552 | + wfMsgHTML( $msgs[$order] ), |
| 553 | + array( 'order' => $order ) |
| 554 | + ); |
536 | 555 | } |
537 | | - if( !$first ) { |
538 | | - $extra .= ' | '; |
539 | | - $first = false; |
540 | | - } |
541 | | - $extra .= $this->makeLink( |
542 | | - wfMsgHTML( $msgs[$order] ), |
543 | | - array( 'order' => $order ) |
544 | | - ); |
545 | 556 | } |
546 | 557 | |
547 | 558 | if( $extra !== '' ) { |