You are here

function views_atom_get_feed_displays in Views Atom 7

Same name and namespace in other branches
  1. 6 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.

1 call to views_atom_get_feed_displays()
views_atom_get_feed_displays_options in ./views_atom.rules.inc
Returns views_atom displays in a form usable for Rules forms.

File

./views_atom.module, line 59

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;
}