You are here

function theme_uc_store_address_fields_form in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \theme_uc_store_address_fields_form()
  2. 6.2 uc_store/uc_store.module \theme_uc_store_address_fields_form()

Returns HTML for uc_store_address_fields_form().

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.

See also

uc_store_address_fields_form()

File

uc_store/uc_store.admin.inc, line 193
Store administration menu items.

Code

function theme_uc_store_address_fields_form($variables) {
  $form = $variables['form'];
  $header = array(
    t('Field'),
    t('Title'),
    t('Enabled'),
    t('Required'),
    t('List position'),
  );

  // Sort fields by weight
  uasort($form['fields'], 'element_sort');
  foreach (element_children($form['fields']) as $field) {
    $row = array(
      drupal_render($form['fields'][$field]['default']),
      drupal_render($form['fields'][$field]['uc_field_' . $field]),
      drupal_render($form['uc_address_fields'][$field]),
      drupal_render($form['uc_address_fields_required'][$field]),
      drupal_render($form['uc_address_fields_weight'][$field]),
    );
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  drupal_add_tabledrag('uc-store-address-fields-weight-table', 'order', 'sibling', 'uc-store-address-fields-weight');
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'uc-store-address-fields-weight-table',
    ),
  ));
  $output .= drupal_render_children($form);
  return $output;
}