You are here

function views_plugin_style_atom_fields::map_rows in Views Atom 7

Same name and namespace in other branches
  1. 6 views/views_plugin_style_atom_fields.inc \views_plugin_style_atom_fields::map_rows()

File

./views_plugin_style_atom_fields.inc, line 194
Style plugin for a standard Atom feed.

Class

views_plugin_style_atom_fields
@file Style plugin for a standard Atom feed.

Code

function map_rows($rows) {

  // Fields must be rendered in order as of Views 2.3, so we will pre-render everything.
  $renders = array();
  $keys = array_keys($this->view->field);
  foreach ($rows as $count => $row) {
    foreach ($keys as $id) {
      $renders[$count][$id] = $this->view->field[$id]
        ->theme($row);
    }
  }
  $items = array();
  foreach ($renders as $id => $row) {
    $item = array();
    foreach ($this->options['fields'] as $key => $val) {
      if (!isset($this->view->field[$val])) {
        continue;
      }
      $item[$key] = htmlentities($row[$val], ENT_QUOTES, '', FALSE);
    }
    $items[] = $item;
  }
  return $items;
}