You are here

function empty_fields_field_formatter_info_alter in Empty fields 7.2

Same name and namespace in other branches
  1. 7 empty_fields.module \empty_fields_field_formatter_info_alter()

Implements hook_field_formatter_info_alter().

File

./empty_fields.module, line 10
Contains the implementation for the empty_fields module.

Code

function empty_fields_field_formatter_info_alter(&$info) {
  foreach ($info as $formatter_key => &$formatter) {
    $formatter['settings']['empty_fields_handler'] = '';
    $formatter['settings']['empty_fields_empty_class'] = '';
    foreach (empty_fields_plugins() as $class_name => $title) {
      if (class_exists($class_name)) {
        $plugin = new $class_name();
        foreach ($plugin
          ->defaults() as $field_id => $default) {
          $field_name = empty_fields_generate_field_name($field_id, $class_name);
          $formatter['settings'][$field_name] = $default;
        }
      }
    }
  }
}