<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PageHtmlUtil { private static function itemRender($mTKI1, $ineBL, $sXLfx, $xIfit) { goto vQYK1; z6vkh: return join('', $lSp6_); goto oZP_F; vQYK1: $lSp6_ = array(); goto c0vgu; c0vgu: for ($eQWJY = $mTKI1; $eQWJY <= $ineBL; $eQWJY++) { if ($eQWJY == $sXLfx) { $lSp6_[] = '<span class="current">' . $eQWJY . '</span>'; } else { $lSp6_[] = '<a class="page" href="' . str_replace('{page}', $eQWJY, $xIfit) . '">' . $eQWJY . '</a>'; } } goto z6vkh; oZP_F: } public static function nextPageUrl($hSsyS, $ibxOT, $sXLfx, $xIfit = '/url/for/path?page={page}') { goto Up4rx; XwP1s: return null; goto XuD0R; Up4rx: $jH9T1 = ceil($hSsyS / $ibxOT); goto USQUP; USQUP: if ($sXLfx < $jH9T1) { return str_replace('{page}', $sXLfx + 1, $xIfit); } goto XwP1s; XuD0R: } public static function prevPageUrl($hSsyS, $ibxOT, $sXLfx, $xIfit = '/url/for/path?page={page}') { if ($sXLfx > 1) { return str_replace('{page}', $sXLfx - 1, $xIfit); } return null; } public static function render($hSsyS, $ibxOT, $sXLfx, $xIfit = '/url/for/path?page={page}') { goto Gal_A; ph2ta: if ($sXLfx < $jH9T1) { $lSp6_[] = '<a class="page" href="' . str_replace('{page}', $sXLfx + 1, $xIfit) . '">下一页</a>'; } goto Fd7xt; BuT4P: $lSp6_[] = '<div class="pages">'; goto knhTf; knhTf: if ($jH9T1 < 6) { if ($jH9T1 > 0) { $lSp6_[] = self::itemRender(1, $jH9T1, $sXLfx, $xIfit); } } else { goto nkfG5; eTpe_: if ($WS3cy < 4) { $WS3cy = 4; } goto NSNAG; nkfG5: $lSp6_[] = self::itemRender(1, 3, $sXLfx, $xIfit); goto a5DSn; hLO_T: if ($WS3cy > 3 + 1) { $lSp6_[] = '<span class="more">...</span>'; } goto siqM_; OMkXR: $lSp6_[] = self::itemRender($jH9T1 - 2, $jH9T1, $sXLfx, $xIfit); goto thTgR; NSNAG: if ($K6sLC > $jH9T1 - 3) { $K6sLC = $jH9T1 - 3; } goto hLO_T; yqpqB: $K6sLC = $sXLfx + 3; goto eTpe_; tB5Wv: if ($K6sLC < $jH9T1 - 3) { $lSp6_[] = '<span class="more">...</span>'; } goto OMkXR; a5DSn: $WS3cy = $sXLfx - 3; goto yqpqB; siqM_: $lSp6_[] = self::itemRender($WS3cy, $K6sLC, $sXLfx, $xIfit); goto tB5Wv; thTgR: } goto GEv4b; Rp4rH: if ($sXLfx < 1) { $sXLfx = 1; } else { if ($sXLfx > $jH9T1) { $sXLfx = $jH9T1; } } goto JzPpA; Fd7xt: $lSp6_[] = '</div>'; goto ViYpX; JzPpA: $lSp6_ = array(); goto BuT4P; ViYpX: return join('', $lSp6_); goto pcrWz; Gal_A: $jH9T1 = ceil($hSsyS / $ibxOT); goto Rp4rH; GEv4b: if ($sXLfx > 1) { $lSp6_[] = '<a class="page" href="' . str_replace('{page}', $sXLfx - 1, $xIfit) . '">上一页</a>'; } goto ph2ta; pcrWz: } }