You are here

function template_preprocess_views_view_views_atom in Views Atom 7

Same name and namespace in other branches
  1. 6 theme/views_atom.theme.inc \template_preprocess_views_view_views_atom()
2 calls to template_preprocess_views_view_views_atom()
template_preprocess_views_view_views_atom_delete in ./views_atom.theme.inc
template_preprocess_views_view_views_atom_fields in ./views_atom.theme.inc

File

./views_atom.theme.inc, line 4

Code

function template_preprocess_views_view_views_atom(&$vars) {
  $view = $vars['view'];
  $options = $view->style_options;

  // Set basic info about the feed.
  $vars['view_title'] = variable_get('site_name', 'Drupal') . ' | ' . $view
    ->get_title();
  $vars['description'] = !empty($options['description']['feed_description']) ? $options['description']['feed_description'] : variable_get('site_mission', '');
  global $base_url;

  // This is the URL of the feed itself
  $vars['link'] = $base_url . $_SERVER['REQUEST_URI'];
  $vars['id'] = $base_url . $_SERVER['REQUEST_URI'];
  $vars['site_name'] = variable_get('site_name', 'Drupal');

  // If the push_hub module is enabled, we want to enable PuSH functionality
  // for this feed, too.
  $vars['use_push'] = FALSE;
  if (module_exists('push_hub')) {
    $vars['use_push'] = TRUE;

    // This is the URL that subscribers should contact to register as subscribers.
    $vars['hub_url'] = url('pubsubhubbub/endpoint', array(
      'absolute' => TRUE,
    ));

    // This is the URL of the feed itself.
    $vars['feed_url'] = filter_xss_admin('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
  }
}