function filefield_paths_get_fields in File (Field) Paths 6
Same name and namespace in other branches
- 5 filefield_paths.module \filefield_paths_get_fields()
2 calls to filefield_paths_get_fields()
- filefield_paths_comment in modules/
comment_upload.inc - Implements hook_comment().
- filefield_paths_node_update in ./
filefield_paths.module - Implements hook_node_update().
File
- ./
filefield_paths.module, line 454 - Contains core functions for the FileField Paths module.
Code
function filefield_paths_get_fields(&$node, $op = NULL) {
$ffp = array();
// Invoke hook_filefield_paths_get_fields().
foreach (module_implements('filefield_paths_get_fields') as $module) {
$function = "{$module}_filefield_paths_get_fields";
$function($node, $ffp);
}
if (count($ffp) == 0 || isset($ffp['#types']) && !is_array($ffp['#types'])) {
return FALSE;
}
$fields = module_invoke_all('filefield_paths_field_settings');
// Load fields settings
foreach ($ffp['#types'] as $name => $temp) {
$result = db_fetch_object(db_query("SELECT * FROM {filefield_paths} WHERE type = '%s' AND field = '%s'", $node->type, $name));
if (!empty($result)) {
foreach ($fields as $field) {
$ffp['#settings'][$name][$field['sql']] = unserialize($result->{$field}['sql']);
}
}
}
return $ffp;
}