From 8cc227dad2eef9bd039d8e628f0edd2cac0c409a Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Sat, 26 Nov 2022 10:58:20 +0800 Subject: =?UTF-8?q?=F0=9F=A7=AD=20Add:=20=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Matcha.php | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'libs/Matcha.php') diff --git a/libs/Matcha.php b/libs/Matcha.php index 616b5d9..7044d85 100644 --- a/libs/Matcha.php +++ b/libs/Matcha.php @@ -255,20 +255,35 @@ class Matcha */ public static function pageNav(Widget_Archive $archive, $tag) { - $archive->widget('Widget_Contents_Page_List')->to($pages); - //首页链接 - echo '<'.$tag.'>首页'; - //页面列表 - while($pages->next()) { + $data = json_decode(Helper::options()->customNav, true); + + if(Helper::options()->customNav!='' && $data==null) { + echo '导航栏设置错误'; + return false; + } + + if(Helper::options()->customNav=='' || $data['type']=='addition'){ + $archive->widget('Widget_Contents_Page_List')->to($pages); + //首页链接 echo '<'.$tag.'>'; - $pages->title(); - echo ''; + Utils::indexHome(); + echo '">首页'; + //页面列表 + while($pages->next()) { + echo '<'.$tag.'>'; + $pages->title(); + echo ''; + } + } + + if(Helper::options()->customNav!='' && $data!=null) { + foreach($data['content'] as $item) { + echo '<'.$tag.'>'.$item['text'].''; + } } } -- cgit v1.2.3