? base-link3.patch
Index: handlers/views_handler_field.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/handlers/views_handler_field.inc,v
retrieving revision 1.5
diff -u -p -r1.5 views_handler_field.inc
--- handlers/views_handler_field.inc	16 Oct 2008 19:38:52 -0000	1.5
+++ handlers/views_handler_field.inc	30 Jan 2009 00:05:07 -0000
@@ -38,6 +38,16 @@ class views_handler_field extends views_
     }
   }
 
+  /**
+   * Determine if this field can allow advanced rendering.
+   *
+   * Fields can set this to FALSE if they do not wish to allow
+   * token based rewriting or link-making.
+   */
+  function allow_advanced_render() {
+    return TRUE;
+  }
+
   function init(&$view, $options) {
     parent::init($view, $options);
 
@@ -132,6 +142,22 @@ class views_handler_field extends views_
     $options = parent::option_definition();
 
     $options['label'] = array('default' => $this->definition['title'], 'translatable' => TRUE);
+    $options['alter'] = array(
+      'contains' => array(
+        'alter_text' => array('default' => FALSE),
+        'text' => array('default' => '', 'translatable' => TRUE),
+        'make_link' => array('default' => FALSE),
+        'path' => array('default' => '', 'translatable' => TRUE),
+        'alt' => array('default' => '', 'translatable' => TRUE),
+        'prefix' => array('default' => '', 'translatable' => TRUE),
+        'suffix' => array('default' => '', 'translatable' => TRUE),
+        'trim' => array('default' => FALSE),
+        'max_length' => array('default' => ''),
+        'word_boundary' => array('default' => TRUE),
+        'ellipsis' => array('default' => TRUE),
+        'html' => array('default' => FALSE),
+      ),
+    );
 
     return $options;
   }
@@ -153,6 +179,170 @@ class views_handler_field extends views_
       '#default_value' => $this->options['exclude'],
       '#description' => t('Check this box to not display this field, but still load it in the view.  Use this option to not show a grouping field in each record, or when doing advanced theming.'),
     );
+
+    if ($this->allow_advanced_render()) {
+      $form['alter']['#tree'] = TRUE;
+      $form['alter']['alter_text'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Rewrite the output of this field'),
+        '#description' => t('If checked, you can alter the output of this field by specifying a string of text with replacement tokens that can use any existing field output.'),
+        '#default_value' => $this->options['alter']['alter_text'],
+      );
+
+      $form['alter']['text'] = array(
+        '#title' => t('Text'),
+        '#type' => 'textfield',
+        '#default_value' => $this->options['alter']['text'],
+        '#description' => t('The text to display for this field. You may include HTML. You may enter data from this view as per the "Replacement patterns" below.'),
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-alter-text' => array(1)
+        ),
+      );
+
+      $form['alter']['make_link'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Output this field as a link'),
+        '#description' => t('If checked, this field will be made into a link. The destination must be given below.'),
+        '#default_value' => $this->options['alter']['make_link'],
+      );
+      $form['alter']['path'] = array(
+        '#title' => t('Link path'),
+        '#type' => 'textfield',
+        '#default_value' => $this->options['alter']['path'],
+        '#description' => t('The Drupal path or absolute URL for this link. You may enter data from this view as per the "Replacement patterns" below.'),
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-make-link' => array(1)
+        ),
+      );
+      $form['alter']['alt'] = array(
+        '#title' => t('Alt text'),
+        '#type' => 'textfield',
+        '#default_value' => $this->options['alter']['alt'],
+        '#description' => t('Text to place as "alt" text which most browsers display as a tooltip when hovering over the link.'),
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-make-link' => array(1)
+        ),
+      );
+      $form['alter']['prefix'] = array(
+        '#title' => t('Prefix text'),
+        '#type' => 'textfield',
+        '#default_value' => $this->options['alter']['prefix'],
+        '#description' => t('Any text to display before this link. You may include HTML.'),
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-make-link' => array(1)
+        ),
+      );
+      $form['alter']['suffix'] = array(
+        '#title' => t('Suffix text'),
+        '#type' => 'textfield',
+        '#default_value' => $this->options['alter']['suffix'],
+        '#description' => t('Any text to display after this link. You may include HTML.'),
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-make-link' => array(1)
+        ),
+      );
+
+      // Get a list of the available fields and arguments for token replacement.
+      $options = array();
+      foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {
+        $options[t('Fields')]["[$field]"] = $handler->ui_name();
+        // We only use fields up to (and including) this one.
+        if ($field == $this->options['id']) {
+          break;
+        }
+      }
+      $count = 0; // This lets us prepare the key as we want it printed.
+      foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
+        $options[t('Arguments')]['%' . ++$count] = $handler->ui_name();
+      }
+
+      // Default text.
+      $output = t('<p>You must add some additional fields to this display before using this field. These fields may be marked as <em>Exclude from display</em> if you prefer. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields.</p>');
+      // We have some options, so make a list.
+      if (!empty($options)) {
+        $output = t('<p>The following substitution patterns are available for this display. Use the pattern shown on the left to display the value indicated on the right. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields.</p>');
+        foreach (array_keys($options) as $type) {
+          if (!empty($options[$type])) {
+            $items = array();
+            $title = t(ucwords($type));
+            foreach ($options[$type] as $key => $value) {
+              $items[] = $key .' == '. $value;
+            }
+            $output .= theme('item_list', $items, $title);
+          }
+        }
+      }
+      // This construct uses 'hidden' and not markup because process doesn't
+      // run. It also has an extra div because the dependency wants to hide
+      // the parent in situations like this, so we need a second div to
+      // make this work.
+      $form['alter']['help'] = array(
+        '#type' => 'hidden',
+        '#id' => 'views-tokens-help',
+        '#prefix' => '<div><fieldset id="views-tokens-help"><legend>' . t('Replacement patterns') . '</legend>' . $output . '</fieldset></div>',
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-make-link' => array(1),
+          'edit-options-alter-alter-text' => array(1),
+        ),
+      );
+
+      $form['alter']['trim'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Trim this field to a maximum length'),
+        '#description' => t('If checked, this field be trimmed to a maximum length in characters.'),
+        '#default_value' => $this->options['alter']['trim'],
+      );
+
+      $form['alter']['max_length'] = array(
+        '#title' => t('Maximum length'),
+        '#type' => 'textfield',
+        '#default_value' => $this->options['alter']['max_length'],
+        '#description' => t('The maximum number of characters his field can be.'),
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-trim' => array(1)
+        ),
+      );
+
+      $form['alter']['word_boundary'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Trim only on a word boundary'),
+        '#description' => t('If checked, this field be trimmed only on a word boundary. This is guaranteed to be the maximum characters stated or less. If there are no word boundaries this could trim a field to nothing.'),
+        '#default_value' => $this->options['alter']['word_boundary'],
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-trim' => array(1)
+        ),
+      );
+
+      $form['alter']['ellipsis'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Add an ellipsis'),
+        '#description' => t('If checked, a "..." will be added if a field was trimmed.'),
+        '#default_value' => $this->options['alter']['ellipsis'],
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-trim' => array(1)
+        ),
+      );
+
+      $form['alter']['html'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Field can contain HTML'),
+        '#description' => t('If checked, HTML corrector will be run to ensure tags are properly closed after trimming.'),
+        '#default_value' => $this->options['alter']['html'],
+        '#process' => array('views_process_dependency'),
+        '#dependency' => array(
+          'edit-options-alter-trim' => array(1)
+        ),
+      );
+    }
   }
 
   /**
@@ -185,6 +375,163 @@ class views_handler_field extends views_
   }
 
   /**
+   * Render a field using advanced settings.
+   *
+   * This renders a field normally, then decides if render-as-link and
+   * text-replacement rendering is necessary.
+   */
+  function advanced_render($values) {
+    $this->last_render = $value = $this->render($values);
+    $this->original_value = $value;
+
+    $tokens = NULL;
+    if (!empty($this->options['alter']['alter_text']) && !empty($this->options['alter']['text'])) {
+      $tokens = $this->get_render_tokens();
+      $value = $this->render_altered($tokens);
+    }
+
+    if (!empty($this->options['alter']['trim']) && !empty($this->options['alter']['max_length'])) {
+      $value = $this->render_trim_text($value);
+    }
+
+    if (!empty($this->options['alter']['make_link']) && !empty($this->options['alter']['path'])) {
+      if (!isset($tokens)) {
+       $tokens = $this->get_render_tokens();
+      }
+      $value = $this->render_as_link($value, $tokens);
+    }
+
+    // This happens here so that render_link can get the unaltered value of
+    // this field as a token rather than the altered value.
+    $this->last_render = $value;
+
+    return $this->last_render;
+  }
+
+  /**
+   * Render this field as altered text, from a fieldset set by the user.
+   */
+  function render_altered($tokens) {
+    // Filter this right away as our substitutions are already sanitized.
+    $value = filter_xss_admin($this->options['alter']['text']);
+    $value = strtr($value, $tokens);
+
+    return $value;
+  }
+
+  /**
+   * Trim the field down to the specified length.
+   */
+  function render_trim_text($value) {
+    if (drupal_strlen($value) <= $this->options['alter']['max_length']) {
+      return $value;
+    }
+
+    $value = drupal_substr($value, 0, $this->options['alter']['max_length']);
+
+    if (!empty($this->options['alter']['word_boundary'])) {
+      if (preg_match ("/(.*)\b.+/u", $value, $matches)) {
+        $value = $matches[1];
+        // Strip spare space at the end.
+        $value = rtrim($value);
+      }
+    }
+
+    if (!empty($this->options['alter']['ellipsis'])) {
+      $value .= '...';
+    }
+
+    if (!empty($this->options['alter']['html'])) {
+      $value = _filter_htmlcorrector($value);
+    }
+
+    return $value;
+  }
+
+  /**
+   * Render this field as a link, with the info from a fieldset set by
+   * the user.
+   */
+  function render_as_link($text, $tokens) {
+    // $path will be run through check_url() by l() so we do not need to
+    // sanitize it ourselves.
+    $path = $this->options['alter']['path'];
+    $path = strtr($path, $tokens);
+
+    $alt = $this->options['alter']['alt'];
+    $alt = strtr($alt, $tokens);
+
+    $value = '';
+
+    if (!empty($this->options['alter']['prefix'])) {
+      $value .= filter_xss_admin($this->options['alter']['prefix']);
+    }
+
+    $options = array(
+      'html' => 'true',
+    );
+
+    if ($alt) {
+      $options['attributes']['title'] = $alt;
+      $options['attributes']['alt'] = $alt;
+    }
+
+    // These can only be set internally at this time.
+    if (isset($this->options['alter']['query'])) {
+      $options['query'] = $this->options['alter']['query'];
+    }
+    if (isset($this->options['alter']['fragment'])) {
+      $options['fragment'] = $this->options['alter']['fragment'];
+    }
+
+    $value .= l($text, $path, $options);
+
+    if (!empty($this->options['alter']['suffix'])) {
+      $value .= filter_xss_admin($this->options['alter']['suffix']);
+    }
+
+    return $value;
+  }
+
+  /**
+   * Get the 'render' tokens to use for advanced rendering.
+   *
+   * This runs through all of the fields and arguments that
+   * are available and gets their values. This will then be
+   * used in one giant str_replace().
+   */
+  function get_render_tokens() {
+    $tokens = array();
+    if (!empty($this->view->build_info['substitutions'])) {
+      $tokens = $this->view->build_info['substitutions'];
+    }
+    $count = 0;
+    foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
+      $token = '%' . ++$count;
+      if (!isset($tokens[$token])) {
+        $tokens[$token] = '';
+      }
+    }
+
+    // Now add replacements for our fields.
+    $options = array();
+    foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {
+      if (isset($handler->last_render)) {
+        $tokens["[$field]"] = $handler->last_render;
+      }
+      else {
+        $tokens["[$field]"] = '';
+      }
+      // We only use fields up to (and including) this one.
+      if ($field == $this->options['id']) {
+        break;
+      }
+    }
+
+    return $tokens;
+  }
+
+  /**
    * Call out to the theme() function, which probably just calls render() but
    * allows sites to override output fairly easily.
    */
Index: handlers/views_handler_field_boolean.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/handlers/views_handler_field_boolean.inc,v
retrieving revision 1.1
diff -u -p -r1.1 views_handler_field_boolean.inc
--- handlers/views_handler_field_boolean.inc	3 Sep 2008 19:21:28 -0000	1.1
+++ handlers/views_handler_field_boolean.inc	30 Jan 2009 00:05:07 -0000
@@ -1,5 +1,6 @@
 <?php
 // $Id: views_handler_field_boolean.inc,v 1.1 2008/09/03 19:21:28 merlinofchaos Exp $
+
 /**
  * A handler to provide proper displays for dates.
  *
Index: includes/handlers.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/handlers.inc,v
retrieving revision 1.104
diff -u -p -r1.104 handlers.inc
--- includes/handlers.inc	7 Jan 2009 23:31:12 -0000	1.104
+++ includes/handlers.inc	30 Jan 2009 00:05:08 -0000
@@ -1062,6 +1062,9 @@ function views_views_handlers() {
       'views_handler_field_numeric' => array(
         'parent' => 'views_handler_field',
       ),
+      'views_handler_field_custom' => array(
+        'parent' => 'views_handler_field',
+      ),
 
       // filter handlers
       'views_handler_filter' => array(
Index: includes/view.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/view.inc,v
retrieving revision 1.148
diff -u -p -r1.148 view.inc
--- includes/view.inc	27 Jan 2009 21:32:46 -0000	1.148
+++ includes/view.inc	30 Jan 2009 00:05:08 -0000
@@ -504,6 +504,9 @@ class view extends views_db_object {
       $this->build_info['title'] = str_replace(array_keys($substitutions), $substitutions, $title);
     }
 
+    // Store the arguments for later use.
+    $this->build_info['substitutions'] = $substitutions;
+
     return $status;
   }
 
@@ -793,6 +796,15 @@ class view extends views_db_object {
   }
 
   /**
+   * Render a specific field via the field ID and the row #.
+   */
+  function render_field($field, $row) {
+    if (isset($this->field[$field]) && isset($this->result[$row])) {
+      return $this->field[$field]->advanced_render($this->result[$row]);
+    }
+  }
+
+  /**
    * Execute the given display, with the given arguments.
    * To be called externally by whatever mechanism invokes the view,
    * such as a page callback, hook_block, etc.
Index: modules/views.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/views.views.inc,v
retrieving revision 1.5
diff -u -p -r1.5 views.views.inc
--- modules/views.views.inc	3 Sep 2008 19:21:29 -0000	1.5
+++ modules/views.views.inc	30 Jan 2009 00:05:08 -0000
@@ -19,6 +19,7 @@ function views_views_data() {
   $data['views']['table']['join'] = array(
     '#global' => array(),
   );
+
   $data['views']['random'] = array(
     'title' => t('Random'),
     'help' => t('Randomize the display order.'),
@@ -34,6 +35,15 @@ function views_views_data() {
       'handler' => 'views_handler_argument_null',
     ),
   );
+
+  $data['views']['nothing'] = array(
+    'title' => t('Custom text'),
+    'help' => t('Provide custom text or link.'),
+    'field' => array(
+      'handler' => 'views_handler_field_custom',
+    ),
+  );
+
   return $data;
 }
 
Index: modules/comment/views_handler_field_comment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/comment/views_handler_field_comment.inc,v
retrieving revision 1.3
diff -u -p -r1.3 views_handler_field_comment.inc
--- modules/comment/views_handler_field_comment.inc	19 Nov 2008 22:44:29 -0000	1.3
+++ modules/comment/views_handler_field_comment.inc	30 Jan 2009 00:05:08 -0000
@@ -28,6 +28,7 @@ class views_handler_field_comment extend
     parent::options_form($form, $form_state);
     $form['link_to_comment'] = array(
       '#title' => t('Link this field to its comment'),
+      '#description' => t('This will override any other link you have set.'),
       '#type' => 'checkbox',
       '#default_value' => $this->options['link_to_comment'],
     );
@@ -35,11 +36,12 @@ class views_handler_field_comment extend
 
   function render_link($data, $values) {
     if (!empty($this->options['link_to_comment']) && $data !== NULL && $data !== '') {
-      return l($data, "node/" . $values->{$this->aliases['nid']}, array('html' => TRUE, 'fragment' => "comment-" . $values->{$this->aliases['cid']}));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = $values->{$this->aliases['nid']};
+      $this->options['alter']['fragment'] = "comment-" . $values->{$this->aliases['cid']};
     }
+
+    return $data;
   }
 
   function render($values) {
Index: modules/comment/views_handler_field_comment_username.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/comment/views_handler_field_comment_username.inc,v
retrieving revision 1.1
diff -u -p -r1.1 views_handler_field_comment_username.inc
--- modules/comment/views_handler_field_comment_username.inc	3 Sep 2008 19:21:29 -0000	1.1
+++ modules/comment/views_handler_field_comment_username.inc	30 Jan 2009 00:05:08 -0000
@@ -29,11 +29,11 @@ class views_handler_field_comment_userna
   }
 
   function render_link($data, $values) {
-    $account->uid = $values->{$this->aliases['uid']};
-    $account->name = $values->{$this->field_alias};
-    $account->homepage = $values->{$this->aliases['homepage']};
-
     if (!empty($this->options['link_to_user'])) {
+      $account->uid = $values->{$this->aliases['uid']};
+      $account->name = $values->{$this->field_alias};
+      $account->homepage = $values->{$this->aliases['homepage']};
+
       return theme('username', $account);
     }
     else {
Index: modules/comment/views_handler_field_node_new_comments.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/comment/views_handler_field_node_new_comments.inc,v
retrieving revision 1.4
diff -u -p -r1.4 views_handler_field_node_new_comments.inc
--- modules/comment/views_handler_field_node_new_comments.inc	7 Jan 2009 20:10:25 -0000	1.4
+++ modules/comment/views_handler_field_node_new_comments.inc	30 Jan 2009 00:05:08 -0000
@@ -23,6 +23,7 @@ class views_handler_field_node_new_comme
     parent::options_form($form, $form_state);
     $form['link_to_comment'] = array(
       '#title' => t('Link this field to new comments'),
+      '#description' => t('This will override any other link you have set.'),
       '#type' => 'checkbox',
       '#default_value' => $this->options['link_to_comment'],
     );
@@ -74,11 +75,13 @@ class views_handler_field_node_new_comme
       $node = new stdClass();
       $node->nid = $values->{$this->aliases['nid']};
       $node->type = $values->{$this->aliases['type']};
-      return l($data, 'node/'. $node->nid, array('html' => TRUE, 'query' => comment_new_page_count($values->node_comment_statistics_comment_count, $values->node_new_comments, $node), 'fragment' => 'new'));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = 'node/' . $node->nid;
+      $this->options['alter']['query'] = comment_new_page_count($values->node_comment_statistics_comment_count, $values->node_new_comments, $node);
+      $this->options['alter']['fragument'] = 'new';
     }
+
+    return $data;
   }
 
   function render($values) {
Index: modules/node/views_handler_field_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/node/views_handler_field_node.inc,v
retrieving revision 1.2
diff -u -p -r1.2 views_handler_field_node.inc
--- modules/node/views_handler_field_node.inc	19 Nov 2008 22:44:29 -0000	1.2
+++ modules/node/views_handler_field_node.inc	30 Jan 2009 00:05:08 -0000
@@ -30,6 +30,7 @@ class views_handler_field_node extends v
     parent::options_form($form, $form_state);
     $form['link_to_node'] = array(
       '#title' => t('Link this field to its node'),
+      '#description' => t('This will override any other link you have set.'),
       '#type' => 'checkbox',
       '#default_value' => !empty($this->options['link_to_node']),
     );
@@ -42,11 +43,10 @@ class views_handler_field_node extends v
    */
   function render_link($data, $values) {
     if (!empty($this->options['link_to_node']) && $data !== NULL && $data !== '') {
-      return l($data, "node/" . $values->{$this->aliases['nid']}, array('html' => TRUE));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = "node/" . $values->{$this->aliases['nid']};
     }
+    return $data;
   }
 
   function render($values) {
Index: modules/system/views_handler_field_file.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/system/views_handler_field_file.inc,v
retrieving revision 1.2
diff -u -p -r1.2 views_handler_field_file.inc
--- modules/system/views_handler_field_file.inc	19 Nov 2008 22:44:29 -0000	1.2
+++ modules/system/views_handler_field_file.inc	30 Jan 2009 00:05:08 -0000
@@ -27,6 +27,7 @@ class views_handler_field_file extends v
     parent::options_form($form, $form_state);
     $form['link_to_file'] = array(
       '#title' => t('Link this field to download the file'),
+      '#description' => t('This will override any other link you have set.'),
       '#type' => 'checkbox',
       '#default_value' => !empty($this->options['link_to_file']),
     );
@@ -39,11 +40,11 @@ class views_handler_field_file extends v
    */
   function render_link($data, $values) {
     if (!empty($this->options['link_to_file']) && $data !== NULL && $data !== '') {
-      return l($data, file_create_url($values->{$this->aliases['filepath']}), array('html' => TRUE));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = file_create_url($values->{$this->aliases['filepath']});
     }
+
+    return $data;
   }
 
   function render($values) {
Index: modules/taxonomy/views_handler_field_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/taxonomy/views_handler_field_taxonomy.inc,v
retrieving revision 1.2
diff -u -p -r1.2 views_handler_field_taxonomy.inc
--- modules/taxonomy/views_handler_field_taxonomy.inc	19 Nov 2008 22:44:30 -0000	1.2
+++ modules/taxonomy/views_handler_field_taxonomy.inc	30 Jan 2009 00:05:08 -0000
@@ -31,6 +31,7 @@ class views_handler_field_taxonomy exten
     parent::options_form($form, $form_state);
     $form['link_to_taxonomy'] = array(
       '#title' => t('Link this field to its taxonomy term page'),
+      '#description' => t('This will override any other link you have set.'),
       '#type' => 'checkbox',
       '#default_value' => !empty($this->options['link_to_taxonomy']),
     );
@@ -46,12 +47,10 @@ class views_handler_field_taxonomy exten
       $term = new stdClass();
       $term->tid = $values->{$this->aliases['tid']};
       $term->vid = $values->{$this->aliases['vid']};
-
-      return l($data, taxonomy_term_path($term), array('html' => TRUE));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = taxonomy_term_path($term);
     }
+    return $data;
   }
 
   function render($values) {
Index: modules/upload/views_handler_field_upload_description.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/upload/views_handler_field_upload_description.inc,v
retrieving revision 1.2
diff -u -p -r1.2 views_handler_field_upload_description.inc
--- modules/upload/views_handler_field_upload_description.inc	19 Nov 2008 22:44:30 -0000	1.2
+++ modules/upload/views_handler_field_upload_description.inc	30 Jan 2009 00:05:08 -0000
@@ -63,10 +63,9 @@ class views_handler_field_upload_descrip
   function render_link($data, $value) {
     if (!empty($this->options['link_to_file']) && $value->{$this->aliases['fid']} && $data !== NULL && $data !== '') {
       $values = $this->items[$value->{$this->aliases['fid']}];
-      return l($data, file_create_url($values->filepath), array('html' => TRUE));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = file_create_url($values->filepath);
     }
+    return $data;
   }
 }
Index: modules/upload/views_handler_field_upload_fid.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/upload/views_handler_field_upload_fid.inc,v
retrieving revision 1.3
diff -u -p -r1.3 views_handler_field_upload_fid.inc
--- modules/upload/views_handler_field_upload_fid.inc	19 Nov 2008 22:44:30 -0000	1.3
+++ modules/upload/views_handler_field_upload_fid.inc	30 Jan 2009 00:05:08 -0000
@@ -59,10 +59,9 @@ class views_handler_field_upload_fid ext
    */
   function render_link($data, $values) {
     if (!empty($this->options['link_to_file']) && $data !== NULL && $data !== '') {
-      return l($data, file_create_url($values->filepath), array('html' => TRUE));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = file_create_url($values->filepath);
     }
+    return $data;
   }
 }
Index: modules/user/views_handler_field_user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/user/views_handler_field_user.inc,v
retrieving revision 1.2
diff -u -p -r1.2 views_handler_field_user.inc
--- modules/user/views_handler_field_user.inc	19 Nov 2008 22:44:30 -0000	1.2
+++ modules/user/views_handler_field_user.inc	30 Jan 2009 00:05:08 -0000
@@ -28,6 +28,7 @@ class views_handler_field_user extends v
     parent::options_form($form, $form_state);
     $form['link_to_user'] = array(
       '#title' => t('Link this field to its user'),
+      '#description' => t('This will override any other link you have set.'),
       '#type' => 'checkbox',
       '#default_value' => $this->options['link_to_user'],
     );
@@ -35,11 +36,10 @@ class views_handler_field_user extends v
 
   function render_link($data, $values) {
     if (!empty($this->options['link_to_user']) && user_access('access user profiles') && $values->{$this->aliases['uid']} && $data !== NULL && $data !== '') {
-      return l($data, "user/" . $values->{$this->aliases['uid']}, array('html' => TRUE));
-    }
-    else {
-      return $data;
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = "user/" . $values->{$this->aliases['uid']};
     }
+    return $data;
   }
 
   function render($values) {
Index: theme/theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/theme/theme.inc,v
retrieving revision 1.68
diff -u -p -r1.68 theme.inc
--- theme/theme.inc	28 Jan 2009 00:43:43 -0000	1.68
+++ theme/theme.inc	30 Jan 2009 00:05:09 -0000
@@ -201,7 +201,7 @@ function template_preprocess_views_view_
  * this: @code { $row->{$field->field_alias} @endcode
  */
 function theme_views_view_field($view, $field, $row) {
-  return $field->render($row);
+  return $field->advanced_render($row);
 }
 
 /**
@@ -209,10 +209,10 @@ function theme_views_view_field($view, $
  *
  * This preprocess function isn't normally run, as a function is used by
  * default, for performance. However, by creating a template, this
- * preprocess should get pickedup.
+ * preprocess should get picked up.
  */
 function template_preprocess_views_view_field(&$vars) {
-  $vars['output'] = $vars['field']->render($vars['row']);
+  $vars['output'] = $vars['field']->advanced_render($vars['row']);
 }
 
 /**
