Skip navigation
Help

theme_uc_shipping_new_shipment

6 uc_shipping.admin.inc theme_uc_shipping_new_shipment($form)
7 uc_shipping.admin.inc theme_uc_shipping_new_shipment($variables)

Formats and displays the new shipment form.

See also

uc_shipping_new_shipment()

Related topics

File

ubercart/shipping/uc_shipping/uc_shipping.admin.inc, line 627
Shipping administration menu items.

Code

function theme_uc_shipping_new_shipment($variables) {
  $form = $variables['form'];
  drupal_add_js('misc/tableselect.js');

  $output = '';
  $header = array(array('class' => array('select-all')), t('Package'), t('Products'), t('Weight'));
  foreach (element_children($form['shipping_types']) as $shipping_type) {
    $rows = array();
    foreach (element_children($form['shipping_types'][$shipping_type]['packages']) as $package_id) {
      $row = array();
      $row[] = drupal_render($form['shipping_types'][$shipping_type]['packages'][$package_id]['checked']);
      $row[] = drupal_render($form['shipping_types'][$shipping_type]['packages'][$package_id]['package_id']);
      $row[] = drupal_render($form['shipping_types'][$shipping_type]['packages'][$package_id]['products']);
      $row[] = drupal_render($form['shipping_types'][$shipping_type]['packages'][$package_id]['weight']);
      $rows[] = $row;
    }
    if (count($rows)) {
      $form['shipping_types'][$shipping_type]['packages']['table'] = array(
        '#theme' => 'table', 
        '#header' => $header, 
        '#rows' => $rows,
      );
    }
  }

  $output .= drupal_render_children($form);

  return $output;
}