fix issues with apporder related to recent pinned apps changes

This commit is contained in:
Mario Vavti 2017-11-19 22:42:16 +01:00
parent 66a0b4790e
commit 241a0829dc
3 changed files with 25 additions and 11 deletions

View File

@ -633,7 +633,7 @@ class Apps {
static function moveup($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, 'nav_featured_app');
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);
@ -674,7 +674,7 @@ class Apps {
static function movedown($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, 'nav_featured_app');
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);

View File

@ -18,7 +18,7 @@ class Apporder extends \Zotlabs\Web\Controller {
nav_set_selected('Order Apps');
$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);
@ -31,14 +31,20 @@ class Apporder extends \Zotlabs\Web\Controller {
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
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');
}
}
return replace_macros(get_markup_template('apporder.tpl'),
[
'$header' => t('Change Order of Navigation Apps'),
'$desc' => t('Use arrows to move the corresponding app up or down in the display list'),
'$nav_apps' => $nav_apps
'$header' => [t('Change Order of Pinned Navbar Apps'), t('Change Order of App Tray Apps')],
'$desc' => [t('Use arrows to move the corresponding app left (top) or right (bottom) in the navbar'), t('Use arrows to move the corresponding app up or down in the app tray')],
'$nav_apps' => $nav_apps,
'$navbar_apps' => $navbar_apps
]
);
}

View File

@ -1,7 +1,15 @@
<h2>{{$header}}</h2>
<div class="descriptive-text">{{$desc}}</div>
<br><br><br>
{{if $navbar_apps}}
<h2>{{$header.0}}</h2>
<div class="descriptive-text">{{$desc.0}}</div>
<br><br>
{{foreach $navbar_apps as $navbar_app}}
{{$navbar_app}}
{{/foreach}}
<br><br>
{{/if}}
<h2>{{$header.1}}</h2>
<div class="descriptive-text">{{$desc.1}}</div>
<br><br>
{{foreach $nav_apps as $nav_app}}
{{$nav_app}}
{{/foreach}}