aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZot <mike@macgirvin.com>2020-06-11 12:13:43 +0200
committerMario <mario@mariovavti.com>2020-06-11 12:13:43 +0200
commit3201a4bec5f3524c2eba813e46d69b4c5943840f (patch)
tree255dc1dbe5745a2bf9b5a4f93ed82628052067cb
parent9da8e30c378a58a89d3eeaf2f29d8c8774128235 (diff)
downloadvolse-hubzilla-3201a4bec5f3524c2eba813e46d69b4c5943840f.tar.gz
volse-hubzilla-3201a4bec5f3524c2eba813e46d69b4c5943840f.tar.bz2
volse-hubzilla-3201a4bec5f3524c2eba813e46d69b4c5943840f.zip
allow apps to be both pinned and starred independently
-rw-r--r--Zotlabs/Lib/Apps.php6
-rw-r--r--Zotlabs/Module/Apporder.php4
-rw-r--r--include/nav.php8
-rw-r--r--view/tpl/app.tpl4
4 files changed, 8 insertions, 14 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index f11bb9628..7b980b8d3 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -564,7 +564,8 @@ class Apps {
'$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
'$pinned' => ((strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true),
'$navapps' => (($mode == 'nav') ? true : false),
- '$order' => (($mode == 'nav-order') ? true : false),
+ '$order' => (($mode === 'nav-order' || $mode === 'nav-order-pinned') ? true : false),
+ '$mode' => $mode,
'$add' => t('Add to app-tray'),
'$remove' => t('Remove from app-tray'),
'$add_nav' => t('Pin to navbar'),
@@ -959,9 +960,6 @@ class Apps {
if($list) {
foreach($list as $li) {
$papp = self::app_encode($li);
- if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
- continue;
-
$syslist[] = $papp;
}
}
diff --git a/Zotlabs/Module/Apporder.php b/Zotlabs/Module/Apporder.php
index eac1abc2d..313c2df50 100644
--- a/Zotlabs/Module/Apporder.php
+++ b/Zotlabs/Module/Apporder.php
@@ -34,9 +34,9 @@ class Apporder extends \Zotlabs\Web\Controller {
foreach($syslist as $app) {
if($l === 'nav_pinned_app') {
- $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
+ $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order-pinned');
}
- elseif(strpos($app['categories'],'nav_pinned_app') === false) {
+ else {
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
}
}
diff --git a/include/nav.php b/include/nav.php
index bd4d000f7..b2a061661 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -296,14 +296,10 @@ function nav($template = 'default') {
$app['active'] = true;
if($is_owner) {
- if(strpos($app['categories'],'nav_pinned_app') === false) {
- $nav_apps[] = Apps::app_render($app,'nav');
- }
+ $nav_apps[] = Apps::app_render($app,'nav');
}
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
- if(strpos($app['categories'],'nav_pinned_app') === false) {
- $nav_apps[] = Apps::app_render($app,'nav');
- }
+ $nav_apps[] = Apps::app_render($app,'nav');
}
}
}
diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl
index cacbf7e64..774b75b31 100644
--- a/view/tpl/app.tpl
+++ b/view/tpl/app.tpl
@@ -31,8 +31,8 @@
<a class="dropdown-item{{if $app.active}} active{{/if}}" href="{{$app.url}}">{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a>
{{/if}}
{{if $order}}
-<a href="{{$hosturl}}appman/{{$app.guid}}/moveup{{if $pinned}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
-<a href="{{$hosturl}}appman/{{$app.guid}}/movedown{{if $pinned}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a>
+<a href="{{$hosturl}}appman/{{$app.guid}}/moveup{{if $mode == 'nav-order-pinned'}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
+<a href="{{$hosturl}}appman/{{$app.guid}}/movedown{{if $mode == 'nav-order-pinned'}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a>
{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}<br>
{{/if}}