You are here

function spaces_preset_save in Spaces 7

Same name and namespace in other branches
  1. 5.2 spaces_admin.inc \spaces_preset_save()
  2. 6.3 spaces.module \spaces_preset_save()
  3. 6 spaces_admin.inc \spaces_preset_save()
  4. 6.2 spaces_admin.inc \spaces_preset_save()
  5. 7.3 spaces.module \spaces_preset_save()

Inserts or updates a spaces preset into the database.

Parameters

$preset: The preset object to be inserted.

6 calls to spaces_preset_save()
SpacesContextControllerTestCase::test in tests/spaces.test
Test override inheritance of variable controller.
SpacesVariableControllerTestCase::test in tests/spaces.test
Test override inheritance of variable controller.
spaces_overrides_preset_save in ./spaces.admin.inc
Submit handler for saving overrides to a preset.
spaces_preset_list_new in spaces_ui/export_ui/spaces_presets_export_ui.class.php
Submit handler for preset creation.
spaces_preset_save_from_space in ./spaces.module
Save a preset's values from a given space object.

... See full list

File

./spaces.module, line 270

Code

function spaces_preset_save($preset) {
  $existing = spaces_preset_load($preset->name, NULL, TRUE);
  if ($existing && $existing->export_type & EXPORT_IN_DATABASE) {
    drupal_write_record('spaces_presets', $preset, 'name');
  }
  else {
    drupal_write_record('spaces_presets', $preset);
  }
  spaces_preset_load(NULL, NULL, TRUE);

  // Reset static cache
  return TRUE;
}