You are here

public function bat_type_handler_type_operations_field::render in Booking and Availability Management Tools for Drupal 7

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

modules/bat_unit/views/bat_type_handler_type_operations_field.inc, line 34
This field handler aggregates operations that can be done on a type under a single field providing a more flexible way to present them in a view.

Class

bat_type_handler_type_operations_field

Code

public function render($values) {
  $links = menu_contextual_links('bat_unit', 'admin/bat/config/types/manage', array(
    $this
      ->get_value($values, 'type_id'),
  ));

  // Unset the "view" link, as this is provided separately.
  if (array_key_exists('bat_unit-view', $links)) {
    unset($links['bat_unit-view']);
  }
  if (!empty($links)) {
    return theme('links', array(
      'links' => $links,
      'attributes' => array(
        'class' => array(
          'links',
          'inline',
          'operations',
        ),
      ),
    ));
  }
}