function view::choose_display

cis7 view.inc view::choose_display($displays)
cle7 view.inc view::choose_display($displays)
elmsmedia7 view.inc view::choose_display($displays)
icor7 view.inc view::choose_display($displays)
meedjum_blog7 view.inc view::choose_display($displays)
mooc7 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.

2 calls to view::choose_display()
view::execute_display in sites/all/modules/ulmus/views/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 sites/all/modules/ulmus/views/includes/view.inc
Set the display as current.

File

sites/all/modules/ulmus/views/includes/view.inc, line 489
Provides the view object type and associated methods.

Class

view
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

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';
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.