You are here

function views_get_view in Views (for Drupal 7) 5

Same name and namespace in other branches
  1. 8.3 views.module \views_get_view()
  2. 6.3 views.module \views_get_view()
  3. 6.2 views.module \views_get_view()
  4. 7.3 views.module \views_get_view()

This function loads a view by name or vid; if not found in db, it looks for a default view by that name.

9 calls to views_get_view()
theme_view in ./views.module
Returns a themed view.
views_create_view_code in ./views_ui.module
views_menu_admin_items in ./views.module
Add the adminstrative items to a view.
views_menu_inline_items in ./views.module
views_theme_wizard_form in ./views_theme_wizard.module

... See full list

File

./views.module, line 370

Code

function views_get_view($view_name) {
  views_load_cache();
  $view = _views_load_view($view_name);
  if ($view) {
    return $view;
  }
  if (is_int($view_name)) {
    return;

    // don't bother looking if view_name is an int!
  }
  $default_views = _views_get_default_views();
  if (isset($default_views[$view_name])) {
    $view = $default_views[$view_name];
    $view->is_cacheable = _views_is_cacheable($view);
    return $view;
  }
}