You are here

function _sharerich_display_overview_form_submit in Sharerich 7.2

Same name and namespace in other branches
  1. 7.3 sharerich.module \_sharerich_display_overview_form_submit()

Sharerich field_ui_display_overview_form submit handler.

1 string reference to '_sharerich_display_overview_form_submit'
sharerich_form_field_ui_display_overview_form_alter in ./sharerich.module
Implements hook_form_FORM_ID_alter().

File

./sharerich.module, line 751

Code

function _sharerich_display_overview_form_submit($form, &$form_state) {

  // Get current bundle settings.
  $bundle_settings = field_bundle_settings($form['#entity_type'], $form['#bundle']);
  foreach (_sharerich_get_field_names($form['fields']) as $field_name) {
    $bundle_settings['extra_fields']['display'][$field_name][$form['#view_mode']] = array(
      'settings' => $form_state['formatter_settings'][$field_name],
      'weight' => $form_state['values']['fields'][$field_name]['weight'],
      'visible' => $form_state['values']['fields'][$field_name]['type'] == 'visible',
    );
  }

  // Save updated bundle settings.
  field_bundle_settings($form['#entity_type'], $form['#bundle'], $bundle_settings);
}