widgetGroupRegistry->getWidgetGroups() as $widgetGroup) { $widgets = []; $widgetGroupIdentifier = $widgetGroup->getIdentifier(); $widgetsForGroup = $this->widgetRegistry->getAvailableWidgetsForWidgetGroup($widgetGroupIdentifier); foreach ($widgetsForGroup as $widgetConfiguration) { $widgetIdentifier = $widgetConfiguration->getIdentifier(); $widgets[] = [ 'identifier' => $widgetIdentifier, 'icon' => $widgetConfiguration->getIconIdentifier(), 'label' => $this->getLanguageService()->sL($widgetConfiguration->getTitle()), 'description' => $this->getLanguageService()->sL($widgetConfiguration->getDescription()), 'requestType' => 'event', 'event' => 'typo3:dashboard:widget:add', ]; } if ($widgets === []) { continue; } $groupConfigurations[$widgetGroupIdentifier] = [ 'identifier' => $widgetGroupIdentifier, 'label' => $widgetGroup->getTitle(), 'items' => $widgets, ]; } return $groupConfigurations; } protected function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } }