<?php
/*
 * ARI Media Gallery Joomla! module
 *
 * @package		ARI Data Tables Joomla! module.
 * @version		1.0.0
 * @author		ARI Soft
 * @copyright	Copyright (c) 2009 www.ari-soft.com. All rights reserved
 * @license		GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
 * 
 */

(defined('_JEXEC') && defined('ARI_FRAMEWORK_LOADED')) or die;

AriKernel::import('Template.Template');

$pageSizeId = uniqid('ps_', false);
$pagingParams = $params['pagingParams'];
$pageSize = $pagingParams['pageSize'];
$currentPage = $pagingParams['currentPage'];
$pageList = $pagingParams['pageList'];
$pageCount = $params['pageCount'];
?>
<div class="page-nav pagination">
	<label for="<?php echo $pageSizeId; ?>"><?php echo JText::_('LIB_ARISMARTCONTENTMEDIAGALLERY_LABEL_DISPLAY'); ?></label>
	<?php
	echo JHTML::_(
		'select.genericlist',
		$pageList,
		'',
		' id="' . $pageSizeId . '" class="page-size" autocomplete="off"',
		'value',
		'text',
		$pageSize
	);
	?>&nbsp;&nbsp;
	<ul>
		<li><a href="#" class="btn-first" rel="first">&laquo;</a></li>
		<li><a href="#" class="btn-prev" rel="prev">&lsaquo;</a></li>
		<?php
			for ($pageIdx = 0; $pageIdx < $pageCount; $pageIdx++):
				$isCurrentPage = ($pageIdx == $currentPage); 
		?>
		<li class="page-holder p<?php echo $pageIdx; ?> <?php if ($isCurrentPage):?> active<?php endif; ?>"><a href="#" class="btn-page" rel="<?php echo $pageIdx; ?>"><?php echo $pageIdx + 1; ?></a></li>
		<?php
			endfor; 
		?>
		<li><a href="#" class="btn-next" rel="next">&rsaquo;</a></li>
		<li><a href="#" class="btn-last" rel="last">&raquo;</a></li>
	</ul>
</div>