You are here

function webform_component_delete_form in Webform 6.3

Same name and namespace in other branches
  1. 5.2 webform_components.inc \webform_component_delete_form()
  2. 6.2 webform_components.inc \webform_component_delete_form()
  3. 7.4 includes/webform.components.inc \webform_component_delete_form()
  4. 7.3 includes/webform.components.inc \webform_component_delete_form()

Form to confirm deletion of a component.

1 string reference to 'webform_component_delete_form'
webform_menu in ./webform.module
Implements hook_menu().

File

includes/webform.components.inc, line 683
Webform module component handling.

Code

function webform_component_delete_form($form_state, $node, $component) {
  $cid = $component['cid'];
  $form = array();
  $form['node'] = array(
    '#type' => 'value',
    '#value' => $node,
  );
  $form['component'] = array(
    '#type' => 'value',
    '#value' => $component,
  );
  if (webform_component_feature($node->webform['components'][$cid]['type'], 'group')) {
    $question = t('Delete the %name fieldset?', array(
      '%name' => $node->webform['components'][$cid]['name'],
    ));
    $description = t('This will immediately delete the %name fieldset and all children elements within %name from the %webform webform. This cannot be undone.', array(
      '%name' => $node->webform['components'][$cid]['name'],
      '%webform' => $node->title,
    ));
  }
  else {
    $question = t('Delete the %name component?', array(
      '%name' => $node->webform['components'][$cid]['name'],
    ));
    $description = t('This will immediately delete the %name component from the %webform webform. This cannot be undone.', array(
      '%name' => $node->webform['components'][$cid]['name'],
      '%webform' => $node->title,
    ));
  }
  return confirm_form($form, $question, 'node/' . $node->nid . '/webform/components', $description, t('Delete'));
}