function _subscriptions_cmp_by_weight in Subscriptions 2.0.x
Same name and namespace in other branches
- 5.2 subscriptions.module \_subscriptions_cmp_by_weight()
- 6 subscriptions.module \_subscriptions_cmp_by_weight()
- 7 subscriptions.module \_subscriptions_cmp_by_weight()
Helper function for uasort()ing arrays with elements that have a 'weight'.
Parameters
array $a:
array $b:
Return value
int
2 string references to '_subscriptions_cmp_by_weight'
- subscriptions_page_user_overview in ./
subscriptions.admin.old.php - Construct the overview page, which displays a summary of subscriptions per type as well as the user settings at user/UID/subscriptions. This form is also used for admin/settings/subscriptions/userdefaults.
- subscriptions_ui_node_form in subscriptions_ui/
subscriptions_ui.module - Returns the form definition for the node subform.
File
- ./
subscriptions.module.old.php, line 857 - Subscriptions module.
Code
function _subscriptions_cmp_by_weight(array $a, array $b) {
$a = isset($a['weight']) ? $a['weight'] : 0;
$b = isset($b['weight']) ? $b['weight'] : 0;
return $a < $b ? -1 : ($a == $b ? 0 : +1);
}