function track_field_changes_node_insert in Track Field Changes 7
Implements hook_node_insert().
File
- ./
track_field_changes.module, line 55 - The Track Field Changes module.
Code
function track_field_changes_node_insert($node) {
// Each node type which are audited.
$node_types = variable_get('track_field_changes_node_types', array());
// If content type is audited.
if (in_array($node->type, $node_types)) {
// Basic or/and advanced audit.
$basic_audit = variable_get('track_field_changes_basic_new_' . $node->type, FALSE);
// Get log.
$log = isset($node->track_field_changes) ? $node->track_field_changes : '';
if ($basic_audit) {
track_field_changes_insert_db($node->nid, 'log', '', '', 'bn', $log);
}
}
}