function redirect_handler_field_redirect_source::render in Redirect 7.2
Same name and namespace in other branches
- 7 views/redirect_handler_field_redirect_source.inc \redirect_handler_field_redirect_source::render()
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides views_handler_field::render
File
- views/
redirect_handler_field_redirect_source.inc, line 48 - Redirect field handler for {redirect}.source.
Class
- redirect_handler_field_redirect_source
- @file Redirect field handler for {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;
}