function _tableofcontents_block_form in Table of Contents 6.3
Same name and namespace in other branches
- 7 tableofcontents_block/tableofcontents_block.module \_tableofcontents_block_form()
Create a form to setup the Table of contents block.
1 call to _tableofcontents_block_form()
- tableofcontents_block_block in tableofcontents_block/
tableofcontents_block.module - Implementation of hook_block().
File
- tableofcontents_block/
tableofcontents_block.module, line 51 - main file for module providing a block
Code
function _tableofcontents_block_form() {
// we get the filter form
module_load_include('admin.inc', 'tableofcontents');
$filter_form = _tableofcontents_settings('block');
// then we change a few things
$form = $filter_form['tableofcontents'];
// adapt some messages
$form['tableofcontents_min_limit_block']['#title'] = t('Number of headers to show table of contents');
$form['tableofcontents_min_limit_block']['#description'] = t('The minimum number of headers before the table of contents is shown.');
// forced values are never shown to the user
unset($form['tableofcontents_on_off']);
// all the on/off are not handle-able in the block
unset($form['tableofcontents_security_options']);
// these are part of the filter only
unset($form['tableofcontents_back_to_top']);
// this is really only possible in the node at this point
unset($form['tableofcontents_numbering']['tableofcontents_number_headers_block']);
unset($form['tableofcontents_other']['tableofcontents_show_on_print_pages_block']);
return $form;
}