You are here

function _diff_field_default_settings in Diff 7.3

Helper function to populate the settings array.

2 calls to _diff_field_default_settings()
diff_admin_global_field_settings in ./diff.admin.inc
Menu form callback for the field settings.
diff_get_field_settings in ./diff.diff.inc
Helper function to get the settings for a given field or formatter.

File

./diff.diff.inc, line 288
Includes the hooks defined by diff_hook_info().

Code

function _diff_field_default_settings($module, $field_type, $settings = array()) {

  // Load files containing the field callbacks.
  _diff_autoload($module);

  // Populate any missing values from CALLBACK_field_diff_default_options().
  $func = $module . '_field_diff_default_options';
  if (function_exists($func)) {
    $settings += $func($field_type);
  }

  // Check for Diff support. If it doesn't exist, the default markdown should
  // escape the field display, otherwise a raw format should be used.
  $func = $module . '_field_diff_view';

  // Global settings.
  $settings += array(
    'markdown' => function_exists($func) ? '' : 'drupal_html_to_text',
    'line_counter' => '',
    'show_header' => 1,
  );
  return $settings;
}