You are here

function linkchecker_form_views_exposed_form_alter in Link checker 8

Implements hook_form_BASE_FORM_ID_alter().

File

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

Code

function linkchecker_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if ($form['#id'] != 'views-exposed-form-broken-links-report-page-1') {
    return;
  }
  if (!empty($form['result'])) {
    $form['result']['#states'] = [
      'enabled' => [
        ':input[name="code"]' => [
          'value' => '',
        ],
      ],
    ];
  }
  if (!empty($form['code'])) {
    $form['code']['#states'] = [
      'enabled' => [
        'select[name="result"]' => [
          'value' => 'All',
        ],
      ],
    ];
  }
}