You are here

function acquia_contenthub_publisher_form_acquia_contenthub_admin_settings_alter in Acquia Content Hub 8.2

Implements hook_form_FORM_ID_alter().

File

modules/acquia_contenthub_publisher/acquia_contenthub_publisher.module, line 125
Drupal Module: Acquia Content Hub - Publisher.

Code

function acquia_contenthub_publisher_form_acquia_contenthub_admin_settings_alter(array &$form, FormStateInterface $form_state) {
  $config = \Drupal::config('acquia_contenthub_publisher.settings');
  $form['publisher_settings'] = [
    '#type' => 'details',
    '#title' => t('Publisher settings'),
    '#open' => FALSE,
  ];
  $form['publisher_settings']['threshold_stale_entities'] = [
    '#type' => 'select',
    '#title' => t('Period threshold for stale items'),
    '#description' => t('A "stale item" is an exported entity that is not confirmed by the service at least for the specified period of time.'),
    '#options' => _acquia_contenthub_publisher_get_threshold_stale_items_options(),
    '#default_value' => $config
      ->get('threshold_stale_entities'),
  ];
  $form['publisher_settings']['submit'] = [
    '#type' => 'submit',
    '#value' => t('Save'),
    '#name' => 'save_publisher_settings',
    '#submit' => [
      '_acquia_contenthub_publisher_save_publisher_settings_submit',
    ],
  ];
}