You are here

function toc_js_form_node_type_form_builder in Toc.js 8

Same name and namespace in other branches
  1. 2.0.x toc_js.module \toc_js_form_node_type_form_builder()

Entity builder for the node type form with TOC node option.

1 string reference to 'toc_js_form_node_type_form_builder'
toc_js_form_node_type_form_alter in ./toc_js.module
Implements hook_form_FORM_ID_alter().

File

./toc_js.module, line 385
Contains toc_js.module.

Code

function toc_js_form_node_type_form_builder($entity_type, NodeTypeInterface $type, &$form, FormStateInterface $form_state) {
  $type
    ->setThirdPartySetting('toc_js', 'toc_js_active', $form_state
    ->getValue('toc_js_active'));
  $type
    ->setThirdPartySetting('toc_js', 'title', $form_state
    ->getValue('title'));
  $type
    ->setThirdPartySetting('toc_js', 'selectors', $form_state
    ->getValue('selectors'));
  $type
    ->setThirdPartySetting('toc_js', 'selectors_minimum', $form_state
    ->getValue('selectors_minimum'));
  $type
    ->setThirdPartySetting('toc_js', 'container', $form_state
    ->getValue('container'));
  $type
    ->setThirdPartySetting('toc_js', 'list_type', $form_state
    ->getValue('list_type'));
  $type
    ->setThirdPartySetting('toc_js', 'smooth_scrolling', $form_state
    ->getValue('smooth_scrolling'));
  $type
    ->setThirdPartySetting('toc_js', 'scroll_to_offset', $form_state
    ->getValue('scroll_to_offset'));
  $type
    ->setThirdPartySetting('toc_js', 'prefix', $form_state
    ->getValue('prefix'));
  $type
    ->setThirdPartySetting('toc_js', 'back_to_top', $form_state
    ->getValue('back_to_top'));
  $type
    ->setThirdPartySetting('toc_js', 'back_to_top_label', $form_state
    ->getValue('back_to_top_label'));
  $type
    ->setThirdPartySetting('toc_js', 'highlight_on_scroll', $form_state
    ->getValue('highlight_on_scroll'));
  $type
    ->setThirdPartySetting('toc_js', 'highlight_offset', $form_state
    ->getValue('highlight_offset'));
  $type
    ->setThirdPartySetting('toc_js', 'sticky', $form_state
    ->getValue('sticky'));
  $type
    ->setThirdPartySetting('toc_js', 'sticky_offset', $form_state
    ->getValue('sticky_offset'));
  $type
    ->setThirdPartySetting('toc_js', 'sticky_stop', $form_state
    ->getValue('sticky_stop'));
  $type
    ->setThirdPartySetting('toc_js', 'sticky_stop_padding', $form_state
    ->getValue('sticky_stop_padding'));
}