You are here

function file_entity_field_extra_fields in D7 Media 7

Implements hook_field_extra_fields().

Adds 'file' as an extra field, so that its display and form component can be weighted relative to the fields that are added to file entity bundles.

File

file_entity/file_entity.module, line 146
Extends Drupal file entities to be fieldable and viewable.

Code

function file_entity_field_extra_fields() {
  $return = array();
  $info = entity_get_info('file');
  foreach (array_keys($info['bundles']) as $bundle) {
    $return['file'][$bundle] = array(
      'form' => array(
        'file' => array(
          'label' => t('File'),
          'description' => t('File preview'),
          'weight' => 0,
        ),
      ),
      'display' => array(
        'file' => array(
          'label' => t('File'),
          'description' => t('File display'),
          'weight' => 0,
        ),
      ),
    );
  }
  return $return;
}