<?php if ($this->pageCount): ?>
<div class="pagination">
<?php if (isset($this->previous)): ?>
  <a href="#" onClick="changePage('<?php echo $this->itemCountPerPage; ?>', '<?php echo $this->first; ?>')">&lt;&lt; <?php echo $this->t('first'); ?></a>
<?php else: ?>
  <span class="previous-off">&laquo; <?php echo $this->t('first'); ?></span>
<?php endif; ?>

<?php if (isset($this->previous)): ?>
   <a href="#" onClick="changePage('<?php echo $this->itemCountPerPage; ?>', '<?php echo $this->previous; ?>')">&lt; <?php echo $this->t('previous'); ?></a> 
<?php else: ?>
  <span class="previous-off">&lt; <?php echo $this->t('previous'); ?></span> 
<?php endif; ?>

<?php foreach ($this->pagesInRange as $page): ?>
  <?php if ($page != $this->current): ?>
    <a href="#" onClick="changePage('<?php echo $this->itemCountPerPage; ?>', '<?php echo $page; ?>')"><?php echo $page; ?></a> 
  <?php else: ?>
    <span class="active"><?php echo $page; ?></span>
  <?php endif; ?>
<?php endforeach; ?>

<?php if (isset($this->next)): ?>
  <a href="#" onClick="changePage('<?php echo $this->itemCountPerPage; ?>', '<?php echo $this->next; ?>')"><?php echo $this->t('next'); ?> &gt;</a> 
<?php else: ?>
  <span class="next-off"><?php echo $this->t('next'); ?> &gt;</span> 
<?php endif; ?>

<!-- Last page link -->
<?php if (isset($this->next)): ?>
  <a href="#" onClick="changePage('<?php echo $this->itemCountPerPage; ?>', '<?php echo $this->last; ?>')"><?php echo $this->t('last'); ?> &gt;&gt;</a>
<?php else: ?>
  <span class="next-off"><?php echo $this->t('last'); ?> &raquo;</span>
<?php endif; ?>

</div>
<?php endif; ?>
