<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PageHtmlUtil { private static function itemRender($GcZ1R, $uqLdQ, $UiipW, $m2Dmo) { goto Yga5B; Yga5B: $A1nut = array(); goto TLAWg; TLAWg: for ($MqJHJ = $GcZ1R; $MqJHJ <= $uqLdQ; $MqJHJ++) { if ($MqJHJ == $UiipW) { $A1nut[] = '<span class="current">' . $MqJHJ . '</span>'; } else { $A1nut[] = '<a class="page" href="' . str_replace('{page}', $MqJHJ, $m2Dmo) . '">' . $MqJHJ . '</a>'; } } goto EWyRL; EWyRL: return join('', $A1nut); goto RK1rN; RK1rN: } public static function nextPageUrl($A_xpu, $UuKEc, $UiipW, $m2Dmo = '/url/for/path?page={page}') { goto LbdlW; oFXII: if ($UiipW < $gjXQE) { return str_replace('{page}', $UiipW + 1, $m2Dmo); } goto yH7jv; yH7jv: return null; goto qQ8Nw; LbdlW: $gjXQE = ceil($A_xpu / $UuKEc); goto oFXII; qQ8Nw: } public static function prevPageUrl($A_xpu, $UuKEc, $UiipW, $m2Dmo = '/url/for/path?page={page}') { if ($UiipW > 1) { return str_replace('{page}', $UiipW - 1, $m2Dmo); } return null; } public static function render($A_xpu, $UuKEc, $UiipW, $m2Dmo = '/url/for/path?page={page}') { goto Zvuhe; aXLwz: if ($UiipW < $gjXQE) { $A1nut[] = '<a class="page" href="' . str_replace('{page}', $UiipW + 1, $m2Dmo) . '">下一页</a>'; } goto X40bj; aAtQM: return join('', $A1nut); goto t9pXK; X40bj: $A1nut[] = '</div>'; goto aAtQM; ukRYf: $A1nut[] = '<div class="pages">'; goto z9jeg; Zvuhe: $gjXQE = ceil($A_xpu / $UuKEc); goto T5_47; kkHxe: $A1nut = array(); goto ukRYf; T5_47: if ($UiipW < 1) { $UiipW = 1; } else { if ($UiipW > $gjXQE) { $UiipW = $gjXQE; } } goto kkHxe; z9jeg: if ($gjXQE < 6) { if ($gjXQE > 0) { $A1nut[] = self::itemRender(1, $gjXQE, $UiipW, $m2Dmo); } } else { goto F6dGc; J8d2w: $A1nut[] = self::itemRender($gjXQE - 2, $gjXQE, $UiipW, $m2Dmo); goto shB2d; ehJ56: if ($EOZNJ < $gjXQE - 3) { $A1nut[] = '<span class="more">...</span>'; } goto J8d2w; ArBxP: if ($EOZNJ > $gjXQE - 3) { $EOZNJ = $gjXQE - 3; } goto XvXSw; GUMBH: if ($rvH03 < 4) { $rvH03 = 4; } goto ArBxP; F6dGc: $A1nut[] = self::itemRender(1, 3, $UiipW, $m2Dmo); goto KvkoO; ygm7v: $A1nut[] = self::itemRender($rvH03, $EOZNJ, $UiipW, $m2Dmo); goto ehJ56; XvXSw: if ($rvH03 > 3 + 1) { $A1nut[] = '<span class="more">...</span>'; } goto ygm7v; pxX3c: $EOZNJ = $UiipW + 3; goto GUMBH; KvkoO: $rvH03 = $UiipW - 3; goto pxX3c; shB2d: } goto OqoDn; OqoDn: if ($UiipW > 1) { $A1nut[] = '<a class="page" href="' . str_replace('{page}', $UiipW - 1, $m2Dmo) . '">上一页</a>'; } goto aXLwz; t9pXK: } }