You are here

function spaces_preset_delete_form in Spaces 5.2

Same name and namespace in other branches
  1. 6 spaces_admin.inc \spaces_preset_delete_form()
  2. 6.2 spaces_admin.inc \spaces_preset_delete_form()
1 string reference to 'spaces_preset_delete_form'
spaces_menu in ./spaces.module
Implementation of hook_menu().

File

./spaces_admin.inc, line 422

Code

function spaces_preset_delete_form($type, $preset_id) {

  // @TODO: proper check for preset existence
  $presets = spaces_presets(null, TRUE);
  if (isset($presets[$type][$preset_id]) && ($preset = $presets[$type][$preset_id])) {
    $form = array();
    $form['type'] = array(
      '#type' => 'hidden',
      '#value' => $type,
    );
    $form['preset'] = array(
      '#type' => 'hidden',
      '#value' => $preset_id,
    );
    $question = t('Are you sure you want to delete !preset?', array(
      '!preset' => $preset['name'],
    ));
    $description = t('Any spaces using this preset will need to reset.');
    $form = confirm_form($form, $question, 'admin/build/spaces', $description);
    return $form;
  }
  return '';
}