You are here

function views_plugin_display_system::execute in Administration Views 6

Same name and namespace in other branches
  1. 7 plugins/views_plugin_display_system.inc \views_plugin_display_system::execute()

Build and render the page view.

Since we replace an existing page, we need to invoke views_set_page_view(). Also set the page title, because original page callbacks might do this.

File

plugins/views_plugin_display_system.inc, line 113
System display plugin.

Class

views_plugin_display_system
Plugin to handle replacement of existing system paths.

Code

function execute() {
  views_set_page_view($this);

  // 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'])) {
    return drupal_not_found();
  }

  // @todo Needed?
  $this->view
    ->get_breadcrumb(TRUE);
  drupal_set_title(filter_xss_admin($this->view
    ->get_title()));

  // @todo This is super-likely the totally wrong place to add our CSS; better
  //   suggestions and patches welcome.
  drupal_add_css(drupal_get_path('module', 'admin_views') . '/admin_views.css');
  return $this->view
    ->render();
}