<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PageHtmlUtil { private static function itemRender($VEnMw, $XoefR, $ejMjt, $BV17G) { goto hOIc4; ScV4K: for ($K3Ni_ = $VEnMw; $K3Ni_ <= $XoefR; $K3Ni_++) { if ($K3Ni_ == $ejMjt) { $B8MP1[] = '<span class="current">' . $K3Ni_ . '</span>'; } else { $B8MP1[] = '<a class="page" href="' . str_replace('{page}', $K3Ni_, $BV17G) . '">' . $K3Ni_ . '</a>'; } } goto zAk04; zAk04: return join('', $B8MP1); goto M2jkD; hOIc4: $B8MP1 = array(); goto ScV4K; M2jkD: } public static function render($hWiW3, $HY7bx, $ejMjt, $BV17G = '/url/for/path?page={page}') { goto YAmwB; f9RMC: if ($nqwh9 < 6) { if ($nqwh9 > 0) { $B8MP1[] = self::itemRender(1, $nqwh9, $ejMjt, $BV17G); } } else { goto KdWba; w9Wbp: if ($x_eeG > 3 + 1) { $B8MP1[] = '<span class="more">...</span>'; } goto IqVt_; WxWtU: $x_eeG = $ejMjt - 3; goto otUR0; UnuvK: if ($x_eeG < 4) { $x_eeG = 4; } goto KP4Jy; W3XLj: if ($gl9Ks < $nqwh9 - 3) { $B8MP1[] = '<span class="more">...</span>'; } goto tlO90; otUR0: $gl9Ks = $ejMjt + 3; goto UnuvK; KP4Jy: if ($gl9Ks > $nqwh9 - 3) { $gl9Ks = $nqwh9 - 3; } goto w9Wbp; KdWba: $B8MP1[] = self::itemRender(1, 3, $ejMjt, $BV17G); goto WxWtU; tlO90: $B8MP1[] = self::itemRender($nqwh9 - 2, $nqwh9, $ejMjt, $BV17G); goto hjsUQ; IqVt_: $B8MP1[] = self::itemRender($x_eeG, $gl9Ks, $ejMjt, $BV17G); goto W3XLj; hjsUQ: } goto hFt7J; ZOZXi: if ($ejMjt < $nqwh9) { $B8MP1[] = '<a class="page" href="' . str_replace('{page}', $ejMjt + 1, $BV17G) . '">下一页</a>'; } goto eNZyg; Bwysk: $B8MP1 = array(); goto uwYSE; hFt7J: if ($ejMjt > 1) { $B8MP1[] = '<a class="page" href="' . str_replace('{page}', $ejMjt - 1, $BV17G) . '">上一页</a>'; } goto ZOZXi; YAmwB: $nqwh9 = ceil($hWiW3 / $HY7bx); goto flIEQ; uwYSE: $B8MP1[] = '<div class="pages">'; goto f9RMC; eNZyg: $B8MP1[] = '</div>'; goto rg1Wy; flIEQ: if ($ejMjt < 1) { $ejMjt = 1; } else { if ($ejMjt > $nqwh9) { $ejMjt = $nqwh9; } } goto Bwysk; rg1Wy: return join('', $B8MP1); goto mpR4f; mpR4f: } }