You are here

function theme_uc_quote_method_settings in Ubercart 7.3

Same name and namespace in other branches
  1. 5 shipping/uc_quote/uc_quote.module \theme_uc_quote_method_settings()
  2. 6.2 shipping/uc_quote/uc_quote.admin.inc \theme_uc_quote_method_settings()

Displays a formatted list of shipping quote methods and form elements.

See also

uc_quote_method_settings()

File

shipping/uc_quote/uc_quote.admin.inc, line 214
Shipping quotes administration menu items.

Code

function theme_uc_quote_method_settings($variables) {
  $form = $variables['form'];
  drupal_add_tabledrag('uc-quote-methods', 'order', 'sibling', 'uc-quote-method-weight');
  $header = array(
    t('Shipping method'),
    t('Details'),
    array(
      'data' => t('List position'),
      'sort' => 'asc',
    ),
    t('Operations'),
  );
  $rows = array();
  foreach (element_children($form['methods']) as $method) {
    $row = array(
      drupal_render($form['methods'][$method]['uc_quote_enabled']),
      drupal_render($form['methods'][$method]['description']),
      drupal_render($form['methods'][$method]['uc_quote_method_weight']),
      drupal_render($form['methods'][$method]['operations']),
    );
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'uc-quote-methods',
    ),
    'empty' => t('No shipping quotes have been configured yet.'),
  ));
  $output .= drupal_render_children($form);
  return $output;
}