You are here

function commerce_recurring_handler_field_order_operations::render in Commerce Recurring Framework 7.2

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

commerce_recurring_ui/includes/views/handlers/commerce_recurring_handler_field_order_operations.inc, line 36

Class

commerce_recurring_handler_field_order_operations
Field handler to present commerce recurring operations links.

Code

function render($values) {
  $recurring_id = $this
    ->get_value($values, 'id');

  // Get the operations links.
  $links = menu_contextual_links('commerce-recurring', 'admin/commerce/recurring-entities', array(
    $recurring_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(
          'commerce-recurring-edit',
          'commerce-recurring-delete',
        ))) {
          $link['query'] = drupal_get_destination();
        }
      }
    }
    return theme('links', array(
      'links' => $links,
      'attributes' => array(
        'class' => array(
          'links',
          'inline',
          'operations',
        ),
      ),
    ));
  }
}