<?php /** * ПоÑÑ‚Ñ€Ð°Ð½Ð¸Ñ‡Ð½Ð°Ñ Ð½Ð°Ð²Ð¸Ð³Ð°Ñ†Ð¸Ñ: Ñтандартный вид * @var $pages array ÑÑылки на Ñтраницы * @var $first array Ð¿ÐµÑ€Ð²Ð°Ñ Ñтраница * @var $last array поÑледнÑÑ Ñтраница * @var $total integer общее кол-во Ñтраниц * @var $settings array дополнительные наÑтройки */ # данные отÑутÑтвуют (общее их кол-во == 0) if( $total <= 1 || ! $settings['pages'] ) return; ?> <div class="pagination-box"> <nav class="pagination-wrapper j-pgn-pages"> <ul class="pagination"> <?php if( $settings['arrows'] ) { HTML::attributeAdd($prev_arr, 'class', 'page-link'); ?> <li class="page-item"> <a<?php if($prev){ echo HTML::attributes($prev_arr); } else { ?> href="javascript:void(0);" class="page-link disabled grey"<?php } ?>> <span>«</span> <span class="sr-only"><?= _t('@pgn', 'Previous') ?></span> </a> </li> <?php } ?> <?php if($first) { HTML::attributeAdd($first['attr_arr'], 'class', 'page-link'); HTML::attributeAdd($first['dots_arr'], 'class', 'page-link'); ?><li><a<?= HTML::attributes($first['attr_arr']); ?>><?= $first['page'] ?></a></li><li><a<?= HTML::attributes($first['dots_arr']); ?>>...</a></li><?php } ?> <?php foreach($pages as $v) { HTML::attributeAdd($v['attr_arr'], 'class', 'page-link'); ?> <li class="page-item<?php if($v['active']){ ?> active<?php } ?>"><a<?= HTML::attributes($v['attr_arr']); ?>><?= $v['page'] ?></a></li> <?php } ?> <?php if($last) { HTML::attributeAdd($last['attr_arr'], 'class', 'page-link'); HTML::attributeAdd($last['dots_arr'], 'class', 'page-link'); ?><li><a<?= HTML::attributes($last['dots_arr']); ?>>...</a></li><li class="page-item"><a<?= HTML::attributes($last['attr_arr']); ?>><?= $last['page'] ?></a></li><?php } ?> <?php if( $settings['arrows'] ) { HTML::attributeAdd($next_arr, 'class', 'page-link'); ?> <li class="page-item"> <a<?php if($next){ echo HTML::attributes($next_arr); } else { ?> href="javascript:void(0);" class="page-link disabled grey"<?php } ?>> <span>»</span> <span class="sr-only"><?= _t('@pgn', 'Next') ?></span> </a> </li> <?php } ?> </ul> <?php if ( ! empty($items_total) && ! empty($page_size) && ! empty($current)): $show = $current * $page_size; if ($show > $items_total) { $show = $items_total; } ?> <div class="pagination-count"> <strong><?= $show ?></strong> <?= _t('@pgn', 'from') ?> <strong><?= $items_total ?></strong> <?= _t('@pgn', 'rows') ?> </div> <?php endif; ?> <?php if (isset($settings['perPage'])): ?> <div class="ml-md-auto"> <?= $settings['perPage'] ?> </div> <?php endif; ?> </nav> </div>