<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PageHtmlUtil { private static function itemRender($K0yTv, $kJ2hw, $hFOwT, $VzVt9) { goto PVNsF; g8530: return join('', $YUOG2); goto IbTfW; Jw3vt: for ($UCcmA = $K0yTv; $UCcmA <= $kJ2hw; $UCcmA++) { if ($UCcmA == $hFOwT) { $YUOG2[] = '<span class="current">' . $UCcmA . '</span>'; } else { $YUOG2[] = '<a class="page" href="' . str_replace('{page}', $UCcmA, $VzVt9) . '">' . $UCcmA . '</a>'; } } goto g8530; PVNsF: $YUOG2 = array(); goto Jw3vt; IbTfW: } public static function nextPageUrl($osYAb, $tWfiU, $hFOwT, $VzVt9 = '/url/for/path?page={page}') { goto hWc11; hWc11: $Vof9n = ceil($osYAb / $tWfiU); goto YzpSb; gKOmq: return null; goto aebWR; YzpSb: if ($hFOwT < $Vof9n) { return str_replace('{page}', $hFOwT + 1, $VzVt9); } goto gKOmq; aebWR: } public static function prevPageUrl($osYAb, $tWfiU, $hFOwT, $VzVt9 = '/url/for/path?page={page}') { if ($hFOwT > 1) { return str_replace('{page}', $hFOwT - 1, $VzVt9); } return null; } public static function render($osYAb, $tWfiU, $hFOwT, $VzVt9 = '/url/for/path?page={page}') { goto SrVS5; gD5ZI: if ($hFOwT < 1) { $hFOwT = 1; } else { if ($hFOwT > $Vof9n) { $hFOwT = $Vof9n; } } goto EKG6k; EKG6k: $YUOG2 = array(); goto L59fR; jpvem: return join('', $YUOG2); goto sYx8n; mJIBN: if ($hFOwT > 1) { $YUOG2[] = '<a class="page" href="' . str_replace('{page}', $hFOwT - 1, $VzVt9) . '">上一页</a>'; } goto NQp4B; SrVS5: $Vof9n = ceil($osYAb / $tWfiU); goto gD5ZI; L59fR: $YUOG2[] = '<div class="pages">'; goto Z_1vT; hvldg: $YUOG2[] = '</div>'; goto jpvem; NQp4B: if ($hFOwT < $Vof9n) { $YUOG2[] = '<a class="page" href="' . str_replace('{page}', $hFOwT + 1, $VzVt9) . '">下一页</a>'; } goto hvldg; Z_1vT: if ($Vof9n < 6) { if ($Vof9n > 0) { $YUOG2[] = self::itemRender(1, $Vof9n, $hFOwT, $VzVt9); } } else { goto fd6Dw; AgE41: $YUOG2[] = self::itemRender($EPAbN, $E2M7q, $hFOwT, $VzVt9); goto KocZw; KocZw: if ($E2M7q < $Vof9n - 3) { $YUOG2[] = '<span class="more">...</span>'; } goto Z6eo2; vC9Tt: if ($E2M7q > $Vof9n - 3) { $E2M7q = $Vof9n - 3; } goto Bbmqc; HrTfM: if ($EPAbN < 4) { $EPAbN = 4; } goto vC9Tt; Bbmqc: if ($EPAbN > 3 + 1) { $YUOG2[] = '<span class="more">...</span>'; } goto AgE41; kAIuj: $E2M7q = $hFOwT + 3; goto HrTfM; GmMJW: $EPAbN = $hFOwT - 3; goto kAIuj; Z6eo2: $YUOG2[] = self::itemRender($Vof9n - 2, $Vof9n, $hFOwT, $VzVt9); goto lstPM; fd6Dw: $YUOG2[] = self::itemRender(1, 3, $hFOwT, $VzVt9); goto GmMJW; lstPM: } goto mJIBN; sYx8n: } }