function views_ui_regenerate_tabs

2.x admin.inc views_ui_regenerate_tabs(&$view, $display_id = NULL, $object = NULL)

Regenerate the tabs for AJAX updates.

3 calls to views_ui_regenerate_tabs()
views_ui_ajax_form in includes/admin.inc
Generic entry point to handle forms.
views_ui_analyze_view in includes/admin.inc
Page callback to display analysis information on a view.
views_ui_edit_details in includes/admin.inc
Page callback to edit details of a view.

File

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

Code

function views_ui_regenerate_tabs(&$view, $display_id = NULL, $object = NULL) {
  if (empty($display_id)) {
    $displays = array_keys($view->display);
  }
  elseif (!is_array($display_id)) {
    $displays = array($display_id);
    if ($display_id != 'default') {
      $displays[] = 'default';
    }
  }
  else {
    $displays = $display_id;
  }

  if (!$view->set_display('default')) {
    views_ajax_render(t('Invalid display id found while regenerating tabs'));
  }

  if (!is_object($object)) {
    $object = new stdClass();
  }

  $object->replace = array();
  foreach ($displays as $id) {
    list($title, $body) = views_ui_display_tab($view, $view->display[$id]);
    $object->replace['#views-tab-' . $id] = $body;
    $object->replace['#views-tab-title-' . $id] = check_plain($title);
  }

  if (!empty($view->changed)) {
    $object->changed = TRUE;
  }

  views_ajax_render($object);
}