From c5e8aabe051bdd471f523236ecb47ceb59679a03 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 21 Nov 2013 00:38:48 +0400 Subject: [PATCH] Fixes #1245: LinkPager now renders disabled links as spans preventing these to be clickable --- framework/yii/widgets/LinkPager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/yii/widgets/LinkPager.php b/framework/yii/widgets/LinkPager.php index 952948f..807a4b8 100644 --- a/framework/yii/widgets/LinkPager.php +++ b/framework/yii/widgets/LinkPager.php @@ -164,14 +164,14 @@ class LinkPager extends Widget */ protected function renderPageButton($label, $page, $class, $disabled, $active) { + $options = ['class' => $class === '' ? null : $class]; if ($active) { - $class .= ' ' . $this->activePageCssClass; + Html::addCssClass($options, $this->activePageCssClass); } if ($disabled) { - $class .= ' ' . $this->disabledPageCssClass; + Html::addCssClass($options, $this->disabledPageCssClass); + return Html::tag('li', Html::tag('span', $label), $options); } - $class = trim($class); - $options = ['class' => $class === '' ? null : $class]; return Html::tag('li', Html::a($label, $this->pagination->createUrl($page), ['data-page' => $page]), $options); }