views_get_view

contributions/views/views.module, line 840

Versions
6
views_get_view($name, $reset = FALSE)
5
views_get_view($view_name)

Get a view from the database or from default views.

This function is just a static wrapper around views::load(). This function isn't called 'views_load()' primarily because it might get a view from the default views which aren't technically loaded from the database.

Parameters

$name The name of the view.

$reset If TRUE, reset this entry in the load cache.

Return value

$view A reference to the $view object. Use $reset if you're sure you want a fresh one.

▾ 30 functions call views_get_view()

custompage_view_tile in contributions/custompage/custompage_util.inc
Render a custompage tile for a view.
date_embed_view in contributions/date/date_api.module
Embed a view using a PHP snippet.
flag_update_6003 in contributions/flag/flag.install
Remove the previous default views that are no longer bundled with Flag.
img_assist_thumbs in contributions/img_assist/img_assist.module
Load the thumbnail display pane.
og_views_feed in contributions/og/og_views/og_views.module
Menu callback. Render group feed.
signup_user_list_page in contributions/signup/includes/node_output.inc
Helper function to generate the list of users signed up for a node.
views_ajax in contributions/views/includes/ajax.inc
Menu callback to load a view via AJAX.
views_arg_load in contributions/views/views.module
Helper function for menu loading. This will automatically be called in order to 'load' a views argument; primarily it will be used to perform validation.
views_block in contributions/views/views.module
Implementation of hook_block
views_calc_update_1 in contributions/views_calc/views_calc.install
Convert the queryname stored in the variable to the fullname so we can access both the fieldname and the tablename from the selections.
views_content_views_content_type_admin_info in contributions/ctools/views_content/plugins/content_types/views.inc
Returns the administrative title for a type.
views_content_views_content_type_admin_title in contributions/ctools/views_content/plugins/content_types/views.inc
Returns the administrative title for a type.
views_content_views_content_type_content_type in contributions/ctools/views_content/plugins/content_types/views.inc
Return a single content type.
views_content_views_content_type_edit_form in contributions/ctools/views_content/plugins/content_types/views.inc
Returns an edit form for a block.
views_content_views_content_type_render in contributions/ctools/views_content/plugins/content_types/views.inc
Output function for the 'views' content type.
views_content_views_panes_content_type_admin_title in contributions/ctools/views_content/plugins/content_types/views_panes.inc
Returns the administrative title for a type.
views_content_views_panes_content_type_content_type in contributions/ctools/views_content/plugins/content_types/views_panes.inc
Return a single content type.
views_content_views_panes_content_type_edit_form in contributions/ctools/views_content/plugins/content_types/views_panes.inc
Returns an edit form for a block.
views_content_views_panes_content_type_render in contributions/ctools/views_content/plugins/content_types/views_panes.inc
Output function for the 'views' content type.
views_content_views_select_display in contributions/ctools/views_content/plugins/content_types/views.inc
Returns an edit form for a block.
views_embed_view in contributions/views/views.module
Embed a view using a PHP snippet.
views_get_view in contributions/views/views.module
Get a view from the database or from default views.
views_page in contributions/views/views.module
Page callback entry point; requires a view and a display id, then passes control to the display handler.
views_ui_add_form_validate in contributions/views/includes/admin.inc
Validate the add view form.
views_ui_cache_load in contributions/views/views_ui.module
Specialized menu callback to load a view either out of the cache or just load it.
views_ui_default_load in contributions/views/views_ui.module
Specialized menu callback to load a view that is only a default view.
views_ui_import_validate in contributions/views/includes/admin.inc
Validate handler to import a view
_calendar_ical_setup_form in contributions/calendar/calendar_ical/calendar_ical_admin.inc
Setup Calendar feeds.
_nodereference_potential_references_views in contributions/cck/modules/nodereference/nodereference.module
Helper function for _nodereference_potential_references(): case of Views-defined referenceable nodes.
_userreference_potential_references_views in contributions/cck/modules/userreference/userreference.module
Helper function for _userreference_potential_references(): case of Views-defined referenceable users.

Code

<?php
function views_get_view($name, $reset = FALSE) {
  views_include('view');
  $view = view::load($name, $reset);
  $default_view = views_get_default_view($name);

  if (empty($view) && empty($default_view)) {
    return;
  }
  elseif (empty($view) && !empty($default_view)) {
    $default_view->type = t('Default');
    return $default_view->clone_view();
  }
  elseif (!empty($view) && !empty($default_view)) {
    $view->type = t('Overridden');
  }

  return $view->clone_view();
}
?>