function views_get_default_view

Get a view from the default views defined by modules.

Default views are cached per-language. This function will rescan the default_views hook if necessary.

Parameters

$view_name: The name of the view to load.

Return value

A view object or NULL if it is not available.

1 call to views_get_default_view()
views_get_view in ./views.module
Get a view from the database or from default views.

File

./views.module, line 960

Code

function &views_get_default_view($view_name, $reset = FALSE) {
    $null = NULL;
    // Attempt to load individually cached view from cache.
    views_include('cache');
    if (!$reset) {
        $data = views_cache_get("views_default:{$view_name}", TRUE);
        if (isset($data->data) && is_object($data->data)) {
            return $data->data;
        }
    }
    // Otherwise, allow entire cache to be rebuilt.
    $cache = views_discover_default_views($reset);
    if (isset($cache[$view_name])) {
        return $cache[$view_name];
    }
    return $null;
}