function ca_weight_sort in Ubercart 6.2
Compare two conditional action arrays to sort them by #weight.
2 string references to 'ca_weight_sort'
- ca_admin in ca/
ca.admin.inc - Display the administration page that lets you add and modify predicates.
- ca_load_trigger_predicates in ca/
ca.module - Load predicates based on the specified parameters.
File
- ca/
ca.module, line 1021 - This is a demonstration module for the new conditional actions API.
Code
function ca_weight_sort($a, $b) {
if ($a['#weight'] == $b['#weight']) {
return 0;
}
return $a['#weight'] > $b['#weight'] ? 1 : -1;
}