You are here

function theme_uc_pane_sort_table in Ubercart 7.3

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

Themes a pane sorting form into a table.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.
2 theme calls to theme_uc_pane_sort_table()
uc_cart_cart_settings_form in uc_cart/uc_cart.admin.inc
General settings for the shopping cart.
uc_cart_checkout_settings_form in uc_cart/uc_cart.admin.inc
General checkout settings.

File

uc_store/uc_store.theme.inc, line 88
Theme functions for the uc_store module.

Code

function theme_uc_pane_sort_table($variables) {
  $form = $variables['form'];
  $prefix = $form['#pane_prefix'];
  $attributes = array();
  if (isset($form['#draggable'])) {
    $attributes['id'] = $form['#draggable'] . '-table';
    drupal_add_tabledrag($form['#draggable'] . '-table', 'order', 'sibling', $form['#draggable']);
  }
  $header = array(
    t('Pane'),
    t('List position'),
  );
  foreach (element_children($form) as $pane_id) {
    $rows[] = array(
      'data' => array(
        drupal_render($form[$pane_id][$prefix . '_' . $pane_id . '_enabled']),
        drupal_render($form[$pane_id][$prefix . '_' . $pane_id . '_weight']),
      ),
      'class' => array(
        'draggable',
      ),
    );
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => $attributes,
  )) . '<br />';
}