You are here

function oauthconnector_delete_confirm_provider in OAuth Connector 6

Same name and namespace in other branches
  1. 7 oauthconnector.admin.inc \oauthconnector_delete_confirm_provider()

Provide a form to confirm deletion of a provider.

1 string reference to 'oauthconnector_delete_confirm_provider'
oauthconnector_menu in ./oauthconnector.module
Implementation of hook_menu().

File

./oauthconnector.admin.inc, line 418
Administrative functions for the OAuth Connector module.

Code

function oauthconnector_delete_confirm_provider(&$form_state, $provider) {
  if (!is_object($provider)) {
    $provider = oauthconnector_provider_load($provider);
  }
  if ($provider->export_type == (EXPORT_IN_CODE | EXPORT_IN_DATABASE)) {
    $title = t('Are you sure you want to revert the provider "@name"?', array(
      '@name' => $provider->title,
    ));
    $submit = t('Revert');
  }
  elseif ($provider->export_type != EXPORT_IN_CODE) {
    $title = t('Are you sure you want to delete the provider "@name"?', array(
      '@name' => $provider->title,
    ));
    $submit = t('Delete');
  }
  else {
    drupal_not_found();
    die;

    // legitimate
  }
  $form['provider'] = array(
    '#type' => 'value',
    '#value' => $provider,
  );
  return confirm_form($form, $title, !empty($_GET['destination']) ? $_GET['destination'] : 'admin/build/oauthconnector', t('This action cannot be undone.'), $submit, t('Cancel'));
}