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