You are here

protected function ImceFM::init in IMCE 8.2

Same name and namespace in other branches
  1. 8 src/ImceFM.php \Drupal\imce\ImceFM::init()

Initializes the file manager.

Initializes the file manager by validating the current configuration and request.

1 call to ImceFM::init()
ImceFM::__construct in src/ImceFM.php
Constructs the file manager.

File

src/ImceFM.php, line 114

Class

ImceFM
Imce File Manager.

Namespace

Drupal\imce

Code

protected function init() {
  if (!isset($this->validated)) {

    // Create the root.
    $root = $this
      ->createItem('folder', '.');
    $root
      ->setPath('.');

    // Check initialization error.
    if ($error = $this
      ->getInitError()) {
      $this
        ->setMessage($error);
    }
    else {
      $this
        ->initSelection();
    }
    $this->validated = $error === FALSE;
  }
}