You are here

function elasticsearch_connector_delete_cluster in Elasticsearch Connector 7.2

Same name and namespace in other branches
  1. 7.5 elasticsearch_connector.admin.inc \elasticsearch_connector_delete_cluster()
  2. 7 elasticsearch_connector.admin.inc \elasticsearch_connector_delete_cluster()

Form constructor for the cluster deletion confirmation form.

See also

elasticsearch_connector_delete_cluster_submit()

1 string reference to 'elasticsearch_connector_delete_cluster'
elasticsearch_connector_menu in ./elasticsearch_connector.module
Implements hook_menu().

File

./elasticsearch_connector.admin.inc, line 801
Created on Dec 23, 2013

Code

function elasticsearch_connector_delete_cluster($form, &$form_state, $cluster) {
  $locked = _elasticsearch_connector_check_if_cluster_locked($cluster);
  if (empty($locked)) {
    $form['cluster'] = array(
      '#type' => 'value',
      '#value' => $cluster,
    );
    return confirm_form($form, t('Are you sure you want to delete %name?', array(
      '%name' => $cluster->name,
    )), elasticsearch_connector_main_settings_path() . '/clusters', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  }
  else {
    $form['item'] = array(
      '#type' => 'item',
      '#markup' => t('Unable the delete this cluster because it\'s locked by following modules:') . theme('item_list', array(
        'items' => $locked,
      )),
    );
    return $form;
  }
}