You are here

function client_delete_confirm_submit in Web Service Clients 6.2

Same name and namespace in other branches
  1. 7 clients.module \client_delete_confirm_submit()
  2. 7.2 clients.connection.admin.inc \client_delete_confirm_submit()

Form submit handler for the deletion form.

@todo: refactor?

File

./clients.module, line 243
Clients module provides a UI, storage, and an API for handling connections to remote webservices, including those provided by Services module on other Drupal sites.

Code

function client_delete_confirm_submit($form, &$form_state) {
  $cid = (int) $form_state['values']['cid'];
  if ($form_state['values']['type'] == 'connection') {
    if ($result = db_query("DELETE FROM {clients_connections} WHERE cid = %d", $cid)) {
      drupal_set_message(t('Connection @name deleted.', array(
        '@name' => $form_state['values']['name'],
      )));
      $form_state['redirect'] = 'admin/build/clients/connections';
    }
    else {
      drupal_set_message(t('Problem deleting connection @name.', array(
        '@name' => $form_state['values']['name'],
      )), 'error');
    }
  }
}