You are here

function uc_taxes_delete in Ubercart 5

Delete a tax rule.

See also

uc_taxes_delete_submit

1 string reference to 'uc_taxes_delete'
uc_taxes_menu in uc_taxes/uc_taxes.module
Implementation of hook_menu().

File

uc_taxes/uc_taxes.module, line 303

Code

function uc_taxes_delete($tax_id = 0) {

  //drupal_set_message($tax_id);
  if ($tax_id != 0) {
    $rule = db_fetch_object(db_query("SELECT * FROM {uc_taxes} WHERE id = %d", $tax_id));
    $form = array(
      'id' => array(
        '#type' => 'value',
        '#value' => $tax_id,
      ),
    );
    $output = confirm_form($form, t('Delete !rule?', array(
      '!rule' => $rule->name,
    )), 'admin/store/settings/taxes', '', t('Continue'), t('Cancel'));
    return $output;
  }
  else {
    drupal_goto('admin/store/settings/taxes');
  }
}