You are here

function tmgmt_ui_translation_review_form_reject_confirm in Translation Management Tool 7

Form callback for the reject confirm form.

1 string reference to 'tmgmt_ui_translation_review_form_reject_confirm'
TMGMTJobItemUIController::hook_menu in ui/includes/tmgmt_ui.controller.job_item.inc
Provides definitions for implementing hook_menu().

File

ui/tmgmt_ui.module, line 1023
Common Translation managment UI.

Code

function tmgmt_ui_translation_review_form_reject_confirm($form, &$form_state, TMGMTJobItem $job_item, $key) {

  // Path of job item review form.
  $path = explode('/', current_path());
  $path = implode('/', array_slice($path, 0, count($path) - 2));
  $args = array(
    '@data_item' => $job_item
      ->getData(tmgmt_ensure_keys_array($key), '#label'),
    '@job_item' => $job_item
      ->label(),
  );
  $form = confirm_form($form, t('Confirm rejection of @data_item in @job_item', $args), $path, '');
  $form_state['item'] = $job_item;
  $form['key'] = array(
    '#type' => 'value',
    '#value' => $key,
  );
  $form['actions']['submit']['#name'] = 'reject-' . $key;
  $form['actions']['submit']['#submit'] = array(
    'tmgmt_ui_translation_review_form_update_state',
    'tmgmt_ui_translation_review_form_submit',
  );
  $form = $job_item
    ->getTranslatorController()
    ->rejectForm($form, $form_state);
  return $form;
}