You are here

function customfilter_set_delete in Custom filter 5

Delete a filter set.

1 string reference to 'customfilter_set_delete'
customfilter_menu in ./customfilter.module
Implements hook_menu().

File

./customfilter.module, line 386

Code

function customfilter_set_delete($sid) {
  $filters = customfilter_get_filters($sid);
  $set = customfilter_get_set($sid, '*');
  $form['sid'] = array(
    '#type' => 'value',
    '#value' => $sid,
  );
  $message = t('Are you sure you want to delete this filter set?');
  $msg_text = "<h3>" . $set['name'] . "</h3>" . "<p>" . $set->description . "</p>";
  if (count($filters) > 0) {
    $msg_text .= "<p>" . t('This set has filters. If you delete this, they will be deleted too.') . "</p>" . customfilter_filter_render_table($sid, $fid, FALSE);
  }
  $msg_text .= "<p>" . t('This action cannot be undone.') . "</p>";
  return confirm_form($form, $message, 'admin/settings/customfilter', $msg_text, t('Delete'));
}