You are here

function _filefield_paths_text_fields in File (Field) Paths 6

Get all text-based fields attached to node.

1 call to _filefield_paths_text_fields()
_filefield_paths_replace_pattern in ./filefield_paths.module
Run regular expression over all available text-based fields.

File

./filefield_paths.module, line 556
Contains core functions for the FileField Paths module.

Code

function _filefield_paths_text_fields($node) {
  $fields = array();

  // Get Node fields.
  if (isset($node->body)) {
    $fields += array(
      'body' => &$node->body,
      'teaser' => &$node->teaser,
    );
  }

  // Get CCK fields.
  if (module_exists('content')) {
    $content_type = content_types($node->type);
    foreach ($content_type['fields'] as $name => $field) {
      if ($field['type'] == 'text' && is_array($node->{$name})) {
        foreach ($node->{$name} as $key => $value) {
          if (isset($node->{$name}[$key]['value'])) {
            $fields["{$name}_{$key}"] =& $node->{$name}[$key]['value'];
          }
        }
      }
    }
  }
  return $fields;
}