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

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

core/modules/redirect/views/redirect_handler_field_redirect_source.inc, line 53
Redirect field handler for {redirect}.source.

Class

redirect_handler_field_redirect_source

Code

function render($values) {
  $source = $values->{$this->aliases['source']};
  $source_options = unserialize($values->{$this->aliases['source_options']});
  $source_options['absolute'] = !empty($this->options['absolute']);

  $url = redirect_url($source, $source_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'] = $source_options['absolute'];
  }
  else {
    $text = check_plain($text);
  }

  return $text;
}