From e63663255e926bbec1319165f8d4d15b09254a4b Mon Sep 17 00:00:00 2001 From: naomi Date: Thu, 12 May 2022 09:03:11 +0100 Subject: [PATCH] event menu items - removed "Event" and pluralised --- opencase.module | 1 + src/Plugin/Derivative/AddEventsMenuLink.php | 2 +- src/Plugin/Derivative/SeeAllEventsMenuLink.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/opencase.module b/opencase.module index 6160a6a..5fa0d87 100644 --- a/opencase.module +++ b/opencase.module @@ -14,6 +14,7 @@ function opencase_element_info_alter(array &$types) { $types['datetime']['#process'][] = 'opencase_process_element'; } + /** * Element process callback for datetime fields. Removes the seconds part. */ diff --git a/src/Plugin/Derivative/AddEventsMenuLink.php b/src/Plugin/Derivative/AddEventsMenuLink.php index 0c74353..0a205f1 100644 --- a/src/Plugin/Derivative/AddEventsMenuLink.php +++ b/src/Plugin/Derivative/AddEventsMenuLink.php @@ -45,7 +45,7 @@ class AddEventsMenuLink extends DeriverBase implements ContainerDeriverInterface $eventTypes = $this->entityTypeManager->getStorage('oc_event_type')->loadMultiple(); foreach ($eventTypes as $id => $eventType) { $links[$id] = [ - 'title' => $eventType->label() . " Event", + 'title' => $eventType->label(), 'route_name' => "entity.oc_event.add_form", 'route_parameters' => ['oc_event_type' => $eventType->id()] ] + $base_plugin_definition; diff --git a/src/Plugin/Derivative/SeeAllEventsMenuLink.php b/src/Plugin/Derivative/SeeAllEventsMenuLink.php index e6b3b2c..73795b3 100644 --- a/src/Plugin/Derivative/SeeAllEventsMenuLink.php +++ b/src/Plugin/Derivative/SeeAllEventsMenuLink.php @@ -50,7 +50,7 @@ class SeeAllEventsMenuLink extends DeriverBase implements ContainerDeriverInterf $eventTypes = $this->entityTypeManager->getStorage('oc_event_type')->loadMultiple(); foreach ($eventTypes as $id => $eventType) { $links[$id] = [ - 'title' => $eventType->label(), + 'title' => \Drupal\opencase\Pluraliser::pluralise($eventType->label()), 'route_name' => "view.events.page_1", 'route_parameters' => ['type' => $eventType->id()] ] + $base_plugin_definition;