You are here

public function TMGMTFileTranslatorUIController::checkoutInfo in Translation Management Tool 7

Retrieves information about a translation job.

Services based translators with remote states should place a Poll button here to sync the job state.

Parameters

TMGMTJob $job: The translation job.

Overrides TMGMTDefaultTranslatorUIController::checkoutInfo

File

translators/file/tmgmt_file.ui.inc, line 90
Please supply a file description.

Class

TMGMTFileTranslatorUIController
File translator plugin controller.

Code

public function checkoutInfo(TMGMTJob $job) {

  // If the job is finished, it's not possible to import translations anymore.
  if ($job
    ->isFinished()) {
    return parent::checkoutInfo($job);
  }
  $form = array(
    '#type' => 'fieldset',
    '#title' => t('Import translated file'),
  );
  $supported_formats = array_keys(tmgmt_file_format_plugin_info());
  $form['file'] = array(
    '#type' => 'file',
    '#title' => t('File file'),
    '#size' => 50,
    '#description' => t('Supported formats: @formats.', array(
      '@formats' => implode(', ', $supported_formats),
    )),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Import'),
    '#submit' => array(
      'tmgmt_file_import_form_submit',
    ),
  );
  return $this
    ->checkoutInfoWrapper($job, $form);
}