You are here

function theme_uc_stock_edit_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_stock/uc_stock.module \theme_uc_stock_edit_form()
  2. 7.3 uc_stock/uc_stock.admin.inc \theme_uc_stock_edit_form()

Returns HTML for uc_stock_edit_form().

See also

uc_stock_edit_form()

uc_stock_edit_form_submit()

File

uc_stock/uc_stock.admin.inc, line 217
Stock administration menu items.

Code

function theme_uc_stock_edit_form($form) {
  $header = array(
    array(
      'data' => '  ' . t('Active'),
    ) + theme('table_select_header_cell'),
    array(
      'data' => t('SKU'),
    ),
    array(
      'data' => t('Stock'),
    ),
    array(
      'data' => t('Threshold'),
    ),
  );
  $rows = array();
  foreach (element_children($form['stock']) as $id) {
    $rows[] = array(
      array(
        'data' => drupal_render($form['stock'][$id]['active']),
      ),
      array(
        'data' => drupal_render($form['stock'][$id]['display_sku']),
      ),
      array(
        'data' => drupal_render($form['stock'][$id]['stock']),
      ),
      array(
        'data' => drupal_render($form['stock'][$id]['threshold']),
      ),
    );
  }
  return theme('table', $header, $rows) . drupal_render($form);
}