function merci_reservation_handler_field_operations::render in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides views_handler_field::render
File
- merci_reservation/
includes/ views/ handlers/ merci_reservation_handler_field_operations.inc, line 36
Class
- merci_reservation_handler_field_operations
- Field handler to present an order's operations links.
Code
function render($values) {
$id = $this
->get_value($values, 'id');
// Get the operations links.
$links = menu_contextual_links('merci_reservation', 'merci_reservation', array(
$id,
));
$links['merci_reservation-view'] = menu_get_item('merci_reservation/' . $id);
if (!empty($links)) {
// Add the destination to the links if specified.
if ($this->options['add_destination']) {
foreach ($links as $id => &$link) {
// Only include the destination for the edit and delete forms.
if (in_array($id, array(
'merci_reservation-edit',
'merci_reservation-delete',
'merci_reservation-view',
))) {
$link['query'] = drupal_get_destination();
}
if ($id == 'merci_reservation-view') {
$link['title'] = 'View';
$link['weight'] = -2;
}
}
}
uasort($links, 'drupal_sort_weight');
//drupal_add_css(drupal_get_path('module', 'commerce_order') . '/theme/commerce_order.admin.css');
return theme('links', array(
'links' => $links,
'attributes' => array(
'class' => array(
'links',
'inline',
'operations',
),
),
));
}
}