You are here

function field_group_formatter_settings_update in Field Group 7

Same name and namespace in other branches
  1. 8.3 includes/field_ui.inc \field_group_formatter_settings_update()
  2. 8 includes/field_ui.inc \field_group_formatter_settings_update()
  3. 7.2 field_group.field_ui.inc \field_group_formatter_settings_update()

Update handler for field_group configuration settings.

Parameters

Object $group The group object:

Array $settings Configuration settings:

2 calls to field_group_formatter_settings_update()
field_group_field_ui_overview_form_alter in ./field_group.field_ui.inc
Function to alter the fields overview and display overview screen.
field_group_formatter_row_update in ./field_group.field_ui.inc
Update the row so that the group variables are updated. The rendering of the elements needs the updated defaults.

File

./field_group.field_ui.inc, line 472
Field_group.field_ui.inc is a file that contains most functions needed on the Fields UI Manage forms (display and fields).

Code

function field_group_formatter_settings_update(&$group, $settings) {

  // for format changes we load the defaults.
  if (empty($settings['format_settings']['settings'])) {
    $mode = $group->mode == 'form' ? 'form' : 'display';
    $group->format_settings = _field_group_get_default_formatter_settings($group->format_type, $mode);
  }
  else {
    $group->format_type = $settings['format']['type'];
    $group->label = $settings['format_settings']['settings']['label'];
    $group->format_settings = $settings['format_settings']['settings'];
  }
}