You are here

function views_ui_get_display_tab in Views (for Drupal 7) 7.3

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

2 calls to views_ui_get_display_tab()
views_ui_edit_form in includes/admin.inc
Form builder callback for editing a View.
views_ui_regenerate_tab in includes/admin.inc
Regenerate the current tab for AJAX updates.

File

includes/admin.inc, line 1583
Provides the Views' administrative interface.

Code

function views_ui_get_display_tab($view, $display_id) {
  $build = array();
  $display = $view->display[$display_id];

  // If the plugin doesn't exist, display an error message instead of an edit
  // page.
  if (empty($display->handler)) {
    $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'] = views_ui_get_display_tab_details($view, $display);
  }

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