From 78c9f752af8db5db290a57224fa1d0239a36a34d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Nov 2017 11:11:06 +0100 Subject: provide ability to pin apps to navbar from /apps. this removes the ability to have per custom navbar pinned apps - this can be added later if desired --- include/nav.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/nav.php') diff --git a/include/nav.php b/include/nav.php index 9df50c9fe..8d39d492a 100644 --- a/include/nav.php +++ b/include/nav.php @@ -253,7 +253,7 @@ EOT; } $syslist = array(); - $list = Zlib\Apps::app_list(local_channel(), false, 'nav_featured_app'); + $list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']); if($list) { foreach($list as $li) { $syslist[] = Zlib\Apps::app_encode($li); @@ -274,16 +274,20 @@ EOT; $app['active'] = true; if($is_owner) { - $nav_apps[] = Zlib\Apps::app_render($app,'nav'); - if(strpos($app['categories'],'navbar_' . $template)) { + if(strpos($app['categories'],'nav_pinned_app')) { $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); } + else { + $nav_apps[] = Zlib\Apps::app_render($app,'nav'); + } } elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { - $nav_apps[] = Zlib\Apps::app_render($app,'nav'); - if(strpos($app['categories'],'navbar_' . $template)) { + if(strpos($app['categories'],'nav_pinned_app')) { $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); } + else { + $nav_apps[] = Zlib\Apps::app_render($app,'nav'); + } } } -- cgit v1.2.3 From cba602bf64dd4e9566e5c060c38480128735a60d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Nov 2017 13:10:08 +0100 Subject: compare strpos result against false --- include/nav.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/nav.php') diff --git a/include/nav.php b/include/nav.php index 8d39d492a..2dcf68bc8 100644 --- a/include/nav.php +++ b/include/nav.php @@ -274,7 +274,7 @@ EOT; $app['active'] = true; if($is_owner) { - if(strpos($app['categories'],'nav_pinned_app')) { + if(strpos($app['categories'],'nav_pinned_app') !== false) { $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); } else { @@ -282,7 +282,7 @@ EOT; } } elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { - if(strpos($app['categories'],'nav_pinned_app')) { + if(strpos($app['categories'],'nav_pinned_app') !== false) { $navbar_apps[] = Zlib\Apps::app_render($app,'navbar'); } else { -- cgit v1.2.3