You are here

function context_ui_confirm in Context 6

Same name and namespace in other branches
  1. 6.2 context_ui/context_ui.admin.inc \context_ui_confirm()

Provide a form to confirm one of the provided actions.

1 string reference to 'context_ui_confirm'
context_ui_menu in context_ui/context_ui.module
Implementation of hook_menu().

File

context_ui/context_ui.admin.inc, line 406

Code

function context_ui_confirm(&$form_state, $op = 'delete', $context) {
  $form = array();
  $form['context'] = array(
    '#type' => 'value',
    '#value' => $context,
  );
  $form['action'] = array(
    '#type' => 'value',
    '#value' => $op,
  );
  switch ($op) {
    case 'delete':
      $action = t('delete');
      $message = t('This action will remove this context permanently from your site.');
      break;
    case 'disable':
      $action = t('disable');
      $message = '';
      break;
    case 'enable':
      $action = t('enable');
      $message = '';
      break;
  }
  $form = confirm_form($form, t('Are you sure you want to !action the context %title?', array(
    '%title' => $context->value,
    '!action' => $action,
  )), 'admin/build/context', $message, drupal_ucfirst($action), t('Cancel'));
  return $form;
}