function tmgmt_local_form_tmgmt_settings_form_alter

Implements hook_form_FORM_ID_alter().

File

translators/tmgmt_local/tmgmt_local.module, line 139
Main module file for the local translation module.

Code

function tmgmt_local_form_tmgmt_settings_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  $config = \Drupal::configFactory()
    ->getEditable('tmgmt_local.settings');
  $form['local'] = array(
    '#type' => 'details',
    '#title' => t('Local translator'),
    '#open' => TRUE,
  );
  $form['local']['use_admin_theme'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use admin theme in local translator'),
    '#description' => t("Enabling this will apply the admin theme over the local translator views. This means that the users will need he the 'view the administration theme' and 'access toolbar' permissions to use the local translator."),
    '#default_value' => $config
      ->get('use_admin_theme'),
  );
  $form['local']['allow_all'] = array(
    '#title' => t('Allow translations for enabled languages even if no user has the necessary abilities'),
    '#type' => 'checkbox',
    '#default_value' => $config
      ->get('allow_all'),
  );
  $form['#submit'][] = 'tmgmt_local_form_tmgmt_settings_form_submit';
}