<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PageHtmlUtil { private static function itemRender($GJZpW, $g106V, $tY5vk, $ik1Qg) { goto T_pAF; xjR9C: for ($kM8qX = $GJZpW; $kM8qX <= $g106V; $kM8qX++) { if ($kM8qX == $tY5vk) { $pbwAU[] = '<span class="current">' . $kM8qX . '</span>'; } else { $pbwAU[] = '<a class="page" href="' . str_replace('{page}', $kM8qX, $ik1Qg) . '">' . $kM8qX . '</a>'; } } goto fECFI; T_pAF: $pbwAU = array(); goto xjR9C; fECFI: return join('', $pbwAU); goto RugDM; RugDM: } public static function nextPageUrl($n47VW, $wI1r0, $tY5vk, $ik1Qg = '/url/for/path?page={page}') { goto cxGns; cxGns: $AtkDh = ceil($n47VW / $wI1r0); goto OXL1o; gMG0s: return null; goto x6dyn; OXL1o: if ($tY5vk < $AtkDh) { return str_replace('{page}', $tY5vk + 1, $ik1Qg); } goto gMG0s; x6dyn: } public static function prevPageUrl($n47VW, $wI1r0, $tY5vk, $ik1Qg = '/url/for/path?page={page}') { if ($tY5vk > 1) { return str_replace('{page}', $tY5vk - 1, $ik1Qg); } return null; } public static function render($n47VW, $wI1r0, $tY5vk, $ik1Qg = '/url/for/path?page={page}') { goto wO4IE; NB59t: $pbwAU[] = '</div>'; goto ZMgDH; uoISn: $pbwAU[] = '<div class="pages">'; goto ej4r6; ZMgDH: return join('', $pbwAU); goto xr5Iv; ej4r6: if ($AtkDh < 6) { if ($AtkDh > 0) { $pbwAU[] = self::itemRender(1, $AtkDh, $tY5vk, $ik1Qg); } } else { goto QBALL; Aub2p: $pbwAU[] = self::itemRender($AtkDh - 2, $AtkDh, $tY5vk, $ik1Qg); goto Yg3Gl; Q7N43: if ($r_hKe < 4) { $r_hKe = 4; } goto DSUcg; aVY7H: $r_hKe = $tY5vk - 3; goto hiPc1; zpY_n: $pbwAU[] = self::itemRender($r_hKe, $Q21lI, $tY5vk, $ik1Qg); goto Zjo1i; UCxtB: if ($r_hKe > 3 + 1) { $pbwAU[] = '<span class="more">...</span>'; } goto zpY_n; QBALL: $pbwAU[] = self::itemRender(1, 3, $tY5vk, $ik1Qg); goto aVY7H; DSUcg: if ($Q21lI > $AtkDh - 3) { $Q21lI = $AtkDh - 3; } goto UCxtB; Zjo1i: if ($Q21lI < $AtkDh - 3) { $pbwAU[] = '<span class="more">...</span>'; } goto Aub2p; hiPc1: $Q21lI = $tY5vk + 3; goto Q7N43; Yg3Gl: } goto uilrf; tLXpu: if ($tY5vk < $AtkDh) { $pbwAU[] = '<a class="page" href="' . str_replace('{page}', $tY5vk + 1, $ik1Qg) . '">下一页</a>'; } goto NB59t; kSIpP: $pbwAU = array(); goto uoISn; uilrf: if ($tY5vk > 1) { $pbwAU[] = '<a class="page" href="' . str_replace('{page}', $tY5vk - 1, $ik1Qg) . '">上一页</a>'; } goto tLXpu; pyFnm: if ($tY5vk < 1) { $tY5vk = 1; } else { if ($tY5vk > $AtkDh) { $tY5vk = $AtkDh; } } goto kSIpP; wO4IE: $AtkDh = ceil($n47VW / $wI1r0); goto pyFnm; xr5Iv: } }