You are here

private function CmisBrowser::init in CMIS API 8

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

Init variables.

Parameters

string $config:

string $folder_id:

3 calls to CmisBrowser::init()
CmisBrowser::ajaxCall in src/CmisBrowser.php
Call from ajaxify url.
CmisBrowser::getDocument in src/CmisBrowser.php
Get document by id.
CmisBrowser::__construct in src/CmisBrowser.php
Constructing the object.

File

src/CmisBrowser.php, line 176

Class

CmisBrowser
Description of CmisBrowser

Namespace

Drupal\cmis

Code

private function init($config, $folder_id) {
  $this->config = $config;
  $this->folder_id = $folder_id;
  $this->connection = new CmisConnectionApi($this->config);

  //$cacheable = $this->connection->getConfig()->getCmisCacheable();

  // TODO: find out the best cache options.

  //$cache_parameters = [

  //  'contexts' => ['user'],
  //  'max-age' => $cacheable ? 300 : 0,

  //];

  //$this->cacheable = $cache_parameters;
  if (!empty($this->connection
    ->getHttpInvoker())) {
    $popup = \Drupal::request()->query
      ->get('type');
    $this->popup = $popup == 'popup';
    $this->connection
      ->setDefaultParameters();
    if (empty($this->folder_id)) {
      $root_folder = $this->connection
        ->getRootFolder();
      $this->folder_id = $root_folder
        ->getId();
      $this->current = $root_folder;
    }
    else {
      $this->current = $this->connection
        ->getObjectById($this->folder_id);
    }
  }
}