You are here

function services_client_error_form_services_client_settings_alter in Services Client 7.2

Same name and namespace in other branches
  1. 7 services_client_error/services_client_error.module \services_client_error_form_services_client_settings_alter()

Implements hook_form_FORM_ID_alter().

File

services_client_error/services_client_error.module, line 61
Services Client error handling, re-try and reporting.

Code

function services_client_error_form_services_client_settings_alter(&$form, $form_state) {
  $form['error_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Error handling'),
    '#collapsed' => TRUE,
    '#collapsible' => TRUE,
    '#tree' => FALSE,
    '#group' => 'additional_settings',
    '#weight' => 0,
  );
  $form['error_settings']['services_client_error_retries'] = array(
    '#type' => 'textfield',
    '#title' => t('Retries'),
    '#default_value' => variable_get('services_client_error_retries', 3),
    '#description' => t('How many reties before error will be marked as failed'),
  );
  $form['error_settings']['services_client_error_remove_period'] = array(
    '#type' => 'textfield',
    '#title' => t('Remove old errors'),
    '#default_value' => variable_get('services_client_error_remove_period', 7),
    '#description' => t('Remove old errors after specified time of days'),
  );
  $form['error_settings']['services_client_error_notify'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send notification on errors'),
    '#default_value' => variable_get('services_client_error_notify', FALSE),
    '#description' => t('Send email notifications on services client errors'),
  );
  $form['error_settings']['services_client_error_notify_recipients'] = array(
    '#type' => 'textarea',
    '#title' => t('Notification recipients'),
    '#default_value' => variable_get('services_client_error_notify_recipients', ''),
    '#description' => t('Enter one email address per row'),
    '#states' => array(
      'visible' => array(
        ':input[name="services_client_error_notify"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
}