function tableofcontents_form_alter in Table of Contents 7
Same name and namespace in other branches
- 6.3 tableofcontents.module \tableofcontents_form_alter()
- 7.2 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 286 - 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') {
module_load_include('admin.inc', 'tableofcontents');
_tableofcontents_nodetype_form_alter($form);
}
elseif ($form_id == 'filter_admin_format_form') {
$form['#submit'][] = '_tableofcontents_settings_submit';
}
}
}