You are here

function _subscriptions_cmp_by_weight in Subscriptions 7

Same name and namespace in other branches
  1. 5.2 subscriptions.module \_subscriptions_cmp_by_weight()
  2. 6 subscriptions.module \_subscriptions_cmp_by_weight()
  3. 2.0.x subscriptions.module.old.php \_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.inc
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.module
Returns the form definition for the node subform.

File

./subscriptions.module, 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);
}