aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/Settings
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/lib/Settings')
-rw-r--r--apps/theming/lib/Settings/Admin.php9
-rw-r--r--apps/theming/lib/Settings/AdminSection.php18
-rw-r--r--apps/theming/lib/Settings/Personal.php15
-rw-r--r--apps/theming/lib/Settings/PersonalSection.php25
4 files changed, 30 insertions, 37 deletions
diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php
index 8a7b47a44a0..9fa0f2bb0e7 100644
--- a/apps/theming/lib/Settings/Admin.php
+++ b/apps/theming/lib/Settings/Admin.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -14,6 +15,7 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
use OCP\IL10N;
+use OCP\INavigationManager;
use OCP\IURLGenerator;
use OCP\Settings\IDelegatedSettings;
use OCP\Util;
@@ -28,6 +30,7 @@ class Admin implements IDelegatedSettings {
private IInitialState $initialState,
private IURLGenerator $urlGenerator,
private ImageManager $imageManager,
+ private INavigationManager $navigationManager,
) {
}
@@ -70,7 +73,7 @@ class Admin implements IDelegatedSettings {
'docUrlIcons' => $this->urlGenerator->linkToDocs('admin-theming-icons'),
'canThemeIcons' => $this->imageManager->shouldReplaceIcons(),
'userThemingDisabled' => $this->themingDefaults->isUserThemingDisabled(),
- 'defaultApps' => array_filter(explode(',', $this->config->getSystemValueString('defaultapp', ''))),
+ 'defaultApps' => $this->navigationManager->getDefaultEntryIds(),
]);
Util::addScript($this->appName, 'admin-theming');
@@ -87,8 +90,8 @@ class Admin implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/theming/lib/Settings/AdminSection.php b/apps/theming/lib/Settings/AdminSection.php
index 3170a826310..a1ea568d9f2 100644
--- a/apps/theming/lib/Settings/AdminSection.php
+++ b/apps/theming/lib/Settings/AdminSection.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -10,14 +11,11 @@ use OCP\IURLGenerator;
use OCP\Settings\IIconSection;
class AdminSection implements IIconSection {
- private string $appName;
- private IL10N $l;
- private IURLGenerator $url;
-
- public function __construct(string $appName, IURLGenerator $url, IL10N $l) {
- $this->appName = $appName;
- $this->url = $url;
- $this->l = $l;
+ public function __construct(
+ private string $appName,
+ private IURLGenerator $url,
+ private IL10N $l,
+ ) {
}
/**
@@ -42,8 +40,8 @@ class AdminSection implements IIconSection {
/**
* @return int whether the form should be rather on the top or bottom of
- * the settings navigation. The sections are arranged in ascending order of
- * the priority values. It is required to return a value between 0 and 99.
+ * the settings navigation. The sections are arranged in ascending order of
+ * the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
*/
diff --git a/apps/theming/lib/Settings/Personal.php b/apps/theming/lib/Settings/Personal.php
index 43156515acd..f14deeb35f0 100644
--- a/apps/theming/lib/Settings/Personal.php
+++ b/apps/theming/lib/Settings/Personal.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -9,10 +10,10 @@ use OCA\Theming\ITheme;
use OCA\Theming\Service\BackgroundService;
use OCA\Theming\Service\ThemesService;
use OCA\Theming\ThemingDefaults;
-use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
+use OCP\INavigationManager;
use OCP\Settings\ISettings;
use OCP\Util;
@@ -25,7 +26,7 @@ class Personal implements ISettings {
private ThemesService $themesService,
private IInitialState $initialStateService,
private ThemingDefaults $themingDefaults,
- private IAppManager $appManager,
+ private INavigationManager $navigationManager,
) {
}
@@ -49,8 +50,8 @@ class Personal implements ISettings {
});
}
- // Get the default app enforced by admin
- $forcedDefaultApp = $this->appManager->getDefaultAppForUser(null, false);
+ // Get the default entry enforced by admin
+ $forcedDefaultEntry = $this->navigationManager->getDefaultEntryIdForUser(null, false);
/** List of all shipped backgrounds */
$this->initialStateService->provideInitialState('shippedBackgrounds', BackgroundService::SHIPPED_BACKGROUNDS);
@@ -78,7 +79,7 @@ class Personal implements ISettings {
$this->initialStateService->provideInitialState('enableBlurFilter', $this->config->getUserValue($this->userId, 'theming', 'force_enable_blur_filter', ''));
$this->initialStateService->provideInitialState('navigationBar', [
'userAppOrder' => json_decode($this->config->getUserValue($this->userId, 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR),
- 'enforcedDefaultApp' => $forcedDefaultApp
+ 'enforcedDefaultApp' => $forcedDefaultEntry
]);
Util::addScript($this->appName, 'personal-theming');
@@ -96,8 +97,8 @@ class Personal implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/theming/lib/Settings/PersonalSection.php b/apps/theming/lib/Settings/PersonalSection.php
index 4411f605903..0a9361d5533 100644
--- a/apps/theming/lib/Settings/PersonalSection.php
+++ b/apps/theming/lib/Settings/PersonalSection.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -11,15 +12,6 @@ use OCP\Settings\IIconSection;
class PersonalSection implements IIconSection {
- /** @var string */
- protected $appName;
-
- /** @var IURLGenerator */
- private $urlGenerator;
-
- /** @var IL10N */
- private $l;
-
/**
* Personal Section constructor.
*
@@ -27,12 +19,11 @@ class PersonalSection implements IIconSection {
* @param IURLGenerator $urlGenerator
* @param IL10N $l
*/
- public function __construct(string $appName,
- IURLGenerator $urlGenerator,
- IL10N $l) {
- $this->appName = $appName;
- $this->urlGenerator = $urlGenerator;
- $this->l = $l;
+ public function __construct(
+ protected string $appName,
+ private IURLGenerator $urlGenerator,
+ private IL10N $l,
+ ) {
}
/**
@@ -70,8 +61,8 @@ class PersonalSection implements IIconSection {
/**
* @return int whether the form should be rather on the top or bottom of
- * the settings navigation. The sections are arranged in ascending order of
- * the priority values. It is required to return a value between 0 and 99.
+ * the settings navigation. The sections are arranged in ascending order of
+ * the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
* @since 9.1