You are here

function fb_instant_articles_form_node_type_form_builder in Facebook Instant Articles 3.x

Same name and namespace in other branches
  1. 8.2 fb_instant_articles.module \fb_instant_articles_form_node_type_form_builder()

Entity builder for the node type form with the FBIA toggle.

See also

fb_instant_articles_form_node_type_form_alter()

1 string reference to 'fb_instant_articles_form_node_type_form_builder'
fb_instant_articles_form_node_type_form_alter in ./fb_instant_articles.module
Implements hook_form_FORM_ID_alter() for \Drupal\node\NodeTypeForm.

File

./fb_instant_articles.module, line 126
Contains fb_instant_articles.module..

Code

function fb_instant_articles_form_node_type_form_builder($entity_type, NodeTypeInterface $type, &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('fb_instant_articles_enabled') === 1) {
    $type
      ->setThirdPartySetting('fb_instant_articles', 'fb_instant_articles_enabled', 1);
  }
  else {
    $type
      ->unsetThirdPartySetting('fb_instant_articles', 'fb_instant_articles_enabled');
  }
}