function views_handler_field::tokenize_value

cis7 views_handler_field.inc views_handler_field::tokenize_value($value, $row_index = NULL)
cle7 views_handler_field.inc views_handler_field::tokenize_value($value, $row_index = NULL)
elmsmedia7 views_handler_field.inc views_handler_field::tokenize_value($value, $row_index = NULL)
icor7 views_handler_field.inc views_handler_field::tokenize_value($value, $row_index = NULL)
meedjum_blog7 views_handler_field.inc views_handler_field::tokenize_value($value, $row_index = NULL)
mooc7 views_handler_field.inc views_handler_field::tokenize_value($value, $row_index = NULL)

Replace a value with tokens from the last field.

This function actually figures out which field was last and uses its tokens so they will all be available.

3 calls to views_handler_field::tokenize_value()
views_handler_field::element_classes in sites/all/modules/ulmus/views/handlers/views_handler_field.inc
Return the class of the field.
views_handler_field::element_label_classes in sites/all/modules/ulmus/views/handlers/views_handler_field.inc
Return the class of the field's label.
views_handler_field::element_wrapper_classes in sites/all/modules/ulmus/views/handlers/views_handler_field.inc
Return the class of the field's wrapper.

File

sites/all/modules/ulmus/views/handlers/views_handler_field.inc, line 307
@todo.

Class

views_handler_field
Base field handler that has no options and renders an unformatted field.

Code

function tokenize_value($value, $row_index = NULL) {
  if (strpos($value, '[') !== FALSE || strpos($value, '!') !== FALSE || strpos($value, '%') !== FALSE) {
    $fake_item = array(
      'alter_text' => TRUE,
      'text' => $value,
    );

    // Use isset() because empty() will trigger on 0 and 0 is
    // the first row.
    if (isset($row_index) && isset($this->view->style_plugin->render_tokens[$row_index])) {
      $tokens = $this->view->style_plugin->render_tokens[$row_index];
    }
    else {
      // Get tokens from the last field.
      $last_field = end($this->view->field);
      if (isset($last_field->last_tokens)) {
        $tokens = $last_field->last_tokens;
      }
      else {
        $tokens = $last_field->get_render_tokens($fake_item);
      }
    }

    $value = strip_tags($this->render_altered($fake_item, $tokens));
    if (!empty($this->options['alter']['trim_whitespace'])) {
      $value = trim($value);
    }
  }

  return $value;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.