diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2020-08-21 14:58:12 +0200 |
---|---|---|
committer | Julien Veyssier <eneiluj@posteo.net> | 2020-08-21 14:58:12 +0200 |
commit | 006157b12fe4ac38d79727d324c97175b78e3c55 (patch) | |
tree | 0acaf7110874290fd6c0dde847a1c52572a57b89 /apps/dashboard/lib | |
parent | 432c8a01487547eca7b2c42326bd25d6f2c18cdb (diff) | |
download | nextcloud-server-006157b12fe4ac38d79727d324c97175b78e3c55.tar.gz nextcloud-server-006157b12fe4ac38d79727d324c97175b78e3c55.zip |
now able to toggle statuses
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'apps/dashboard/lib')
-rw-r--r-- | apps/dashboard/lib/Controller/DashboardController.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index a272c9deb14..c9fd96fcb6f 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -103,7 +103,10 @@ class DashboardController extends Controller { 'url' => $widget->getUrl() ]; }, $this->dashboardManager->getWidgets()); + $configStatuses = $this->config->getUserValue($this->userId, 'dashboard', 'statuses', '{}'); + $statuses = json_decode($configStatuses, true); $this->inititalStateService->provideInitialState('dashboard', 'panels', $widgets); + $this->inititalStateService->provideInitialState('dashboard', 'statuses', $statuses); $this->inititalStateService->provideInitialState('dashboard', 'layout', $userLayout); $this->inititalStateService->provideInitialState('dashboard', 'firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1'); $this->inititalStateService->provideInitialState('dashboard', 'shippedBackgrounds', BackgroundService::SHIPPED_BACKGROUNDS); @@ -133,6 +136,16 @@ class DashboardController extends Controller { /** * @NoAdminRequired + * @param string $statuses + * @return JSONResponse + */ + public function updateStatuses(string $statuses): JSONResponse { + $this->config->setUserValue($this->userId, 'dashboard', 'statuses', $statuses); + return new JSONResponse(['statuses' => $statuses]); + } + + /** + * @NoAdminRequired */ public function setBackground(string $type = 'default', string $value = ''): JSONResponse { $currentVersion = (int)$this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', '0'); |