You are here

function multifield_field_info in Multifield 7.2

Same name and namespace in other branches
  1. 7 multifield.field.inc \multifield_field_info()

Implements hook_field_info().

2 calls to multifield_field_info()
multifield_field_formatter_info in ./multifield.field.inc
Implements hook_field_formatter_view().
multifield_field_widget_info in ./multifield.field.inc
Implements hook_field_widget_info().

File

./multifield.field.inc, line 26
Field integration for the Multifield module.

Code

function multifield_field_info() {
  $info = array();
  $info['multifield'] = array(
    'label' => t('Multifield'),
    'default_widget' => 'multifield_default',
    'default_formatter' => 'multifield_default',
    'settings' => array(
      'hide_blank_items' => TRUE,
      'entity_translation_sync' => array(
        'id',
      ),
    ),
  );

  // Deprecated field types from the CTools exports.
  $multifields = multifield_load_all();
  foreach ($multifields as $machine_name => $multifield) {

    // Only show this multifield as an option to create if it has subfields.
    if (empty($multifield->locked) && multifield_type_has_subfields($machine_name)) {
      $info[$machine_name] = array(
        'label' => $multifield->label,
        'description' => $multifield->description,
        'default_widget' => 'multifield_default',
        'default_formatter' => 'multifield_default',
        'settings' => array(
          'hide_blank_items' => TRUE,
          'entity_translation_sync' => array(
            'id',
          ),
        ),
        'no_ui' => TRUE,
      );
    }
  }
  return $info;
}