diff --git a/eck.module b/eck.module index 54fb49608858a942285588b1c727da29a736f263..6d93f12381f959b3f9d02f65c0c59035889ba58a 100644 --- a/eck.module +++ b/eck.module @@ -237,6 +237,35 @@ function eck_menu_local_actions_alter(&$local_actions) { } } +/** + * Implements hook_contextual_links_plugins_alter(). + */ +function eck_contextual_links_plugins_alter(array &$contextual_links): void { + $eck_types = EckEntityType::loadMultiple(); + foreach ($eck_types as $type) { + $contextual_links['entity.' . $type->id() . '.edit_form'] = [ + 'route_name' => 'entity.' . $type->id() . '.edit_form', + 'group' => $type->id(), + 'title' => t('Edit'), + 'options' => [], + 'weight' => NULL, + 'class' => 'Drupal\Core\Menu\ContextualLinkDefault', + 'id' => 'entity.' . $type->id() . '.edit_form', + 'provider' => 'eck', + ]; + $contextual_links['entity.' . $type->id() . '.delete_form'] = [ + 'route_name' => 'entity.' . $type->id() . '.delete_form', + 'group' => $type->id(), + 'title' => t('Delete'), + 'options' => [], + 'weight' => NULL, + 'class' => 'Drupal\Core\Menu\ContextualLinkDefault', + 'id' => 'entity.' . $type->id() . '.delete_form', + 'provider' => 'eck', + ]; + } +} + /** * Implements hook_theme(). */