function private_content_form_node_type_form_builder in Private 8.2
Same name and namespace in other branches
- 8 private_content.module \private_content_form_node_type_form_builder()
Entity builder for the node type form with private option.
See also
private_content_form_node_type_form_alter()
1 string reference to 'private_content_form_node_type_form_builder'
File
- ./
private_content.module, line 245 - A tremendously simple access control module -- it allows users to mark individual nodes as private; users with 'access private content' perms can read these nodes, while others cannot.
Code
function private_content_form_node_type_form_builder($entity_type, NodeTypeInterface $type, &$form, FormStateInterface $form_state) {
$existing = $type
->getThirdPartySetting('private_content', 'private');
$new = $form_state
->getValue('private');
$type
->setThirdPartySetting('private_content', 'private', $new);
if ($new != $existing) {
// @todo Skip this for new content type.
node_access_needs_rebuild(TRUE);
}
}