You are here

function vd_custom_formatters_fields_alter in Custom Formatters 6

Implements hook_type_alter().

File

includes/vd.inc, line 10
Provides Custom Formatters integration with the Views displays module.

Code

function vd_custom_formatters_fields_alter(&$fields) {
  foreach (module_implements('ds_api') as $module) {
    $api_info = ds_api_info($module);
    $extra = array();
    foreach ($api_info['extra'] as $key) {
      $extra[$key] = 1;
    }
    foreach (ds_get_fields('vd', NULL, NULL, $extra) as $key => $field) {
      if ($field['type'] == DS_FIELD_TYPE_THEME || $field['type'] == DS_FIELD_TYPE_CODE) {
        $fields['vd_' . $key] = array(
          'label' => $field['title'],
          'module' => 'vd',
        );
      }
    }
  }
}