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 $halfRange = floor($this->paginationPagesCount/2);
18 $start = $current - $halfRange;
19 $end = $current + $halfRange;
27 <?php
if ($current > 0): ?>
28 <div
class=
"pagination-previous">
29 <?php echo CHtml::link(
CommentsModule::t(
"Previous"), $this->createPaginationUrl($current - 1))?>
33 <?php
for ($i = $start; $i <= $end; $i++): ?>
34 <div
class=
"pagination-<?php echo $i == $current ? 'current' : 'item'?>">
35 <?php echo CHtml::link($i + 1, $this->createPaginationUrl($i))?>
39 <?php
if ($current < $total): ?>
40 <div
class=
"pagination-next">
41 <?php echo CHtml::link(
CommentsModule::t(
'Next'), $this->createPaginationUrl($current + 1))?>
45 <div
class=
"pagination-last">
46 <?php echo CHtml::link(
CommentsModule::t(
'Last'), $this->createPaginationUrl($total))?>