You are here

function _dynamic_background_cmp in Dynamic Background 6

Helper function to sort image configuration arrays based on module weight.

Parameters

array $a:

array $b:

Return value

int

1 string reference to '_dynamic_background_cmp'
dynamic_background_load_image_configuration in ./dynamic_background.module
Helper function that calls hook_dynamic_background_css() and sorts the returned image configurations based on weight. This function may be called by more then one preprocessor function, so a static cache applied.

File

./dynamic_background.module, line 301
This module enables administrators to upload images used as background on the site. The selected background image link is exposed as either $background in the page.tpl file or as /background.css.

Code

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