You are here

public function ViewUI::getDisplayTab in Views (for Drupal 7) 8.3

Returns a renderable array representing the edit page for one display.

2 calls to ViewUI::getDisplayTab()
ViewUI::buildEditForm in views_ui/lib/Drupal/views_ui/ViewUI.php
Form builder callback for editing a View.
ViewUI::rebuildCurrentTab in views_ui/lib/Drupal/views_ui/ViewUI.php
Regenerate the current tab for AJAX updates.

File

views_ui/lib/Drupal/views_ui/ViewUI.php, line 525
Definition of Drupal\views_ui\ViewUI.

Class

ViewUI
Stores UI related temporary settings.

Namespace

Drupal\views_ui

Code

public function getDisplayTab($display_id) {
  $build = array();
  $display = $this->displayHandlers[$display_id];

  // If the plugin doesn't exist, display an error message instead of an edit
  // page.
  if (empty($display)) {
    $title = isset($display['display_title']) ? $display['display_title'] : t('Invalid');

    // @TODO: Improved UX for the case where a plugin is missing.
    $build['#markup'] = t("Error: Display @display refers to a plugin named '@plugin', but that plugin is not available.", array(
      '@display' => $display['id'],
      '@plugin' => $display['display_plugin'],
    ));
  }
  else {
    $build['details'] = $this
      ->getDisplayDetails($display->display);
  }

  // In AJAX context, ViewUI::rebuildCurrentTab() returns this outside of form
  // context, so hook_form_views_ui_edit_form_alter() is insufficient.
  drupal_alter('views_ui_display_tab', $build, $this, $display_id);
  return $build;
}