function node_field_value_fields_form in Node Field 7.2
Build node fields form for node.
Parameters
object $node: Node to build form for.
array $node_fields: Node fields which will be on the form.
Return value
array Returned node fields form.
1 call to node_field_value_fields_form()
- node_field_node_form_edit in includes/
node_field.form.inc - Add node fields to node edit form.
File
- includes/
node_field.form.inc, line 34 - Forms for node_field module.
Code
function node_field_value_fields_form($node, array $node_fields, &$form_state) {
$form = [
'#type' => 'fieldset',
'#title' => t('Node fields'),
'#tree' => TRUE,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
];
foreach ($node_fields as $field) {
$widget = node_field_node_field_widget_form($field, $form_state);
drupal_alter('node_field_value_form', $field, $widget, $node);
$form[$field['id']] = $widget;
}
return $form;
}