<?php
/**
 * Partial script for all pagination visualization.
 * It supposes that $mainUrl view variable is set, mostly via paginationControl
 * helper call as last parameter.
 */
?>
<?php if ($this->pageCount>1): ?>
<?php if ($this->current != $this->first): ?>
  <a href="<?php echo $this->mainUrl?>" title="<?php echo $this->trans("First page")?>">|&lt;</a>
<?php else: ?>|&lt;
<?php endif;
if (isset($this->previous)): ?>
  <a href="<?php echo $this->mainUrl
	. ($this->previous>1
			? "?" . http_build_query(array("page"=>$this->previous))
			: ""
		)?>" title="<?php echo $this->trans("Previous page")?>">&lt;</a>
<?php else: ?>&lt;<?php endif;?>

<?php foreach ($this->pagesInRange as $page):
  if ($page != $this->current): ?>
	<a href="<?php echo $this->mainUrl 
    . ($page>1
        ? "?" . http_build_query(array("page"=>$page))
        : "")
    ?>" title="<?php echo $this->trans("Page no.") . " $page"?>"><?php echo $page; ?></a>
 <?php else: ?><span style="font-weight: bold"><?php echo $page;?></span>
<?php endif;endforeach;?>

<?php if (isset($this->next)): ?>
  <a href="<?php echo $this->mainUrl . "?" . http_build_query(array("page"=>$this->next))?>"
    title="<?php echo $this->trans("Next page")?>">&gt;</a>
<?php else: ?>&gt;
<?php endif; ?>

<?php if ($this->current != $this->last): ?>
  <a href="<?php echo $this->mainUrl . "?" . http_build_query(array("page"=>$this->last))?>"
    title="<?php echo $this->trans("Last page")?>">&gt;|</a>
<?php else: ?>&gt;|
<?php endif; ?>

<?php endif; ?>
