<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PageHtmlUtil { private static function itemRender($MkLTs, $o6kkl, $HOoei, $XVqXz) { goto TuEjY; V2L3w: for ($JhHfm = $MkLTs; $JhHfm <= $o6kkl; $JhHfm++) { if ($JhHfm == $HOoei) { $oAyDf[] = '<span class="current">' . $JhHfm . '</span>'; } else { $oAyDf[] = '<a class="page" href="' . str_replace('{page}', $JhHfm, $XVqXz) . '">' . $JhHfm . '</a>'; } } goto CIihH; CIihH: return join('', $oAyDf); goto O794P; TuEjY: $oAyDf = array(); goto V2L3w; O794P: } public static function nextPageUrl($XbUZp, $WovE4, $HOoei, $XVqXz = '/url/for/path?page={page}') { goto PjCBg; k2NfD: return null; goto pAl3h; PjCBg: $QAMpw = ceil($XbUZp / $WovE4); goto GvcJE; GvcJE: if ($HOoei < $QAMpw) { return str_replace('{page}', $HOoei + 1, $XVqXz); } goto k2NfD; pAl3h: } public static function prevPageUrl($XbUZp, $WovE4, $HOoei, $XVqXz = '/url/for/path?page={page}') { if ($HOoei > 1) { return str_replace('{page}', $HOoei - 1, $XVqXz); } return null; } public static function render($XbUZp, $WovE4, $HOoei, $XVqXz = '/url/for/path?page={page}') { goto XonYT; iYty7: $oAyDf[] = '</div>'; goto rd0GX; iKQzQ: if ($HOoei > 1) { $oAyDf[] = '<a class="page" href="' . str_replace('{page}', $HOoei - 1, $XVqXz) . '">上一页</a>'; } goto Yk_q9; Yk_q9: if ($HOoei < $QAMpw) { $oAyDf[] = '<a class="page" href="' . str_replace('{page}', $HOoei + 1, $XVqXz) . '">下一页</a>'; } goto iYty7; XonYT: $QAMpw = ceil($XbUZp / $WovE4); goto Y8cZ_; BCrjT: if ($QAMpw < 6) { if ($QAMpw > 0) { $oAyDf[] = self::itemRender(1, $QAMpw, $HOoei, $XVqXz); } } else { goto xh9DV; mHn26: $J2jQN = $HOoei - 3; goto HRvN9; xh9DV: $oAyDf[] = self::itemRender(1, 3, $HOoei, $XVqXz); goto mHn26; l9CEZ: if ($J2jQN > 3 + 1) { $oAyDf[] = '<span class="more">...</span>'; } goto HGzvR; HRvN9: $qlcUn = $HOoei + 3; goto bjvB4; mZE7t: if ($qlcUn > $QAMpw - 3) { $qlcUn = $QAMpw - 3; } goto l9CEZ; HGzvR: $oAyDf[] = self::itemRender($J2jQN, $qlcUn, $HOoei, $XVqXz); goto H0LPU; RO4F9: $oAyDf[] = self::itemRender($QAMpw - 2, $QAMpw, $HOoei, $XVqXz); goto aLoAX; bjvB4: if ($J2jQN < 4) { $J2jQN = 4; } goto mZE7t; H0LPU: if ($qlcUn < $QAMpw - 3) { $oAyDf[] = '<span class="more">...</span>'; } goto RO4F9; aLoAX: } goto iKQzQ; zbYO4: $oAyDf = array(); goto YYt1B; YYt1B: $oAyDf[] = '<div class="pages">'; goto BCrjT; Y8cZ_: if ($HOoei < 1) { $HOoei = 1; } else { if ($HOoei > $QAMpw) { $HOoei = $QAMpw; } } goto zbYO4; rd0GX: return join('', $oAyDf); goto E9Bl7; E9Bl7: } }