1 view.inc view::choose_display($displays)

Get the first display that is accessible to the user.

Parameters

$displays: Either a single display id or an array of display ids.

File

core/modules/views/includes/view.inc, line 525
Provides the view object type and associated methods.

Class

view

Code

function choose_display($displays) {
  if (!is_array($displays)) {
    return $displays;
  }

  $this->init_display();

  foreach ($displays as $display_id) {
    if ($this->display[$display_id]->handler->access()) {
      return $display_id;
    }
  }

  return 'default';
}