diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-08-04 15:20:05 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-08-05 17:03:38 +0200 |
commit | 018be662f4df89345b528382ab300269d4a88048 (patch) | |
tree | 474a64e9a86f1070f7aeacf947334a1922655d58 /apps/dashboard/lib | |
parent | 6accf4d857b4233cff698e602041a5126a57e940 (diff) | |
download | nextcloud-server-018be662f4df89345b528382ab300269d4a88048.tar.gz nextcloud-server-018be662f4df89345b528382ab300269d4a88048.zip |
Refactor API to match the widget wording
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/dashboard/lib')
-rw-r--r-- | apps/dashboard/lib/Controller/DashboardController.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index 06ce063b0a5..07cfaf071e2 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -32,8 +32,8 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\Dashboard\IManager; -use OCP\Dashboard\IPanel; -use OCP\Dashboard\RegisterPanelEvent; +use OCP\Dashboard\IWidget; +use OCP\Dashboard\RegisterWidgetEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IInitialStateService; @@ -76,18 +76,18 @@ class DashboardController extends Controller { * @return TemplateResponse */ public function index(): TemplateResponse { - $this->eventDispatcher->dispatchTyped(new RegisterPanelEvent($this->dashboardManager)); + $this->eventDispatcher->dispatchTyped(new RegisterWidgetEvent($this->dashboardManager)); $userLayout = explode(',', $this->config->getUserValue($this->userId, 'dashboard', 'layout', 'recommendations,spreed,mail,calendar')); - $panels = array_map(function (IPanel $panel) { + $widgets = array_map(function (IWidget $widget) { return [ - 'id' => $panel->getId(), - 'title' => $panel->getTitle(), - 'iconClass' => $panel->getIconClass(), - 'url' => $panel->getUrl() + 'id' => $widget->getId(), + 'title' => $widget->getTitle(), + 'iconClass' => $widget->getIconClass(), + 'url' => $widget->getUrl() ]; - }, $this->dashboardManager->getPanels()); - $this->inititalStateService->provideInitialState('dashboard', 'panels', $panels); + }, $this->dashboardManager->getWidgets()); + $this->inititalStateService->provideInitialState('dashboard', 'panels', $widgets); $this->inititalStateService->provideInitialState('dashboard', 'layout', $userLayout); $this->inititalStateService->provideInitialState('dashboard', 'firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1'); $this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0'); |