public function FilebrowserManager::createPresentation in Filebrowser 8.2
Same name and namespace in other branches
- 3.x 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
Namespace
Drupal\filebrowserCode
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,
]));
}
}