function toc_filter_init in TOC filter 6
Same name and namespace in other branches
- 7 toc_filter.module \toc_filter_init()
Implementation of hook_init(). Adds toc_filter.css and toc_filter.js to every page.
File
- ./
toc_filter.module, line 10 - Converts header tags into a linked table of contents.
Code
function toc_filter_init() {
drupal_add_css(drupal_get_path('module', 'toc_filter') . '/toc_filter.css');
if (variable_get('toc_filter_smooth_scroll', '1')) {
drupal_add_js(drupal_get_path('module', 'toc_filter') . '/toc_filter.js');
$settings = array(
'toc_filter_smooth_scroll_duration' => variable_get('toc_filter_smooth_scroll_duration', ''),
);
drupal_add_js($settings, 'setting');
}
}