function uc_coupon_uc_coupon_actions in Ubercart Discount Coupons 6
Same name and namespace in other branches
- 7.3 uc_coupon.module \uc_coupon_uc_coupon_actions()
- 7.2 uc_coupon.module \uc_coupon_uc_coupon_actions()
Implementation of hook_uc_coupon_actions().
File
- ./
uc_coupon.module, line 1385 - Provides discount coupons for Ubercart.
Code
function uc_coupon_uc_coupon_actions($coupon) {
$actions = array();
if (user_access('view store coupons')) {
$actions[] = array(
'url' => 'admin/store/coupons/' . $coupon->cid,
'icon' => drupal_get_path('module', 'uc_store') . '/images/order_view.gif',
'title' => t('View coupon: @name', array(
'@name' => $coupon->name,
)),
);
$actions[] = array(
'url' => 'admin/store/coupons/' . $coupon->cid . '/print',
'icon' => drupal_get_path('module', 'uc_store') . '/images/print.gif',
'title' => t('Print coupon: @name', array(
'@name' => $coupon->name,
)),
);
if ($coupon->bulk) {
$actions[] = array(
'url' => 'admin/store/coupons/' . $coupon->cid . '/codes',
'icon' => drupal_get_path('module', 'uc_store') . '/images/menu_reports_small.gif',
'title' => t('Download codes as CSV: @name', array(
'@name' => $coupon->name,
)),
);
}
}
if (user_access('manage store coupons')) {
$actions[] = array(
'url' => 'admin/store/coupons/' . $coupon->cid . '/edit',
'icon' => drupal_get_path('module', 'uc_store') . '/images/order_edit.gif',
'title' => t('Edit coupon: @name', array(
'@name' => $coupon->name,
)),
);
$actions[] = array(
'url' => 'admin/store/coupons/' . $coupon->cid . '/delete',
'icon' => drupal_get_path('module', 'uc_store') . '/images/order_delete.gif',
'title' => t('Delete coupon: @name', array(
'@name' => $coupon->name,
)),
);
}
return $actions;
}