You are here

function certificate_field_extra_fields in Certificate 3.x

Same name and namespace in other branches
  1. 8.3 certificate.module \certificate_field_extra_fields()
  2. 7.3 certificate.module \certificate_field_extra_fields()
  3. 7.2 certificate.module \certificate_field_extra_fields()
  4. 4.x certificate.module \certificate_field_extra_fields()

Implements hook_field_extra_fields().

File

./certificate.module, line 424
Certificate module.

Code

function certificate_field_extra_fields() {
  $extra = array();
  foreach (entity_get_info() as $entity_type => $entity_info) {
    if ($entity_type == 'node') {
      foreach (array_keys($entity_info['bundles']) as $bundle) {
        if (variable_get('certificate_certifiable_' . $bundle)) {
          $extra[$entity_type][$bundle]['form']['certificate'] = array(
            'label' => t('Certificate'),
            'description' => t('Certificate module elements'),
            'weight' => 0,
          );
        }
      }
    }
  }
  $extra['node']['certificate']['form']['certificate'] = array(
    'label' => t('Certificate tokens'),
    'description' => t('Tokens to insert into the certificate'),
    'weight' => 0,
  );
  return $extra;
}