diff --git a/entity_info_table.links.menu.yml b/entity_info_table.links.menu.yml index 172324e322f77b9f86e1abc2c663804102442457..5b068b00bd6839d2a4b9e2bf8a6f282911a0ff69 100644 --- a/entity_info_table.links.menu.yml +++ b/entity_info_table.links.menu.yml @@ -1,6 +1,6 @@ -entity_info_table.manage: +entity_info_table.admin: title: 'Entity Info Table' - parent: system.admin_config_system + parent: system.admin_reports description: 'Administrative interface for the Entity info table module' weight: -10 - route_name: entity_info_table.manage + route_name: entity_info_table.admin diff --git a/src/Controller/EntityInfoTableController.php b/src/Controller/EntityInfoTableController.php index 40290b0b85d37835caa01396193a3ddae0f04890..2d97882685addbcedadce12ada2d27c4f9c98ca9 100644 --- a/src/Controller/EntityInfoTableController.php +++ b/src/Controller/EntityInfoTableController.php @@ -1,14 +1,14 @@ <?php + namespace Drupal\entity_info_table\Controller; -use Drupal\Component\Serialization\Json; + use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Url; -use Drupal\devel\DevelDumperManagerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Drupal\Core\Entity\FieldableEntityInterface; -use Drupal\webform\Entity\Webform; -use Drupal\webform\WebformHelpManager; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * + */ class EntityInfoTableController extends ControllerBase { /** @@ -16,14 +16,17 @@ class EntityInfoTableController extends ControllerBase { */ public static function create(ContainerInterface $container) { return new static( - $container->get('devel.dumper') - ); + $container->get('devel.dumper') + ); } + /** + * + */ public function render() { $headers = [ - $this->t('ID'), - $this->t('Name'), + $this->t('Entity Type ID'), + $this->t('Entity Type Name'), $this->t('bundle'), $this->t('bundle label'), $this->t('Field name'), @@ -36,13 +39,12 @@ class EntityInfoTableController extends ControllerBase { foreach ($this->entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) { // Fail with an exception for non-fieldable entity types. $bundle_list = \Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type_id); - + + // webform & webform_submission are different entity type :) if ($entity_type_id == 'webform') { -// $query = \Drupal::service('entity.query')->get('webform'); -// dpm($query); + continue; } if (!$entity_type->entityClassImplements(FieldableEntityInterface::class)) { - // dpm("Getting the base fields is not supported for entity type {$entity_type->getLabel()}."); continue; } foreach ($bundle_list as $bundle_key => $bundle_info) { @@ -64,7 +66,7 @@ class EntityInfoTableController extends ControllerBase { ]; $row['bundle_label'] = [ 'data' => $bundle_info['label'], - 'filter' => false, + 'filter' => FALSE, ]; $row['field_name'] = [ 'data' => $field_definition->getLabel(), @@ -75,7 +77,6 @@ class EntityInfoTableController extends ControllerBase { 'filter' => TRUE, ]; $field_description = $field_definition->getFieldStorageDefinition()->getDescription() ? $field_definition->getFieldStorageDefinition()->getDescription() : NULL; -// dpm($field_description); $row['field_description'] = [ 'data' => $field_description, 'filter' => TRUE, @@ -103,4 +104,5 @@ class EntityInfoTableController extends ControllerBase { return $output; } -} \ No newline at end of file + +}