Skip navigation
Help

theme_uc_stock_edit_form

6 uc_stock.admin.inc theme_uc_stock_edit_form($form)
7 uc_stock.admin.inc theme_uc_stock_edit_form($variables)

Returns HTML for uc_stock_edit_form().

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.

See also

uc_stock_edit_form()

uc_stock_edit_form_submit()

Related topics

File

ubercart/uc_stock/uc_stock.admin.inc, line 299
Stock administration menu items.

Code

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

  $header = array(
    array(
      'data' => '  ' . t('Active'),
      'class' => array('select-all'),
    ),
    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', array('header' => $header, 'rows' => $rows)) . drupal_render_children($form);
}