You are here

function template_preprocess_eck_content_add_list in Entity Construction Kit (ECK) 8

Preprocess the entity bundles for listing.

File

./eck.pages.inc, line 14
Contains theme implementations.

Code

function template_preprocess_eck_content_add_list(&$variables) {
  $variables['types'] = [];
  if (!empty($variables['content'])) {
    foreach ($variables['content'] as $type) {
      $variables['types'][$type->type] = [
        'type' => $type->name,
        'add_link' => new Url('eck.entity.add', [
          'eck_entity_type' => $type
            ->getEntityType()
            ->getBundleOf(),
          'eck_entity_bundle' => $type->type,
        ]),
        'description' => Xss::filterAdmin($type->description),
      ];
    }
  }
}