You are here

function tmgmt_ui_checkout_settings_form in Translation Management Tool 7

Helper function for retrieving the job settings form.

@todo Make use of the response object here.

1 call to tmgmt_ui_checkout_settings_form()
tmgmt_job_form in ui/includes/tmgmt_ui.pages.inc
Entity API form the job entity.

File

ui/includes/tmgmt_ui.pages.inc, line 773
Provides page callbacks and form functions for the Translation Management Tool User Interface module.

Code

function tmgmt_ui_checkout_settings_form(&$form_state, TMGMTJob $job) {
  $form = array();
  $translator = $job
    ->getTranslator();
  if (!$translator) {
    return $form;
  }
  if (!$translator
    ->isAvailable()) {
    $form['#description'] = filter_xss($job
      ->getTranslator()
      ->getNotAvailableReason());
  }
  elseif ($job->target_language && !$translator
    ->canTranslate($job)) {
    $form['#description'] = filter_xss($job
      ->getTranslator()
      ->getNotCanTranslateReason($job));
  }
  else {
    $controller = tmgmt_translator_ui_controller($translator->plugin);
    $form = $controller
      ->checkoutSettingsForm($form, $form_state, $job);
  }
  return $form;
}