You are here

function theme_uc_product_field_settings_form in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_product/uc_product.admin.inc \theme_uc_product_field_settings_form()

Display the product field settings form.

See also

uc_product_field_settings_form

File

uc_product/uc_product.module, line 2059
The product module for Ubercart.

Code

function theme_uc_product_field_settings_form($form) {
  $options = array(
    'model' => t('Model'),
    'image' => t('Image'),
    'display_price' => t('Display price'),
    'list_price' => t('List price'),
    'cost' => t("Cost (seen only by 'administer products' permission)"),
    'sell_price' => t('Sell price'),
    'weight' => t('Weight'),
    'dimensions' => t('Dimensions'),
    'add_to_cart' => variable_get('uc_product_add_to_cart_text', t('Add to cart')),
  );
  $header = array(
    t('Enable'),
    t('Product field'),
    t('Weight'),
  );
  $rows = array();
  foreach (element_children($form['fields']) as $field) {
    $row = array();
    $row[] = drupal_render($form['fields'][$field]['enabled']);
    $row[] = $options[$field];
    $row[] = drupal_render($form['fields'][$field]['weight']);
    $rows[] = $row;
  }
  $output .= theme('table', $header, $rows);
  $output .= drupal_render($form);
  return $output;
}