diff --git a/modules/structural_pages_event/src/Plugin/ParentEntityHandler/EventHandler.php b/modules/structural_pages_event/src/Plugin/ParentEntityHandler/EventHandler.php new file mode 100644 index 0000000..a6ab7ee --- /dev/null +++ b/modules/structural_pages_event/src/Plugin/ParentEntityHandler/EventHandler.php @@ -0,0 +1,51 @@ +getParameter('event'); + + if (!$event instanceof EventInterface) { + return NULL; + } + + return $event; + } + + /** + * {@inheritdoc} + */ + public function handlesEntity(EntityInterface $entity): bool { + return $entity instanceof EventInterface; + } + +} diff --git a/modules/structural_pages_event/structural_pages_event.info.yml b/modules/structural_pages_event/structural_pages_event.info.yml new file mode 100644 index 0000000..0297353 --- /dev/null +++ b/modules/structural_pages_event/structural_pages_event.info.yml @@ -0,0 +1,8 @@ +name: 'Structural Pages Event Integration' +type: module +description: 'Provides Event entity support as parent type for Structural Pages module.' +package: 'Structural Pages' +core_version_requirement: ^10.3 || ^11 +dependencies: + - structural_pages:structural_pages + - event_management:event_management diff --git a/modules/structural_pages_event/translations/structural_pages_event.pt-br.po b/modules/structural_pages_event/translations/structural_pages_event.pt-br.po new file mode 100644 index 0000000..096f5cb --- /dev/null +++ b/modules/structural_pages_event/translations/structural_pages_event.pt-br.po @@ -0,0 +1,27 @@ +# Portuguese (Brazil) translation for Structural Pages Event Integration. +# Copyright (C) 2024 +# This file is distributed under the same license as the Drupal package. +# +msgid "" +msgstr "" +"Project-Id-Version: Structural Pages Event Integration 1.0.0\n" +"POT-Creation-Date: 2024-01-01 00:00+0000\n" +"PO-Revision-Date: 2024-01-01 00:00+0000\n" +"Language-Team: Portuguese, Brazil\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt-br\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: structural_pages_event.info.yml +msgid "Structural Pages Event Integration" +msgstr "Integração de Eventos das Páginas Estruturais" + +#: structural_pages_event.info.yml +msgid "Provides Event entity support as parent type for Structural Pages module." +msgstr "Fornece suporte a entidades Evento como tipo pai para o módulo Páginas Estruturais." + +#: src/Plugin/ParentEntityHandler/EventHandler.php +msgid "Events (event)" +msgstr "Eventos (event)" diff --git a/translations/structural_pages.pt-br.po b/translations/structural_pages.pt-br.po index 14f0c51..2169094 100644 --- a/translations/structural_pages.pt-br.po +++ b/translations/structural_pages.pt-br.po @@ -264,3 +264,15 @@ msgstr "Integração de Grupos das Páginas Estruturais" #: modules/structural_pages_group/structural_pages_group.info.yml msgid "Provides Group entity support as parent type for Structural Pages module." msgstr "Fornece suporte a entidades Grupo como tipo pai para o módulo Páginas Estruturais." + +#: modules/structural_pages_event/src/Plugin/ParentEntityHandler/EventHandler.php +msgid "Events (event)" +msgstr "Eventos (event)" + +#: modules/structural_pages_event/structural_pages_event.info.yml +msgid "Structural Pages Event Integration" +msgstr "Integração de Eventos das Páginas Estruturais" + +#: modules/structural_pages_event/structural_pages_event.info.yml +msgid "Provides Event entity support as parent type for Structural Pages module." +msgstr "Fornece suporte a entidades Evento como tipo pai para o módulo Páginas Estruturais."