You are here

function tmgmt_ui_source_overview_form_validate in Translation Management Tool 7

Validation callback for the source overview form.

File

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

Code

function tmgmt_ui_source_overview_form_validate($form, &$form_state) {

  // Copy the form state so we are not removing important information from it
  // when sending it through form_state_values_clean().
  $cleaned = $form_state;
  form_state_values_clean($cleaned);
  if (empty($cleaned['values'])) {
    form_set_error('items', t("You didn't select any source objects"));
  }
  list($plugin, $item_type) = $form_state['build_info']['args'];

  // Execute the validation method on the source plugin controller.
  $controller = tmgmt_source_ui_controller($plugin);
  $controller
    ->overviewFormValidate($form, $form_state, $item_type);
}