add a way to create custom categories and manage application categories

This commit is contained in:
Simon Vieille
2022-01-11 19:59:51 +01:00
parent a9ca55390d
commit 30072500bc
13 changed files with 386 additions and 7 deletions
+13 -2
View File
@@ -28,6 +28,7 @@ use OCP\ILogger;
use OCP\Settings\ISettings;
use OCA\Theming\ThemingDefaults;
use OCA\SideMenu\Service\Color;
use OCA\SideMenu\Service\LangRepository;
class Admin implements ISettings
{
@@ -66,6 +67,11 @@ class Admin implements ISettings
*/
protected $color;
/**
* @var LangRepository
*/
protected $langRepository;
public function __construct(
IL10N $l,
ILogger $logger,
@@ -73,7 +79,8 @@ class Admin implements ISettings
AppRepository $appRepository,
CategoryRepository $categoryRepository,
ThemingDefaults $theming,
Color $color
Color $color,
LangRepository $langRepository
) {
$this->l = $l;
$this->logger = $logger;
@@ -82,6 +89,7 @@ class Admin implements ISettings
$this->categoryRepository = $categoryRepository;
$this->theming = $theming;
$this->color = $color;
$this->langRepository = $langRepository;
}
/**
@@ -140,10 +148,13 @@ class Admin implements ISettings
'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'),
'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'),
'default-enabled' => $this->config->getAppValue('default-enabled', '1'),
'apps' => $this->appRepository->getVisibleApps(),
'apps-categories-custom' => $this->config->getAppValueArray('apps-categories-custom', '[]'),
'categories-order-type' => $this->config->getAppValue('categories-order-type', 'default'),
'categories-order' => $this->config->getAppValueArray('categories-order', '[]'),
'apps' => $this->appRepository->getVisibleApps(),
'categories-custom' => $this->config->getAppValueArray('categories-custom', '[]'),
'categories' => $this->categoryRepository->getOrderedCategories(),
'langs' => $this->langRepository->getUsedLangs(),
];
return new TemplateResponse(Application::APP_ID, 'settings/admin-form', $parameters, '');