You are here

function varnish_admin_settings_control_key_callback in Varnish 7

AJAX callback to set required property on varnish admin settings form.

1 string reference to 'varnish_admin_settings_control_key_callback'
varnish_admin_settings_form in ./varnish.admin.inc
Menu callback for varnish admin settings.

File

./varnish.admin.inc, line 141
Administrative functions for Varnish integration.

Code

function varnish_admin_settings_control_key_callback($form, $form_state) {
  if ($form_state['values']['varnish_version'] == '4') {
    $form['varnish_control_key']['#required'] = TRUE;
  }
  else {
    $form['varnish_control_key']['#required'] = FALSE;
  }
  return $form['varnish_control_key'];
}