You are here

function linkchecker_form_field_config_form_builder in Link checker 8

1 string reference to 'linkchecker_form_field_config_form_builder'
linkchecker_form_field_config_form_alter in ./linkchecker.module
Implements hook_form_BASE_FORM_ID_alter().

File

./linkchecker.module, line 126
This module periodically check links in given node types, blocks etc.

Code

function linkchecker_form_field_config_form_builder($entity_type, FieldConfigInterface $field_config, &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue([
    'third_party_settings',
    'linkchecker',
    'scan',
  ]) === 1) {
    $field_config
      ->setThirdPartySetting('linkchecker', 'scan', TRUE);
    $field_config
      ->setThirdPartySetting('linkchecker', 'extractor', $form_state
      ->getValue([
      'third_party_settings',
      'linkchecker',
      'extractor',
    ]));
    return;
  }
  $field_config
    ->unsetThirdPartySetting('linkchecker', 'scan');
  $field_config
    ->unsetThirdPartySetting('linkchecker', 'extractor');
}