You are here

function menu_position_delete_rule_form in Menu Position 7.2

Same name and namespace in other branches
  1. 6 menu_position.admin.inc \menu_position_delete_rule_form()
  2. 7 menu_position.admin.inc \menu_position_delete_rule_form()

Menu callback: confirms deletion of rule.

1 string reference to 'menu_position_delete_rule_form'
menu_position_menu in ./menu_position.module
Implements hook_menu().

File

./menu_position.admin.inc, line 616
Provides infrequently used functions and hooks for menu_position.

Code

function menu_position_delete_rule_form($form, &$form_state, $rid = 0) {

  // Make sure rid is set.
  if ($rid == 0) {
    drupal_goto('admin/structure/menu-position');
    return;
  }
  $form['rid'] = array(
    '#type' => 'hidden',
    '#value' => $rid,
  );
  $title = db_query('SELECT admin_title FROM {menu_position_rules} WHERE rid = :rid', array(
    ':rid' => $rid,
  ))
    ->fetchField();
  return confirm_form($form, t('Are you sure you want to delete the %title rule?', array(
    '%title' => $title,
  )), 'admin/structure/menu-position/edit/' . $rid, NULL, t('Delete'), t('Cancel'));
}