You are here

function tvi_get_views in Taxonomy Views Integrator 7

Same name and namespace in other branches
  1. 6 includes/tvi.admin.inc \tvi_get_views()

Gather a listing of all views so that the admin may choose ANY view.

Parameters

bool $return_object: Define if we want the entire object or just the name of the view.

Return value

object|string The entire view object or just its name.

2 calls to tvi_get_views()
tvi_get_view_displays in includes/tvi.admin.inc
Gathers the available views display options.
tvi_taxonomy_admin_form in includes/tvi.admin.inc
The main TVI administration form.

File

includes/tvi.admin.inc, line 269
Administration functions for the tvi module.

Code

function tvi_get_views($return_object = FALSE) {
  $views = array();
  foreach (views_get_enabled_views() as $view) {

    // Filter views having no display.
    if (count($view->display) > 1) {
      if ($return_object) {
        $views[$view->name] = $view;
      }
      else {
        $views[$view->name] = $view->name;
      }
    }
  }
  return $views;
}