You are here

function theme_uc_price_settings_form in Ubercart 6.2

Renders the price handler form, adding tabledrag.

See also

uc_price_settings_form()

File

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

Code

function theme_uc_price_settings_form($form) {

  // Add the tabledrag to the alterer table.
  drupal_add_tabledrag('uc-price-handler-table', 'order', 'sibling', 'uc-price-handler-table-weight');
  $header = array(
    t('Price alterers'),
    t('Enabled'),
    t('Weight'),
  );
  if (count(element_children($form['uc_price_alterers'])) > 0) {
    foreach (element_children($form['uc_price_alterers']) as $module) {
      $row = array();
      foreach (element_children($form['uc_price_alterers'][$module]) as $field) {
        $row[] = drupal_render($form['uc_price_alterers'][$module][$field]);
      }
      $rows[] = array(
        'data' => $row,
        'class' => 'draggable',
      );
    }
  }
  $output = theme('table', $header, $rows, array(
    'id' => 'uc-price-handler-table',
  )) . drupal_render($form);
  return $output;
}