You are here

public function DisplayFile::createSubdir in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x src/File/DisplayFile.php \Drupal\filebrowser\File\DisplayFile::createSubdir()

@function Creates a .. file for the abstracted file system.

Parameters

string $relative_path:

Return value

object $this

File

src/File/DisplayFile.php, line 140

Class

DisplayFile

Namespace

Drupal\filebrowser\File

Code

public function createSubdir($relative_path) {
  function s3_create_subdir($nid, $fs_root) {
    return [
      'nid' => $nid,
      'display-name' => '..',
      'relative-path' => '/',
      'full-path' => $fs_root,
      'status' => MARK_READ,
      'kind' => 2,
      'mime-type' => 'folder/parent',
      'url' => url('node/' . $nid, [
        'absolute' => TRUE,
      ]),
    ];
  }
  $this->nid = $this->fid = null;
  $this->description = null;
  $this->displayName = '..';
  $this->fsRoot = null;
  $this->relativePath = $relative_path;
  $this->fullPath = $this->fsRoot;

  //todo: mark logic
  $this->status = MARK_READ;
  $this->fileData = new \stdClass();
  $this->fileData->mimetype = 'folder/parent';
  $this->fileData->type = 'directory';
  return $this;
}