summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_field_url.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_field_url.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_field_url.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_field_url.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_field_url.inc
index 2491f35..4a76548 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_field_url.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_field_url.inc
@@ -1,6 +1,11 @@
<?php
/**
+ * @file
+ * Definition of views_handler_field_url.
+ */
+
+/**
* Field handler to provide simple renderer that turns a URL into a clickable link.
*
* @ingroup views_field_handlers
@@ -9,7 +14,7 @@ class views_handler_field_url extends views_handler_field {
function option_definition() {
$options = parent::option_definition();
- $options['display_as_link'] = array('default' => TRUE);
+ $options['display_as_link'] = array('default' => TRUE, 'bool' => TRUE);
return $options;
}
@@ -29,7 +34,10 @@ class views_handler_field_url extends views_handler_field {
function render($values) {
$value = $this->get_value($values);
if (!empty($this->options['display_as_link'])) {
- return l($this->sanitize_value($value), $value, array('html' => TRUE));
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = $value;
+ $text = !empty($this->options['text']) ? $this->sanitize_value($this->options['text']) : $this->sanitize_value($value, 'url');
+ return $text;
}
else {
return $this->sanitize_value($value, 'url');