add options to select apps that must be displayed in the top menu (replace exteral sites option)
This commit is contained in:
+10
-2
@@ -23,6 +23,7 @@ use OCP\IL10N;
|
||||
use OCP\ILogger;
|
||||
use OCP\Settings\ISettings;
|
||||
use OCP\IConfig;
|
||||
use OCA\SideMenu\Service\AppRepository;
|
||||
|
||||
class Admin implements ISettings
|
||||
{
|
||||
@@ -41,11 +42,17 @@ class Admin implements ISettings
|
||||
*/
|
||||
private $config;
|
||||
|
||||
public function __construct(IL10N $l, ILogger $logger, IConfig $config)
|
||||
/**
|
||||
* @var AppRepository
|
||||
*/
|
||||
private $appRepository;
|
||||
|
||||
public function __construct(IL10N $l, ILogger $logger, IConfig $config, AppRepository $appRepository)
|
||||
{
|
||||
$this->l = $l;
|
||||
$this->logger = $logger;
|
||||
$this->config = $config;
|
||||
$this->appRepository = $appRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +81,8 @@ class Admin implements ISettings
|
||||
'hide-when-no-apps' => $this->config->getAppValue('side_menu', 'hide-when-no-apps', '0'),
|
||||
'size-icon' => $this->config->getAppValue('side_menu', 'size-icon', 'normal'),
|
||||
'size-text' => $this->config->getAppValue('side_menu', 'size-text', 'normal'),
|
||||
'external-sites-in-top-menu' => $this->config->getAppValue('side_menu', 'external-sites-in-top-menu', '0'),
|
||||
'top-menu-apps' => (array) json_decode($this->config->getAppValue('side_menu', 'top-menu-apps', '[]'), true),
|
||||
'apps' => $this->appRepository->getVisibleApps(),
|
||||
];
|
||||
|
||||
return new TemplateResponse('side_menu', 'settings/admin-form', $parameters, '');
|
||||
|
||||
Reference in New Issue
Block a user