You are here

function redirect_handler_field_redirect_redirect::render in Redirect 7

Same name and namespace in other branches
  1. 7.2 views/redirect_handler_field_redirect_redirect.inc \redirect_handler_field_redirect_redirect::render()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

views/redirect_handler_field_redirect_redirect.inc, line 48
Redirect field handler for {redirect}.redirect.

Class

redirect_handler_field_redirect_redirect
@file Redirect field handler for {redirect}.redirect.

Code

function render($values) {
  $redirect = $values->{$this->aliases['redirect']};
  $redirect_options = unserialize($values->{$this->aliases['redirect_options']});
  $redirect_options['absolute'] = !empty($this->options['absolute']);
  $url = redirect_url($redirect, $redirect_options);
  $text = !empty($this->options['text']) ? $this->options['text'] : $url;
  if (!empty($this->options['alter']['make_link'])) {
    $this->options['alter']['path'] = $url;
    $this->options['alter']['absolute'] = $redirect_options['absolute'];
  }
  else {
    $text = check_plain($text);
  }
  return $text;
}