add an option to force settings to users
This commit is contained in:
+27
-26
@@ -18,13 +18,13 @@
|
||||
|
||||
namespace OCA\SideMenu\Settings;
|
||||
|
||||
use OCA\SideMenu\AppInfo\Application;
|
||||
use OCA\SideMenu\Service\AppRepository;
|
||||
use OCA\SideMenu\Service\ConfigProxy;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\ILogger;
|
||||
use OCP\Settings\ISettings;
|
||||
use OCA\SideMenu\AppInfo\Application;
|
||||
|
||||
class Admin implements ISettings
|
||||
{
|
||||
@@ -39,7 +39,7 @@ class Admin implements ISettings
|
||||
private $logger;
|
||||
|
||||
/**
|
||||
* @var IConfig
|
||||
* @var ConfigProxy
|
||||
*/
|
||||
private $config;
|
||||
|
||||
@@ -48,7 +48,7 @@ class Admin implements ISettings
|
||||
*/
|
||||
private $appRepository;
|
||||
|
||||
public function __construct(IL10N $l, ILogger $logger, IConfig $config, AppRepository $appRepository)
|
||||
public function __construct(IL10N $l, ILogger $logger, ConfigProxy $config, AppRepository $appRepository)
|
||||
{
|
||||
$this->l = $l;
|
||||
$this->logger = $logger;
|
||||
@@ -61,32 +61,33 @@ class Admin implements ISettings
|
||||
*/
|
||||
public function getForm()
|
||||
{
|
||||
$backgroundColor = $this->config->getAppValue(Application::APP_ID, 'background-color', '#333333');
|
||||
$backgroundColorTo = $this->config->getAppValue(Application::APP_ID, 'background-color-to', $backgroundColor);
|
||||
$backgroundColor = $this->config->getAppValue('background-color', '#333333');
|
||||
$backgroundColorTo = $this->config->getAppValue('background-color-to', $backgroundColor);
|
||||
|
||||
$parameters = [
|
||||
'background-color' => $backgroundColor,
|
||||
'background-color-to' => $backgroundColorTo,
|
||||
'current-app-background-color' => $this->config->getAppValue(Application::APP_ID, 'current-app-background-color', '#444444'),
|
||||
'loader-color' => $this->config->getAppValue(Application::APP_ID, 'loader-color', '#0e75ac'),
|
||||
'icon-invert-filter' => (int) $this->config->getAppValue(Application::APP_ID, 'icon-invert-filter', '0'),
|
||||
'icon-opacity' => (int) $this->config->getAppValue(Application::APP_ID, 'icon-opacity', '100'),
|
||||
'loader-enabled' => $this->config->getAppValue(Application::APP_ID, 'loader-enabled', '1'),
|
||||
'text-color' => $this->config->getAppValue(Application::APP_ID, 'text-color', '#FFFFFF'),
|
||||
'cache' => $this->config->getAppValue(Application::APP_ID, 'cache', '0'),
|
||||
'opener' => $this->config->getAppValue(Application::APP_ID, 'opener', 'side-menu-opener'),
|
||||
'always-displayed' => $this->config->getAppValue(Application::APP_ID, 'always-displayed', '0'),
|
||||
'big-menu' => $this->config->getAppValue(Application::APP_ID, 'big-menu', '0'),
|
||||
'display-logo' => $this->config->getAppValue(Application::APP_ID, 'display-logo', '1'),
|
||||
'use-avatar' => $this->config->getAppValue(Application::APP_ID, 'use-avatar', '0'),
|
||||
'opener-position' => $this->config->getAppValue(Application::APP_ID, 'opener-position', 'before'),
|
||||
'opener-hover' => $this->config->getAppValue(Application::APP_ID, 'opener-hover', '0'),
|
||||
'opener-only' => $this->config->getAppValue(Application::APP_ID, 'opener-only', '0'),
|
||||
'hide-when-no-apps' => $this->config->getAppValue(Application::APP_ID, 'hide-when-no-apps', '0'),
|
||||
'size-icon' => $this->config->getAppValue(Application::APP_ID, 'size-icon', 'normal'),
|
||||
'size-text' => $this->config->getAppValue(Application::APP_ID, 'size-text', 'normal'),
|
||||
'target-blank-apps' => (array) json_decode($this->config->getAppValue(Application::APP_ID, 'target-blank-apps', '[]'), true),
|
||||
'top-menu-apps' => (array) json_decode($this->config->getAppValue(Application::APP_ID, 'top-menu-apps', '[]'), true),
|
||||
'current-app-background-color' => $this->config->getAppValue('current-app-background-color', '#444444'),
|
||||
'loader-color' => $this->config->getAppValue('loader-color', '#0e75ac'),
|
||||
'icon-invert-filter' => $this->config->getAppValueInt('icon-invert-filter', '0'),
|
||||
'icon-opacity' => $this->config->getAppValueInt('icon-opacity', '100'),
|
||||
'loader-enabled' => $this->config->getAppValue('loader-enabled', '1'),
|
||||
'text-color' => $this->config->getAppValue('text-color', '#FFFFFF'),
|
||||
'cache' => $this->config->getAppValue('cache', '0'),
|
||||
'opener' => $this->config->getAppValue('opener', 'side-menu-opener'),
|
||||
'always-displayed' => $this->config->getAppValue('always-displayed', '0'),
|
||||
'big-menu' => $this->config->getAppValue('big-menu', '0'),
|
||||
'display-logo' => $this->config->getAppValue('display-logo', '1'),
|
||||
'use-avatar' => $this->config->getAppValue('use-avatar', '0'),
|
||||
'opener-position' => $this->config->getAppValue('opener-position', 'before'),
|
||||
'opener-hover' => $this->config->getAppValue('opener-hover', '0'),
|
||||
'opener-only' => $this->config->getAppValue('opener-only', '0'),
|
||||
'hide-when-no-apps' => $this->config->getAppValue('hide-when-no-apps', '0'),
|
||||
'size-icon' => $this->config->getAppValue('size-icon', 'normal'),
|
||||
'size-text' => $this->config->getAppValue('size-text', 'normal'),
|
||||
'force' => $this->config->getAppValue('force', '0'),
|
||||
'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'),
|
||||
'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'),
|
||||
'apps' => $this->appRepository->getVisibleApps(),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user