You are here

function ldap_query_admin_delete in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_query/ldap_query.admin.inc \ldap_query_admin_delete()
  2. 7.2 ldap_query/ldap_query.admin.inc \ldap_query_admin_delete()

Implements the LDAP query delete page.

Parameters

$form_state: A form state array.

$sid: A LDAP server ID.

Return value

The form structure.

1 string reference to 'ldap_query_admin_delete'
ldap_query_menu in ldap_query/ldap_query.module

File

ldap_query/ldap_query.admin.inc, line 126
Defines functions for administrative interface for servers

Code

function ldap_query_admin_delete($form, &$form_state, $op = NULL, $qid = NULL) {
  if ($qid && ($ldap_query = ldap_query_get_queries($qid, 'all', TRUE))) {

    // array()
    $variables = array(
      'ldap_query' => $ldap_query,
      'actions' => FALSE,
      'type' => 'detail',
    );
    $form['#prefix'] = '<div>' . theme('ldap_query', $variables) . '</div>';
    $form['qid'] = array(
      '#type' => 'hidden',
      '#value' => $qid,
    );
    $form['name'] = array(
      '#type' => 'hidden',
      '#value' => $ldap_query->name,
    );
    return confirm_form($form, 'Delete Confirmation Form', LDAP_QUERY_MENU_BASE_PATH . '/query/list', '<p>' . t('Are you sure you want to delete the LDAP query named <em><strong>%name</strong></em> ?', array(
      '%name' => $ldap_query->name,
    )) . '</p><p>' . t('This action cannot be undone.') . '</p>', t('Delete'), t('Cancel'));
  }
  drupal_goto(LDAP_QUERY_MENU_BASE_PATH . '/query/list');
}