You are here

function spaces_preset_delete_form in Spaces 6

Same name and namespace in other branches
  1. 5.2 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 440

Code

function spaces_preset_delete_form(&$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 '';
}