You are here

function uc_attribute_option_delete_confirm in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_attribute/uc_attribute.module \uc_attribute_option_delete_confirm()
  2. 6.2 uc_attribute/uc_attribute.admin.inc \uc_attribute_option_delete_confirm()

Confirms deletion of the given attribute option.

See also

uc_attribute_option_delete_confirm_submit()

1 string reference to 'uc_attribute_option_delete_confirm'
uc_attribute_menu in uc_attribute/uc_attribute.module
Implements hook_menu().

File

uc_attribute/uc_attribute.admin.inc, line 486
Attribute administration menu items.

Code

function uc_attribute_option_delete_confirm($form, &$form_state, $attribute, $option) {
  if (empty($option)) {
    drupal_set_message(t('There is no option with that ID.'), 'error');
    drupal_goto('admin/store/products/attributes/' . $attribute->aid . '/options');
  }
  $aid = $attribute->aid;
  $oid = $option->oid;
  $form['aid'] = array(
    '#type' => 'value',
    '#value' => $aid,
  );
  $form['oid'] = array(
    '#type' => 'value',
    '#value' => $oid,
  );
  $output = confirm_form($form, t('Are you sure you want to delete the option %name?', array(
    '%name' => $option->name,
  )), 'admin/store/products/attributes/' . $aid . '/options', '', t('Delete'), t('Cancel'));
  return $output;
}