You are here

function colorbox_node_handler_field_colorbox_node_link::render_link in Colorbox Node 7.2

Same name and namespace in other branches
  1. 7.3 views/colorbox_node_handler_field_colorbox_node_link.inc \colorbox_node_handler_field_colorbox_node_link::render_link()

Apply our colorbox-node class and add our widths and heights to the query params.

Overrides views_handler_field_node_link::render_link

File

views/colorbox_node_handler_field_colorbox_node_link.inc, line 67
Views handlers for Colorbox Node module.

Class

colorbox_node_handler_field_colorbox_node_link
A handler to provide a field that is completely custom by the administrator.

Code

function render_link($node, $values) {
  if (node_access('view', $node)) {
    if (!empty($this->options['node_in_colorbox'])) {
      $this->options['alter']['link_class'] = 'colorbox-node';
      $this->options['alter']['query'] = array(
        'width' => $this->options['node_in_colorbox_width'],
        'height' => $this->options['node_in_colorbox_height'],
      );
    }
  }
  return parent::render_link($node, $values);
}