You are here

function uc_product_class_delete_confirm in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_product/uc_product.module \uc_product_class_delete_confirm()
  2. 7.3 uc_product/uc_product.admin.inc \uc_product_class_delete_confirm()

Confirms the deletion of a product class.

See also

uc_product_class_delete_confirm_submit()

1 string reference to 'uc_product_class_delete_confirm'
uc_product_menu in uc_product/uc_product.module
Implements hook_menu().

File

uc_product/uc_product.admin.inc, line 656
Product administration menu items.

Code

function uc_product_class_delete_confirm($form_state, $class) {
  $form = array();
  $form['pcid'] = array(
    '#type' => 'value',
    '#value' => $class->pcid,
  );
  $question = t('Are you sure you want to delete the %type product class?', array(
    '%type' => $class->pcid,
  ));
  $description = t('The node type associated with this product class will revert to a standard node type.');

  // Find out how many nodes of this class exist and add to the description.
  $count = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE type = '%s'", $class->pcid));
  if ($count > 0) {
    $description .= '<br />' . format_plural($count, 'There is @count node of this type.', 'There are @count nodes of this type.');
  }
  return confirm_form($form, $question, 'admin/store/products/classes', $description, t('Delete'), t('Cancel'));
}