aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Apporder.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-12-13 03:11:30 +0000
committerMario <mario@mariovavti.com>2018-12-14 21:31:02 +0100
commitc2ad9d4996840d8b76ca1d29cffc10c7d4723b39 (patch)
tree539accab5a26420e6e15105ccb98954b874c3bb1 /Zotlabs/Module/Apporder.php
parent79f828125d6e0287a238901e504e82109eed4c93 (diff)
downloadvolse-hubzilla-c2ad9d4996840d8b76ca1d29cffc10c7d4723b39.tar.gz
volse-hubzilla-c2ad9d4996840d8b76ca1d29cffc10c7d4723b39.tar.bz2
volse-hubzilla-c2ad9d4996840d8b76ca1d29cffc10c7d4723b39.zip
regression: the ability to order apps messed up since adding pinned apps to the ordering
(cherry picked from commit 6464099364f3d4e800137a57d3b9ff9e8f7601e4)
Diffstat (limited to 'Zotlabs/Module/Apporder.php')
-rw-r--r--Zotlabs/Module/Apporder.php33
1 files changed, 18 insertions, 15 deletions
diff --git a/Zotlabs/Module/Apporder.php b/Zotlabs/Module/Apporder.php
index a9f66ba69..eac1abc2d 100644
--- a/Zotlabs/Module/Apporder.php
+++ b/Zotlabs/Module/Apporder.php
@@ -17,25 +17,28 @@ class Apporder extends \Zotlabs\Web\Controller {
nav_set_selected('Order Apps');
- $syslist = array();
- $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);
+ foreach( [ 'nav_featured_app', 'nav_pinned_app' ] as $l ) {
+ $syslist = [];
+ $list = Zlib\Apps::app_list(local_channel(), false, [ $l ]);
+ if($list) {
+ foreach($list as $li) {
+ $syslist[] = Zlib\Apps::app_encode($li);
+ }
}
- }
- Zlib\Apps::translate_system_apps($syslist);
+
+ Zlib\Apps::translate_system_apps($syslist);
- usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
+ usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
- $syslist = Zlib\Apps::app_order(local_channel(),$syslist);
+ $syslist = Zlib\Apps::app_order(local_channel(),$syslist, $l);
- foreach($syslist as $app) {
- if(strpos($app['categories'],'nav_pinned_app') !== false) {
- $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
- }
- else {
- $nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
+ foreach($syslist as $app) {
+ if($l === 'nav_pinned_app') {
+ $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
+ }
+ elseif(strpos($app['categories'],'nav_pinned_app') === false) {
+ $nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
+ }
}
}