You are here

function _tableofcontents_load in Table of Contents 6.3

Same name and namespace in other branches
  1. 7 tableofcontents.module \_tableofcontents_load()

Load the extra data for the node from the TOC table.

1 call to _tableofcontents_load()
tableofcontents_nodeapi in ./tableofcontents.module
Implementation of hook_nodeapi

File

./tableofcontents.module, line 157
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_load(&$node) {
  $sql = "SELECT toc_automatic FROM {tableofcontents_node_toc} WHERE nid = %d";
  $result = db_query($sql, $node->nid);
  if ($toc = db_fetch_object($result)) {
    $node->tableofcontents_toc_automatic = $toc->toc_automatic;
  }
  else {
    $node->tableofcontents_toc_automatic = 0;
  }
}