You are here

function hook_uc_coupon_actions in Ubercart Discount Coupons 7.2

Same name and namespace in other branches
  1. 6 uc_coupon.api.php \hook_uc_coupon_actions()
  2. 7.3 uc_coupon.api.php \hook_uc_coupon_actions()

hook_uc_coupon_actions().

Allows modules to add to the list of actions available when coupons are listed in a table.

Parameters

$coupon: The coupon being displayed.

Return value

An associative array describing the actions available. Must contain the followoing keys: - 'url': The url where the action is processed. - 'icon': The icon to display for this action. - 'title': The text to display as a title for the action (usually as hover text over the icon).

3 functions implement hook_uc_coupon_actions()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

theme_uc_coupon_actions in ./uc_coupon.admin.inc
Show the actions a user may perform on a coupon.
uc_coupon_purchase_uc_coupon_actions in uc_coupon_purchase/uc_coupon_purchase.module
Implementation of hook_uc_coupon_actions for purchased coupons
uc_coupon_uc_coupon_actions in ./uc_coupon.module
Implements hook_uc_coupon_actions().
1 invocation of hook_uc_coupon_actions()
theme_uc_coupon_actions in ./uc_coupon.admin.inc
Show the actions a user may perform on a coupon.

File

./uc_coupon.api.php, line 113
Ubercart Discount Coupon module api/hooks. Version 7.x-2.x

Code

function hook_uc_coupon_actions($coupon) {
  $actions = array();

  // Provide a "mark coupon as used" action.
  if (user_access('mark coupon as used')) {
    $actions[] = array(
      'url' => 'admin/store/coupons/mark-as-used/' . $coupon->cid,
      'icon' => drupal_get_path('module', 'mymodule') . 'mark_as_used.gif',
      'title' => t('Mark coupon: @name as used', array(
        '@name' => $coupon->name,
      )),
    );
  }
  return $actions;
}