Skip navigation
Help

uc_order_edit_form

6 uc_order.admin.inc uc_order_edit_form($form_state, $order)
7 uc_order.admin.inc uc_order_edit_form($form, &$form_state, $order)

Displays the order edit screen, constructed via hook_order_pane().

See also

uc_order_edit_form_validate()

uc_order_edit_form_submit()

theme_uc_order_edit_form()

Related topics

3 string references to 'uc_order_edit_form'

File

ubercart/uc_order/uc_order.admin.inc, line 1151
Order administration menu items.

Code

function uc_order_edit_form($form_state, $order) {
  $form['order_id'] = array(
    '#type' => 'hidden',
    '#value' => $order->order_id,
  );
  $form['order_uid'] = array(
    '#type' => 'hidden',
    '#value' => $order->uid,
  );

  $modified = isset($form_state['post']['order_modified']) ? $form_state['post']['order_modified'] : $order->modified;
  $form['order_modified'] = array(
    '#type' => 'hidden',
    '#value' => $modified,
  );

  $panes = _order_pane_list('edit');
  foreach ($panes as $pane) {
    if (in_array('edit', $pane['show']) && 
        variable_get('uc_order_pane_' . $pane['id'] . '_show_edit', $pane['enabled'])) {
      $func = $pane['callback'];
      if (function_exists($func) && ($contents = $func('edit-form', $order)) != NULL) {
        $form = array_merge($form, $contents);
      }
    }
  }

  $form['submit-changes'] = array(
    '#type' => 'submit', 
    '#value' => t('Submit changes'), 
    '#attributes' => array('class' => 'save-button'),
  );

  if (uc_order_can_delete($order)) {
    $form['delete'] = array(
      '#type' => 'submit', 
      '#value' => t('Delete'),
    );
  }

  return $form;
}