You are here

function theme_uc_stock_edit_form in Ubercart 7.3

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

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()

File

uc_stock/uc_stock.admin.inc, line 298
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);
}