8 <?php
if ($commentsTotal > $this->commentsPerPage): ?>
9 <div
class=
"pagination">
10 <div
class=
"pagination-first">
11 <?php echo CHtml::link(
CommentsModule::t(
"First"), $this->createPaginationUrl(0))?>
14 $current = $this->getCurrentPage();
15 $total = floor($commentsTotal / $this->commentsPerPage);
16 $range = $this->paginationPagesCount;
18 $start = $current - $range + 2;
21 $end = min($total, $start + $range - 1);
23 $end = $start + $range - 1;
26 $start = $end - $range;
30 <?php
if ($current > 0): ?>
31 <div
class=
"pagination-previous">
32 <?php echo CHtml::link(
CommentsModule::t(
"Previous"), $this->createPaginationUrl($current - 1))?>
36 <?php
for ($i = $start; $i <= $end; $i++): ?>
37 <div
class=
"pagination-<?php echo $i == $current ? 'current' : 'item'?>">
38 <?php echo CHtml::link($i + 1, $this->createPaginationUrl($i))?>
42 <?php
if ($current < $total): ?>
43 <div
class=
"pagination-next">
44 <?php echo CHtml::link(
CommentsModule::t(
'Next'), $this->createPaginationUrl($current + 1))?>
48 <div
class=
"pagination-last">
49 <?php echo CHtml::link(
CommentsModule::t(
'Last'), $this->createPaginationUrl($total))?>