function filefield_paths_node_update in File (Field) Paths 6.2
Same name and namespace in other branches
- 6 filefield_paths.module \filefield_paths_node_update()
Implements hook_node_update().
1 call to filefield_paths_node_update()
- filefield_paths_node_insert in ./
filefield_paths.module - Implements hook_node_insert().
File
- ./
filefield_paths.module, line 160 - Contains core functions for the FileField Paths module.
Code
function filefield_paths_node_update(&$node) {
$files = array();
$content_type = content_types($node->type);
foreach ($content_type['fields'] as $field) {
if ($field['type'] == 'filefield' && is_array($node->{$field}['field_name'])) {
foreach ($node->{$field['field_name']} as $count => &$file) {
if (is_array($file) && !empty($file['filepath']) && _filefield_paths_process_file_check($file, $field)) {
filefield_paths_process_file($file, $field['widget'], $node);
}
}
}
}
//node_save($node);
//_content_field_invoke_default('update', $node);
// // Re-write node entry if required.
// if ($update->node == TRUE) {
// global $user;
//
// drupal_write_record('node', $node, 'nid');
// _node_save_revision($node, $user->uid, 'vid');
// }
//
// // Re-write cck fields.
// if (module_exists('content')) {
// _content_field_invoke_default('update', $node);
// cache_clear_all('content:'. $node->nid . ':' . $node->vid, content_cache_tablename());
// }
}