You are here

function _subscriptions_cmp_by_weight in Subscriptions 6

Same name and namespace in other branches
  1. 5.2 subscriptions.module \_subscriptions_cmp_by_weight()
  2. 7 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'

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 591
Subscriptions module.

Code

function _subscriptions_cmp_by_weight($a, $b) {
  $a = isset($a['weight']) ? $a['weight'] : 0;
  $b = isset($b['weight']) ? $b['weight'] : 0;
  return $a < $b ? -1 : ($a == $b ? 0 : +1);
}