function uc_weight_sort in Ubercart 6.2
Same name and namespace in other branches
- 5 uc_store/uc_store.module \uc_weight_sort()
- 7.3 uc_store/uc_store.module \uc_weight_sort()
Sorts an array of arrays having a weight key to determine their order.
19 string references to 'uc_weight_sort'
- template_preprocess_uc_order in uc_order/
uc_order.module - Preprocess a formatted invoice with an order's data.
- theme_tapir_table in uc_store/
includes/ tapir.inc - Themes form data into a table for display.
- uc_cart_cart_pane_list in uc_cart/
uc_cart.module - Gets all of the enabled, sorted cart panes.
- uc_checkout_pane_payment in payment/
uc_payment/ uc_payment_checkout_pane.inc - @file Checkout pane functions for uc_payment.module.
- uc_order_edit_form_submit in uc_order/
uc_order.admin.inc - Form submission handler for uc_order_edit_form().
File
- uc_store/
uc_store.module, line 1645 - Contains global Ubercart functions and store administration functionality.
Code
function uc_weight_sort($a, $b) {
if ($a['weight'] == $b['weight']) {
return 0;
}
return $a['weight'] > $b['weight'] ? 1 : -1;
}