public function TestTranslatorUi::checkoutSettingsForm

Form callback for the checkout settings form.

Overrides TranslatorPluginUiBase::checkoutSettingsForm

File

tmgmt_test/src/TestTranslatorUi.php, line 49

Class

TestTranslatorUi
Test translator UI controller.

Namespace

Drupal\tmgmt_test

Code

public function checkoutSettingsForm(array $form, FormStateInterface $form_state, JobInterface $job) {
  if ($job
    ->getTranslator()
    ->getSetting('expose_settings')) {
    $form['action'] = array(
      '#type' => 'select',
      '#title' => t('Action'),
      '#options' => array(
        'translate' => t('Translate'),
        'submit' => t('Submit'),
        'reject' => t('Reject'),
        'fail' => t('Fail'),
        'not_available' => t('Not available'),
        'not_translatable' => t('Not translatable'),
      ),
      '#default_value' => $job
        ->getTranslator()
        ->getSetting('action'),
    );
  }
  return $form;
}