You are here

public function FilebrowserManager::createPresentation in Filebrowser 3.x

Same name and namespace in other branches
  1. 8.2 src/FilebrowserManager.php \Drupal\filebrowser\FilebrowserManager::createPresentation()

Parameters

\Drupal\node\NodeInterface $node:

array $display_list:

Return value

null

File

src/FilebrowserManager.php, line 507

Class

FilebrowserManager

Namespace

Drupal\filebrowser

Code

public function createPresentation($node, array $display_list) {
  $view = $node->filebrowser->defaultView;
  $presentation = new Presentation($node, $display_list);
  switch ($view) {
    case 'list-view':
      return $presentation
        ->listView();
    case 'icon-view':
      return $presentation
        ->iconView();
    default:
      return \Drupal::messenger()
        ->addError($this
        ->t('Selected display @display not available ', [
        '@display' => $view,
      ]));
  }
}