function content_generate_fields in Content Construction Kit (CCK) 5
Same name and namespace in other branches
- 6.3 includes/content.devel.inc \content_generate_fields()
- 6.2 includes/content.devel.inc \content_generate_fields()
Enrich the $node that is about to be saved with arbitrary information in each of its CCK fields.
1 call to content_generate_fields()
- content_nodeapi in ./
content.module - Implementation of hook_nodeapi().
File
- ./
content.devel.inc, line 10 - Functions needed for Devel module integration.
Code
function content_generate_fields(&$node) {
$type_name = $node->type;
$type = content_types($type_name);
$field_types = _content_field_types();
if (!empty($type['fields'])) {
foreach ($type['fields'] as $field) {
$node_field = array();
$module = $field_types[$field['type']]['module'];
$function = $module . '_content_generate';
if (function_exists($function)) {
$result = $function($node, $field);
// $items, $teaser, $page
$node_field = $result;
}
$node->{$field}['field_name'] = $node_field;
}
}
}