function uc_order_add_line_item_form in Ubercart 6.2
Same name and namespace in other branches
- 5 uc_order/uc_order.module \uc_order_add_line_item_form()
- 7.3 uc_order/uc_order.admin.inc \uc_order_add_line_item_form()
Form to add a line item to an order.
See also
uc_order_add_line_item_form_validate()
uc_order_add_line_item_submit()
1 string reference to 'uc_order_add_line_item_form'
- uc_order_menu in uc_order/
uc_order.module - Implements hook_menu().
File
- uc_order/
uc_order.admin.inc, line 1508 - Order administration menu items.
Code
function uc_order_add_line_item_form($form_state, $order, $line_item_id) {
$func = _line_item_data($line_item_id, 'callback');
if (!function_exists($func) || ($form = $func('form', $order->order_id)) == NULL) {
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Line Item Title'),
'#description' => t('Display title of the line item.'),
'#size' => 32,
'#maxlength' => 128,
'#default_value' => _line_item_data($line_item_id, 'title'),
);
$form['amount'] = array(
'#type' => 'textfield',
'#title' => t('Line Item Amount'),
'#description' => t('Amount of the line item without a currency sign.'),
'#size' => 6,
'#maxlength' => 13,
);
}
$form['order_id'] = array(
'#type' => 'hidden',
'#value' => $order->order_id,
);
$form['line_item_id'] = array(
'#type' => 'hidden',
'#value' => $line_item_id,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Add line item'),
'#suffix' => l(t('Cancel'), 'admin/store/orders/' . $order->order_id . '/edit'),
);
return $form;
}