You are here

function getlocations_adjust_vars in Get Locations 7

Same name and namespace in other branches
  1. 7.2 getlocations.module \getlocations_adjust_vars()

Recursively merge the defaults with the current settings

Parameters

array $defaults:

array $settings:

Return value

array The merged settings

24 calls to getlocations_adjust_vars()
getlocations_blocks_get_var in modules/getlocations_blocks/getlocations_blocks.module
Load the getlocations_blocks variables array
getlocations_blocks_set_var in modules/getlocations_blocks/getlocations_blocks.module
Save the getlocations_blocks variables array
getlocations_colorbox_settings in ./getlocations.module
Function
getlocations_defaults in ./getlocations.module
Some defaults.
getlocations_fields_defaults in modules/getlocations_fields/getlocations_fields.module

... See full list

File

./getlocations.module, line 5764
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_adjust_vars($defaults, $settings) {
  $newdefaults = array();
  foreach ($defaults as $k => $v) {
    if (isset($settings[$k])) {
      if (is_array($v)) {
        $newdefaults[$k] = getlocations_adjust_vars($v, $settings[$k]);
      }
      else {
        $newdefaults[$k] = $settings[$k];
      }
    }
    else {
      $newdefaults[$k] = $v;
    }
  }
  return $newdefaults;
}