function certificate_field_extra_fields in Certificate 8.3
Same name and namespace in other branches
- 7.3 certificate.module \certificate_field_extra_fields()
- 7.2 certificate.module \certificate_field_extra_fields()
- 4.x certificate.module \certificate_field_extra_fields()
- 3.x certificate.module \certificate_field_extra_fields()
Implements hook_field_extra_fields().
File
- ./
certificate.module, line 408 - 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,
);
}
}
}
}
foreach (entity_get_info() as $entity_type => $entity_info) {
if ($entity_type == 'certificate') {
foreach (array_keys($entity_info['bundles']) as $bundle) {
$extra[$entity_type][$bundle]['form']['title'] = array(
'label' => t('Certificate title'),
'description' => t('Certificate title'),
'weight' => 1,
);
$extra[$entity_type][$bundle]['form']['name'] = array(
'label' => t('Certificate machine name'),
'description' => t('Certificate machine name'),
'weight' => 2,
);
$extra[$entity_type][$bundle]['form']['orientation'] = array(
'label' => t('Certificate orientation'),
'description' => t('Certificate orientation'),
'weight' => 3,
);
$extra[$entity_type][$bundle]['form']['certificate_tokens'] = array(
'label' => t('Certificate tokens'),
'description' => t('Tokens to insert into the certificate'),
'weight' => 5,
);
}
}
}
return $extra;
}