protected function CmisBrowser::setBreadcrumb in CMIS API 8.2
Same name and namespace in other branches
- 8 src/CmisBrowser.php \Drupal\cmis\CmisBrowser::setBreadcrumb()
- 3.0.x src/CmisBrowser.php \Drupal\cmis\CmisBrowser::setBreadcrumb()
Prepare a breadcrumb url.
Parameters
mixed $label: Breadcrumb label.
string $id: Folder id.
1 call to CmisBrowser::setBreadcrumb()
- CmisBrowser::setBreadcrumbs in src/
CmisBrowser.php - Create breadcrumbs from parent folders.
File
- src/
CmisBrowser.php, line 411
Class
- CmisBrowser
- Description of CmisBrowser.
Namespace
Drupal\cmisCode
protected function setBreadcrumb($label, $id) {
$path = '/cmis/browser/nojs/' . $this->config;
if (!empty($id)) {
$path .= '/' . $id;
}
$url = Url::fromUserInput($path);
$link_options = [
'attributes' => [
'class' => [
'use-ajax',
],
],
];
if ($this->popup) {
$link_options['query'] = [
'type' => 'popup',
];
}
$url
->setOptions($link_options);
$item = Link::fromTextAndUrl($label, $url);
array_unshift($this->breadcrumbs, $item);
}