You are here

function taxonomy_views_atom_render_field in Views Atom 7

Implements hook_views_atom_render_field().

@todo, complete the upgrade of this function from 6 to 7.

File

./views_atom.module, line 252

Code

function taxonomy_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.
  if ($field_type == 'taxonomy_term_reference') {
    $l = 0;
    foreach ($field as $language_key => $field_language_instances) {
      foreach ($field_language_instances as $i => $instance) {
        if (!empty($instance['tid']) && ($term = taxonomy_term_load($instance['tid']))) {

          // @todo, discern what data is needed here.
          $new_column = $field_xml->{'language'}[$l]->{'field-instance'}[$i]
            ->addChild('column', $term->name);
          $new_column
            ->addAttribute('name', 'term_name');

          /*
                   // $term_path = url(taxonomy_term_path($term), array('absolute' => TRUE, 'alias' => TRUE));
          $vocabulary = taxonomy_vocabulary_load($term->vid);

          //$field_xml = $taxonomy_xml->addChild('term');
          $field_xml->addAttribute('name', $term->name);
          //$field_xml->addChild('link', $term_path);
          $field_xml->addChild('label', $term->name);
          $field_xml->addChild('title', $term->name);
          $field_xml->addChild('subject', $term->name);
          $field_xml->addChild('description', views_atom_sanitize($term->description));
          $field_xml->addChild('taxonomy_vocabulary', $vocabulary->name);
          */
        }
      }
      $l++;
    }
  }
}