You are here

function oauth_common_delete_confirm_context in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 oauth_common.admin.inc \oauth_common_delete_confirm_context()
  2. 7.4 oauth_common.admin.inc \oauth_common_delete_confirm_context()

Provide a form to confirm deletion of a context.

1 string reference to 'oauth_common_delete_confirm_context'
oauth_common_providerui_menu in ./oauth_common_providerui.module
Implements hook_menu().

File

./oauth_common.admin.inc, line 533
Administration pages for OAuth module.

Code

function oauth_common_delete_confirm_context($form, &$form_state, $context) {
  if (!is_object($context)) {
    $context = oauth_common_context_load($context);
  }
  if ($context->export_type == (EXPORT_IN_CODE | EXPORT_IN_DATABASE)) {
    $title = t('Are you sure you want to revert the context "@title"?', array(
      '@title' => $context->title,
    ));
    $submit = t('Revert');
  }
  elseif ($context->export_type != EXPORT_IN_CODE) {
    $title = t('Are you sure you want to delete the context "@title"?', array(
      '@title' => $context->title,
    ));
    $submit = t('Delete');
  }
  else {
    drupal_not_found();
    die;
  }
  $form['context'] = array(
    '#type' => 'value',
    '#value' => $context->name,
  );
  $form['cid'] = array(
    '#type' => 'value',
    '#value' => $context->cid,
  );
  return confirm_form($form, $title, !empty($_GET['destination']) ? $_GET['destination'] : 'admin/config/services/oauth', t('This action cannot be undone.'), $submit, t('Cancel'));
}