You are here

function ldap_query_admin_enable_disable 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_enable_disable()
  2. 7.2 ldap_query/ldap_query.admin.inc \ldap_query_admin_enable_disable()

Implements the LDAP query disable

Parameters

$form_state: A form state array.

$qid: A LDAP query ID.

Return value

The form structure.

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

File

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

Code

function ldap_query_admin_enable_disable($form, &$form_state, $action = NULL, $qid = NULL) {
  if ($ldap_query = ldap_query_get_queries($qid, 'all', TRUE)) {
    $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,
    );
    $form['action'] = array(
      '#type' => 'hidden',
      '#value' => $action,
    );
    return confirm_form($form, t('Are you sure you want to') . t($action) . ' ' . t('the LDAP query named <em><strong>%name</strong></em>?', array(
      '%name' => $ldap_query->name,
    )), LDAP_QUERY_MENU_BASE_PATH . '/query/list', t('<p></p>'), t($action), t('Cancel'));
  }
}