You are here

function rules_action_watchdog_form in Rules 6

Action "Watchdog" configuration form

Related topics

File

rules/modules/system.rules_forms.inc, line 166
Rules configuration forms for the system module

Code

function rules_action_watchdog_form($settings = array(), &$form) {
  $form['settings']['severity'] = array(
    '#type' => 'select',
    '#title' => t('Severity'),
    '#options' => watchdog_severity_levels(),
    '#default_value' => isset($settings['severity']) ? $settings['severity'] : WATCHDOG_NOTICE,
    '#required' => TRUE,
  );
  $form['settings']['type'] = array(
    '#type' => 'textfield',
    '#title' => t('Category'),
    '#default_value' => isset($settings['type']) ? $settings['type'] : 'rules',
    '#description' => t('The category to which this message belongs.'),
    '#required' => TRUE,
  );
  $form['settings']['message'] = array(
    '#type' => 'textfield',
    '#title' => t('Message'),
    '#default_value' => isset($settings['message']) ? $settings['message'] : '',
    '#description' => t('The message to log.'),
    '#required' => TRUE,
  );
  $form['settings']['link'] = array(
    '#type' => 'textfield',
    '#title' => t('Link (optional)'),
    '#default_value' => isset($settings['link']) ? $settings['link'] : '',
    '#description' => t('A link to associate with the message.'),
  );
}