You are here

function hashtags_form_field_config_edit_form_submit in Hashtags 8

Form submission handler for hashtags_form_field_config_edit_form_alter.

Parameters

array $form: The form array.

FormStateInterface $form_state: The form state.

1 string reference to 'hashtags_form_field_config_edit_form_submit'
hashtags_form_field_config_edit_form_alter in ./hashtags.module
Implements hook_form_field_config_edit_form_alter().

File

./hashtags.module, line 104

Code

function hashtags_form_field_config_edit_form_submit(array $form, FormStateInterface $form_state) {
  $field = $form_state
    ->getFormObject()
    ->getEntity();
  $form_fields =& $form_state
    ->getValues();

  // If the private option is checked, update settings.
  if ($form_fields['hashtags_activate']) {
    $field
      ->setThirdPartySetting('hashtags', 'hashtags_activate', TRUE);
    $field
      ->save();
  }
  else {
    $field
      ->unsetThirdPartySetting('hashtags', 'hashtags_activate');
    $field
      ->save();
  }
}