This commit is contained in:
parent
0382e1c61d
commit
4d05079c70
|
@ -86,7 +86,11 @@ class AppController extends Controller
|
||||||
|
|
||||||
protected function redirectToApp($appId): RedirectResponse
|
protected function redirectToApp($appId): RedirectResponse
|
||||||
{
|
{
|
||||||
$isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false);
|
$isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue(
|
||||||
|
'htaccess.IgnoreFrontController',
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
$isFrontControllerActive = 'true' === getenv('front_controller_active');
|
$isFrontControllerActive = 'true' === getenv('front_controller_active');
|
||||||
|
|
||||||
if ($isIgnoreFrontController || $isFrontControllerActive) {
|
if ($isIgnoreFrontController || $isFrontControllerActive) {
|
||||||
|
|
|
@ -21,14 +21,14 @@ namespace OCA\SideMenu\Controller;
|
||||||
use OC;
|
use OC;
|
||||||
use OC\User\User;
|
use OC\User\User;
|
||||||
use OCA\SideMenu\AppInfo\Application;
|
use OCA\SideMenu\AppInfo\Application;
|
||||||
|
use OCA\SideMenu\Service\Color;
|
||||||
use OCA\SideMenu\Service\ConfigProxy;
|
use OCA\SideMenu\Service\ConfigProxy;
|
||||||
|
use OCA\Theming\ThemingDefaults;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
use OCP\AppFramework\Http\Response;
|
use OCP\AppFramework\Http\Response;
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
use OCP\AppFramework\Http\TemplateResponse;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use OCA\Theming\ThemingDefaults;
|
|
||||||
use OCA\SideMenu\Service\Color;
|
|
||||||
|
|
||||||
class CssController extends Controller
|
class CssController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -58,8 +58,7 @@ class CssController extends Controller
|
||||||
ConfigProxy $config,
|
ConfigProxy $config,
|
||||||
ThemingDefaults $theming,
|
ThemingDefaults $theming,
|
||||||
Color $color
|
Color $color
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
parent::__construct($appName, $request);
|
parent::__construct($appName, $request);
|
||||||
|
|
||||||
$this->user = OC::$server[IUserSession::class]->getUser();
|
$this->user = OC::$server[IUserSession::class]->getUser();
|
||||||
|
@ -105,16 +104,18 @@ class CssController extends Controller
|
||||||
$topSideMenuApps = $userTopSideMenuApps;
|
$topSideMenuApps = $userTopSideMenuApps;
|
||||||
}
|
}
|
||||||
|
|
||||||
$isDarkThemeUserEnabled = $this->config->getUserValue($this->user, 'theme', '', 'accessibility') === 'dark';
|
$isDarkThemeUserEnabled = 'dark' === $this->config->getUserValue($this->user, 'theme', '', 'accessibility');
|
||||||
$isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark');
|
$isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark');
|
||||||
|
|
||||||
$isBreezeDarkUserEnabled = $isBreezeDarkUserEnabled === '1' || ($isBreezeDarkGlobalEnabled && $isBreezeDarkUserEnabled === '');
|
$isBreezeDarkUserEnabled = '1' === $isBreezeDarkUserEnabled ||
|
||||||
|
($isBreezeDarkGlobalEnabled && '' === $isBreezeDarkUserEnabled);
|
||||||
} else {
|
} else {
|
||||||
$isDarkThemeUserEnabled = false;
|
$isDarkThemeUserEnabled = false;
|
||||||
$isBreezeDarkUserEnabled = false;
|
$isBreezeDarkUserEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$isDarkMode = ($isAccessibilityAppEnabled && $isDarkThemeUserEnabled) || ($isBreezeDarkAppEnabled && $isBreezeDarkUserEnabled);
|
$isDarkMode = ($isAccessibilityAppEnabled && $isDarkThemeUserEnabled) ||
|
||||||
|
($isBreezeDarkAppEnabled && $isBreezeDarkUserEnabled);
|
||||||
|
|
||||||
$primaryColor = $this->theming->getColorPrimary();
|
$primaryColor = $this->theming->getColorPrimary();
|
||||||
$lightenPrimaryColor = $this->color->adjustBrightness($primaryColor, 0.2);
|
$lightenPrimaryColor = $this->color->adjustBrightness($primaryColor, 0.2);
|
||||||
|
|
|
@ -43,8 +43,13 @@ class PersonalSettingController extends Controller
|
||||||
*/
|
*/
|
||||||
protected $userSession;
|
protected $userSession;
|
||||||
|
|
||||||
public function __construct($appName, IRequest $request, IConfig $config, ConfigProxy $configProxy, IUserSession $userSession)
|
public function __construct(
|
||||||
{
|
$appName,
|
||||||
|
IRequest $request,
|
||||||
|
IConfig $config,
|
||||||
|
ConfigProxy $configProxy,
|
||||||
|
IUserSession $userSession
|
||||||
|
) {
|
||||||
parent::__construct($appName, $request);
|
parent::__construct($appName, $request);
|
||||||
|
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
|
@ -54,8 +54,13 @@ class Personal implements ISettings
|
||||||
*/
|
*/
|
||||||
private $appRepository;
|
private $appRepository;
|
||||||
|
|
||||||
public function __construct(IL10N $l, ILogger $logger, ConfigProxy $config, IUserSession $userSession, AppRepository $appRepository)
|
public function __construct(
|
||||||
{
|
IL10N $l,
|
||||||
|
ILogger $logger,
|
||||||
|
ConfigProxy $config,
|
||||||
|
IUserSession $userSession,
|
||||||
|
AppRepository $appRepository
|
||||||
|
) {
|
||||||
$this->l = $l;
|
$this->l = $l;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
Loading…
Reference in a new issue