You are here

function _file_views_atom_render_field in Views Atom 7

Helper function for hook_views_atom_render_field().

Drupal 7 splits image and file fields. However, the needed hook logic is the same for both.

2 calls to _file_views_atom_render_field()
file_views_atom_render_field in ./views_atom.module
Implements hook_views_atom_render_field().
image_views_atom_render_field in ./views_atom.module
Implements hook_views_atom_render_field().

File

./views_atom.module, line 230

Code

function _file_views_atom_render_field(SimpleXMLElement $field_xml, $field, $field_type) {

  // For filefields, also encode the complete URL to the file so that it can be
  // pulled by the remote system.
  // $language counter
  $l = 0;
  foreach ($field as $language_key => $field_language_instances) {
    foreach ($field_language_instances as $i => $instance) {
      $url = file_create_url($instance['uri']);
      $new_column = $field_xml->{'language'}[$l]->{'field-instance'}[$i]
        ->addChild('column', $url);
      $new_column
        ->addAttribute('name', 'full_url');
    }
    $l++;
  }
}