You are here

function template_preprocess_views_view_views_atom_delete in Views Atom 6

Same name and namespace in other branches
  1. 7 views_atom.theme.inc \template_preprocess_views_view_views_atom_delete()

File

theme/views_atom.theme.inc, line 65

Code

function template_preprocess_views_view_views_atom_delete(&$vars) {
  global $user;

  // Inherit the base processing for all atom feeds.
  template_preprocess_views_view_views_atom($vars);
  $items = array();
  date_default_timezone_set(variable_get('date_default_timezone_name', 'America/New_York'));
  $now = date('c');
  $vars['updated'] = $now;
  $vars['items'] = array();
  $guid_options = isset($vars['view']->style_options['guid']) ? $vars['view']->style_options['guid'] : array();

  // Now process the rows into deletion information.
  foreach ($vars['rows'] as $i => $row) {
    $item = array(
      'guid' => views_atom_guid('node', $row->nid, $guid_options),
      'when' => $now,
      'by' => array(
        'name' => '',
        'email' => '',
      ),
    );
    if ($user->uid) {
      $item['by']['name'] = $user->name;
      $item['by']['email'] = $user->mail;
    }
    $vars['items'][] = $item;
  }

  // Set Headers

  //drupal_set_header('Content-Type:  text/plain; charset=utf-8');
}