You are here

function tmgmt_ui_source_overview_form_defaults in Translation Management Tool 7

Form callback for the source overview form.

1 string reference to 'tmgmt_ui_source_overview_form_defaults'
TMGMTDefaultSourceUIController::hook_forms in plugin/tmgmt.ui.source.inc

File

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

Code

function tmgmt_ui_source_overview_form_defaults($form, &$form_state, $plugin, $item_type = NULL) {
  $controller = tmgmt_source_plugin_controller($plugin);
  $info = tmgmt_source_plugin_info($plugin);

  // Set a generic title that includes the source plugin and item type label.
  drupal_set_title(t('@type overview (@plugin)', array(
    '@type' => $controller
      ->getItemTypeLabel($item_type),
    '@plugin' => $info['label'],
  )), PASS_THROUGH);
  $form['actions'] = array(
    '#type' => 'fieldset',
    '#title' => t('Operations'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#weight' => -10,
    '#attributes' => array(
      'class' => array(
        'tmgmt-source-operations-wrapper',
      ),
    ),
  );
  tmgmt_ui_add_cart_form($form['actions'], $form_state, $plugin, $item_type);
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Request translation'),
  );
  return $form;
}