You are here

function paragraphs_admin_bundle_delete_form in Paragraphs 7

Menu callback to delete a single paragraph bundle.

Parameters

array $form: The form structure array.

array $form_state: An associative array containing the current state of the form.

object $bundle: The bundle.

1 string reference to 'paragraphs_admin_bundle_delete_form'
paragraphs_menu in ./paragraphs.module
Implements hook_menu().

File

./paragraphs.admin.inc, line 274
Admin functions for the paragraphs module.

Code

function paragraphs_admin_bundle_delete_form(array $form, array &$form_state, $bundle) {
  if (!$bundle) {
    drupal_set_message(t('Could not load bundle'), 'error');
    drupal_goto('admin/structure/paragraphs');
  }
  $form['type'] = array(
    '#type' => 'value',
    '#value' => $bundle->bundle,
  );
  $form['name'] = array(
    '#type' => 'value',
    '#value' => $bundle->name,
  );
  $message = t('Are you sure you want to delete the paragraph bundle %bundle?', array(
    '%bundle' => $bundle->name,
  ));
  $caption = '<p>' . t('This action cannot be undone. Content using the bundle will be broken.') . '</p>';
  return confirm_form($form, filter_xss_admin($message), 'admin/structure/paragraphs', filter_xss_admin($caption), t('Delete'));
}