You are here

public function TMGMTJobUIController::operationForm in Translation Management Tool 7

Builds the operation form.

For the export operation a serialized string of the entity is directly shown in the form (no submit function needed).

Overrides EntityDefaultUIController::operationForm

File

ui/includes/tmgmt_ui.controller.job.inc, line 67
Contains the job UI controller.

Class

TMGMTJobUIController
Entity UI controller for the Job Entity.

Code

public function operationForm($form, &$form_state, $entity, $op) {
  switch ($op) {
    case 'delete':
      $confirm_question = t('Are you sure you want to delete the translation job %label?', array(
        '%label' => $entity
          ->label(),
      ));
      return confirm_form($form, $confirm_question, $this->path);
    case 'abort':
      return confirm_form($form, t('Abort this job?'), 'admin/tmgmt/jobs/' . $entity->tjid, t('This will send a request to the translator to abort the job. After the action the job translation process will be aborted and only remaining action will be resubmitting it.'));
    case 'resubmit':
      return confirm_form($form, t('Resubmit as a new job?'), 'admin/tmgmt/jobs/' . $entity->tjid, t('This creates a new job with the same items which can then be submitted again. In case the sources meanwhile changed, the new job will reflect the update.'));
  }
  drupal_not_found();
  exit;
}