You are here

function uc_order_status_create_form in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_order/uc_order.admin.inc \uc_order_status_create_form()
  2. 7.3 uc_order/uc_order.admin.inc \uc_order_status_create_form()
1 string reference to 'uc_order_status_create_form'
uc_order_menu in uc_order/uc_order.module
Implementation of hook_menu().

File

uc_order/uc_order.module, line 946

Code

function uc_order_status_create_form() {
  $form['status_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Order status ID'),
    '#description' => t('Must be a unique ID with no spaces.'),
    '#size' => 32,
    '#maxlength' => 32,
    '#required' => TRUE,
  );
  $form['status_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#description' => t('The order status title displayed to users.'),
    '#size' => 32,
    '#maxlength' => 48,
    '#required' => TRUE,
  );

  // Build the state option array for the order status table.
  $options = array();
  foreach (uc_order_state_list() as $state) {
    $options[$state['id']] = $state['title'];
  }
  $form['status_state'] = array(
    '#type' => 'select',
    '#title' => t('Order state'),
    '#description' => t('Set which order state this status is for.'),
    '#options' => $options,
    '#default_value' => 'post_checkout',
  );
  $form['status_weight'] = array(
    '#type' => 'weight',
    '#title' => t('Weight'),
    '#delta' => 20,
    '#default_value' => 0,
  );
  $form['create'] = array(
    '#type' => 'submit',
    '#value' => t('Create'),
  );
  $form['cancel'] = array(
    '#value' => l(t('Cancel'), 'admin/store/settings/orders/edit/workflow'),
  );
  return $form;
}