You are here

function views_handler_field_block_cache::render in Views Hacks 7

Same name and namespace in other branches
  1. 6 views_block/handlers/views_handler_field_block_cache.inc \views_handler_field_block_cache::render()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

views_block/handlers/views_handler_field_block_cache.inc, line 4

Class

views_handler_field_block_cache

Code

function render($values) {
  $cache = $values->{$this->field_alias};
  if ($cache == DRUPAL_NO_CACHE) {
    return 'DRUPAL_NO_CACHE';
  }
  $caches = array(
    DRUPAL_CACHE_PER_ROLE => 'DRUPAL_CACHE_PER_ROLE',
    DRUPAL_CACHE_PER_USER => 'DRUPAL_CACHE_PER_USER',
    DRUPAL_CACHE_PER_PAGE => 'DRUPAL_CACHE_PER_PAGE',
    DRUPAL_CACHE_GLOBAL => 'DRUPAL_CACHE_GLOBAL',
  );
  $result = array();
  foreach ($caches as $bit => $string) {
    if (($cache & $bit) > 0) {
      $result[] = $string;
    }
  }
  return implode("\n", $result);
}