Skip navigation
Help

theme_uc_shipping_new_package_fieldset

6 uc_shipping.admin.inc theme_uc_shipping_new_package_fieldset($fieldset)
7 uc_shipping.admin.inc theme_uc_shipping_new_package_fieldset($variables)

Formats and displays the products in a shipping type fieldset.

See also

uc_shipping_new_package()

Related topics

File

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

Code

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

  $output = '';
  $header = array(array('class' => array('select-all')), t('SKU'), t('Title'), theme('uc_qty_label'), t('Package'));

  $rows = array();
  foreach (element_children($fieldset) as $op_id) {
    $row = array();
    $row[] = drupal_render($fieldset[$op_id]['checked']);
    $row[] = drupal_render($fieldset[$op_id]['model']);
    $row[] = drupal_render($fieldset[$op_id]['name']);
    $row[] = drupal_render($fieldset[$op_id]['qty']);
    $row[] = drupal_render($fieldset[$op_id]['package']);
    $rows[] = $row;
  }

  $output .= theme('table', array(
    'header' => $header, 
    'rows' => $rows, 
    'empty' => t('There are no products available for this type of package.'),
  ));
  $output .= drupal_render_children($fieldset);

  return $output;
}