You are here

public function TMGMTLocalTranslatorUIController::checkoutSettingsForm in Translation Management Tool 7

Form callback for the checkout settings form.

Overrides TMGMTDefaultTranslatorUIController::checkoutSettingsForm

File

translators/tmgmt_local/includes/tmgmt_local.plugin.ui.inc, line 16
Provides the user translator UI plugin controller.

Class

TMGMTLocalTranslatorUIController
Local translator plugin UI controller.

Code

public function checkoutSettingsForm($form, &$form_state, TMGMTJob $job) {
  if ($translators = tmgmt_local_translators($job->source_language, array(
    $job->target_language,
  ))) {
    $form['translator'] = array(
      '#title' => t('Select translator for this job'),
      '#type' => 'select',
      '#options' => array(
        '' => t('Select user'),
      ) + $translators,
      '#default_value' => $job
        ->getSetting('translator'),
    );
  }
  else {
    $form['message'] = array(
      '#markup' => t('There are no translators available.'),
    );
  }
  return $form;
}