add add top-menu-apps option in the personal settings
This commit is contained in:
@@ -109,6 +109,13 @@ class NavController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
$topMenuApps = (array) json_decode($this->config->getAppValue('side_menu', 'top-menu-apps', '[]'), true);
|
||||
$userTopMenuApps = (array) json_decode($this->config->getUserValue($user->getUid(), 'side_menu', 'top-menu-apps', '[]'), true);
|
||||
|
||||
if (!empty($userTopMenuApps)) {
|
||||
$topMenuApps = $userTopMenuApps;
|
||||
}
|
||||
|
||||
foreach ($categoriesLabels as $k => $category) {
|
||||
$categoriesLabels[$category['id']] = $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'];
|
||||
|
||||
@@ -118,13 +125,14 @@ class NavController extends Controller
|
||||
$categoriesLabels['external_links'] = $this->trans->t('External sites');
|
||||
|
||||
foreach ($apps as $app) {
|
||||
if (in_array($app['id'], $topMenuApps)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$categories = (array) $app['category'];
|
||||
$appsCategories[$app['id']] = [];
|
||||
|
||||
foreach ($categories as $category) {
|
||||
if ($externalSitesInTopMenu && $category === 'external_links') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($items[$category])) {
|
||||
$items[$category] = [
|
||||
|
||||
Reference in New Issue
Block a user