You are here

function diff_admin_global_field_settings in Diff 7.3

Menu form callback for the field settings.

1 string reference to 'diff_admin_global_field_settings'
diff_menu in ./diff.module
Implements hook_menu().

File

./diff.admin.inc, line 157
Administration page callbacks and forms.

Code

function diff_admin_global_field_settings($form, $form_state, $type) {
  module_load_include('diff.inc', 'diff');
  $field_types = field_info_field_types();
  if (!isset($field_types[$type])) {
    drupal_set_message(t('Invalid field type.'), 'error');
    drupal_goto('admin/config/content/diff/fields');
  }
  $field_type = $field_types[$type];

  // Set the title to give more context to this page.
  drupal_set_title(t('Global settings for %label fields', array(
    '%label' => $field_type['label'],
  )), PASS_THROUGH);
  $variable_name = "diff_{$field_type['module']}_field_{$type}_default_options";
  $settings = variable_get($variable_name, array());
  $settings = _diff_field_default_settings($field_type['module'], $type, $settings);
  $func = $field_type['module'] . '_field_diff_options_form';
  if (function_exists($func) && ($options_form = $func($type, $settings))) {
    $form[$variable_name] = $options_form;
  }
  $form[$variable_name]['#tree'] = TRUE;
  diff_global_settings_form($form[$variable_name], $form_state, $type, $settings);
  return system_settings_form($form);
}