Merge branch 'master' of https://gitee.com/dxtc/chaoyu
commit
683242cb2b
|
@ -85,9 +85,12 @@ class CustomPageHelper extends Paginator
|
||||||
return $this->getPageLinkWrapper($url, $text);
|
return $this->getPageLinkWrapper($url, $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 渲染分页
|
// 渲染分页 $btnNumber [0 只显示上下页 | >= 3]
|
||||||
public function render($type = '')
|
public function render($btnNumber = 10, $type = '')
|
||||||
{
|
{
|
||||||
|
if($btnNumber == 0 || $btnNumber >= 3) {
|
||||||
|
$this->btnNumber = $btnNumber;
|
||||||
|
}
|
||||||
//数据是否足够分页
|
//数据是否足够分页
|
||||||
if ($this->hasPages()) {
|
if ($this->hasPages()) {
|
||||||
if(strtoupper($type) == 'A') {
|
if(strtoupper($type) == 'A') {
|
||||||
|
@ -154,7 +157,7 @@ class CustomPageHelper extends Paginator
|
||||||
foreach ($urls as $page => $url) {
|
foreach ($urls as $page => $url) {
|
||||||
$html .= $this->getPageLinkWrapper($url, $page, $htmlClass);
|
$html .= $this->getPageLinkWrapper($url, $page, $htmlClass);
|
||||||
}
|
}
|
||||||
if($ellipsis) {
|
if($ellipsis && $this->btnNumber > 0) {
|
||||||
$html .= $this->getDisabledTextWrapper('...', $htmlClass);
|
$html .= $this->getDisabledTextWrapper('...', $htmlClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,17 +17,23 @@ function getMenus($menus, $level = 1, $currentFirstId, $categoryId) {
|
||||||
}
|
}
|
||||||
$aHref = getUri($menu);
|
$aHref = getUri($menu);
|
||||||
$aHref = empty($aHref) ? 'javascript:;' : $aHref;
|
$aHref = empty($aHref) ? 'javascript:;' : $aHref;
|
||||||
|
$spanClass = '';
|
||||||
|
$hasChild = false;
|
||||||
|
if (isset($menu['children']) && count($menu['children']) > 0) {
|
||||||
|
$hasChild = true;
|
||||||
|
$spanClass = 'class="cur"';
|
||||||
|
}
|
||||||
if($level == 1) {
|
if($level == 1) {
|
||||||
$menuHtml .= '<li class="'.$activeClass.'" >';
|
$menuHtml .= '<li class="'.$activeClass.'" >';
|
||||||
$menuHtml .= '<span><a href="'.$aHref.'" target="'.$menu['style'].'">'.$menu['title'].'</a></span>';
|
$menuHtml .= '<span '.$spanClass.'><a href="'.$aHref.'" target="'.$menu['style'].'">'.$menu['title'].'</a></span>';
|
||||||
if (isset($menu['children']) && count($menu['children']) > 0) {
|
if ($hasChild) {
|
||||||
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
||||||
}
|
}
|
||||||
$menuHtml .= '</li>';
|
$menuHtml .= '</li>';
|
||||||
} else {
|
} else {
|
||||||
$menuHtml .= '<a href="'.$aHref.'" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
$menuHtml .= '<a href="'.$aHref.'" target="'.$menu['style'].'" class="'.$activeClass.'">';
|
||||||
$menuHtml .= '<span>'.$menu['title'].'</span>';
|
$menuHtml .= '<span '.$spanClass.'>'.$menu['title'].'</span>';
|
||||||
if (isset($menu['children']) && count($menu['children']) > 0) {
|
if ($hasChild) {
|
||||||
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
$menuHtml .= getMenus($menu['children'], $level + 1, $currentFirstId, $categoryId);
|
||||||
}
|
}
|
||||||
$menuHtml .= '</a>';
|
$menuHtml .= '</a>';
|
||||||
|
|
Loading…
Reference in New Issue