You are here

public function TMGMTJobItemUIController::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_item.inc, line 69
Contains the job item UI controller.

Class

TMGMTJobItemUIController
Entity UI controller for the Job Entity.

Code

public function operationForm($form, &$form_state, $entity, $op) {
  $controller = $entity
    ->getSourceController();
  $info = $controller
    ->pluginInfo();
  switch ($op) {
    case 'delete':
      $confirm_question = t('Are you sure you want to delete the %plugin translation job item for %label?', array(
        '%plugin' => $info['label'],
        '%label' => $entity
          ->label(),
      ));
      return confirm_form($form, $confirm_question, $this->path);
    case 'accept':
      $confirm_question = t('Are you sure you want to accept the %plugin translation job item for %label?', array(
        '%plugin' => $info['label'],
        '%label' => $entity
          ->label(),
      ));
      return confirm_form($form, $confirm_question, $this->path);
  }
  drupal_not_found();
  exit;
}