views_ui_regenerate_tabs

Versions
6
views_ui_regenerate_tabs(&$view, $display_id = NULL, $object = NULL)
7
views_ui_regenerate_tabs(&$view, &$output, $display_id = NULL)

Regenerate the tabs for AJAX updates.

▾ 3 functions call views_ui_regenerate_tabs()

views_ui_ajax_form in contributions/views/includes/admin.inc
Generic entry point to handle forms.
views_ui_analyze_view in contributions/views/includes/admin.inc
Page callback to display analysis information on a view.
views_ui_edit_details in contributions/views/includes/admin.inc
Page callback to edit details of a view.

Code

contributions/views/includes/admin.inc, line 1309

<?php
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);
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.