Same name and namespace in other branches
  1. 6.x-3.x includes/view.inc \view::choose_display()

Get the first display that is accessible to the user.

Parameters

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

2 calls to view::choose_display()
view::execute_display in includes/view.inc
Execute the given display, with the given arguments. To be called externally by whatever mechanism invokes the view, such as a page callback, hook_block, etc.
view::set_display in includes/view.inc
Set the display as current.

File

includes/view.inc, line 527
views_objects Objects that represent a View or part of a view

Class

view

Code

public 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';
}