Skip navigation
Help

theme_uc_pane_sort_table

6 uc_store.module theme_uc_pane_sort_table($form)
7 uc_store.theme.inc theme_uc_pane_sort_table($variables)

Themes a pane sorting form into a table.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.

Related topics

File

ubercart/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 />';
}