You are here

protected function DisplayFileList::parentFolder in Filebrowser 3.x

Same name and namespace in other branches
  1. 8.2 src/File/DisplayFileList.php \Drupal\filebrowser\File\DisplayFileList::parentFolder()
1 call to DisplayFileList::parentFolder()
DisplayFileList::createUpDirContent in src/File/DisplayFileList.php

File

src/File/DisplayFileList.php, line 386

Class

DisplayFileList
Class FileDisplayList @package Drupal\filebrowser This class holds the list of files to be displayed on the filebrowser node. These files are retrieved from the filesystem and filtered for user and node access. The array produced by this class…

Namespace

Drupal\filebrowser\File

Code

protected function parentFolder() {
  $array = explode('/', $this->relativePath);
  if (count($array) < 3) {
    return '/';
  }
  else {
    unset($array[count($array) - 1]);
    return $result = implode('/', $array);
  }
}