You are here

function languagefield_views_data_alter in Custom Language field 7

Implements hook_views_data_alter().

Parameters

$data:

File

./languagefield.views.inc, line 239
languagefield.views.inc

Code

function languagefield_views_data_alter(&$data) {
  $languagefields = array();
  foreach (field_info_fields() as $field_name => $field) {
    if ($field['module'] == 'languagefield') {
      $languagefields[$field_name] = $field;
    }
  }
  foreach ($data as $field_name => $field) {
    foreach (array_keys($languagefields) as $name) {

      // Check on field storage type prevents warnings on non-sql field storage.
      if (isset($field[$name]) && $languagefields[$name]['storage']['type'] == 'field_sql_storage') {
        $title = empty($data[$field_name][$name]['title']) ? '' : $data[$field_name][$name]['title'] . ' ';
        $data[$field_name][$name]['help'] = $title . t('If you need more fields add a language relationship.');
      }
    }
  }
}