You are here

function tableofcontents_cache_get in Table of Contents 7.2

TOC cache management

1 call to tableofcontents_cache_get()
tableofcontents_field_attach_view_alter in ./tableofcontents.module
Implementation of hook_field_attach_view_alter(&$output, $context)

File

./tableofcontents.module, line 191
This is a filter module to generate a collapsible jquery enabled mediawiki style table of contents based on <h[1-6]> tags. Transforms header tags into named anchors.

Code

function tableofcontents_cache_get($entity_type, $bundle, $vid, $field, $raw) {
  $cid = tableofcontents_cache_key($entity_type, $bundle, $vid, $field, $raw);
  if ($cached = cache_get($cid, 'cache_tableofcontents')) {
    return $cached->data;
  }

  // We didn't find it, so the text may have changed,
  // remove any other version that may exist
  list($cid, ) = explode(':', $cid);
  db_delete('cache_tableofcontents')
    ->condition('cid', "{$cid}%", 'LIKE')
    ->execute();
  return FALSE;
}