You are here

function swftools_profiles_delete_confirm in SWF Tools 6.3

Menu callback to delete a profile.

1 string reference to 'swftools_profiles_delete_confirm'
swftools_profiles_menu in profiles/swftools_profiles.module
Implementation of hook_menu().

File

profiles/swftools_profiles.admin.inc, line 437
Configuration settings for SWF Tools profiles.

Code

function swftools_profiles_delete_confirm(&$form_state, $profile) {

  // Store the profile
  $form['profile'] = array(
    '#type' => 'value',
    '#value' => $profile['profile'],
  );

  // Store the name
  $form['name'] = array(
    '#type' => 'value',
    '#value' => $profile['name'],
  );

  // Define message and caption
  $message = t('Are you sure you want to delete the profile %profile?', array(
    '%profile' => $profile['name'],
  ));
  $caption = '';

  // TODO: Warn if content is using this profile
  //  $num_nodes = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE type = '%s'", $type->type));
  //  if ($num_nodes) {
  //    $caption .= '<p>'. format_plural($num_nodes, '<strong>Warning:</strong> there is currently 1 %type post on your site. It may not be able to be displayed or edited correctly, once you have removed this content type.', '<strong>Warning:</strong> there are currently @count %type posts on your site. They may not be able to be displayed or edited correctly, once you have removed this content type.', array('%type' => $type->name)) .'</p>';
  //  }
  $caption .= '<p>' . t('This action cannot be undone.') . '</p>';

  // Return a confirmation form
  return confirm_form($form, $message, 'admin/settings/swftools/profiles', $caption, t('Delete'));
}