function fastly_webhook_form in Fastly 7.2
Webhook form
Parameters
$form_state:
Return value
mixed
1 string reference to 'fastly_webhook_form'
- fastly_menu in ./
fastly.module - Implements hook_menu().
File
- ./
fastly.admin.inc, line 107 - Administrative forms for Fastly module.
Code
function fastly_webhook_form($form_state) {
$form['fastly_webhook_enabled'] = array(
'#type' => 'radios',
'#title' => t('Webhook enabled?'),
'#options' => array(
'yes' => 'Yes',
'no' => 'No',
),
'#default_value' => variable_get('fastly_webhook_enabled', 'no'),
);
$defaultWebhookUrlValue = variable_get('fastly_webhook_url', '');
$form['fastly_webhook_url'] = array(
'#type' => 'textfield',
'#title' => t('Incoming WebHook URL'),
'#description' => t('Incoming WebHook URL'),
'#states' => array(
'visible' => array(
':input[name="fastly_webhook_enabled"]' => array(
'value' => 'yes',
),
),
),
'#required' => TRUE,
'#default_value' => $defaultWebhookUrlValue,
);
$defaultFastlyWebhookEvents = variable_get('fastly_webhook_events', array());
$form['fastly_webhook_events'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#title' => t('Send webhook notifications for'),
'#required' => FALSE,
'#options' => array(
"purge_actions" => "Purge actions",
"vcl_upload_actions" => "VLC upload actions",
),
'#size' => 5,
'#weight' => 0,
'#states' => array(
'visible' => array(
':input[name="fastly_webhook_enabled"]' => array(
'value' => 'yes',
),
),
),
'#default_value' => $defaultFastlyWebhookEvents,
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save webhook configuration'),
);
return $form;
}