Skip navigation
Help

theme_uc_store_address_fields_form

6 uc_store.module theme_uc_store_address_fields_form($form)
7 uc_store.admin.inc theme_uc_store_address_fields_form($variables)

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()

Related topics

File

ubercart/uc_store/uc_store.admin.inc, line 186
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;
}