refactoring
This commit is contained in:
parent
deca4b2cba
commit
3f2a307226
|
@ -124,6 +124,11 @@ class NavController extends Controller
|
||||||
|
|
||||||
$categoriesLabels['external_links'] = $this->trans->t('External sites');
|
$categoriesLabels['external_links'] = $this->trans->t('External sites');
|
||||||
|
|
||||||
|
$items['other'] = [
|
||||||
|
'name' => '',
|
||||||
|
'apps' => [],
|
||||||
|
];
|
||||||
|
|
||||||
foreach ($apps as $app) {
|
foreach ($apps as $app) {
|
||||||
if (in_array($app['id'], $topMenuApps)) {
|
if (in_array($app['id'], $topMenuApps)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -132,8 +137,11 @@ class NavController extends Controller
|
||||||
$categories = (array) $app['category'];
|
$categories = (array) $app['category'];
|
||||||
$appsCategories[$app['id']] = [];
|
$appsCategories[$app['id']] = [];
|
||||||
|
|
||||||
foreach ($categories as $category) {
|
if (empty($categories)) {
|
||||||
|
$categories = ['other'];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($categories as $category) {
|
||||||
if (!isset($items[$category])) {
|
if (!isset($items[$category])) {
|
||||||
$items[$category] = [
|
$items[$category] = [
|
||||||
'name' => $categoriesLabels[$category],
|
'name' => $categoriesLabels[$category],
|
||||||
|
@ -185,17 +193,6 @@ class NavController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$items['other'] = [
|
|
||||||
'name' => '',
|
|
||||||
'apps' => [
|
|
||||||
'files' => [
|
|
||||||
'name' => 'Files',
|
|
||||||
'href' => $this->router->linkTo('files', ''),
|
|
||||||
'icon' => '/apps/files/img/app.svg',
|
|
||||||
]
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach ($items as $category => $value) {
|
foreach ($items as $category => $value) {
|
||||||
ksort($items[$category]['apps']);
|
ksort($items[$category]['apps']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,14 @@ class AppRepository
|
||||||
'external_links',
|
'external_links',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
} elseif ($app['id'] === 'files') {
|
||||||
|
$visibleApps[$app['id']] = [
|
||||||
|
'id' => $app['id'],
|
||||||
|
'name' => $app['name'],
|
||||||
|
'preview' => $app['icon'],
|
||||||
|
'previewAsIcon' => true,
|
||||||
|
'category' => [],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue