You are here

function views_atom_get_feed_displays in Views Atom 6

Same name and namespace in other branches
  1. 7 views_atom.module \views_atom_get_feed_displays()

Returns an array containing information about all Feed displays in the system.

Return value

array An array of descriptive arrays about the available feed displays.

2 calls to views_atom_get_feed_displays()
views_atom_rules_action_add_nids_to_feed_form in ./views_atom.rules.inc
Form callback for the viws_atom_rules_action_add_to_feed action.
views_atom_rules_action_add_to_feed_form in ./views_atom.rules.inc
Form callback for the views_atom_rules_action_add_to_feed action.

File

./views_atom.module, line 42

Code

function views_atom_get_feed_displays() {
  static $used_views = array();
  if (empty($used_views)) {
    views_include('cache');
    $cache = views_cache_get("views_atom:feeds");
    if (isset($cache->data)) {
      $used_views = $cache->data;
    }
    else {
      $views = views_get_all_views();
      foreach ($views as $view) {
        foreach ($view->display as $display_id => $display) {
          if ($display->display_plugin == 'feed') {
            $title = $view
              ->get_title();
            if (!$title) {
              $title = $view->name;
            }
            $used_views[] = array(
              'name' => $view->name,
              'display' => $display_id,
              'title' => $title,
              'display_title' => $display->display_title,
            );
          }
        }
        $view
          ->destroy();
      }
      views_cache_set("views_atom:feeds", $used_views);
    }
  }
  return $used_views;
}