You are here

function spaces_preset_delete in Spaces 7

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

Deletes an existing preset.

Parameters

$preset: The preset object to be deleted.

Return value

Returns true on success, false on failure.

2 calls to spaces_preset_delete()
SpacesContextControllerTestCase::test in tests/spaces.test
Test override inheritance of variable controller.
SpacesVariableControllerTestCase::test in tests/spaces.test
Test override inheritance of variable controller.

File

./spaces.module, line 310

Code

function spaces_preset_delete($preset) {
  if (isset($preset->name) && $preset->export_type & EXPORT_IN_DATABASE) {
    db_delete('spaces_presets')
      ->condition('name', $preset->name)
      ->execute();
    spaces_preset_load(NULL, NULL, TRUE);
    return TRUE;
  }
  return FALSE;
}