You are here

function skinr_context_sort_weight in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 skinr_context/skinr_context.module \skinr_context_sort_weight()

Function used by uasort to sort classes by weight.

See also

skinr_context_skinr_preprocess_alter()

2 string references to 'skinr_context_sort_weight'
skinr_context_skinr_preprocess_alter in skinr_context/skinr_context.module
Implements hook_skinr_preprocess_alter().
skinr_panels_skinr_preprocess_alter in skinr_panels/skinr_panels.module
Implements hook_skinr_preprocess_alter().

File

skinr_context/skinr_context.module, line 705
Provides Skinr integration with Context.

Code

function skinr_context_sort_weight($a, $b) {
  $a_weight = is_object($a) && isset($a->weight) ? $a->weight : 0;
  $b_weight = is_object($b) && isset($b->weight) ? $b->weight : 0;
  if ($a_weight == $b_weight) {
    return 0;
  }
  return $a_weight < $b_weight ? -1 : 1;
}