You are here

function commerce_coupon_add_page in Commerce Coupon 7.2

Menu callback: display a list of product types that the user can create.

1 string reference to 'commerce_coupon_add_page'
commerce_coupon_menu in ./commerce_coupon.module
Implements hook_menu().

File

includes/commerce_coupon.admin.inc, line 53
Administrative forms and callbacks for Commerce Coupon.

Code

function commerce_coupon_add_page() {
  $item = menu_get_item();
  $content = system_admin_menu_block($item);

  // Bypass the admin/commerce/products/add listing if only one product type is
  // available.
  if (count($content) == 1) {
    $item = array_shift($content);
    drupal_goto($item['href']);
  }
  return theme('commerce_coupon_add_list', array(
    'content' => $content,
  ));
}