You are here

function rules_admin_form_delete in Rules 6

Shows the delete form for elements (conditions, actions, ..)

1 string reference to 'rules_admin_form_delete'
rules_admin_menu in rules_admin/rules_admin.module
Implementation of hook_menu().

File

rules_admin/rules_admin.rule_forms.inc, line 817

Code

function rules_admin_form_delete(&$form_state, $proxy, $element) {
  $form_state['proxy'] =& $proxy;

  //get the item assocaited with $id
  $form_state['id'] = $element['#id'];
  _rules_element_defaults($element);
  $form = array();
  $path = array();
  $path['path'] = isset($_GET['destination']) ? $_GET['destination'] : RULES_ADMIN_PATH;
  if (isset($element['#logical_op']) && $element['#logical_op']) {
    $form_state['is_op'] = TRUE;
    $text = t('Are you sure you want to delete the logical operation %label?', array(
      '%label' => rules_get_element_label($element),
    ));
  }
  else {
    $text = t('Are you sure you want to delete %label?', array(
      '%label' => rules_get_element_label($element),
    ));
  }
  return confirm_form($form, $text, $path, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}