You are here

function course_form_node_type_edit_form_builder in Course 8.2

Same name and namespace in other branches
  1. 8.3 course.module \course_form_node_type_edit_form_builder()
  2. 3.x course.module \course_form_node_type_edit_form_builder()

Set third party course setting on form submit.

1 string reference to 'course_form_node_type_edit_form_builder'
course_form_node_type_form_alter in ./course.module
Implements hook_form_FORM_ID_alter().

File

./course.module, line 342
course.module Core functionality for Courses.

Code

function course_form_node_type_edit_form_builder($entity_type, NodeType $node_type, &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('course_enabled')) {
    $node_type
      ->setThirdPartySetting('course', 'enabled', $form_state
      ->getValue('course_enabled'));
    return;
  }
  $node_type
    ->unsetThirdPartySetting('course', 'enabled');
}