You are here

function spaces_preset_save_from_space in Spaces 7

Same name and namespace in other branches
  1. 6.3 spaces.module \spaces_preset_save_from_space()
  2. 7.3 spaces.module \spaces_preset_save_from_space()

Save a preset's values from a given space object.

Parameters

$preset: The preset object to be saved.

$space: The space object whose values should be used for the preset.

File

./spaces.module, line 290

Code

function spaces_preset_save_from_space($preset, $space) {
  $space
    ->activate();
  foreach (array_keys(spaces_controllers()) as $controller) {
    $preset->value[$controller] = array_merge($space->controllers->{$controller}
      ->get(NULL, 'preset'), $space->controllers->{$controller}
      ->get(NULL, 'space'));
  }
  spaces_preset_save($preset);
}