You are here

protected function CmisBrowser::setBreadcrumbs in CMIS API 8

Same name and namespace in other branches
  1. 8.2 src/CmisBrowser.php \Drupal\cmis\CmisBrowser::setBreadcrumbs()
  2. 3.0.x src/CmisBrowser.php \Drupal\cmis\CmisBrowser::setBreadcrumbs()

Create breadcrumbs from parent folders.

Parameters

type $folder:

1 call to CmisBrowser::setBreadcrumbs()
CmisBrowser::browse in src/CmisBrowser.php
Browse.

File

src/CmisBrowser.php, line 337

Class

CmisBrowser
Description of CmisBrowser

Namespace

Drupal\cmis

Code

protected function setBreadcrumbs($folder, $class = '') {
  $name = $folder
    ->getName();
  $id = $folder
    ->getId();
  $this
    ->setBreadcrumb($name, $id, $class);
  if ($parent = $folder
    ->getFolderParent()) {
    $this
      ->setBreadcrumbs($parent);
  }
  else {
    $this->breadcrumbs[0]['#wrapper_attributes']['class'] = [
      'first',
    ];
  }
}