You are here

function theme_uc_pane_sort_table in Ubercart 5

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

Theme a pane sorting form into a table!

3 theme calls to theme_uc_pane_sort_table()
uc_cart_cart_panes_form in uc_cart/uc_cart.module
uc_cart_checkout_panes_form in uc_cart/uc_cart.module
uc_order_panes_form in uc_order/uc_order.module

File

uc_store/uc_store.module, line 2549
Contains global Ubercart functions and store administration functionality.

Code

function theme_uc_pane_sort_table($form) {
  $prefix = $form['#pane_prefix'];
  if (isset($form['#table_attributes']) && is_array($form['#table_attributes'])) {
    $attributes = $form['#table_attributes'];
  }
  else {
    $attributes = array();
  }
  $header = array(
    t('Enabled'),
    t('Title'),
    t('Weight'),
  );
  foreach (element_children($form) as $pane_id) {
    $rows[] = array(
      array(
        'data' => drupal_render($form[$pane_id][$prefix . '_' . $pane_id . '_enabled']),
        'align' => 'center',
      ),
      drupal_render($form[$pane_id]['title']),
      drupal_render($form[$pane_id][$prefix . '_' . $pane_id . '_weight']),
    );
  }
  return theme('table', $header, $rows, $attributes) . '<br />';
}