You are here

function theme_migrate_ui_field_mapping_form in Migrate 7.2

Theme function to layout field mappings in a table.

Parameters

array $variables:

Return value

string Rendered markup.

1 theme call to theme_migrate_ui_field_mapping_form()
migrate_ui_edit_mappings in migrate_ui/migrate_ui.pages.inc
Page callback to edit field mappings for a given migration.

File

migrate_ui/migrate_ui.pages.inc, line 1565
Pages for managing migration processes.

Code

function theme_migrate_ui_field_mapping_form($variables) {
  $output = '';
  $form = $variables['field_mappings'];
  $elements = element_children($form);
  if (!empty($elements)) {
    $header = array(
      t('DNM'),
      t('Destination field'),
      t('Source field'),
      t('Default value'),
      t('Source migration'),
    );
    if (!empty($form['#is_xml_migration'])) {
      $header[] = t('Xpath');
    }
    $rows = array();
    foreach ($elements as $mapping_key) {
      $row = array();
      $title = $form[$mapping_key]['mapping']['#title'];
      unset($form[$mapping_key]['mapping']['#title']);
      $row[] = drupal_render($form[$mapping_key]['issue_group']);
      $row[] = $title;
      $row[] = drupal_render($form[$mapping_key]['mapping']);
      $row[] = drupal_render($form[$mapping_key]['default_value']);
      $row[] = drupal_render($form[$mapping_key]['source_migration']);
      if (!empty($form['#is_xml_migration'])) {
        $row[] = drupal_render($form[$mapping_key]['xpath']);
      }
      $rows[] = $row;
    }
    $output .= theme('table', array(
      'header' => $header,
      'rows' => $rows,
    ));
  }
  $output .= drupal_render_children($form);
  return $output;
}