Wrap navigation in <div class="mw-pager-navigation-bar"> in all pagers
Bug: T308364 Change-Id: Ia0253e2553ff58c852f189e052344cf2f9fe1957
This commit is contained in:
parent
c9d81cf942
commit
94553a1bcb
3 changed files with 26 additions and 34 deletions
|
|
@ -64,32 +64,33 @@ abstract class AlphabeticPager extends IndexPager {
|
|||
$this->msg( 'viewprevnext' )->rawParams( $pagingLinks['prev'],
|
||||
$pagingLinks['next'], $limits )->escaped();
|
||||
|
||||
if ( !is_array( $this->getIndexField() ) ) {
|
||||
# Early return to avoid undue nesting
|
||||
return $this->mNavigationBar;
|
||||
}
|
||||
if ( is_array( $this->getIndexField() ) ) {
|
||||
$extra = '';
|
||||
$msgs = $this->getOrderTypeMessages();
|
||||
foreach ( $msgs as $order => $msg ) {
|
||||
if ( $extra !== '' ) {
|
||||
$extra .= $this->msg( 'pipe-separator' )->escaped();
|
||||
}
|
||||
|
||||
if ( $order == $this->mOrderType ) {
|
||||
$extra .= $this->msg( $msg )->escaped();
|
||||
} else {
|
||||
$extra .= $this->makeLink(
|
||||
$this->msg( $msg )->escaped(),
|
||||
[ 'order' => $order ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$extra = '';
|
||||
$msgs = $this->getOrderTypeMessages();
|
||||
foreach ( $msgs as $order => $msg ) {
|
||||
if ( $extra !== '' ) {
|
||||
$extra .= $this->msg( 'pipe-separator' )->escaped();
|
||||
}
|
||||
|
||||
if ( $order == $this->mOrderType ) {
|
||||
$extra .= $this->msg( $msg )->escaped();
|
||||
} else {
|
||||
$extra .= $this->makeLink(
|
||||
$this->msg( $msg )->escaped(),
|
||||
[ 'order' => $order ]
|
||||
);
|
||||
$extra = ' ' . $this->msg( 'parentheses' )->rawParams( $extra )->escaped();
|
||||
$this->mNavigationBar .= $extra;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $extra !== '' ) {
|
||||
$extra = ' ' . $this->msg( 'parentheses' )->rawParams( $extra )->escaped();
|
||||
$this->mNavigationBar .= $extra;
|
||||
}
|
||||
$this->mNavigationBar = Html::rawElement( 'div', [ 'class' => 'mw-pager-navigation-bar' ],
|
||||
$this->mNavigationBar
|
||||
);
|
||||
|
||||
return $this->mNavigationBar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,6 +176,10 @@ abstract class ReverseChronologicalPager extends IndexPager {
|
|||
$this->msg( 'viewprevnext' )->rawParams(
|
||||
$pagingLinks['prev'], $pagingLinks['next'], $limits )->escaped();
|
||||
|
||||
$this->mNavigationBar = Html::rawElement( 'div', [ 'class' => 'mw-pager-navigation-bar' ],
|
||||
$this->mNavigationBar
|
||||
);
|
||||
|
||||
return $this->mNavigationBar;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -252,19 +252,6 @@ class ContribsPager extends RangeChronologicalPager {
|
|||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap the navigation bar in a p element with identifying class.
|
||||
* In future we may want to change the `p` tag to a `div` and upstream
|
||||
* this to the parent class.
|
||||
*
|
||||
* @return string HTML
|
||||
*/
|
||||
public function getNavigationBar() {
|
||||
return Html::rawElement( 'p', [ 'class' => 'mw-pager-navigation-bar' ],
|
||||
parent::getNavigationBar()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method basically executes the exact same code as the parent class, though with
|
||||
* a hook added, to allow extensions to add additional queries.
|
||||
|
|
|
|||
Loading…
Reference in a new issue