You are here

function tableofcontents_form_alter in Table of Contents 6.3

Same name and namespace in other branches
  1. 7.2 tableofcontents.module \tableofcontents_form_alter()
  2. 7 tableofcontents.module \tableofcontents_form_alter()

Add a field in nodes so one can mark the node as using a TOC without the need for the [toc] tag.

File

./tableofcontents.module, line 260
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_form_alter(&$form, $form_state, $form_id) {
  if (!$form_state['submitted']) {
    if (substr($form_id, -10) == '_node_form' && isset($form['nid'])) {
      module_load_include('admin.inc', 'tableofcontents');
      _tableofcontents_node_form_alter($form);
    }
    elseif ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
      module_load_include('admin.inc', 'tableofcontents');
      _tableofcontents_nodetype_form_alter($form);
    }
  }
}