function filebrowser_node_builder in Filebrowser 8.2
Same name and namespace in other branches
- 3.x filebrowser.module \filebrowser_node_builder()
Entity form builder to add the filebrowser information to the node.
Parameters
Entity\EntityTypeBundleInfo $entity_type:
NodeInterface $entity:
FormStateInterface $form_state:
array $form:
1 string reference to 'filebrowser_node_builder'
- filebrowser_form_node_form_alter in ./
filebrowser.module - Whe can define the filebrowser fields for node dir_listing. but for the time we won't use this. We will continue to use hook_form_alter due to the the complexity of updating.
File
- ./
filebrowser.module, line 137
Code
function filebrowser_node_builder($entity_type, NodeInterface $entity, &$form, FormStateInterface $form_state) {
$entity->filebrowser = new Filebrowser($form_state
->getValue('filebrowser'));
// Always save a revision for non-administrators.
if (!empty($entity->filebrowser->nid) && !\Drupal::currentUser()
->hasPermission('administer nodes')) {
// $entity->setNewRevision();
}
}