Подскажите пожалуйста как заменить средние 8 значений троеточием?
Сейчас пагинация:
< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 >
,а нужно:
< 1 2 3 ... 12 13 14 >
Код:
<ul class="pagination">
<?if ($arResult["NavPageNomer"] < $arResult["NavPageCount"]):?>
<?if($arResult["bSavePage"]):?>
<li class="prev">
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=($arResult["NavPageNomer"]+1)?>">
</a>
</li>
<?else:?>
<?if ($arResult["NavPageCount"] == ($arResult["NavPageNomer"]+1) ):?>
<li class="prev">
<a href="<?=$arResult["sUrlPath"]?><?=$strNavQueryStringFull?>">
</a>
</li>
<?else:?>
<li class="prev">
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=($arResult["NavPageNomer"]+1)?>">
</a>
</li>
<?endif?>
<?endif?>
<?else:?>
<li class="prev disabled">
<a class="noactive" href="#"></a>
</li>
<?endif?>
<?while($arResult["nStartPage"] >= $arResult["nEndPage"]):?>
<?$NavRecordGroupPrint = $arResult["NavPageCount"] - $arResult["nStartPage"] + 1;?>
<?if ($arResult["nStartPage"] == $arResult["NavPageNomer"]):?>
<li class="current">
<a href="#"><?=$NavRecordGroupPrint?></a>
</li>
<?elseif($arResult["nStartPage"] == $arResult["NavPageCount"] && $arResult["bSavePage"] == false):?>
<li>
<a href="<?=$arResult["sUrlPath"]?><?=$strNavQueryStringFull?>"><?=$NavRecordGroupPrint?></a>
</li>
<?else:?>
<li>
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=$arResult["nStartPage"]?>"><?=$NavRecordGroupPrint?></a>
</li>
<?endif?>
<?$arResult["nStartPage"]--?>
<?endwhile?>
<?if ($arResult["NavPageNomer"] > 1):?>
<li class="next">
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=($arResult["NavPageNomer"]-1)?>">
</a>
</li>
<?else:?>
<li class="next disabled">
<a href="#"></a>
</li>
<?endif?>
<?else:?>
</ul>
<ul class="pagination">
<?if ($arResult["NavPageNomer"] > 1):?>
<?if($arResult["bSavePage"]):?>
<li class="prev">
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=($arResult["NavPageNomer"]-1)?>"></a>
</li>
<?else:?>
<?if ($arResult["NavPageNomer"] > 2):?>
<li class="prev">
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=($arResult["NavPageNomer"]-1)?>"></a>
</li>
<?else:?>
<li class="prev">
<a href="<?=$arResult["sUrlPath"]?><?=$strNavQueryStringFull?>"></a>
</li>
<?endif?>
<?endif?>
<?else:?>
<li class="prev disabled">
<a href="#"></a>
</li>
<?endif?>
<?while($arResult["nStartPage"] <= $arResult["nEndPage"]):?>
<?if ($arResult["nStartPage"] == $arResult["NavPageNomer"]):?>
<li class="current">
<a href="#"><?=$arResult["nStartPage"]?></a>
</li>
<?elseif($arResult["nStartPage"] == 1 && $arResult["bSavePage"] == false):?>
<li>
<a href="<?=$arResult["sUrlPath"]?><?=$strNavQueryStringFull?>">
<?=$arResult["nStartPage"]?>
</a>
</li>
<?else:?>
<li>
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=$arResult["nStartPage"]?>">
<?=$arResult["nStartPage"]?>
</a>
</li>
<?endif?>
<?$arResult["nStartPage"]++?>
<?endwhile?>
<?if($arResult["NavPageNomer"] < $arResult["NavPageCount"]):?>
<li class="next">
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>PAGEN_<?=$arResult["NavNum"]?>=<?=($arResult["NavPageNomer"]+1)?>">
</a>
</li>
<?else:?>
<li class="disabled next">
<a href="#"></a>
</li>
<?endif?>
<?endif?>
<?if ($arResult["bShowAll"]):?>
<?if ($arResult["NavShowAll"]):?>
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>SHOWALL_<?=$arResult["NavNum"]?>=0" rel="nofollow">
<?=GetMessage("nav_paged")?>
</a>
<?else:?>
<a href="<?=$arResult["sUrlPath"]?>?<?=$strNavQueryString?>SHOWALL_<?=$arResult["NavNum"]?>=1" rel="nofollow">
<?=GetMessage("nav_all")?>
</a>
<?endif?>
<?endif?>
</ul>
Заранее спасибо.