views_get_view

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

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.

▾ 66 functions call views_get_view()

calendar_remove in contributions/calendar/calendar.module
Callback to remove a default calendar from the system.
category_views_render_nodes in contributions/category/contrib/category_views/category_views.module
Retrieves a themed view of the specified category node. This is called directly from category.module.
cck_gallery_preprocess_node in contributions/cck_gallery/cck_gallery.module
custompage_view_tile in contributions/custompage/custompage_util.inc
Render a custompage tile for a view.
custom_pager_build_nav in contributions/custom_pagers/custom_pagers.module
date_embed_view in contributions/date/date_api.module
Embed a view using a PHP snippet.
drush_migrate_status in contributions/migrate/migrate.drush.inc
A simplified version of the Process (dashboard) page
flag_update_6003 in contributions/flag/flag.install
Remove the previous default views that are no longer bundled with Flag.
hs_taxonomy_views_common_config_form_submit in contributions/hierarchical_select/modules/hs_taxonomy_views.module
Additional submit callback to redirect the user to the "Edit view" form.
hs_taxonomy_views_json in contributions/hierarchical_select/modules/hs_taxonomy_views.module
Menu callback; wrapper around hierarchical_select_json, with support for preloading the view thats is referenced from within the form.
migrate_content_process_import in contributions/migrate/migrate.module
Import objects from the specified content set
migrate_content_set_mappings in contributions/migrate/migrate_pages.inc
Menu callback function for content set edit page.
migrate_save_content_set in contributions/migrate/migrate.module
Save a new or updated content set
migrate_schema_alter in contributions/migrate/migrate.module
Implementation of hook_schema_alter().
mm_views_harvest in contributions/media_mover/contrib/mm_views/mm_views.module
Select files with views
nodecomment_form_alter in contributions/nodecomment/nodecomment.module
Implementation of hook_form_alter().
og_menu_access_picture in contributions/og/modules/og_views/og_views.module
og_views_block_search_form in contributions/og/modules/og_views/og_views.module
og_views_feed in contributions/og/modules/og_views/og_views.module
Menu callback. Render group feed.
og_views_view_group in contributions/og/modules/og_views/og_views.module
Embed the configured group homepage.
signup_node_admin_page in contributions/signup/includes/node_admin.inc
Print the signup administration tab for a single node.
signup_user_list_output in contributions/signup/includes/node_output.inc
Helper function to generate the list of users signed up for a node.
signup_view_user_list_access in contributions/signup/signup.module
Menu access callback for the signup_plugin_access_user_signup_list plugin.
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_bulk_operations_execute in contributions/views_bulk_operations/views_bulk_operations.module
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_content_type in contributions/ctools/views_content/plugins/content_types/views.inc
Return a single content 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_panes_content_type_admin_info in contributions/ctools/views_content/plugins/content_types/views_panes.inc
Returns the administrative title for a type.
views_content_views_panes_content_type_admin_info in contributions/ctools/views_content/plugins/content_types/views_panes.inc
Returns the administrative title for a 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_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_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_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_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_content_views_select_display in contributions/ctools/views_content/plugins/content_types/views.inc
Returns an edit form for a block.
views_deploy in contributions/deploy/modules/views_deploy/views_deploy.module
Implementation of hook_deploy().
views_embed_view in contributions/views/views.module
Embed a view using a PHP snippet.
views_features_export in contributions/features/includes/features.views.inc
Implementation of hook_features_export().
views_features_export_render in contributions/features/includes/features.views.inc
Implementation of hook_features_export_render().
views_features_revert in contributions/features/includes/features.views.inc
Implementation of hook_features_revert().
views_get_view_result in contributions/views/views.module
Get the result of a view. *
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_service_export in contributions/services/services/views_service/views_service.inc
Export a view.
views_service_get in contributions/services/services/views_service/views_service.inc
Get a view from the database.
views_service_get_access in contributions/services/services/views_service/views_service.inc
Check the access permission to a given views.
views_service_import in contributions/services/services/views_service/views_service.inc
Import a view.
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
_advanced_forum_preprocess_forums in contributions/advanced_forum/includes/advanced_forum_preprocess_forums.inc
_calendar_ical_setup_form in contributions/calendar/calendar_ical/calendar_ical_admin.inc
Setup Calendar feeds.
_migrate_dashboard_form in contributions/migrate/migrate_pages.inc
Form definition for dashboard page
_migrate_get_view_count in contributions/migrate/migrate.module
Get the row count for a view, possibly filtered by arguments
_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.
_views_bulk_operations_adjust_selection in contributions/views_bulk_operations/views_bulk_operations.module
_views_content_views_update_conf in contributions/ctools/views_content/plugins/content_types/views.inc
Update the $conf to deal with updates from Drupal 5.
_views_content_views_update_conf in contributions/ctools/views_content/plugins/content_types/views.inc
Update the $conf to deal with updates from Drupal 5.

Code

contributions/views/views.module, line 885

<?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)) {
    $status = variable_get('views_defaults', array());
    if (isset($status[$default_view->name])) {
      $default_view->disabled = $status[$default_view->name];
    }
    $default_view->type = t('Default');
    return $default_view->clone_view();
  }
  elseif (!empty($view) && !empty($default_view)) {
    $view->type = t('Overridden');
  }

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

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.