1 views_handler_field_contextual_links.inc views_handler_field_contextual_links::render($values)

Render the contextual fields.

Overrides views_handler_field_links::render

File

core/modules/views/handlers/views_handler_field_contextual_links.inc, line 38
Definition of views_handler_field_contextual_links.

Class

views_handler_field_contextual_links
Provides a handler that adds contextual links.

Code

function render($values) {
  $links = $this->get_links();
  if (!empty($links)) {
    $build = array(
      '#prefix' => '<div class="contextual-links-wrapper">',
      '#suffix' => '</div>',
      '#theme' => 'links__contextual',
      '#links' => $links,
      '#attributes' => array('class' => array('contextual-links')),
      '#attached' => array(
        'library' => array(array('contextual', 'contextual-links')),
      ),
      '#access' => user_access('access contextual links'),
    );
    return backdrop_render($build);
  }
  else {
    return '';
  }
}