1 views_plugin_display_page.inc views_plugin_display_page::execute()

The display page handler returns a normal view, but it also does a backdrop_set_title for the page, and does a views_set_page_view on the view.

Overrides views_plugin_display::execute

File

core/modules/views/plugins/views_plugin_display_page.inc, line 210
Contains the page display plugin.

Class

views_plugin_display_page
The plugin that handles a full page.

Code

function execute() {
  // Let the world know that this is the page view we're using.
  views_set_page_view($this->view);

  // Prior to this being called, the $view should already be set to this
  // display, and arguments should be set on the view.
  $this->view->build();
  if (!empty($this->view->build_info['fail'])) {
    backdrop_not_found();
    exit();
  }

  if (!empty($this->view->build_info['denied'])) {
    backdrop_access_denied();
    exit();
  }

  $this->view->get_breadcrumb(TRUE);


  // And now render the view.
  $render = $this->view->render();

  // First execute the view so it's possible to get tokens for the title.
  // And the title, which is much easier.
  backdrop_set_title(filter_xss_admin($this->view->get_title()), PASS_THROUGH);
  return $render;
}