You are here

function bibcite_entity_entity_extra_field_info in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/bibcite_entity.module \bibcite_entity_entity_extra_field_info()

Implements hook_entity_extra_field_info().

File

modules/bibcite_entity/bibcite_entity.module, line 309
Module hooks.

Code

function bibcite_entity_entity_extra_field_info() {
  $extra = [];
  $storage = \Drupal::entityTypeManager()
    ->getStorage('bibcite_reference_type');
  foreach ($storage
    ->loadMultiple() as $bundle) {
    $extra['bibcite_reference'][$bundle
      ->id()]['display']['citation'] = [
      'label' => t('Citation'),
      'description' => t('Reference rendered as citation'),
      'weight' => 100,
    ];
    $extra['bibcite_reference'][$bundle
      ->id()]['display']['bibcite_links'] = [
      'label' => t('Links'),
      'description' => t('Render all available reference links'),
      'weight' => 100,
    ];
    $extra['bibcite_reference'][$bundle
      ->id()]['display']['bibcite_type'] = [
      'label' => t('Reference type'),
      'description' => t('Reference type, for example Journal Article'),
      'weight' => 100,
    ];
  }
  return $extra;
}