add constante for the app id and the app name

This commit is contained in:
Simon Vieille 2020-09-21 11:28:55 +02:00
commit 9a67c165bd
Signed by: deblan
GPG key ID: 03383D15A1D31745
9 changed files with 89 additions and 77 deletions

View file

@ -29,6 +29,7 @@ use OCP\IL10N;
use OCP\IRequest;
use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCA\SideMenu\AppInfo\Application;
class NavController extends Controller
{
@ -98,7 +99,7 @@ class NavController extends Controller
$apps = $this->appRepository->getVisibleApps();
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
$categoriesLabels = $this->categoryFetcher->get();
$externalSitesInTopMenu = (bool) $this->config->getAppValue('side_menu', 'external-sites-in-top-menu', 0);
$externalSitesInTopMenu = (bool) $this->config->getAppValue(Application::APP_ID, 'external-sites-in-top-menu', 0);
$user = OC::$server[IUserSession::class]->getUser();
$appsCategories = [];
$categoriesAppsCount = [];
@ -110,8 +111,8 @@ 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);
$topMenuApps = (array) json_decode($this->config->getAppValue(Application::APP_ID, 'top-menu-apps', '[]'), true);
$userTopMenuApps = (array) json_decode($this->config->getUserValue($user->getUid(), Application::APP_ID, 'top-menu-apps', '[]'), true);
if (!empty($userTopMenuApps)) {
$topMenuApps = $userTopMenuApps;