Drupal investigation

migrate_tools.module 1.8KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @file
  4. * Provides tools for implementing and managing migrations.
  5. */
  6. /**
  7. * Implements hook_entity_type_alter().
  8. */
  9. function migrate_tools_entity_type_alter(array &$entity_types) {
  10. // Inject our UI into the general migration and migration group config entities.
  11. /** @var \Drupal\Core\Config\Entity\ConfigEntityType[] $entity_types */
  12. $entity_types['migration']
  13. ->set('admin_permission', 'administer migrations')
  14. ->setHandlerClass('list_builder', 'Drupal\migrate_tools\Controller\MigrationListBuilder')
  15. // ->setFormClass('add', 'Drupal\migrate_tools\Form\MigrationAddForm')
  16. ->setFormClass('edit', 'Drupal\migrate_tools\Form\MigrationEditForm')
  17. ->setFormClass('delete', 'Drupal\migrate_tools\Form\MigrationDeleteForm')
  18. // ->setLinkTemplate('edit-form', '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}')
  19. ->setLinkTemplate('list-form', '/admin/structure/migrate/manage/{migration_group}/migrations')
  20. /* ->setLinkTemplate('delete-form', '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/delete')*/;
  21. $entity_types['migration_group']
  22. ->set('admin_permission', 'administer migrations')
  23. ->setHandlerClass('list_builder', 'Drupal\migrate_tools\Controller\MigrationGroupListBuilder')
  24. ->setFormClass('add', 'Drupal\migrate_tools\Form\MigrationGroupAddForm')
  25. ->setFormClass('edit', 'Drupal\migrate_tools\Form\MigrationGroupEditForm')
  26. ->setFormClass('delete', 'Drupal\migrate_tools\Form\MigrationGroupDeleteForm')
  27. ->setLinkTemplate('edit-form', '/admin/structure/migrate/manage/{migration_group}')
  28. /* ->setLinkTemplate('list-form', '/admin/structure/migrate/manage/{migration_group}/migrations')*/
  29. ->setLinkTemplate('delete-form', '/admin/structure/migrate/manage/{migration_group}/delete');
  30. }