You are here

function theme_feed_import_reorder_fields_form in Feed Import 7.3

Same name and namespace in other branches
  1. 7.2 feed_import.module \theme_feed_import_reorder_fields_form()

Theme form feed_import_edit_filter_form

File

./feed_import.module, line 1668
User interface, cron functions for feed_import module

Code

function theme_feed_import_reorder_fields_form($form) {
  $form = $form['form'];
  if (empty($form['#feed_fields'])) {
    $form['#feed_fields'] = array();
  }
  else {
    foreach ($form['#feed_fields'] as &$field) {
      $field = array(
        drupal_render($form['table_content'][$field]['field']),
        drupal_render($form['table_content'][$field]['weight']),
      );
      $field = array(
        'data' => $field,
        'class' => array(
          'draggable',
        ),
      );
    }
  }
  $form['table'] = array(
    '#theme' => 'table',
    '#header' => array(
      t('Field'),
      t('Weight'),
    ),
    '#rows' => $form['#feed_fields'],
    '#attributes' => array(
      'id' => 'table',
    ),
    '#empty' => t('There are no fields.'),
  );
  drupal_add_tabledrag('table', 'order', 'sibling', 'weight');
  return drupal_render_children($form);
}