function commerce_coupon_handler_field_coupon_operations::render in Commerce Coupon 7
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides views_handler_field::render
File
- includes/
views/ handlers/ commerce_coupon_handler_field_coupon_operations.inc, line 38 - Coupon.. Field handler to present an order's operations .
Class
- commerce_coupon_handler_field_coupon_operations
- @file Coupon.. Field handler to present an order's operations .
Code
function render($values) {
$coupon_id = $this
->get_value($values, 'coupon_id');
$links = menu_contextual_links('commerce-coupon', 'admin/commerce/coupons', array(
$coupon_id,
));
if (!empty($links)) {
// Add the destination to the links if specified.
if ($this->options['add_destination']) {
foreach ($links as $id => &$link) {
$link['query'] = drupal_get_destination();
}
}
return theme('links', array(
'links' => $links,
'attributes' => array(
'class' => array(
'links',
'inline',
'operations',
),
),
));
}
}